text
stringlengths
28
935k
meta
stringlengths
137
139
red_pajama_subset
stringclasses
1 value
\section{Introduction} Learning is the key to achieving coordination with others in multiagent environments \cite{stone2000multiagent}. Over the last couple of decades, a large body of multiagent learning techniques have been proposed that aim to coordinate on various solutions (e.g., Nash equilibrium) in different settings, e.g., minimax Q-learning \cite{littman1994markov}, Nash Q-learning \cite{hu2003nash}, and Conditional-JAL \cite{banerjee2007reaching}, to name just a few. One commonly investigated class of games is the Prisoner's Dilemma (PD), in which an Nash equilibrium solution is not a desirable learning target. Until now, a large body of work \cite{axelrod1984evolution,nowak1993strategy,banerjee2007reaching,crandall2005learning,damer2008achieving,hao2015introducing,mathieu2015new} has been devoted to incentivize rational agents towards mutual cooperation in repeated matrix PD games. \begin{comment} One of the earliest strategies in this direction is Tit-for-Tat \cite{axelrod1984evolution} or variants such as win-stay lose-shift \cite{nowak1993strategy}. Later, various multiagent learning strategies have been proposed in the last decade. For example, Banerjee and Sen \shortcite{banerjee2007reaching} propose a conditional joint action leaner to allow agents to discover non-NE outcomes that are beneficial for both players and provide agents with incentives to make these outcomes stable. There also exist works \cite{crandall2005learning,hao2015introducing} that integrate a ``teacher and follower'' mechanism into strategy design to: 1) teach opponents to behave cooperatively and punish them otherwise and 2) use a follower strategy to avoid being exploited by the opponent in case the teaching has no influence on the opponent's behavior. For scenarios when the game changes frequently, Damer and Gini \shortcite{damer2008achieving} investigate how to achieve cooperation by estimating the opponent's cooperative attitude using a particle filter and reciprocate accordingly. \end{comment} However, all the above works focus on the classic repeated PD games, which ignores several key aspects of real world prisoner's dilemma scenarios. \begin{comment} In repeated matrix PD games, the moves are atomic actions and can be easily labeled as cooperative or uncooperative or learned from the payoffs \cite{busoniu2008comprehensive}. In contrast, in real world PD games cooperation/defection behaviors are temporally extended and the payoff signals are usually delayed (available after a number of steps of interactions). Crandall \cite{crandall2012just} proposes the Pepper framework for repeated stochastic PD games (e.g., two-player gate entering problem) which allows extending strategies originally proposed for repeated matrix games. Later Elidrisi et al. \cite{elidrisi2014fast} extend Pepper by introducing the meta game abstraction model to reduce a stochastic game representation to a matrix game. Their approach is shown to accelerate the multiagent learning speed in stochastic games with a large state space. Hernandez-Leal and Kaisers \cite{Hernandez2017Towards} combine two established frameworks Pepper and Bayesian policy reuse to enable the agent to quickly select the appropriate policy against its switching opponents. However, the above approaches rely on hand-crafted state inputs and tabular Q-learning techniques to learn optimal control policies. They cannot be directly applied to more realistic environments whose states are too large and complex to be analyzed beforehand. \end{comment} \begin{comment} In repeated PD games, the moves are atomic actions and can be easily labeled as cooperative or uncooperative or learned from the payoffs \cite{busoniu2008comprehensive}. In contrast, in real world PD scenarios, cooperation/defection behaviors are temporally extended and the payoff signals are usually delayed (available after a number of steps of interactions). Crandall \shortcite{crandall2012just} proposes the Pepper framework for repeated stochastic PD games (e.g., two-player gate entering problem) which allows extending strategies originally proposed for classic repeated matrix games. Later Elidrisi et al. \cite{elidrisi2014fast} extend Pepper using the meta game abstraction model to accelerate the learning speed in stochastic games with a large state space. Hernandez-Leal and Kaisers \cite{Hernandez2017Towards} combine Pepper and Bayesian policy reuse for the agent to play against its switching opponents. However, the above approaches rely on hand-crafted state inputs and tabular Q-learning techniques to learn optimal control policies. They cannot be directly applied to more realistic environments whose states are too large and complex to be analyzed beforehand. \end{comment} In repeated PD games, the moves are atomic actions and can be easily labeled as cooperative or uncooperative or learned from the payoffs \cite{busoniu2008comprehensive}. In contrast, in real world PD scenarios, cooperation/defection behaviors are temporally extended and the payoff signals are usually delayed (available after a number of steps of interactions). Crandall \shortcite{crandall2012just} proposes the Pepper framework for repeated stochastic PD games (e.g., two-player gate entering problem), which can extend strategies originally proposed for classic repeated matrix games. Later some techniques extend Pepper in different scenarios, e.g., stochastic games with a large state space under tabular based framework \cite{elidrisi2014fast} and playing against the switching opponents \cite{Hernandez2017Towards}. However, these approaches rely on hand-crafted state inputs and tabular Q-learning techniques to learn optimal policies. Thus, they cannot be directly applied to more realistic environments whose states are too large and complex to be analyzed beforehand. Leibo et al.~\shortcite{leibo2017multi} introduce a 2D Fruit Gathering game to better capture the real world social dilemma characteristics, while also maintaining the characteristics of classical iterated PD games. In this game, at each time step, an agent selects its action based on its image observation and cannot directly observe the actions of the opponent. Different policies represent different levels of cooperativeness, which is a graded quantity. They investigate the cooperation/defection emergence problem by leveraging the power of deep reinforcement learning \cite{mnih2013playing,mnih2015human} from the descriptive point of view: how do multiple selfish independent agents' behaviors evolve when agents update their policy using deep Q-learning? In contrast, this paper takes a prescriptive and non-cooperative perspective and considers the following question: {\it how should an agent learn effectively in real world social dilemma environments when it is faced with different opponents?} \begin{comment} To this end, this paper proposes a multiagent deep reinforcement learning approach for mutual cooperation in SPD games. Our approach consists of two phases: offline and online phases. The offline phase generates policies with varying cooperation degrees and trains a cooperation degree detection network. To generate policies, we first train baseline cooperation and defection policies using Actor Critic and then synthesize the full range of policies from these baseline policies. The cooperation degree detection network is implemented as an LSTM-based structure with an encoder-decoder module, trained offline. The online phase extends the Tit-for-Tat principle into sequential prisoner's dilemma scenarios. Our strategy adaptively selects its policy with the proper cooperation degree from a continuous range of candidates based on the detected cooperation degree of an opponent. Intuitively, on one hand, our overall algorithm is cooperation-oriented and seeks for mutual cooperation whenever possible; on the other hand, our algorithm is also robust against selfish exploitation and resorts to a defection strategy to avoid being exploited whenever necessary. We evaluate the performance of our deep multiagent reinforcement approach using two 2D SPD games (the Fruit Gathering and Apple-Pear games). \end{comment} To this end, in the paper, we first formally introduce the general notion of sequential prisoner's dilemma (SPD) to model real world PD problems. We propose a multiagent deep reinforcement learning approach for mutual cooperation in SPD games. Our approach consists of two phases: offline and online phases. The offline phase generates policies with varying cooperation degrees and trains a cooperation degree detection network. To generate policies, we propose using the weighted target reward and two schemes, IAC and JAC, to train the baseline policies with varying cooperation degrees. Then we propose using the policy generation approach to synthesize the full range of policies from these baseline policies. Lastly, we propose a cooperation degree detection network implemented as an LSTM-based structure with an encoder-decoder module and generate a training dataset. The online phase extends the Tit-for-Tat principle into sequential prisoner's dilemma scenarios. Our strategy adaptively selects its policy with the proper cooperation degree from a continuous range of candidates based on the detected cooperation degree of an opponent. Intuitively, on one hand, our overall algorithm is cooperation-oriented and seeks for mutual cooperation whenever possible; on the other hand, our algorithm is also robust against selfish exploitation and resorts to a defection strategy to avoid being exploited whenever necessary. We evaluate the performance of our deep multiagent reinforcement approach using two 2D SPD games (the Fruit Gathering and Apple-Pear games). Our experiments show that our agent can efficiently achieve mutual cooperation under self-play and also perform well against opponents with changing stationary policies. \begin{comment} The remainder of this paper is organized as follows. Section 2 presents the background related to SPD. Section 3 formally introduces our approach approach and proposed approach. Section 4 describes the simulation setup and discusses the simulation results. Finally, Section 5 summarizes the paper and points out future work. \end{comment} \section{Background} \subsection{Matrix Games and the Prisoner's Dilemma} \begin{comment} A matrix game can be represented as a tuple $ \langle N, \{A_i\}_{i \in N},\{R_i\}_{i \in N} \rangle$, where $N$ is the set of agents, $A_i$ is the set of actions available to agent $i$ with $\mathcal{A}$ being the joint action space $A_1 \times \ldots \times A_n$, and $R_i$ is the reward function for agent $i$. One representative class of matrix games is the prisoner's dilemma game, as shown in Table 1. In this game, each agent has two actions: cooperate (C) and defect (D), and is faced with four possible rewards: $R$ (reward of mutual cooperation), $P$ (punishment of mutual defection), $S$ (sucker outcome obtained by by cooperating against a defector), $T$ (temptation outcome received by defecting against a cooperator). The four payoffs satisfy the following four inequalities under a prisoner's dilemma game: \begin{itemize} \item $R > P$: mutual cooperation is preferred to mutual defection. \item $R > S$: mutual cooperation is preferred to being exploited by a defector. \item $2R > S + T$: mutual cooperation is preferred to an equal probability of unilateral cooperation and defection. \item $T > R$: exploiting a cooperator is preferred over mutual cooperation. \item $P > S$: mutual defection is preferred over being exploited. \end{itemize} \end{comment} A matrix game can be represented as a tuple $ \langle N, \{A_i\}_{i \in N},\{R_i\}_{i \in N} \rangle$, where $N$ is the set of agents, $A_i$ is the set of actions available to agent $i$ with $\mathcal{A}$ being the joint action space $A_1 \times \ldots \times A_n$, and $R_i$ is the reward function for agent $i$. One representative class of matrix games is the prisoner's dilemma game, as shown in Table 1. In this game, each agent has two actions: cooperate (C) and defect (D), and is faced with four possible rewards: $R$, $P$, $S$, and $T$. The four payoffs satisfy the following four inequalities under a prisoner's dilemma game: \begin{itemize} \item $R > P$: mutual cooperation is preferred to mutual defection. \item $R > S$: mutual cooperation is preferred to being exploited by a defector. \item $2R > S + T$: mutual cooperation is preferred to an equal probability of unilateral cooperation and defection. \item $T > R$: exploiting a cooperator is preferred over mutual cooperation. \item $P > S$: mutual defection is preferred over being exploited. \end{itemize} \subsection{Markov Game} Markov games combine matrix games and Markov Decision Processes and can be considered as an extension of Matrix games to multiple states. A Markov game $\mathcal{M}$ is defined by a tuple $\langle N, S,\{A_i\}_{i \in N},\{R_i\}_{i \in N}, \mathcal{T} \rangle$, where $S$ is the set of states and $N$ is the number of agents, $\{A_i\}_{i\in N}$ is the collection of action sets, with $A_i$ being the action set of agent $i$, and $\{R_i\}_{i\in N}$ is the set of reward functions, $R_i: S \times A_1 \times \ldots \times A_n \rightarrow \mathcal{R}$ is the reward function for agent $i$. $\mathcal{T}$ is the state transition function: $S \times A_1 \times \ldots \times A_n \rightarrow \Delta (S)$, where $\Delta (S)$ denotes the set of discrete probability distributions over $S$. Matrix games are the special case of Markov games when $|S| = 1$. \begin{table} \centering \caption{Prisoner's Dilemma} \begin{tabular}{|c|c|c|} \hline \ & C & D \\ \hline C & R, R & S, T \\ \hline D & T, S & P, P \\ \hline \end{tabular} \vspace{-10pt} \end{table} \begin{comment} Matrix games like the prisoner's dilemma only distinguish two atomic actions: cooperate and defect, which ignores several aspects of real-world social dilemmas. First, PD scenarios are usually temporally extended and each cooperate or defect strategy may correspond to a sequence of actions. Second, the concept of cooperation (or defection) may be a graded quantity and a policy can be partially cooperative. To this end, we introduce a Sequential Prisoner's Dilemma (SPD) to better capture the aforementioned characteristics. \end{comment} Next we formally introduce SPD by extending the classic iterated PD game to multiple states. \subsection{Definition of Sequential Prisoner's Dilemma} A two-player SPD is a tuple $\langle \mathcal{M}, \Pi \rangle$, where $\mathcal{M}$ is a 2-player Markov game with state space $S$. $\Pi$ is the set of policies with varying cooperation degrees. The empirical payoff matrix $(R(s), P(s), S(s), T(s))$ can be induced by policies $(\pi^C, \pi^D \in \Pi)$, where $\pi^C$ is more cooperative than $\pi^D$. Given two policies, $\pi^C$ and $\pi^D$, the corresponding empirical payoffs $(R, P, S, T)$ under any starting state s with respect to the payoff matrix in Section 2.1 can be defined as $(R(s), P(s), S(s), T(s))$ through their long-term expected payoff, where \begin{eqnarray} R(s) := V_1^{\pi^C, \pi^C} (s) & = V_2^{\pi^C, \pi^C}(s), \\ P(s) := V_1^{\pi^D, \pi^D} (s) & = V_2^{\pi^D, \pi^D}(s), \\ S(s) := V_1^{\pi^C, \pi^D} (s) & = V_2^{\pi^D, \pi^C}(s), \\ T(s) := V_1^{\pi^D, \pi^C} (s) & = V_2^{\pi^C, \pi^D}(s), \end{eqnarray} We can define the long-term payoff $V_i^{\vec \pi}(s)$ for agent $i$ when the joint policy $\vec \pi = (\pi_1, \pi_2)$ is followed starting from $s$. \begin{eqnarray} V_i^{\vec \pi}(s) = E_{\vec a_t \sim \vec \pi(s_t),s_{t+1} \sim \mathcal{T}(s_t,\vec a_t)}[\sum_{t=0}^{\infty} \gamma^t r_i(s_t,\vec a_t)] \end{eqnarray} A Markov game is an SPD when there exists a state $s \in S$ for which the induced empirical payoff matrix satisfies the five inequalities in Section 2.1. Since SPD is more complex than PD, the existing approaches addressing learning in matrix PD games cannot be directly applied in SPD. \subsection{Deep Reinforcement Learning} \begin{comment} \textbf{Q-Learning and Deep Q-Networks}: Q-learning and Deep Q-Networks (DQN) \cite{mnih2013playing, mnih2015human} are popular value-based reinforcement learning approaches to learn optimal policies in Markov environments. Q-learning makes use of an action-value function for policy $\pi$ as $Q^{\pi}(s,a)=E_{s'}[r(s,a)+\gamma E_{a' \sim \pi}[Q^{\pi}(s',a')]]$. DQN uses a deep convolutional neural network to estimate Q-values and the optimal Q-values are learned by minimizing the following loss function: \begin{eqnarray} y = r + \gamma max_{a'}\bar{Q}(s',a'), \\ L(\theta) = E_{s,a,r,s'}[(Q(s,a|\theta)-y)^2] \end{eqnarray} where $\bar{Q}$ is a target $Q$ network whose parameters are periodically updated with the most recent $\theta$. \textbf{Policy Gradient and Actor-Critic Algorithms}: Policy Gradient methods are also popular for a variety of RL tasks. Their objective is to maximize $J(\theta)=E_{s \sim p^{\pi},a \sim \pi_{\theta}}[R]$ by taking steps in the direction of $\bigtriangledown _{\theta}J(\theta)$, where \begin{eqnarray} \bigtriangledown _{\theta}J(\theta) = E_{s \sim p^{\pi},a \sim \pi_{\theta}}[\bigtriangledown_{\theta}log\pi_{\theta}(a|s)Q^{\pi}(s,a)] \end{eqnarray} where $p^{\pi}$ is the state transition distribution. In practical algorithms, the value of $Q^{\pi}$ can be estimated in different ways. For example, one can simply use sample return $\sum_{i=t}^T \gamma^{i-t}r_i$ over a sample trajectory to obtain the REINFORCE algorithm \cite{williams1992simple}. Alternatively, one learns an approximation of the true action-value function using temporal-difference learning techniques. In this case, $Q^{\pi}(s,a)$ serves as a critic to guide the updating direction of $\pi_{\theta}$, which leads to a class of actor-critic algorithms \cite{schulman2015high,wang2016sample}. \end{comment} \textbf{Q-Learning and Deep Q-Networks}: Q-learning and Deep Q-Networks (DQN) \cite{mnih2013playing,mnih2015human} are value-based reinforcement learning approaches to learn optimal policies in Markov environments. Q-learning makes use of an action-value function for policy $\pi$ as $Q^{\pi}(s,a)=E_{s'}[r(s,a)+\gamma E_{a' \sim \pi}[Q^{\pi}(s',a')]]$. DQN uses a deep convolutional neural network to estimate Q-values and the optimal Q-values are learned by minimizing the following loss function: \begin{eqnarray} y = r + \gamma max_{a'}\bar{Q}(s',a'), \\ L(\theta) = E_{s,a,r,s'}[(Q(s,a|\theta)-y)^2] \end{eqnarray} where $\bar{Q}$ is a target $Q$ network whose parameters are periodically updated with the most recent $\theta$. \textbf{Policy Gradient and Actor-Critic Algorithms}: Policy Gradient methods are for a variety of RL tasks \cite{williams1992simple,sutton2000policy}. Their objective is to maximize $J(\theta)=E_{s \sim p^{\pi},a \sim \pi_{\theta}}[R]$ by taking steps in the direction of $\bigtriangledown _{\theta}J(\theta)$, where \begin{eqnarray} \bigtriangledown _{\theta}J(\theta) = E_{s \sim p^{\pi},a \sim \pi_{\theta}}[\bigtriangledown_{\theta}log\pi_{\theta}(a|s)Q^{\pi}(s,a)] \end{eqnarray} where $p^{\pi}$ is the state transition distribution. Practically, the value of $Q^{\pi}$ can be estimated in different ways. For example, $Q^{\pi}(s,a)$ serves as a critic to guide the updating direction of $\pi_{\theta}$, which leads to a class of actor-critic algorithms \cite{schulman2015high,wang2016sample}. \section{Deep RL: Towards Mutual Cooperation} Algorithm 1 describes our deep multiagent reinforcement learning approach, which consists of two phases, as discussed Section 1. In the offline phase, we first seek to generate policies with varying cooperation degrees. Since the number of policies with different cooperation degrees is infinite, it is computationally infeasible to train all the policies from scratch. To address this issue, we first train representative policies using Actor-Critic until convergence (i.e., cooperation and defection baseline policies) (Lines \ref{alline3}-\ref{alline5}) detailed in Section 3.1; second, we synthesize the full range of policies (Lines \ref{alline6}-\ref{alline7}) from the above baseline policies, which will be detailed in Section 3.2. Another task is to how to effectively detect the cooperation degree of the opponent. We divide this task into two steps: we first train an LSTM-based cooperation degree detection network offline (Lines \ref{alline8}-\ref{alline10}), which will be then used for real-time detection during the online phase, detailed in Section 3.3. In the online phase, our agent plays against any opponent by reciprocating with a policy of a slightly higher cooperation degree than that of the opponent we detect (Lines \ref{alline11}-\ref{alline18}), detailed in Section 3.4. \begin{comment} The high-level idea of our online learning strategy can be understood as an extension of Tit-for-Tat principle into sequential prisoner's dilemma scenarios. Our strategy adaptively selects its policy with proper cooperation degree from a continuous range of candidates based on the detected cooperation degree of an opponent. \end{comment} Intuitively, on one hand, our algorithm is cooperation-oriented and seeks for mutual cooperation whenever possible; on the other hand, our algorithm is also robust against selfish exploitation and resorts to defection strategy to avoid being exploited whenever necessary. \begin{algorithm}[tp] \caption{The Approach of Deep Multiagent Reinforcement Learning Towards Mutual Cooperation} \begin{algorithmic}[1] \STATE \emph{//offline training} \STATE initialize the size $N_{t}$ of training policy set, the size $N_{g}$ of generation policy set, the number $N_{d}$ of training data set, the episode number $N_e$ and the step number $N_r$ of each episode \FOR {training policy set index t = 1 to $N_{t}$} \label{alline3} \STATE set agents' attitudes \STATE train agents' policy set $P_{t}$ using weighted target reward\label{alline5} \ENDFOR \FOR {generation policy set index g = 1 to $N_{g}$} \label{alline6} \STATE use policy set $\{P_{t}\}_{t \in N_t}$ to generate policy set $P_{g}$ \label{alline7} \ENDFOR \FOR {training data set index d = 1 to $N_{d}$ } \label{alline8} \STATE generate training data set $D_{d}$ as $\{P_{t}\}_{t \in N_t} \cup \{P_{g}\}_{g \in N_g}$ \ENDFOR \STATE use data set $\{D_{d}\}_{d \in N_d}$ to train cooperation degree detection network \label{alline10} \STATE \emph{//adjust the policy online} \STATE initialize $agent_1's$ cooperation degree \label{alline11} \FOR {episode index e = 1 to $N_e$} \label{alline13} \FOR {step index r = 1 to $N_r$} \STATE $agent_1$ and $agent_2$ take actions and get rewards \STATE $agent_1$ uses $n$-state trajectory $\langle s_{r-n+1}, \ldots, s_r \rangle$ to detect the cooperation degree $cd_2^r$ of $agent_2$ \STATE $agent_1$ updates $cd_1^r$ incrementally based on $cd_2^r$ \STATE $agent_1$ synthesizes a policy with $cd_1^r$ using policy generation \label{alline18} \ENDFOR \ENDFOR \end{algorithmic} \end{algorithm} \subsection{Train Baseline Policies with Different Cooperation Degrees} One way of generating policies with different cooperation degrees is by directly changing the key parameters of the environments. For example, Leibo et al.~\cite{leibo2017multi} investigate the influence of the resource abundance degree on the learned policy's cooperation tendency in sequential social dilemma games where agents compete for limited resources. It is found that when both agents employ deep Q-learning algorithms, more cooperative behaviors can be learned when resources are plentiful and vice versa. We may leverage similar ideas of modifying game settings to generate policies with different cooperation degrees. However, this type of approach requires a perfect understanding of the environment as a prior, and also may not be practically feasible when on cannot modify the underlying game engine. Another more generalized way of generating policies with different cooperation degrees is to modify agents' reward signals during learning. Intuitively agents with the reward of the sum of all agents' immediate rewards would learn towards cooperation policies to maximize the expected accumulated social welfare eventually, and agents maximizing only their own reward would learn more selfish (defecting) policies. Formally, for a two-player environment (agent $i$ and $j$), agent $i$ computes a weighted target reward $r_i'$ as follows: \begin{eqnarray} r_i' = r_i + att_{ij} \times r_j \end{eqnarray} where $att_{ij} \in [0,1]$ is agent $i$'s attitude towards agent $j$, which reflects the relative importance of agent $j$ in agent $i's$ perceived reward. By setting the values of $att_{ij}$ and $att_{ji}$ to 0, agents would update their strategies in the direction of maximizing their own accumulated discounted rewards. By setting the values of $att_{ij}$ and $att_{ji}$ to 1, agents would update their strategies in the direction of maximizing the overall accumulated discounted reward. The greater the value of agent one's attitude towards agent two is, the higher the cooperation degree of agent one's learned policy would be. \begin{figure}[t] \centering \includegraphics[height=1.5in,width=3.5in,angle=0]{detect.pdf} \caption{ Cooperation Degree Detection Network } \label{detectionnetwork} \end{figure} Given the modified reward signal for each agent, the next question is how agents should learn to effectively converge to the expected behaviors. One natural way is to resort to the the independent Actor-Critic (IAC) or some other independent deep reinforcement learning, i.e., equipping each agent with an individual deep Q-learning algorithm (IDQL) with the modified reward. However, the key element to the success of DQL, experience replay memory, might prohibit effective learning in deep multiagent Q-learning environments \cite{foerster2017stabilising,sunehag2017value}. The nonstationarity introduced by the coexistence of multiple IACs means that data in the replay memory may no longer reflect the current dynamics in which the agent is learning. Thus IACs may frequently get confused by obsolete experience and impede the learning process. A number of methods have been proposed to remedy this issue \cite{foerster2017stabilising,lowe2017multi,foerster2017counterfactual} and we omit the details which are out of the scope of this paper. Since the baseline policy training step is performed offline, another way of improving training is to use the joint Actor-Critic (JAC) by treating both agents as a single learner during training. Note that we use JAC only for the purpose of training baseline policies offline, and we do not require that we can control the policies that an opponent may use online. In JAC, both agents share the same underlying network that learns the optimal policy over the joint action space using a single reward signal. In this way, the aforementioned nonstationarity problem can be avoided. Besides, compared with IAC, the training efficiency can be improved significantly since the network parameters are shared across agents in JAC. In JAC, the weighted target reward is defined as follows: \begin{eqnarray} \label{attequation} r_{ { \emph{total} } } = \sum_{i \in N} att_{i} \times r_i \end{eqnarray} where $att_i\in [0,1]$ represents the relative importance of agent $i$ on the overall reward. The smaller the value of $att_i$, the higher the cooperation degree of agent $i$'s learned policy and vice versa. Given the learned joint policy $\pi^{joint}(a_1,a_2|s,att_1,att_2)$, agent $i$ can easily obtain its individual policy $\pi_i$ as follows: \begin{eqnarray} \pi_i = \sum_{a_j,~j \neq i}\pi^{{\emph{joint}}}(a_1,a_2|s,att_1,att_2) \end{eqnarray} As we mentioned previously, it is computationally prohibitive to train a large number of policies with different cooperation degrees due to the high training cost of deep Q-learning, and because the policy space is infinite. To alleviate this issue, here we propose that only two policies, cooperation policy $\pi_c$ and defection policy $\pi_d$, need to be trained. Other policies with cooperation degree between the baselines can be synthesized efficiently, which will be introduced in Section \ref{policygeneration}. \begin{figure}[t] \includegraphics[height=2.0in,width=3.5in,angle=0]{final.pdf} \caption{ The Structure of Deep Reinforcement Learning Approach Towards Mutual Cooperation } \label{deepStructure} \end{figure} \subsection{Policy Generation} \label{policygeneration} Given the baseline policies $\pi_i^c$ and $\pi_i^d$, we synthesize multiple policies. Each continuous weighting factor $w_c\in [0,1]$ corresponds to a new policy $\pi_i^{w_c}$ defined as follows: \begin{eqnarray} \label{policygenerationequation} \pi_i^{w_c} = w_c \times \pi_i^c + (1 - w_c) \times \pi_i^d \end{eqnarray} The weighting factor $w_c$ is defined as policy $\pi_i^{w_c}$'s cooperation degree. Specially, the linear combination of two policies has two advantages --- it 1) generates policies with varying cooperation degrees and 2) ensures low computational cost. Any synthesized policy $\pi_i^{w_c}$ should be more cooperative than $\pi_i^d$ and more defecting than $\pi_i^c$. The higher the value of $w_c$ is, the more cooperative the corresponding policy $\pi_i^{w_c}$ is. It is important to mention that the cooperation degrees of synthesized policies are ordinal, i.e., the cooperation degree of policies only reflect their relative cooperation ranking. For example, considering two synthesized policies $\pi_i^{0.6}$ and $\pi_i^{0.3}$, it only implies that policy $\pi_i^{0.6}$ is more cooperative than policy $\pi_i^{0.3}$. However, we cannot say that $\pi_i^{0.6}$ is twice as cooperative as $\pi_i^{0.3}$. Our way of synthesizing new policies can be understood as synthesizing policies over expert policies \cite{he2016opponent}. The previous work applies a similar idea to generate policies to better respond with different opponents in competitive environments, however, our goal here is to synthesize policies with varying cooperation degrees in sequential Prisoner's dilemmas. \subsection{Opponent Cooperation Degree Detection} \begin{figure}[t] \includegraphics[height=0.9in,width=1.8in,angle=0]{gathering.pdf} \includegraphics[height=0.9in,angle=0]{apple-pear.pdf} \caption{The Fruit Gathering game (left) and the Apple-Pear game. } \label{game} \end{figure} \begin{comment} Traditional repeated PD game settings usually assume that the opponent's action can be directly observed, and thus we can directly estimate the opponent's cooperation degree since the action is atomic (either cooperation or defection) \cite{leibo2017multi}. Even for cases where the opponent's action cannot be directly observed, we can still detect the opponent's cooperation degree from rewards using techniques such as a partial filter \cite{damer2008achieving}. Later Hernandez-Leal et al. \cite{hernandez2016bayesian,Hernandez2016Identifying} use a Bayesian approach to detect the opponent's strategy and adjust agents' strategies, which can only be used in single-state repeated PD games. However, in SPD, we are facing a more challenging cooperation degree detection problem, in which the cooperation behaviors are temporally extended. We need a way of understanding the underlying cooperation (or defection) intention of the opponents from the observed sequence of moves. \end{comment} \begin{comment} Traditional repeated PD game settings assume that we can directly observe the opponent's action and then estimate its cooperation degree since the action is atomic \cite{leibo2017multi}. Later Damer and Gini \shortcite{damer2008achieving} use a partial filter to solve the cases where the opponent's action cannot be directly observed. Hernandez-Leal et al. \shortcite{hernandez2016bayesian,Hernandez2016Identifying} use a Bayesian approach to detect the opponent's strategy in single-state repeated PD games. However, in SPD, we are facing a more challenging cooperation degree detection problem, in which the cooperation behaviors are temporally extended. We need a way of understanding the underlying cooperation (or defection) intention of the opponents from the observed sequence of moves. \end{comment} In classical iterated PD games, a number of techniques have been proposed to estimate the opponent's cooperation degree, e.g., counting the cooperation frequency when action can be observed; using a partial filter or a Bayesian approach otherwise \cite{damer2008achieving,hernandez2016bayesian,Hernandez2016Identifying,leibo2017multi}. However, in SPD, the actions are temporally extended, and the opponent's information (actions and rewads) cannot be observed directly. Thus the previous works cannot be directly applied. We need a way of accurately predicting the cooperation degree of the opponents from the observed sequence of moves in a qualitative manner. In SPD, given the sequential observations (time-series data), we propose an LSTM-based cooperation degree detection network. In previous sections, we have introduced a way of synthesizing policies of any cooperation degree, thus we can easily prepare a large dataset of agents' behaviors with varying cooperation degrees. Based on this, we can transform the cooperation degree detection problem into a supervised learning problem: given a sequence of moves of an opponent, our task is to detect the cooperation degree (label) of this opponent. We propose a recurrent neural network, which combines an autoencoder and a recurrent classifier, as shown in Figure~\ref{detectionnetwork}. Combing an autoencoder with a recurrent classifier brings two major benefits here. First, the classifier and autoencoder share underlying layer parameters of the neural network. This ensures that the classification task is based on the effective feature extraction of the observed moves, which improves the classification detection accuracy. Second, concurrent training of the autoencoder also helps to accelerate the training speed of the classifier and reduces fluctuation during training. The network is trained on experiences collected by agents. Both agents $i$ and $j$ interact with the environment starting with initialized policies $\pi_i$ and $\pi_j$, yielding a training set $D$: \begin{figure}[tp] \centering \subfigure { \includegraphics[height=1.3in,width=1.7in,angle=0]{joint-train-agent1-reward.png} \includegraphics[height=1.3in,width=1.7in,angle=0]{joint-train-agent2-reward.png} } \caption{ Agents' average rewards under policies trained with different cooperation attitudes. } \label{baseline} \end{figure} \begin{equation} \begin{split} D = \{(X, label) | X = env(\pi_i,\pi_j),\\ \pi_i \in \{\pi_i^c, \pi_i^d\},\pi_j \in \Pi_j,\\ \mbox{if} \ \pi_i = \pi_i^c, \ label = 1 \ \mbox{else} \ 0 \}_{i \in N} \end{split} \end{equation} where $\pi_i^c$ and $\pi_i^d$ are baseline policies for agent $i$. $\Pi_j$ is the learned policy set of its opponent $j$. $label$ is the relative cooperation degree of policy $\pi_i$, and $X$ is the set of trajectories under the joint policy $(\pi_i,\pi_j)$. For each trajectory $x = \langle s_1,s_2,\ldots,s_d \rangle \in X$, its label is the cooperation degree of agent $i$'s policy. The network is trained to minimize the following weighted cross entropy loss function as follows: \begin{eqnarray} \label{cd} \begin{split} L(f_c(\vec x),label) = - (w_1 \times label_1 \times log(p_1) + \\ w_2 \times (1 - lable_1) \times log(1 - p_1)) \end{split} \end{eqnarray} where $w_1$ is the weight of $label_1$. $p_1$ is the network output, which is the probability of $\pi^c$. \subsection{Play Against Different Opponents} Once we have detected the cooperation degree of the opponent, the final question arises as to how an agent should select proper policies to play against that opponent. A self-interested approach would be to simply play the best response policy toward the detected policy of the opponent. However, as we mentioned before, we seek a solution that can allow agents to achieve cooperation while avoiding being exploited. Figure~\ref{deepStructure} shows our overall approach playing with opponents towards mutual cooperation. At each time step $t$, agent $i$ uses its previous $n$-step sequence of observations (from time step $t-n$ to $t$) as the input of the detection network, and obtain the detected cooperation degree $cd_j^t$. However, the one-shot detection of the opponent's cooperation degree might be misleading due to either the detection error of our classifier or the stochastic behaviors of the opponent. Thus this may lead to high variance of our detection outcome and our response policy thereafter. To reduce the variance, agent $i$ uses the exponential smoothing to update its current cooperation degree estimation of its opponent $j$ as follows: \begin{eqnarray} cd_i^t = (1 - \alpha) \times cd_i^{t-1} + \alpha \times cd_j^t \end{eqnarray} where $cd_i^{t-1}$ is agent $i$'s cooperation degree in the last time step, and $\alpha$ is the cooperation degree changeing factor. Finally, agent $i$ sets its own cooperation degree equal to $cd_i^t$ plus its reciprocation level, and then synthesizes a new policy with the updated cooperation degree following Equation (\ref{policygenerationequation}) as its next-step strategy to play against its opponent. Note that the reciprocation level can be quite low and still produce cooperation. The benefit is that it will not lead to a significant loss if the opponent is not cooperative at all, while full cooperation can be reached if the opponent reciprocates in the same way. Also, note that here we only provide a way of responding to the opponent with changing policies. However, our overall approach is general and any existing multiagent strategy selection approaches can be applied here. \begin{figure*}[htbp] \centering \subfigure[The Apple-Pear game] {\includegraphics[height=1.5in,width=2.2in,angle=0]{a-heat-agent1-reward.png} \includegraphics[height=1.5in,width=2.2in,angle=0]{a-heat-agent2-reward.png} \includegraphics[height=1.5in,width=2.2in,angle=0]{a-heat-total-reward.png}} \subfigure[The Fruit Gathering game] {\includegraphics[height=1.5in,width=2.2in,angle=0]{g-heat-agent1-reward.png} \includegraphics[height=1.5in,width=2.2in,angle=0]{g-heat-agent2-reward.png} \includegraphics[height=1.5in,width=2.2in,angle=0]{g-heat-total-reward.png}} \caption{ Average and total rewards under different cooperation degrees. The cooperation degrees of $agent_1$ and $agent_2$ increase from left to right and from bottom to top respectively. Each cell corresponds the rewards of different policy pairs. } \label{rewardheatmap} \end{figure*} \section{Simulation and Results} \subsection{SPD Game Descriptions} In this section, we adopt the Fruit Gathering game \cite{leibo2017multi} to evaluate the effectiveness of our approach. We also propose another game Apple-Pear, which also satisfies real world social dilemma conditions we mentioned before. Each game involves two agents (in blue and red). The task of an agent in the Fruit Gathering game is to collect as many apples, represented by green pixels, as possible (see Figure~\ref{game} (left)). An agent's action set is: step forward, step backward, step left, step right, rotate left, rotate right, use beam, and stand still. The agent obtains the corresponding fruit when it steps on the same square as the fruit is located. When an agent collects an apple, it will receive a reward 1. And the apple will be removed from the environment and respawn after 40 frames. Each agent can also emit a beam in a straight line along its current orientation. An agent is removed from the map for 20 frames if it is hit by the beam twice. Intuitively, a defecting policy in this game is one which frequently tags the rival agent to remove it from the game. A cooperation policy is one that rarely tags the other agent. For the Apple-Pear game, there is a red apple and a green pear (see Figure~\ref{game} (right)). The blue agent prefers apple while the red agent prefers pear. Each agent has four actions: step right, step left, step backward, step forward, and each step of moving incurs a cost of 0.01. The fruit is collected when the agent steps on the same square as it. When the blue (red) agent collects an apple (pear) individually, it receives a higher reward 1. When the blue agent collects a pear individually, it receives a lower reward 0.5. The situation is the opposite for the red agent. One exception is that they both receive a half of their corresponding rewards when they share a pear or an apple. In this game, a fully defecting policy is to collect both fruits whenever the fruit-collecting reward exceeds the moving cost, while a cooperative one is to only collect the fruit it prefers to maximize the social welfare of agents. In Section 4.4, we find that the two games satisfy the definition of SPD games in Section 2.3 by using policies with different cooperation degrees to play with each other. \subsection{Network Architecture and Parameter Settings} In both games, our network architectures for training the baseline policies follow standard AC networks, except that we allow both actor and critic to share the same underlying network to reduce the parameter space. For the underlying network, the first hidden layer convolves $32$ filters of $8 \times 8$ with stride $4$ with the input image and applies a rectifier nonlinearity. The second hidden layer convolves $64$ filters of $4 \times 4$ with stride $2$, again followed by a rectifier nonlinearity. This is followed by a third convolutional layer that convolves $64$ filters of $3 \times 3$ with stride $1$ followed by a rectifier. For the actor, on the basis of sharing network, the next layer includes $128$ units with rectifier nonlinearity, and the final softmax layer has as many units as the number of actions. The critic is similar to the actor, but with only one scalar output. The recurrent cooperation degree detection network is shown in Figure~\ref{detectionnetwork}. The autoencoder and the detection network share the same underlying network. The first hidden layer convolves $10$ filters of $3 \times 3$ with stride $2$ with the input image and applies a rectifier nonlinearity. The second hidden layer is the same as the first one and the third hidden layer convolves $10$ filters of $3 \times 3$ with stride $3$ and applies a rectifier nonlinearity. The autoencoder is followed by a fourth hidden layer that deconvolves $10$ filters of $3 \times 3$ with stride $3$ and applies a sigmoid and its output shape is $21 \times 21 \times 10$. The next layer deconvolves $10$ filters of $3 \times 3$ with stride $2$ and applies a sigmoid and the output shape is $42 \times 42 \times 10$. The final layer deconvolves $10$ filters of $3 \times 3$ with stride $2$ and applies a sigmoid and the output shape is $84 \times 84 \times 3$. Cooperation degree detection network is followed by two LSTM layers of $256$ units. The final layer is an output node.\footnote{The code and network architectures will be available soon: \url{https://goo.gl/3VnFHj}.} For the Apple-Pear game, each episode has at most $100$ steps. The exploration rate is annealed linearly from $1$ to $0.1$ over the first $20000$ steps. The weight parameters are updated by soft target updates \cite{lillicrap2015continuous} every 4 steps to avoid the update fluctuation as follows: \begin{eqnarray} \theta' \leftarrow 0.05\theta + 0.95\theta' \end{eqnarray} where $\theta$ is the parameter of the policy network and $\theta'$ is the parameter of the target network. The learning rate is set to $0.0001$ and memory is set to $25000$. The batch size is $128$. For the loss function in the cooperation degree detection network, we set $w_1$ and $w_2$ as 1 and 2 (see Equation~\ref{cd}). When agents play with different opponents online, we assign the number of states visited to the length $n$ of the state sequence which is the input of cooperation detection network. The cooperation degree changing factor $\alpha$ is set to 1. The Fruit Gathering game uses the same detection network architecture. The actor-critic uses independent policy networks. Each episode has at most $100$ steps during training. The exploration rate and the memory are the same as the Apple-Pear game. The weight parameters are updates the same as the Apple-Pear game: \begin{eqnarray} \theta' \leftarrow 0.001\theta + 0.999\theta' \end{eqnarray} When agents play with different opponents online, we set state sequence length $n$ as 50 and the changing factor $\alpha$ is set to 0.02. \begin{figure*}[htbp] \subfigure[Apple-Pear]{\includegraphics[height=1.5in,width=2.2in,angle=0]{a-detect.pdf}} \subfigure[Fruit Gathering]{\includegraphics[height=1.5in,width=2.2in,angle=0]{g-detect.pdf}} \subfigure[Fruit Gathering ($cd_{1} = 1$)] {\includegraphics[height=1.5in,width=2.2in,angle=0]{g-detect-1.pdf}} \caption{ The detection results for $agent_2$ under different cooperation degrees of $agent_1$: (a) Apple-Pear game; (b) Fruit Gathering game; (c)$agent_1$'s cooperation degree as 1 in Fruit Gathering game} \label{detectionresult} \end{figure*} \subsection{Effect of Baseline Policy Generation} For the Apple-Pear game, the baseline policies are trained using the JAC scheme. The individual rewards of each agent increase gradually as its attitude increases and the other agent's attitude decreases. The results also indicate that an agent can learn a defecting policy when its attitude that represents its relative importance on overall reward increases and vice versa. We set the attitude in Equation (\ref{attequation}) between 0.1 and 0.9 to train baseline policies. The reason that attitudes are not set 0 and 1 is that these settings will cause an agent with meaningless policy, e.g, the agent whose attitude equals $0$ makes no influence to total reward in Equation (\ref{attequation}) and hence will always avoid collecting fruit. This would, in turn, affect the learned policy quality of the other agent (i.e., lazy agent problem \cite{perolat2017multi}). Figure~\ref{baseline} shows the average rewards of agents under policies trained with different weighted target rewards. We also evaluate the IAC scheme and similar results can be obtained and we omit it here. For the Fruit Gathering game, the learning policies are synthesized based on IAC. IAC is more efficient for training baseline policies in this game, relative to JAC, since the rewards of collecting the apple for both agents are the same. On the other hand, if we adopt a JAC approach, it might lead to the consequence that the agent with a higher weight will collect all the apples, while the other agent will not collect any apples. Similar results as the Apple-Pear game can be observed here and we omit it here. \subsection{Effect of Policy Generation} For the Apple-Pear game, the baseline cooperation policies $\pi_1^c$ and $\pi_2^c$ are trained under the setting of $\{att_1 = att_2 = 0.5\}$. For $agent_1$, the baseline defection policy $\pi_1^d$ has $\{att_1 = 0.75, att_2 = 0.25\}$. For $agent_2$, the baseline defection policy $\pi_2^d$ has $\{att_1 = 0.25, att_2 = 0.75\}$. Then we generate the policy set of $agent_1$ $\Pi_1 = \{\pi = w_1 \times \pi_1^c + (1 - w_1) \times \pi_1^d | w_1 = 0.0, 0.1, \ldots, 1.0\}$ and the policy set of $agent_2$ $\Pi_2 = \{\pi = w_2 \times \pi_2^c + (1 - w_2) \times \pi_2^d | w_2 = 0.0, 0.1, \ldots, 1.0\}$. After that, two policies $\pi_1$ and $\pi_2$ are sampled from $\Pi_1$ and $\Pi_2$ and matched against each other in the games for 200,000 episodes. The average rewards are assigned to individual cells of different attitude pairs, in which $\pi_1$ correspond to policies with varying cooperation degrees $w_1$ for agent $1$, and $\pi_2$, policies with varying cooperation degrees $w_2$ for agent $2$ (see Figure~\ref{rewardheatmap} (a)). In Figure~\ref{rewardheatmap} (a), we can observe that when agents' cooperation degrees decrease, their rewards decrease. When both of their cooperation degrees increase, which means they are more cooperative, the sum of their rewards increase. Besides, given a fixed cooperation degree of $agent_1$, $agent_2$'s reward is increased as its cooperation degree decreases, and vice versa. Similar pattern can be observed for agent 1 as well. Therefore, it indicates that we can successfully synthesize policies with a continuous range of cooperation degrees. It also confirms that the Apple-Pear game can be seen as an SPD following the definition in Section 2.3. For the Fruit Gathering game, we use policies with both attitudes equal to 0 and 0.5 as the baseline defection and cooperation policy respectively. Figure~\ref{rewardheatmap} (b) shows the results of their rewards, which is similar to the Apple-Pear game. \subsection{Effect of Cooperation Degree Detection} This section evaluates the detection power of the cooperation degree detection network. First, we train the cooperation degree detection network using datasets which include only the data labeled as full cooperation or full defection. The training data $(\langle s_0, s_1, s_2, \ldots, s_n \rangle,label)$ in the simulation is obtained based on baseline policies of $agent_2$. We set its label as 1 when $agent_2$ uses its baseline cooperation policy and 0 when $agent_2$ uses its baseline defection policy. Then we use this dataset to train the detection network. After training we evaluate the detection accuracy by applying it to detecting the cooperation degree of agent 2 when it uses policies with cooperation degrees from 0 to 1 and the degree interval is 0.1. The policy pair $(\pi_1, \pi_2)$ is sampled from $\Pi_1$ and $\Pi_2$ and matched against with each other for each episode. After the cooperation degree average value is stable, we view the output value as the cooperation degree of $agent_2$. For the Apple-Pear game, we collect 10000 data for state sequence lengths \{3, 4, 5, 6, 7, 8\}. The cooperation detection results of $agent_2$ are shown in Figure~\ref{detectionresult} (a). We can see that the cooperation detection values can well approximate the true values with slight variance. Besides, the network can clearly detect the order of different cooperation degrees, which allows us to calculate the cooperation degree of $agent_2$ accurately. For the Fruit Gathering game, we collect 4000 data for each state sequence lengths \{40, 50, 60, 70\}, which includes 2000 data labeled as 1 and 2000 data labeled as 0. The network is trained in a similar way and the cooperation degree detection accuracy is high (see Figure~\ref{detectionresult} (b)). From Figure~\ref{detectionresult}, We observe that the detection results are almost linear with the true values. Fig 6(c) shows the detection results of $agent_2$ when $agent_1$'s policy is fixed with cooperation degree 1. We can see that the true cooperation degree of $agent_2$ can be easily obtained by fitting a linear curve between the predicted and true values. Thus for each policy of $agent_1$ in $\Pi_1$, we can fit a linear function to evaluate the true cooperation degrees of $agent_2$. During practical online learning, when $agent_1$ uses policies of varying cooperation degrees to play with $agent_2$, it firstly chooses the function whose corresponding policy is closest to the used policy, and then computes the cooperation degree of $agent_2$. \begin{figure}[htbp] \centering \subfigure {\includegraphics[height=1.2in,width=1.7in,angle=0]{a-self-D-D-attitute.png} \includegraphics[height=1.2in,width=1.7in,angle=0]{a-self-D-D-reward.png}} \caption{ Performance under self-play in the Apple-Pear game when both agents use our strategy. } \label{aselfplay} \end{figure} \begin{figure}[htbp] \centering \subfigure {\includegraphics[height=1.2in,width=1.8in,angle=0]{g-self-D-D-agent1-cooperation-degree.pdf} \includegraphics[height=1.2in,width=1.8in,angle=0]{g-self-D-D-agent2-cooperation-degree.pdf}} \caption{ Performance under self-play in the Fruit Gathering game when both agents use our strategy. } \label{gselfplay} \end{figure} \begin{figure*}[htbp] \centering \subfigure{\includegraphics[height=1.225in,width=1.75in,angle=0]{a-change-attitute-110.png} \includegraphics[height=1.225in,width=1.75in,angle=0]{a-change-agent1-reward-110.png} \includegraphics[height=1.225in,width=1.75in,angle=0]{a-change-agent2-reward-110.png} \includegraphics[height=1.225in,width=1.75in,angle=0]{a-change-total-reward-110.png} } \caption{Apple-Pear game: $agent_2$'s policy varies between $\pi^c$ and $\pi^d$ every 110 episodes. The average rewards of the $agent_1$ are higher when using our approach than using $\pi^c$, which means our approach can avoid being exploited by defective opponents. The social welfare is higher than using $\pi^d$, indicating that our approach can seek for cooperation against cooperative ones.} \label{achange} \end{figure*} \begin{figure*}[htbp] \centering \subfigure{\includegraphics[height=1.225in,width=1.75in,angle=0]{g-change-attitute-300.png} \includegraphics[height=1.225in,width=1.75in,angle=0]{g-change-agent1-reward-300.png} \includegraphics[height=1.225in,width=1.75in,angle=0]{g-change-agent2-reward-300.png} \includegraphics[height=1.225in,width=1.75in,angle=0]{g-change-total-reward-300.png} } \caption{Fruit Gathering game: $agent_2$'s policy varies between $\pi^c$ and $\pi^d$ every 300 steps. Similar phenomenon can be observed as in Figure \ref{achange}.} \label{gchange} \end{figure*} \subsection{Performance under Self-Play} Next, we evaluate the learning performance of our approach under self-play. Since the initialized policies of agents can affect their behaviors in the game, we evaluate under all different initial conditions: a) $agent_1$ starts with cooperation policy and $agent_2$ starts with defecting policy; b) $agent_1$ starts with defecting policy and $agent_2$ starts with cooperation policy; c) both agents start with cooperation policies; d) both agents start with defecting policies. Agents converge to full cooperation for all four cases. We present the results for the last case, which is the most challenging one (see Figure~\ref{aselfplay} and Figure~\ref{gselfplay}). When both agents start with a defection policy, it is more likely for them to model each other as defective and thus both play defect thereafter. Our approach enables agents to successfully detect the cooperation tendency of their opponents from sequential actions and converge to cooperation at last. In the Apple-Pear game, agents converge efficiently within few episodes. The reason is that when agents are close to fruits they prefer, they will collect fruits no matter whether their policies are cooperative or not. Thus, an agent is more likely to be detected as being cooperative, which induces its opponent to change policies towards cooperation. In contrast, for the Fruit Gathering game, agents need a relatively longer time before converging to full cooperation. This is because in the Fruit Gathering game, the main feature of detecting the cooperation degree is beam emitting frequency. When one agent emits a beam continuously, they change to defect. Only when both agents collect fruits without emitting beam would lead to mutual cooperation. \subsection{Playing with Opponents with Changing Strategies} Now, we evaluate the performance against switching opponents, during a repeated interaction of $T$ episodes, the opponent changes its policy after a certain number of episodes and the learning agent does not know when the switches happen. Through this, we can evaluate the cooperation degree detection performance of our network, and verify whether our strategy can perform better than the fully cooperation or defection strategy from two aspects: 1) our approach seeks for mutual cooperation whenever possible; 2) our approach is robust against selfish exploitation. In the Apple-Pear game, we vary the value of $N_{change}$ in the range of $[50, 200]$ at the interval of 30, and similarly in the Fruit Gathering game we vary it in the range of $[100,500]$ at the interval of 100. Only one set of results for each game are provided in Figure 9 and 10. The results of other values of $N_{change}$ are in the Appendix. Similar phenomenon can be observed for other values of $N_{change}$. From Figure 9 and 10, we observe that for both games, the average rewards of the learning agent ($agent_1$) are higher than its rewards using cooperation strategy $\pi^c$. And the social welfare (the sum of both agents' rewards) is higher than that using defection strategy $\pi^d$. This indicates that our approach can prevent agents from being exploited by defecting opponents and seek for cooperation against cooperative ones. By comparing the results for different values of $N_{change}$, we find that the detection accuracy decreases when the opponent changes its policy quickly. Since the agent requires observing several episodes to detect the cooperation degree of the opponent, when the agent realizes its opponent changes the policy and adjusts its policy, the opponent may change the policy again. This problem becomes less severe when $T$ is comparatively large. \section{Conclusions} \begin{comment} In this paper, we make the first step in investigating multiagent learning problem in large-scale PD games by leveraging the recent advance of deep reinforcement learning. A deep multiagent reinforcement learning approach is proposed towards mutual cooperation in SPD games to support adaptive end-to-end learning. There are three points to our main contribution. First, we propose training policies with different cooperation degrees and combining with policy generation strategy to generate policies. Second, we propose a cooperation degree detection network which implements an LSTM-based structure with an encoder-decoder module and generate a training dataset. Last, we extend the Tit-for-Tat principle into SPD scenarios using cooperation degree detection network and policy generation. Our approach is cooperation-oriented and seeks for mutual cooperation whenever possible, while it also avoids being exploited when faced with selfish opponents. Empirical simulation shows that our agent can efficiently achieve mutual cooperation under self-play and also perform well against opponents with changing strategies. As the first step towards solving multiagent learning problem in large-scale environments, we believe there are a lot of works remaining as future work. One worthwhile direction is how to generalize our approach to other classes of large-scale multiagent games. Generalized policy detection and reuse techniques should be proposed, e.g., by extending existing approaches in traditional reinforcement learning contexts \cite{Hernandez2016Identifying,hernandez2016bayesian,Hernandez2017Towards}. \end{comment} In this paper, we make the first step in investigating multiagent learning problem in large-scale PD games by leveraging the recent advance of deep reinforcement learning. A deep multiagent RL approach is proposed towards mutual cooperation in SPD games to support adaptive end-to-end learning. Empirical simulation shows that our agent can efficiently achieve mutual cooperation under self-play and also perform well against opponents with changing strategies. As the first step towards solving multiagent learning problem in large-scale environments, we believe there are many interesting questions remaining for future work. One worthwhile direction is how to generalize our approach to other classes of large-scale multiagent games. Generalized policy detection and reuse techniques should be proposed, e.g., by extending existing approaches in traditional reinforcement learning contexts \cite{Hernandez2016Identifying,hernandez2016bayesian,Hernandez2017Towards}. \bibliographystyle{named}
{'timestamp': '2018-03-02T02:05:29', 'yymm': '1803', 'arxiv_id': '1803.00162', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00162'}
arxiv
\section{Introduction} \subsection{A Brief Overview of Cyber-Attacks and Countermeasures in Smart Grid} Due to the integration of advanced signal processing, communication, and control technologies, smart grid relies on a critical cyber infrastructure that is subject to adversarial cyber threats \cite{HHe16,Liang16,wang2013cyber,yan2012survey}. The smart grid is regulated based on estimated system states and the main aim of attackers is to damage/mislead the state estimation mechanism and thereby to cause wrong/manipulated decisions in the energy management system of the smart grid. Some potential consequences of a successful cyber-attack are regional power blackouts, {manipulated electricity market prices \cite{Xie10,moslemi2017}, and destabilization of the power grid \cite{ayar2017}.} Such cyber-attacks are also seen in practice. For instance, on December 23, 2015, the Ukrainian power system was attacked and the resulting power blackout affected around 200,000 people for several hours \cite{GLiang17}. The Ukraine attack has demonstrated that attackers have more capabilities than predicted \cite{GLiang17}. Namely, (i) attackers can access and monitor the power system over long periods of time without being detected, (ii) attackers are able to perform cyber-attacks by hacking smart grid components (smart meters, control centers, etc.), manipulating/jamming the network communication channels, and accessing and manipulating the database of the control center \cite{GLiang17,Amin09,Liang16}. Hence, cyber-attacks significantly threaten the safe and reliable operation of the power grid in practice. Effective countermeasures need to be developed considering the worst-case scenarios where the attackers are fully capable of performing a diverse range of cyber-attacks. The first step in a defense mechanism is early detection of cyber-attacks. After detecting an attack, effective mitigation schemes should then be implemented. Recently, the false data injection (FDI) attacks \cite{Liang16,Liu09,Tan17,moslemi2017fast} and the jamming attacks \cite{Amin09,Sargolzaei17,YLi15,Deka15} against the smart grid are extensively studied in the literature and several detectors are proposed. The proposed detectors are mostly outlier detectors, i.e., they classify a sample measurement as either normal or anomalous. Conventional detectors classify a measurement as anomalous if the measurement residual exceeds a certain threshold \cite{Abur04,Liu09,Manandhar14,Brumback87,Rawat15}. More advanced machine learning techniques are also considered for classification of anomalous measurements \cite{Esmalifalak17,Ozay16}. {Moreover, in \cite{moslemi2017fast}, firstly a Markov graph model for system states is learned under normal system operation and then attacks/anomalies are detected based on the consistency of new measurements compared to the learned nominal model. Further, in \cite{bretas2017}, based on the least squares (LS) state estimator, a multi-step procedure is presented to detect and classify cyber-attacks on meter measurements, network line parameters, and network topology, and then to make corrections for attack mitigation.} {In \cite{zhao2017robust,zhao2017attack,gandhi2010robust}, robust extended Kalman filters have been proposed where the main aim is to bound the effects of outliers on the state estimation mechanism. No specific attack types are considered so that using such schemes, it is not possible to distinguish a real attack from random outliers, e.g., due to heavy-tailed non-Gaussian noise processes. Moreover, such schemes have breakdown points such that if outliers, significantly far away from the nominal measurements, are observed, then the proposed filters fail to keep track of the system state.} In order to improve the time resolution and also to detect cyber-attacks more reliably, several online detectors based on the quickest detection theory are proposed. For instance, in \cite{Li_15} and \cite{Huang16}, cumulative sum (CUSUM)-based schemes are considered to detect FDI attacks where the state estimation is based on the conventional LS methods. More recently, in \cite{Necip18}, CUSUM-based detection schemes are proposed to detect FDI and denial of service (DoS) attacks (separately) in a dynamic setting and their advantages over the outlier detectors and the LS-based detectors are demonstrated. {Further, in \cite{yang2016false}, a nonparametric CUSUM detector is proposed that do not assume any attack model and only evaluates the deviation of meter measurements from the baseline statistics, i.e., normal system operation. In \cite{sun2013anomaly}, a window-based CUSUM detector is proposed for detection of FDI attacks where the attack parameters of interest are estimated based on the most recent sliding window of measurements.} \subsection{Contributions} In this paper, we propose robust mechanisms for timely detection of potentially combined and stealthily designed FDI and jamming attacks. The proposed mechanisms are tightly connected to an estimation mechanism, which makes both the detection and state estimation schemes robust against unknown and time-varying attack variables. In particular, online maximum likelihood estimates (MLEs) of the attack types, set of attacked meters, and the attack magnitudes are used in attack detection. Moreover, recovered state estimates are computed based on the online MLE estimates of the attack variables. No restrictive assumptions are made about an attacker's strategy, i.e., an attacker can design and perform arbitrarily combined FDI and jamming attacks, targeting any subset of meters in any magnitude and can also change its attack parameters over time. Further, considering the possibility of smarter and more capable attackers, additional countermeasures are proposed against stealthily designed cyber-attacks. These make the proposed detection schemes highly robust against a significantly wide range of potential cyber-attacks targeting the smart grid. Since the smart grid is a highly complex network, any anomaly/failure in a part of the system can quickly spread over the network and lead to new unpredicted failures. Hence, timely attack detection and mitigation is crucial. In this paper, for timely detection, we present real-time detection mechanisms. Moreover, to help for timely attack mitigation and quick system recovery, we provide online estimates of the attack types, set of attacked meters and attack magnitudes. Note that having an estimate for the attack type can be useful since different countermeasures may need to be employed against different types of attacks. Further, considering that the real power grid is a huge network consisting of many meters, an estimate of the attacked meters can be critical for a timely and effective attack mitigation, e.g., via isolating the attacked meters during the recovery procedure. Moreover, estimates of attack magnitudes are needed to recover attack-free states. We list our main contributions as follows: \begin{itemize} \item A novel low-complexity online detection and estimation algorithm is proposed against (possibly) combined FDI and jamming attacks. The proposed algorithm is robust to unknown and time-varying attack types, magnitudes, and set of attacked meters. Further, recovered state estimates and closed-form online MLE estimates of the attack variables are presented. \item Stealthy attacks against CUSUM-based detectors and particularly against the proposed algorithm are introduced and analyzed. \item Several countermeasures are proposed against the considered stealthy attacks. \end{itemize} \subsection{Organization} The remainder of the paper is organized as follows. In Sec.~\ref{sec:system}, the system model, attack models, state estimation mechanism, and the problem formulation are presented. In Sec.~\ref{sec:combined}, an online cyber-attack detection and estimation algorithm is presented. In Sec.~\ref{sec:stealth}, stealthy attacks against CUSUM-based detectors are introduced and analyzed. Also, countermeasures against the considered stealthy attacks are presented. In Sec.~\ref{sec:numerical}, the proposed detection schemes are evaluated extensively via simulations. Finally, the paper is concluded in Sec.~\ref{sec:conc}. Boldface letters denote vectors and matrices, and all vectors are column vectors. \section{System Model and Problem Formulation} \label{sec:system} \subsection{System Model} The actual power grid is regulated based on a nonlinear AC power flow model \cite{Liang16}. On the other hand, the approximate linearized (around an operating point) DC power flow model is a good approximation that is widely used in the literature to describe the operation of the power grid \cite{Abur04,Liu09,Cui12}. Furthermore, static system model and consequently conventional static (LS) state estimation are not effective in capturing the dynamics of a power system due to time-varying load and power generation \cite{Tan17}. In addition, attack detection mechanisms based on static estimators are not effective in detecting time-varying cyber-attacks and {structured ``stealth'' FDI attacks \cite{Liu09}, for which dynamic state estimator-based detectors are known to be effective \cite{Necip18,Zhao17}.} We then model the power grid, consisting of $N+1$ buses and $K$ meters, as a discrete-time linear dynamic system based on the commonly employed linear DC model \cite{Abur04,Liu09,Cui12} as follows: \begin{gather} \label{eq:state_upd} \mathbf{x}_t = \mathbf{A} \mathbf{x}_{t-1} + \mathbf{v}_t, \\ \label{eq:meas_model} \mathbf{y}_t = \mathbf{H} \mathbf{x}_t + \mathbf{w}_t, \end{gather} where $\mathbf{x}_{t} = [x_{1,t}, x_{2,t}, \dots, x_{N,t}]^\mathrm{T}$ is the state vector denoting the phase angles of $N$ buses (one of the buses is considered as a reference bus), $\mathbf{A} \in \mathbb{R}^{N \times N}$ is the state transition matrix, $\mathbf{v}_t = [v_{1,t}, v_{2,t}, \dots, v_{N,t}]^\mathrm{T} \sim \mathbf{\mathcal{N}}(\mathbf{0},\sigma_v^2 \, \mathbf{I}_N)$ is the process noise vector, $\mathbf{I}_N$ is an ${N \times N}$ identity matrix, and $\cdot^\mathrm{T}$ is the transpose operator. Further, $\mathbf{y}_t = [\mathbf{y}_{1,t}^\mathrm{T}, \mathbf{y}_{2,t}^\mathrm{T}, \dots, \mathbf{y}_{K,t}^\mathrm{T}]^\mathrm{T}$ is the vector consisting of meter measurements, $\mathbf{y}_{k,t} = [y_{k,t,1}, y_{k,t,2}, \dots, y_{k,t,\lambda}]^\mathrm{T}$ is the measurement vector for meter $k$, $\mathbf{H} \in \mathbb{R}^{K \lambda \times N}$ is the measurement matrix, $\mathbf{w}_t = [\mathbf{w}_{1,t}^\mathrm{T}, \mathbf{w}_{2,t}^\mathrm{T}, \dots, \mathbf{w}_{K,t}^\mathrm{T}]^\mathrm{T} \sim \mathbf{\mathcal{N}}(\mathbf{0},\sigma_w^2 \, \mathbf{I}_{K \lambda})$ is the measurement noise vector, and $\mathbf{w}_{k,t} = [w_{k,t,1}, w_{k,t,2}, \dots, w_{k,t,\lambda}]^\mathrm{T}$ is the measurement noise vector for meter $k$. Note that in each time interval between $t-1$ and $t$, $\lambda \in \{1,2,3,\dots\}$ measurements are taken at each meter, where $\lambda$ is usually small, and the collected measurements between $t-1$ and $t$ are processed at time $t$. To increase the measurement redundancy against noise and also to estimate the unknown attack parameters more reliably in case of a cyber-attack, $\lambda$ needs to be chosen higher. {In general, the state transition and measurement matrices can also be dynamic. For instance, due to changes in network topology, i.e., on and off states of the switches and line breakers in the power grid, the measurement matrix may vary over time. In that case, instead of modeling the smart grid as a linear time-invariant system as in \eqref{eq:state_upd} and \eqref{eq:meas_model}, we can model it as a linear time-varying system where we can replace $\mathbf{A}$ and $\mathbf{H}$ by $\mathbf{A}_t$ and $\mathbf{H}_t$, respectively. The results presented in this study can be generalized to the case of linear time-varying system model as long as $\mathbf{A}_t$ and $\mathbf{H}_t$ are known by the system controller at each time $t$.} \subsection{Attack Models} We assume that at an unknown time $\tau$, a cyber-attack is launched to the system, where we particularly consider FDI attacks, jamming attacks, and their combination. The attack types, attack magnitudes, and the set of attacked meters can be time-varying. But, during a time interval, i.e., between $t-1$ and $t$, we assume that the attack parameters stay constant. Next, we explain the attack models under consideration. \subsubsection{FDI Attack} In case of an FDI attack, additive malicious data are injected into the measurements of a subset of meters. In practice, an FDI attack can be performed by manipulating the network communication channels or hacking meters and/or control centers in the smart grid \cite{Liang16,GLiang17}. The measurement model in case of an FDI attack takes the following form: \begin{gather} \label{eq:fdi_model} \mathbf{y}_t = \mathbf{H} \mathbf{x}_t + \mathbf{a}_t + \mathbf{w}_t, ~~ t \geq \tau, \end{gather} where $\mathbf{a}_t = [\mathbf{a}_{1,t}^\mathrm{T}, \mathbf{a}_{2,t}^\mathrm{T}, \dots, \mathbf{a}_{K,t}^\mathrm{T}]^\mathrm{T}$ denotes the injected false data at time $t$. Since the attack magnitudes are assumed to be constant between $t-1$ and $t$, for meter $k$, $\mathbf{a}_{k,t} = \mathbf{1}_{\lambda \times 1} \, \mathrm{a}_{k,t}$, where $\mathbf{1}_{\lambda \times 1}$ is a $\lambda \times 1$ vector consisting of $1$s. Note that if meter $k$ is not under an FDI attack at time $t$, then $a_{k,t} = 0$, otherwise $a_{k,t} \neq 0$. \subsubsection{Jamming Attack} In case of a jamming attack, we assume that the attacker constantly emits additive white Gaussian noise (AWGN) to the network communication channels to compromise a subset of meter measurements. We consider jamming with AWGN since (i) it is a commonly employed jamming model in the literature \cite{JGao15,Gezici16}, (ii) it is a simple attacking strategy to perform, and (iii) in an additive noise channel with Gaussian input, for a given mean and variance, among all noise distributions, the Gaussian noise maximizes the mean squared error of estimating the channel input given the channel output \cite{Kay93,Gezici16}. Hence, an attacker can jam the communication channels with AWGN to maximize its damage on the state estimation mechanism. In case of a jamming attack, the measurement model can be written as follows: \begin{gather} \label{eq:jamming_model} \mathbf{y}_t = \mathbf{H} \mathbf{x}_t + \mathbf{w}_t + \mathbf{n}_t, ~~ t \geq \tau, \end{gather} where $\mathbf{n}_t = [\mathbf{n}_{1,t}^\mathrm{T}, \mathbf{n}_{2,t}^\mathrm{T}, \dots, \mathbf{n}_{K,t}^\mathrm{T}]^\mathrm{T} \sim \mathbf{\mathcal{N}}(\mathbf{0}, \mathrm{diag}(\pmb{\sigma}_t))$ denotes the jamming noise, $\pmb{\sigma}_t = [\pmb{\sigma}_{1,t}^\mathrm{T}, \pmb{\sigma}_{2,t}^\mathrm{T}, \dots, \pmb{\sigma}_{K,t}^\mathrm{T}]^\mathrm{T}$, and $\pmb{\sigma}_{k,t} = \mathbf{1}_{\lambda \times 1} \, \sigma_{k,t}^2$ where $\sigma_{k,t}^2$ is the variance of the jamming noise targeting meter $k$ at time $t$. If meter $k$ is not under a jamming attack at time $t$, then $\sigma_{k,t}^2 = 0$, otherwise $\sigma_{k,t}^2 > 0$. \subsubsection{Hybrid Attack} In case of a hybrid (combined) attack, FDI and jamming attacks are simultaneously launched to the system and hence the measurement model takes the following form: \begin{gather} \label{eq:meas_attacked} \mathbf{y}_t = \mathbf{H} \mathbf{x}_t + \mathbf{a}_t + \mathbf{w}_t + \mathbf{n}_t, ~~ t \geq \tau. \end{gather} For meter $k$ under both FDI and jamming attacks at time $t$, $a_{k,t} \neq 0$ and $\sigma_{k,t}^2 > 0$. Since the FDI and jamming attacks can be considered as special cases of hybrid attacks, we consider \eqref{eq:meas_attacked} as the measurement model under the attacking regime, i.e., for $t \geq \tau$. \textit{Remark 1:} If the noise terms in the normal system operation are AWGN (as in \eqref{eq:state_upd} and \eqref{eq:meas_model}) and the jamming noise terms are mutually independent over the meters, then the considered hybrid FDI/jamming attacks span all possible data attacks. This is due to the fact that a Gaussian random variable is defined by its mean and variance, and through the hybrid attacks, mean and variance of the density of meter measurements can be arbitrarily changed (cf. \eqref{eq:meas_attacked}). For instance, in case of a DoS attack, meter measurements are blocked and only a random or zero signal is received at the control center \cite{Amin09,Sargolzaei17,YLi15}. Hence, the DoS attack can be considered as a special case of the hybrid cyber-attacks, i.e., a DoS attack can either be equivalent to an FDI attack with false data being in the same magnitude of the actual signal but with an opposite sign or a jamming attack with high level noise variances such that the actual signal can be neglected compared to the noise signal \cite{Necip18}. On the other hand, if the jamming noise is correlated over the meters or it is not normally distributed, then such an attack does not comply with the considered jamming attack model in \eqref{eq:jamming_model} and nor with \eqref{eq:meas_attacked}. For such cases, we consider a non-parametric goodness-of-fit test as a countermeasure (see Sec.~\ref{subsec:counter}). \subsection{Pre- and Post-Attack Measurement Densities} Let $\mathbf{H} = [\mathbf{H}_1^\mathrm{T}, \mathbf{H}_2^\mathrm{T}, \dots, \mathbf{H}_K^\mathrm{T}]^\mathrm{T}$ where $\mathbf{H}_k \in \mathbb{R}^{\lambda \times N}$ is the measurement matrix for meter $k$. Since the measurement matrix is determined based on the system topology, the rows of $\mathbf{H}_k$ are identical, i.e., $\mathbf{H}_k = \mathbf{1}_{\lambda \times 1} \, \mathbf{h}_k^\mathrm{T}$, where $\mathbf{h}_k^\mathrm{T}$ is a row of $\mathbf{H}_k$. Based on the considered post-attack model in \eqref{eq:meas_attacked}, a measurement obtained at meter $k$ during the time interval between $t-1$ and $t$, i.e., $y_{k,t,i}, k \in \{1, 2, \dots, K\}, i \in \{1, 2, \dots, \lambda\}$ can be written as \begin{equation}\label{eq:meas_att_v2} y_{k,t,i} = \begin{cases} \mathbf{h}_k^\mathrm{T} \mathbf{x}_t + w_{k,t,i}, & \mbox{if } k \in \mathcal{S}_t^0 \\ \mathbf{h}_k^\mathrm{T} \mathbf{x}_t + \mathrm{a}_{k,t} + w_{k,t,i}, & \mbox{if } k \in \mathcal{S}_t^f \\ \mathbf{h}_k^\mathrm{T} \mathbf{x}_t + w_{k,t,i} + n_{k,t,i}, & \mbox{if } k \in \mathcal{S}_t^j \\ \mathbf{h}_k^\mathrm{T} \mathbf{x}_t + \mathrm{a}_{k,t} + w_{k,t,i} + n_{k,t,i}, & \mbox{if } k \in \mathcal{S}_t^{f,j} \end{cases} , ~ t \geq \tau, \end{equation} where $\mathcal{S}_t^0$ is the set of non-attacked meters, $\mathcal{S}_t^f$ is the set of meters under only FDI attack, $\mathcal{S}_t^j$ is the set of meters under only jamming attack, and $\mathcal{S}_t^{f,j}$ is the set of meters under both FDI and jamming attacks at time $t \geq \tau$. Note that $\mathcal{S}_t^0$, $\mathcal{S}_t^f$, $\mathcal{S}_t^j$, and $\mathcal{S}_t^{f,j}$ are disjoint sets and $\mathcal{S}_t^0 \cup \mathcal{S}_t^f \cup \mathcal{S}_t^j \cup \mathcal{S}_t^{f,j} = \{1,2,\dots,K\}$. Then, the probability density functions (pdfs) of the measurements in the pre- and post-attack regimes take respectively the following forms $\forall i \in \{1,2,\dots,\lambda\}$: \begin{align} \label{eq:hyp_null} y_{k,t,i} \sim \mathbf{\mathcal{N}}(\mathbf{h}_k^\mathrm{T} \mathbf{x}_t,\sigma_w^2), ~~ \forall k \in \{1,2,\dots,K\}, ~ t < \tau, \end{align} and \begin{align} \label{eq:hyp_alter} y_{k,t,i} \sim \begin{cases} \mathbf{\mathcal{N}}(\mathbf{h}_k^\mathrm{T} \mathbf{x}_t,\sigma_w^2), & \forall k \in \mathcal{S}_t^0 \\ \mathbf{\mathcal{N}}(\mathbf{h}_k^\mathrm{T} \mathbf{x}_t + \mathrm{a}_{k,t},\sigma_w^2), & \forall k \in \mathcal{S}_t^f \\ \mathbf{\mathcal{N}}(\mathbf{h}_k^\mathrm{T} \mathbf{x}_t,\sigma_w^2 + \sigma_{k,t}^2), & \forall k \in \mathcal{S}_t^j \\ \mathbf{\mathcal{N}}(\mathbf{h}_k^\mathrm{T} \mathbf{x}_t + \mathrm{a}_{k,t},\sigma_w^2 + \sigma_{k,t}^2), & \forall k \in \mathcal{S}_t^{f,j} \end{cases} ,~ t \geq \tau. \end{align} \subsection{State Estimation} Since the smart grid is modeled as a discrete-time linear dynamic system with the Gaussian noise terms (cf. \eqref{eq:state_upd} and \eqref{eq:meas_model}), the Kalman filter is the optimal linear estimator in minimizing the mean squared state estimation error \cite{Kalman_60}. Further, since the measurement models for the pre- and post-attack periods are different (cf. \eqref{eq:hyp_null} and \eqref{eq:hyp_alter}), two Kalman filters need to be simultaneously employed: one for assuming no attack occurs at all and one for assuming an attack occurs at an unknown time $\tau$. Since the latter involves the unknown change-point $\tau$ and the unknown attack parameters $\mathbf{a}_t$ and $\pmb{\sigma}_t$, estimates of these unknowns are needed to employ the corresponding Kalman filter. As we will explain later, $\tau$ is estimated by the detection algorithm, $\mathbf{a}_t$ and $\pmb{\sigma}_t$ are estimated via the maximum likelihood (ML) estimation. The Kalman filter is an iterative real-time estimator composed of prediction and measurement update steps at each iteration. Let the Kalman filter estimates for the pre- and post-attack cases be denoted with $\hat{\mathbf{x}}_{t|t'}^0$ and $\hat{\mathbf{x}}_{t|t'}^1$, respectively where $t' = t-1$ and $t' = t$ for the prediction and measurement update steps at time $t$, respectively. The Kalman filter equations at time $t$ are then given as follows: \emph{Pre-attack -- Prediction}: \begin{gather} \nonumber \hat{\mathbf{x}}_{t|t-1}^0 = \mathbf{A} \hat{\mathbf{x}}_{t-1|t-1}^0, \\ \label{eq:pred_fdata_null} \mathbf{P}_{t|t-1}^0 = \mathbf{A} \mathbf{P}_{t-1|t-1}^0 \mathbf{A}^\mathrm{T} + \sigma_v^2 \, \mathbf{I}_N, \end{gather} \emph{Pre-attack -- Measurement update}: \begin{gather} \nonumber \mathbf{G}_{t}^0 = \mathbf{P}_{t|t-1}^0 \mathbf{H}^\mathrm{T} (\mathbf{H} \mathbf{P}_{t|t-1}^0 \mathbf{H}^\mathrm{T} + \sigma_w^2 \, \mathbf{I}_{K \lambda})^{-1}, \\ \nonumber \hat{\mathbf{x}}_{t|t}^0 = \hat{\mathbf{x}}_{t|t-1}^0 + \mathbf{G}_{t}^0 (\mathbf{y}_t - \mathbf{H} \hat{\mathbf{x}}_{t|t-1}^0), \\ \label{eq:meas_upd_fdata_null} \mathbf{P}_{t|t}^0 = \mathbf{P}_{t|t-1}^0 - \mathbf{G}_{t}^0 \mathbf{H} \mathbf{P}_{t|t-1}^0, \end{gather} \emph{Post-attack -- Prediction}: \begin{gather} \nonumber \hat{\mathbf{x}}_{t|t-1}^1 = \mathbf{A} \hat{\mathbf{x}}_{t-1|t-1}^1, \\ \label{eq:pred_fdata_alter} \mathbf{P}_{t|t-1}^1 = \mathbf{A} \mathbf{P}_{t-1|t-1}^1 \mathbf{A}^\mathrm{T} + \sigma_v^2 \, \mathbf{I}_N, \end{gather} \emph{Post-attack -- Measurement update}: \begin{gather} \nonumber \mathbf{G}_{t}^1 = \mathbf{P}_{t|t-1}^1 \mathbf{H}^\mathrm{T} (\mathbf{H} \mathbf{P}_{t|t-1}^1 \mathbf{H}^\mathrm{T} + \sigma_w^2 \, \mathbf{I}_{K \lambda} + \mathrm{diag}(\hat{\pmb{\sigma}}_t))^{-1}, \\ \nonumber \hat{\mathbf{x}}_{t|t}^1 = \hat{\mathbf{x}}_{t|t-1}^1 + \mathbf{G}_{t}^1 (\mathbf{y}_t - \mathbf{H} \hat{\mathbf{x}}_{t|t-1}^1 - \hat{\mathbf{a}}_t), \\ \label{eq:meas_upd_fdata_alter} \mathbf{P}_{t|t}^1 = \mathbf{P}_{t|t-1}^1 - \mathbf{G}_{t}^1 \mathbf{H} \mathbf{P}_{t|t-1}^1, \end{gather} where $\mathbf{P}_{t|t'}^0$ and $\mathbf{P}_{t|t'}^1$ denote the estimates of the state covariance matrix at time $t$, and $\mathbf{G}_{t}^0$ and $\mathbf{G}_{t}^1$ denote the Kalman gain matrices at time $t$ for the pre- and post-attack cases, respectively. Note that the MLE estimates of the attack parameters are used in the measurement update step of the Kalman filter for the post-attack case, where $\hat{\mathbf{a}}_t$ is the MLE of $\mathbf{a}_t$ (cf. \eqref{eq:a_hat_kt_v3_rrr}) and $\hat{\pmb{\sigma}}_t$ is the MLE of $\pmb{\sigma}_t$ (cf. \eqref{eq:sigma_hat_kt_v3_rrr}). Hence, $\hat{\mathbf{x}}_{t|t-1}^1$ and $\hat{\mathbf{x}}_{t|t}^1$ are, in fact, recovered state estimates in case of a cyber-attack. Note, however, that ML estimation errors may lead to errors in computing the recovered state estimates. \subsection{Problem Formulation} Our objective is detecting cyber-attacks in a timely and reliable manner and the quickest detection theory \cite{Poor08,Basseville93,Veeravalli14} is well suited to this objective. In the quickest change detection problems, measurements become available sequentially over time and at each time, either a change is declared or further measurements are taken in the next time interval, where the aim is to optimally balance the detection delay and the false alarm rate. There are two main approaches in the quickest detection theory, namely Bayesian and non-Bayesian. In a Bayesian setting, the change point $\tau$ is considered as a random variable with a known a priori distribution whereas in a non-Bayesian setting, the change point is considered as non-random and unknown. Our problem better fits to the non-Bayesian setting since we do not assume any a priori knowledge about the change-point $\tau$. Then, we consider the following objective function, proposed by Lorden \cite{Lorden_71}: \begin{gather} \label{eq:det_delay} d(T) = \sup_{\tau} \, \esssup_{\mathcal{F}_\tau} \, \mathbb{E}_\tau \big[(T-\tau)^+\,|\mathcal{F}_\tau\,\big], \end{gather} where $T$ is the stopping time at which an attack is declared, $\mathcal{F}_\tau$ denotes all measurements obtained up to time $\tau$, and $\mathbb{E}_j$ is the expectation under $\mathbb{P}_j$, that is the probability measure if the change occurs at time $j$. Note that $d(T)$ is called the worst-case average detection delay since it is maximized over the change point and also over all measurements obtained up to the change-point. We then consider the following minimax optimization problem: \begin{gather} \label{eq:opt_prob} \inf_{T}~ d(T) ~~ \text{subject to} ~~ \mathbb{E}_\infty[T] \geq \alpha, \end{gather} where $\mathbb{E}_\infty[T]$ is called the average false alarm period, i.e., average stopping time when no change occurs at all ($\tau = \infty$), and $\alpha$ is a prespecified lower bound for $\mathbb{E}_\infty[T]$. Let the pre- and post-attack measurement pdfs given in \eqref{eq:hyp_null} and \eqref{eq:hyp_alter} be denoted with $p_0(\mathbf{y}_t|\mathbf{x}_t)$ and $p_1(\mathbf{y}_t|\mathbf{x}_t, \mathbf{a}_t, \pmb{\sigma}_t)$, respectively. Since the dynamic system state $\mathbf{x}_t$ is not directly observed and the attack parameters $\mathbf{a}_t$ and $\pmb{\sigma}_t$ are completely determined by an attacker and hence unknown, both pdfs are unknown and time-varying. If the pre- and post-attack pdfs would be exactly known, then the well-known CUSUM algorithm would be the optimal solution to \eqref{eq:opt_prob} \cite{Moustakides_86}. Nonetheless, the system state can be inferred using the Kalman filters and the MLEs of the unknown attack parameters can be computed. Then, following a generalized likelihood ratio approach \cite[Sec.~5.3]{Basseville93}, \cite{Li_15,Necip18} and replacing the unknowns with their estimates, a generalized CUSUM algorithm can be used as a solution to \eqref{eq:opt_prob}. In this paper, in addition to early attack detection, we also aim to recover the attack-free system states. Notice that in case of no attack, i.e., for $t < \tau$, the Kalman filter for the pre-attack case (assuming no attack at all) is the optimal state estimator. However, after an attack occurs, the measurement model assumed in the pre-attack period (cf. \eqref{eq:meas_model}) is no longer true. Hence, the state estimates for the pre-attack case, i.e., $\hat{\mathbf{x}}_{t|t-1}^0$ and $\hat{\mathbf{x}}_{t|t}^0$, deviate from the actual system state $\mathbf{x}_t$ for $t \geq \tau$. Recalling that an attack occurs at an unknown time $\tau$ and the measurements follow the post-attack measurement model (cf. \eqref{eq:meas_attacked}) for $t \geq \tau$, if the attack launch time $\tau$ and the attack magnitudes $\mathbf{a}_t$ and $\pmb{\sigma}_t$ would be exactly known, then the system state would be perfectly recovered for $t \geq \tau$. Nonetheless, as we will explain more clearly in the next section, the (generalized) CUSUM algorithm always keeps a change-point estimate $\hat{\tau}$ in its memory and updates this estimate as the measurements become sequentially available over time \cite[Sec. 2.2]{Basseville93}. When an attack is declared at the stopping time $T$, $\hat{\tau}$ becomes the final change-point estimate of the (generalized) CUSUM algorithm. Furthermore, the MLEs of the attack magnitudes, i.e., $\hat{\mathbf{a}}_t$ and $\hat{\pmb{\sigma}}_t$, can be computed at each time $t$. Then, employing a Kalman filter for the post-attack case (cf. \eqref{eq:pred_fdata_alter} and \eqref{eq:meas_upd_fdata_alter}) and computing the state estimates using the MLEs of the attack parameters in the measurement update step, recovered state estimates, i.e., $\hat{\mathbf{x}}_{t|t-1}^1$ and $\hat{\mathbf{x}}_{t|t}^1$, can be obtained for $\hat{\tau} \leq t \leq T$. \section{Online Attack Detection and Estimation} \label{sec:combined} Since it is hard to distinguish noise from FDI/jamming attacks with small magnitudes, some minimum levels for the attack magnitudes need to be defined in order to control the false alarm level of a detection algorithm. We then define the change event of interest as follows: \begin{gather} \nonumber |\mathrm{a}_{k,t}| \geq \gamma,~ \forall k \in \mathcal{S}_t^f, ~~ t \geq \tau, \\ \nonumber \sigma_{k,t}^2 \geq \sigma^2,~ \forall k \in \mathcal{S}_t^j, ~~ t \geq \tau, \\ \label{eq:change_event} |\mathrm{a}_{k,t}| \geq \gamma ~ \& ~ \sigma_{k,t}^2 \geq \sigma^2, ~ \forall k \in \mathcal{S}_t^{f,j}, ~~ t \geq \tau, \end{gather} where $\gamma$ and $\sigma^2$ are the smallest attack magnitudes of interest for $|\mathrm{a}_{k,t}|$ and $\sigma_{k,t}^2$, respectively. Note that, in general, an attacker can arbitrarily choose its attack parameters, i.e., $\gamma$ and $\sigma^2$ do not restrict an attacker's strategy. In fact, attackers usually do not know such parameters. On the other hand, smarter attackers may exploit such lower bounds on the attack magnitudes in order to perform stealthy attacks with small attack magnitudes (see Sec.~\ref{sec:st_proposed}). The generalized CUSUM algorithm can then be written as follows: \begin{gather} \label{eq:gen_CUSUM} T = \inf \bigg\{m \in \mathbb{N}: \underbrace{ \max_{1 \leq j \leq m} \sum_{t=j}^{m} \underbrace{ \sup_{\mathcal{S}_t^0,\mathcal{S}_t^f,\mathcal{S}_t^j,\mathcal{S}_t^{f,j}} \, \log {\frac{\sup_{|a_{k,t}| \geq \gamma, \, k \, \in \, \mathcal{S}_t^f \, \cup \, \mathcal{S}_t^{f,j}} \, \sup_{\sigma_{k,t}^2 \geq \sigma^2, \, k \, \in \, \mathcal{S}_t^j \, \cup \, \mathcal{S}_t^{f,j}} \, p_1(\mathbf{y}_t \,|\, \hat{\mathbf{x}}_t^1, \mathbf{a}_t, \pmb{\sigma}_t) }{p_0(\mathbf{y}_t|\hat{\mathbf{x}}_t^0)}}}_{\beta_t}}_{g_m} \geq h \bigg\}, \end{gather} where $\hat{\mathbf{x}}_t^0$ and $\hat{\mathbf{x}}_t^1$ denote the state estimates for the pre- and post-attack cases, respectively, $g_m$ is the decision statistic at time $m$, $h$ is the test threshold, and $\beta_t$ is the generalized log-likelihood ratio (GLLR) calculated at time $t$. Based on \eqref{eq:gen_CUSUM}, the decision statistic can be recursively updated at each time $t$ as $g_t \gets \max\{0, g_{t-1} + \beta_t\}$, where $g_0 = 0$ \cite[Sec. 2.2]{Basseville93}. Note that whenever $g_t$ reaches zero, the (generalized) CUSUM algorithm updates its change-point estimate $\hat{\tau}$ to the current time $t$, where the initial change-point estimate is $\hat{\tau} = 1$ \cite[Sec. 2.2]{Basseville93}. That is, when $g_t \gets 0$, we have $\hat{\tau} \gets t$. Recall that the Kalman filter for the post-attack case is employed assuming the normal measurement model (cf. \eqref{eq:meas_model}) up to the unknown change-point $\tau$. We then propose to employ the Kalman filter for the post-attack case based on the estimated change-point $\hat{\tau}$. Hence, whenever the change-point estimate is updated, the Kalman filter for the post-attack case needs also to be updated. Recall further that the Kalman filter for the pre-attack case is always employed based on the normal measurement model. Hence, whenever $g_t \gets 0$, the Kalman filter estimates for the post-attack case are updated by setting them to the Kalman filter estimates for the pre-attack case, i.e., $\mathbf{P}_{t|t}^1 \gets \mathbf{P}_{t|t}^0$ and $\hat{\mathbf{x}}_{t|t}^1 \gets \hat{\mathbf{x}}_{t|t}^0$. Assuming no attack, $\hat{\mathbf{x}}_{t|t}^0$ is the optimal state estimate at time $t$. Thus, we estimate $\mathbf{x}_t$ by $\hat{\mathbf{x}}_{t|t}^0$ for the pre-attack case, i.e., $\hat{\mathbf{x}}_t^0 \triangleq \hat{\mathbf{x}}_{t|t}^0$. On the other hand, we estimate $\mathbf{x}_t$ by $\hat{\mathbf{x}}_{t|t-1}^1$ for the post-attack case, i.e., $\hat{\mathbf{x}}_t^1 \triangleq \hat{\mathbf{x}}_{t|t-1}^1$. This is because the measurement update step of the Kalman filter for the post-attack case and hence $\hat{\mathbf{x}}_{t|t}^1$ depends on estimates of the unknown attack variables (cf. \eqref{eq:meas_upd_fdata_alter}), and effects of the attack parameters $\mathbf{a}_t$ and $\pmb{\sigma}_t$ at time $t$ on $\hat{\mathbf{x}}_t^1$ need to be blocked to be able to compute the MLEs of the attack parameters in closed form (cf. numerator in \eqref{eq:gen_CUSUM}). Note that $\hat{\mathbf{x}}_{t|t-1}^1$ is computed based on the measurements up to time $t-1$, thus $\hat{\mathbf{x}}_{t|t-1}^1$ is independent of the attack parameters at time $t$. At first, it may seem unfair that we use the state estimate of the measurement update step, i.e., $\hat{\mathbf{x}}_{t|t}^0$, for the pre-attack case, and the state prediction, i.e., $\hat{\mathbf{x}}_{t|t-1}^1$, for the post-attack case. However, it essentially improves the performance of the proposed detection scheme due to the following reasons: (i) in case of no attack, we favor $p_0(\mathbf{y}_t|\hat{\mathbf{x}}_t^0)$ over $p_1(\mathbf{y}_t \,|\, \hat{\mathbf{x}}_t^1, \mathbf{a}_t, \pmb{\sigma}_t)$ and hence decrease the false alarm level of the proposed detection scheme, (ii) in case of an attack, since the state estimates for the post-attack case are recovered whereas the state estimates for the pre-attack case do not have a recovery mechanism, detection delays are not expected to increase. Furthermore, based on \eqref{eq:gen_CUSUM}, the following proposition presents the GLLR at time $t$ and the MLEs of the attack variables for the time interval between $t-1$ and $t$. \textbf{Proposition 1:} Let $e_{k,t,i} \triangleq y_{k,t,i} - \mathbf{h}_k^\mathrm{T} \hat{\mathbf{x}}_t^1$ and $\mathbf{e}_{k,t} \triangleq [e_{k,t,1}, e_{k,t,2}, \dots, e_{k,t,\lambda}]^\mathrm{T}$. Moreover, let $\delta_{k,t} \triangleq \sum_{i=1}^{\lambda} e_{k,t,i}$, $\zeta_{k,t} \triangleq \sum_{i=1}^{\lambda} e_{k,t,i}^2$, $\varrho_{k,t} \triangleq \sum_{i=1}^{\lambda} (e_{k,t,i} + \gamma)^2$, and $\varpi_{k,t} \triangleq \sum_{i=1}^{\lambda} (e_{k,t,i} - \gamma)^2$, $\forall k \in \{1,2,\dots,K\}$, $\forall t > 0$. The most likely subset of meters under no attack, under only FDI attack, under only jamming attack, and under both FDI and jamming attacks during the time interval between $t-1$ and $t$ are classified, respectively as \begin{align} \label{eq:S0_rrr} &\hat{\mathcal{S}}_t^0 = \Big\{k: u^0(\mathbf{e}_{k,t}) \leq u^f(\mathbf{e}_{k,t}), \, u^0(\mathbf{e}_{k,t}) \leq u^j(\mathbf{e}_{k,t}), \, u^0(\mathbf{e}_{k,t}) \leq u^{f,j}(\mathbf{e}_{k,t}), \, k = 1, 2, \dots, K \Big\}, \\ \label{eq:Sf_rrr} &\hat{\mathcal{S}}_t^f = \Big\{ k: u^f(\mathbf{e}_{k,t}) < u^0(\mathbf{e}_{k,t}), \, u^f(\mathbf{e}_{k,t}) \leq u^j(\mathbf{e}_{k,t}), \, u^f(\mathbf{e}_{k,t}) \leq u^{f,j}(\mathbf{e}_{k,t}), \, k = 1, 2, \dots, K \Big\}, \\ \label{eq:Sj_rrr} &\hat{\mathcal{S}}_t^j = \Big\{ k: u^j(\mathbf{e}_{k,t}) < u^0(\mathbf{e}_{k,t}), \, u^j(\mathbf{e}_{k,t}) < u^f(\mathbf{e}_{k,t}), \, u^j(\mathbf{e}_{k,t}) \leq u^{f,j}(\mathbf{e}_{k,t}), \, k = 1, 2, \dots, K \Big\}, \\ \label{eq:Sfj_rrr} &\hat{\mathcal{S}}_t^{f,j} = \Big\{ k: u^{f,j}(\mathbf{e}_{k,t}) < u^0(\mathbf{e}_{k,t}), \, u^{f,j}(\mathbf{e}_{k,t}) < u^f(\mathbf{e}_{k,t}), \, u^{f,j}(\mathbf{e}_{k,t}) < u^j(\mathbf{e}_{k,t}), \, k = 1, 2, \dots, K \Big\}, \end{align} and the GLLR at time $t$ is computed as \begin{align} \nonumber \beta_t &= \frac{K \lambda}{2} \log(\sigma_w^2) + \frac{1}{2 \sigma_w^2} \sum_{k=1}^{K} \sum_{i=1}^{\lambda} (y_{k,t,i} - \mathbf{h}_k^\mathrm{T} \hat{\mathbf{x}}_t^0)^2 \\ \label{eq:beta_t_v3_rrr} &~~ - \frac{1}{2} \bigg( \sum_{k \in \hat{\mathcal{S}}_t^0} u^0(\mathbf{e}_{k,t}) + \sum_{k \in \hat{\mathcal{S}}_t^f} u^f(\mathbf{e}_{k,t}) + \sum_{k \in \hat{\mathcal{S}}_t^j} u^j(\mathbf{e}_{k,t}) + \sum_{k \in \hat{\mathcal{S}}_t^{f,j}} u^{f,j}(\mathbf{e}_{k,t}) \bigg), \end{align} where \begin{gather}\label{eq:u0_rrr} u^0(\mathbf{e}_{k,t}) \triangleq \lambda \log(\sigma_w^2) + \frac{\zeta_{k,t}}{\sigma_w^2}, \end{gather} \begin{align} \label{eq:uf_rrr} u^f(\mathbf{e}_{k,t}) &\triangleq \begin{cases} \lambda \log(\sigma_w^2) + \frac{1}{\sigma_w^2} \sum_{i=1}^{\lambda} (e_{k,t,i} - \frac{\delta_{k,t}}{\lambda})^2 , & \mbox{if } |\frac{\delta_{k,t}}{\lambda}| \geq \gamma \\ \lambda \log(\sigma_w^2) + \frac{\varpi_{k,t}}{\sigma_w^2}, & \mbox{if } 0 \leq \frac{\delta_{k,t}}{\lambda} < \gamma \\ \lambda \log(\sigma_w^2) + \frac{\varrho_{k,t}}{\sigma_w^2}, & \mbox{if } -\gamma < \frac{\delta_{k,t}}{\lambda} < 0, \end{cases} \end{align} \begin{align} \label{eq:uj_rrr} u^j(\mathbf{e}_{k,t}) &\triangleq \begin{cases} \lambda \log(\frac{\zeta_{k,t}}{\lambda}) + \lambda, & \mbox{if } \frac{\zeta_{k,t}}{\lambda} \geq \sigma_w^2 + \sigma^2 \\ \lambda \log(\sigma_w^2 + \sigma^2) + \frac{\zeta_{k,t}}{\sigma_w^2 + \sigma^2}, & \mbox{if } \frac{\zeta_{k,t}}{\lambda} < \sigma_w^2 + \sigma^2, \end{cases} \end{align} and \begin{align} \label{eq:ufj_rrr} u^{f,j}(\mathbf{e}_{k,t}) &\triangleq \begin{cases} \lambda \log(\frac{1}{\lambda} \sum_{i=1}^{\lambda} (e_{k,t,i} - \frac{\delta_{k,t}}{\lambda})^2) + \lambda, & \mbox{if } |\frac{\delta_{k,t}}{\lambda}| \geq \gamma \mbox{ and } \frac{1}{\lambda} \sum_{i=1}^{\lambda} (e_{k,t,i} - \frac{\delta_{k,t}}{\lambda})^2 \geq \sigma_w^2 + \sigma^2 \\ \lambda \log(\sigma_w^2 + \sigma^2) + \frac{1}{\sigma_w^2 + \sigma^2} \sum_{i=1}^{\lambda} (e_{k,t,i} - \frac{\delta_{k,t}}{\lambda})^2, & \mbox{if } |\frac{\delta_{k,t}}{\lambda}| \geq \gamma \mbox{ and } \frac{1}{\lambda} \sum_{i=1}^{\lambda} (e_{k,t,i} - \frac{\delta_{k,t}}{\lambda})^2 < \sigma_w^2 + \sigma^2 \\ \lambda \log(\frac{\varpi_{k,t}}{\lambda}) + \lambda, & \mbox{if } 0 \leq \frac{\delta_{k,t}}{\lambda} < \gamma \mbox{ and } \frac{\varpi_{k,t}}{\lambda} \geq \sigma_w^2 + \sigma^2 \\ \lambda \log(\sigma_w^2 + \sigma^2) + \frac{\varpi_{k,t}}{\sigma_w^2 + \sigma^2}, & \mbox{if } 0 \leq \frac{\delta_{k,t}}{\lambda} < \gamma \mbox{ and } \frac{\varpi_{k,t}}{\lambda} < \sigma_w^2 + \sigma^2 \\ \lambda \log(\frac{\varrho_{k,t}}{\lambda}) + \lambda, & \mbox{if } -\gamma < \frac{\delta_{k,t}}{\lambda} < 0 \mbox{ and } \frac{\varrho_{k,t}}{\lambda} \geq \sigma_w^2 + \sigma^2 \\ \lambda \log(\sigma_w^2 + \sigma^2) + \frac{\varrho_{k,t}}{\sigma_w^2 + \sigma^2}, & \mbox{if } -\gamma < \frac{\delta_{k,t}}{\lambda} < 0 \mbox{ and } \frac{\varrho_{k,t}}{\lambda} < \sigma_w^2 + \sigma^2. \end{cases} \end{align} Furthermore, the MLEs of the attack magnitudes for meter $k \in \{1,2,\dots,K\}$ and for the interval between $t-1$ and $t$ are determined as follows: \begin{equation} \label{eq:a_hat_kt_v3_rrr} \hat{\mathrm{a}}_{k,t} = \begin{cases} \frac{\delta_{k,t}}{\lambda}, & \text{if} ~~ |\frac{\delta_{k,t}}{\lambda}| \geq \gamma \mbox{ and } k \in \hat{\mathcal{S}}_t^f \cup \hat{\mathcal{S}}_t^{f,j} \\ \gamma , & \text{if} ~~ 0 \leq \frac{\delta_{k,t}}{\lambda} < \gamma \mbox{ and } k \in \hat{\mathcal{S}}_t^f \cup \hat{\mathcal{S}}_t^{f,j} \\ - \gamma , & \text{if} ~~ -\gamma < \frac{\delta_{k,t}}{\lambda} < 0 \mbox{ and } k \in \hat{\mathcal{S}}_t^f \cup \hat{\mathcal{S}}_t^{f,j} \\ 0, & \text{if} ~~ k \in \hat{\mathcal{S}}_t^0 \cup \hat{\mathcal{S}}_t^j \end{cases} \end{equation} and \begin{align} \label{eq:sigma_hat_kt_v3_rrr} \hat{\sigma}_{k,t}^2 &= \begin{cases} - \sigma_w^2 + \frac{\zeta_{k,t}}{\lambda}, & \text{if} ~~ \frac{\zeta_{k,t}}{\lambda} \geq \sigma_w^2 + \sigma^2 \mbox{ and } k \in \hat{\mathcal{S}}_t^j \\ \sigma^2 , & \text{if} ~~ \frac{\zeta_{k,t}}{\lambda} < \sigma_w^2 + \sigma^2 \mbox{ and } k \in \hat{\mathcal{S}}_t^j \\ - \sigma_w^2 + \frac{1}{\lambda} \sum_{i=1}^{\lambda} (e_{k,t,i} - \frac{\delta_{k,t}}{\lambda})^2, & \mbox{if } |\frac{\delta_{k,t}}{\lambda}| \geq \gamma \mbox{ and } \frac{1}{\lambda} \sum_{i=1}^{\lambda} (e_{k,t,i} - \frac{\delta_{k,t}}{\lambda})^2 \geq \sigma_w^2 + \sigma^2 \mbox{ and } k \in \hat{\mathcal{S}}_t^{f,j} \\ \sigma^2, & \mbox{if } |\frac{\delta_{k,t}}{\lambda}| \geq \gamma \mbox{ and } \frac{1}{\lambda} \sum_{i=1}^{\lambda} (e_{k,t,i} - \frac{\delta_{k,t}}{\lambda})^2 < \sigma_w^2 + \sigma^2 \mbox{ and } k \in \hat{\mathcal{S}}_t^{f,j} \\ - \sigma_w^2 + \frac{\varpi_{k,t}}{\lambda}, & \mbox{if } 0 \leq \frac{\delta_{k,t}}{\lambda} < \gamma \mbox{ and } \frac{\varpi_{k,t}}{\lambda} \geq \sigma_w^2 + \sigma^2 \mbox{ and } k \in \hat{\mathcal{S}}_t^{f,j} \\ \sigma^2, & \mbox{if } 0 \leq \frac{\delta_{k,t}}{\lambda} < \gamma \mbox{ and } \frac{\varpi_{k,t}}{\lambda} < \sigma_w^2 + \sigma^2 \mbox{ and } k \in \hat{\mathcal{S}}_t^{f,j} \\ - \sigma_w^2 + \frac{\varrho_{k,t}}{\lambda}, & \mbox{if } -\gamma < \frac{\delta_{k,t}}{\lambda} < 0 \mbox{ and } \frac{\varrho_{k,t}}{\lambda} \geq \sigma_w^2 + \sigma^2 \mbox{ and } k \in \hat{\mathcal{S}}_t^{f,j} \\ \sigma^2, & \mbox{if } -\gamma < \frac{\delta_{k,t}}{\lambda} < 0 \mbox{ and } \frac{\varrho_{k,t}}{\lambda} < \sigma_w^2 + \sigma^2 \mbox{ and } k \in \hat{\mathcal{S}}_t^{f,j} \\ 0, & \mbox{if } k \in \hat{\mathcal{S}}_t^0 \cup \hat{\mathcal{S}}_t^f. \end{cases} \end{align} \textbf{Proof:} See Appendix~\ref{sec:proof_prop1}. The proposed online detection and estimation algorithm is summarized in Algorithm~\ref{alg:centralized}. At each time $t$, firstly the prediction step of the Kalman filters is implemented. Then, the most likely attack type (or no attack) and the attack parameters for each meter are determined. Based on the estimates of the attack variables, the measurement update step of the Kalman filters is implemented. Then, the GLLR is computed and the decision statistic is updated. If the decision statistic crosses the predetermined test threshold, then an attack is declared. Otherwise, it proceeds to the next time interval and further measurements are collected. Moreover, if the decision statistic reaches zero, the Kalman filter estimates for the post-attack case are updated before proceeding to the next time interval. Recall that Algorithm 1 keeps a change point estimate $\hat{\tau}$. Hence, after an attack is declared at time $T$, to help for a quick system recovery, $\{\hat{\mathbf{x}}_{t|t}^1: \hat{\tau} \leq t \leq T\}$ can be reported as the recovered state estimates and further, estimates of the attack types and the set of attacked meters can be reported for the time interval between $\hat{\tau}$ and $T$. \begin{algorithm}[t]\small \caption{\small Real-time attack detection and estimation} \label{alg:centralized} \baselineskip=0.4cm \begin{algorithmic}[1] \STATE Initialization: $t \gets 0$, $g_{0} \gets 0$, $\hat{\tau} \gets 1$ \WHILE {$g_t < h$} \STATE $t \gets t+1$ \STATE Implement the prediction step of the Kalman filters using \eqref{eq:pred_fdata_null} and \eqref{eq:pred_fdata_alter}. \STATE Compute $u^0(\mathbf{e}_{k,t}), u^f(\mathbf{e}_{k,t}), u^j(\mathbf{e}_{k,t}), \mbox{ and } u^{f,j}(\mathbf{e}_{k,t}), \, \forall k \in \{1, 2, \dots, K\}$ using \eqref{eq:u0_rrr}, \eqref{eq:uf_rrr}, \eqref{eq:uj_rrr}, and \eqref{eq:ufj_rrr}, respectively. \STATE Classification: compute $\hat{\mathcal{S}}_t^0, \hat{\mathcal{S}}_t^f, \hat{\mathcal{S}}_t^j, \mbox{ and } \hat{\mathcal{S}}_t^{f,j}$ using \eqref{eq:S0_rrr}, \eqref{eq:Sf_rrr}, \eqref{eq:Sj_rrr}, and \eqref{eq:Sfj_rrr}, respectively. \STATE Compute $\hat{\mathbf{a}}_t$ and $\hat{\pmb{\sigma}}_t$ using \eqref{eq:a_hat_kt_v3_rrr} and \eqref{eq:sigma_hat_kt_v3_rrr}, respectively. \STATE Implement the measurement update step of the Kalman filters using \eqref{eq:meas_upd_fdata_null} and \eqref{eq:meas_upd_fdata_alter}. \STATE Compute $\beta_t$ using \eqref{eq:beta_t_v3_rrr}. \STATE Update the decision statistic: $g_t \gets \max\{0, g_{t-1} + \beta_t\}$ \IF {$g_t = 0$} \STATE $\hat{\tau} \gets t$ \STATE $\hat{\mathbf{x}}_{t|t}^1 \gets \hat{\mathbf{x}}_{t|t}^0$ \STATE $\mathbf{P}_{t|t}^1 \gets \mathbf{P}_{t|t}^0$ \ENDIF \ENDWHILE \STATE $T \gets t$, declare a cyber-attack. \end{algorithmic} \end{algorithm} \textit{Remark 2:} The detector parameters $\gamma$ and $\sigma^2$ can be determined by the system designer based on the system requirements, i.e., the desired level of false alarm rate. The system designer firstly determines the desired minimum level of average false alarm period, i.e., $\alpha$. If the frequency of false alarms needs to be decreased, then $\alpha$ is chosen higher. After choosing $\alpha$, the system designer chooses the values of $\gamma$, $\sigma^2$, and the test threshold $h$ in order to achieve an average false alarm period that is larger than or equal to $\alpha$. For a higher level of $\alpha$, higher values of $\gamma$, $\sigma^2$, and $h$ need to be chosen. On the other hand, higher values of $\gamma$, $\sigma^2$, and $h$ lead to larger detection delays. Hence, the system designer can choose such parameters to strike a desired balance between false alarm rate and the detection delays. \section{Stealthy Attacks and Countermeasures} \label{sec:stealth} We firstly discuss stealthy attacks against a CUSUM detector, which can be employed in a simple case where the pre- and post-attack pdfs are known. Discussion on the stealthy attacks against a CUSUM detector is useful since similar forms of stealthy attacks can be performed against all CUSUM-based detectors. We then particularly discuss stealthy attacks against the proposed detector, i.e., Algorithm 1, where the pre- and post-attack pdfs are unknown and time-varying, as explained in Sec.~\ref{sec:combined}. Finally, we present some countermeasures against the considered stealthy attacks. \subsection{Stealthy Attacks Against a CUSUM Detector} \label{sec:st_cusum} Suppose the pre- and post-attack measurement pdfs are known and denoted with $f_0$ and $f_1$, respectively such that $y_t \sim f_0$ for $t < \tau$ and $y_t \sim f_1$ for $t \geq \tau$. In this case, the CUSUM algorithm is the optimum solution to \eqref{eq:opt_prob} \cite{Moustakides_86}, given by \begin{gather}\label{eq:cusum} T_{\text{CUSUM}} = \inf\{t: g_t \geq h\}, ~ g_t = \max\{0, g_{t-1} + \ell_t\}, \end{gather} where $T_{\text{CUSUM}}$ denotes the stopping time, $h$ is the test threshold, $g_t$ is the decision statistic at time $t$, and $\ell_t \triangleq \log\big(\frac{f_1(y_t)}{f_0(y_t)}\big)$ is the log-likelihood ratio (LLR) at time $t$. \noindent \subsubsection{Non-persistent attacks} The CUSUM algorithm is mainly designed for detecting persistent changes, i.e., it is assumed that an attack is launched at an unknown time $\tau$ and continued thereafter. It accumulates evidence (LLR) over time and declares a change (attack/anomaly) only if the accumulated evidence is reliably high (cf. \eqref{eq:cusum}). Hence, with the purpose of increasing the detection delay of the CUSUM algorithm, a smart attacker can design an on-off attacking strategy to perform an intermittent (non-persistent) attack. That is, it can attack for a period of time, then wait for a period of time and repeat this procedure over its attacking period with the aim of keeping the decision statistic of the CUSUM algorithm, i.e., $g_t$, below the decision threshold $h$ for $t \geq \tau$ so that the attack can be continued without being noticed. Since the measurements $y_t$ are essentially random variables, an attacker cannot control the decision statistic deterministically; it can control it only on average. Note that attackers usually need simple and effective attacking strategies that require the minimum possible knowledge. Let $\mathrm{KL}(f_1,f_0) \triangleq \int{f_1(y) \log(\frac{f_1(y)}{f_0(y)}) dy}$ denote the Kullback-Leibler (KL) divergence between $f_1$ and $f_0$. The following proposition presents a simple necessary condition for an attacker, having the knowledge of $f_0$ and $f_1$, to determine the on and off periods of a non-persistent stealthy attack against the CUSUM detector. \textbf{Proposition 2:} Let $h' \geq \mathrm{KL}(f_1,f_0)$ be a threshold chosen by the attacker. The on and off periods have to be chosen as \begin{gather}\nonumber \mathrm{T}_{\text{on}} \leq \frac{h'}{\mathrm{KL}(f_1,f_0)} \mbox{ and } \mathrm{T}_{\text{off}} > \frac{h'}{\mathrm{KL}(f_0,f_1)} \end{gather} in order to satisfy $\mathbb{E}[g_t] \leq h'$ for $t \geq \tau$, where $\mathrm{T}_{\text{on}}$ and $\mathrm{T}_{\text{off}}$ are positive integers denoting the on and off periods, respectively. \begin{proof} We have \begin{align}\nonumber \mathbb{E}[g_t] &= \mathbb{E}[\max\{0, g_{t-1} + \ell_t\}] \\ \label{eq:low_bnd} &\geq \max\{0, \mathbb{E}[g_{t-1} + \ell_t]\} = \max\{0, \mathbb{E}[g_{t-1}] + \mathbb{E}[\ell_t]\}, \end{align} where the inequality is due to the fact that $g_{t-1} + \ell_t$ can take negative values in general ($-\infty < \ell_t < \infty$). If $y_t \sim f_1$, then \begin{gather} \nonumber \mathbb{E}[\ell_t] = \int{f_1(y) \log(\frac{f_1(y)}{f_0(y)}) dy} = \mathrm{KL}(f_1,f_0) > 0, \end{gather} and if $y_t \sim f_0$, then \begin{gather} \nonumber \mathbb{E}[\ell_t] = \int{f_0(y) \log(\frac{f_1(y)}{f_0(y)}) dy} = -\mathrm{KL}(f_0,f_1) < 0. \end{gather} Let \begin{align} \label{eq:rho_t} \rho_t \triangleq \max\{0, \mathbb{E}[g_{t-1}] + \mathbb{E}[\ell_t]\} \end{align} be a lower bound on $\mathbb{E}[g_t]$ (cf. \eqref{eq:low_bnd}). Since (i) $g_t = 0$ at $t = 0$ (hence, $\mathbb{E}[g_0] = 0$) and (ii) for $t \leq \tau-1$, $\mathbb{E}[\ell_t] = -\mathrm{KL}(f_0,f_1) < 0$, based on \eqref{eq:rho_t}, we have $\rho_t = 0$ for $t \leq \tau-1$. Further, based on \eqref{eq:rho_t}, with an on period of $\mathrm{T}_{\text{on}} = {h'}/{\mathrm{KL}(f_1,f_0)}$ (when $y_t \sim f_1$) and an off period of $\mathrm{T}_{\text{off}} = {h'}/{\mathrm{KL}(f_0,f_1)}$ (when $y_t \sim f_0$), we have $0 \leq \rho_t \leq h'$ for $t \geq \tau$. Since $\rho_t$ is a lower bound for $\mathbb{E}[g_t]$ for $t > 0$, in order to satisfy $\mathbb{E}[g_t] \leq h'$ for $t \geq \tau$, the on period needs to be chosen smaller than ${h'}/{\mathrm{KL}(f_1,f_0)}$ and/or the off period needs to be chosen larger than ${h'}/{\mathrm{KL}(f_0,f_1)}$. \end{proof} For a stealthy attack, the attacker needs to choose $h'$ such that $h' < h$. Further, $\Delta \triangleq h - h'$ can be considered as a margin for non-detectability. That is, as $\Delta$ increases, $g_t, t \geq \tau$ takes smaller values on average, that increases the average detection delay of the CUSUM algorithm. Based on Proposition 2, the average on (attacking) period is upper bounded with \begin{equation}\nonumber \bar{\mathrm{T}}_{\text{on}} \triangleq \frac{\mathrm{T}_{\text{on}}}{\mathrm{T}_{\text{on}} + \mathrm{T}_{\text{off}}} < \frac{\mathrm{KL}(f_0,f_1)}{\mathrm{KL}(f_1,f_0) + \mathrm{KL}(f_0,f_1)}. \end{equation} Note that the upper bound on $\bar{\mathrm{T}}_{\text{on}}$ is independent of $h'$ and hence of $\Delta$. However, for a higher $\bar{\mathrm{T}}_{\text{on}}$, either $\mathrm{T}_{\text{on}}$ needs to be increased or $\mathrm{T}_{\text{off}}$ needs to be decreased, that both increases $\mathbb{E}[g_t], t \geq \tau$ and hence decreases the average detection delay. Further, note that a stealthy attack can especially be effective if the system has strict false alarm constraints, i.e., requiring high level of false alarm periods and equivalently a high threshold $h$. \subsubsection{Persistent attacks} The CUSUM algorithm may not be effective in attack detection if the attack does not comply with the presumed attack model. If an attacker knows that the CUSUM detector is employed based on the post-attack pdf $f_1$, then it can perform a stealthy persistent attack with a post-attack density $f_1' \neq f_1$. The design goal can be keeping $f_1'$ as closest as possible to the post-attack pdf $f_1$ for a strong attack while limiting the risk of being detected. Since the attack is of persistent nature, $f_1'$ needs to be designed such that the decision statistic of the CUSUM algorithm does not increase on average over time. Since the CUSUM algorithm accumulates the LLRs over time (cf. \eqref{eq:cusum}), the LLR can be designed such that it takes non-positive values on the average, i.e., $\mathbb{E}[\ell_t] \leq 0, t > 0$. Then, since $\mathbb{E}[\ell_t] = -\mathrm{KL}(f_0,f_1) < 0$ for $t \leq \tau - 1$, the condition $\mathbb{E}[\ell_t] \leq 0, t \geq \tau$ needs to be satisfied. Considering the KL divergence $\mathrm{KL}(f_1',f_1)$ as the information distance between $f_1'$ and $f_1$, the following optimization problem can be considered: \begin{align} \label{eq:opt_prob_stealth} \min_{f_1'} ~ \mathrm{KL}(f_1',f_1) ~~ \text{subject to} ~~ \mathbb{E}[\ell_t] \leq 0, t \geq \tau, \end{align} where the solution is presented in the following proposition. \textbf{Proposition 3:} The solution of \eqref{eq:opt_prob_stealth} is given by \begin{gather}\label{eq:cond_pers} \{f_1': \mathrm{KL}(f_1',f_0) = \mathrm{KL}(f_1',f_1)\}. \end{gather} \begin{proof} Let $y_t \sim f_1'$ for $t \geq \tau$. Then, \begin{align} \nonumber \mathbb{E}[\ell_t] &= \int {f_1'(y) \log\Big(\frac{f_1(y)}{f_0(y)}\Big) dy} \\ \nonumber &= \int {f_1'(y) \log(f_1(y)) dy} - \int {f_1'(y) \log(f_0(y)) dy} \\ \nonumber &= \int {f_1'(y) \log(f_1(y)) dy} - \int {f_1'(y) \log(f_1'(y)) dy} + \int {f_1'(y) \log(f_1'(y)) dy} - \int {f_1'(y) \log(f_0(y)) dy} \\ \nonumber &= \int {f_1'(y) \log\Big(\frac{f_1(y)}{f_1'(y)}\Big) dy} + \int {f_1'(y) \log\Big(\frac{f_1'(y)}{f_0(y)}\Big) dy} \\ \nonumber &= - \mathrm{KL}(f_1',f_1) + \mathrm{KL}(f_1',f_0). \end{align} Then, the constraint in \eqref{eq:opt_prob_stealth}, i.e., $\mathbb{E}[\ell_t] \leq 0$, implies that $- \mathrm{KL}(f_1',f_1) + \mathrm{KL}(f_1',f_0) \leq 0$, which is equivalent to $\mathrm{KL}(f_1',f_1) \geq \mathrm{KL}(f_1',f_0)$. Hence, the minimum value of $\mathrm{KL}(f_1',f_1)$ is $\mathrm{KL}(f_1',f_0)$. \end{proof} Proposition 3 presents a simple strategy for an attacker to perform a persistent stealthy attack against a CUSUM detector. As an example, let $f_0 \sim \mathcal{N}([\mu_0 \, \mu_0]^\mathrm{T},\sigma^2 \, \mathbf{I}_2)$ and $f_1 \sim \mathcal{N}([\mu_1 \, \mu_1]^\mathrm{T},\sigma^2 \, \mathbf{I}_2)$. If \begin{gather}\nonumber f_1' \sim \mathcal{N}\bigg( \begin{bsmallmatrix} \frac{1}{2} (\mu_0 + \mu_1) \\ \frac{1}{2} (\mu_0 + \mu_1) \end{bsmallmatrix}, \begin{bsmallmatrix} \sigma^2 & \varphi \\ \varphi & \sigma^2 \end{bsmallmatrix}\bigg), \end{gather} then it can be checked that \begin{align} \nonumber \mathrm{KL}(f_1',f_0) &= \mathrm{KL}(f_1',f_1) \\ \nonumber &= \frac{1}{4 \sigma^2} (\mu_1 - \mu_0)^2 + \frac{1}{2} \log\Big(\frac{\sigma^4}{\sigma^4 - \varphi^2}\Big), \end{align} where the correlation term $\varphi$ can be chosen such that $\sigma^4 - \varphi^2 > 0$. \subsection{Stealthy Attacks Against Algorithm 1} \label{sec:st_proposed} In the actual problem under consideration, the pre- and post-attack measurement pdfs, i.e., $p_0(\mathbf{y}_t|\mathbf{x}_t)$ and $p_1(\mathbf{y}_t|\mathbf{x}_t, \mathbf{a}_t, \pmb{\sigma}_t)$, are based on some unknown and time-varying variables and hence the results in the previous subsection do not directly apply. The proposed algorithm estimates the pre- and post-attack pdfs at time $t$ as $p_0(\mathbf{y}_t|\hat{\mathbf{x}}_t^0)$ and $p_1(\mathbf{y}_t|\hat{\mathbf{x}}_t^1, \hat{\mathbf{a}}_t, \hat{\pmb{\sigma}}_t)$, respectively where $\hat{\mathbf{x}}_t^0$ and $\hat{\mathbf{x}}_t^1$ are computed via the Kalman filters, $\hat{\mathbf{a}}_t$ is given in \eqref{eq:a_hat_kt_v3_rrr}, and $\hat{\pmb{\sigma}}_t$ is given in \eqref{eq:sigma_hat_kt_v3_rrr}. Then, the GLLR at time $t$ is computed as follows (cf. \eqref{eq:gen_CUSUM}): \begin{gather}\label{eq:gllr} \beta_t = \log\Big(\frac{p_1(\mathbf{y}_t|\hat{\mathbf{x}}_t^1, \hat{\mathbf{a}}_t, \hat{\pmb{\sigma}}_t)}{p_0(\mathbf{y}_t|\hat{\mathbf{x}}_t^0)}\Big). \end{gather} Note that computing $\hat{\mathbf{x}}_t^0$ and $\hat{\mathbf{x}}_t^1$ requires the knowledge of all previously taken measurements, i.e., $\{\mathbf{y}_j, j \leq t\}$. Hence, for an attacker, estimating the pre- and post-attack pdfs and hence computing $\beta_t$ and $g_t$ requires monitoring all the system-wide measurements at all times, which is practically infeasible. Although determining the online attack parameters for a stealthy attack is difficult in general, we provide below a brief analysis of the proposed algorithm and discuss possible stealthy attacks against it based on this analysis and the intuitions gained in Sec.~\ref{sec:st_cusum}. As before, since the measurements are random, an attacker can control the decision statistic only on the average. Firstly, based on \eqref{eq:gllr}, $\beta_t$ depends on how close (relatively) the state estimates $\hat{\mathbf{x}}_t^0$ and $\hat{\mathbf{x}}_t^1$ to the actual system state $\mathbf{x}_t$ and how accurate the MLEs of the attack magnitudes $\hat{\mathbf{a}}_t$ and $\hat{\pmb{\sigma}}_t$ compared to the actual attack magnitudes ${\mathbf{a}}_t$ and ${\pmb{\sigma}}_t$ are. During the pre-attack period, the measurements $\mathbf{y}_t$ follow the normal measurement model \eqref{eq:meas_model} and hence $\mathbf{a}_t = \mathbf{0}$ and $\pmb{\sigma}_t = \mathbf{0}$. Since $\hat{\mathbf{x}}_t^0$ is computed assuming no attack, for $t \leq \tau-1$, $\hat{\mathbf{x}}_t^0$ is usually a better estimate of the actual system state $\mathbf{x}_t$ compared to $\hat{\mathbf{x}}_t^1$ due to the possible ML estimation errors in computing $\hat{\mathbf{a}}_t$, $\hat{\pmb{\sigma}}_t$, and $\hat{\mathbf{x}}_t^1$ (recall that (cf. \eqref{eq:meas_upd_fdata_alter}) $\hat{\mathbf{x}}_t^1$ is computed based on $\hat{\mathbf{a}}_t$ and $\hat{\pmb{\sigma}}_t$). Then, $p_0(\mathbf{y}_t|\hat{\mathbf{x}}_t^0)$ is expected to fit better to $\mathbf{y}_t$ compared to $p_1(\mathbf{y}_t|\hat{\mathbf{x}}_t^1, \hat{\mathbf{a}}_t, \hat{\pmb{\sigma}}_t)$, i.e., we usually have $p_0(\mathbf{y}_t|\hat{\mathbf{x}}_t^0) \geq p_1(\mathbf{y}_t|\hat{\mathbf{x}}_t^1, \hat{\mathbf{a}}_t, \hat{\pmb{\sigma}}_t)$ for $t \leq \tau-1$. Then, based on \eqref{eq:gllr}, $\beta_t$ is expected to take nonpositive values in general, that makes $g_t \approx 0$ a good approximation for $t \leq \tau-1$. The main aim of an attacker against the smart grid is deviating the state estimates from the actual system state as much as possible without being detected. Hence, it needs to keep $g_t$ below the level of $h$ as long as possible for $t \geq \tau$ (cf. \eqref{eq:gen_CUSUM}). Similar to the stealthy attacks against the CUSUM algorithm discussed in Sec.~\ref{sec:st_cusum}, an attacker can either follow an on-off attacking strategy or perform persistent attacks that do not comply with the presumed attack magnitudes (cf. \eqref{eq:change_event}). Note that in case of an attack, i.e., for $t \geq \tau$, $\hat{\mathbf{x}}_t^0$ deviates from $\mathbf{x}_t$ since it is computed assuming no attack. On the other hand, $\hat{\mathbf{x}}_t^1$ is a recovered state estimate, but it is subject to possible ML estimation errors. \subsubsection{Non-persistent attacks} Since Algorithm 1 is a CUSUM-based detector, stealthy intermittent (on-off) attacking can be performed against it. Specifically, during the on periods, an attacker can choose its attack magnitudes comparable to or larger than the presumed lower bounds on the attack magnitudes, i.e., $\gamma$ and $\sigma^2$, with the purpose of a strong attack. However, as explained before, analytically deriving the on-off periods and the online attack magnitudes seems infeasible for an attacker. Hence, a smart attacker, having the knowledge of system and detector parameters, can determine its attack parameters based on an offline simulation. When the attack complies with the presumed attack magnitudes, during an on period, $\hat{\mathbf{x}}_t^0$ usually deviates from the actual system state more than $\hat{\mathbf{x}}_t^1$ due to the recovery mechanism in computing $\hat{\mathbf{x}}_t^1$ (cf. \eqref{eq:meas_upd_fdata_alter}). That makes $p_1(\mathbf{y}_t|\hat{\mathbf{x}}_t^1, \hat{\mathbf{a}}_t, \hat{\pmb{\sigma}}_t)$ a better fit to $\mathbf{y}_t$ compared to $p_0(\mathbf{y}_t|\hat{\mathbf{x}}_t^0)$ on the average. Then, if an on-off attack is performed, during the on periods, based on \eqref{eq:gllr}, usually $\beta_t$ takes non-negative values and $g_t$ increases. Further, at the beginning of an off period after an on period, although the attack magnitudes are zero, i.e., $\mathbf{a}_t = \pmb{\sigma}_t = \mathbf{0}$, since $\hat{\mathbf{x}}_t^1$ is still a better (recovered) state estimate compared to $\hat{\mathbf{x}}_t^0$, $p_1(\mathbf{y}_t|\hat{\mathbf{x}}_t^1, \hat{\mathbf{a}}_t, \hat{\pmb{\sigma}}_t)$ can still be a better fit to $\mathbf{y}_t$ and $g_t$ may further increase. Note that during an off period, $\hat{\mathbf{x}}_t^0$ is not expected to deviate further since $\mathbf{y}_t$ now follows the normal measurement model. On the other hand, $\hat{\mathbf{a}}_t$, $\hat{\pmb{\sigma}}_t$, and $\hat{\mathbf{x}}_t^1$ are still subject to possible ML estimation errors. That may make $p_0(\mathbf{y}_t|\hat{\mathbf{x}}_t^0)$ a better fit to $\mathbf{y}_t$ over time and as the off period is continued, $\beta_t$ may start to take nonpositive values on the average. Since $g_t$ is expected to increase in an on period as well as in the beginning of an off period, the level of attack magnitudes during the on periods needs to be carefully chosen in accordance with the aim of keeping the highest value of $g_t$ below the decision threshold $h$, for $t \geq \tau$. \subsubsection{Persistent attacks} Since Algorithm 1 relies on the lower bounds $\gamma$ and $\sigma^2$ defined on the attack magnitudes (cf. \eqref{eq:change_event}), an attacker can perform persistent stealthy attacks using significantly small attack magnitudes compared to $\gamma$ and $\sigma^2$ so that Algorithm 1 becomes ineffective to detect such attacks. In case of such small-magnitude stealthy attacks, the attack magnitudes ${\mathbf{a}}_t$ and ${\pmb{\sigma}}_t$ are close to zero for $t \geq \tau$ and due to the possible ML estimation errors in computing $\hat{\mathbf{a}}_t$ and $\hat{\pmb{\sigma}}_t$, $\hat{\mathbf{x}}_t^1$ usually deviates more compared to $\hat{\mathbf{x}}_t^0$, similarly to the pre-attack period discussed before. Then, $p_0(\mathbf{y}_t|\hat{\mathbf{x}}_t^0)$ fits better to $\mathbf{y}_t$ compared to $p_1(\mathbf{y}_t|\hat{\mathbf{x}}_t^1, \hat{\mathbf{a}}_t, \hat{\pmb{\sigma}}_t)$ on the average. Hence, in case of a persistent small-magnitude attack, based on \eqref{eq:gllr}, $\beta_t$ usually takes nonpositive values and the approximation $g_t \approx 0$ can still be valid. Note that even if an attacker has an incomplete knowledge about the system and detector parameters, it can still perform stealthy attacks with small attack magnitudes. Although such small-magnitude attacks have minimal effects on the system performance in the short run, they can be effective over long periods of time. Hence, they need to be detected with reasonable detection delays. \subsection{Countermeasures Against Stealthy Attacks} \label{sec:st_counter} We firstly discuss countermeasures against the on-off attacking strategy, i.e., the non-persistent stealthy attacks. We then discuss a countermeasure against the persistent stealthy attacks where the attacks may not comply with the presumed attack model/magnitudes. Finally, we propose a new detection scheme, i.e., Algorithm \ref{alg:countermeasure}, that simultaneously employs Algorithm \ref{alg:centralized} and the proposed countermeasures with the aim of being effective against a diverse range of potential cyber-attacks. \subsubsection{Countermeasures against the non-persistent stealthy attacks} \label{sec:non_persistent} Timely detection of cyber-attacks against the smart grid is crucial since any failure may quickly spread over the network. Hence, in practice, detection delays cannot be allowed to be arbitrarily large. Note that the optimization problem stated in \eqref{eq:opt_prob} does not impose any constraints on the maximum tolerable detection delay. In an alternative quickest detection problem considered in \cite{Moustakides14}, the objective is maximizing the probability of detection in at most $\eta$ time units after an attack occurs, where $\tau \leq T < \tau+\eta$ needs to be satisfied for a successful detection. In the extreme case of the considered non-persistent stealthy attacks, the attacker can choose its on period as $\mathrm{T}_{\text{on}} = 1$. In such a case, the attack needs to be detected using the measurements obtained during a single time interval in the attacking regime and hence $\eta = 1$ needs to be chosen. Then, we consider the following optimization problem, proposed in \cite{Moustakides14}: \begin{gather}\label{eq:opt_shewhart} \sup_T ~ p(T) ~~ \text{subject to} ~~ \mathbb{E}_\infty[T] \geq \alpha, \end{gather} where \begin{gather}\label{eq:worst_prob} \nonumber p(T) = \inf_{\tau} \, \essinf_{\mathcal{F}_\tau} \, \mathbb{P}_\tau \big(T = \tau\,|\mathcal{F}_\tau, T\geq\tau\,\big) \end{gather} is the worst-case (in the Lorden's sense) detection probability after obtaining the first measurements in the attacking regime. \vspace{0.2cm} \textbf{Shewhart Test}: In case the pre- and post-attack pdfs are known as in Sec.~\ref{sec:st_cusum}, the optimum solution to \eqref{eq:opt_shewhart} is the Shewhart test \cite[Theorem 2.3]{Moustakides14}, given by \begin{gather}\label{eq:Shewhart} T_S = \inf \{t: \ell_t \geq \nu\}, \end{gather} where $T_S$ denotes the stopping time and the threshold $\nu$ is determined such that $\mathbb{P}_{\infty}(\ell_1 \geq \nu) = {1}/{\alpha}$. Note that the Shewhart test in \eqref{eq:Shewhart} is, in fact, the repeated log-likelihood ratio test (LLRT), i.e., at each time, the LLR is compared with a certain threshold and an alarm is triggered at the first time the LLR crosses the threshold. We then propose the Shewhart test as a countermeasure to the non-persistent stealthy attacks against the CUSUM detector. Note that $\nu$ needs to be chosen sufficiently high to prevent frequent false alarms. \vspace{0.2cm} \textbf{Generalized Shewhart Test}: In case the pre- and post-attack pdfs are unknown and time-varying, we can only compute the GLLR $\beta_t$. Hence, as a countermeasure, we propose to employ the generalized Shewhart test, i.e., the repeated generalized LLRT (GLLRT), given by \begin{gather}\label{GLLRT} T' = \inf\{t: \beta_t \geq \phi\}, \end{gather} where $T'$ is the stopping time and $\phi$ is the test threshold. Again, a sufficiently high threshold needs to be chosen to prevent frequent false alarms. Moreover, similar to Algorithm 1, by choosing higher $\gamma$ and/or $\sigma^2$, false alarm rate of the generalized Shewhart test can be reduced (see Remark 2). Note that the generalized Shewhart test is expected to be mainly effective in detecting significant instantaneous increases in the level of GLLR and hence in detecting non-persistent stealthy attacks during the on periods. That is, even if an attack may be missed by Algorithm 1 since the decision statistic $g_t$ may not achieve reliably high values for $t \geq \tau$ due to the subsequent off period after an on period, the generalized Shewhart test can detect such non-persistent increases during the on periods. \subsubsection{A countermeasure against the persistent stealthy attacks} \label{subsec:counter} Non-parametric detection techniques do not assume any attack models and only evaluate the deviation of measurement statistics from the baseline (no attack) statistics. However, they are usually less effective if the attacks comply with the presumed attack models. As explained before, a persistent stealthy attack can be performed if an attack does not match the considered attack models or magnitudes. For such cases, parametric detectors such as Algorithm 1 and the generalized Shewhart test become ineffective and the non-parametric detection techniques become more appropriate. In case of no attack, i.e., for $t < \tau$, $c_t \triangleq {\mathbf{r}_t}^T {\mathbf{Q}_t}^{-1} \mathbf{r}_t$ is a chi-square random variable with $K \lambda$ degrees of freedom \cite{Brumback87}, where $\mathbf{r}_t$ denotes the measurement innovation signal at time $t$, given as \begin{gather} \label{eq:residual} \nonumber \mathbf{r}_t \triangleq \mathbf{y}_t - \mathbf{H} \hat{\mathbf{x}}_{t|t-1}^{0}, \end{gather} and $\mathbf{Q}_t$ is the measurement prediction covariance matrix at time $t$, calculated as follows: \begin{gather} \label{eq:meas_pred_cov} \nonumber \mathbf{Q}_t \triangleq \mathbf{H} \mathbf{P}_{t|t-1} \mathbf{H}^T + \sigma_w^2 \, \mathbf{I}_{K \lambda}. \end{gather} Notice that although the distribution of the measurements $\mathbf{y}_t$ is time-varying and unknown due to the dynamic system state $\mathbf{x}_t$, the distribution of $c_t$ is time-invariant and known in case of no attack, i.e., for $t < \tau$. Hence, whether the sequence $\{c_t\}$ fits to the chi-squared distribution or not can be evaluated via a goodness-of-fit test and if not, an attack/anomaly is declared. \vspace{0.2cm} \textbf{Sliding-Window Chi-Squared Test}: We partition the range of $c_t$, i.e., $[0, \infty)$, into $M$ mutually exclusive and disjoint intervals $I_j, j = 1,2, \dots, M$ such that $p_1 = P(c_t \in I_1)$, $p_2 = P(c_t \in I_2)$, \dots, $p_M = P(c_t \in I_M)$. Hence, $p_1, p_2, \dots, p_M$ denote the probabilities that $c_t$ belongs to the intervals $I_1, I_2, \dots, I_M$, respectively for $t < \tau$, where $\sum_{j=1}^{M} p_j = 1$. The intervals $I_1, I_2, \dots, I_M$ can be determined using the cumulative distribution function (cdf) of a chi-squared random variable with $K \lambda$ degrees of freedom. Then, the null hypothesis is that $c_t$ belongs to the intervals $I_1, I_2, \dots, I_M$ with probabilities $p_1, p_2, \dots, p_M$, respectively. We propose to employ an online test to evaluate whether the most recent sliding window of $c_t$'s fits to the null hypothesis. Let the size of the sliding window be $L$. Then, the sliding window at time $t$, denoted with $\mathbf{W}_t$, consists of $\{c_j: t-L+1 \leq j \leq t\}$. Let the number of samples in $\mathbf{W}_t$ belonging to the predetermined disjoint intervals be denoted with $N_{1,t}, N_{2,t}, \dots, N_{M,t}$, respectively where $\sum_{i=1}^{M} N_{i,t} = L, \forall t$. Since we have a multinomial distribution where the expected number of samples in the disjoint intervals are $L p_1, L p_2, \dots, L p_M$, respectively, the Pearson's chi-squared test can be used to evaluate the goodness of fit, that can be written as \begin{gather}\label{chi_squ} T'' = \inf\{t: \chi_t \geq \varphi\}, \end{gather} where \begin{gather}\label{eq:Pearson} \chi_t = \sum_{i=1}^{M} \frac{(N_{i,t} - L p_i)^2}{L p_i} \end{gather} is the asymptotically (as $L \rightarrow \infty$) chi-squared distributed test statistic with $M-1$ degrees of freedom under the null hypothesis, $\varphi$ is the test threshold that can be determined using the cdf of a chi-squared random variable for a desired significance level, and $T''$ denotes the stopping time. To improve the accuracy of the detector, $M$ can be chosen higher. Note, however, that as $M$ is increased, the window size $L$ needs also to be increased to improve the reliability of the goodness-of-fit test, that will cause larger detection delays. {The chi-squared test does not assume any attack model a priori and it only evaluates deviation of observed measurements from the baseline statistics corresponding to the normal system operation. We propose to use the chi-squared test to have a detection scheme that is robust against (i) low-magnitude stealthy attacks that corresponds to small deviations from the baseline for which our proposed parametric detectors (Algorithm 1 and the generalized Shewhart test) become ineffective to detect, and (ii) attacks that do not comply with the presumed hybrid attack model, e.g., non-Gaussian or correlated jamming noise.} \textit{Remark 3:} The proposed chi-squared test is a sequential version of the Pearson's chi-squared test since the most recent sliding window of samples is used in the test. Furthermore, the proposed test is different from the outlier detector in \cite{Brumback87}, that makes sample by sample decisions, i.e., it declares a single sample as either normal and anomalous. The proposed test is thus more reliable and more sensitive to small deviations from the baseline since it considers long-term deviations by evaluating a sliding window of samples. \subsubsection{Proposed final detection scheme} Our aim is to obtain a detection mechanism that is effective against a significantly wide range of cyber-attacks. Hence, we propose to simultaneously employ Algorithm 1, the generalized Shewhart test, and the sliding-window chi-squared test and declare an attack at the first time instant one of the detectors declares an attack (if any). Hence, \begin{gather}\nonumber \tilde{T} = \inf\{T,T',T''\} \end{gather} is the proposed stopping time. We summarize the proposed detector in Algorithm \ref{alg:countermeasure}. Note that the average false alarm period of Algorithm \ref{alg:countermeasure} is less than the minimum of the (individual) average false alarm periods of Algorithm 1, the generalized Shewhart test, and the sliding-window chi-squared test. Hence, sufficiently high thresholds, i.e., $h$, $\phi$ and $\varphi$, need to be chosen to prevent frequent false alarms. Furthermore, to have the same average false alarm periods $\alpha$ for Algorithms 1 and 2, the threshold $h$ needs to be chosen higher in Algorithm 2 and the thresholds $\phi$ and $\varphi$ need to be chosen such that the individual average false alarm periods of the generalized Shewhart test and the sliding-window chi-squared tests are greater than $\alpha$. \begin{algorithm}[t]\small \caption{\small Real-time detection of hybrid and stealthy attacks} \label{alg:countermeasure} \baselineskip=0.4cm \begin{algorithmic}[1] \STATE Initialization: $t \gets 0$, $g_{0} \gets 0$, $\hat{\tau} \gets 1$, choose the entries of the initial sliding window of the chi-squared test, i.e., $\mathbf{W}_0$, as realizations of a chi-squared random variable with $K \lambda$ degrees of freedom. \WHILE {$g_t < h$ and $\beta_t < \phi$ and $\chi_t < \varphi$} \STATE $t \gets t+1$ \STATE Implement the lines 4--15 in Algorithm 1. \STATE $\mathbf{r}_t \gets \mathbf{y}_t - \mathbf{H} \hat{\mathbf{x}}_{t|t-1}^{0}$ \STATE $\mathbf{Q}_t \gets \mathbf{H} \mathbf{P}_{t|t-1} \mathbf{H}^T + \sigma_w^2 \, \mathbf{I}_{K \lambda}$ \STATE $c_t \gets {\mathbf{r}_t}^T {\mathbf{Q}_t}^{-1} \mathbf{r}_t$ \STATE Update $\mathbf{W}_t$ with the most recent entry $c_t$. \STATE Update $N_{1,t}, N_{2,t}, \dots, N_{M,t}$ and compute $\chi_t$ using \eqref{eq:Pearson}. \ENDWHILE \STATE $\tilde{T} \gets t$, declare a cyber-attack. \end{algorithmic} \end{algorithm} \section{Simulation Results} \label{sec:numerical} In this section, we evaluate the performance of the proposed detection schemes via simple case studies in an IEEE-14 bus power system, where $K = 23$ and $N = 13$. The system matrix $\mathbf{A}$ is chosen to be an identity matrix, the measurement matrix $\mathbf{H}$ is determined based on the IEEE-14 bus power system, and $\lambda = 5$ is chosen. The initial state variables are obtained through the DC optimal power flow algorithm for case-14 in MATPOWER \cite{Zimmerman11}. The system noise variances are chosen as $\sigma_v^2 = \sigma_w^2 = 10^{-4}$. Furthermore, the parameters of Algorithm 1 are chosen as $\gamma = 0.022$ and $\sigma^2 = 10^{-2}$. In Algorithm 2, the threshold of the generalized Shewhart test is chosen as $\phi = 10$. Moreover, for the chi-squared test, the window size is chosen as $L = 80$, number of disjoint intervals are chosen as $M = 5$, the probabilities are chosen as $p_1=p_2=\dots=p_5 = 0.2$, and the intervals $I_1, I_2, \dots, I_5$ are determined accordingly as $I_1 = [0,102.081)$, $I_2 = [102.081,110.5475)$, $I_3 = [110.5475,118.2061)$, $I_4 = [118.2061,127.531)$, and $I_5 = [127.531,\infty)$ based on the cdf of a chi-squared random variable with $K \lambda = 115$ degrees of freedom. The threshold of the Pearson's chi-squared test, i.e., $\varphi = 25.0133$, is chosen based on the significance level of $5 \times 10^{-5}$ for a chi-squared random variable with $M-1 = 4$ degrees of freedom. The thresholds of the generalized Shewhart and the chi-squared tests are chosen such that the (individual) average false alarm periods of these tests are in the order of $10^4$. The cyber-attacks are launched at $t = 100$. Firstly, we evaluate the performance of the proposed schemes in case of an FDI-only attack, a jamming-only attack, and a hybrid attack. We then evaluate the performance in case of stealthy hybrid attacks. Particularly, we consider a non-persistent stealthy attack and a small-magnitude persistent stealthy attack, and illustrate the performance improvement obtained with the proposed countermeasures against such stealthy attacks. Next, we illustrate the mean squared error (MSE) vs. time plot for the recovered and non-recovered state estimates in case of a hybrid cyber-attack. {Finally, we evaluate the performance of the proposed schemes in case of a network topology attack/failure.} \subsection{Case 1: FDI Attack} \label{sec:num_fdi} We firstly consider a random and time-varying persistent FDI attack where at each time the attacker chooses the magnitudes of the injected false data and the set of attacked meters randomly. In particular, at each time, the attacker compromises the measurements of each meter with probability $0.5$ and injects the realizations of the uniform random variable $\mathcal{U}[-0.02,0.02]$ to the attacked meters. Fig.~\ref{fig:fdata_tradeoff} illustrates the tradeoff between the average detection delay and the average false alarm period for the proposed algorithms and also {three benchmark tests, namely the nonparametric CUSUM test in \cite{yang2016false},} the Euclidean detector \cite{Manandhar14} and the cosine-similarity metric based detector \cite{Rawat15} that both check the dissimilarity between the actual and the predicted measurements (by the Kalman filter) and declare an anomaly if the dissimilarity metric is greater than certain thresholds. {Since a nonlinear power system model is studied in \cite{yang2016false} and we use a linear system model, we include a modified version of the nonparametric CUSUM detector for the linear case. The stopping time and the update of the decision statistic over time for the modified nonparametric CUSUM detector are given as follows: \begin{align} \nonumber \bar{T} &\triangleq \inf\left\{t: S_t \geq q \right\}, \\ \nonumber S_t &= S_{t-1} + \delta_t, \\ \nonumber \delta_t &\triangleq \|\mathbf{y}_t - \mathbf{H} \hat{\mathbf{x}}_{t|t-1}^0\| - \mathbb{E}_0\big[\|\mathbf{y}_t - \mathbf{H} \hat{\mathbf{x}}_{t|t-1}^0\|\big], \end{align} where $\bar{T}$ denotes the corresponding stopping time, $S_t$ is the decision statistic at time $t$ where $S_0 = 0$, $q$ is the test threshold that controls the false alarm rate of the detector, and $\mathbb{E}_0[\|\mathbf{y}_t - \mathbf{H} \hat{\mathbf{x}}_{t|t-1}^0\|]$ denotes the expectation of the $L_2$ norm of the measurement innovation signal in the pre-change case, computed via a Monte Carlo simulation. The nonparametric CUSUM detector accumulates the difference between magnitude of the measurement innovation signal and its expected value in the pre-change case (normal system operation).} We observe that the proposed algorithms significantly outperform the benchmark tests. Moreover, Algorithm 1 slightly outperforms Algorithm 2. This is because the countermeasures introduced in Algorithm 2 slightly increase the false alarm rate of Algorithm 2. Note that in obtaining the tradeoff curve for Algorithm 2, we keep the thresholds $\phi$ and $\varphi$ constant and only vary $h$. \begin{figure} \center \includegraphics[width=78mm]{fdata_tradeoff.eps} \caption{Average detection delay vs. average false alarm period for the proposed detectors and the benchmark tests in case of a random FDI attack.} \label{fig:fdata_tradeoff} \end{figure} We then illustrate the performance of the proposed algorithms as the magnitude of the injected false data varies while keeping the false alarm rate constant. We again consider the random and time-varying persistent FDI attack described above, but this time the magnitudes of the injected data are realizations of $\mathcal{U}[-\theta,\theta]$, where $\theta$ varies between $0.009$ and $0.03$. Through Fig.~\ref{fig:fdata_add_vs_mag}, we see the advantage of the proposed countermeasures as the magnitude of the false data takes very small values. For instance, when $\theta = 0.009$, the average detection delays of Algorithm 1 and Algorithm 2 are $48.02$ and $39.45$, respectively. \begin{figure} \center \includegraphics[width=78mm]{fdata_add_vs_mag.eps} \vspace{-0.1cm} \caption{Average detection delay vs. magnitude of the injected false data for the proposed detectors in case of a random FDI attack, where the average false alarm period is approximately $1.5\times10^{4}$.} \label{fig:fdata_add_vs_mag} \end{figure} \subsection{Case 2: Jamming Attack} \label{sec:num_jam} Next, we consider a random and time-varying persistent jamming attack. At each time, an attacker jams the measurements of each meter with probability $0.5$ where the variances of the jamming noise are the realizations of the uniform random variable $\mathcal{U}[2\times10^{-4},4\times10^{-4}]$. Fig.~\ref{fig:jamming_tradeoff} presents the delay to false alarm curve for the proposed algorithms and the benchmark tests. Further, we evaluate the performance as the magnitude of the jamming noise variance varies by keeping the false alarm rate constant. In particular, jamming noise variances are chosen as realizations of $\mathcal{U}[\vartheta,2 \vartheta]$, where $\vartheta$ is varied between $0.75 \sigma_w^2$ and $3 \sigma_w^2$. Through Fig.~\ref{fig:jamming_add_vs_mag}, we again observe smaller detection delays in Algorithm 2 compared to Algorithm 1 in case of very small attack magnitudes. \begin{figure} \center \includegraphics[width=78mm]{jamming_tradeoff.eps} \caption{Average detection delay vs. average false alarm period for the proposed detectors and the benchmark tests in case of a random jamming attack.} \label{fig:jamming_tradeoff} \end{figure} \begin{figure} \center \includegraphics[width=78mm]{jamming_add_vs_mag.eps} \vspace{-0.1cm} \caption{Average detection delay vs. variance of the jamming noise for the proposed detectors in case of a random jamming attack, where the average false alarm period is approximately $1.5\times10^{4}$.} \label{fig:jamming_add_vs_mag} \end{figure} \subsection{Case 3: Hybrid FDI/Jamming Attack} \label{sec:num_combined} Next, we consider a random and time-varying persistent hybrid attack. The attack is combined over the system and it may also be combined over a subset of meters. In particular, we consider the attacks described in Sec.~\ref{sec:num_fdi} and Sec.~\ref{sec:num_jam} altogether. Hence, the attacker chooses a random subset of meters for FDI attack and another random subset of meters for jamming attack, where these subsets might overlap with each other. The attack magnitudes for FDI and jamming attacks are realizations of $\mathcal{U}[-0.02,0.02]$ and $\mathcal{U}[2\times10^{-4},4\times10^{-4}]$, respectively. In Fig.~\ref{fig:combined_tradeoff}, for the same levels of false alarm rate, we observe smaller detection delays compared to Figures \ref{fig:fdata_tradeoff} and \ref{fig:jamming_tradeoff}, as expected. \begin{figure} \center \includegraphics[width=78mm]{combined_tradeoff.eps} \caption{Average detection delay vs. average false alarm period for the proposed detectors and the benchmark tests in case of a hybrid attack.} \label{fig:combined_tradeoff} \end{figure} \subsection{Case 4: Non-persistent Stealthy Attack} \label{sec:nonper_st} Next, we consider a stealthily designed on-off attack. Particularly, after the attack is launched at $t = 100$, the attacker performs a hybrid attack as described in Sec.~\ref{sec:num_combined} where the magnitudes of the FDI and jamming attacks are realizations of $\mathcal{U}[-0.01,0.01]$ and $\mathcal{U}[10^{-4},2\times10^{-4}]$, respectively and the on and off periods are $\mathrm{T}_{\text{on}} = 1$ and $\mathrm{T}_{\text{off}} = 3$, respectively. As an example, we choose the maximum tolerable detection delay as $50$ time units and if the attack cannot be detected within this period, we assume that the attack is missed. In Fig.~\ref{fig:miss_non_persistent}, we present the missed detection ratio versus average false alarm period for the proposed algorithms and the benchmark tests. As discussed in Sec.~\ref{sec:non_persistent}, against the non-persistent attacks, mainly the generalized Shewhart test is expected to perform well. That is, due to the off periods, even though the accumulated evidence supporting change may not become reliably high to declare an attack in Algorithm 1, the GLLR may take high values during the on periods. On the other hand, since the threshold of the generalized Shewhart test is chosen very high ($\phi = 10$) to reduce the false alarm level of Algorithm 2, the missed detection ratios in Algorithms 1 and 2 are almost the same for the small levels of average false alarm period, i.e., for the small test thresholds. However, for higher levels of average false alarm period, the missed detection ratio of Algorithm 2 significantly decreases compared to Algorithm 1 and the advantage of introducing the generalized Shewhart test in Algorithm 2 becomes visible in detecting the non-persistent stealthy attacks. \begin{figure} \center \includegraphics[width=78mm]{miss_non_persistent.eps} \caption{Missed detection ratio vs. average false alarm period for the proposed detectors and the benchmark tests in case of a stealthy non-persistent attack, where the attack is assumed to be missed if it is not detected within $50$ time units.} \label{fig:miss_non_persistent} \end{figure} \subsection{Case 5: Persistent Stealthy Attack} \label{sec:per_st} Although the considered lower bounds $\gamma$ and $\sigma^2$ on the attack magnitudes are already very small, an attacker may still perform a persistent stealthy attack using even lower attack magnitudes. Recall that we have previously showed in Figures \ref{fig:fdata_add_vs_mag} and \ref{fig:jamming_add_vs_mag} the advantage of Algorithm 2 over Algorithm 1 as the attack magnitudes get smaller for the FDI and jamming attacks, respectively. This time, we consider a hybrid attack with even smaller attack magnitudes where the magnitudes of FDI and jamming attacks are chosen as realizations of $\mathcal{U}[-0.005,0.005]$ and $\mathcal{U}[0.5\times10^{-4},10^{-4}]$, respectively. We present the missed detection ratio versus the average false alarm period curve for the proposed algorithms and the benchmark tests in Fig.~\ref{fig:miss_persistent}. We observe that Algorithm 2 significantly outperforms Algorithm 1 due to the introduced non-parametric chi-squared test in Algorithm 2. Since the attack magnitudes are very small, the proposed parametric tests become ineffective to detect such stealthy attacks. Note that although the non-parametric goodness-of-fit tests such as the chi-squared test becomes more successful in detecting such small-magnitude stealthy attacks, they in general lead to longer detection delays compared to the considered parametric tests since they usually require more samples for a reliable decision, mainly because they ignore all the prior knowledge about the post-attack case. \begin{figure} \center \includegraphics[width=78mm]{miss_persistent.eps} \caption{Missed detection ratio vs. average false alarm period for the proposed detectors and the benchmark tests in case of a stealthy small-magnitude persistent attack, where the attack is assumed to be missed if it is not detected within $50$ time units.} \label{fig:miss_persistent} \end{figure} \subsection{Algorithm 1 vs. Countermeasures Against Stealthy Attacks} With the purpose of illustrating the advantages of additional countermeasures employed in Algorithm 2 more clearly, Fig.~\ref{fig:bar_plot} shows a comparison between Algorithm 1 and the countermeasures in case of stealthy attacks described in Sec.~\ref{sec:nonper_st} and Sec.~\ref{sec:per_st}. Here, the individual average false alarm periods of Algorithm 1, the generalized Shewhart test, and the sliding-window chi-squared test are nearly equal to each other and for the non-persistent and persistent stealthy attacks, the figure shows the ratios over all trials at which each algorithm detects the attack first (with the minimum delay), where more than one test may simultaneously declare an attack with the minimum delay. Through the figure, we observe that the generalized Shewhart and the sliding-window chi-squared tests outperform Algorithm 1 in case of non-persistent and persistent stealthy attacks, respectively. Hence, together with the results obtained through Figures \ref{fig:miss_non_persistent} and \ref{fig:miss_persistent}, we can conclude that in case of stealthy attacks, the countermeasures improve the detection performance of Algorithm 2 compared to Algorithm 1. \begin{figure} \center \includegraphics[width=78mm]{bar_plot.eps} \caption{Ratio of trials at which Algorithm 1, the generalized Shewhart test, and the sliding-window chi-squared test detect the stealthy attacks first (with the minimum delay), where the individual average false alarm periods of the algorithms are approximately $1.5\times10^{4}$.} \label{fig:bar_plot} \end{figure} \subsection{Recovered State Estimates} Fig.~\ref{fig:mse_state} presents the MSE versus time curve for the recovered, i.e., $\hat{\mathbf{x}}_{t|t}^1$, and the non-recovered, i.e., $\hat{\mathbf{x}}_{t|t}^0$, state estimates during the pre-change period, i.e., for $t < 100$, and the first $50$ time units after a hybrid FDI/jamming attack is launched to the system at $\tau = 100$. The FDI and jamming attacks are both of persistent nature as described in Sec.~\ref{sec:num_combined} and the attack magnitudes are realizations of $\mathcal{U}[-0.1,0.1]$ and $\mathcal{U}[1,2]$, respectively. Through the figure, we observe that the MSE of the recovered state estimates is significantly smaller than the MSE of the non-recovered state estimates. Further, we observe that the recovered state estimates slightly deviate from the actual system state $\mathbf{x}_t$ over the attacking period. This is due to the fact that the MLEs of the attack variables are computed based on the recovered state estimates (cf. \eqref{eq:a_hat_kt_v3_rrr} and \eqref{eq:sigma_hat_kt_v3_rrr}) and also the recovered state estimates are computed based on the MLEs of the attack variables (cf. \eqref{eq:meas_upd_fdata_alter}). Hence, the ML estimation errors accumulate over time during the attacking period. However, since the attacks can be quickly detected with the proposed real-time detection schemes, the deviation of the recovered state estimates is not expected to be significantly high at the detection time. Furthermore, recall that during the pre-attack period, whenever the decision statistic of Algorithm 1 reaches zero, the state estimates for the post-attack case are updated as being equal to the state estimates for the pre-attack case. Since the decision statistic frequently reaches zero during the pre-attack period, the ML estimation errors in computing the recovered state estimates do not accumulate in the pre-attack period. \begin{figure} \center \includegraphics[width=78mm]{mse_state.eps} \caption{MSE vs. time for the recovered ($\hat{\mathbf{x}}_{t|t}^1$) and non-recovered ($\hat{\mathbf{x}}_{t|t}^0$) state estimates in case of a hybrid attack.} \label{fig:mse_state} \end{figure} \subsection{{Case 6: Topology Attack/Fault}} { Except the proposed nonparametric chi-squared test, the proposed methods are prone to the errors in the measurement matrix $\mathbf{H}$ due to either cyber-attacks or faults. This is because Algorithm 1 and the generalized Shewhart test are designed for a given $\mathbf{H}$ (see the hybrid attack model in \eqref{eq:meas_attacked}), whereas the chi-squared test does not depend on attack model assumptions.} { On the other hand, the specific version of topology attack/failure in which some rows of $\mathbf{H}$ seem zero to the control center (although they are not) corresponds to DoS attacks, which is covered by the considered hybrid attack model (see Remark 1). For instance, if the link between two buses in a power grid breaks down due to an attack or fault, then the row in $\mathbf{H}$ corresponding to the power-flow measurement between these buses is changed accordingly such that the corresponding measurement signal becomes unavailable to the control center. Since the hybrid attack model covers DoS attacks as a special case, such topology attacks/faults can be detected by the proposed detectors. In Fig.~\ref{fig:topology}, we illustrate the performance of the proposed and the benchmark algorithms in detecting a line break between buses 9 and 10 in the IEEE-14 bus power system.} \begin{figure} \center \includegraphics[width=78mm]{topology.eps} \caption{{Average detection delay vs. average false alarm period for the proposed detectors and the benchmark tests in case of a network topology attack/fault.}} \label{fig:topology} \end{figure} \section{Conclusions} \label{sec:conc} In this paper, we have studied the real-time detection of hybrid FDI/jamming attacks in the smart grid. {For a given network topology, we have modeled the smart grid as a linear dynamic system and employed Kalman filters for state estimation.} We have proposed an online CUSUM-based attack detection and estimation algorithm that is robust to unknown and time-varying attack parameters. We have also presented online estimates of the attack parameters in closed form and recovered state estimates in case of a cyber-attack. Furthermore, we have introduced and analyzed stealthy attacks against CUSUM-based detectors and specifically against the proposed algorithm, where the main aim of stealthy attacks is to prevent the detection or at least to increase the detection delays. {We have presented the generalized Shewhart test and the sliding-window chi-squared test as countermeasures against non-persistent and persistent stealthy attacks, respectively.} Through extensive simulations, we have illustrated that the proposed algorithms can timely and reliably detect {hybrid FDI/jamming attacks and stealthy attacks against CUSUM-based detectors, that correspond to} a significantly diverse range of potential cyber-attacks targeting the smart grid. {Moreover, the simulations illustrate the effectiveness of the proposed state recovery mechanism to mitigate the effects of cyber-attacks on the state estimation mechanism.} {The proposed hybrid attack model does not cover network topology attacks as a special case. As a future work, the generalized state estimation mechanism \cite{Alsac98} can be considered where both the system state and the network topology are estimated based on power flow/injection measurements and measurements regarding the status of network switches and line breakers, and countermeasures can be developed against advanced topology attacks where attackers simultaneously perform hybrid FDI/jamming and network topology attacks.}
{'timestamp': '2018-06-29T02:04:01', 'yymm': '1803', 'arxiv_id': '1803.00128', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00128'}
arxiv
\subsection{Physical Description} % \begin{figure}[t] \centering \includegraphics[width=0.96\linewidth]{fig/leg_diagram.pdf} \caption{Diagram of the robot leg showing the actuation sequence (active motors are shown in red). Each leg has 2 motors, each one independently actuating a single DOF. } \label{fig:leg_diagram} \end{figure} The hexapod microrobot is based on silicon microelectromechanical systems (MEMS) technology. The robot's legs are made using linear motors actuating planar pin-joint linkages~\citep{Contreras2016DurabilityOS}. A tethered single-legged walking robot was previously demonstrated using this technology~\citep{contreras_first_2017}. The hexapodal robot is assembled using three chips. The two chips on the side each have 3 of the leg assemblies, granting six 2 degree-of-freedom (DOF) legs for the whole robot. The top chip acts to hold the leg chips together for support, and to route the signals for off-board power and control. Overall, the robot measures \SI{13}{\milli\meter} long by \SI{9.6}{\milli\meter} wide and stands at \SI{8}{\milli\meter} tall with an overall weight of approximately \SI{200}{\milli\gram}. \subsection{Actuation} Each of the robot's legs has 2-DOF in the plane of fabrication, as shown in \fig{fig:leg_diagram}. Both DOFs are actuated, thus the leg has 2 motors, one to actuate the vertical DOF to lift the robot's body and a second to actuate the horizontal DOF for the vertical stride. The actuators used for the legs are electrostatic gap-closing inchworm motors~\cite{penskiy_optimized_2013}. During a full cycle, each leg moves \SI{0.6}{\milli\meter} vertically with a horizontal stride of \SI{2}{\milli\meter}. For more details on the actuation mechanism used on our microrobot, we refer readers to ~\cite{Contreras2017DynamicsOE}. \subsection{Simulator} % \begin{wrapfigure}{r}{0.46\linewidth} \centering \vspace{-10pt} \includegraphics[width=0.98\linewidth]{fig/simulator.pdf} \caption{The simulated micro walker.} \label{fig:vrep} \vspace{-8pt} \end{wrapfigure} In our experimental simulations, we used the robotics simulator V-REP~\citep{vrep} for constructing a scaled-up simulated model of the physical microrobot (see \fig{fig:vrep}). Since V-REP was not designed with simulation of microrobots in mind, it was not capable of simulating the dynamics of the leg joints accurately and would produce wildly unstable models at the desired scale. We chose to scale up the size of the robot in simulation by a factor of $100$ in order to account for the issues with scaling in simulation (all the experimental results are re-normalized to the dimensions of the real robot). We believe that this re-scaling still allows meaningful results to be produced for several reasons. First, the experiments performed in this paper are meant to demonstrate the validity of the proposed controller, and the learning approach for training an actual physical microrobot. The policies trained are not meant to work on the real robot without any re-tuning or modification. Second, the simulator still allows to test the basic motion patterns we want to implement on the microrobot. Finally, our contribution lends credibility to the potential application of Bayesian-inspired optimization methods to a setting where evaluations can be costly and time consuming. \subsection{Central Pattern Generators} \label{sec:bg:cpg} Central pattern generators (CPGs) are neural circuits found in nearly all vertebrates, which produce periodic outputs without sensory input~\citep{Junzhi_Yu_2014}. CPGs are also a common choice for designing gaits for robot locomotion~\citep{Ijspeert2008}. We chose to use CPGs for our controller because they are capable of reproducing a wide variety of different gaits simply by manipulating the relative coupling phase biases between oscillators. This allows us to easily produce a variety of gait patterns without having to manually program those behaviors. In addition, CPGs are not computationally intensive and can have on-chip hardware implementations using VLSI or FPGA. This makes them well suited to be eventually used in our physical microrobot, where the processing power is limited. CPGs can be modeled as a network of coupled non-linear oscillators where the dynamics of the network are determined by the set of differential equations % \begin{align} \dot{\phi_i} &= \omega_{i} + \displaystyle \sum_{j} (\omega_{ij}r_j\sin(\phi_j - \phi_i - \varphi_{ij}))\,,\\ \ddot{r_i} &= a_r (\dfrac{a_r}{4} (R_i - r_i) - \dot{r_i})\,,\\ \ddot{x_i} &= a_x (\dfrac{a_x}{4} (X_i - x_i) - \dot{x_i})\,, \end{align} % where $\phi_{i}$ is a state variable corresponding to the phase of the oscillations and $\omega_{i}$ is the target frequency for the oscillations. $\omega_{ij}$ and $\varphi_{ij}$ are the coupling weights and phase biases which change how the oscillators influence each other. To implement our desired gaits, we only need to modify the phase biases between the oscillators~$\phi_{ij}$. $r_{i}$ and $x_{i}$ are state variables for the amplitude and offset of each oscillator, and $R_{i}$ and $X_{i}$ are control parameters for the desired amplitude and offset. The constants $a_{r}$ and $a_{x}$ are constant positive gains and allow us to control how quickly the amplitude and offset variables can be modulated. A more detailed explanation of the network can be found in Crespi's original work~\citep{Crespi_2007}. One of the foremost benefits of using a CPG controller is a drastic reduction in the number of parameters~$\parameters_i$ we need to optimize. Overall, the parameters that we consider during the optimization are $\parameters = \left[\omega, R, X_{l}, X_{r} \right]$ where $\omega$ is the frequency of the oscillators and $R$ is the phase difference between each of the vertical-horizontal oscillator pairs. In order to allow for directional control, $X_{l}$ and $X_{r}$ are the amplitudes of the left and right side oscillators respectively. \subsection{Bayesian Optimization} \label{sec:bg:BO} % Even with a complete CPG network, some amount of parameter tuning is necessary to obtain efficient locomotion. To automate the parameter tuning, we use Bayesian optimization (BO), an approach often used for global optimization of black box functions~\citep{Kushner1964,Jones2001,Calandra2015a}. We formulate the tuning of the CPG parameters as the optimization % \begin{align} \parameters^* = \maximize_{\parameters}\, \objfunc{\parameters}\,, \label{eq:optimization} \end{align} % where $\parameters$ are the CPG parameters to be optimized w.r.t. the objective function of choice~$\objfuncNo$ (\eg, walking speed, which we investigate in \sec{sec:results:soo}). At each iteration, BO learns a model $\tilde{\objfuncNo}: \parameters \rightarrow \objfunc{\parameters}$ from the dataset of the previously evaluated parameters and corresponding objective values measured~$\dataset=\{\parameters, \objfunc{\parameters}\}$. Subsequently, the learned model $\tilde{\objfuncNo}$ is used to perform a ``virtual'' optimization through the use of an acquisition function which controls the trade-off between exploration and exploitation. Once the model is optimized, the resulting set of parameters $\parameters^*$ is finally evaluated on the real system, and is added to the dataset together with the corresponding measurement $\objfunc{\parameters^*}$ before starting a new iteration. A common model used in BO for learning the underlying objective, and the one that we consider, is Gaussian processes~\citep{Rasmussen2006}. For more information regarding BO, we refer the readers to~\citep{Jones2001,Shahriari2016}. \subsection{Multi-objective Bayesian Optimization} A special case of the optimization task of \eq{eq:optimization} is multi-objective optimization~\citep{Branke2008a}. Often times in robotics\footnote{As well as in nature~\citep{Hoyt1981}.}, there are multiple conflicting objectives that need to be optimized simultaneously, resulting in design trade-offs (e.g., walking speed vs energy efficiency which we investigate in \sec{sec:results:moo}). When multiple objectives are taken into consideration, there is no longer necessarily a single optimum solution, but rather the goal of the optimization became to find the set of Pareto optimal solutions~\citep{Pareto1906}, which also takes the name of Pareto front~(PF). Formally, the PF is the set of parameters that are not dominated, where a set of parameters~$\parameters_1$ is said to dominate $\parameters_2$ when % \begin{align} \left\{ \begin{array}{l l} \forall i \in \{1,\dots ,\numbersubobj\}: &\objfuncNo_i(\parameters_1) \leq \objfuncNo_i(\parameters_2)\\ \exists j \in \{1,\dots , \numbersubobj\}: &\objfuncNo_j(\parameters_1) < \objfuncNo_j(\parameters_2) \end{array} \right. \end{align} Intuitively, if $\parameters_1 \dom \parameters_2$, then $\parameters_1$ is preferable to $\parameters_2$ as it never performs worse, but at least in one objective function it performs strictly better. However, different dominant variables are equivalent in terms of optimality as they represent different trade-offs. Multi-objective optimization can often be difficult to perform as it might require a significant amount of experiments. This is especially true with our microrobot where large number of experiments can wear-and-tear the robot. As a result, the number of evaluations allowed to find the Pareto set of solutions is limited. Luckily for us, there exist extensions of BO which address multi-objective optimization. In particular, the multi-objective Bayesian optimization algorithm that we consider is ParEGO~\citep{Knowles2006}. The main intuition of ParEGO is that at every iteration, the multiple objectives can be randomly scalarized into a single objective (via the augmented Tchebycheff function), which is subsequently optimized as in the standard Bayesian optimization algorithm (by creating a response surface, and then optimizing its acquisition function). For more information about multi-objective Bayesian optimization we refer the reader to~\citep{Wagner2010}. \subsection{Contextual Bayesian Optimization} % Another special case of the optimization task of \eq{eq:optimization}, is contextual optimization. In contextual optimization, we assume that there are multiple correlated, but slightly different, tasks which we want to solve, and that they are identified by a context variable~$\context$. An example (which we investigate in \sec{sec:results:context1}) might be walking on inclined slopes, where the contextual variable is the angle of the slope. The contextual optimization can hence be formalized as % \begin{align} \parameters^* = \maximize_{\parameters}\, \objfunc{\parameters,\context}\,, \end{align} % where for each context~$\context$, a potentially different set of parameters~$\parameters^*$ exists. The main advantage compared to treating each task independently is that, in contextual optimization, we can exploit the correlation between the tasks to generalize, and as a result quickly learn how to solve a new context. Specifically, in this paper we consider contextual Bayesian optimization (cBO)~\citep{Metzen2015} which extends the classic BO framework from \sec{sec:bg:BO}. Contextual Bayesian Optimization learns a joint model $\tilde{\objfuncNo}: \{\parameters,\context\} \rightarrow \objfunc{\parameters}$, but now, at every iteration the acquisition function is optimized with a constrained optimization where the context $\context$ is provided by the environment. However, because the model jointly model the context-parameter space, experience learned in one context can be generalized to similar contexts. By utilizing cBO, we will show in \sec{sec:results} that our microrobot can learn to walk (and generalize) to different environmental contexts such as walking uphill and curving. \subsection{Controller Implementation} We built our controller following the setup described in \sec{sec:bg:cpg}, using a network of 12 coupled phase oscillators (one per motor). In order to translate the output of each of the oscillators into motor actuation, we calculate the oscillator outputs for each vertical-horizontal motor pair using the piecewise function % \begin{align} \begin{cases} x_{i} + r_{i}cos(\phi_{i}), x_{j} + r_{j}cos(\phi_{j}) &\text{if }\phi_{i}>\pi,\phi_{j}>\pi\,,\\ x_{i} + r_{i}, x_{j} + r_{j}cos(\phi_{j}) &\text{if }\phi_{i}\leq\pi,\phi_{j}>\pi\,,\\ x_{i} + r_{i}, x_{j} + r_{j} &\text{if }\phi_{i}\leq\pi,\phi_{j}\leq\pi\,,\\ x_{i} + r_{i}cos(\phi_{i}), x_{j} - r_{j} &\text{if }\phi_{i}\leq\pi,\phi_{j}>\pi\,, \end{cases} \end{align} % where the $i$th oscillator outputs to its respective vertical motor and the $j$th oscillator outputs to its respective horizontal motor. This allows us to discard the parts of the oscillator output that are not consistent with the physical constraints of the physical robot, since the actual leg actuators cannot partially retract (see \fig{fig:cpg}). We choose to mutually couple all six of the vertical oscillators (with a coupling weight of 4 to ensure quick convergence on stable limit cycles). We refer the reader to \cite{Crespi_2007} for a more comprehensive discussion of oscillator coupling in CPGs. Each of the horizontal oscillators are also coupled with their respective vertical oscillator in order to encapsulate the dynamics of each leg. We chose to implement four different gaits with the CPG -- tripod, ripple, wave, and four-two (see \fig{fig:gaits}). For a more detailed description of these gaits we refer the reader to~\cite{Campos2010}. We use the same frequency and phase difference for the whole network in order to reduce the number of parameters and speed up the rate of convergence. We use two separate parameters for amplitude, each controlling the left and right set of legs respectively. This choice of parameters allows us to control the turning of the robot which is necessary for path planning and corrections for not walking straight. \subsection{Learning to Walk Straight} \label{sec:results:soo} We optimized the four gaits considered (i.e., dual tripod, ripple, wave, and four-two) using as our objective function the walking speed of the robot (measured as the distance traveled after $\SI{1}{\second}$). Since some gaits result in curved motions, we also penalized the speed objective with a term proportional to the drift from the axis of locomotion. The optimization used the 4 parameters outlined in \sec{sec:bg:cpg} and was repeated 50 times for each of the gaits. In \fig{fig:soo}, we show the median and 65th percentiles of the best solution obtained so far in the trials. The results show that the optimizer was able to learn to walk from scratch within 50 iterations. Moreover, it can be noted that the optimized tripod and ripple are the fastest gaits at $\sim \SI[per-mode=symbol]{1.1}{\centi\meter\per\second}$ and $\sim \SI[per-mode=symbol]{1.2}{\centi\meter\per\second}$ respectively. \subsection{Multi-objective Gait Optimization} \label{sec:results:moo} % \begin{figure}[t] \centering \begin{subfigure}{0.49\linewidth} \includegraphics[width=0.99\linewidth]{fig/Dual_Tripod.pdf} \caption{Dual Tripod} \label{fig:moo:1} \end{subfigure} \hfill \begin{subfigure}{0.49\linewidth} \includegraphics[width=0.99\linewidth]{fig/Ripple.pdf} \caption{Ripple} \label{fig:moo:2} \end{subfigure} \\ \begin{subfigure}{0.49\linewidth} \includegraphics[width=0.99\linewidth]{fig/Wave.pdf} \caption{Wave} \label{fig:moo:3} \end{subfigure} \hfill \begin{subfigure}{0.49\linewidth} \includegraphics[width=0.99\linewidth]{fig/Four-Two.pdf} \caption{Four-Two} \label{fig:moo:4} \end{subfigure} \caption{Performance measured for the four gaits, and the corresponding PFs. ParEGO is able to quickly explore the PF for each of our four gaits.} \label{fig:moo} \end{figure} % In the previous simulation we only considered walking speed as our objective. However, for practical gait design, energy efficiency is another objective of great interest, particularly when it comes to designing gaits for a microrobot with real energy restrictions. For this reason, we now consider a multi-objective optimization setting and compare the different gaits w.r.t. both walking speed, and energy consumption. The energy consumption of the robot was computed by measuring the forces exerted by each of the 12 motors along the axis of actuation and calculating the power used to actuate the motors. Since the retraction of the legs is spring powered, the energy input in the cycle is only during motor extension. Hence, we only consider the cost of extending the legs. With the mass of the robot and the time of each trial being held constant, we quantify the energy efficiency of a gait and estimate the cost of transport. % \begin{wrapfigure}{r}{0.52\linewidth} \vspace{-12pt} \centering \includegraphics[width=\linewidth]{fig/all_pareto.pdf} \caption{Comparison of the PFs obtained for the different gaits.} \label{fig:moo:all} \vspace{-10pt} \end{wrapfigure} We optimized the four gaits again with the same 4 parameters as the previous optimization, but this time using multi-objective Bayesian optimization with a budget of 50 iterations. % \begin{figure}[t] \centering \includegraphics[width=0.95\linewidth]{fig/discovery2.pdf} \caption{PF of the unrestrained gait optimization versus the best performance of the four nature-inspired gaits. The faster solutions outperform the fastest nature-inspired gaits, albeit with more energy expenditure. However, the inability of the optimizer to match the performance of the gaits at lower speeds within 1250 trials shows that the gait parametrization can help limit the search space to find better solutions easier. \textit{(top)} Pattern for two of the discovered gaits.} \label{fig:moo:new} \end{figure} % In \fig{fig:moo} we can see the performance measured and Pareto fronts obtained for the different gaits. To better compare the PF from the different gaits, we also visualized just the PFs together in \fig{fig:moo:all}. From these results, we can see how the tripod gait dominates the other gaits for speed $<\SI[per-mode=symbol]{0.6}{\centi\meter\per\second}$, while Ripple dominates when the speed is $>\SI[per-mode=symbol]{0.6}{\centi\meter\per\second}$, hence giving a clear indication of which gait is preferable under different circumstances. \subsection{Discovering New Gaits with Multi-objective Optimization} In addition to optimizing the four nature-inspired gaits, we also tested multi-objective optimization on the walker without constraining to using predefined gaits. To parametrize the oscillator couplings, we thus discretized each gait into intervals of constant length. Within each of these intervals, we assume that each leg steps exactly once, keeping each of the oscillators in the CPG in phase with each other. This allows us to parametrize gaits by assigning each leg a point during each interval where it begins stepping. While this parametrization excludes certain gaits that cannot be expressed in this form, we leave the study of more sophisticated gait parameterizations for gait discovery to future works. The resulting multi-objective optimization task had 8 parameters (frequency, phase difference between horizontal and vertical motors, and the six gait coupling parameters). Due to the higher parameter dimensionality, and because this training was not intended for on-line training, we ran the optimization for 250 iterations in order to allow a more comprehensive exploration of the optimization space. We also repeated the optimization five times for a total of 1250 trials. In \fig{fig:moo:new} we can see the Pareto front for the resulting gaits. We found that the fastest discovered gaits were actually able to outperform the four nature-inspired gaits implemented by a substantial margin. Even while penalizing curved paths, the fastest discovered gait outperformed Ripple (the fastest nature-inspired gait we found) by almost $50\%$. However, for low-speed gaits, the nature inspired gaits out-perform the gaits produced by the unconstrained optimization, indicating the optimization did not yet fully converged to the optimal PF. \subsection{Learning to Walk on Inclined Surfaces} \label{sec:results:context1} % \begin{figure}[t] \centering \includegraphics[width=0.96\linewidth]{fig/contextual_generalized_mod.pdf} \caption{Performance of the contextual policy (median and 65th percentile) for a wide range of inclines. The policy was trained only at 5, 10 and 15 degrees, but it was capable of generalizing smoothly to unseen inclinations. } \label{fig:incline} \end{figure} \begin{figure}[t] \centering \begin{subfigure}{0.49\linewidth} \centering \includegraphics[width=\columnwidth]{fig/contextual_vs_normal.pdf} \caption{Inclined surface.} \label{fig:contextual:1} \end{subfigure} \hfill \begin{subfigure}{0.49\linewidth} \centering \includegraphics[width=\linewidth]{fig/contextual_vs_normal_turning.pdf} \caption{Curved trajectory.} \label{fig:contextual:2} \end{subfigure} \caption{Comparison between the optimization performance of a contextual optimizer and a normal optimizer for two different tasks: (a) walking on inclines (b) walking curved trajectories. In both cases, the contextual optimizer can leverage prior simulations to obtain high-performing gaits in fewer simulations.} \vspace{-10pt} \end{figure} We now consider the case of contextual optimization and specifically the task of gait optimization for slopes with different inclinations. We framed learning to walk on inclined terrain as a contextual policy search, where the angle of the inclination is the context. In this simulation, we decided to use Dual Tripod for our gait with mostly the same open parameters as the previous simulations. We used a single parameter to represent the amplitude for the entire network in order to keep the number of parameters low with the addition of a contextual variable, leaving us with 3 parameters and 1 contextual parameter. To respect real world constraints, where testing randomly sampled incline angles over a continuous interval can be excessively time-consuming, we chose at training time to perform simulations only from a small number of inclines: 5, 10, and 15 degrees. After optimizing the gaits for these three inclines over 50 iterations, we studied how the contextual optimizer is able to generalize across the context space by testing the performance of the contextual policy for a wide range of inclines. In \fig{fig:incline} we can see that the policy performs well on intermediary inclines and seems to smoothly interpolate between the training inclines as is desirable. The gradual decrease in performance as the inclines get steeper can be attributed to the increasing physical difficulty for climbing up steeper inclines. We also compared cBO against using standard BO to train the robot for an untested incline. As shown in \fig{fig:contextual:1}, the contextual optimization was able to converge on optimal performance significantly faster than standard BO. This result demonstrate the ability of cBO to efficiently use data accumulated in previous contexts to quickly reach optimize gaits in new unseen contexts. \subsection{Learning to Curve} \label{sec:results:context2} Another useful task that can be framed as contextual optimization is learning motor primitives to walk curved trajectories for use in path planning. We used the same parameters as in \sec{sec:results:soo} and the contextual parameters in this case were the target displacements along both the x and y axes from the point of origin. In order to train particular trajectories, we selected five evenly spaced target points along the front quadrant of the field of vision. Since the primary objective was to reach the desired destination, we chose to use the distance of the final position to the target position as our sole objective function. We found that over 10 repetitions, the walker was able to accurately move and turn towards all of the target points within 250 iterations. In \fig{fig:contextual:2}, we compared the performance of cBO against standard BO on a previously unseen target position $(4\cos{\pi / 16}, 4\sin{\pi / 16})$. We found that, as in the case of inclinations, the contextual policy was able to learn the optimal parameters for a novel trajectory within very few iterations. \subsection{Learning Motor Primitives for Path Planning} \label{sec:results:planning} % \begin{figure}[t] \centering \includegraphics[width=\linewidth]{fig/turning_map_both_hor.pdf} \caption{Comparison of the performances of cBO and our approach for learning motor primitives (using the same data). With the robot having an initial position of $(0,0)$, we evaluated the error between the desired position (indicated by the element of the grid) and the reached position. Darker color indicates better target accuracy. While cBO accurately learned trajectories near the training targets, it did not generalize well to unseen targets. In contrast, our approach had a more comprehensive coverage as it could leverage better information about the environment to improve generalization.} \label{fig:pathing1} \end{figure} % \begin{wrapfigure}{r}{0.50\linewidth} \vspace{-10pt} \centering \includegraphics[width=\linewidth]{fig/contextual_path.pdf} \caption{Path constructed using the locomotion primitives learned with our approach.} \label{fig:pathing2} \vspace{-8pt} \end{wrapfigure} In the previous simulation we learned motor primitives capable of walking curved trajectories. While the model handled trajectories near and between the targets quite well, the performance on trajectories well within the physical capabilities of the robot but not in proximity to the targets left much to be desired, as shown in \fig{fig:pathing1}. We now demonstrate how our approach presented in \sec{sec:approach} can be used to significantly improve the movement accuracy (compared to cBO using the same data), as well as how such motor primitives can be used to perform path planning. First, we reused the data from the previous simulation in order to reformulate the task as a multi-objective optimization as described in \sec{sec:approach}. Then, we used our trained model to sample 10,000 trajectories by randomly sampling from the parameter space. Out of all these trajectories, we selected the one with the smallest expected error subject to not walking through the wall. Evaluating the resulting sequence of motor primitives on the real system (\ie, the simulator) demonstrated that the expected trajectory was capable of navigating the maze, as shown in \fig{fig:pathing2}. \section{Introduction} \input{1_introduction} \section{Related Work} \label{sec:related} \input{2_related} \section{The Hexapod Microrobot} \input{3_hardware} \section{Background} \label{sec:background} \input{4_background} \section{Learning Locomotion Primitives for Path Planning} \label{sec:approach} \input{5_approach} \section{Experimental Simulation Results} \label{sec:results} \input{6_results} \section{Conclusion} \input{7_conclusion} \bibliographystyle{IEEEtran}
{'timestamp': '2018-03-02T02:06:15', 'yymm': '1803', 'arxiv_id': '1803.00196', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00196'}
arxiv
\section{Introduction} Recent progress in model-free (MF) reinforcement learning has demonstrated the capacity of rich value function approximators to master complex tasks. However, these model-free approaches require access to an impractically large number of training interactions for most real-world problems. In contrast, model-based (MB) methods can quickly arrive at near-optimal control with learned models under fairly restricted dynamics classes \cite{lqr}. In settings with nonlinear dynamics, fundamental issues arise with the MB approach: \emph{complex dynamics demand high-capacity models, which in turn are prone to overfitting in precisely those low-data regimes where they are most needed.} Model inaccuracy is further exacerbated by the difficulty of long-term dynamics predictions (Fig.~\ref{fig:dynmse}). The MF and MB approaches have distinct strengths and weaknesses: expressive value estimation MF methods can achieve good asymptotic performance but have poor sample complexity, while MB methods exhibit efficient learning but struggle on complex tasks. In this paper, we seek to \emph{reduce sample complexity while supporting complex non-linear dynamics by combining MB and MF learning techniques through disciplined model use for value estimation}. \begin{wrapfigure}{r}{4cm} \begin{center} \includegraphics[width=0.5\columnwidth]{dyn-mse.pdf} \end{center} \caption{The mean $L_2$ error, with standard deviation, for open-loop dynamics prediction of a \textit{cheetah} agent increases in the prediction horizon.} \label{fig:dynmse} \end{wrapfigure} We present model-based value expansion (MVE), a hybrid algorithm that uses a dynamics model to simulate the short-term horizon and Q-learning to estimate the long-term value beyond the simulation horizon. This improves Q-learning by providing higher-quality target values for training. Splitting value estimates into a near-future MB component and a distant-future MF component offers a model-based value estimate that (1) creates a decoupled interface between value estimation and model use and (2) does not require differentiable dynamics. In this scheme, our trust in the model informs the selection of the horizon up to which we believe the model can make accurate estimates. This horizon is an interpretable metric applicable to many dynamics model classes. Prior approaches that combine model-based and model-free RL, such as model-based acceleration \cite{naf}, incorporate data from the model directly into the model-free RL algorithm, which we show can lead to poor results. Alternatively, imagination-augmented agents (I2A) offloads all uncertainty estimation and model use into an implicit neural network training process, inheriting the inefficiency of model-free methods \cite{i2a}. By incorporating the model into Q-value target estimation, we only require the model to be able to make forward predictions. In contrast to stochastic value gradients (SVG), we make no differentiability assumptions on the underlying dynamics, which usually include non-differentiable phenomena such as contact interactions \cite{svg}. Using an approximate, few-step simulation of a reward-dense environment, the improved value estimate provides enough signal for faster learning for an actor-critic method (Fig.~\ref{fig:hc-true}). Our experimental results show that our method can outperform both fully model-free RL algorithms and prior approaches to combining real-world and model-based rollouts for accelerated learning. The remainder of this paper is organized along the following contributions: \begin{itemize} \item A general method to reduce the value estimation error in algorithms with model-free critics (Sec.~\ref{sec:mve}). \item An evaluation of the reduced sample complexity resulting from better value estimation (Sec.~\ref{sec:mve-perf}). \item A characterization of the error that arises from value-based methods applied to imaginary data (Sec.~\ref{sec:critic-improve}). \end{itemize} \section{Background} A deterministic Markov decision process (MDP) is characterized by a set of possible actions $\mathcal{A}$ and states $\mathcal{S}$. Its dynamics are deterministic and are described by a state transition function $f:\mathcal{S}\times \mathcal{A}\rightarrow\mathcal{S}$ and the bounded reward function $r:\mathcal{S}\times\mathcal{A}\rightarrow \mathbb{R}$. In this work, we consider continuous state and action spaces. For a deterministic policy $\pi:\mathcal{S}\rightarrow\mathcal{A}$, the action-value function $Q^\pi(s_0,a_0)=\sum_{t=0}^\infty \gamma^t r_t$ gives the deterministic $\gamma$-discounted cumulative reward, where $s_{t+1}=f^\pi(s_t) = f(s_t,\pi(s_t)) $, $a_t=\pi(s_t)$, and $r_t=r(s_t,a_t)$. We will use $\hat Q$ to refer to some estimate of $Q^\pi$. Finally, recall that we may express the value function $V^\pi(s)=Q^\pi(s,\pi(s))$. We will denote state-value estimates with $\hat V$. The policy $\pi$ is implicitly parameterized by $\theta$. We indicate this with subscripts $\pi_\theta$ when necessary. The objective is to maximize $J_{d_0}(\pi)=\mathExp_{d_0}\ha{V^\pi(S)}$, where $S\sim d_0$ is sampled from the initial state distribution. With access to only off-policy states from an exploration policy, summarized by some empirical distribution $\nu$, we consider the proxy $J_\nu$ instead, as is typical \cite{degris}. \subsection{Deterministic Policy Gradients (DPG)} \citet{dpg} describe an off-policy actor-critic MF algorithm. For a deterministic, parameterized policy $\pi_\theta$ and parameterized critic $\hat Q$ (we leave its parameters implicit), \citet{dpg} prove that a tractable form of the policy gradient $\nabla_\theta J_{d_0}(\theta)$ exists when $f$ is continuously differentiable with respect to actions taken by the policy. This result, the deterministic policy gradient theorem, expresses the policy gradient as an expectation over on-policy data. To encourage exploration, the data collected may be off-policy. To reconcile the use of off-policy data with an on-policy estimator, \citet{dpg} briefly note an analogous off-policy policy improvement theorem in the case of finite state spaces \cite{degris}. \subsection{Continuous DPG} In the continuous case, the conditions under which the off-policy policy improvement theorem holds are distinct from the discrete case. We emphasize these conditions here and provide a proof for the statement in \citet{dpg} inspired by the discrete case \citep{degris}. \begin{thm}[\textbf{Off-Policy Deterministic Continuous Policy Improvement Theorem}] \label{thm:offpolicy_improvement} Let $\beta$ be an off-policy distribution of states and set \begin{equation} g_\theta(s)=D_{\pi(s)}(\theta)^\top\nabla_a Q^{\pi_\theta}(s, a)\big|_{a=\pi(s)}, \label{eq:ascentdir} \end{equation} with $D_{\pi(s)}(\theta)$ the Jacobian of $\theta\mapsto \pi_{\theta}(s)$. Then $\mathExp_\beta g_\theta(S)$ ascends $J_\beta(\theta)$ if the following conditions hold $\beta$-almost always: (1) $Q^{\pi_\theta}$ must be differentiable with respect to the action at $(s, \pi_\theta(s))$, (2) the Jacobian $D_{\pi(s)}(\theta)$ must exist, and (3) $g_\theta(s)$ is nonzero. \end{thm} \textit{Proof}. See the appendix (Sec.~\ref{sec:dpg-continuous}). Critically, we do not require DPG's assumptions of continuous differentiability in the reward or dynamics functions. This will allow model-based value expansion to be both theoretically and practically compatible with arbitrary forward models, including discrete event simulators, and settings with non-differentiable physics. Finally, a proxy $\hat Q$ may be used as a replacement for the true $Q^\pi$ term to approximate the ascent direction $g_\theta$ in \eqnref{eq:ascentdir}, as described in deep deterministic policy gradients (DDPG) \cite{ddpg}. \section{Model-Based Value Expansion}\label{sec:mve} MVE improves value estimates for a policy $\pi$ by assuming we an approximate dynamical model $\hat f:\mathcal{S}\times\mathcal{A}\rightarrow\mathcal{S}$ and the true reward function $r$. Such an improved value estimate can be used in training a critic for faster task mastery in reward-dense environments (\figref{fig:hc-true}). We assume that the model is accurate to depth $H$; that is, for a fixed policy $\pi$, we may use $\hat f$ to evaluate (``imagine") future transitions that occur when taking actions according to $\pi$ with $\hat f^\pi=\hat f(\cdot, \pi(\cdot))$. We use these future transitions to estimate value. \begin{dfn}[\textbf{$H$-Step Model Value Expansion}]\label{def:mve} Using the imagined rewards reward $\hat r_t=r(\hat s_t,\pi(\hat s_t))$ obtained from our model $\hat s_t=\hat f^\pi(\hat s_{t-1})$ under $\pi$ we define the $H$-step model value expansion (MVE) estimate for the value of a given state $V^\pi(s_0)$: \begin{equation} \hat V_H(s_0)=\sum_{t=0}^{H-1}\gamma^t\hat r_t + \gamma^H\hat V(\hat s_H)\label{eq:mve}\,. \end{equation} \end{dfn} The $H$-step model value expansion in \dfnref{def:mve} decomposes the state-value estimate at $s_0$ into the component predicted by learned dynamics $\sum_{t=0}^{H-1}\gamma^t\hat r_t$ and the tail, estimated by $\hat V$. This approach can be extended to stochastic policies and dynamics by integrating Eq.~\ref{eq:mve} with a Monte Carlo method, assuming a generative model for the stochastic dynamics and policy. Since $\hat r_t$ is derived from actions $\hat a_t=\pi(\hat s_t)$, this is an on-policy use of the model and, even in the stochastic case, MVE would not require importance weights, as opposed to the case of using traces generated by off-policy trajectories. While MVE is most useful in settings where the $H$ step horizon is not sparse, even in sparse reward settings predicting the future state will improve critic accuracy. Finally, MVE may be applied to state-action estimates: in this case $\hat a_0\triangleq a_0$ while $\hat a_t=\pi(\hat s_t)$ for $t>0$ and $\hat V(\hat s_H)\triangleq \hat Q(\hat s_H,\hat a_H)$ and may be used for estimating $\hat Q_H(s_0,a_0)$ with a state-action critic $\hat Q$. \subsection{Value Estimation Error}\label{sec:value-error} In this section, we discuss the conditions under which the MVE estimate improves the mean-squared error (MSE): \begin{equation} \MSE_\nu(V)=\mathExpUnder_{S\sim\nu}\ha{\pa{V(S)-V^\pi(S)}^2}\label{eq:mse}, \end{equation} of the original critic $\hat V$ with respect to $\nu$, a distribution of states. We emphasize that, even assuming an ideal model, the mere combination of MB and MF does not guarantee improved estimates. Further, while our analysis will be conducted on state-value estimation, it may be naturally extended to state-action-value estimation. Recall the $H$-depth model accuracy assumption: if we observe a state $s_0$ we may imagine $\hat s_t\approx s_t$, so $\hat a_t\approx a_t$ and $\hat r_t\approx r_t$ for $t\le H$. If the modelling assumption holds for some fixed $s_0$, we have $$\hat V_H(s_0)-V^{\pi}(s_0)\approx \gamma^H\pa{\hat V( s_H)-V^{\pi}(s_H)}\,.$$ This translates to an expression for MVE MSE, $$ \MSE_\nu(\hat V_H)\approx \gamma^{2H}\MSE_{(f^\pi)^H\nu} (\hat V)\,, $$ where $(f^\pi)^H\nu$ denotes the pushforward measure resulting from playing $\pi$ $H$ times starting from states in $\nu$. This informal presentation demonstrates the relation of MVE MSE to the underlying critic MSE by assuming the model is nearly ideal. We verify that the informal reasoning above is sound in the presence of model error. \begin{thm}[\textbf{Model-Based Value Expansion Error}] Define $s_t,a_t,r_t$ to be the states, actions, and rewards resulting from following policy $\pi$ using the true dynamics $f$ starting at $s_0\sim\nu$ and analogously define $\hat s_t,\hat a_t,\hat r_t$ using the learned dynamics $\hat f$ in place of $f$. Let the reward function $r$ be $L_r$-Lipschitz and the value function $V^\pi$ be $L_V$-Lipschitz. Let $\epsilon$ be a be an upper bound $$ \max_{t\in[H]}{\mathExp\left[\norm{\hat s_t- s_t}^2\right]}\le \epsilon^2, $$ on the model risk for an $H$-step rollout. Then $$ \MSE_\nu(\hat V_H)\le c_1^2\epsilon^2+ (1+c_2\epsilon)\gamma^{2H}\MSE_{(\hat f^\pi)^H\nu} (\hat V)\,, $$ where $c_1,c_2$ grow at most linearly in $L_r,L_V$ and are independent of $H$ for $\gamma <1$. We assume $\MSE_{(\hat f^\pi)^H\nu} (\hat V)\ge \epsilon^2$ for simplicity of presentation, but an analogous result holds when the critic outperforms the model. \end{thm} \textit{Proof}. See the appendix (Sec.~\ref{sec:mve-error}). Sufficient conditions for improving on the original critic $\MSE_\nu (\hat V)$ are then small $\epsilon$, $\gamma < 1$, and the critic being at least as accurate on imagined states as on those sampled from $\nu$, \begin{equation} \MSE_\nu (\hat V)\ge \MSE_{(\hat f^\pi)^H\nu} (\hat V).\label{eq:offdist} \end{equation} However, if $\nu$ is an arbitrary sampling distribution, such as the one generated by an exploratory policy, the inequality of Eq.~\eqref{eq:offdist} rarely holds. In particular, this naive choice results in poor performance overall (Fig.~\ref{fig:ablation}) and counteracts the benefit of model-based reward estimates, even assuming a perfect oracle dynamics model (Fig.~\ref{fig:hc-true}). Thus, if $\hat V$ is trained on Bellman error from $\nu$, then the \textbf{distribution mismatch} between $(f^\pi)^H\nu$ and $\nu$ eclipses the benefit of $\gamma^{2H}$. In effect, any model-based approach evaluating the critic $\hat V$ on imaginary states from $(f^\pi)^H \nu$ must be wary of only training its critic on the real distribution $\nu$. We believe this insight can be incorporated into a variety of works similar to MVE, such as value prediction networks \cite{vpn}. We propose a solution to the distribution-mismatch problem by observing that the issue disappears if $(f^\pi)^H\nu=\nu$, i.e., the training distribution $\nu$ is a fixed point of $f^\pi$. In practice, given an arbitrary off-policy distribution of state-action pairs $\beta$ we set $\nu=\mathExp\ha{(f^\pi)^T\beta}$ as an approximation to the fixed point, where $T\sim\Uniform\ca{0, \cdots, H-1}$. If we then sample a state $\hat s_T|T\sim \pa{f^\pi}^T\beta$, our model accuracy assumption dictates that we may accurately simulate states $\ca{\hat s_{T+i}}_{i=1}^{H-T}$ arising from playing $\pi$ starting at $\hat{s}_T$. These simulated states can be used to construct $k$-step MVE targets $\hat V_{k}(\hat s_T)$ accurately while adhering to assumptions about the model by setting $k=H-T$. These targets can then be used to train $\hat V$ on the entire support of $\nu$, instead of just $\beta$. Since we do not have access to the true MSE of $\hat V$, we minimize its Bellman error with respect to $\nu$, using this error as a proxy. In this context, using a target $\hat V_k(\hat s_T)$ is equivalent to training $\hat V$ with imagined TD-$k$ error. This \textbf{TD-$k$ trick} enables us to skirt the distribution mismatch problem to the extent that $\nu$ is an approximate fixed point. We find that the TD-$k$ trick greatly improves task performance relative to training the critic on $\beta$ alone (Fig.~\ref{fig:ablation}). \subsection{Deep Reinforcement Learning Implementation} In the preceding section, we presented an analysis that motivates our model-based value expansion approach. In this section, we will present a practical implementation of this approach for high-dimensional continuous deep reinforcement learning. We demonstrate how to apply MVE in a general actor-critic setting to improve the target $Q$-values, with the intention of achieving faster convergence. Our implementation relies on a parameterized actor $\pi_\theta$ and critic $Q_\varphi$, but note that the separate parameterized actor may be removed if it is feasible to compute $\pi(s)=\argmax_a Q_\varphi(s,a)$. We assume that the actor critic method supplies a differentiable actor loss $\ell_{\mathrm{actor}}$ and a critic loss $\ell_{\mathrm{critic}}^{\pi,Q}$. These losses are functions of $\theta,\varphi$ as well as transitions $\tau=(S,A,R,S')$ sampled from some distribution $\mathcal{D}$. For instance, in DDPG, the $\theta$ gradient of $\mathExp_\mathcal{D}\ha{\ell_{\mathrm{actor}}(\theta,\varphi, \tau)}=\mathExp_\mathcal{D}\ha{Q_\varphi(S, \pi_\theta(S)}$ approximately ascends $J_{\mathcal{D}}$ per the deterministic continuous policy improvement theorem \cite{ddpg}. The DDPG critic loss depends on a target actor $\pi$ and critic $Q$: $\ell_{\mathrm{critic}}^{\pi,Q}(\varphi,\tau)=\pa{Q_\varphi(S,A)-\pa{R+\gamma Q(S', \pi(S'))}}^2$. MVE relies on our approximate fixed point construction from an empirical distribution of transitions $\beta$. Recall our approximation from the previous section, which relies on the current policy to imagine up to $H$ steps ahead: $\nu(\theta',\hat f)=\frac{1}{H}\sum_{t=0}^{H-1}(\hat f^{\pi_{\theta'}})^t\beta$, where $\hat f^{\pi_{\theta'}}(\tau)=(S', A', r(S', A'), \hat f(S', A'))$ and $A'=\pi_{\theta'}(S')$. Thus, sampling transitions from $\nu$ is equivalent to sampling from any point up to $H$ imagined steps into the future, when starting from a state sampled from $\beta$. The MVE-augmented method follows the usual actor-critic template, but critic training uses MVE targets and transitions sampled from $\nu$ (Alg.~\ref{alg:mve}). We imagine rollouts with the target actor, whose parameters are exponentially weighted averages of previous iterates, for parity with DDPG, which uses a target actor to compute target value estimates. Taking $H=0$, $\nu(\theta', \hat f)=\beta$, we recover the original actor-critic algorithm. Our implementation uses multi-layer fully-connected neural networks to represent both the $Q$-function and the policy. We use the actor and critic losses described by DDPG \cite{ddpg}. \begin{algorithm}[!ht] \caption{Use model-based value expansion to enhance critic target values in a generic actor-critic method abstracted by $\ell_{\mathrm{actor}},\ell_{\mathrm{critic}}$. Parameterize $\pi,Q$ with $\theta,\varphi$, respectively. We assume $\hat f$ is selected from some class of dynamics models and the space $\mathcal{S}$ is equipped with a norm.} \label{alg:mve} \begin{algorithmic}[1] \Procedure{MVE-AC}{initial $\theta,\varphi$} \State Initialize targets $\theta'=\theta,\varphi'=\varphi$ \State Initialize the replay buffer $\beta\gets \emptyset$ \While{not tired} \State Collect transitions from any exploratory policy \State Add observed transitions to $\beta$ \State Fit the dynamics $$\hat f\gets\argmin_{f}\mathExpUnder_\beta\ha{\norm{f(S,A)-S'}^2}$$ \For{a fixed number of iterations} \State sample $\tau_0\sim\beta$ \State update $\theta$ with $\nabla_\theta \ell_{\mathrm{actor}}\pa{\pi_\theta,Q_\varphi,\tau_0}$ \State imagine future transitions for $t\in [H-1]$ $$ \tau_{t}=\hat f^{\pi_{\theta'}}(\tau_{t-1}) $$\label{line:sample}\vspace{-\baselineskip} \State $\forall k$ define $\hat Q_k$ as the $k$-step MVE of $Q_{\varphi'}$ \State update $\varphi$ with $\nabla_\varphi\sum_t\ell_{\mathrm{critic}}^{\pi_{\theta'},\hat Q_{H-t}}\pa{\varphi,\tau_t}/H$ \label{line:critic-update}\vspace{-\baselineskip} \State update targets $\theta',\varphi'$ with some decay \EndFor \EndWhile \State \Return $\theta,\varphi$ \EndProcedure \end{algorithmic} \end{algorithm} Importantly, we do not use an imagination buffer to save simulated states, and instead generate simulated states on-the-fly by sampling from $\nu(\theta',\hat f)$. We perform a stratified sampling from $\nu(\theta',\hat f)$, with $H$ dependent samples at a time, for each $t\in \{0,\cdots,H-1\}$ in Line~\ref{line:sample}. First, we sample a real transition $\tau_0=(s_{-1},a_{-1},r_{-1},s_0)$ from $\beta$, the empirical distribution of transitions observed from interacting with the environment according to an exploratory policy. We use the learned dynamics model $\hat f$ to generate $\hat s_t$ and $\hat r_t$. Since $\pi_{\theta'}$ changes during the joint optimization of $\theta,\varphi$, these simulated states are discarded immediately after the batch. We then take a stochastic $\nabla_\varphi$ step to minimize $\nu$-based Bellman error of $Q_\varphi$, $$ \frac{1}{H}\sum_{t=-1}^{H-1}\pa{ Q_\varphi (\hat s_t, \hat a_t)- \pa{\sum_{k=t}^{H-1}\gamma^{k-t}\hat r_k+\gamma^H Q_{\varphi'}\pa{\hat s_H,\hat a_H}}}^2\,, $$ where $Q_{\varphi'}$ and and $\hat a_t=\pi_{\theta'}(\hat s_t)$ use target parameter values (Lines~\ref{line:sample}-\ref{line:critic-update} of Alg.~\ref{alg:mve}). As such, every observation of the Bellman error always relies on some real data. For the dynamics $\hat f$, we use a neural network network with 8 layers of 128 neurons each with a fixed $10^{-3}$ learning rate trained to predict the difference in real-vector-valued states, similar to previous work \cite{metrpo}. While we expect more accurate and carefully tuned models to allow us to use large $H$, even a weak model with shared hyperparameters across all tasks from a flexible class suffices to demonstrate our point. \section{Results} We evaluate MVE on several continuous control environments. Experimental details are in Sec.~\ref{sec:exp-det}. We would like to verify the following: \begin{itemize} \item Does MVE improve estimates of $Q^\pi$? \item Do the improved estimates result in faster mastery? \item Does the TD-$k$ trick resolve distribution mismatch? \end{itemize} In all of our experiments, we tune the baseline, DDPG, and report its best performance. For exploration, we use parameter-space noise \cite{paramnoise}. Every experiment and each setting uses the same adaptive parameter-space noise standard deviation target, so exploration is controlled to be the same in all trials. We then add the MVE extension (we do not tune DDPG parameters to MVE performance). To evaluate the effect of the TD-$k$, we evaluate against the naive approach of using $H$-step MVE $\hat Q$ estimates for Bellman error on states sampled from $\beta$. This is equivalent to using only the first term for $t=0$ in the sum of Line~\ref{line:critic-update} of Alg.~\ref{alg:mve}, i.e., updating critic parameters $\varphi$ with the gradient $\nabla_\varphi\ell_{\mathrm{critic}}^{\pi_{\theta'},\hat Q_H}(\varphi, \tau_0)$. Without the TD-$k$ trick the model is still used to simulate to depth $H$, but the opportunity to learn on a distribution of additional support is neglected. We plot the mean learning curve, along with the standard deviation. We smooth each graph with a 20 point window (evaluation data is collected at intervals of at most $10^3$ timesteps). \begin{figure} \begin{center} \subfigure[]{\includegraphics[width=0.3\columnwidth]{hc-env.pdf}} \subfigure[]{\includegraphics[width=0.3\columnwidth]{swimmer-env.pdf}} \subfigure[]{\includegraphics[width=0.3\columnwidth]{walker-env.pdf}} \end{center} \caption{We use fully-observable analogues of typical Gym environments \cite{gym}. By default, the environments excerpt certain observed dimensions, such as the abscissa of (a), which are requisite for reward calculation. This is done as a supervised imposition of policy invariance to certain dimensions, which we remove for full observability. (a) shows \textit{Fully Observable Half Cheetah} (\textit{cheetah}); (b), \textit{Fully Observable Swimmer} (\textit{swimmer}); (c), \textit{Fully Observable Walker, 2-D} (\textit{walker}). Agents are rewarded for forward motion. We detail our changes in the Appendix (Sec.~\ref{sec:exp-det}). } \label{fig:envpics} \end{figure} \subsection{Performance}\label{sec:mve-perf} First, we evaluate that MVE-DDPG (with the TD-$k$ trick) improves in terms of raw reward performance by comparing its learning curves to those of the original DDPG, MVE-DDPG without the TD-$k$ trick, and imagination buffer (IB) approaches \cite{kalweit}. We find that MVE-DDPG outperforms the alternatives (Fig.~\ref{fig:ablation}).\footnote{We run IB with an imaginary-to-real ratio of 4, as used for 2 of 3 environments in \cite{kalweit}. We tested lower ratios on \textit{cheetah} but found they performed worse. Note that for parity with DDPG we ran MVE-DDPG with only 4 gradient steps.} Our result shows that incorporating synthetic samples from a learned model can drastically improve the performance of model-free RL, greatly reducing the number of samples required to attain good performance. As illustrated by the comparison to the IB baseline, this improvement is obtained only when carefully incorporating this synthetic experience via a short horizon and the TD-$k$ trick. As we will discuss in the next section, the specific design decisions here are critical for good results, which helps to explain the lack of success with learned neural network models observed with related methods in prior work~\cite{naf}. MVE-DDPG improves on similar approaches, such as MA-DDPG, by its treatment of synthetic data obtained from the dynamics model. This alternative approach adds simulated data back into a separate imagination buffer, effectively modifying $\beta$ from Alg.~\ref{alg:mve} into a mixture between $\beta$ and simulated data (where the mixture is dependent on the relative number of samples taken from each buffer). This is problematic because the policy changes during training, so the data from this mixed distribution of real and fake data is stale relative to $\nu$ in terms of representing actions that would be taken by $\pi$. In our implementation of MA-DDPG, we do not reuse imagined states in this manner, but MVE-DDPG still outperforms MA-DDPG. We suspect this is due to two factors: (1) the staleness of the imaginary states in the IB approach, and (2) the delicate interaction between using more imaginary data and overtraining the actor. In order to use the additional synthetic data, an IB approach must take more gradient steps with imaginary batches. On the other hand, since MVE-DDPG uses a gradient averaged over both real and simulated data, the choice to make additional gradient steps becomes an independent consideration dependent on the stability of the actor-critic method being trained. \begin{figure*}[!h] \begin{center} \includegraphics[width=1.75\columnwidth]{legend.pdf} \end{center} \vspace{-2em} \begin{center} \subfigure[]{\includegraphics[width=0.65\columnwidth]{hc-learned.pdf}} \subfigure[]{\includegraphics[width=0.65\columnwidth]{swim-learned.pdf}} \subfigure[]{\includegraphics[width=0.65\columnwidth]{walk-learned.pdf}} \end{center} \caption{Learning curves comparing MVE with learned dynamics ({\color{purple}purple}), MVE without the TD-$k$ trick ({\color{orange}orange}), IB \citep{kalweit} ({\color{blue}blue}), and DDPG ({\color{black}black}) on (a) \textit{cheetah}, (b) \textit{swimmer}, and (b) \textit{walker}. We used $H=10$ for (a,b), but found the same dynamics class inadequate for walker, reducing \textit{walker} experiments to $H=3$ reduces the improvement MVE has to offer over DDPG, but it still exhibits greater robustness to the poor model fit than IB. Note that we use MA-DDPG, not MA-BDDPG in the IB approach. The bootstrap estimation in MA-BDDPG may reduce model use in some cases, so it is possible that MA-BDDPG would have improved performance in \textit{walker}, where the learned dynamics are poor compared to the other environments.} \label{fig:ablation} \end{figure*} \subsection{MVE as Critic Improvement}\label{sec:critic-improve} We make sure that MVE can make use of accurate models to improve the critic value estimate (Fig.~\ref{fig:learned-hc-hs}). The improved critic performance results in faster training compared to the $H=0$ DDPG baseline on \textit{cheetah}. Also, we replicate the density plot from DDPG to analyze $Q$ accuracy directly, from which it is clear that MVE improves the critic by providing better target values (Fig.~\ref{fig:qdensity}). In addition, we verify that the TD-$k$ trick is essential to training $\hat Q$ appropriately. To do so, we conduct an ablation analysis on the \textit{cheetah} environment: we hold all parameters constant and substitute the learned dynamics model $\hat f$ with the true dynamics model $f$, making model error zero. If $\MSE_{\beta}(\hat Q)\approx \MSE_{(f^\pi)^H\beta}(\hat Q)$, the MVE estimates must improve exponentially in $H$, even without the TD-$k$ trick. However, this is not the case. With the TD-$k$ trick, increasing $H$ yields increasing but diminishing returns (Fig.~\ref{fig:hc-true}). Without the adjustment for distribution mismatch, past a certain point, increasing $H$ hurts performance. Because the dynamics model is ideal in these cases, the only difference is that the critic $\hat Q$ is trained on the distribution of states $\nu=\frac{1}{H}\sum_{t=0}^{H-1}(f^\pi)^t\beta$ instead of $\beta$, where $\beta$ is the empirical distribution resulting from the replay buffer. Since the TD-$k$ trick increases the support of the training data on which $\hat Q$ is trained, the function class for the critic may need to have sufficient capacity to capture the new distribution, but we did not find this to be an issue in our experiments. \begin{figure}[!h] \begin{center} \includegraphics[width=\columnwidth]{hc-multih.pdf} \end{center} \caption{Learning curves from \textit{cheetah} for MVE-DDPG \textit{with learned dynamics} at different model horizons $H$. } \label{fig:learned-hc-hs} \end{figure} \begin{figure}[!h] \begin{center} {\includegraphics[width=0.43\columnwidth]{hc0.pdf}} {\includegraphics[width=0.47\columnwidth]{hc30.pdf}} \end{center} \caption{We plot the true observed cumulative discounted returns against those predicted by the critic for \textit{cheetah} at the end of training (both values are normalized), reconstructing Fig.~3 of \citep{ddpg}. The dotted black line represents unity. An ideal critic concentrates over the line. We verify that with MVE at $H=30$ with the true dynamics model trains a critic with improved $Q$ values relative to the original DDPG algorithm. Both of the above runs use a reduced mini-batch size because oracle dynamics are expensive to compute. } \label{fig:qdensity} \end{figure} \begin{figure*}[!h] \begin{center} \subfigure[]{\includegraphics[width=0.9\columnwidth]{oracle-cheetah.pdf}} \subfigure[]{\includegraphics[width=0.9\columnwidth]{hc-notdk-oracle.pdf}} \end{center} \caption{Learning curves for the \textit{cheetah} environment for MVE-DDPG with an ideal, oracle dynamical model at different horizons $H$ of model prediction. We examine performance (a) with and (b) without the TD-$k$ trick. $H=0$ implies no model use; this is the original DDPG. First, (a) exemplifies that improving value estimation with a model has a marked effect on performance in dense reward environments and offers an upper bound to the improvement that can result from learned-dynamics MVE. Note that as mentioned in Fig.~\ref{fig:qdensity} the batch size for oracle dynamics evaluations was reduced out of computational necessity, so these curves are not comparable to Fig.~\ref{fig:learned-hc-hs}. The diminishing returns for increases in $H$ that we observe further emphasize that model improvement is captured even with a short horizon. Second, (b) demonstrates the value of the TD-$k$ trick: for small $H$, distribution mismatch is small so (b) still shows a performance improvement, but as $H$ increases we lose the monotonic improvements observed in (a). } \label{fig:hc-true} \end{figure*} \section{Related Work} A number of prior works have sought to incorporate dynamics models into model-free RL and value estimation. We observe three general approaches: (1) direct incorporation of dynamics into the value gradient, (2) use of imagination as additional training data, and (3) use of imagination as context for value estimation. (1) Stochastic value gradients (SVG) uses its model for improved credit assignment from traces of real trajectories \cite{svg}. By applying a differentiable dynamics model to real data only, SVG avoids instability from planning with an overfitted dynamics model, since the model is used for its gradients rather than its forward predictions. A major limitation of this approach is that the dynamics model can now only be used to retrieve information that is already present in the observed data, albeit with lower variance, so the actual improvement in efficiency is relatively small. Applied to a horizon of length one, given off-policy data from $\beta$, $\mathrm{SVG}(1)$ estimates $J_\beta(\pi)\approx \mathExp\ha{w(A|S)\pa{r(S,A) + \gamma \hat V(\hat S)}}$ with $S,A,r(S,A)$ observed from the transition taken according to some sampling distribution $\beta$ and $\hat S$ following the probabilistic dynamics model (the stochastic value gradient is achieved by using the reparameterization trick to differentiate the approximation). \citet{svg} does not consider the case of $\mathrm{SVG}(n)$ for off-policy data and $n>1$, likely due the use of the importance weight $w(a|s)=\frac{\pi(a|s)}{\beta(a|s)}$, which may vanish for model-based expansion of longer lengths. This is not a problem for the on-policy $\mathrm{SVG}(\infty)$, but by the authors' own account $\mathrm{SVG}(\infty)$ is less sample-efficient than $\mathrm{SVG}(1)$. (2) Alternatively, Dyna-like approaches use the learned model for imagination rollouts \cite{dyna}. Providing imagined data to model-free value estimation algorithms is potentially a more robust use of a potentially erroneous view of a task's dynamics compared to planning. A number of follow-up methods have expanded on this idea. For instance, in model-based acceleration (MBA), imagination rollouts are used as additional training data for a parameterized value network \cite{naf}. The original MBA proposal adds a replay buffer with the imagined data. Imagined states may then be used as the starting point for further imagination at later iterations. This reuse violates the rule of trusting the model for only $H$ steps of simulation. The authors find that this approach does not work well with neural network models, and settle for locally linear ones. Even with this modification, the model is deactivated in the middle of training heuristically to attain the best results. Our analysis and comparisons shed light on why this approach may be ineffective. One approach to limit model use automatically is model-assisted bootstrapped DDPG (MA-BDDPG) \cite{kalweit}. This has two modifications from MBA. The first is that the imaginary states are not used as the starting point for future imaginary rollouts (this change alone is referred to as MA-DDPG). The second change adds an estimate of approximate critic uncertainty via the bootstrap. The imagined states are then used for training with frequency increasing in estimated critic uncertainty. Thus model use is limited except in scenarios where it is needed disambiguate uncertainty in the model-free critic estimate. Fig.~\ref{fig:learned-hc-hs} compares MVE to the IB approach of MA-DDPG. We do not use bootstrap to limit model use as MA-BDDPG does. The IB approach is in part representative of MBA as well, though MBA explicitly states that it is not compatible with neural network dynamics. MBA also uses the model for local planning in its imagination rollouts, and this is not done here. Another prior approach is model-ensemble trust region policy optimization (ME-TRPO) \cite{metrpo}. Here, real data is used to train the dynamics model only, and a TRPO algorithm learns from imagination rollouts alone. ME-TRPO limits over-training to the imagined data by using an ensemble metric for policy performance. In other words, ME-TRPO bootstraps the dynamics model prediction, as opposed to the critic as in MA-BDDPG. However, dynamics model predictions are treated equally regardless of imagination depth, and the lack of use of real data for policy training may become problematic if dynamics models fail to capture phenomena occurring in reality. In any case, ME-TRPO demonstrates the success of using the bootstrap for estimating the degree of uncertainty in models, and we believe that this notion can be incorporated in future work combined with MVE. ME-TRPO is orthogonal and complementary to our method. (3) The use of imagination as context for value estimation is most similar to MVE, but existing literature does not address model accuracy. In particular, unlike the aforementioned works, which focus on quantification of model uncertainty to limit model use, an end-to-end approach, I2A, avoids explicit reasoning about model inaccuracy \cite{i2a}. I2A supplies imagined rollouts as inputs to critic and actor networks, which are free to interpret the imaginary data in whatever way they learn to. A related approach is proposed by value prediction networks (VPN), which expand encoded state predictions and perform backups on a set of expanded imagined paths to compute an improved target estimate \cite{vpn}. Both I2A and VPN are tested on planning problems in discrete spaces. However, in continuous spaces, some degree of dynamics prediction error is unavoidable and may affect I2A stability or sample complexity as the network must learn to deal with uncertain rollouts. In addition, VPN crucially relies on the ability to perform stable backups on imagined paths with respect to current and future actions. These backups amount to optimizing over the action space to maximize the value function, which may be problematic in the continuous case. However, we believe that a stable model-based value expansion, which may be achieved with the TD-$k$ trick, along with careful optimization, may make a VPN-like approach viable in continuous contexts. Finally, we note that MVE has some high-level similarity to $n$-step return methods. Both use short horizon rollouts to improve the value estimate, frequently used as a target value in computing Bellman error. Usually, $n$-step return methods are on-policy: they estimate target $Q$-values at some state-action pair as $\sum_{t=0}^{H-1}\gamma^tr_t+\gamma^H\hat Q(s_H,a_H)$ for a trace of rewards $r_t$ in an observed $H$-step trajectory \cite{inc}. The main difference of MVE from $n$-step return methods, explicit state prediction via dynamics modeling, is essential because it enables faster learning by use of off-policy data. Recent work, path consistency learning (PCL), relieves the on-policy requirements: PCL trains on a soft consistency error that is compatible with off-policy trajectories \cite{pcl}. We believe that model-based extension of PCL with imagined rollouts may be possible following the algorithm design lessons MVE recommends. In particular, using an imagination buffer of rollouts to augment paths chosen for consistency learning may result in stale data and requires model use to be tempered by the stability of the algorithm to taking many gradient steps without gathering additional data. An MVE approach could augment paths with imagined branches that would be followed by the current policy, and the path consistency value would be the average over such branches. In other words, MVE may be complimentary to PCL, similar to how off-policy actor-critic methods can still be improved with MVE value estimation from imagined data, even though they are already off-policy. \section{Conclusion} In this paper, we introduce the model-based value expansion (MVE) method, an algorithm for incorporating predictive models of system dynamics into model-free value function estimation. Our approach provides for improved sample complexity on a range of continuous action benchmark tasks, and our analysis illuminates some of the design decisions that are involved in choosing how to combine model-based predictions with model-free value function learning. Existing approaches following a general Dyna-like approach to using imagination rollouts for improvement of model-free value estimates either use stale data in an imagination buffer or use the model to imagine past horizons where the prediction is accurate. Multiple heuristics \cite{metrpo,kalweit} have been proposed to reduce model usage to combat such problems, but these techniques generally involve a complex combination of uncertainty estimation and additional hyperparameters and may not always appropriately restrict model usage to reasonable horizon lengths. MVE offers a single, simple, and adjustable notion of model trust ($H$), and fully utilizes the model to that extent. MVE also demonstrates that state dynamics prediction enables on-policy imagination via the TD-$k$ trick starting from off-policy data. Our work justifies further exploration in model use for model-free sample complexity reduction. In particular, estimating uncertainty in the dynamics model explicitly would enable automatic selection of $H$. To deal with sparse reward signals, we also believe it is important to consider exploration with the model, not just refinement of value estimates. Finally, MVE admits extensions into domains with probabilistic dynamics models and stochastic policies via Monte Carlo integration over imagined rollouts. \section*{Acknowledgements} The authors are very thankful for the valuable feedback from Roberto Calandra, Gregory Kahn, Anusha Nagabandi, and Richard Liaw. This research is supported in part by DHS Award HSHQDC-16-3-00083, NSF CISE Expeditions Award CCF-1139158, and gifts from Alibaba, Amazon Web Services, Ant Financial, CapitalOne, Ericsson, GE, Google, Huawei, Intel, IBM, Microsoft, Scotiabank, Splunk and VMware. \FloatBarrier
{'timestamp': '2018-03-02T02:03:26', 'yymm': '1803', 'arxiv_id': '1803.00101', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00101'}
arxiv
\section{Introduction} \label{intro} We study a novel approach to collaborative ranking---the personalized ranking of items for users based on their observed preferences---through the use of listwise losses, which are dependent only on the observed rankings of items by users. We propose the SQL-Rank algorithm, which can handle ties and missingness, incorporate both explicit ratings and more implicit feedback, provides personalized rankings, and is based on the relative rankings of items. To better understand the proposed contributions, let us begin with a brief history of the topic. \subsection{A brief history of collaborative ranking} Recommendation systems, found in many modern web applications, movie streaming services, and social media, rank new items for users and are judged based on user engagement (implicit feedback) and ratings (explicit feedback) of the recommended items. A high-quality recommendation system must understand the popularity of an item and infer a user's specific preferences with limited data. Collaborative filtering, introduced in \cite{hill1995recommending}, refers to the use of an entire community's preferences to better predict the preferences of an individual (see \cite{schafer2007collaborative} for an overview). In systems where users provide ratings of items, collaborative filtering can be approached as a point-wise prediction task, in which we attempt to predict the unobserved ratings \cite{pan2017transfer}. Low rank methods, in which the rating distribution is parametrized by a low rank matrix (meaning that there are a few latent factors) provides a powerful framework for estimating ratings \cite{mnih2008probabilistic, koren2008factorization}. There are several issues with this approach. One issue is that the feedback may not be representative of the unobserved entries due to a sampling bias, an effect that is prevalent when the items are only `liked' or the feedback is implicit because it is inferred from user engagement. Augmenting techniques like weighting were introduced to the matrix factorization objective to overcome this problem \cite{hsieh2015pu, hu2008collaborative}. Many other techniques are also introduced \cite{kabbur2013fism, wang2017irgan, wu2016collaborative}. Another methodology worth noting is the CofiRank algorithm of \cite{weimer2008cofi} which minimizes a convex surrogate of the normalized discounted cumulative gain (NDCG). The pointwise framework has other flaws, chief among them is that in recommendation systems we are not interested in predicting ratings or engagement, but rather we must rank the items. Ranking is an inherently relative exercise. Because users have different standards for ratings, it is often desirable for ranking algorithms to rely only on relative rankings and not absolute ratings. A ranking loss is one that only considers a user's relative preferences between items, and ignores the absolute value of the ratings entirely, thus deviating from the pointwise framework. Ranking losses can be characterized as pairwise and listwise. A pairwise method decomposes the objective into pairs of items $j,k$ for a user $i$, and effectively asks `did we successfully predict the comparison between $j$ and $k$ for user $i$?'. The comparison is a binary response---user $i$ liked $j$ more than or less than $k$---with possible missing values in the event of ties or unobserved preferences. Because the pairwise model has cast the problem in the classification framework, then tools like support vector machines were used to learn rankings; \cite{joachims2002optimizing} introduces rankSVM and efficient solvers can be found in \cite{chapelle2010efficient}. Much of the existing literature focuses on learning a single ranking for all users, which we will call simple ranking \cite{freund2003efficient,agarwal2006ranking, pahikkala2009efficient}. This work will focus on the personalized ranking setting, in which the ranking is dependent on the user. Pairwise methods for personalized ranking have seen great advances in recent years, with the AltSVM algorithm of \cite{park2015preference}, Bayesian personalized ranking (BPR) of \cite{rendle2009bpr}, and the near linear-time algorithm of \cite{wu2017large}. Nevertheless, pairwise algorithms implicitly assume that the item comparisons are independent, because the objective can be decomposed where each comparison has equal weight. Listwise losses instead assign a loss, via a generative model, to the entire observed ranking, which can be thought of as a permutation of the $m$ items, instead of each comparison independently. The listwise permutation model, introduced in \cite{cao2007learning}, can be thought of as a weighted urn model, where items correspond to balls in an urn and they are sequentially plucked from the urn with probability proportional to $\phi(X_{ij})$ where $X_{ij}$ is the latent score for user $i$ and item $j$ and $\phi$ is some non-negative function. They proposed to learn rankings by optimizing a cross entropy between the probability of $k$ items being at the top of the ranking and the observed ranking, which they combine with a neural network, resulting in the ListNet algorithm. \cite{shi2010list} applies this idea to collaborative ranking, but uses only the top-1 probability because of the computational complexity of using top-k in this setting. This was extended in \cite{huang2015listwise} to incorporate neighborhood information. \cite{xia2008listwise} instead proposes a maximum likelihood framework that uses the permutation probability directly, which enjoyed some empirical success. Very little is understood about the theoretical performance of listwise methods. \cite{cao2007learning} demonstrates that the listwise loss has some basic desirable properties such as monotonicity, i.e.~increasing the score of an item will tend to make it more highly ranked. \cite{lan2009generalization} studies the generalizability of several listwise losses, using the local Rademacher complexity, and found that the excess risk could be bounded by a \smash{$1/\sqrt n$} term (recall, $n$ is the number of users). Two main issues with this work are that no dependence on the number of items is given---it seems these results do not hold when $m$ is increasing---and the scores are not personalized to specific users, meaning that they assume that each user is an independent and identically distributed observation. A simple open problem is: can we consistently learn preferences from a single user's data if we are given item features and we assume a simple parametric model? ($n = 1, m\rightarrow \infty$.) \subsection{Contributions of this work} We can summarize the shortcomings of the existing work: current listwise methods for collaborative ranking rely on the top-$1$ loss, algorithms involving the full permutation probability are computationally expensive, little is known about the theoretical performance of listwise methods, and few frameworks are flexible enough to handle explicit and implicit data with ties and missingness. This paper addresses each of these in turn by proposing and analyzing the SQL-rank algorithm. \begin{compactitem} \item We propose the SQL-Rank method, which is motivated by the permutation probability, and has advantages over the previous listwise method using cross entropy loss. \item We provide an $O(\text{iter} \cdot (|\Omega| r))$ linear algorithm based on stochastic gradient descent, where $\Omega$ is the set of observed ratings and $r$ is the rank. \item The methodology can incorporate both implicit and explicit feedback, and can gracefully handle ties and missing data. \item We provide a theoretical framework for analyzing listwise methods, and apply this to the simple ranking and personalized ranking settings, highlighting the dependence on the number of users and items. \end{compactitem} \section{Methodology} \label{method} \subsection{Permutation probability} The permutation probability, \cite{cao2007learning}, is a generative model for the ranking parametrized by latent scores. First assume there exists a ranking function that assigns scores to all the items. Let's say we have $m$ items, then the scores assigned can be represented as a vector $s = (s_1, s_2, ..., s_m)$. Denote a particular permutation (or ordering) of the $m$ items as $\pi$, which is a random variable and takes values from the set of all possible permutations $S_m$ (the symmetric group on $m$ elements). $\pi_1$ denotes the index of highest ranked item and $\pi_m$ is the lowest ranked. The probability of obtaining $\pi$ is defined to be \begin{equation} \label{eq:permprob} P_{s}(\pi) := \prod_{j=1}^m \frac{\phi(s_{\pi_j})}{\sum_{l=j}^{m} \phi(s_{\pi_l})}, \end{equation} where $\phi(.)$ is an increasing and strictly positive function. An interpretation of this model is that each item is drawn without replacement with probability proportional to $\phi(s_i)$ for item $i$ in each step. One can easily show that $P_{s}(\pi)$ is a valid probability distribution, i.e.~$\sum_{\pi \in S_m} P_{s}(\pi) = 1, P_{s}(\pi) > 0, \forall \pi$. Furthermore, this definition of permutation probability enjoys several favorable properties (see \cite{cao2007learning}). For any permutation $\pi$ if you swap two elements ranked at $i<j$ generating the permutation $\pi'$ ($\pi'_i = \pi_j$, $\pi'_j = \pi_i$, $\pi_k = \pi'_k, k\ne i,j$), if $s_{\pi_i} > s_{\pi_j}$ then $P_s(\pi) > P_s(\pi')$. Also, if permutation $\pi$ satisfies $s_{\pi_i} > s_{\pi_{i+1}}$, $\forall i$, then we have $\pi = \arg\max_{\pi' \in S_m} P_{s}(\pi')$. Both of these properties can be summarized: larger scores will tend to be ranked more highly than lower scores. These properties are required for the negative log-likelihood to be considered sound for ranking \cite{xia2008listwise}. In recommendation systems, the top ranked items can be more impactful for the performance. In order to focus on the top $k$ ranked items, we can compute the partial-ranking marginal probability, \begin{equation} \label{eq:topk_prob} P^{(k,\bar{m})}_{s}(\pi) = \prod_{j=1}^{\min\{k, \bar{m}\}} \frac{\phi(s_{\pi_j})}{\sum_{l=j}^{\bar{m}} \phi(s_{\pi_l})}. \end{equation} It is a common occurrence that only a proportion of the $m$ items are ranked, and in that case we will allow $\bar{m} \le m$ to be the number of observed rankings (we assume that $\pi_1,\ldots,\pi_{\bar{m}}$ are the complete list of ranked items). When $k=1$, the first summation vanishes and top-$1$ probability can be calculated straightforwardly, which is why $k=1$ is widely used in previous listwise approaches for collaborative ranking. Counter-intuitively, we demonstrate that using a larger $k$ tends to improve the ranking performance. We see that computing the likelihood loss is linear in the number of ranked items, which is in contrast to the cross-entropy loss used in \cite{cao2007learning}, which takes exponential time in $k$. The cross-entropy loss is also not sound, i.e.~it can rank worse scoring permutations more highly, but the negative log-likelihood is sound. We will discuss how we can deal with ties in the following subsection, namely, when the ranking is derived from ratings and multiple items receive the same rating, then there is ambiguity as to the order of the tied items. This is a common occurrence when the data is implicit, namely the output is whether the user engaged with the item or not, yet did not provide explicit feedback. Because the output is binary, the cross-entropy loss (which is based on top-$k$ probability with $k$ very small) will perform very poorly because there will be many ties for the top ranked items. To this end, we propose a collaborative ranking algorithm using the listwise likelihood that can accommodate ties and missingness, which we call Stochastic Queuing Listwise Ranking, or SQL-Rank. \begin{figure}[ht] \vspace{-0.1in} \begin{center} \centerline{\includegraphics[width=\columnwidth]{figures/demo.png}} \caption{Demonstration of Stochastic Queuing Process---the rating matrix $R$ (left) generates multiple possible rankings $\Pi$'s (right), $\Pi \in \mathcal S(R,\Omega)$ by breaking ties randomly.} \label{demo} \end{center} \vskip -0.3in \end{figure} \subsection{Deriving objective function for SQL-Rank} The goal of collaborative ranking is to predict a personalized score $X_{ij}$ that reflects the preference level of user $i$ towards item $j$, where $1 \leq i \leq n$ and $1 \leq j \leq m$. It is reasonable to assume the matrix $X \in \mathbb{R}^{n \times m}$ to be low rank because there are only a small number of latent factors contributing to users' preferences. The input data is given in the form of ``user $i$ gives item $j$ a relevance score $R_{ij}$''. Note that for simplicity we assume all the users have the same number $\bar{m}$ of ratings, but this can be easily generalized to the non-uniform case by replacing $\bar{m}$ with $m_i$ (number of ratings for user $i$). With our scores $X$ and our ratings $R$, we can specify our collaborative ranking model using the permutation probability \eqref{eq:topk_prob}. Let $\Pi_i$ be a ranking permutation of items for user $i$ (extracted from $R$), we can stack $\Pi_1, \dots \Pi_n$, row by row, to get the permutation matrix $\Pi \in \mathbb{R}^{n\times m}$. Assuming users are independent with each other, the probability of observing a particular $\Pi$ given the scoring matrix $X$ can be written as \begin{equation} P_{X}^{(k, \bar{m})}(\Pi) = \prod_{i=1}^{n} P^{(k,\bar{m})}_{X_i}(\Pi_i). \end{equation} We will assume that $\log \phi(x) = 1/(1 + \exp(-x))$ is the sigmoid function. This has the advantage of bounding the resulting weights, \smash{$\phi(X_{ij})$}, and maintaining their positivity without adding additional constraints. Typical rating data will contain many {\em ties} within each row. In such cases, the permutation $\Pi$ is no longer unique and there is a set of permutations that coincides with rating because with any candidate $\Pi$ we can arbitrarily shuffle the ordering of items with the same relevance scores to generate a new candidate matrix $\Pi'$ which is still valid (see Figure~\ref{demo}). We denote the set of valid permutations as $\mathcal S (R, \Omega)$, where $\Omega$ is the set of all pairs $(i,j)$ such that $R_{i,j}$ is observed. We call this shuffling process the {\it Stochastic Queuing Process}, since one can imagine that by permuting ties we are stochastically queuing new $\Pi$'s for future use in the algorithm. The probability of observing $R$ therefore should be defined as $P_{X}^{(k, \bar{m})}(R) = \sum_{\Pi \in \mathcal S (R, \Omega)}P_X(\Pi)$. To learn the scoring matrix $X$, we can naturally solve the following maximum likelihood estimator with low-rank constraint: \begin{equation} \min_{X \in \mathcal X} - \log \sum_{\Pi \in \mathcal S (R, \Omega)} P_X^{(k, \bar{m})}(\Pi), \label{eq:aaa} \end{equation} where $\mathcal{X}$ is the structural constraint of the scoring matrix. To enforce low-rankness, we use the nuclear norm regularization $\mathcal{X}=\{X: \|X\|_*\leq r\}$. Eq~\eqref{eq:aaa} is hard to optimize since there is a summation inside the $\log$. But by Jensen's inequality and convexity of $-\log$ function, we can move the summation outside $\log$ and obtain an upper bound of the original negative log-likelihood, leading to the following optimization problem: \begin{equation} \min_{X \in \mathcal X} -\sum_{\Pi \in \mathcal S (R, \Omega)} \log P_X^{(k, \bar{m})}(\Pi) \label{eq:convex} \end{equation} This upper bound is much easier to optimize and can be solved using Stochastic Gradient Descent (SGD). Next we discuss how to apply our model for explicit and implicit feedback settings. In the explicit feedback setting, it is assumed that the matrix $R$ is partially observed and the observed entries are explicit ratings in a range (e.g., $1$ to $5$). We will show in the experiments that $k=\bar{m}$ (using the full list) leads to the best results. \cite{huang2015listwise} also observed that increasing $k$ is useful for their cross-entropy loss, but they were not able to increase $k$ since their model has time complexity exponential to $k$. In the implicit feedback setting each element of $R_{ij}$ is either $1$ or $0$, where $1$ means positive actions (e.g., click or like) and $0$ means no action is observed. Directly solving~\eqref{eq:convex} will be expensive since $\bar{m}=m$ and the computation will involve all the $mn$ elements at each iteration. Moreover, the $0$'s in the matrix could mean either a lower relevance score or missing, thus should contribute less to the objective function. Therefore, we adopt the idea of negative sampling \cite{mikolov2013distributed} in our list-wise formulation. For each user (row of $R$), assume there are $\tilde{m}$ $1$'s, we then sample $\rho \tilde{m}$ unobserved entries uniformly from the same row and append to the back of the list. This then becomes the problem with $\bar{m}=(1+\rho) \tilde{m}$ and then we use the same algorithm in explicit feedback setting to conduct updates. We then repeat the sampling process at the end of each iteration, so the update will be based on different set of $0$'s at each time. \begin{algorithm}[tb] \caption{SQL-Rank: General Framework} \label{alg:sqlrank} \begin{algorithmic} \STATE {\bfseries Input:} $\Omega$, $\{R_{ij}: (i, j) \in \Omega \}$, $\lambda\in \mathbb{R}^+$, $ss$, $rate$, $\rho$ \STATE {\bfseries Output:} $U\in \mathbb{R}^{r \times n}$ and $V \in \mathbb{R}^{r \times m}$ \STATE Randomly initialize $U, V$ from Gaussian Distribution \REPEAT \STATE Generate a new permutation matrix $\Pi$ \COMMENT{see alg~\ref{alg:sq}} \STATE Apply gradient update to U while fixing V \STATE Apply gradient update to V while fixing U \COMMENT{see alg~\ref{alg:update}} \UNTIL{performance for validation set is good} \STATE \textbf{return} $U, V$\COMMENT{recover score matrix $X$} \end{algorithmic} \end{algorithm} \begin{algorithm}[tb] \caption{Stochastic Queuing Process} \label{alg:sq} \begin{algorithmic} \STATE {\bfseries Input:} $\Omega$, $\{R_{ij}: (i, j) \in \Omega \}$, $\rho$ \STATE {\bfseries Output:} $\Pi \in \mathbb{R}^{n \times m}$ \FOR{$i = 1$ {\bfseries to} $n$} \STATE Sort items based on observed relevance levels $R_i$ \STATE Form $\Pi_i$ based on indices of items in the sorted list \STATE Shuffle $\Pi_i$ for items within the same relevance level \IF{Dataset is implicit feedback} \STATE Uniformly sample $\rho \tilde{m}$ items from unobserved items \STATE Append sampled indices to the back of $\Pi_i$ \ENDIF \ENDFOR \STATE Stack $\Pi_i$ as rows to form matrix $\Pi$ \STATE {\bfseries Return} $\Pi$ \COMMENT{Used later to compute gradient} \end{algorithmic} \end{algorithm} \subsection{Non-convex implementation} Despite the advantage of the objective function in equation~\eqref{eq:convex} being convex, it is still not feasible for large-scale problems since the scoring matrix $X\in \mathbb{R}^{n\times m}$ leads to high computational and memory cost. We follow a common trick to transform~\eqref{eq:convex} to the non-convex form by replacing $X=U^TV$: with $U \in \mathbb{R}^{r \times n}, V\in \mathbb{R}^{r \times m}$ so that the objective is, \begin{align*} \! \sum_{\Pi \in \mathcal S (R, \Omega)}\!\! \underbrace{-\sum_{i=1}^{n} \sum_{j=1}^{\bar{m}} \log \frac{\phi(u_i^T v_{\Pi_{ij}})}{\sum_{l=j}^{\bar{m}} \phi(u_i^T v_{\Pi_{il}})}}_{f(U, V)} \! +\! \frac{\lambda}{2} (\|U\|_F^2 \!+\! \|V\|_F^2), \label{eq:nonconvex} \end{align*} where $u_i, v_j$ are columns of $U, V$ respectively. We apply stochastic gradient descent to solve this problem. At each step, we choose a permutation matrix $\Pi\in\mathcal S (R, \Omega) $ using the stochastic queuing process (Algorithm \ref{alg:sq}) and then update $U, V$ by $\nabla f(U, V)$. For example, the gradient with respect to $V$ is ($g = \log \phi$ is the sigmoid function), \begin{align*} \frac{\partial f}{\partial v_j} &= \sum_{i\in \Omega_j} \sum_{t=1}^{\bar{m}}\bigg\{ -g'(u_i^T v_t) u_i \\ & + \frac{\mathbbm{1}(\text{rank}_i(j)\geq t) \phi(u_i^T v_j)}{\sum_{l=t}^{\bar{m}}\phi(u_i^T v_{\Pi_{il}})} g'(u_i^T v_j)u_i\bigg\} \end{align*} where $\Omega_j$ denotes the set of users that have rated the item $j$ and $\text{rank}_i(j)$ is a function gives the rank of the item $j$ for that user $i$. Because $g$ is the sigmoid function, $g' = g \cdot (1 - g)$. The gradient with respect to $U$ can be derived similarly. As one can see, a naive way to compute the gradient of $f$ requires $O(n \bar{m}^2 r)$ time, which is very slow even for one iteration. However, we show in Algorithm~\ref{alg:gradv} (in the appendix) that there is a smart way to re-arranging the computation so that $\nabla_V f(U, V)$ can be computed in $O(n \bar{m} r)$ time, which makes our SQL-Rank a linear-time algorithm (with the same per-iteration complexity as classical matrix factorization). \section{Theory} \label{theory} Throughout this section, we will establish a theoretical framework for understanding listwise ranking algorithms. We do not consider ties and missing data and reserve this extension of the theory developed here for future work. These tools can be employed to analyze any problem of the constrained form \begin{equation} \label{eq:constrainedform} \hat X := \arg\min - \log P_X(\Pi) \textrm{ such that } X \in \mathcal X. \end{equation} We will consider two main settings of listwise ranking, the simple ranking setting where for each $X \in \mathcal X$, \begin{equation} \label{eq:simplepara} X_{ij} = \beta^\top z_{ij}, \beta \in \mathbb R^{s}, \| \beta \| \le c_b, \end{equation} where the feature vectors $z_{ij} \in \mathbb R^{s}$ are known, and the personalized setting, \begin{equation} \label{eq:persmodel} X_{ij} = u_i^\top v_j, \\ u_i, v_j \in \mathbb R^{r}, \| U \|_F \le c_u, \| V \|_F \le c_v. \end{equation} The simple ranking setting, among other listwise programs was considered in \cite{lan2009generalization}, and it was determined that the excess risk is bounded by a \smash{$1 / \sqrt n$} term. Critically, these results assumed that the number of items $m$ is bounded, severely limiting their relevance to realistic recommendation systems. It seems that we should be able to learn something about a user's preferences by having them rank more items, yet the existing theory does not reflect this. The main engine of our theoretical analysis is a generative mechanism for listwise ranking, which demonstrates that the permutation probability model, \eqref{eq:permprob}, is also the probability of a row-wise ordering of an exponential ensemble matrix. We demonstrate that the excess risk in the parametric setting scales like $\sqrt{m} \ln m / n$, achieving parametric rates in $n$ and sub-linear excess risk in $m$ when the feature dimension $s$ is fixed. In the personalized setting, \eqref{eq:persmodel}, we bound the excess risk by $\sqrt{m/n} \ln m$ when the rank $r$ is fixed, which matches comparable results for matrix factorization up to log factors. \subsection{Generative mechanism for listwise ranking} We give an alternative generative mechanism which will prove useful for understanding the listwise ranking objective. \begin{theorem} \label{thm:gen} Consider a matrix, $Y$, with independent entries, $Y_{ij}$ that are drawn from an exponential distribution with rate $\phi(X_{ij})$. Let $\Pi_i$ be the ordering of the entries of $Y_i$ from smallest to largest, then the probability of $\Pi_i | X_i$ is exactly $P_{X_i}(\Pi_i)$. \end{theorem} The proof is in the appendix. A key aspect of this generative mechanism is that the listwise likelihood can be written as a function of the exponential ensemble. This allows us to establish concentration of measure results for the listwise loss via bounded differences. \subsection{Statistical guarantees} As a first step to controlling the excess risk, we establish a basic inequality. This bounds the excess risk by an empirical process term, which is a random function of $\hat X$ and for a fixed $\hat X$ it has mean zero. The excess risk (the difference in expected loss between the estimate and the truth) can also be written as the KL divergence between the estimated model and the true model. \begin{lemma} \label{lem:basic} Consider the minimizer, $\hat X$, to the constrained optimization, \eqref{eq:constrainedform}. Suppose that there exists a $X^\star \in \mathcal X$ such that $\Pi_i \sim P_{X^\star_i}$ independently for all \smash{$i=1,\ldots,n$}. The KL-divergence between the estimate and the truth is bounded \begin{align*} &D(X^\star,\hat X) := \frac 1n \sum_{i=1}^n \mathbb E \log \frac{P_{X_i^\star}(\Pi_i)}{P_{\hat X_i}(\Pi_i)} \tag{basic} \label{eq:basic} \\ &\le - \frac 1n \sum_{i=1}^n \left( \log \frac{P_{X_i^\star}(\Pi_i)}{P_{\hat X_i}(\Pi_i)} - \mathbb E \log \frac{P_{X_i^\star}(\Pi_i)}{P_{\hat X_i}(\Pi_i)} \right). \end{align*} \end{lemma} Because the RHS of \eqref{eq:basic}, the empirical process term, has mean zero and is a function of the random permutation, we can use Theorem \ref{thm:gen} to bound it with high probability for a fixed $\hat X$. Because $\hat X$ is random, we need to control the empirical process term uniformly over the selection of $\hat X \in \mathcal X$. To this end, we employ Dudley's chaining, which gives us the following theorem (see the Supplement for the complete proof). \begin{theorem} \label{thm:chaining} Assume the conditions of Lemma \ref{lem:basic}. Define the matrix norm, for the $n \times m$ matrix $Z$, $$ \| Z \|_{\infty, 2} := \sqrt{ \sum_{i=1}^n \| Z_i \|_\infty^2} $$ and define $\mathcal Z = \{ \log \phi(X) : X \in \mathcal X\}$ where $\log \phi$ is applied elementwise. Also, let $\mathcal N(\epsilon, \mathcal Z, \| . \|_{\infty,2})$ be the $\epsilon$-covering number of $\mathcal Z$ in the $\infty,2$ norm (the fewest number of $\epsilon$ radius balls in the $\infty,2$ norm required to cover $\mathcal Z$). Then, if $\sup_{Z \in \mathcal Z} \| Z \|_\infty \le C$ (where $\| . \|_\infty$ is the elementwise absolute maximum), then \begin{equation*} D(X^\star,\hat X) = O_{\mathbb P} \left( \frac{\sqrt m \ln(m)}{n} \cdot g(\mathcal Z) \right), \end{equation*} where \begin{equation*} g(\mathcal Z) := \int_0^\infty \sqrt{\ln \mathcal N (u,\mathcal Z, \|. \|_{\infty,2})} {\rm d}u, \end{equation*} and $C$ is bounded by a constant in $n,m$. \end{theorem} Theorem \ref{thm:chaining} bounds the KL-divergence by the geometric quantity $g(\mathcal Z)$. For the derived corollaries, we will assume that $\log \phi$ is 1-Lipschitz, which is true when $\log \phi$ is the sigmoid function. The results do not significantly change by increasing the Lipschitz constant, so for simplicity of presentation we set it to be 1. \begin{corollary} \label{cor:simple} Assume the conditions to Lemma \ref{lem:basic}, the simple ranking setting \eqref{eq:simplepara}, that $\log \phi$ is 1-Lipschitz, and $\|Z_{ij}\|_2$ is bounded uniformly, then $$ D(X^\star,\hat X) = O_{\mathbb P} \left( \frac{\sqrt{sm}}{n} \ln m\right). $$ \end{corollary} Notably when $n=1$ this bound is on the order of $\sqrt m \ln m$. In the event that $P_{X^\star}$ is concentrated primarily on a single permutation for this user, and we resort to random guessing (i.e.~$\hat X_{1j} = 0$) then the KL divergence will be close to $\ln m! \approx m \ln m$. So, a reduction of the KL-divergence from order $m \ln m$ to $\sqrt m \ln m$ is a large improvement, and the above result should be understood to mean that we can achieve consistency even when $n=1$ (where consistency is measured relative to random guessing). \begin{corollary} \label{cor:person} Assume the conditions to Lemma \ref{lem:basic}, the personalized ranking setting, \eqref{eq:persmodel}, and that $\log \phi$ is 1-Lipschitz, $$ D(X^\star,\hat X) = O_{\mathbb P} \left( \sqrt{\frac{rm}{n}}\ln m\right). $$ \end{corollary} Notably, even in the personalized setting, where each user has their own preferences, we can achieve $1/\sqrt n$ rates for fixed $m,r$. Throughout these results the $O_{\mathbb P}$ notation only hides the constants $c_b, c_u, c_v$, and any dependence on $s,r,m,n$ is explicitly given. While Theorem \ref{thm:chaining} gives us a generic result that can be applied to a large range of constraint sets, we believe that the parametric simple ranking and the low-rank personalized setting are the two most important listwise ranking problems. \section{Experiments} \label{exp} In this section, we compare our proposed algorithm (SQL-Rank) with other state-of-the-art algorithms on real world datasets. Note that our algorithm works for both implicit feedback and explicit feedback settings. In the implicit feedback setting, all the ratings are $0$ or $1$; in the explicit feedback setting, explicit ratings (e.g., $1$ to $5$) are given but only to a subset of user-item pairs. Since many real world recommendation systems follow the implicit feedback setting (e.g., purchases, clicks, or checkins), we will first compare SQL-Rank on implicit feedback datasets and show it outperforms state-of-the-art algorithms. Then we will verify that our algorithm also performs well on explicit feedback problems. All experiments are conducted on a server with an Intel Xeon E5-2640 2.40GHz CPU and 64G RAM. \subsection{Implicit Feedback} In the implicit feedback setting we compare the following methods: \begin{compactitem} \item SQL-Rank: our proposed algorithm implemented in Julia \footnote{\url{https://github.com/wuliwei9278/SQL-Rank}}. \item Weighted-MF: the weighted matrix factorization algorithm by putting different weights on $0$ and $1$'s \cite{hu2008collaborative,hsieh2015pu}. \item BPR: the Bayesian personalized ranking method motivated by MLE \cite{rendle2009bpr}. For both Weighted-MF and BPR, we use the C++ code by Quora \footnote{\url{https://github.com/quora/qmf}}. \end{compactitem} Note that other collaborative ranking methods such as Pirmal-CR++~\cite{wu2017large} and List-MF~\cite{shi2010list} do not work for implicit feedback data, and we will compare with them later in the explicit feedback experiments. For the performance metric, we use precision@$k$ for $k = 1, 5, 10$ defined by \begin{equation} \text{precision}@k = \frac{\sum_{i=1}^{n}|\{1 \leq l \leq k: R_{i\Pi_{il}} = 1\}|}{n \cdot k}, \end{equation} where $R$ is the rating matrix and $\Pi_{il}$ gives the index of the $l$-th ranked item for user $i$ among all the items not rated by user $i$ in the training set. We use rank $r = 100$ and tune regularization parameters for all three algorithms using a random sampled validation set. For Weighted-MF, we also tune the confidence weights on unobserved data. For BPR and SQL-Rank, we fix the ratio of subsampled unobserved $0$'s versus observed $1$'s to be $3:1$, which gives the best performance for both BPR and SQL-rank in practice. We experiment on the following four datasets. Note that the original data of Movielens1m, Amazon and Yahoo-music are ratings from $1$ to $5$, so we follow the procedure in \cite{rendle2009bpr,yu2017selection} to preprocess the data. We transform ratings of $4, 5$ into $1$'s and the rest entries (with rating $1, 2, 3$ and unknown) as $0$'s. Also, we remove users with very few $1$'s in the corresponding row to make sure there are enough $1$'s for both training and testing. For Amazon, Yahoo-music and Foursquare, we discard users with less than $20$ ratings and randomly select $10$ $1$'s as training and use the rest as testing. Movielens1m has more ratings than others, so we keep users with more than $60$ ratings, and randomly sample 50 of them as training. \begin{compactitem} \item Movielens1m: a popular movie recommendation data with $6,040$ users and $3,952$ items \item Amazon: the Amazon purchase rating data for musical instruments \footnote{\url{http://jmcauley.ucsd.edu/data/amazon/}} with $339,232$ users and $83,047$ items. \item Yahoo-music: the Yahoo music rating data set \footnote{\url{https://webscope.sandbox.yahoo.com/catalog.php?datatype=r&did=3}} which contains $15,400$ users and $1,000$ items. \item Foursquare: a location check-in data\footnote{\url{https://sites.google.com/site/yangdingqi/home/foursquare-dataset}}. The data set contains $3,112$ users and $3,298$ venues with $27,149$ check-ins. The data set is already in the form of ``0/1'' so we do not need to do any transformation. \end{compactitem} The experimental results are shown in Table~\ref{implicit-combined}. We find that SQL-Rank outperforms both Weighted-MF and BPR in most cases. \begin{table}[t] \caption{Comparing implicit feedback methods on various datasets.} \label{implicit-combined} \begin{center} \begin{small} \begin{sc} \resizebox{0.5\textwidth}{!}{ \begin{tabular}{lccccr} \toprule Dataset & Method & P@1 & P@5 & P@10 \\ \midrule \multirow{3}{*}{Movielens1m} & SQL-Rank & {\bfseries 0.73685} & {\bfseries 0.67167} & 0.61833 \\ & Weighted-MF & 0.54686 & 0.49423 & 0.46123 \\ & BPR & 0.69951 & 0.65608 & {\bfseries 0.62494} \\ \midrule \multirow{3}{*}{Amazon} & SQL-Rank & 0.04255 & {\bfseries 0.02978} & {\bfseries 0.02158} \\ & Weighted-MF & 0.03647 & 0.02492 & 0.01914 \\ & BPR & {\bfseries 0.04863} & 0.01762 & 0.01306 \\ \midrule \multirow{3}{*}{Yahoo music} & SQL-Rank & {\bfseries 0.45512} & {\bfseries 0.36137} & {\bfseries 0.30689} \\ & Weighted-MF & 0.39075 & 0.31024 & 0.27008 \\ & BPR & 0.37624 & 0.32184 & 0.28105 \\ \midrule \multirow{3}{*}{Foursquare} & SQL-Rank & {\bfseries 0.05825} & {\bfseries 0.01941} & {\bfseries 0.01699} \\ & Weighted-MF & 0.02184 & 0.01553 & 0.01407 \\ & BPR & 0.03398 & 0.01796 & 0.01359 \\ \bottomrule \end{tabular} } \end{sc} \end{small} \end{center} \vskip -0.1in \end{table} \subsection{Explicit Feedback} Next we compare the following methods in the explicit feedback setting: \begin{compactitem} \item SQL-Rank: our proposed algorithm implemented in Julia. Note that in the explicit feedback setting our algorithm only considers pairs with explicit ratings. \item List-MF: the listwise algorithm using the cross entropy loss between observed rating and top $1$ probability \cite{shi2010list}. We use the C++ implementation on github\footnote{\url{https://github.com/gpoesia/listrankmf}}. \item MF: the classical matrix factorization algorithm in \cite{koren2008factorization} utilizing a pointwise loss solved by SGD. We implemented SGD in Julia. \item Primal-CR++: the recently proposed pairwise algorithm in \cite{wu2017large}. We use the Julia implementation released by the authors\footnote{\url{https://github.com/wuliwei9278/ml-1m}}. \end{compactitem} Experiments are conducted on Movielens1m and Yahoo-music datasets. We perform the same procedure as in implicit feedback setting except that we do not need to mask the ratings into ``0/1''. We measure the performance in the following two ways: \begin{compactitem} \item NDCG$@k$: defined as: \begin{equation*} \text{NDCG}@k = \frac{1}{n} \sum_{i = 1}^{n} \frac{\text{DCG}@k(i, \Pi_i)}{\text{DCG}@k(i, \Pi_i^*)}, \end{equation*} where $i$ represents $i$-th user and \begin{equation*} \text{DCG}@k(i, \Pi_i)= \sum_{l = 1}^{k} \frac{2^{R_{i\Pi_{il}}} - 1}{log_2(l + 1)}. \end{equation*} In the DCG definition, $\Pi_{il}$ represents the index of the $l$-th ranked item for user $i$ in test data based on the learned score matrix $X$. $R$ is the rating matrix and $R_{ij}$ is the rating given to item $j$ by user $i$. $\Pi_i^*$ is the ordering provided by the ground truth rating. \item Precision@$k$: defined as a fraction of relevant items among the top $k$ recommended items: \begin{equation*} \text{precision}@k = \frac{\sum_{i=1}^{n}|\{1 \leq l \leq k: 4 \leq R_{i\Pi_{il}} \leq 5\}|}{n \cdot k}, \end{equation*} here we consider items with ratings assigned as $4$ or $5$ as relevant. $R_{ij}$ follows the same definitions above but unlike before $\Pi_{il}$ gives the index of the $l$-th ranked item for user $i$ among all the items that are not rated by user $i$ in the training set (including both rated test items and unobserved items). \end{compactitem} As shown in Table~\ref{explicit-combined}, our proposed listwise algorithm SQL-Rank outperforms previous listwise method List-MF in both NDCG@$10$ and precision@$1,5,10$. It verifies the claim that log-likelihood loss outperforms the cross entropy loss if we use it correctly. When listwise algorithm SQL-Rank is compared with pairwise algorithm Primal-CR++, the performances between SQL-Rank and Primal-CR++ are quite similar, slightly lower for NDCG@$10$ but higher for precision@$1,5,10$. Pointwise method MF is doing okay in NDCG but really bad in terms of precision. Despite having comparable NDCG, the predicted top $k$ items given by MF are quite different from those given by other algorithms utilizing a ranking loss. The ordered lists based on SQL-Rank, Primal-CR++ and List-MF, on the other hand, share a lot of similarity and only have minor difference in ranking of some items. It is an interesting phenomenon that we think is worth exploring further in the future. \begin{table}[t] \caption{Comparing explicit feedback methods on various datasets.} \label{explicit-combined} \begin{center} \begin{small} \begin{sc} \resizebox{0.5\textwidth}{!}{ \begin{tabular}{lccccr} \toprule Dataset & Method & NDCG@$10$ & P@1 & P@5 & P@10 \\ \midrule \multirow{3}{*}{Movielens1m} & SQL-Rank & 0.75076 & {\bfseries 0.50736} & {\bfseries 0.43692} & {\bfseries 0.40248} \\ & List-MF & 0.73307 & 0.45226 & 0.40482 & 0.38958 \\ & Primal-CR++ & {\bfseries 0.76826} & 0.49365 & 0.43098 & 0.39779 \\ & MF & 0.74661 & 0.00050 & 0.00096 & 0.00134 \\ \midrule \multirow{3}{*}{Yahoo music} & SQL-Rank & 0.66150 & {\bfseries 0.14983} & {\bfseries 0.12144} & {\bfseries 0.10192} \\ & List-MF & 0.67490 & 0.12646 & 0.11301 & 0.09865 \\ & Primal-CR++ & 0.66420 & 0.14291 & 0.10787 & 0.09104 \\ & MF & {\bfseries 0.69916} & 0.04944 & 0.03105 & 0.04787 \\ \bottomrule \end{tabular} } \end{sc} \end{small} \end{center} \vskip -0.2in \end{table} \subsection{Training speed} To illustrate the training speed of our algorithm, we plot precision@$1$ versus training time for the Movielen1m dataset and the Foursquare dataset. Figure~\ref{time} and Figure~\ref{time2} (in the appendix) show that our algorithm SQL-Rank is faster than BPR and Weighted-MF. Note that our algorithm is implemented in Julia while BPR and Weighted-MF are highly-optimized C++ codes (usually at least 2 times faster than Julia) released by Quora. This speed difference makes sense as our algorithm takes $O(n \bar{m} r)$ time, which is linearly to the observed ratings. In comparison, pair-wise model such as BPR has $O(n\bar{m}^2)$ pairs, so will take $O(n \bar{m}^2 r)$ time for each epoch. \begin{figure}[ht] \vskip -0.1in \begin{center} \centerline{\includegraphics[width=0.8\columnwidth]{figures/ml1m_l.png}} \caption{Training time of implicit feedback methods.} \label{time} \end{center} \vskip -0.4in \end{figure} \subsection{Effectiveness of Stochastic Queuing (SQ)} One important innovation in our SQL-Rank algorithm is the Stochastic Queuing (SQ) Process for handling ties. To illustrate the effectiveness of the SQ process, we compare our algorithm with and without SQ. Recall that without SQ means we fix a certain permutation matrix $\Pi$ and optimize with respect to it throughout all iterations without generating new $\Pi$, while SQ allows us to update using a new permutation at each time. As shown Table~\ref{implicit-sq} and Figure~\ref{sqp} (in the appendix), the performance gain from SQ in terms of precision is substantial (more than $10\%$) on Movielen1m dataset. It verifies the claim that our way of handling ties and missing data is very effective and improves the ranking results by a lot. \begin{table}[t] \caption{Effectiveness of Stochastic Queuing Process.} \label{implicit-sq} \vskip 0.15in \begin{center} \begin{small} \begin{sc} \resizebox{0.35\textwidth}{!}{ \begin{tabular}{lcccr} \toprule Method & P@1 & P@5 & P@10 \\ \midrule With SQ & {\bfseries 0.73685} & {\bfseries 0.67167} & {\bfseries 0.61833} \\ Without SQ & 0.62763 & 0.58420 & 0.55036 \\ \bottomrule \end{tabular} } \end{sc} \end{small} \end{center} \vskip -0.2in \end{table} \subsection{Effectiveness of using the Full List} Another benefit of our algorithm is that we are able to minimize top $k$ probability with much larger $k$ and without much overhead. Previous approaches \cite{huang2015listwise} already pointed out increasing $k$ leads to better ranking results, but their complexity is exponential to $k$ so they were not able to have $k > 1$. To show the effectiveness of using permutation probability for full lists rather than using the top $k$ probability for top $k$ partial lists in the likelihood loss, we fix everything else to be the same and only vary $k$ in Equation~\eqref{eq:convex}. We obtain the results in Table~\ref{explicit-ml1m-topk} and Figure~\ref{explicit_topk} (in the appendix). It shows that the larger $k$ we use, the better the results we can get. Therefore, in the final model, we set $k$ to be the maximum number (length of the observed list.) \vspace{-10pt}\begin{table}[th] \caption{Comparing different $k$ on Movielens1m data set using 50 training data per user.} \label{explicit-ml1m-topk} \vskip 0.15in \begin{center} \begin{small} \begin{sc} \vspace{-15pt}\resizebox{0.5\textwidth}{!}{ \begin{tabular}{lcccr} \toprule $k$ & NDCG@$10$ & P@1 & P@5 & P@10 \\ \midrule 5 & 0.64807 & 0.39156 & 0.33591 & 0.29855 \\ 10 & 0.67746 & 0.43118 & 0.34220 & 0.33339 \\ 25 & 0.74589 & 0.47003 & 0.42874 & 0.39796 \\ 50 (full list) & {\bfseries 0.75076} & {\bfseries 0.50736} & {\bfseries 0.43692} & {\bfseries 0.40248} \\ \bottomrule \end{tabular} } \end{sc} \end{small} \end{center} \vskip -0.2in \end{table} \section{Conclusions} In this paper, we propose a listwise approach for collaborative ranking and provide an efficient algorithm to solve it. Our methodology can incorporate both implicit and explicit feedback, and can gracefully handle ties and missing data. In experiments, we demonstrate our algorithm outperforms existing state-of-the art methods in terms of top $k$ recommendation precision. We also provide a theoretical framework for analyzing listwise methods highlighting the dependence on the number of users and items. \newpage \section*{Acknowledgements} JS is partially supported by NSF DMS-1712996. CJH acknowledge the support by NSF IIS-1719097, Google Cloud and Nvidia. \\ Side Note by Liwei Wu: SQL in SQL-Rank is not only the abbreviation for Stochastically Queuing Listwise, but also name initials of Liwei's girlfriend ShuQing Li. Special thanks for her support.
{'timestamp': '2019-02-08T02:03:01', 'yymm': '1803', 'arxiv_id': '1803.00114', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00114'}
arxiv
\section{Introduction} \begin{figure}[t!] \centering \includegraphics[width=\columnwidth]{overview.eps} \caption{An overview of our method. The auxiliary loss improves the memory of the recurrent network such that the number of steps needed for the main task's BPTT is small.} \label{fig:overview} \end{figure} Many important applications in artificial intelligence require the understanding of long term dependencies between events in a sequence. For example, in natural language processing, it is sometimes necessary to understand relationships between distant events described in a book to answer questions about it. Typically, this is achieved by gradient descent and BPTT~\cite{Rumelhart86} with recurrent networks. Learning long term dependencies with gradient descent, however, is difficult because the gradients computed by BPTT tend to vanish or explode during training~\cite{hochreiter2001gradient}. Additionally, for BPTT to work, one needs to store the intermediate hidden states in the sequence. The memory requirement is therefore proportional to the sequence length, making it difficult to scale to large problems. Several promising approaches have been proposed to alleviate the aforementioned problems. First, instead of using the vanilla recurrent network, one can use Long Short-Term Memory (LSTM)~\cite{hochreiter1997long}, which is designed to improve gradient flow in recurrent networks. In addition, one can also use gradient clipping~\cite{pascanu2013difficulty} to stabilize the training of the LSTM. Finally, to reduce the memory requirement, one can either store the hidden states only periodically~\cite{gruslys2016memory, chen2016training}, use truncated BPTT, or use synthetic gradients~\cite{Jaderberg16synthGrad}. \begin{figure*}[tb] \centering \includegraphics[width=0.8\textwidth]{auxiliary.eps} \caption{An overview of our methods. For each random anchor point, say F, we build an auxiliary loss at its position. \textbf{Left}: We predict a random subsequence BCD that occurs before F. B is inserted into a decoder network to start the reconstruction, while C and D is optionally fed. \textbf{Right}: We predict the subsequence GHI by stacking an auxiliary RNNs on top of the main one. Gradients from auxiliary loss is truncated in both cases to keep the overall cost of BPTT constant.} \label{fig:method} \end{figure*} Convolutional neural networks also mitigate the problem of long-term dependencies since large kernel sizes and deep networks such as ResNets~\cite{he2016deep} allow long-term dependencies to be learnt across distant parts of an image. However, this is a fundamentally different kind of architecture that has other tradeoffs. For example, the entire input (an image or sequence) and the intermediate activations of the model must be stored in memory during training. At inference time, typical CNNs also need $O(n)$ storage where $n$ is the size of the input.\footnote{A convolutional layer is often followed by a reduction layer to reduce the input size by a constant factor.} The Transformer~\cite{vaswani2017attention} has a similar issue, though somewhat magnified since computation for training and inference requires random access to storage that is $O(n)$. RNNs therefore have the advantage where assuming a fixed BPTT length of $l$, training requires $O(l)$ storage. This is commonly the case when training language models on the PTB dataset~\cite{penntreebank}, where the state is never reset over the entire 1 million token sequence. Therefore, in theory the RNN can learn relationships across this extremely long distance. Furthermore, inference in RNNs also requires $O(1)$ storage since RNNs do not need to `look back'. In this paper, we propose an orthogonal technique to further address the weakness of recurrent networks purely relying on BPTT. Our technique introduces an unsupervised auxiliary loss to the main supervised loss that reconstructs/predicts a random segment in the sequence before/after an anchor point. This enables learning with only need a few BPTT steps from the supervised loss. Our results show that unsupervised auxiliary losses significantly improve optimization and generalization of LSTMs. Moreover, using this technique, one does not have to perform lengthy BPTT during training to obtain good results. Our method, therefore, lends itself to very long sequences where vanishing/exploding gradients as well as the cost of lengthy BPTT become critical bottlenecks. In our experiments where sequences of up to 16\,000 elements is processed, LSTMs with auxiliary losses can train much faster and with less memory usage, while training LSTMs with full backprop becomes very difficult. \section{Related works} As learning long term dependencies with recurrent networks is an important problem in machine learning, many approaches have been proposed to tackle this challenge. Well known approaches include recurrent networks with special structures~\cite{el1996hierarchical,sperduti1997supervised,frasconi1998general,socher11,chan2016listen}, Long Short-Term Memory Networks~\cite{hochreiter1997long,gers1999learning,graves2013generating}, Gated Recurrent Unit Networks~\cite{cho2014learning,chung2014empirical}, multiplicative units~\cite{wu2016multiplicative}, specialized optimizers~\cite{martens2011learning,kingma2014adam}, identity initialization and connections~\cite{mikolov2014learning,le2015simple,he2016deep}, highway connections~\cite{zilly2016recurrent}, orthogonal- or unitary-constrained weights~\cite{white2004short,henaff2016recurrent,arjovsky2016unitary}, dilated convolutions~\citep{salimans2017pixelcnn++}, connections~\cite{koutnik2014clockwork} and attention mechanisms~\citep{bahdanau2014neural,luong2015effective,vaswani2017attention}. A more recent approach is to skip input information at certain steps~\cite{yu2017learning,seo2017neural,campos2017skip}. As training very long recurrent networks is memory-demanding, many techniques have also been proposed to tackle this problem~\cite{chen2016training,gruslys2016memory,Jaderberg16synthGrad}. We propose methods that are orthogonal to these approaches, and can be used in combination with them to improve RNNs. Our work is inspired by recent approaches in pretraining recurrent networks~\cite{dai2015semi,ramachandran2016unsupervised} with sequence autoencoders or language models. Their work, however, focuses on short sequences, and using pretraining to improve generalization of these short recurrent networks. In contrast, our work focuses on longer sequences, and studies the effects of auxiliary losses in learning long term dependencies. Combining auxiliary losses and truncated BPTT is also described in the context of online learning~\cite{schmidhuber1992learning}, where the main network learns to predict the concatenation of its next input token, the target vector, and distilled knowledge from an auxiliary network. The auxiliary network only predicts the sequence of tokens that is not predicted correctly by the main network. This shorter sequence is termed the {\it compressed history} and is argued to be suffice for good classification. In variational inference setting, \cite{goyal2017z} also propose reconstruction of the states from a backward running recurrent network as an auxiliary cost to help with training on long sequences. \section{Methodology} An overview of our methods is shown in Figure~\ref{fig:overview}. Let us suppose that the goal is to use a recurrent network to read a sequence and classify it. We propose to randomly sample one or multiple anchor positions, and insert an unsupervised auxiliary loss at each of them. \subsection{Reconstruction auxiliary loss} In reconstructing past events, we sample a subsequence before the anchor point, and insert the first token of the subsequence into a decoder network; we then ask the decoder network to predict the rest of the subsequence. The whole process is illustrated in Figure~\ref{fig:method}-left. Our intuition is that if the events to be predicted are close enough to the anchor point, the number of BPTT steps needed for the decoder to reconstruct past events can be quite small. Furthermore, with this training, the anchor points serve as a temporary memory for the recurrent network to remember past events in the sequence. If we choose enough anchor points, the memory is built over the sequence such that when we reach sequence end, the classifier remembers enough about the sequence and can do a good job at classifying it. Consequently, the classifier only needs a few backpropagation steps to fine-tune the LSTM's weights, since good embeddings of the input sequence has been learnt by optimizing the auxiliary objective. \subsection{Prediction auxiliary loss} Another auxiliary loss of consideration is analogous to Language Modelling loss, illustrated in Figure~\ref{fig:method}-right. In this case, we ask the decoder network to predict the next token given the current one sequentially, over a subsequence starting from the anchor point. This type of unsupervised auxiliary loss is first examined by ~\citet{dai2015semi}, where it is applied over the whole input sequence. In our experiments, however, we are interested in scalable schemes of learning long term dependencies, we therefore only apply this loss on a subsequence after the random anchor point. \subsection{Training} We name the former method {\it r}-LSTM{}, the later {\it p}-LSTM{} (which respectively stand for {\it reconstruct-} and {\it predict-}LSTM) and train them in two phases. The first is pure unsupervised pretraining where only the auxiliary loss is minimized. In the second phase, semi-supervised learning is performed where we minimize the sum of the main objective loss $L_{\textrm{supervised}}$ and our auxiliary loss $L_{\textrm{auxiliary}}$. The auxiliary LSTM that performs reconstruction is trained with Scheduled Sampling~\cite{bengio2015scheduled}. \subsection{Sampling frequency and subsequence length} By introducing the auxiliary losses over subsequences of the input, one introduces extra hyper-parameters. The first indicates how frequently one should sample the reconstruction segments, the others indicate how long each segment should be. Denoting the former \(n\), and the later \(\{l_i\}_{i=1}^n\), we obtain the auxiliary loss as follows:$ L_{\textrm{auxiliary}} = \frac{\sum_{i=1}^nL_i}{\sum_{i=1}^nl_i}$ Where $L_i$ denotes the loss evaluated on the $i^{th}$ sampled segment, and is calculated by summing losses on all predicted tokens ($\textrm{TokenLoss}_t$) in that segment: $L_{i} = \sum_{t=1}^{l_i}\textrm{TokenLoss}_t$ For sequences of characters, each $\textrm{TokenLoss}_t$ is the cross-entropy loss between the ground truth one-hot vector and the prediction produced by our decoder network. For other types of input, we treat each token as a continuous, multi-dimensional real vector and perform $L_2$ distance minimization. Tuning hyper-parameters is known to be very expensive, especially so when training RNNs on very long sequences. We therefore set all sampled segments to the same length: $l_i = l \ \forall i$, and sample at frequency $n=1$ in most experiments. Tuning these hyper-parameters is also explored in cases where sequence length is relatively short. In later experiments, we show that the tuned values generalize well to much longer input sequences. \section{Experiments} To evaluate the effectiveness of our models, we consider a wide variety of datasets with sequences of varying lengths from 784 to 16384. Our first benchmark is a {\it pixel-by-pixel image classification} task on MNIST in which pixels of each image are fed into a recurrent model sequentially before a prediction is made. This dataset was proposed by \citet{le2015simple} and has now become the most popular benchmark for testing long term dependency learning.\footnote{No symbol was added to indicate the end of each row of pixels.} Beside MNIST, we also explore pMNIST, a harder version, where each pixel sequence is permuted in the same way. Permuting pixels breaks apart all local structures and creates even more complex dependencies across various time scales. To test our methods on a larger dataset, we include pixel-by-pixel CIFAR10 (no permutation). Additionally, to perform control experiments with several scales of sequence lengths, we use the StanfordDogs dataset \citep{stanforddogs} which contains large images categorized to 120 dog breeds. All images are scaled down to 8 different sizes from 40$\times$40 to 128$\times$128 before being flattened into sequences of pixels without permutation. This setup results in sequences of lengths up to 16\,000, which is over 20 times longer than any previously used benchmark of this flavor. \begin{table}[] \caption{Datasets and average sequence length.} \label{image_statistics} \vskip 0.15in \begin{center} \begin{small} \small \begin{tabular}{lccc} \toprule Dataset & Mean length & \# classes & Train set size\\ \midrule MNIST & 784 & 10 & 60K\\ pMNIST & 784 & 10 & 60K\\ CIFAR10 & 1024 & 10 & 50K\\ StanfordDogs\footnotemark & 1600 -- 16384 & 120 & 150K\\ DBpedia & 300 & 14 & 560K\\ \bottomrule \end{tabular} \end{small} \end{center} \vskip -0.1in \end{table} \footnotetext{We follow the procedure suggested in \citet{SermanetFR14} to obtain a larger training set, while keeping the same test set. All images are scaled down to 8 different sizes from 40$\times$40 to 128$\times$128 before being flattened into sequences of pixels.} Lastly, we explore how well truncated BPTT and the auxiliary losses can perform on a real language task, where previous RNN variants have already reported remarkable accuracy. For this task, the DBpedia character level classification task is chosen as it is a large-scale dataset (with 560K training examples) and has been well benchmarked by~\citet{dai2015semi}. We follow the procedure suggested in ~\citet{zhang2015text} to normalize the dataset. A summary of all datasets being used is presented in Table~\ref{image_statistics}. \subsection{Model Setup} We use a single-layer LSTM with 128 cells and an embedding size of 128 to read the input sequence. For the supervised loss, the final state of the main LSTM is passed through a two-layer feedforward network (FFN) with 256 hidden units, before making a prediction. We apply drop-connect~\cite{wan2013regularization} with probability 0.5 on the second layer. For the auxiliary losses, we use a two-layer LSTM in which the bottom layer is initialized from the current state of the main classification LSTM, while the top one starts with zero state. When reconstructing image pixels, a two-layer FFN (256 units, drop-connect 0.5 on second layer) is applied on top of the auxiliary LSTM per timestep. Our RNNs are trained using the RMSProp optimizer~\cite{Tieleman2012} with batch size of 128. Unsupervised pretraining is done in 100 epochs with initial learning rate of 0.001, which is halved to 0.0005 halfway through pretraining. For the semi-supervised phase, the same learning rate is halved every 300 epochs until training reaches 1000 epochs. Scheduled sampling for auxiliary LSTMs is annealed linearly to zero after 100\,000 training steps. As we scale our methods to various input lengths, we make sure that backpropagation cost is constant regardless of the input length. Specifically, gradients are truncated to 300 time steps for both the supervised and auxiliary losses.\footnote{All models are implemented in TensorFlow~\cite{tensorflow2015-whitepaper}. Truncated gradients are achieved using the built-in \texttt{tf.stop\_gradient} op.} For the auxiliary losses, we choose the simplest setup of sampling $n{=}1$ segment of length $l{=}600$ per training example. In Section~\ref{sec:sample_frequency}, we will explore different values for $n$ and $l$. As a complement to results from purely recurrent models, in Section~\ref{sec:transformer}, we will also compare our models with Transformer \cite{vaswani2017attention}. Transformer is a completely different paradigm of processing sequences that sidesteps the difficulties of BPTT through the use of self-attention. Such advantage is achieved at the cost of $O(n)$ working memory during both training and inference compared to $O(1)$ for RNNs. Even though our main interest is to improve over recurrent models, we include these results to study how scalable the self-attention mechanism is. We use Tensor2Tensor\footnote{\url{https://github.com/tensorflow/tensor2tensor}} to train Transformer models with an off-the-shelf configuration that has a comparable number of parameters as our RNNs (0.5M weights)\footnote{\texttt{transformer\_tiny}.}. A simple setting for classification is adopted where the Transformer output vectors is average-pooled and fed into a two-layer FFN before making predictions, as done in our RNNs. \subsection{Main results} \subsubsection{MNIST, pMNIST, and CIFAR10} We first explore sequences of length no longer than 1000 on MNIST, pMNIST and CIFAR10. Besides results from previous works on pixel MNIST and permuted MNIST (pMNIST) such as \citet{le2015simple,arjovsky2016unitary}, we evaluated a fully trained LSTM and an LSTM trained with only 300 steps of BPTT as the main baselines to see how much disadvantage truncating classification gradients might cause. At this stage, it is also affordable to include test accuracies from both truncated and fully-trained {\it r}-LSTM{} and {\it p}-LSTM{} for a more complete result. \begin{table}[htb] \caption{Test accuracy (\%) on MNIST, pMNIST, and CIFAR10.} \label{mnist_cifar} \vskip 0.15in \begin{center} \resizebox{8cm}{!}{ \begin{tabular}{lccc} \toprule & MNIST & pMNIST & CIFAR10 \\ \midrule iRNN \cite{le2015simple} & 97.0 & 82.0 & N/A \\ uRNN \cite{arjovsky2016unitary} & 95.1 & 91.4 & N/A \\ LSTM Full BP & 98.3 & 89.4 & 58.8 \\ LSTM Truncate300 & 11.3 & 88.8 & 49.0 \\ \midrule {\it r}-LSTM{} Truncate300 & 96.4 & 92.8 & 65.9 \\ {\it p}-LSTM{} Truncate300 & 95.4 & 92.5 & 64.7 \\ \textbf{{\it r}-LSTM{} Full BP} & \textbf{98.4} & \textbf{95.2} & \textbf{72.2} \\ {\it p}-LSTM{} Full BP & 98.0 & 92.8 & 67.6 \\ \bottomrule \end{tabular} } \end{center} \vskip -0.1in \end{table} An overview of Table~\ref{mnist_cifar} shows that our proposed auxiliary losses produce gradually larger improvements moving from MNIST to pMNIST and CIFAR10. On pixel-by-pixel MNIST, our truncated LSTM baseline is nearly untrainable, with only 11.3\% accuracy. This is due to the fact that gradients back-propagated from the loss can only reach largely non-informative solid pixels near the end of the sequence. Despite this detrimental effect of gradient truncation, the proposed unsupervised losses bring {\it r}-LSTM{} and {\it p}-LSTM{} on par with fully trained RNNs like uRNN and LSTM. On permuted pMNIST where more complex long-range dependencies is put to the test, {\it r}-LSTM{} and {\it p}-LSTM{} easily outperform the fully trained LSTM baselines as well as a fully trained uRNN, while using less than half the number of gradients from the classification loss. On CIFAR10, we observe an even greater discrepancy, where {\it r}-LSTM{} is followed closely by {\it p}-LSTM{} in accuracy, while a fully trained LSTM is more than 7\% lower in absolute accuracy. With fully backpropagated gradients from classification loss, we obtain the best accuracy across all datasets against other recurrent models. Notably on the two harder benchmarks pMNSIT and CIFAR10, {\it r}-LSTM{} outperforms a fully-trained LSTM by a large margin. \subsubsection{StanfordDogs} \begin{figure}[tb] \includegraphics[width=1\columnwidth, clip=true, trim= 10 40 60 80]{growing_lengths.eps} \caption{Top: Test accuracy on StanfordDogs resized to 8 levels of sequence length. Bottom: Time to run a single mini batch of 128 training examples, measured in second.} \label{fig:growing_lengths} \end{figure} So far, our experiments give hints that {\it r}-LSTM{} and {\it p}-LSTM{} scale better in performance when input sequences get longer and more complex. Next, we present how this trend elaborates when input sequences extend up to an order of magniwtude higher -- over 10\,000 steps. As presented earlier, we use the dataset StanfordDogs resized down to 8 levels of sequence lengths and test the models on all levels. As this range, training is expensive in terms of time and computational resources, especially so with LSTMs where parallelization over the time dimension is not possible. We therefore restrict each training session to the same amount of resource (a single Tesla P100 GPU) and report infeasible whenever a mini-batch of one training example can no longer fit into memory. In Figure~\ref{fig:growing_lengths}-top, we report test accuracy from a fully backpropagated LSTM baseline, {\it r}-LSTM{}, and {\it p}-LSTM{} on all levels. Since StanfordDogs is an even more challenging classification problem compared to CIFAR10, pursuing useful accuracy with non-convolutional models is not our main goal. We instead examine the relative robustness of different methods when input sequences get longer. All models are evaluated after 100 epochs of training, with an additional 20 epochs of pretraining for models with auxiliary loss. Using the unsupervised auxiliary losses, we are able to obtain much better results compared to other methods. Figure~\ref{fig:growing_lengths}-top shows that both {\it r}-LSTM{} and {\it p}-LSTM{} exhibit the strongest resistance to the growing difficulty, while an LSTM trained with full backpropagation is slow to improve and produces no better than random predictions when the input sequence length reaches the 9\,000 mark. After the 12\,000 mark, memory constraint is exceeded for this model. At the same time, there is virtually no accuracy loss in {\it r}-LSTM{} going from 12\,000 to 16\,000 element long sequences. The gradient truncation in {\it r}-LSTM{} and {\it p}-LSTM{} also offers a much greater computational advantage as sequence length gets arbitrarily large. Figure~\ref{fig:growing_lengths}-bottom illustrates the time to finish one training step for each recurrent model. LSTM takes 4 seconds at the 1600 mark and quickly stretches out to 26 seconds at the 12\,000 mark. With the same computational resource, our proposed methods stay under 3 seconds and grow up to only around 8 seconds at the end, processing a batch of sequences with lengths more than 16\,000. \subsection{Comparing with Transformer} \label{sec:transformer} In this set of experiments, we explore how well our proposed recurrent models fare with those that utilize a self-attention mechanism. As noted in the introduction, these models require random access to the entire sequence at inference time, so are very quick to become infeasible as sequences get longer (such as the PTB LM dataset). \subsubsection{MNIST, pMNIST, and CIFAR10} On MNIST and pMNIST, Transformer outperforms our best model as shown in Table~\ref{transformer_mnist_cifar}. On CIFAR10, however, Transformer performance drops significantly - worse than most recurrent models on this dataset. \begin{table}[htb] \caption{Test accuracy (\%) on MNIST, pMNIST and CIFAR10.} \label{transformer_mnist_cifar} \vskip 0.15in \begin{center} \begin{small} \begin{tabular}{lccc} \toprule & MNIST & pMNIST & CIFAR10 \\ \midrule {\it r}-LSTM{} Full BP & 98.4 & 95.2 & 72.2 \\ Transformer & 98.9 & 97.9 & 62.2 \\ \bottomrule \end{tabular} \end{small} \end{center} \vskip -0.1in \end{table} We additionally evaluate results from T-DMCA~\cite{liu18}, though strictly speaking, this is an unfair comparison since the T-DMCA adds convolutions at each self-attention layer. Compared to the Transformer, T-DMCA is more memory efficient as it utilizes local-attention and memory-compressed attention.\footnote{In our experiments, Transformer-DMCA consists of 5 alternating layers of unmasked local attention and memory compressed attention, with all hidden sizes and filter sizes set to 128.} Results indicate that T-DMCA performs better than Transformer on MNIST (99.3\%) and CIFAR10 (73.0\%). On pMNIST where there is no spatial locality to be exploited by convolution, T-DMCA achieves 97.6\% accuracy, slightly worse than that of Transformer. \subsubsection{StanfordDogs} Similar to the previous section, we transfer the same hyper-parameter settings of Transformer to much longer sequences, created using StanfordDogs dataset. As shown in Figure~\ref{fig:growing_lengths}, Transformer starts with almost twice the accuracy of {\it r}-LSTM{} or {\it p}-LSTM{}, but this performance quickly degrades at a much higher rate as input sequences get longer. Specifically, Transformer performs worse than our methods after the 3000 mark and end up only slightly better than random prediction around the 9200 mark. Its training using the same resource also becomes infeasible after this point. Note that our proposed method is orthogonal to most models that process sequences. Incorporating our technique to any scalable Transformer variant will therefore likely result in significant improvements. Our current work, however, focuses on improving recurrent networks and therefore leaves this option for future exploration. \subsection{Classifying DBpedia documents at character level} We explore how well truncated BPTT and the auxiliary losses can do on sequences of discrete data (text), where previous methods already reported remarkable accuracy. For this task, the DBpedia dataset is chosen as it provides a large and carefully curated set of clean Wikipedia texts and no duplication. In our experiments, each document in the dataset is processed at character level~\cite{zhang2015text}. This makes the average sequence length 300, with 99\% of the training examples are under 600 elements long. \begin{table}[htb] \caption{Test error rate (\%) on character-by-character DBpedia.} \label{tab:dbpedia_truncate} \vskip 0.15in \begin{center} \begin{small} \begin{tabular}{lc} \toprule & Test error \\ \midrule LM-LSTM Truncate100 & 4.04 \\ SA-LSTM Truncate100 & 3.89 \\ \midrule {\it r}-LSTM{} 20x15 Truncate100 & 3.84 \\ \textbf{{\it p}-LSTM{} Truncate100} & \textbf{2.85} \\ \bottomrule \end{tabular} \end{small} \end{center} \vskip -0.1in \end{table} To explore how well auxiliary losses can help with limited backpropagation, supervised gradients are truncated to only 100 time steps, while anchored subsequences are sampled with length $l=300$. Similar to ~\citet{dai2015semi}, we did not perform joint-training since it slightly degrades performance on this large dataset, all other hyper-parameters are reused. We also test {\it r}-LSTM{} with the 20-sample setting, a full BPTT trained LSTM baseline and truncated LM-LSTM and SA-LSTM ~\cite{dai2015semi} baselines. As can be seen in Table~\ref{tab:dbpedia_truncate}, auxiliary losses with truncated BPTT can significantly outperform the LSTM baseline by more than 10\% absolute accuracy. Our methods also have better results than truncated LM-LSTM and SA-LSTM. We conjecture that this comes from the combination of more randomness and truncation in our training process. \begin{table}[htb] \caption{Test error rate (\%) on character-by-character DBpedia.} \label{tab:dbpedia} \vskip 0.15in \begin{center} \begin{small} \begin{tabular}{lc} \toprule & Test error \\ \midrule LSTM Full Backprop~\cite{dai2015semi} & 13.64 \\ char-CNN~\cite{zhang2015text} & 1.66 \\ CNN+RNN~\cite{xiaocrnn16} & 1.43 \\ 29-layer CNN~\cite{ConneauVDCNN16} & 1.29 \\ LM-LSTM~\cite{dai2015semi} & 1.50 \\ SA-LSTM~\cite{dai2015semi} & 2.34 \\ \midrule {\it r}-LSTM{} n=20, l=15, 2 layers 512 units & 1.40 \\ \bottomrule \end{tabular} \end{small} \end{center} \vskip -0.1in \end{table} When trained without restriction of model size and gradient truncation, {\it p}-LSTM{} performs on par with other strong baselines that operate on character-level (Table~\ref{tab:dbpedia}). Specifically, {\it r}-LSTM{} with $n=20$ and $l=15$ significantly outperforms a full auto-encoder in SA-LSTM, ranking only behind Very-deep CNN with 29 layers. \section{Analysis} \subsection{Shrinking supervised BPTT length} Given the clear trend demonstrated in previous sections, it is natural to ask the question of how much longer the input has to grow before {\it r}-LSTM{} and {\it p}-LSTM{} becomes untrainable. To simulate this effect without growing sequence length indefinitely, we instead keep the input sequence length fixed, while truncating backpropagation incrementally. We perform experiments on CIFAR10 and start shrinking the BPTT length from 300 down to 1 - where gradients from the classification loss have minimal impact on the main LSTM. Results in Figure~\ref{fig:shrinking_bp} shows that {\it r}-LSTM{} and {\it p}-LSTM{} can afford a reduction of another 200 BPTT steps, while still being able to generalize better than a fully trained LSTM. Moreover, by applying gradients on only 50 steps -- less than 5\% of the total input steps, {\it r}-LSTM{} and {\it p}-LSTM{}'s accuracy can still approximate their fully trained counterpart. At the extreme point of one-step backpropagation, both {\it r}-LSTM{} (46.1\%) and {\it p}-LSTM{} (47.0\%) perform commendably well. \begin{figure}[htb] \includegraphics[width=0.9\columnwidth, clip=true, trim= 0 5 0 0]{shrinking_bp.eps} \caption{Effects of shrinking supervised BPTT length.} \label{fig:shrinking_bp} \end{figure} Going one step further, we prevent classification gradients from updating the main LSTM, thereby training it completely unsupervised. By doing so, we attempt to address the question of why the human brain can understand long sequences of events, even though BPTT is argued biologically implausible~\cite{Bengio15bioPlausibleML}. Results from Figure~\ref{fig:shrinking_bp} indicate that both {\it r}-LSTM{} (37.7\%) and {\it p}-LSTM{} (34.9\%) can still classify unseen data with far-from-random accuracy. \subsection{Multiple reconstructions with fixed BPTT cost} \label{sec:sample_frequency} So far, we only adopt the simplest setting of $n=1$ reconstruction sample per sequence. One can also tune this hyper-parameter for even better results. We explore this option to improve one and zero step supervised BPTT. To keep the total cost of backpropagation approximately the same with previous experiments, we gradually increase $n$ and shrink each subsequence length $l$ proportionately. We also set the unsupervised BPTT truncation to be $l$. In Table~\ref{tab:sample_rate}, we report results obtained with five different sampling frequencies, ranging from 10 to 200 samples. \begin{table}[htb] \caption{Classification test accuracy (\%) on CIFAR10 with varying sample frequency and fixed backpropagation cost.} \label{tab:sample_rate} \vskip 0.15in \begin{center} \begin{small} \begin{tabular}{cccc} \toprule & & \multicolumn{2}{c}{Supervised BPTT length} \\ \cmidrule(lr){3-4} $n$ & $l$ & 1 & 0 \\ \midrule 1 & 600 & 46.0 & 37.4 \\ 10 & 60 & 46.0 & 40.6 \\ \textbf{20} & \textbf{30} & \textbf{48.0} & \textbf{41.6} \\ 50 & 12 & 47.7 & 41.0 \\ 100 & 6 & 47.2 & 40.1 \\ 200 & 3 & 46.2 & 37.9 \\ \bottomrule \end{tabular} \end{small} \end{center} \vskip -0.1in \end{table} We indeed observed accuracy gain on the test set across almost all frequencies of sampling. Interestingly, there is a peak at 20 samples per sequence and the accuracy gain starts decaying from this point in both directions. In other words, it is harmful to sample too little, or sample too many at the cost of very little backpropagation. Comparing these two extremes, we observe slightly better accuracy with many small reconstructions than one big reconstruction. At sampling frequency 20, for single time step backpropagation, we obtain an increase of 2.0\%. For completely unsupervised training (no backpropagation on the main LSTM), there is a remarkable increase of 4.0\%. This increase implies that {\it r}-LSTM{} has great potential to improve on long sequences, with relatively few supervised gradients, as long as one is able to afford tuning extra hyper-parameters. We explore this potential on StanfordDogs by retraining {\it r}-LSTM{} with sampling frequency 20 ({\it r}-LSTM{} 20$\times$30) on all 8 levels. As shown in Figure~\ref{fig:growing_lengths}-top, this best performing setting found on CIFAR10 generalizes to all difficulty levels of StanfordDogs. Namely, {\it r}-LSTM{} 20$\times$30 closes the gap with Transformer on shorter sequences, and stays at this top position throughout, outperforming all other recurrent models as well as Transformer by a large margin starting from the 3000 mark . Furthermore, by independently sampling several segments of equal length, one can batch them to utilize data parallelism and subsequently speed up the training process even more. This is illustrated in Figure~\ref{fig:growing_lengths}-bottom, where single-batch training time of {\it r}-LSTM{} 20$\times$30 consistently stays lower than that of any other recurrent method. \subsection{Regularization and Optimization Advantages from Unsupervised Losses} \label{sec:reg_or_opt} With a significant gap between {\it r}-LSTM{}/{\it p}-LSTM{} and a fully-trained LSTM on almost all benchmarks, we ask whether it is regularization or optimization advantage that is added by truncated BPTT and our auxiliary losses. At any point during training, we identify optimization advantage when training accuracy with auxiliary losses are much better than that of the baseline, while the corresponding improvement on test set is not as significant. On the other hand, if our models generalize better while being harder or insignificantly easier to train, the improvement comes from regularization. \begin{figure}[htb] \includegraphics[width=0.8\columnwidth, clip=true, trim= 0 10 0 0]{testing_curves.eps} \caption{Effects of auxiliary losses on training/testing accuracy.} \label{fig:testing_curves} \end{figure} Figure~\ref{fig:testing_curves} shows the training/testing accuracy of {\it r}-LSTM{}, {\it p}-LSTM{} and an LSTM during training. {\it r}-LSTM{} and {\it p}-LSTM{} training curves trace each other almost identically throughout, while {\it r}-LSTM{} gives better result on testing data. This implies that {\it r}-LSTM{} regularizes better than {\it p}-LSTM{}. Comparing to the LSTM baseline, {\it r}-LSTM{} and {\it p}-LSTM{} start off with much higher training accuracy while having the same testing accuracy (10\%). This reveals the significant improvement from unsupervised pretraining for both {\it r}-LSTM{} and {\it p}-LSTM{}'s optimization. Gradually throughout the training process, this optimization gap with the baseline becomes smaller, while the corresponding difference in test accuracy becomes relatively bigger. We therefore conclude that both types of pretraining bring optimization advantages at early stages of training. Later on, minimizing the semi-supervised loss creates a regularization effect that quickly takes over until the end. \subsection{Ablation Study} In this section, we evaluate the relative contribution of different factors to {\it r}-LSTM{}'s performance. Here we test each factor by turning it off and retraining the model from scratch on CIFAR10, using the same random seed. Firstly, as reported in Table~\ref{mnist_cifar}, eliminating the auxiliary loss and leaving the main LSTM with a truncation of 300 BPTT steps cause a loss of nearly 17\% in test accuracy. With the auxiliary loss in effect, Figure~\ref{fig:ablation} shows the results when turning off other parts from the original full setting. \begin{figure}[htb] \includegraphics[width=\columnwidth, clip=true, trim= 0 10 0 10]{ablation.eps} \caption{Ablation analysis of {\it r}-LSTM{} performance.} \label{fig:ablation} \end{figure} \textbf{Jointly training unsupervised and supervised loss is most important}, with a corresponding loss of more than 3.6\% reported. As long as joint training is in effect, pretraining is slightly less important than applying Scheduled Sampling for the auxiliary LSTMs. \textbf{More randomness is better}. Instead of only reconstructing the immediate past, allowing reconstruction segments to be randomly sampled in distant past gives almost a 2\% accuracy gain. Allowing a part of the sampled segment to spread over to the anchor point's future also gives a boost. Other improvements come from embedding input pixels to the same dimensionality as the LSTM's hidden size, reversing the order of reconstruction and stacking a second layer on the LSTM that receives outputs from the anchor point. \section{Conclusion} In this paper, we have presented a simple approach to improve the learning of long-term dependencies in RNNs. An auxiliary loss was added to the main supervised loss to offer two main benefits. First, it induces a regularization effect, allowing our models to generalize well to very long sequences, up to length 16\,000. Second, it provides computational advantages as the input sequence gets very long, so that one only needs to backpropagate for a small number of time steps to obtain competitive performance. In the extreme cases where there is little to no backpropagation, our models perform far better than random predictions. On a comprehensive set of benchmarks, ranging from pixel-by-pixel image classification (MNIST, pMNIST, CIFAR10, StanfordDogs) to character-level document classification (DBpedia), our models have demonstrated competitive performance over strong recurrent baselines (iRNN, uRNN, LM-LSTM, SA-LSTM) and non-recurrent ones such as Transformer, CRNN, VDCNN. For long sequences, our results are superior despite using much fewer resources. We anticipate that this simple technique will be widely applicable to online learning systems or ones that process unusually long sequences.
{'timestamp': '2018-06-14T02:07:03', 'yymm': '1803', 'arxiv_id': '1803.00144', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00144'}
arxiv
\section{Conclusion} \label{sec:conclude} In this paper, we propose a technique named \textit{Hierarchical Sentence Factorization} that is able to transform a sentence into a hierarchical factorization tree. Each node in the tree is a semantic unit consists of one or several words in the sentence and reorganized into the form of ``predicate-argument'' structure. Each depth in the tree factorizes the sentence into semantic units of different scales. Based on the hierarchical tree-structured representation of sentences, we propose both an unsupervised metric and two supervised deep models for sentence matching tasks. On one hand, we design a new unsupervised distance metric, named \textit{Ordered Word Mover's Distance} (OWMD), to measure the semantic difference between a pair of text snippets. OWMD takes the sequential structure of sentences into account, and is able to handle the flexible syntactical structure of natural language sentences. On the other hand, we propose the multi-scale Siamese neural network architecture which takes the multi-scale representation of a pair of sentences as network input and matches the two sentences at different granularities. We apply our techniques to the task of text-pair similarity estimation and the task of text-pair paraphrase identification, based on multiple datasets. Our extensive experiments show that both the unsupervised distance metric and the supervised multi-scale Siamese network architecture can achieve significant improvement on multiple datasets using the technique of sentence factorization. \section{Evaluation} \label{sec:eval} In this section, we evaluate the performance of our unsupervised Ordered Word Mover's Distance metric and supervised Multi-scale Sentence Matching model with factorized sentences as input. We apply our algorithms to semantic textual similarity estimation tasks and sentence pair paraphrase identification tasks, based on four datasets: STSbenchmark, SICK, MSRP and MSRvid. \subsection{Experimental Setup} \label{subsec:setup} \begin{table}[tb] \caption{Description of evaluation datasets.} \label{tab:datasets} \begin{tabular}{lllll} \toprule Dataset & Task & Train & Dev & Test\\ \midrule STSbenchmark & Similarity scoring & $5748$ & $1500$ & $1378$ \\ SICK & Similarity scoring & $4500$ & $500$ & $4927$ \\ MSRP & Paraphrase identification & $4076$ & - & $1725$ \\ MSRvid & Similarity scoring & $750$ & - & $750$ \\ \bottomrule \end{tabular} \vspace{-2mm} \end{table} We will start with a brief description for each dataset: \begin{itemize} \item \textbf{STSbenchmark}\cite{cer2017semeval}: it is a dataset for semantic textual similarity (STS) estimation. The task is to assign a similarity score to each sentence pair on a scale of 0.0 to 5.0, with 5.0 being the most similar. \item \textbf{SICK}\cite{marelli2014sick}: it is another STS dataset from the SemEval 2014 task 1. It has the same scoring mechanism as STSbenchmark, where 0.0 represents the least amount of relatedness and 5.0 represents the most. \item \textbf{MSRvid}: the Microsoft Research Video Description Corpus contains 1500 sentences that are concise summaries on the content of a short video. Each pair of sentences is also assigned a semantic similarity score between 0.0 and 5.0. \item \textbf{MSRP}\cite{quirk2004monolingual}: the Microsoft Research Paraphrase Corpus is a set of 5800 sentence pairs collected from news articles on the Internet. Each sentence pair is labeled 0 or 1, with 1 indicating that the two sentences are paraphrases of each other. \end{itemize} Table \ref{tab:datasets} shows a detailed breakdown of the datasets used in evaluation. For STSbenchmark dataset we use the provided train/dev/test split. The SICK dataset does not provide development set out of the box, so we extracted 500 instances from the training set as the development set. For MSRP and MSRvid, since their sizes are relatively small to begin with, we did not create any development set for them. One metric we used to evaluate the performance of our proposed models on the task of semantic textual similarity estimation is the Pearson Correlation coefficient, commonly denoted by $r$. Pearson Correlation is defined as: \begin{equation} \label{eq:pearson} r = cov(X,Y) /( \sigma_X \sigma_Y), \end{equation} where $cov(X,Y)$ is the co-variance between distributions X and Y, and $\sigma_X$, $\sigma_Y$ are the standard deviations of X and Y. The Pearson Correlation coefficient can be thought as a measure of how well two distributions fit on a straight line. Its value has range [-1, 1], where a value of 1 indicates that data points from two distribution lie on the same line with a positive slope. Another metric we utilized is the Spearman's Rank Correlation coefficient. Commonly denoted by $r_s$, the Spearman's Rank Correlation coefficient shares a similar mathematical expression with the Pearson Correlation coefficient, but it is applied to ranked variables. Formally it is defined as \cite{wiki:spearman}: \begin{equation} \label{eq:spearman} \rho = cov(rg_X, rg_Y) / (\sigma_{rg_X} \sigma_{rg_Y}), \end{equation} where $rg_X$, $rg_Y$ denotes the ranked variables derived from $X$ and $Y$. $cov(rg_X,rg_Y)$, $\sigma_{rg_X}$, $\sigma_{rg_Y}$ corresponds to the co-variance and standard deviations of the rank variables. The term ranked simply means that each instance in X is ranked higher or lower against every other instances in X and the same for Y. We then compare the rank values of X and Y with \ref{eq:spearman}. Like the Pearson Correlation coefficient, the Spearman's Rank Correlation coefficient has an output range of [-1, 1], and it measures the monotonic relationship between X and Y. A Spearman's Rank Correlation value of 1 implies that as X increases, Y is guaranteed to increase as well. The Spearman's Rank Correlation is also less sensitive to noise created by outliers compared to the Pearson Correlation. For the task of paraphrase identification, the classification accuracy of label $1$ and the F1 score are used as metrics. In the supervised learning portion, we conduct the experiments on the aforementioned four datasets. We use training sets to train the models, development set to tune the hyper-parameters and each test set is only used once in the final evaluation. For datasets without any development set, we will use cross-validation in the training process to prevent overfitting, that is, use $10\%$ of the training data for validation and the rest is used in training. For each model, we carry out training for 10 epochs. We then choose the model with the best validation performance to be evaluated on the test set. \subsection{Unsupervised Matching with OWMD} \label{subsec:eval-owmd} To evaluate the effectiveness of our Ordered Word Mover's Distance metric, we first take an unsupervised approach towards the similarity estimation task on the STSbenchmark, SICK and MSRvid datasets. Using the distance metrics listed in Table \ref{tab:compare-pearson} and \ref{tab:compare-spearman}, we first computed the distance between two sentences, then calculated the Pearson Correlation coefficients and the Spearman's Rank Correlation coefficients between all pair's distances and their labeled scores. We did not use the MSRP dataset since it is a binary classification problem. In our proposed Ordered Word Mover's Distance metric, distance between two sentences is calculated using the order preserving Word Mover's Distance algorithm. For all three datasets, we performed hyper-parameter tuning using the training set and calculated the Pearson Correlation coefficients on the test and development set. We found that for the STSbenchmark dataset, setting $\lambda_1=10$, $\lambda_2=0.03$ produces the most optimal result. For the SICK dataset, a combination of $\lambda_1=3.5$, $\lambda_2=0.015$ works best. And for the MSRvid dataset, the highest Pearson Correlation is attained when $\lambda_1=0.01$, $\lambda_2=0.02$. We maintain a max iteration of 20 since in our experiments we found that it is sufficient for the correlation result to converge. During hyper-parameter tuning we discovered that using the Euclidean metric along with $\sigma=10$ produces better results, so all OWMD results summarized in Table \ref{tab:compare-pearson} and \ref{tab:compare-spearman} are acquired under these parameter settings. Finally, it is worth mentioning that our OWMD metric calculates the distances using factorized versions of sentences, while all other metrics use the original sentences. Sentence factorization is a necessary preprocessing step for the OWMD metric. We compared the performance of Ordered Word Mover's Distance metric with the following methods: \begin{itemize} \item \textbf{Bag-of-Words (BoW)}: in the Bag-of-Words metric, distance between two sentences is computed as the cosine similarity between the word counts of the sentences. \item \textbf{LexVec}~\cite{salle2016enhancing}: calculate the cosine similarity between the averaged 300-dimensional LexVec word embedding of the two sentences. \item \textbf{GloVe}~\cite{pennington2014glove}: calculate the cosine similarity between the averaged 300-dimensional GloVe 6B word embedding of the two sentences. \item \textbf{Fastext}~\cite{joulin2016bag}: calculate the cosine similarity between the averaged 300-dimensional Fastext word embedding of the two sentences. \item \textbf{Word2vec}~\cite{mikolov2013efficient}: calculate the cosine similarity between the averaged 300-dimensional Word2vec word embedding of the two sentences. \item \textbf{Word Mover's Distance (WMD)}~\cite{kusner2015word}: estimating the semantic distance between two sentences by WMD introduced in Sec.~\ref{sec:owmd}. \end{itemize} \begin{table}[tb] \caption{Pearson Correlation results on different distance metrics.} \label{tab:compare-pearson} \begin{tabular}{c|cc|cc|c} \toprule \multirow{2}{*}{Algorithm} & \multicolumn{2}{c}{STSbenchmark} & \multicolumn{2}{c}{SICK} & MSRvid\\ & Test & Dev & Test & Dev & Test\\ \midrule BoW & $0.5705$ & $0.6561$ & $0.6114$ & $0.6087$ & $0.5044$ \\ LexVec & $0.5759$ & $0.6852$ & $0.6948$ & $\mathbf{0.6811}$ & $0.7318$\\ GloVe & $0.4064$ & $0.5207$ & $0.6297$ & $0.5892$ & $0.5481$ \\ Fastext & $0.5079$ & $0.6247$ & $0.6517$ & $0.6421$ & $0.5517$ \\ Word2vec & $0.5550$ & $0.6911$ & $\mathbf{0.7021}$ & $0.6730$ & $0.7209$ \\ WMD & $0.4241$ & $0.5679$ & $0.5962$ & $0.5953$ & $0.3430$ \\ OWMD & $\mathbf{0.6144}$ & $\mathbf{0.7240}$ & $0.6797$ & $0.6772$ & $\mathbf{0.7519}$ \\ \bottomrule \end{tabular} \vspace{-4mm} \end{table} \begin{table}[tb] \caption{Spearman's Rank Correlation results on different distance metrics.} \label{tab:compare-spearman} \begin{tabular}{c|cc|cc|c} \toprule \multirow{2}{*}{Algorithm} & \multicolumn{2}{c}{STSbenchmark} & \multicolumn{2}{c}{SICK} & MSRvid\\ & Test & Dev & Test & Dev & Test\\ \midrule BoW & $0.5592$ & $0.6572$ & $0.5727$ & $0.5894$ & $0.5233$ \\ LexVec & $0.5472$ & $0.7032$ & $0.5872$ & $0.5879$ & $0.7311$\\ GloVe & $0.4268$ & $0.5862$ & $0.5505$ & $0.5490$ & $0.5828$ \\ Fastext & $0.4874$ & $0.6424$ & $0.5739$ & $0.5941$ & $0.5634$ \\ Word2vec & $0.5184$ & $0.7021$ & $0.6082$ & $0.6056$ & $0.7175$ \\ WMD & $0.4270$ & $0.5781$ & $0.5488$ & $0.5612$ & $0.3699$ \\ OWMD & $\mathbf{0.5855}$ & $\mathbf{0.7253}$ & $\mathbf{0.6133}$ & $\mathbf{0.6188}$ & $\mathbf{0.7543}$ \\ \bottomrule \end{tabular} \vspace{-2mm} \end{table} Table \ref{tab:compare-pearson} and Table \ref{tab:compare-spearman} compare the performance of different metrics in terms of the Pearson Correlation coefficients and the Spearman's Rank Correlation coefficients. We can see that the result of our OWMD metric achieves the best performance on all the datasets in terms of the Spearman's Rank Correlation coefficients. It also produced the best Pearson Correlation results on the STSbenchmark and the MSRvid dataset, while the performance on SICK datasets are close to the best. This can be attributed to the two characteristics of OWMD. First, the input sentence is re-organized into a predicate-argument structure using the sentence factorization tree. Therefore, corresponding semantic units in the two sentences will be aligned roughly in order. Second, our OWMD metric takes word positions into consideration and penalizes disordered matches. Therefore, it will produce less mismatches compared with the WMD metric. \subsection{Supervised Multi-scale Semantic Matching} \label{subsec:eval-multilayer} \begin{table*}[tb] \caption{A comparison among different supervised learning models in terms of accuracy, F1 score, Pearson's $r$ and Spearman's $\rho$ on various test sets.} \label{tab:sts} \begin{tabular}{c|cc|cc|cc|cc} \toprule \multirow{2}{*}{Model} & \multicolumn{2}{c}{MSRP} & \multicolumn{2}{c}{SICK} & \multicolumn{2}{c}{MSRvid} & \multicolumn{2}{c}{STSbenchmark}\\ & Acc.(\%) & F1(\%) & $r$ & $\rho$ & $r$ & $\rho$ & $r$ & $\rho$ \\ \midrule MaLSTM & $66.95$ & $73.95$ & $0.7824$ & $0.71843$ & $0.7325$ & $0.7193$ & $0.5739$ & $0.5558$\\ Multi-scale MaLSTM & $\mathbf{74.09}$ & $\mathbf{82.18}$ & $\mathbf{0.8168}$ & $\mathbf{0.74226}$ & $\mathbf{0.8236}$ & $\mathbf{0.8188}$ & $\mathbf{0.6839}$ & $\mathbf{0.6575}$\\ \midrule HCTI & $73.80$ & $80.85$ & $0.8408$ & $0.7698$ & $\mathbf{0.8848}$ & $\mathbf{0.8763}$ & $\mathbf{0.7697}$ & $\mathbf{0.7549}$ \\ Multi-scale HCTI & $\mathbf{74.03}$ & $\mathbf{81.76}$ & $\mathbf{0.8437}$ & $\mathbf{0.7729}$ & $0.8763$ & $0.8686$ & $0.7269$ & $0.7033$ \\ \bottomrule \end{tabular} \vspace{-2mm} \end{table*} The use of sentence factorization can improve both existing unsupervised metrics and existing supervised models. To evaluate how the performance of existing Siamese neural networks can be improved by our sentence factorization technique and the multi-scale Siamese architecture, we implemented two types of Siamese sentence matching models, HCTI \cite{mueller2016siamese} and MaLSTM \cite{shao2017hcti}. HCTI is a Convolutional Neural Network (CNN) based Siamese model, which achieves the best Pearson Correlation coefficient on STSbenchmark dataset in SemEval2017 competition (compared with all the other neural network models). MaLSTM is a Siamese adaptation of the Long Short-Term Memory (LSTM) network for learning sentence similarity. As the source code of HCTI is not released in public, we implemented it according to \cite{shao2017hcti} by Keras \cite{chollet2015keras}. With the same parameter settings listed in paper \cite{shao2017hcti} and tried our best to optimize the model, we got a Pearson correlation of 0.7697 (0.7833 in paper \cite{shao2017hcti}) in STSbencmark test dataset. We extended HCTI and MaLSTM to our proposed Siamese architecture in Fig. \ref{fig:network}, namely the Multi-scale MaLSTM and the Multi-scale HCTI. To evaluate the performance of our models, the experiment is conducted on two tasks: 1) semantic textual similarity estimation based on the STSbenchmark, MSRvid, and SICK2014 datasets; 2) paraphrase identification based on the MSRP dataset. Table \ref{tab:sts} shows the results of HCTI, MaLSTM and our multi-scale models on different datasets. Compared with the original models, our models with multi-scale semantic units of the input sentences as network inputs significantly improved the performance on most datasets. Furthermore, the improvements on different tasks and datasets also proved the general applicability of our proposed architecture. Compared with MaLSTM, our multi-scaled Siamese models with factorized sentences as input perform much better on each dataset. For MSRvid and STSbenmark dataset, both Pearson's $r$ and Spearman's $\rho$ increase about $10\%$ with Multi-scale MaLSTM. Moreover, the Multi-scale MaLSTM achieves the highest accuracy and F1 score on the MSRP dataset compared with other models listed in Table \ref{tab:sts}. There are two reasons why our Multi-scale MaLSTM significantly outperforms MaLSTM model. First, for an input sentence pair, we explicitly model their semantic units with the factorization algorithm. Second, our multi-scaled network architecture is specifically designed for multi-scaled sentences representations. Therefore, it is able to explicitly match a pair of sentences at different granularities. We also report the results of HCTI and Multi-scale HCTI in Table \ref{tab:sts}. For the paraphrase identification task, our model shows better accuracy and F1 score on MSRP dataset. For the semantic textual similarity estimation task, the performance varies across datasets. On the SICK dataset, the performance of Multi-scale HCTI is close to HCTI with slightly better Pearson' $r$ and Spearman's $\rho$. However, the Multi-scale HCTI is not able to outperform HCTI on MSRvid and STSbenchmark. HCTI is still the best neural network model on the STSbenchmark dataset, and the MSRvid dataset is a subset of STSbenchmark. Although HCTI has strong performance on these two datasets, it performs worse than our model on other datasets. Overall, the experimental results demonstrated the general applicability of our proposed model architecture, which performs well on various semantic matching tasks. \section{Introduction} \label{sec:intro} Semantic matching, which aims to model the underlying semantic similarity or dissimilarity among different textual elements such as sentences and documents, has been playing a central role in many Natural Language Processing (NLP) applications, including information extraction \cite{grishman1997information}, top-$k$ re-ranking in machine translation \cite{brown1993mathematics}, question-answering \cite{yu2014deep}, automatic text summarization \cite{ponzanelli2015summarizing}. However, semantic matching based on either supervised or unsupervised learning remains a hard problem. Natural language demonstrates complicated hierarchical structures, where different words can be organized in different orders to express the same idea. As a result, appropriate semantic representation of text plays a critical role in matching natural language sentences. Traditional approaches represent text objects as bag-of-words (BoW), term frequency inverse document frequency (TF-IDF) \cite{wu2008interpreting} vectors, or their enhanced variants \cite{paltoglou2010study,robertson1994some}. However, such representations can not accurately capture the similarity between individual words, and do not take the semantic structure of language into consideration. Alternatively, word embedding models, such as \textit{word2vec} \cite{mikolov2013efficient} and \textit{Glove} \cite{pennington2014glove}, learn a distributional semantic representation of each word and have been widely used. Based on the word-vector representation, a number of unsupervised and supervised matching schemes have been recently proposed. As an unsupervised learning approach, the Word Mover's Distance (WMD) metric \cite{kusner2015word} measures the dissimilarity between two sentences (or documents) as the minimum distance to transport the embedded words of one sentence to those of another sentence. However, the sequential and structural nature of sentences is omitted in WMD. For example, two sentences containing exactly the same words in different orders can express totally different meanings. On the other hand, many supervised learning schemes based on deep neural networks have also been proposed for sentence matching \cite{mueller2016siamese,severyn2015learning,wang2017bilateral,pang2016text}. A common characteristic of many of these neural network models is that they adopt a Siamese architecture, taking the word embedding sequences of a pair of sentences (or documents) as the input, transforming them into intermediate contextual representations via either convolutional or recurrent neural networks, and performing scoring over the contextual representations to yield final matching results. However, these methods rely purely on neural networks to learn the complicated relationships among sentences, and many obvious compositional and hierarchical features are often overlooked or not explicitly utilized. In this paper, however, we argue that a successful semantic matching algorithm needs to best characterize the sequential, hierarchical and flexible structure of natural language sentences, as well as the rich interaction patterns among semantic units. We present a technique named \textit{Hierarchical Sentence Factorization} (or \emph{Sentence Factorization} in short), which is able to represent a sentence in a hierarchical semantic tree, with each node (semantic unit) at different depths of the tree reorganized into a normalized ``predicate-argument'' form. Such normalized sentence representation enables us to propose new methods to both improve unsupervised semantic matching by taking the structural and sequential differences between two text entities into account, and enhance a range of supervised semantic matching schemes, by overcoming the limitation of the representation capability of convolutional or recurrent neural networks, especially when labelled training data is limited. Specifically, we make the following contributions: \textit{First}, the proposed \textit{Sentence Factorization} scheme factorizes a sentence recursively into a hierarchical tree of semantic units, where each unit is a subset of words from the original sentence. Words are then reordered into a ``predicate-argument'' structure. Such form of sentence representation offers two benefits: i) the flexible syntax structures of the same sentence, for example, active and passive sentences, can be normalized into a unified representation; ii) the semantic units in a pair of sentences can be aligned according to their depth and order in the factorization tree. \textit{Second}, for unsupervised text matching, we combine the factorized and reordered representation of sentences and the Order-preserving Wasserstein Distance \cite{su2017order} (which was originally proposed to match hand-written characters in computer vision) to propose a new semantic distance metric between text objects, which we call \textit{Ordered Word Mover's Distance}. Compared with the recently proposed Word Mover's Distance \cite{kusner2015word}, our new metric achieves significant improvement by taking the sequential structures of sentences into account. For example, without considering the order of words, the Word Mover's Distance between the sentences ``Tom is chasing Jerry'' and ``Jerry is chasing Tom'' is zero. In contrast, our new metric is able to penalize such order mismatch between words, and identify the difference between the two sentences. \textit{Third}, for supervised semantic matching, we extend the existing Siamese network architectures (both for CNN and LSTM) to multi-scaled models, where each scale adopts an individual Siamese network, taking as input the vector representations of the two sentences at the corresponding depth in the factorization trees, ranging from the coarse-grained scale to fine-grained scales. When increasing the number of layers in the corresponding neural network can hardly improve performance, hierarchical sentence factorization provides a novel means to extend the original deep networks to a ``richer'' model that matches a pair of sentences through a multi-scaled semantic unit matching process. Our proposed multi-scaled deep neural networks can effectively improve existing deep models by measuring the similarity between a pair of sentences at different semantic granularities. For instance, Siamese networks based on CNN and BiLSTM \cite{mueller2016siamese,shao2017hcti} that originally only take the word sequences as the inputs. We extensively evaluate the performance of our proposed approaches on the task of semantic textual similarity estimation and paraphrase identification, based on multiple datasets, including the STSbenchmark dataset, the Microsoft Research Paraphrase identification (MSRP) dataset, the SICK dataset and the MSRvid dataset. Experimental results have shown that our proposed algorithms and models can achieve significant improvement compared with multiple existing unsupervised text distance metrics, such as the Word Mover's Distance \cite{kusner2015word}, as well as supervised deep neural network models, including Siamese Neural Network models based on CNN and BiLSTM \cite{mueller2016siamese,shao2017hcti}. The remainder of this paper is organized as follows. Sec.~\ref{sec:sentence} presents our hierarchical sentence factorization algorithm. Sec.~\ref{sec:owmd} presents our Ordered Word Mover's Distance metric based on sentence structural reordering. In Sec.~\ref{sec:multi-layer}, we propose our multi-scaled deep neural network architectures based on hierarchical sentence representation. In Sec.~\ref{sec:eval}, we conduct extensive evaluations of the proposed methods based on multiple datasets on multiple tasks. Sec.~\ref{sec:related} reviews the related literature. The paper is concluded in Sec.~\ref{sec:conclude}. \section{Related Work} \label{sec:related} The task of natural language sentence matching has been extensively studied for a long time. Here we review related unsupervised and supervised models for sentence matching. Traditional unsupervised metrics for document representation, including bag of words (BOW), term frequency inverse document frequency (TF-IDF) \cite{wu2008interpreting}, Okapi BM25 score \cite{robertson1994some}. However, these representations can not capture the semantic distance between individual words. Topic modeling approaches such as Latent Semantic Indexing (LSI) \cite{deerwester1990indexing} and Latent Dirichlet Allocation (LDA) \cite{blei2003latent} attempt to circumvent the problem through learning a latent representation of documents. But when applied to semantic-distance based tasks such as text-pair semantic similarity estimation, these algorithms usually cannot achieve good performance. Learning distributional representation for words, sentences or documents based on deep learning models have been popular recently. \textit{word2vec} \cite{mikolov2013efficient} and \textit{Glove} \cite{pennington2014glove} are two high quality word embeddings that have been extensively used in many NLP tasks. Based on word vector representation, the Word Mover's Distance (WMD) \cite{kusner2015word} algorithm measures the dissimilarity between two sentences (or documents) as the minimum distance that the embedded words of one sentence need to ``travel'' to reach the embedded words of another sentence. However, when applying these approaches to sentence pair matching tasks, the interactions between sentence pairs are omitted, also the ordered and hierarchical structure of natural languages is not considered. Different neural network architectures have been proposed for sentence pair matching tasks. Models based on Siamese architectures \cite{mueller2016siamese,severyn2015learning,neculoiu2016learning,baudivs2016sentence} usually transform the word embedding sequences of text pairs into context representation vectors through a multi-layer Long Short-Term Memory (LSTM) \cite{sundermeyer2012lstm} network or Convolutional Neural Networks (CNN) \cite{krizhevsky2012imagenet}, followed by a fully connected network or score function which gives the similarity score or classification label based on the context representation vectors. However, Siamese models defer the interaction between two sentences until the hidden representation layer, therefore may lose details of sentence pairs for matching tasks \cite{hu2014convolutional}. Aside from Siamese architectures, \cite{wang2017bilateral} introduced a matching layer into Siamese network to compare the contextual embedding of one sentence with another. \cite{hu2014convolutional,pang2016text} proposed convolutional matching models that consider all pair-wise interactions between words in sentence pairs. \cite{he2016pairwise} propose to explicitly model pairwise word interactions with a pairwise word interaction similarity cube and a similarity focus layer to identify important word interactions. \section{Hierarchical Sentence Factorization and Reordering} \label{sec:sentence} \begin{figure*}[tb] \centering \includegraphics[width=\textwidth]{figure/CaseStudy} \vspace{-3mm} \caption{An example of the sentence factorization process. Here we show: A. The original sentence pair; B. The procedures of creating sentence factorization trees; C. The predicate-argument form of original sentence pair; D. The alignment of semantic units with the reordered form.} \label{fig:casestudy} \vspace{-1mm} \end{figure*} In this section, we present our \textit{Hierarchical Sentence Factorization} techniques to transform a sentence into a hierarchical tree structure, which also naturally produces a reordering of the sentence at the root node. This multi-scaled representation form proves to be effective at improving both unsupervised and supervised semantic matching, which will be discussed in Sec.~\ref{sec:owmd} and Sec.~\ref{sec:multi-layer}, respectively. We first describe our desired factorization tree structure before presenting the steps to obtain it. Given a natural language sentence $S$, our objective is to transform it into a semantic factorization tree denoted by $T^f_S$. Each node in $T^f_S$ is called a \textit{semantic unit}, which contains one or a few tokens (tokenized words) from the original sentence $S$, as illustrated in Fig.~\ref{fig:casestudy} $(a4)$, $(b4)$. The tokens in every semantic unit in $T^f_S$ is re-organized into a ``predicate-argument'' form. For example, a semantic unit for ``Tom catches Jerry'' in the ``predicate-argument'' form will be ``catch Tom Jerry''. Our proposed factorization tree recursively factorizes a sentence into a hierarchy of semantic units at different granularities to represent the semantic structure of that sentence. The root node in a factorization tree contains the entire sentence reordered in the predicate-argument form, thus providing a ``normalized'' representation for sentences expressed in different ways (e.g., passive vs. active tenses). Moreover, each semantic unit at depth $d$ will be further split into several child nodes at depth $d + 1$, which are smaller semantic sub-units. Each sub-unit also follows the predicate-argument form. For example, in Fig.~\ref{fig:casestudy}, we convert sentence $A$ into a hierarchical factorization tree $(a4)$ using a series of operations. The root node of the tree contains the semantic unit ``chase Tom Jerry little yard big'', which is the reordered representation of the original sentence ``The little Jerry is being chased by Tom in the big yard'' in a semantically normalized form. Moreover, the semantic unit at depth $0$ is factorized into four sub-units at depth $1$: ``chase'', ``Tom'', ``Jerry little'' and ``yard big'', each in the ``predicate-argument'' form. And at depth $2$, the semantic sub-unit ``Jerry little'' is further factorized into two sub-units ``Jerry'' and ``little''. Finally, a semantic unit that contains only one token (e.g., ``chase'' and ``Tom'' at depth $1$) can not be further decomposed. Therefore, it only has one child node at the next depth through self-duplication. We can observe that each depth of the tree contains all the tokens (except meaningless ones) in the original sentence, but re-organizes these tokens into semantic units of different granularities. \subsection{Hierarchical Sentence Factorization} \label{subsec:sf} We now describe our detailed procedure to transform a natural language sentence to the desired factorization tree mentioned above. Our Hierarchical Sentence Factorization algorithm mainly consists of five steps: 1) AMR parsing and alignment, 2) AMR purification, 3) index mapping, 4) node completion, and 5) node traversal. The latter four steps are illustrated in the example in Fig.~\ref{fig:casestudy} from left to right \begin{figure}[tb] \centering \includegraphics[width=2.7in]{figure/amr} \vspace{0mm} \caption{An example of a sentence and its Abstract Meaning Representation (AMR), as well as the alignment between the words in the sentence and the nodes in AMR.} \label{fig:amr} \vspace{-3mm} \end{figure} \textbf{AMR parsing and alignment.} Given an input sentence, the first step of our hierarchical sentence factorization algorithm is to acquire its Abstract Meaning Representation (AMR), as well as perform AMR-Sentence alignment to align the concepts in AMR with the tokens in the original sentence. Semantic parsing \cite{baker1998berkeley,kingsbury2002treebank,berant2014semantic,banarescu2013abstract, damonte2016incremental} can be performed to generate the formal semantic representation of a sentence. Abstract Meaning Representation (AMR) \cite{banarescu2013abstract} is a semantic parsing language that represents a sentence by a directed acyclic graph (DAG). Each AMR graph can be converted into an AMR tree by duplicating the nodes that have more than one parent. Fig.~\ref{fig:amr} shows the AMR of the sentence ``I observed that the army moved quickly.'' In an AMR graph, leaves are labeled with concepts, which represent either English words (e.g., ``army''), PropBank framesets (e.g., ``observe-01'') \cite{kingsbury2002treebank}, or special keywords (e.g., dates, quantities, world regions, etc.). For example, ``(a / army)'' refers to an instance of the concept army, where ``a'' is the variable name of army (each entity in AMR has a variable name). ``ARG0'', ``ARG1'', ``:manner'' are different kinds of relations defined in AMR. Relations are used to link entities. For example, ``:manner'' links ``m / move-01'' and ``q / quick'', which means ``move in a quick manner''. Similarly, ``:ARG0'' links ``m / move-01'' and ``a / army'', which means that ``army'' is the first argument of ``move''. Each leaf in AMR is a concept rather than the original token in a sentence. The alignment between a sentence and its AMR graph is not given in the AMR annotation. Therefore, AMR alignment \cite{pourdamghani2014aligning} needs to be performed to link the leaf nodes in the AMR to tokens in the original sentence. Fig.~\ref{fig:amr} shows the alignment between sentence tokens and AMR concepts by the alignment indexes. The alignment index $0$ is for the root node, 0.0 for the first child of the root node, 0.1 for the second child of the root node, and so forth. For example, in Fig.~\ref{fig:amr}, the word ``army'' in sentence is linked with index ``0.1.0'', which represents the concept node ``a / army'' in its AMR. We refer interested readers to \cite{banarescu2013abstract,banarescu2012abstract} for more detailed description about AMR. Various parsers have been proposed for AMR parsing and alignment \cite{flanigan2014discriminative,wang2015boosting}. We choose the JAMR parser \cite{flanigan2014discriminative} in our algorithm implementation. \begin{figure}[tb] \centering \includegraphics[width=3.0in]{figure/amr2} \vspace{0mm} \caption{An example to show the operation of AMR purification.} \label{fig:amr2} \vspace{-3mm} \end{figure} \textbf{AMR purification.} Unfortunately, AMR itself cannot be used to form the desired factorization tree. First, it is likely that multiple concepts in AMR may link to the same token in the sentence. For example, Fig.~\ref{fig:amr2} shows AMR and its alignment for the sentence ``Three Asian kids are dancing.''. The token ``Asian'' is linked to four concepts in the AMR graph: `` continent (0.0.0)'', ``name (0.0.0.0)'', ``Asia (0.0.0.0.0)'' and ``wiki Asia (0.0.0.1)''. This is because AMR will match a named entity with predefined concepts which it belongs to, such as ``c / continent'' for ``Asia'', and form a compound representation of the entity. For example, in Fig.\ref{fig:amr2}, the token ``Asian'' is represented as a continent whose name is Asia, and its Wikipedia entity name is also Asia. In this case, we select the link index with the smallest tree depth as the token's position in the tree. Suppose $\mathcal{P}_w = \{p_1, p_2, \cdots, p_{|\mathcal{P}|}\}$ denotes the set of alignment indexes of token $w$. We can get the desired alignment index of $w$ by calculating the longest common prefix of all the index strings in $\mathcal{P}_w$. After getting the alignment index for each token, we then replace the concepts in AMR with the tokens in sentence by the alignment indexes, and remove relation names (such as ``:ARG0'') in AMR, resulting into a compact tree representation of the original sentence, as shown in the right part of Fig.~\ref{fig:amr2}. \textbf{Index mapping.} A purified AMR tree for a sentence obtained in the previous step is still not in our desired form. To transform it into a hierarchical sentence factorization tree, we perform index mapping and calculate a new position (or index) for each token in the desired factorization tree given its position (or index) in the purified AMR tree. Fig.~\ref{fig:casestudy} illustrates the process of index mapping. After this step, for example, the purified AMR trees in Fig.~\ref{fig:casestudy} $(a1)$ and $(b1)$ will be transformed into $(a2)$ and $(b2)$. Specifically, let $T^p_S$ denote a purified AMR tree of sentence $S$, and $T^f_S$ our desired sentence factorization tree of $S$. Let $I^p_N = \overline{i_0.i_1.i_2.\cdots.i_d}$ denote the index of node $N$ in $T^p_S$, where $d$ is the depth of $N$ in $T^p_S$ (where depth 0 represents the root of a tree). Then, the index $I^f_N$ of node $N$ in our desired factorization tree $T^f_S$ will be calculated as follows: \begin{equation} \label{eqn:transform-index} I^f_N := \begin{cases} \overline{0.0} & \quad \text{if } d=0, \\ \overline{i_0.(i_1+1).(i_2+1).\cdots.(i_d + 1)} & \quad \text{otherwise}. \end{cases} \end{equation} After index mapping, we add an empty root node with index $0$ in the new factorization tree, and link all nodes at depth $1$ to it as its child nodes. Note that the $i_0$ in every node index will always be 0. \textbf{Node completion.} We then perform node completion to make sure each branch of the factorization tree have the same maximum depth and to fill in the missing nodes caused by index mapping, illustrated by Fig.~\ref{fig:casestudy} $(a3)$ and $(b3)$. First, given a pre-defined maximum depth $D$, for each leaf node $N^l$ with depth $d < D$ in the current $T^f_S$ after index mapping, we duplicate it for $D - d$ times and append all of them sequentially to $N^l$, as shown in Fig.~\ref{fig:casestudy} $(a3)$, $(b3)$, such that the depths of the ending nodes will always be $D$. For example, in Fig.~\ref{fig:casestudy} with $D = 2$, the node ``chase (0.0)'' and ``Tom (0.1)'' will be extended to reach depth $2$ via self-duplication. Second, after index mapping, the children of all the non-leaf nodes, except the root node, will be indexed starting from 1 rather than 0. For example, in Fig.~\ref{fig:casestudy} $(a2)$, the first child node of ``Jerry (0.2)'' is ``little (0.2.1)''. In this case, we duplicate ``Jerry (0.2)'' itself to ``Jerry (0.2.0)'' to fill in the missing first child of ``Jerry (0.2)''. Similar filling operations are done for other non-leaf nodes after index mapping as well. \textbf{Node traversal to complete semantic units}. Finally, we complete each semantic unit in the formed factorization tree via node traversal, as shown in Fig.~\ref{fig:casestudy} $(a4)$, $(b4)$. For each non-leaf node $N$, we traverse its sub-tree by Depth First Search (DFS). The original semantic unit in $N$ will then be replaced by the concatenation of the semantic units of all the nodes in the sub-tree rooted at $N$, following the order of traversal. For example, for sentence $A$ in Fig.~\ref{fig:casestudy}, after node traversal, the root node of the factorization tree becomes ``chase Tom Jerry little yard big'' with index ``0''. We can see that the original sentence has been reordered into a predicate-argument structure. A similar structure is generated for the other nodes at different depths. Until now, each depth of the factorization tree $T^f_S$ can express the full sentence $S$ in terms of semantic units at different granularity. \section{Multi-scale Sentence Matching} \label{sec:multi-layer} \begin{figure*}[!htb] \centering \includegraphics[width=5.5in]{figure/network} \vspace{0mm} \caption{Extend the Siamese network architecture for sentence matching by feeding into the multi-scale representations of sentence pairs.} \label{fig:network} \vspace{-2mm} \end{figure*} Our sentence factorization algorithm parses a sentence $S$ into a hierarchical factorization tree $T^f_S$, where each depth of $T^f_S$ contains the semantic units of the sentence at a different granularity. In this section, we exploit this multi-scaled representation of $S$ present in $T^f_S$ to propose a multi-scaled Siamese network architecture that can extend any existing CNN or RNN-based Siamese architectures to leverage the hierarchical representation of sentence semantics. Fig.~\ref{fig:network} (a) shows the network architecture of the popular Siamese ``matching-aggregation'' framework \cite{wang2016compare,mueller2016siamese,severyn2015learning,neculoiu2016learning,baudivs2016sentence} for sentence matching tasks. The matching process is usually performed as follows: First, the sequence of word embeddings in two sentences will be encoded by a context representation layer, which usually contains one or multiple layers of LSTM, bi-directional LSTM (BiLSTM), or CNN with max pooling layers. The goal is to capture the contextual information of each sentence into a context vector. In a Siamese network, every sentence is encoded by the same context representation layer. Second, the context vectors of two sentences will be concatenated in the aggregation layer. They may be further transformed by more layers of neural network to get a fixed length matching vector. Finally, a prediction layer will take in the matching vector and outputs a similarity score for the two sentences or the probability distribution over different sentence-pair relationships. Compared with the typical Siamese network shown in Fig.~\ref{fig:network} (a), our proposed architecture shown in Fig.~\ref{fig:network} (b) differs in two aspects. First, our network contains three Siamese sub-modules that are similar to (a). They correspond to the factorized representations from depth $0$ (the root layer) to depth $2$. We only select the semantic units from the top $3$ depths of the factorization tree as our input, because usually most semantic units at depth $2$ are already single words and can not be further factorized. Second, for each Siamese sub-module in our network architecture, the input is not the embedding vectors of words from the original sentences. Instead, we use semantic units at different depths of sentence factorization tree for matching. We sum up the embedding vectors of the words contained in a semantic unit to represent that unit. Assuming each semantic unit at depth $d$ can be factorized into $k$ semantic sub-units at depth $d + 1$. If a semantic unit has less than $k$ sub-units, we add empty units as its child node to make each non-leaf node in a factorization tree has exactly $k$ child nodes. The empty units are embedded with a vector of zeros. After this procedure, the number of semantic units at depth $d$ of a sentence factorization tree is $k^d$. Taking Fig.~\ref{fig:casestudy} as an example. We set $k = 4$ in Fig.~\ref{fig:casestudy}. For sentence A ``The little Jerry is being chased by Tom in the big yard'', the input at depth $0$ is the sum of word embedding $\{$chase, Tom, Jerry, little, yard, big$\}$. The input at depth $1$ are the embedding vectors of four semantic units: $\{$chase, Tome, Jerry little, yard big$\}$. Finally, at depth $2$, the semantic units are $\{$chase, -, -, -, Tom, -, -, -, Jerry, little, -, -, yard, big, -, -$\}$, where ``$-$'' denotes an empty unit. As we can see, based on this factorized sentence representation, our network architecture explicitly matches a pair of sentences at several semantic granularities. In addition, we align the semantic units in two sentences by mapping their positions in the tree to the corresponding indices in the input layer of the neural network. For example, as shown in Fig.~\ref{fig:casestudy}, the semantic units at depth $2$ are aligned according to their unit indices: ``chase'' matches with ``catch'', ``Tom'' matches with ``cat blue'', ``Jerry little'' matches with ``mouse brown'', and ``yard big'' matches with ``forecourt''. \section{Ordered Word Mover's Distance} \label{sec:owmd} \begin{figure}[tb] \centering \includegraphics[width=2.5in]{figure/SentenceMatch} \vspace{0mm} \caption{Compare the sentence matching results given by Word Mover's Distance and Ordered Word Mover's Distance.} \label{fig:match} \vspace{-3mm} \end{figure} The proposed hierarchical sentence factorization technique naturally reorders an input sentence into a unified format at the root node. In this section, we introduce the \textit{Ordered Word Mover's Distance} metric which measures the semantic distance between two input sentences based on the unified representation of reordered sentences. Assume $X\in \mathbb{R}^{d\times n}$ is a \textit{word2vec} embedding matrix for a vocabulary of $n$ words, and the $i$-th column $\mathbf{x}_i \in \mathbb{R}^d$ represents the $d$-dimensional embedding vector of $i$-th word in vocabulary. Denote a sentence $S = \overline{a_1a_2\cdots a_K}$ where $a_i$ represents the $i$-th word (or the word embedding vector). The Word Mover's Distance considers a sentence $S$ as its normalized bag-of-words (nBOW) vectors where the weights of the words in $S$ is $\mathbf \alpha = \{\alpha_1, \alpha_2, \cdots, \alpha_K\}$. Specifically, if word $a_i$ appears $c_i$ times in $S$, then $\alpha_i = \frac{c_i}{\sum_{j=1}^K c_j}$. The Word Mover's Distance metric combines the normalized bag-of-words representation of sentences with Wasserstein distance (also known as Earth Mover's Distance \cite{rubner2000earth}) to measure the semantic distance between two sentences. Given a pair of sentences $S_1 = \overline{a_1a_2\cdots a_M}$ and $S_2 = \overline{b_1b_2\cdots b_N}$, where $b_j \in \mathbb{R}^d$ is the embedding vector of the $j$-th word in $S_2$. Let $\mathbf \alpha = \{\alpha_1, \cdots, \alpha_M\}$ and $\mathbf \beta = \{\beta_1, \cdots, \beta_N\}$ represents the normalized bag-of-words vectors of $S_1$ and $S_2$. We can calculate a distance matrix $D \in \mathbb{R}^{M\times N}$ where each element $D_{ij} = \|a_i - b_j\|_2$ measures the distance between word $a_i$ and $b_j$ (we use the same notation to denote the word itself or its word vector representation). Let $T \in \mathbb{R}^{M\times N}$ be a non-negative sparse transport matrix where $T_{ij}$ denotes the portion of word $a_i \in S_1$ that transports to word $b_j \in S_2$. The Word Mover's Distance between sentences $S_1$ and $S_2$ is given by $\sum_{i,j} T_{ij} D_{ij}$. The transport matrix $T$ is computed solving the following constrained optimization problem: \begin{equation} \label{eq:wmd} \begin{split} \underset{T \in \mathbb{R}_{+}^{M\times N}}{\mbox{minimize}}\quad & \sum_{i,j} T_{ij} D_{ij} \\ \mbox{subject to}\quad & \sum\limits_{i = 1}^{M} T_{ij} = \beta_j \quad 1\leq j \leq N,\\ & \sum\limits_{j = 1}^{N} T_{ij} = \alpha_i \quad 1\leq i \leq M. \end{split} \end{equation} Where the minimum ``word travel cost'' between two bags of words for a pair of sentences is calculated to measure the their semantic distance. However, the Word Mover's Distance fails to consider a few aspects of natural language. First, it omits the sequential structure. For example, in Fig.~\ref{fig:match}, the pair of sentences ``Morty is laughing at Rick'' and ``Rick is laughing at Morty'' only differ in the order of words. The Word Mover's Distance metric will then find an exact match between the two sentences and estimate the semantic distance as zero, which is obviously false. Second, the normalized bag-of-words representation of a sentence can not distinguish duplicated words shown in multiple positions of a sentence. To overcome the above challenges, we propose a new kind of semantic distance metric named Ordered Word Mover's Distance (OWMD). The Ordered Word Mover's Distance combines our sentence factorization technique with Order-preserving Wasserstein Distance proposed in \cite{su2017order}. It casts the calculation of semantic distance between texts as an optimal transport problem while preserving the sequential structure of words in sentences. The Ordered Word Mover's Distance differs from the Word Mover's Distance in multiple aspects. First, rather than using normalized bag-of-words vector to represent a sentence, we decompose and re-organize a sentence using the sentence factorization algorithm described in Sec.~\ref{sec:sentence}. Given a sentence $S$, we represent it by the reordered word sequence $S'$ in the root node of its sentence factorization tree. Such representation normalizes a sentence into ``predicate-argument'' structure to better handle syntactic variations. For example, after performing sentence factorization, sentences ``Tom is chasing Jerry'' and ``Jerry is being chased by Tom'' will both be normalized as ``chase Tom Jerry''. Second, we calculate a new transport matrix $T$ by solving the following optimization problem \begin{equation} \label{eq:owmd} \begin{split} \underset{T \in \mathbb{R}_{+}^{M\times N}}{\mbox{minimize}}\quad & \sum_{i,j} T_{ij} D_{ij} - \lambda_1 I(T) + \lambda_2 KL(T||P)\\ \mbox{subject to}\quad & \sum\limits_{i = 1}^{M} T_{ij} = \beta_j' \quad 1\leq j \leq N',\\ & \sum\limits_{j = 1}^{N} T_{ij} = \alpha_i' \quad 1\leq i \leq M', \end{split} \end{equation} where $\lambda_1 > 0$ and $\lambda_2 > 0$ are two hyper parameters. $M'$ and $N'$ denotes the number of words in $S_1'$ and $S_2'$. $\alpha_i'$ denotes the weight of the $i$-th word in normalized sentence $S_1'$ and $\beta_j'$ denotes the weight of the $j$-th word in normalized sentence $S_2'$. Usually we can set $\mathbf{\alpha'} = (\frac{1}{M'}, \cdots, \frac{1}{M'})$ and $\mathbf{\beta'} = (\frac{1}{N'}, \cdots, \frac{1}{N'})$ without any prior knowledge of word differences. The first penalty term $I(T)$ is the inverse difference moment \cite{albregtsen2008statistical} of the transport matrix $T$ that measures local homogeneity of $T$. It is defined as: \begin{equation} \label{eq:IT} \begin{split} I(T) = \sum\limits_{i=1}^{M'} \sum\limits_{j=1}^{N'} \frac{T_{ij}}{(\frac{i}{M'} - \frac{j}{N'})^2 + 1}. \end{split} \end{equation} $I(T)$ will have a relatively large value if the large values of $T$ mainly appear near its diagonal. Another penalty term $KL(T||P)$ denotes the KL-divergence between $T$ and $P$. $P$ is a two-dimensional distribution used as the prior distribution for values in $T$. It is defined as \begin{equation} \label{eq:P} \begin{split} P_{ij} = \frac{1}{\sigma \sqrt{2\pi}}e^{- \frac{l^2(i,j)}{2\sigma^2}} \end{split} \end{equation} where $l(i, j)$ is the distance from position $(i, j)$ to the diagonal line, which is calculated as \begin{equation} \label{eq:l} \begin{split} l(i, j) = \frac{|i/M' - j/N'|}{\sqrt{1/M'^2 + 1/N'^2}}. \end{split} \end{equation} As we can see, the farther a word in one sentence is from the other word in another sentence in terms of word orders, the less likely it will be transported to that word. Therefore, by introducing the two penalty terms $I(T)$ and $KL(T||P)$ into problem~(\ref{eq:owmd}), we encourage words at similar positions in two sentences to be matched. Words at distant positions are less likely to be matched by $T$. The problem (\ref{eq:owmd}) has a unique optimal solution $T^{\lambda_1, \lambda_2}$ since both the objective and the feasible set are convex. It has been proved in \cite{su2017order} that the optimal $T^{\lambda_1, \lambda_2}$ has the same form with $diag(\mathbf{k}_1) \cdot \mathbf{K} \cdot diag(\mathbf{k}_2)$, where $diag(\mathbf{k}_1) \in \mathbb{R}^{M'}$ and $diag(\mathbf{k}_2) \in \mathbb{R}^{N'}$ are two diagonal matrices with strictly positive diagonal elements. $\mathbf{K} \in \mathbb{R}^{M'\times N'}$ is a matrix defined as \begin{equation} \label{eq:K} \begin{split} K_{ij} = P_{ij} e^{\frac{1}{\lambda_2}(S_{ij}^{\lambda_1} - D_{ij})}, \end{split} \end{equation} where \begin{equation} \label{eq:S} \begin{split} S_{ij} = \frac{\lambda_1}{(\frac{i}{M'} - \frac{j}{N'})^2 + 1}. \end{split} \end{equation} The two matrices $\mathbf{k}_1$ and $\mathbf{k}_2$ can be efficiently obtained by the Sinkhorn-Knopp iterative matrix scaling algorithm \cite{knight2008sinkhorn}: \begin{equation} \label{eq:k1} \begin{split} \mathbf{k}_1 &\leftarrow \mathbf{\alpha'} ./ K \mathbf{k}_2, \\ \mathbf{k}_2 &\leftarrow \mathbf{\beta'} ./ K^T \mathbf{k}_1. \end{split} \end{equation} where $./$ is the element-wise division operation. Compared with Word Mover's Distance, the Ordered Word Mover's Distance considers the positions of words in a sentence, and is able to distinguish duplicated words at different locations. For example, in Fig.~\ref{fig:match}, while the WMD finds an exact match and get a semantic distance of zero for the sentence pair ``Morty is laughing at Rick'' and ``Rick is laughing at Morty'', the OWMD metric is able to find a better match relying on the penalty terms, and gives a semantic distance greater than zero. The computational complexity of OWMD is also effectively reduced compared to WMD. With the additional constraints, the time complexity is $O(dM'N')$ where $d$ is the dimension of word vectors \cite{su2017order}, while it is $O(dp^3\log p)$ for WMD, where $p$ denotes the number of uniques words in sentences or documents \cite{kusner2015word}.
{'timestamp': '2018-03-02T02:05:54', 'yymm': '1803', 'arxiv_id': '1803.00179', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00179'}
arxiv
\section{Formal Problem Setting} In this section, we formalize our problem setting as a {\sc pomdp}, for which we will show that a dynamically factored belief is a good representation for the agent's belief state. \emph{Assumptions.} We will assume deterministic transitions and a uniform observation model over all valid observations, in order to make progress on this difficult problem. \subsection{Planning Problem Class} We first describe the underlying class of planning problems. We consider \emph{open domains}, in which the world contains a (finite or infinite) universe of objects, but the agent does not know this universe. Planning in open domains is significantly more complex than planning in settings where the universe of objects is known in advance. The class of \emph{open-domain planning problems} $\Pi$ contains tuples $\langle \mathcal{T}, \P, \mathcal{O}, \mathcal{V}, \mathcal{F}, \mathcal{U}, \mathcal{I}, \mathcal{G} \rangle$: \begin{tightlist} \item $\mathcal{T}$ is a known set of object \emph{types}, such as locations or movables. For some types, the set of objects may be known to the agent in advance; for others, it may not. \item $\P$ is a known set of \emph{properties} (such as color, size, pose, or contents) for each type from $\mathcal{T}$. Each property has an associated (possibly infinite) domain. \item $\mathcal{O}$ is a (possibly partially) unknown set of \emph{objects}, each of a type from $\mathcal{T}$. This set $\mathcal{O}$ can be finite or infinite. \item $\mathcal{V}$ is the set of \emph{state variables} resulting from applying each property in $\P$ to every object in $\mathcal{O}$ of the corresponding type. Each variable has a domain based on the property and can be either continuous or discrete. \item $\mathcal{F}$ is a set of \emph{fluents} or \emph{constraints}, Boolean-valued expressions given by a predicate applied to state variables and (possibly) values in their domains. Examples: \emph{Equal(size(obj1), 6)}; \emph{Different(color(obj2), color(obj3))}. \item $\mathcal{U}$ is a set of object-parametrized \emph{operators} that represent ways the agent can affect its environment. Each has preconditions (partial assignment of values to $\mathcal{V}$ that must hold for it to be legal), effects (partial assignment of values to $\mathcal{V}$ that holds after it is performed), and a cost. \item $\mathcal{I}$ is an assignment of values to $\mathcal{V}$ defining the \emph{initial state}. \item $\mathcal{G}$ is a partial assignment of values to $\mathcal{V}$ defining the \emph{goal}. \end{tightlist} A solution to a problem in $\Pi$ is a minimum-cost sequence of parametrized operators $u_{1}, ..., u_{n} \in \mathcal{U}$ (a \emph{plan}) such that starting with $\mathcal{I}$ and applying the $u_{i}$ sequentially satisfies operator preconditions and causes the partial assignment $\mathcal{G}$ to hold. Variables in $\mathcal{V}$ that are not in $\mathcal{G}$ may have any value. \subsection{{\sc pomdp}\ Formulation} With $\Pi$ defined, we are ready to formulate our setting as a {\sc pomdp}. Let $\langle \mathcal{T}, \P, \mathcal{O}, \mathcal{V}, \mathcal{F}, \mathcal{U}, \mathcal{I}, \mathcal{G} \rangle$ be an open-domain planning problem from $\Pi$. Define the {\sc pomdp}: \begin{tightlist} \item $\mathcal{S}$ (the state space) is the space of all possible assignments of values to $\mathcal{V}$. A state is, thus, an assignment of a value to each variable in $\mathcal{V}$. Note that $\mathcal{I}$ is a state. \item $\mathcal{A}$ (the action space) is $\mathcal{U}$. \item $\Omega$ (the observation space) is the space of all (potentially noisy) observations: we define an observation as a set of pairs $\langle f, p \rangle$, where $f \in \mathcal{F}$ and $p \in (0, 1]$. Intuitively, the interpretation is that every fluent (constraint) $f$ in this set holds with probability $p$ in the current state. We assume each observation $o$ comes from either 1) the robot's own perceptual capabilities or 2) an \emph{assertion} about the environment, which simulates human-provided information. For each fluent $f$ in $o$, the corresponding $p$ is a measure of confidence in $f$ holding within the current state. It can be based on the quality of a sensor or on the human's certainty about the veracity of their assertion. Because $\mathcal{O}$ is unknown, a fluent may contain state variables referencing objects the agent has not encountered before. \item $T(s, a, s')$ (the transition distribution) is 1 if $s$ satisfies $a$'s preconditions and $s'$ its effects; 0 otherwise. \item $O(s', a, o)$ (the observation model) is a uniform distribution over all valid observations. \item $R(s', a)$ (the reward function) is the negative cost of $a$. \item $s \in \mathcal{S}$ is \emph{terminal}, ending the episode, if $\mathcal{G}$ holds in $s$. \end{tightlist} A solution to this {\sc pomdp}\ is a policy that maps the history of observations and actions to the next action to take, such that the sum of expected rewards is maximized: observe that this corresponds to solving $\Pi$. Sources of uncertainty in this formulation are the open domain and the noisy observations. Next, we present the \emph{dynamically factored belief} as a good belief state representation for this {\sc pomdp}. Though this representation does not depend on the presence of assertions or an open domain, we present it within this context because it best motivates the approach and manifests its strengths. \section{Dynamically Factored Belief} \subsection{Overview} In trying to find a suitable belief state representation for the {\sc pomdp}\ defined in the previous section, we must be cognizant of the fact that the agent does not know $\mathcal{O}$, the complete set of objects in the world. A natural representation to use might be a factored one over each state variable in $\mathcal{V}$, but unfortunately, if $\mathcal{O}$ is unknown then so is $\mathcal{V}$. Furthermore, fluents in the observations may be complicated expressions involving multiple state variables; we would like our representation to be able to incorporate these observations. \begin{figure}[t] \vspace{0.6em} \centering \noindent \includegraphics[width=\columnwidth]{figures/dfboverview.jpg} \caption{Example of dynamic factoring given four sequential noiseless observations in a setting with one object type and two properties: \emph{color} and \emph{location}. Each factor maps to a distribution over values (not shown). Initially, there are no factors. \emph{Row 1:} The agent receives an assertion containing one state variable, \emph{color(A)}; a singleton factor for this variable is introduced. \emph{Row 2:} The assertion contains two state variables, so a joint factor is introduced. \emph{Row 3:} The assertion contains a new state variable, \emph{location(D)}, so a factor is introduced for it, then joined with the [\emph{location(B), location(C)}] factor. \emph{Row 4:} The agent observes the color and location of Object B. The joint distribution over the locations of B, C, and D is now uniform across the first dimension, so the factor gets split into two. This type of splitting implies that factors do not necessarily get bigger each time a new observation arrives. In this figure, all observations are noiseless (all $p=1$) for clarity of presentation. The factor graph is always a collection of independent subgraphs, where each subgraph contains exactly one factor.} \label{fig:dfboverview} \end{figure} We note the following. First, we do not need to know the full set of state variables in order to maintain a (partial) factored belief representation. Second, the choice of factors should be dynamic and influenced by the observations, allowing us to gracefully cope with complicated assertions. The intuition is that a constraint linking two state variables would not be foldable into a factored representation over each state variable, so the representation should be modified. Building on these ideas, we present the following definition. \begin{defn} A \emph{dynamically factored belief state representation} has two components: \begin{tightlist} \item A factored representation for which each factor is a \emph{list} of one or more state variables from $\mathcal{V}$. The factors partition the set of state variables that the agent knows about so far, either from prior knowledge or from a received observation. Each factor maps to a joint probability distribution over possible values for all its variables. \item A database called ComplexFluents. \end{tightlist} \end{defn} The belief is initialized to have a singleton factor for each state variable in $\mathcal{V}$ associated with an object in $\mathcal{O}$ known a priori to exist, mapping to any distribution (e.g. a prior). Each time an observation $o \in \Omega$ is received, the belief is updated as follows with every constituent fluent $f$: all factors containing state variables mentioned by $f$ are introduced (if they are not represented yet) and joined, so long as the resulting joint would not be too big. If it would be too big, then the fluent is lazily placed into ComplexFluents and considered only at query time. Furthermore, factors are regularly split up for efficiency, implying that a belief update could potentially compress the representation. This is shown in \figref{fig:dfboverview} and described in detail in the next section. Newly introduced variables can map to any distribution, such as a uniform one, or one calculated from some prior knowledge. The factors partition the set of state variables that the agent knows about so far, meaning no state variable can ever be present in more than one factor. Enforcing this invariant greatly simplifies inference, as can be understood from a factor graph perspective. A dynamically factored belief maintains a factor graph with variable nodes $V$ and factor nodes $F$, where the $V$ are the state variables in $\mathcal{V}$ that the agent knows about so far, and the $F$ are the factors. Each node $F$ connects to all the $V$ that are present in the corresponding list (and thus comprise that factor's joint distribution). Because the factors partition the variables, this factor graph is a collection of independent subgraphs, where each subgraph contains exactly one node from $F$ connected to one or more nodes from $V$. See \figref{fig:dfboverview} for an example. Fluents placed lazily into ComplexFluents are not part of this factor graph. The structure of this factor graph is constantly changing as new objects are discovered and observations are received, but it will always be a collection of independent subgraphs. Thus, there is no possibility of ending up with a cyclic factor graph, which would typically necessitate either approximate inference or expensive exact inference. \emph{Note.} All fluents, complex or not, can be represented by a factor in some more complex factor graph. One could imagine a different algorithm that avoids constructing the joint of all variables mentioned by a fluent, but instead creates a new factor for the fluent while leaving other factors untouched. This would likely create cycles, but cycles could be collapsed into joint distributions over all constituent nodes. Inference would then be done using message-passing. In contrast, our method eagerly incorporates fluents in a way that makes inference fast and cycles impossible. Furthermore, our method can very quickly answer queries about a marginal on a subset of any factor, as we will see. \subsection{Belief Update Algorithm} \begin{algorithm}[t] \SetAlgoLined \SetAlgoNoEnd \DontPrintSemicolon \SetKwFunction{algo}{algo}\SetKwFunction{proc}{proc} \SetKwProg{myalg}{Algorithm}{}{} \SetKwProg{myproc}{Subroutine}{}{} \SetKw{Continue}{continue} \SetKw{Return}{return} \myalg{Dynamically Factored Belief Update}{ \nl $B \gets$ InitializeFactoredBeliefMap()\; \nl ComplexFluents $\gets$ set(\{\})\; \myproc{\textsc{BeliefUpdate}(observation, action)}{ \nl \For{each $\langle f, p \rangle$ in observation}{ \nl \For{each stateVar mentioned by $f$}{ \nl \If{!$B$.Contains(stateVar)}{ \nl $B$.Add([stateVar], defaultDist())\; } } \nl \eIf{joint would be too big}{ \nl ComplexFluents.Add($f$)\; }{ \nl $B$.JoinFactorsAndUpdate($f, p$)\;} } \nl $B$.UpdateWithAction(action)\; \tcp{\footnotesize Keep representation compact.} \nl \For{each factor in $B$.Factors}{ \nl $B$.TrySplit(factor, $\epsilon$)\; } }}\; \caption{Dynamically factored belief update.} \label{alg:dynamicbeliefupdate} \end{algorithm} \algref{alg:dynamicbeliefupdate} gives pseudocode for updating a dynamically factored belief. The belief is initialized to contain a singleton factor for each state variable in $\mathcal{V}$ associated with an object in $\mathcal{O}$ known a priori to exist. The \textsc{BeliefUpdate} subroutine is called at each timestep, after the agent takes an action and receives an observation (a set of fluents, each with a corresponding probability of holding in the world). Line 7 decides whether joining all factors containing a state variable mentioned by the fluent would result in a joint that is too ``big'' (expensive to compute or represent). If so, the fluent is lazily stored in the database ComplexFluents and considered only at query time. An implementation of this test could take the product of the factor sizes and check whether it is above a certain threshold. \begin{algorithm}[t] \SetAlgoLined \SetAlgoNoEnd \DontPrintSemicolon \SetKwFunction{algo}{algo}\SetKwFunction{proc}{proc} \SetKwProg{myalg}{Algorithm}{}{} \SetKwProg{myproc}{Subroutine}{}{} \SetKw{Continue}{continue} \SetKw{Return}{return} \myproc{\textsc{JoinFactorsAndUpdate}($B, f, p$)}{ \nl joint $\gets$ (join factors $F$ containing variables in $f$)\; \nl $m \gets$ (total prob. of values inconsistent with $f$)\; \nl \For{each value in joint}{ \nl \If{value is inconsistent with $f$}{ \nl joint.RescaleProbBy$\left(\text{value}, \frac{(1-p)(1-m)}{pm}\right)$\; } } \nl joint.Normalize()\; \nl Add joint to $B$ and remove all $F$ from $B$.\; }\; \myproc{\textsc{TrySplit}($B$, factor, $\epsilon$)}{ \nl \For{each state variable $V$ in factor}{ \nl reconstructed $\gets$ Join($B$[V], $B$[factor $\setminus$ \{V\}])\; \nl \If{$D_{JS}\infdivx{B[\text{factor}]}{\text{reconstructed}} < \epsilon$}{ \nl Split $B$[factor] into $B$[V], $B$[factor $\setminus$ \{V\}].\; } } }\; \caption{Subroutines used in \algref{alg:dynamicbeliefupdate}.} \label{alg:subroutines} \end{algorithm} \textbf{Joining Factors} \ The call in Line 9 to \textsc{JoinFactorsAndUpdate} creates a new factor containing all state variables that are mentioned by the fluent $f$ (if such a factor is not already present), then maps this factor to a joint distribution for which $f$ holds with probability $p$. To accomplish this, we build the joint then rescale the probabilities such that $p$ mass goes to the joint values which are consistent with $f$, and the remaining $1-p$ mass goes to those which are inconsistent. This can be done using Jeffrey's rule~\cite{jeffreysrule}: rescale the probability of all values inconsistent with $f$ by $\frac{(1-p)(1-m)}{pm}$, where $m$ is the total probability of these inconsistent values, then normalize. When $p = 1$, this algorithm just filters out joint values inconsistent with $f$, as expected. See \algref{alg:subroutines} for pseudocode and \figref{fig:joinfactorsandupdate} for an example. If distributions are continuous, we perform these operations implicitly using rejection sampling at query time. \textbf{Splitting Factors} \ The call in Line 12 to \textsc{TrySplit} attempts to split up factors to maintain a compact representation. In practice, we accomplish this by checking whether each state variable in the factor can be marginalized out. Of course, it is unlikely that such marginalization can ever be done in a lossless manner, as this would require the joint to be exactly decomposable into a product involving this marginal. Instead, we perform marginalization whenever the reconstruction error is less than a hyperparameter $\epsilon$. We measure this reconstruction error as the Jensen-Shannon divergence $D_{JS}$ between the true joint and the approximate joint reconstructed from the attempted decomposition. Let $P$ and $Q$ be arbitrary probability distributions. The Jensen-Shannon divergence is a smooth, symmetric, bounded measure of similarity between $P$ and $Q$. It is based on the Kullback-Leibler (KL) divergence, defined as $D_{KL}\infdivx{P}{Q} = -\sum_{i}P(i) \log \frac{Q(i)}{P(i)},$ where the summation can be replaced by integration for continuous distributions. Then letting $A = \frac{1}{2}(P+Q)$, the Jensen-Shannon divergence is defined as $D_{JS}\infdivx{P}{Q} = \frac{1}{2} D_{KL}\infdivx{P}{A} + \frac{1}{2} D_{KL}\infdivx {Q}{A}.$ Assuming the natural logarithm is used, the bound $0 \leq D_{JS}\infdivx{P}{Q} \leq \log 2$ always holds. Since $D_{JS}$ is bounded, it is reasonable to use $\epsilon$ as a fixed threshold on the reconstruction error to decide whether to do marginalization. Varying $\epsilon$ lets the designer trade off between compactness of the belief and accuracy of inference. See \algref{alg:subroutines} for pseudocode and \figref{fig:trysplit} for an example. \begin{figure}[t] \vspace{0.6em} \centering \noindent \includegraphics[width=0.45\textwidth]{figures/noisyupdate1.png} \vspace{0.7em} \includegraphics[width=0.45\textwidth]{figures/noisyupdate2.png} \caption{Posteriors from running \textsc{JoinFactorsAndUpdate} with fluent \emph{Same(color(object1), color(object2))}, for three values of $p$.} \label{fig:joinfactorsandupdate} \end{figure} \begin{figure}[t] \centering \noindent \includegraphics[width=0.45\textwidth]{figures/noisysplit1.png} \vspace{0.7em} \includegraphics[width=0.45\textwidth]{figures/noisysplit2.png} \caption{Two examples of trying to split up a factor having two variables. \emph{Top:} The variables are independent; no error is incurred. \emph{Bottom:} Error is incurred based on the Jensen-Shannon divergence between the joint and the product of the marginals ($\sim$0.01 here).} \label{fig:trysplit} \end{figure} \subsection{Inference} Dynamically factored beliefs can handle two types of queries: 1) a marginal on any state variable, or on a set of state variables that is a subset of some factor, and 2) a sample from the full joint of current factors, which gives a world state consistent with the agent's current knowledge. To answer queries of type 1), we observe that if a state variable or set of state variables is a subset of some factor, then our representation already stores a joint distribution over values for those variables. Any query about them can be answered using this joint, e.g. by sampling. We do not have to worry about violating the constraints in ComplexFluents because each of those could only ever constrain a set of state variables that spans multiple factors. To answer queries of type 2), we must draw from the distribution implicitly encoded by all factors together, which produces an assignment that maps every currently known state variable to a value. One can treat this as a constraint satisfaction problem~\cite{csp} where the constraints are the fluents in ComplexFluents (all other fluents have already been folded eagerly into the belief), and apply standard solving techniques. Our experiments solve it incrementally using a backtracking approach; see \algref{alg:samplestate} for pseudocode. \begin{algorithm}[t] \SetAlgoLined \SetAlgoNoEnd \DontPrintSemicolon \SetKwFunction{algo}{algo}\SetKwFunction{proc}{proc} \SetKwProg{myalg}{Algorithm}{}{} \SetKwProg{myproc}{Subroutine}{}{} \SetKw{Continue}{continue} \SetKw{Return}{return} \myalg{\textsc{SampleState}($B$, ComplexFluents)}{ \nl state $\gets$ map(each state variable in $B \to$ NULL)\; \nl curIndex $\gets$ 0\; \nl \While{curIndex $<$ number of factors}{ \nl factor $\gets$ $B$.Factors[curIndex]\; \nl \If{sampling limit reached}{ \nl \For{each stateVar in factor}{ \nl state[stateVar] $\gets$ NULL\;} \nl curIndex $\gets$ curIndex $-$ 1\; \Continue} \nl values $\gets B$[factor].Sample()\; \nl \For{stateVar, value in zip(factor, values)}{ \nl state[stateVar] $\gets$ value\;} \nl \If{any $f$ in ComplexFluents cannot hold}{\Continue} \nl curIndex $\gets$ curIndex + 1\; } \Return state }\; \caption{An incremental algorithm for sampling a world state consistent with all observations, using a dynamically factored belief $B$. The returned state is an assignment of currently known state variables to values.} \label{alg:samplestate} \end{algorithm} \section{Background} \subsection{{\sc pomdp} s and Belief States} We formalize agent-environment interaction in the presence of uncertainty as a \emph{partially observable Markov decision process} ({\sc pomdp})~\cite{pomdp}. We consider a typical undiscounted setting with: $\mathcal{S}$, the state space; $\mathcal{A}$, the action space; $\Omega$, the observation space; $T(s, a, s') = P(s' \mid s, a)$, the transition distribution with $s, s' \in \mathcal{S}, a \in \mathcal{A}$; $O(s', a, o) = P(o \mid s', a)$, the observation model with $s' \in \mathcal{S}, a \in \mathcal{A}, o \in \Omega$; and $R(s, a, s')$, the reward function with $s, s' \in \mathcal{S}, a \in \mathcal{A}$. Some states in $\mathcal{S}$ are \emph{terminal}, ending the episode. At each timestep, the agent selects an action, causing 1) the hidden state to change according to $T$, 2) the agent to receive a reward according to $R$, and 3) the agent to receive an observation according to $O$. The agent's objective is to maximize its overall expected reward, $\mathbb{E}\left[\sum_{t}R(s_{t}, a_{t}, s_{t+1})\right]$. A solution to a {\sc pomdp}\ is a policy that maps the history of observations and actions to the next action to take, such that this objective is optimized over the trajectory. The sequence of states $s_{0}, s_{1}, ...$ is unobserved, so the agent must instead maintain a \emph{belief state}: a probability distribution over the space of world states. This belief is updated on each timestep based on the received observation and taken action. The exact belief update is $B'(s') = \frac{1}{Z}\left[O(s', a, o) \sum_{s \in \mathcal{S}} T(s, a, s')B(s)\right],$ where $B$ and $B'$ are the old and new belief states, $s' \in \mathcal{S}$ is a state, $a \in \mathcal{A}$ is the taken action, $o \in \Omega$ is the received observation, and $Z$ is a normalizing factor. Representing the full belief exactly is prohibitively expensive for even moderately-sized {\sc pomdp} s, so a typical alternative approach is to use a \emph{factored} representation~\cite{boyenkoller}. Here, we assume that the state can be decomposed into a set of features, each of which has a value. The factored belief is then a mapping from every feature to a distribution over its value. Typically, one chooses the features carefully so that observations can be \emph{folded}, i.e. incorporated, into the belief efficiently and without too much loss of information. In other words, the chosen distributions are conjugate to the most frequent kinds of observations. Most factored representations are updated \emph{eagerly} (without explicitly remembering the actions and observations) but approximately. On the other hand, a \emph{fully lazy} representation just appends $a$ and $o$ to a list at each timestep. Though belief updates are trivial with this lazy representation, inference can be very expensive. In our work, we will give a representation that is sometimes eager and sometimes lazy, based on how expensive it would be to perform an eager update. Some popular approaches for generating policies in {\sc pomdp} s are online planning~\cite{pomcp,despot,beliefspaceplanning} and finding a policy offline with a point-based solver~\cite{sarsop,pointpomdp}. Our work will use the more efficient but more approximate \emph{determinize-and-replan} approach, which optimistically plans in a determinized version of the environment, brought about by (for instance) assuming that the maximum likelihood observation is always obtained~\cite{plattmlobs,bsptamp}. The agent executes this plan and replans any time it receives an observation contradicting the optimistic assumptions made. \subsection{Factor Graphs} We will be viewing our approach from the perspective of factor graphs, which we briefly describe in this section. We refer the reader to work by Kschischang et al.~\cite{factorgraph} for a more thorough treatment. A \emph{factor graph} is a bipartite undirected probabilistic graphical model containing two types of nodes: \emph{variables} and \emph{factors}. Factor graphs provide a compact representation for the factorization of a function. Suppose a function $f$ on $n$ variables can be decomposed as $f(X_{1}, X_{2}, ..., X_{n}) = \prod_{i=1}^{m}f_{i}(C_{i}),$ where each $C_{i} \subseteq \{X_{1}, X_{2}, ..., X_{n}\}$ is a subset of the variables. This decomposition corresponds to a factor graph in which the variables are the $X_{j}$, the factors are the $f_{i}$, and there is an edge between any $f_{i}$ and $X_{j}$ for which $X_{j} \in C_{i}$, i.e. $f_{i}$ is a function of $X_{j}$. This representation affords efficient marginal inference, which is the process of computing the marginal distribution of a variable, possibly conditioned on the values of some other variables. Message-passing algorithms such as the sum-product algorithm typically compute marginals using dynamic programming to recursively send messages between neighboring nodes. The sum-product algorithm is also commonly referred to as \emph{belief propagation}. \section{Conclusion and Future Work} We have considered the problem of belief state representation in an open-domain planning problem where a human can give relational information to the robot. We showed that a dynamically factored belief is a good representational choice for efficient inference and planning in this setting. One future direction to explore is to approximately fold information into the belief representation rather than compute a joint on every update. We should seek a mechanism that allows the designer to trade off between compactness of the belief and accuracy of inference. Another direction to explore is a non-uniform observation model: a robot given information $I$ can learn something not only from $I$ but also from the fact that it was told $I$ as opposed to anything else. \section{Experiments} We evaluate the performance of our approach on the cooking task, a planning problem from $\Pi$. The robot is tasked with gathering ingredients and using them to cook a meal. There are three object types: $\mathcal{T} = \{$\emph{locations}, \emph{vegetables}, \emph{seasonings}$\}$. The term \emph{ingredients} refers to vegetables and seasonings together. Each object type has one property. Locations have a \emph{contents} property, which is one of ``vegetable,'' ``seasoning,'' or ``empty.'' Ingredients have a \emph{position} property, which could be continuous- or discrete-valued. Initially, the robot knows the set of locations but not the set of ingredients. There is a pot at a fixed, known position. When any vegetable is placed into the pot, it transitions to a \emph{cooking} state; 5 timesteps later, it transitions to a \emph{cooked} state. The goal is to have all ingredients in the pot and all vegetables cooked. However, the robot is penalized heavily for placing any seasoning into the pot too early, before all vegetables have been cooked. To achieve the goal, the robot must learn the positions of all ingredients, either by doing observations or by learning about them from assertions. The operators (actions) $\mathcal{U}$ are: \begin{tightlist} \item \textsc{Observe(location)}: Moves and observes the ingredient(s) at a location. Cost: 5. \item \textsc{Pick(position)}: Moves and picks at a continuous- or discrete-valued position (domain-dependent). The robot can hold up to 10 ingredients at once. Cost: 20. \item \textsc{PlaceInPot()}: Places all $n$ held ingredients into the pot. Vegetables in the pot are either \emph{cooking} or, 5 timesteps later, \emph{cooked}. Cost: 100 + 50$n$, plus an additional 1000 if a seasoning is placed in before all vegetables are cooked. \item \textsc{No-op()}: Takes no action. Cost: 0. \end{tightlist} There is also a living cost of 10 per timestep. The state variables $\mathcal{V}$ comprise each location's contents and each ingredient's position. The world state contains an assignment of these variables to values. It also tracks which ingredients are held by the robot and the pot, and the current robot pose; these are all assumed to be known and thus do not need to be tracked by the belief state. \emph{Assertions.} \figref{fig:assertions} shows the types of assertions we use. At each timestep, we sample an assertion uniformly at random from all valid ones, following our observation model, and give it to the robot. The information could be redundant. \begin{figure}[t] \vspace{0.6em} \centering \noindent \includegraphics[width=\columnwidth]{figures/assertions.jpg} \caption{An illustration of the types of assertions we use, with a simplified execution of the gridworld cooking task. There are four locations: L1, L2, L3, L4. Factors are color-coded based on the number of state variables. c($\cdot$) means \emph{contents($\cdot$)}, p($\cdot$) means \emph{position($\cdot$)}. Initially, there is a singleton factor for each location's contents. The last two columns tell whether the fluent is foldable into a dynamic factoring (our approach), and into a static factoring that tracks the potential contents of each location (baseline). Unfoldable fluents get placed into ComplexFluents, slowing down inference. Observe that singleton factors go in and out of joints.} \label{fig:assertions} \end{figure} \emph{Baseline.} We test against a baseline belief representation that simulates prior work on factored representations, which typically commit to a representational choice at the start. This baseline, which we call a \emph{statically factored belief} or \emph{static factoring}, represents the agent's belief as a distribution over the potential contents of each location. The factoring does not change based on observations, or as ingredients are discovered. We choose this factoring as our baseline because initially, the robot only knows the set of locations, not the set of ingredients. Thus, this factoring is the most reasonable choice for a static representation that is chosen at the start and held fixed throughout execution. Any fluent that cannot fold into this static factoring is lazily placed into ComplexFluents and considered only at query time. \textbf{Domain 1: Discrete 2D Gridworld Cooking Task} \ Our first experimental domain is the cooking task in a 2D gridworld. Locations are organized in a 2D grid, and the robot is in exactly one at any time. Both \textsc{Observe} and \textsc{Pick} actions are performed on single grid locations. Each location is initialized to contain either a single ingredient or nothing, so the \emph{position} property of each ingredient is a discrete value corresponding to a location. We solve the task using the determinize-and-replan approach to belief space planning, with A* as the planner. The task is computationally challenging, so we impose a 60-second timeout per episode. \textbf{Domain 2: Continuous 3D Cooking Task} \ Our second experimental domain is the cooking task in a pybullet simulation~\cite{pybullet}. Here, the \emph{position} property of each ingredient is a continuous value: each can be placed anywhere on the surface of one of four tables. The robot can \textsc{Observe} any table and \textsc{Pick} at any position along a table surface, so the action space is continuous. Locations are given by a grid discretization of the environment geometry. As ingredients get discovered, a dynamically factored belief adapts to track continuous distributions over their positions. Again, we use the determinize-and-replan method and a 60-second timeout. \begin{table}[t] \vspace{0.6em} \centering \resizebox{\columnwidth}{!}{ \tabcolsep=0.08cm{ \begin{tabular}{c|c|c|c|c} \toprule[1.5pt] \textbf{Setting} & \textbf{System} & \textbf{\% Solved} & \textbf{Bel. Upd. Time} & \textbf{Queries / Second}\\ \midrule[2pt] Dom. 1, 4x4, 6ing & S (baseline) & 67 & 0.01 & 0.11\\ \midrule Dom. 1, 4x4, 6ing & D (ours) & \textbf{100} & 0.03 & \textbf{20}\\ \midrule Dom. 1, 4x4, 10ing & S (baseline) & 50 & 0.01 & 0.068\\ \midrule Dom. 1, 4x4, 10ing & D (ours) & \textbf{100} & 0.04 & \textbf{16.7}\\ \midrule[1.5pt] Dom. 1, 5x5, 6ing & S (baseline) & 13 & 0.01 & 0.039\\ \midrule Dom. 1, 5x5, 6ing & D (ours) & \textbf{100} & 0.06 & \textbf{2.27}\\ \midrule Dom. 1, 5x5, 10ing & S (baseline) & 5 & 0.01 & 0.031\\ \midrule Dom. 1, 5x5, 10ing & D (ours) & \textbf{99} & 0.08 & \textbf{2.3}\\ \midrule[1.5pt] Dom. 1, 6x6, 6ing & S (baseline) & 5 & 0.01 & 0.019\\ \midrule Dom. 1, 6x6, 6ing & D (ours) & \textbf{100} & 0.13 & \textbf{1.15}\\ \midrule Dom. 1, 6x6, 10ing & S (baseline) & 5 & 0.01 & 0.028\\ \midrule Dom. 1, 6x6, 10ing & D (ours) & \textbf{97} & 0.23 & \textbf{0.338}\\ \midrule[2pt] Dom. 2, 8ing & S (baseline) & 55 & 0.07 & 0.495\\ \midrule Dom. 2, 8ing & D (ours) & \textbf{100} & 0.11 & \textbf{5.56}\\ \midrule Dom. 2, 10ing & S (baseline) & 48 & 0.07 & 0.287\\ \midrule Dom. 2, 10ing & D (ours) & \textbf{100} & 0.14 & \textbf{4.76}\\ \bottomrule[1.5pt] \end{tabular}}} \caption{Some of our experimental results. Each row reports averages over 100 independent episodes. Percentage of tasks solved within 60-second timeout, belief update time (seconds), and average number of queries answered per second (across solved tasks) are shown. S: Statically factored belief (baseline), D: Dynamically factored belief (our method). \emph{Setting} column gives domain (``Dom. 1'' is gridworld, ``Dom. 2'' is continuous), grid size (if applicable), and number of ingredients. Our approach solves more tasks than a static factoring does, and inference is an order of magnitude faster.} \label{table:results} \end{table} \textbf{Results and Discussion} \ \tabref{table:results} and \figref{fig:results} show results when all $p$ are 1 and $\epsilon$ is 0 (see \algref{alg:subroutines}), while \figref{fig:noisyresults} shows results with noisy observations where $p$ and $\epsilon$ vary. Overall, our approach solves significantly more tasks than a static factoring does, and also does inference an order of magnitude faster. However, our method could perform badly when belief updates are very expensive, which could happen if we try to eagerly incorporate fluents that link several state variables with large domains. Typically in practice, though, such fluents would be placed into ComplexFluents. As $p$ decreases, observations get noisier, so execution costs and factor sizes increase. As $\epsilon$ increases, more marginalization occurs and inference accuracy is lower, so factors are smaller but execution is costlier. \begin{figure}[t] \vspace{0.6em} \centering \noindent \includegraphics[width=0.58\columnwidth]{figures/results_gw10ing_runtimecdf.png} \includegraphics[width=0.4\columnwidth,height=3.7cm]{figures/cooking_cont.png} \caption{\emph{Left:} Cumulative distribution functions showing the percentage of the 100 episodes we ran with our method that got solved within different running times, for the 10-ingredient gridworld. Although our timeout was set to 60 seconds, most tasks were solved within 10 seconds, whereas the baseline (not shown) timed out frequently (see \tabref{table:results}). \emph{Right:} A visualization of the continuous 3D cooking domain. The robot is a light-blue-and-orange arm. Vegetables (red) and seasonings (blue) are placed across four tables.} \label{fig:results} \end{figure} \begin{figure}[t] \centering \noindent \includegraphics[width=0.49\columnwidth]{figures/results_noisy_costvsp.png} \includegraphics[width=0.49\columnwidth]{figures/results_noisy_costvserror.png} \vspace{0.7em} \includegraphics[width=0.49\columnwidth]{figures/results_noisy_factorsizevsp.png} \includegraphics[width=0.49\columnwidth]{figures/results_noisy_factorsizevserror.png} \caption{Results for varying $p$ and $\epsilon$ (see \algref{alg:subroutines}) in our experiments. As $p$ decreases, observations get noisier, so execution costs and factor sizes increase. As $\epsilon$ increases, more marginalization occurs (with reconstruction error) and inference accuracy decreases, so factors are smaller but execution is costlier.} \label{fig:noisyresults} \end{figure} \section{Introduction} As robots become increasingly adept at understanding and manipulating the world around them, it becomes important to enable humans to interact with them to convey goals, give advice, or ask questions. A typical setting is a partially observed environment in which the robot has uncertainty about its surroundings, but a human can give it \emph{information} to help it act more intelligently. This information could represent complex relationships among properties of objects in the world, but the robot would be expected to use it as needed when given a task or query. This setting motivates an important question: what is the best way to represent the robot's internal knowledge so that this information is correctly processed and combined with the robot's own sensory observations? It is important for the chosen representation to be able to accurately and efficiently answer queries (i.e. do inference) that require it to draw on the given information. \begin{figure}[t] \centering \noindent \includegraphics[width=\columnwidth]{figures/teaser.jpg} \caption{A schematic illustration of a dynamically factored belief. The initial belief $B$ tracks distributions over possible values for the locations of two objects. There are three locations in the world (not shown): Loc1 on the left, Loc2 in the middle, and Loc3 on the right. When the agent is given information that the objects are next to each other, the belief is updated to produce $B'$. This is a new factoring in which the two old factors are joined into a single one, corresponding to a distribution over the joint location of both objects. Other factors (not shown) would not be affected.} \label{fig:teaser} \end{figure} We consider a specific class of open-domain planning problems in which objects exist in the world, but the agent does not know the universe of objects. We formalize our setting as a partially observable Markov decision process in which the robot has two sources of (potentially noisy) observations: its own perceptual capabilities, and \emph{assertions} about the environment that simulate the human-provided information and are expressed in formal language. These observations represent constraints that hold with some probability and relate properties of objects in the world. In order to support inference in partially observed environments, one typically maintains a belief state: a probability distribution over the space of world states. Unfortunately, the full joint distribution is usually intractable to work with. A popular alternative approach is to represent a factored belief state, in which the world state is decomposed into a set of features, each with a value. The factored belief is then a mapping from every feature to a distribution over its value. We propose a method for efficient inference using a factored belief state in the presence of potentially complicated assertions relating multiple variables. The typical approach to using a factored belief state involves committing to a (possibly domain-specific) representational choice at the very start~\cite{bonet2014belief,boyenkoller,sallans2000learning}, for which can be difficult to fold in arbitrary relational constraints without too much loss in accuracy. On the other hand, our work treats a factored belief state as a fluid, dynamic data structure in which the factoring itself is molded by the constraints, as suggested by \figref{fig:teaser}. We call this a \emph{dynamically factored belief}. For the class of open-domain planning problems we consider, we show that a dynamically factored belief state representation provides significant improvements in inference time over a fixed factoring. We validate our approach experimentally in two open-domain planning problems: a 2D discrete gridworld task and a 3D continuous cooking task. Visit \texttt{http://tinyurl.com/chitnis-iros-18} for a supplementary video. \section{Related Work} We focus on the setting of \emph{information-giving} for open-domain human-robot collaboration. Information-giving was first explored algorithmically by McCarthy~\cite{programswithcommonsense} in a seminal 1959 paper on advice-takers. Much work in open-domain collaboration focuses on the robot understanding goals given by the human~\cite{talamadupula1}, whereas we focus on understanding information given by the human, as in work on advice-giving~\cite{odom2015learning} and commonsense reasoning~\cite{corpp}. \subsection{Adaptive Belief Representations} Our work explores belief state representations that adapt to the structure of the observations received by the robot. The work perhaps most similar to ours is that of Lison et al.~\cite{beliefsituationaware}, who acknowledge the importance of information fusion and abstraction in uncertain environments. Building on Markov Logic Networks~\cite{mln}, they describe a method for belief refinement that 1) groups percepts likely to be referring to the same object, 2) fuses information about objects based on these percept groups, and 3) dynamically evolves the belief over time by combining it with those in the past and future. They focus on beliefs about each object in the environment, whereas our work focuses on combining information about multiple objects, based on the structure of the observations. The notion of adaptive belief representations has also been explored in domains outside robotics. For instance, Sleep~\cite{adaptivegrid} applies this idea to an acoustic target-tracking setting. The belief representation, which tracks potential locations of targets, can expand to store additional information about the targets that may be important for locating them, such as their acoustic power. The belief can also contract to remove information that is deemed no longer necessary. It would be difficult to update this factoring with information linking multiple targets, whereas our method is well-suited to incorporating such relational constraints. \subsection{Factored Belief Representations for {\sc pomdp} s} The more general problem of finding efficient belief representations for {\sc pomdp} s is very well-studied. Boyen and Koller~\cite{boyenkoller} were the first to provide a tractable method for belief propagation and inference in a hidden Markov model or dynamic Bayesian network. Their basic strategy is to first pick a computationally tractable approximate belief representation (such as a factored one), then after a belief update, fold the newly obtained belief into the chosen approximate representation. This technique is a specific application of the more general principle of \emph{assumed density filtering}~\cite{maybeck1982stochastic}. Although it seems that the approximation error will build up and propagate, the authors show that actually, the error remains bounded under reasonable assumptions. Our work adopts a fluid notion of a factored belief representation, not committing to one factoring. Bonet and Geffner~\cite{bonet2014belief} introduce the idea of beam tracking for belief tracking in a {\sc pomdp}. Their method leverages the fact that a problem can be decomposed into projected subproblems, allowing the joint distribution over state variables to be represented as a product over factors. Then, the authors introduce an alternative decomposition over beams, subsets of variables that are causally relevant to each observable variable. This work shares with ours the idea of having the structure of the belief representation not be fixed ahead of time. A difference, however, is that the decomposition used in beam tracking is informed by the structure of the underlying model, while ours is informed by the structure of the observations and can thus efficiently incorporate arbitrary relational constraints on the world state. \section*{Acknowledgments} We gratefully acknowledge support from NSF grants 1420316, 1523767, and 1723381; from AFOSR grant FA9550-17-1-0165; from Honda Research; and from Draper Laboratory. Rohan is supported by an NSF Graduate Research Fellowship. Any opinions, findings, and conclusions expressed in this material are those of the authors and do not necessarily reflect the views of our sponsors.
{'timestamp': '2018-07-31T02:20:34', 'yymm': '1803', 'arxiv_id': '1803.00119', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00119'}
arxiv
\section{Introduction} \label{Intr} Recently there are increasing interests in using ensembles of \textit{Deep Neural Networks} (DNNs) (\citet{ju2017relative,huang2017snapshot}), which are known to be more robust and accurate than individual networks. An explanation stems from the fact that learning neural networks is an optimization problem with many local minima (\cite{hansen1990neural}). Multiple models obtained from applying stochastic optimization, e.g. the widely used Stochastic Gradient Descent (SGD) and its variants, converge to different local minima and tend to make different errors. Due to this diversity, the collective prediction produced by an ensemble is less likely to be in error than individual predictions. The collective prediction is usually performed by averaging the predictions of the multiple neural networks. On the other hand, the improved prediction accuracy of such model averaging can be understood from the principled perspective of Bayesian inference with Bayesian neural networks. Specifically, for each test point $\tilde{x}$, we consider the predictive distribution $P(\tilde{\mathnormal{y}}|\tilde{x},\mathcal{D}) = \int P(\tilde{\mathnormal{y}}|\tilde{x},\theta) P(\theta|\mathcal{D})d\theta $, by integrating the model distribution $P(\tilde{\mathnormal{y}}|\tilde{x},\theta)$ with the posterior distribution over the model parameters $ P(\theta|\mathcal{D})$ given training data $\mathcal{D}$. The predictive distribution is then approximated by Monte Carlo integration $ P(\tilde{\mathnormal{y}}|\tilde{x},\mathcal{D}) \approx \frac{1}{M} \sum_{m=1}^{M} P(\tilde{\mathnormal{y}}|\tilde{x},\theta^{(m)}) $ , where $\theta^{(m)} \thicksim P(\theta|\mathcal{D}), m=1,\cdots,M$, are posterior samples of model parameters. It is well known that such Bayesian model averaging is more accurate in prediction and robust to over-fitting than point estimates of model parameters (\citet{balan2015bayesian,li2016preconditioned,gan2016scalable}). Despite the obvious advantages as seen from both perspectives, a practical problem that hinders the use of DNN ensembles in real-world tasks is that an ensemble requires too much computation in both training and testing. Traditionally, multiple neural networks are trained, e.g. with different random initialization of model parameters. Recent studies in (\citet{loshchilov2016sgdr,huang2017snapshot}) propose to learn an ensemble which consists of multiple snapshot models along the optimization path within a single training process, by leveraging a special cyclic learning rate schedule. This reduces the training cost, but the testing cost is still high. In this paper we also aim at learning an ensemble within a single training process, but by leveraging the recent progress in Bayesian posterior sampling, namely the \textit{Stochastic Gradient Markov Chain Monte Carlo} (SG-MCMC) algorithms. Moreover, we apply group sparse priors in training to enforce group-level sparsity on the network's connections. Subsequently we can further use model pruning to compress the networks so that the testing cost is reduced with no loss of accuracy. Figure \ref{procedure} presents a high-level overview of our two-stage method to learn Sparse Structured Ensembles (SSEs) for DNNs. Specifically, in the first stage, we run SG-MCMC with group sparse priors to draw an ensemble of samples from the posterior distribution of network parameters. In the second stage, we apply weight-pruning to each sampled network and then perform retraining over the remained connections as fine-tuning. In this way of learning SSEs with SG-MCMC and pruning, we reduce memory and computation cost significantly in both training and testing of NN ensembles, while maintaining high prediction accuracy. This is empirically verified in our experiments of learning SSE ensembles of both FNNs and LSTMs. We evaluate the performance of the proposed method on two experiments with different types of neural networks. The first is an image classification experiment, which uses \textit{Feed-forward Neural Networks} (FNNs) on the well-known MNIST dataset (\citet{deng2012mnist}). Second, we experiment with the more challenging task of \textit{Long Short-term Memory} (LSTM, \citet{hochreiter1997long}) based language modeling, which is conducted on the Penn Treebank dataset (\citet{marcus1993building}). It is found that the proposed method works well across both tasks. For example, we obtain 12\% relative reduction (from 78.4 to 68.6) in LM perplexity by learning a SSE of 4 large LSTM models, which has only 40\% of model parameters and 90\% of computations in total, as compared to the large LSTM LM in \citet{zaremba2014recurrent}. Furthermore, when the embedding weights of input and output are shared (\citet{inan2016tying, E17-2025}), we obtain a perplexity of 62.1 (achieving 21\% reduction from 78.4) by 4 large LSTMs with only 30\% of model parameters and 70\% of computations in total. \begin{figure}[t] \begin{center} \includegraphics[width=1.0\linewidth]{procedure} \end{center} \caption{Overview of our two-stage method for learning SSEs.} \label{procedure} \end{figure} \section{Related Work} \label{re_work} This work draws inspiration from three recent research findings, namely running SG-MCMC for efficient and scalable Bayesian posteriori sampling, applying group sparse priors to enforce network sparsity, and network pruning. To the best of our knowledge, this work represents the first methodology and empirical study of integrating these three techniques and demonstrates its usefulness to learning and using ensembles. In the following, more discussions are given on related studies. \textbf{SG-MCMC sampling:} SG-MCMC represents a family of MCMC sampling algorithms developed in recent years, e.g. \textit{Stochastic Gradient Langevin Dynamics} (SGLD) (\citet{welling2011bayesian}, \textit{Stochastic Gradient Hamiltonian Monte Carlo} (SGHMC) \citet{chen2014stochastic}, mainly for Bayesian learning from large scale datasets. SG-MCMC has the following favorable properties for learning ensembles. \textit{(i)} SG-MCMC works by adding a scaled gradient noise during training, and thus enhances exploration of the model-parameter space. This is beneficial for finding diverse sample models for ensembles. \textit{(ii)} Scalable and simple: the basic SG-MCMC algorithm, e.g. SGLD, is just a noisy \textit{Stochastic Gradient Descent} (SGD), which means the same training cost as SGD on large datasets. The effectiveness of applying SG-MCMC to Bayesian learning of RNNs is shown in \cite{gan2016scalable} but without considering model pruning \zyc{to reduce the cost of model averaging}. \textbf{Sparse structure learning:} Group Lasso penalty (\citet{yuan2006model}) has been widely used to regularize likelihood function to learn sparse structures. \ozj{It was applied with SGD in (\cite{wen2016learning,alvarez2016learning}) and in \citet{wen2017learning} to learn structurally sparse DNNs and LSTMs respectively. But all focus on point estimates and are not in the context of learning ensembles.} Group Lasso idea has been studied in Bayesian learning, which is known as applying group sparse priors (\citet{marlin2009group,babacan2014bayesian}); but these previous works use variational method. Applying group sparse priors with SG-MCMC has not been explored. \textbf{Model compression:} Model pruning and retraining (\citet{han2015deep}, \citet{hu2016network}) has been studied to compress CNNs. Recently, \citet{han2017ese} and \citet{narang2017exploring} apply model pruning to LSTM models for automatic speech recognition task. We use similar model pruning and retraining method in the experiments. We find that model averaging can enable the ensemble with heavily-pruned networks to be more robust in prediction. \textbf{Learning ensembles:} Some efforts have been made to reduce the training and testing cost for ensembles. For reducing the training time cost of ensembles, a special cyclic learning rate schedule is developed in (\citet{loshchilov2016sgdr,huang2017snapshot}), which restarts the learning rate periodically to attempt to visit multiple local minima along its optimization path and saves snapshot models. In contrast to relying on such empirical setting of the learning rate to explore model space, theoretical consistency properties of SG-MCMC methods in posterior sampling have been established (\citet{teh2016consistency}). For reducing the testing time cost of ensembles, \citet{hinton2015distilling} and \citet{balan2015bayesian} distill the β€œknowledge” of an ensemble into a single model, but still require large training cost. \section{Learning ensembles with SG-MCMC and network pruning} \label{learning} We consider the classification problem under Bayesian inference framework. Given training data $ \mathcal{D} \triangleq \{(x_i,\mathnormal{y}_{i})\}_{i=1}^N $ with input feature $ x_{i} \in \mathbb{R}^{D} $ and class label $ \mathnormal{y}_{i} \in \mathcal{Y} $, where $\mathcal{Y}$ is the set of classes. We view a neural network as a conditional probabilistic model $P(\mathnormal{y}_i|x_i,\theta)$. Denote the network parameters by $\theta$, with $ P(\theta) $ a prior distribution. We compute the posterior distribution over the model parameters, $ P(\theta|\mathcal{D}) \propto P(\theta) \prod_{i=1}^{N}P(\mathnormal{y}_i|x_i,\theta) $. For testing, given a test input $ \tilde{x} $, the Bayesian predictive distribution for its label $ \tilde{\mathnormal{y}} $ is given by $ P(\tilde{\mathnormal{y}}|\tilde{x},\mathcal{D}) = \mathbb{E}_{P(\theta|\mathcal{D})} [P(\tilde{\mathnormal{y}}|\tilde{x},\theta)] $ , which can be viewed as model averaging across parameters with distribution $ P(\theta|\mathcal{D}) $. However, the integration over the posterior is analytically intractable for deep neural networks (DNNs). Thus it is approximated by Monte Carlo integration as in the following: \begin{equation} \label{eq1} P(\tilde{\mathnormal{y}}|\tilde{x},\mathcal{D}) \approx \frac{1}{M} \sum_{m=1}^{M} P(\tilde{\mathnormal{y}}|\tilde{x},\theta^{(m)}) ,\quad \theta^{(m)} \thicksim P(\theta|\mathcal{D}) \end{equation} where $ \{\theta^{(m)}\}_{m=1}^M $ is a set of posterior samples drawn from $ P(\theta|\mathcal{D}) $, e.g. by the popular Markov Chain Monte Carlo (MCMC) methods. Traditional MCMC methods either have low-efficiency for high dimensional sampling or scale poorly with dataset. Fortunately, the recently developed SG-MCMC methods work on stochastic gradients over small mini-batches, which alleviate these problems and can be applied for posterior sampling for DNNs. \subsection{Sampling via Stochastic Gradient Langevin Dynamics} \label{SGLD} Specifically, we choose the simplest and most widely used SG-MCMC algorithm - \textit{Stochastic Gradient Langevin Dynamics} (SGLD) (\citet{welling2011bayesian}) as the sampling method in our first stage of learning ensembles. Extension by using other high-order SG-MCMC algorithms is straightforward. SGLD calculates a stochastic gradient of negative log posterior based on $ S_t $, small mini-batch of training data: \begin{equation} \label{eq2} \widetilde{g}_t \triangleq \nabla_{\theta}\widetilde{U}_t(\theta) = -\frac{N}{|S_t|}\sum_{i\in S_t}\nabla_{\theta}\log P(\mathnormal{y}_i|x_i, \theta) -\nabla_{\theta}\log P(\theta) \end{equation} where $ U(\theta) \triangleq -\log P(\mathcal{D}|\theta) -\log P(\theta) $ is known as the potential energy in SG-MCMC sampling and $ \widetilde{U}_t(\theta) $ is its approxmation over the $ t $-th mini-batch. The updating rule of SGLD is as simple as SGD with an additional Gaussian noise $ \xi\thicksim\mathcal{N}(0,\epsilon_t\rm{I}) $ as following: \begin{equation} \label{eq3} \theta_{t+1} = \theta_{t} - \frac{\epsilon_t}{2}\widetilde{g}_t +\xi \end{equation} where $ \epsilon_t $ is the learning rate or step size. By using gradient information and stochastic mini-batch updating, SGLD overcomes the problems in traditional MCMC methods and thus leads to efficient posterior sampling. In the following, we provide three discussions about applying SGLD to learning ensembles. First, note that SGLD is proposed with the use of annealing learning rates since SGLD does not have a Metropolis-Hastings correction step; discretization error goes to zero only when learning rates annealed to zero. In spite of that, some studies suggest to use constant learning rates in practice (\citet{sato2014approximation}, \citet{chaudhari2016entropy}), which is found to give better mixing rate and make more extensive exploration of parameter space. This is also compatible with our aim of learning a good ensemble, since we want to collect diverse models. We test both annealing and constant learning rates in our experiments and find that using constant learning rates performs better, as expected. Hence, we only report the results of using constants learning rate in this work. Second, we need to consider how to sample $ \theta $ from the parameter updating sequence $ \{\theta_t\}_{t=1}^T $, where $ T $ is the total number of iterations. Firstly, a burn-in process is desired. Secondly, a thinned collection of samples $ \{\theta_{\frac{kT}{M}}\}_{k=1}^M $ performs better than other strategies like backward collection $ \{\theta_t\}_{t=T-M+1}^T $, since there are lower correlations between samples. Our preliminary results as well as the results from \citet{gan2016scalable} both hold for that, so we take thinned collection as the default setting in this work. Finally, we need to consider how long to run the sampling algorithm and how many models are used for model averaging. The fixed-scale additional noise in SGLD generally reduces overfitting, thus longer running can be allowed in order to better explore the parameter space. As shown by the empirical result in Fig. \ref{pplvsnum}, the SGLD learning method indeed can improve performance by averaging more models than other traditional methods of learning ensembles. \subsection{Pruning and Retraining} \label{PR} After all the models are collected, we come to the second stage of learning DNN ensembles - network pruning and retraining. We use a simple pruning rule, i.e. finding the network connections whose weights are below certain threshold and removing them away, as did in (\citet{han2015learning}). The threshold is determined by the configured overall sparsity or pruning ratio, e.g. 90\%, after sorting the weights by their absolute values. Once the network is pruned, the posterior changes from $ P(\theta|\mathcal{D}) $ to the reduced posterior $ Q^{(m)}(\phi^{(m)}|\mathcal{D}) $, where $ m $ is the index of the pruned network. Retraining is then performed for each pruned network: \begin{equation} \label{eq4} \hat{\phi}^{(m)} = \arg \max_{\phi^{(m)}} \log Q^{(m)}(\phi^{(m)}|\mathcal{D}), \quad m=1,2,\ldots,M \end{equation} We thus obtain an ensemble of networks $ \{\hat{\phi}^{(m)}\}_{m=1}^M $, which are in fact maximum a posterior (MAP) estimates under the reduced posteriors. The effect of pruning is to reduce the model size as well as the computation cost. Interestingly, it is found in our experiments that retraining of the sampled models, whether being pruned or not, significantly improve the performance of the ensemble. \ozj{There are two justifications for the retraining phase. First, theoretically (namely with infinite samples), model averaging according to Equ. (\ref{eq1}) does not need retraining. However, the actual number of samples used in practice is rather small for computational efficiency. So retraining essentially compensates for the limited size of samples for model averaging.} Second, if we denote by $\bar{\phi}^{(m)}$ the network obtained just after pruning but before retraining, it can be seen that the MAP estimate $\hat{\phi}^{(m)}$ is more likely than $\bar{\phi}^{(m)}$ under the reduced posterior. Note that the probability of $\bar{\phi}^{(m)}$ under the reduced posterior is close to the probability of $\bar{\phi}^{(m)}$ under the original posterior, since we only prune small network weights. So retraining increases the posteriori probabilities of the networks in the ensemble and hopefully improves the prediction performance of the networks in the ensemble. \section{Sparse Structured Ensembles} \label{SSE} The main computation for training or testing a DNN is the large amount of matrix calculations, which are commonly accelerated by using a GPU hardware. However, a randomly pruned network is not friendly for GPUs to handle, since the randomly positioned zeros in the weight matrices still require \textit{floating-point operations} (FLOPs) without special treatment. In our \textit{Sparse Structured Ensembles} (SSEs), we take this into consideration and aim at learning structures for reducing FLOPs in the sense of matrix calculations. \subsection{Group Sparse Prior} \label{GSP} In optimization, a regularization term is often used as a penalty to the objective function to do trade-off between minimizing a loss function and choosing a desirable model with certain constraints. The group Lasso regularization \citet{yuan2006model} proposes to do feature selection in group level, which means keeping or removing all the parameters in a group simultaneously to achieve structured sparsity corresponding to grouping strategy. It can be formulated as: \begin{equation} \label{eq5} R(\theta) = \lambda\sum_{g=1}^{G} \sqrt{dim({\theta}_g)}\ \big\Vert \theta_g \big\Vert_{2} \end{equation} where $ \theta_g $ is a group of weights in $ \theta $, $ G $ is the number of groups, $dim({\theta}_g)$ denotes the number of weights in $\theta_g$ and $ \Vert \cdot \Vert_2 $ denotes the $ l_2 $ norm. The term $ \sqrt{dim({\theta}_g)} $ ensures that each group gets regularized uniformly corresponding to its dimension. The coefficient $ \lambda $, called GSP strength coefficient, is a hyperparameter to do trade off between gaining group sparsity and minimizing the loss function. While in training, the gradient of each component can be calculated by \begin{equation} \label{eq6} \frac{\partial\sqrt{dim({\theta}_g)}\ \big\Vert \theta_g \big\Vert_{2}}{\partial\theta_g} = \sqrt{dim({\theta}_g)}\frac{\theta_g}{\Vert \theta_g \Vert_2} \end{equation} A small constant could be added to $ \Vert{\theta}_g \Vert_2 $ in order to avoid the denominator being zero. In our experiments, we find $ \Vert \theta_g \Vert_2 $ fluctuate near zero and thus do not add the constant. In Bayesian inference framework, the regularization term corresponds to the negative log prior term $ -\log P({\theta}) $ in the potential energy $ U({\theta}) $, thus the group Lasso regularization can be converted into a specific prior as follows: \begin{equation} \label{eq7} P({\theta}) = \frac{1}{Z}\exp(-R({\theta})) = \frac{1}{Z}\exp(-\lambda\sum_{g=1}^{G} \sqrt{dim({\theta}_g)}\ \big\Vert {\theta}_g \big\Vert_{2}) \end{equation} where $ Z $ is a normalization constant. The gradient term $ -\nabla_{{\theta}}\log P({\theta}) $ in Equ. (\ref{eq2}) for SGLD parameter updating can be directly calculated via Equ. (\ref{eq7}), without the use of complex hierarchical decomposition form for the prior as the variational methods do (\citet{marlin2009group,babacan2014bayesian}). We call it a \textit{Group Sparse Prior} (GSP) as named in \citet{marlin2009group}. \subsection{Grouping Strategies} \label{GS} To learn sparse structured networks for our SSE, it is necessary to specify grouping strategy according to the characteristics of different types of neural networks. In this paper, we show how to learn SSE for both FNN and LSTM. Their grouping strategies are described separately in the following. \textbf{Feed-forward Neural Network:} For FNN, we group all the outgoing connections from a single neuron (input or hidden) together following \citet{scardapane2017group}. Since FNN's simple hierarchical structure, if a neuron's outputs are all zeros, it makes no contribution to the next layer and can be removed. This leads to node pruning instead of random connection pruning, which reduces the rows and columns of weight matrices between layers, thus leading to lower matrix-level FLOPs as expected. We can also group the incoming connections of a neuron, but the neurons with no incoming weights are still required to shift their biases to the next layer, which is a bit more complex than the above strategy we choose. \textbf{Long Short-term Memory:} The case is not that simple for LSTM, since the input and hidden units are used four times when calculating the input gate, forget gate, cell updates and output gate as follows: \begin{equation} \label{eq8} \begin{aligned} &\bm{f}_t = \sigma([\bm{x}_t, \bm{h}_{t-1}]W_f+\bm{b}_f)& &\bm{i}_t = \sigma([\bm{x}_t, \bm{h}_{t-1}]W_i+\bm{b}_i) \\ &\bm{u}_t = \tanh([\bm{x}_t, \bm{h}_{t-1}]W_u+\bm{b}_c) & &\bm{o}_t = \sigma([\bm{x}_t, \bm{h}_{t-1}]W_o+\bm{b}_o) \\ &\bm{c}_t=\bm{f}_t\odot\bm{c}_{t-1}+\bm{i}_t\odot\bm{u}_t & &\bm{h}_t=\bm{o}_t\odot\tanh(\bm{c}_t) \end{aligned} \end{equation} where all the vectors are row vectors, $ \sigma(\cdot) $ is the sigmoid function, $ [\cdot,\cdot] $ denotes concatenating horizontally and $ \odot $ is element-wise multiplication. Removing an input or hidden unit is difficult for LSTM since every unit affects all the updating steps. However, note that the weight matrix between units and each gate is fully-connected, it is still beneficial to reduce the matrix size by removing a row or column. Specifically, we keep two index lists during pruning to record the remained rows and columns for each weight matrix. When doing computations, we just use partial units to update partial dimensions of the gates according to the index lists. This is flexible for different units to provide updating for different gate dimensions. \begin{figure}[t] \begin{center} \subfigure[Untied strategy] { \label{untied} \includegraphics[width=0.57\linewidth]{untied} } \subfigure[Tied W strategy] { \label{tied} \includegraphics[width=0.39\linewidth]{tied} } \vskip\baselineskip \subfigure[ISS strategy] { \label{ISS} \includegraphics[width=0.99\linewidth]{ISS} } \end{center} \caption{Illustration of different grouping strategies for LSTMs. In figure (a) and (b), the black lines in each weight matrix represent non-zero elements and the yellow areas are rows and columns with all zeros, as a result of group selection enforced by GSP. The horizontal arrows indicate the input and hidden units used in calculations, and the vertical arrows point to those dimensions of a gate to be updated. Thus it is enough to do calculations by the reduced matrix formed by these black rows and columns in the figure instead of the whole matrix. In figure (c), the dash white lines separate each weight matrix of tied W matrix. Yellow lines indicate the weights associated with a certain hidden unit in LSTM layer $ l $, which are removed simultaneously to reduce the hidden size of $ h^{(l)} $.} \label{group} \end{figure} Thus, our first grouping strategy is to group each row and each column for the four weight matrices separately in Equ. (\ref{eq8}). Note that the group sparse prior generally selects or removes a certain group, it is allowed to make groups overlapped for reducing matrix size. We consider this untied strategy since the most basic implementation of LSTM cell conducts calculation as in Equ. (\ref{eq8}). Alternatively, the LSTM updating formulas can be written as in \citet{gal2016theoretically}: \begin{equation} \label{eq9} \left( \begin{array}{c} \bm{i}_t \\\bm{u}_t \\\bm{f}_t\\\bm{o}_t \end{array} \right) =\left( \begin{array}{c} \sigma\\\tanh \\ \sigma\\ \sigma \end{array} \right) \left(\left(\begin{array}{c} \bm{x}_t\\ \bm{h}_{t-1} \end{array} \right)\cdot W\right) \end{equation} where $ W $ is a matrix of dimension $ 2n $ by $ 4n $ ($ n $ being the unit number for a hidden state), which is the horizontally concatenation of the four weight matrices in Equ. (\ref{eq8}). Since acceleration has been reported by concatenating matrix (\citet{appleyard2016optimizing}), we also try to group each row and column of $ W $ as a second grouping strategy. This strategy is simpler since only two index lists are kept instead of eight, and we call it \textit{tied W} strategy. \ozj{ In a concurrent work of learning structurally sparse LSTMs \citet{wen2017learning} using SGD, a grouping strategy, called \textit{Intrinsic Sparse Structures} (ISS), is proposed to reduce the hidden size by grouping all the weights associated with a certain hidden unit together and removing them simultaneously. LSTMs learned by ISS can be reconstructed easily with the pruned smaller hidden size, without the need to keep original model size and index lists. However, the embedding size is not reduced in (\citet{wen2017learning}), which leads to high cost in computing the input for the 1st LSTM layer. To overcome this, there are two schemes. (a) Each column of the input embedding matrix is grouped to further reduce the input size of the 1st LSTM layer; (b) The weights from the embedding layer and the softmax layer are shared, as proposed in \citet{inan2016tying}, thus the embedding size is the same as hidden size of the last LSTM layer. } An illustration of these strategies are shown in Fig. \ref{ISS}. \section{Experiments} In our experiments, we implemented the proposed method in TensorFlow, and present the results in two parts: \textit{(i)} learn SSE of FNNs for image classification task on MNIST; \textit{(ii)} learn SSE of LSTM models, \ozj{which is more challenging}, for word-level language modeling task on Penn TreeBank corpus. The sparsity of a network in this paper means the percentage of the pruned weights from the total parameters, FLOPs for a matrix $W$ is calculated as the size of the smallest sub-matrix formed by such rows and columns in $W$ that contain all non-zero elements in $W$, and FLOPs for a network is the sum of FLOPs for all its weight matrices. The parameters and FLOPs presented in the following tables are the total size considering all the models in an ensemble, unless otherwise indicated. PR, GSP and SSE denotes Pruning and Retraining, Group Sparse Prior and Sparse Structured Ensemble respectively. \subsection{Classification on MNIST} First we use our method on FNNs for classification on the well-known MNIST dataset. We choose a commonly used network structure of 2 hidden layers with 300 and 100 hidden neurons respectively and ReLU activations, denoted as FNN-784-300-100-10. We run our experiments without any additional tricks such as dropout, batch normalization etc. \ozj{Such basic setting allows easy reproduction of the results.} All the results reported in table \ref{MNIST} are averaged results from 10 independent runs. The detailed model structure information for one arbitrary model taken is shown in table \ref{FNN_SSE}. The baseline FNN-784-300-100-10 is trained by Stochastic Gradient Descent (SGD). Specifically it is trained for 100 epochs with an annealing learning rate of 0.5 which decays by a factor of 2 every 10 epoch. The baseline obtains 1.66\% test error rate, and an ensemble of 18 independently trained FNN-784-300-100-10 networks decrease the error to 1.49\%. In the first group of experiments with SGLD learning, we use Laplace priors, similar to adding L1 regularization. We train also for 100 epochs but with a constant learning rate of 0.5. Network samples are collected every 5 epoch after a 10 epoch burn in. The ensemble learned by SGLD gives 1.53\% test error, which is slightly worse than the independently trained ensemble, since each sample drawn by constant-step-size SGLD sampling is not as accurate as the sample trained through SGD optimization. Adding L1 could enforce sparse structure learning and allows us to prune the network weights. After pruning, we retrain each network in the ensemble for 20 epochs with a small learning rate of 0.01 which decay by factor 1.15 every epoch. The resulting ensembles are denoted by SGLD+L1+PR in Table \ref{MNIST}. For these ensembles, the highest sparsity without losing accuracy is 90\%. When 96\% of the parameters are pruned, the performance is worsened obviously. \begin{table}[t] \caption{MNIST results of various models based on FNN-784-300-100-10. The number of parameters and FLOPs are shown as multiples of the baseline FNN trained by SGD, the specifics of which are shown in parentheses. PR: Pruning and Retraining, GSP: Group Sparse Prior.} \label{MNIST} \begin{center} \begin{tabular}{llccc} \toprule \multicolumn{1}{c}{Method} &\multicolumn{1}{c}{Model} &\multicolumn{1}{c}{Parameters} &\multicolumn{1}{c}{FLOPs} &\multicolumn{1}{c}{Test Error (\%)} \\ \toprule SGD (baseline) &1 model &1 (266K) &1 (532K) &1.66 \\ SGD &18 models &18$ \times $ &18$ \times $ &1.49 \\ \midrule SGLD &18 models &18$ \times $ &18$ \times $ &1.53 \\ SGLD+L1+PR &18 models, 90\% sparsity &1.8$ \times $ &3.4$ \times $ &1.26 \\ SGLD+L1+PR &18 models, 96\% sparsity &0.7$ \times $ &3.0$ \times $ &1.39 \\ \midrule SGLD+GSP+PR &18 models, 90\% sparsity &1.8$ \times $ &2.5$ \times $ &\bf1.26 \\ SGLD+GSP+PR &18 models, 96\% sparsity &\bf0.7$ \times $ &\bf2.2$ \times $ &1.29 \\ \bottomrule \end{tabular} \end{center} \end{table} \begin{table}[t] \caption{Detailed structure information of various FNN ensembles based on FNN-784-300-100-10 for MNIST.} \label{FNN_SSE} \begin{center} \begin{tabular}{ccccc} \toprule \multicolumn{1}{c}{Model} &\multicolumn{1}{c}{Sparsity} &\multicolumn{1}{c}{Parameters} &\multicolumn{1}{c}{Network structure} &\multicolumn{1}{c}{FLOPs} \\ \toprule SGLD 18 models & - & 266K & 784-300-100-10 & 532K \\ SGLD+GSP+PR 18 models & 90\% &27K &380-128-24-10 &75K (14\%) \\ SGLD+GSP+PR 18 models & 96\% &11K &364-82-22-10 &64K (12\%) \\ \bottomrule \end{tabular} \end{center} \end{table} In the second group of experiments with SGLD learning, our new method, SGLD with group sparse prior (GSP) is applied. The resulting ensembles are denoted by SGLD+GSP+PR in Table \ref{MNIST}. \ozj{ When compared to SGLD+L1+PR, the new method achieves larger sparsity (up to 96\%) and FLOP reduction without losing accuracy, presumably because applying GSP forces the pruned connections to be aligned, thus removes more neurons. When compared to the baseline FNN, the SSE of 18 networks learned by the new method decreases test error from 1.66\% to 1.29\% with 70\% of parameters and $ 2.2\times $ computational cost.} \subsection{Language Modeling} Next, we experiment with the more challenging task of learning ensembles of LSTMs, which represent a widely used type of recurrent neural networks (RNNs) for sequence learning tasks. Specifically, we study the task of LSTM-based language modeling (LM), which basically is to predict the next word given previous words. The prediction performance is measured by perplexity (PPL), which is defined as the exponential of negative log-probability per token. A popular LM benchmarking dataset - Penn TreeBank (PTB) corpus (\citet{marcus1993building}) is used, with a vocabulary of 10K words and 929K/73K/10K words in training, development and test sets respectively. We use \citet{zaremba2014recurrent} as the baseline and follow their LSTM architectures to make comparable results. We test different methods on the medium (2 layers with 650 hidden units each) and large (2 layers with 1500 hidden units each) LSTM models as used in \citet{zaremba2014recurrent}. The dimension of word embedding as input is the same as the size of hidden units. All the models are trained with the dropout technique introduced in \citet{zaremba2014recurrent}. The experiments without GSP just follow their dropout keep ratio which are 0.5 and 0.35 for medium and large model respectively. It is found in our experiments that when applying GSP, a higher dropout keep ratio is desired, which are 0.7 for medium and 0.5 for large model. This is presumably because that both GSP and dropout are some form of regularization and regularizing too much will lead to underfitting. For both untied and tied cases of LSTM weight matrices, the GSP strength coefficients are $ \lambda=4.2\times10^{-5} $ and $ \lambda=2.3\times10^{-5} $ respectively for medium and large model; \zyc{for the ISS case, the GSP strength coefficients are $ \lambda=3.0\times10^{-5} $ and $ \lambda=1.5\times10^{-5} $ respectively.} For both medium and large models, the learning rates are fixed to 1.5 and 1.0 respectively for SGLD training, and decay by a factor of 1.25 for retraining by SGD. All the hyperparameter settings above are found empirically via grid search on the validation set. The results are organized into four parts. (1) For ablation analysis, we study the contribution of each component in the new method SGLD+GSP+PR through a series of comparison experiments, as shown in Table \ref{PTB_medium}. (2) We show the effects of the number of model samples and sampling strategies for the method SGLD+GSP+PR, as given in Fig. \ref{curves}. (3) We display in Fig. \ref{pattern} the sparse structures, obtained from applying the method SGLD+GSP+PR. (4) Main results are summarized and compared in Table \ref{PTB_best}. \begin{table}[t] \caption{ Model ablations for the new method SGLD+GSP+PR based on the medium LSTM LMs over PTB. The column of single model denotes the lowest PPL obtained by a single model in the ensemble. The number of parameters and FLOPs are shown as multiples of the baseline medium LSTM trained by SGD, the specifics of which are shown in parentheses. \zyc{The grouping strategy is the untied weight strategy by default, unless specified in parentheses. Tied W denotes tied weight strategy and ISS denotes \textit{Intrinsic Sparse Structures} as in \citet{wen2017learning}}} \label{PTB_medium} \begin{center} \begin{tabular}{lccccccc} \toprule \multicolumn{1}{c}{\multirow{3}*{Method}} &\multicolumn{1}{c}{\multirow{3}*{Model}} &\multicolumn{1}{c}{\multirow{3}*{Parameters}} &\multicolumn{1}{c}{\multirow{3}*{FLOPs}} &\multicolumn{2}{c}{Single model} &\multicolumn{2}{c}{Ensemble}\\ \cmidrule{5-8} &&&&Dev. &Test &Dev. &Test \\ \toprule SGD (Zaremba, 2014) &1 &1 (19.8M) &1 (26.5M) &86.2 &82.1 &- &-\\ SGD (Zaremba, 2014) &10 &10$\times$ &10$\times$ &- &- &75.2 &72.0\\ \midrule SGLD &10 &10$\times$ &10$\times$ &87.0 &83.7 &80.5 &78.9 \\ SGLD+PR &10 &1$\times$ &10$\times$ &103.8 &100.2 &91.1 &89.4\\ SGLD+GSP &10 &10$\times$ &10$\times$ &98.8 &97.0 &88.0 &86.9\\ SGLD+GSP+R &10 &10$\times$ &10$\times$ &80.0 &76.3 &70.8 &69.1\\ SGLD+GSP+P &10 &1$\times$ &4$\times$ &103.8 &101.9 &96.1 &94.7\\ SGLD+GSP+PR &10 &1$\times$ &4$\times$ &79.8 &76.6 &71.5 &69.5\\ SGLD+GSP+PR (tied W) &10 &1$\times$ &4$\times$ &79.7 &76.6 &70.9 &69.2\\ \zyc{SGLD+GSP+PR (ISS)} &10 &1$\times$ &3$\times$ &80.9 &77.4 &71.8 &69.9\\ \bottomrule \end{tabular} \end{center} \end{table} \begin{figure}[t] \begin{center} \subfigure[] { \label{training} \includegraphics[width=0.45\linewidth]{training_curve.eps} } \subfigure[] { \label{pplvsnum} \includegraphics[width=0.45\linewidth]{ppl_vs_m_num.eps} } \end{center} \caption{(a) The PPL curves along the learning of LSTM ensemble by SGLD+GSP+PR over the PTB development set. \ozj{It is worthwhile to note that as the training proceeds, more models are averaged, which consistently improves the PPLs.} (b) The PPLs over development set v.s. the number of models in the LSTM ensembles by SGLD+GSP+PR.} \label{curves} \end{figure} Table \ref{PTB_medium} lists the model ablation results of SGLD training with different combinations of pruning, retraining and GSP (untied grouping strategy as default). It is found that applying PR or GSP alone lead to worse performance than vanilla SGLD for learning LSTM ensembles. When they are applied together, GSP forces the network to learn group sparse structures which are highly robust to pruning, thus leading to a better result. \ozj{With GSP}, applying pruning only leads to negligible loss of performance but greatly reduces the model size, as can been seen from comparing SGLD+GSP+PR with SGLD+GSP+R; pruning without retraining produces inferior result. \zyc{The three grouping strategies perform close to each other.} Remarkably, compared to the medium LSTM ensemble obtained by multiple training, the ensemble learned by the new method SGLD+GSP+PR reduces the PPL from 72.0 to 69.5, and with only 10\% parameters and 40\% FLOPs in total. \ozj{SGLD indeed provides a good approach to finding diverse sample models for ensembles.} Fig.\ref{training} presents the PPL curves along the learning of LSTM ensemble by the new method SGLD+GSP+PR over the development set. It clearly shows the performance gains brought by model averaging and PR. The relationship between the performance of an ensemble and the number of models in an ensemble is examined in Fig.\ref{pplvsnum}, together with a comparison between different sampling strategies. We test the performances of different ensembles on the PTB development set, each consisting of 2 to 35 medium LSTMs. The blue curve shows the result of running SGLD+GSP+PR for 80 epochs and sampling uniformly after a 10-epoch burn in process, \textit{e.g.} sampling every 2 epoch to collect 35 models and sampling every 35 epoch to get 3 models. The orange curve is obtained by sampling every 6 epochs, which means that the more model collected the longer run of SGLD. It can be seen from comparing the two curves that it is better to sample with larger interval with relatively small number of models. \ozj{It is also clear from Fig.\ref{pplvsnum} that the traditional ensemble learning method by SGD training of multiple models is inferior to the SGLD learning method.} \begin{figure}[t] \begin{center} \subfigure[Untied weights] { \label{untie_p} \includegraphics[width=0.38\linewidth]{untied_pattern} } \subfigure[Tied weights] { \label{tied_p} \includegraphics[width=0.28\linewidth]{tied_pattern} } \subfigure[ISS] { \label{ISS_p} \includegraphics[width=0.27\linewidth]{ISS_pattern} } \end{center} \caption{The sparse structure patterns of the weight matrices from a sample LSTM model trained by applying SGLD with GSP. Yellow areas are all zeros while black dots stand for non-zero weights. The patterns are plotted with a sub-sampling by a factor of 5.} \label{pattern} \end{figure} \begin{table}[t] \caption{Detailed structure information for various large LSTMs. The FLOPs of LSTM layer 1, LSTM layer 2 and softmax layer are shown in three columns respectively. The embedding layer is not listed here since it is a table lookup process instead of matrix calculation. The results of our method are the statistics from a single model sample from the ensemble trained by SGLD+GSP+PR. \zyc{The size of the reduced LSTM model learned by our method with ISS is 365, 311 and 420 for embedding input, 1st LSTM layer and 2nd LSTM layer respectively. For shared embeddings (denoted as SE), the layer sizes are 456, 352 and 456 respectively.} } \label{PTB_SSE} \begin{center} \begin{tabular}{lcccccc} \toprule \multicolumn{1}{c}{\multirow{3}*{Method}} &\multicolumn{1}{c}{\multirow{3}*{Sparsity}} &\multicolumn{1}{c}{\multirow{3}*{Parameters}} &\multicolumn{4}{c}{FLOPs} \\ \cmidrule{4-7} &&&LSTM1 &LSTM2 &Softmax &Total \\ \toprule SGD (Zaremba, 2014) &- & 66M &36M &36M &30M &102M \\ ISS (Wen, 2017) &- &25.2M &5.7M &3.9M &10.7M &20.4M (20\%)\\ \midrule SGLD+GSP+PR &90\% &6.6M &4.3M &6.1M &12.2M &22.7M (22\%)\\ SGLD+GSP+PR (tied W) &90\% &6.6M &4.9M &6.1M &12.4M &23.5M (23\%)\\ SGLD+GSP+PR (ISS) &90\% &6.6M &1.7M &2.5M &8.4M &12.6M (12\%)\\ SGLD+GSP+PR+SE (ISS) &90\% &5.1M &2.3M &2.9M &9.1M &14.4M (14\%)\\ \bottomrule \end{tabular} \end{center} \end{table} Fig. \ref{pattern} shows the sparse structured patterns of the weight matrices from a single LSTM model sample in the ensemble trained by applying SGLD with GSP, separately for three different grouping strategies of weight matrices. Table \ref{PTB_SSE} shows the FLOPs for each layer for these LSTM model samples. Note that word embedding is not included for FLOP calculation, since it is a table lookup process instead of matrix calculation in practice, but we still prune it to reduce model size. \zyc{Models learned by ISS have desirable homogeneously-sparse structures and thus fewer FLOPs.} Comparison of various models based on LSTMs on PTB dataset are summarized in Table \ref{PTB_best}. We investigate to use small number of models to achieve trade off between cost and performance. An attractive model is the SSE of 4 large LSTMs, which only requires 40\% of parameters and 90\% of computational cost in total, compared to the baseline large LSTM \citet{zaremba2014recurrent}, but decrease the perplexity from 78.4 to 68.7. This result is also better than those obtained by \citet{zaremba2014recurrent} (38 independently trained large LSTMs) and \citet{gal2016theoretically} (10 independently trained large LMs with costly MC dropout for testing), not only in terms of PPL reduction but also in term of reducing memory and computing costs. \zyc{ As suggested by a referee, we compare SGD (1 model)+GSP+PR with SGLD (ensemble)+GSP+PR. SGD+GSP+PR represents the SGD training with group sparse prior and model pruning/retraining. SGD (1 model)+GSP+PR can reduce the model size but the PPL is much worse than the ensemble, which clearly shows the improvement provided by the ensemble. Additionally, we compare SGLD (4 models)+GSP+PR with SGD (4 models)+GSP+PR, namely the classic ensemble training method by multiple independent runs with different initializations. The two ensembles achieve close PPLs. However, SGD ensemble learning requires $ 30\times4 $ epochs training and $ 15\times4$ epochs retraining, SGLD ensemble learning takes 80 epochs training plus $ 15\times4$ epochs retraining, which reduces about $30\%$\footnote{Retraining operates on pruned models, and reduces the time cost by $50\%$. So the total reduction of training time is about $(80+15*4*0.5)/(30*4+15*4*0.5)=0.73$. } training time.} \zyc{ Note that a number of better model architectures (\citet{inan2016tying,merity2017regularizing,yang2017breaking}) have emerged than the baseline large LSTM LM, which we used as a baseline. Our SGLD+GSP+PR in principle can be applied to those new model architectures. As an example, we apply SGLD+GSP+PR to models that share input and output embeddings \citet{inan2016tying}. With shared embeddings, we further reduce the perplexity to 62.1 by using the SSE of 4 large LSTMs, which can be regarded as an ensemble version of \citet{inan2016tying} without variational dropout (VD) and augmented loss (AL). As a side note, without shared embeddings, the lowest perplexity achieved is 66.4 by the SSE of 20 large LSTMs, which is also among the top models obtained with standard LSTMs to the best of our knowledge.} \begin{table}[t] \caption{Comparison of various models based on LSTMs on PTB dataset. The number of parameters and FLOPs are shown as multiples of the baseline medium LSTM trained by SGD, the specifics of which are shown in parentheses. The bold line denotes the best result obtained with shared embeddings (denote as SE). } \label{PTB_best} \begin{center} \begin{tabular}{lcccccc} \toprule \multicolumn{1}{c}{Method} &\multicolumn{1}{c}{Model} &\multicolumn{1}{c}{Parameters} &\multicolumn{1}{c}{FLOPs} &\multicolumn{1}{c}{Dev.} &\multicolumn{1}{c}{Test}\\ \toprule SGD (Zaremba, 2014) &1 large &1(66M)(&1(102M) &82.2 &78.4 \\ SGD (Zaremba, 2014) &38 large &38$\times$ &38$\times$ &71.9 &68.7 \\ VD (Gal, 2016) &10 large &10$\times$ &- &- &68.7 \\ \zyc{VD-LSTM+SE+AL (Inan, 2016)} &individual &51M &- &71.1 &68.5 \\ \zyc{AWD-LSTM (Merity, 2017)} &individual &24M &- &60.0 &57.3 \\ \zyc{AWD-LSTM-MoS (Yang, 2017)} &individual &22M &- &56.5 &54.4 \\ \midrule \zyc{SGD+GSP+PR} &1 large &0.1$\times$ &0.2$\times$ &81.9 &77.8 \\ \zyc{SGD+GSP+PR} &4 large &0.4$\times$ &0.9$\times$ &69.9 &66.7 \\ SGLD+GSP+PR &20 large &2.0$\times$ &4.5$\times$ &68.6 &66.4 \\ SGLD+GSP+PR &4 large &0.4$\times$ &0.9$\times$ &70.9 &68.7 \\ SGLD+GSP+PR+SE (ISS) &4 large &\bf0.3$\times$ (20.4M) &\bf0.7 $\times$ &\bf64.4 &\bf62.1\\ \bottomrule \end{tabular} \end{center} \end{table} \section{Conclusion and Future Works} In this work, we propose a novel method of learning NN ensembles efficiently and cost-friendly by integrating three mutually enhanced techniques: SG-MCMC sampling, group sparse prior and network pruning. The resulting SGLD+GSP+PR method is easy to implement, yet surprisingly effective. This is \ozj{thoroughly evaluated} in the experiments of learning SSE ensembles of both FNNs and LSTMs. The Sparse Structured Ensembles (SSEs) learned by our method gain better prediction performance with reduced training and test cost when compared to traditional methods of learning NN ensembles. Moreover, \ozj{by proper controlling the number of models used in the ensemble}, the method can also be used to produce SSE, which outperforms baseline NN significantly without increasing the model size and computation cost. Some interesting future works: (1) interleaving model sampling and model pruning; (2) application of this new method, as a new powerful tool of learning ensembles, to more tasks. \section*{Acknowledgments}
{'timestamp': '2018-05-24T02:07:13', 'yymm': '1803', 'arxiv_id': '1803.00184', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00184'}
arxiv
\section{Introduction} Bidding optimization is one of the most critical problems for maximizing advertisers' profit in online advertising. In the sponsored search (SS) scenario, the problem is typically formulated as an optimization of the advertisers' objectives (KPIs) via seeking the best settings of keyword bids \cite{borgs2007dynamics,feldman2007budget}. The keyword bids are usually assumed to be fixed during the online auction process. However, the sequence of user queries (incurring \emph{impressions} and \emph{auctions} for online advertising) creates a complicated dynamic environment where a real-time bidding strategy could significantly boost advertisers' profit. This is more important on e-commerce auction platforms since impressions more readily turn into purchases, compared to traditional web search. In this work, we consider the problem, Sponsored Search Real-Time Bidding (SS-RTB), which aims to generate proper bids at the impression level in the context of SS. To the best of our knowledge, there is no publicly available solution to SS-RTB. The RTB problem has been studied in the context of display advertising (DA). Nevertheless, SS-RTB is intrinsically different from RTB. In DA, the impressions for bidding are concerned with ad placements in publishers' web pages, while in SS the targets are ranking lists of dynamic user queries. The key difference are: (1) for a DA impression only the winning ad can be presented to the user (i.e. a 0-1 problem), while in the SS context multiple ads which are ranked high can be exhibited to the query user; (2) In SS, we need to adjust bid prices on multiple keywords for an ad to achieve optimal performance, while an ad in DA does not need to consider such a keyword set. These differences render popular methods for RTB in DA, such as predicting winning market price \cite{wu2015predicting} or winning rate \cite{zhang2014optimal}, inapplicable in SS-RTB. Moreover, compared to ad placements in web pages, user query sequences in SS are stochastic and highly dynamic in nature. This calls for a complex model for SS-RTB, rather than the shallow models often used in RTB for DA \cite{zhang2014optimal}. One straightforward solution for SS-RTB is to establish an optimization problem that outputs the optimal bidding setting for each impression independently. However, each impression bid is strategically correlated by several factors given an ad, including the ad's budget and overall profit, and the dynamics of the underlying environment. The above greedy strategy often does not lead to a good overall profit \cite{cai2017real}. Thus, it is better to model the bidding strategy as a sequential decision on the sequence of impressions in order to optimize the overall profit for an ad by considering the factors mentioned above. This is exactly what reinforcement learning (RL) \cite{mnih2013playing,poole2010artificial} does. By RL, we can model the bidding strategy as a dynamic interactive control process in a complex environment rather than an independent prediction or optimization process. The budget of an ad can be dynamically allocated across the sequence of impressions, so that both immediate auction gain and long-term future rewards are considered. Researchers have explored using RL in online advertising. Amin \emph{et al.} constructed a Markov Decision Process (MDP) for budget optimization in SS \cite{amin2012budget}. Their method deals with impressions/auctions in a batch model and hence cannot be used for RTB. Moreover, the underlying environment for MDP is ``static'' in that all states share the same set of transition probabilities and they do not consider impression-specific features. Such a MDP cannot well capture the complex dynamics of auction sequences in SS, which is important for SS-RTB. Cai \emph{et al.} developed a RL method for RTB in DA \cite{cai2017real}. The method combines an optimized reward for the current impression (based on impression-level features) and the estimate of future rewards by a MDP for guiding the bidding process. The MDP is still a static one as in \cite{amin2012budget}. Recently, a deep reinforcement learning (DRL) method was proposed in \cite{wang2017ladder} for RTB in DA. Different from the previous two works, their MDP tries to fully model the dynamics of auction sequences. However, they also identified an ``environment changing'' issue: the underlying dynamics of the auction sequences from two days could be very different. For example, the auction number and the users' visits could heavily deviate between days. A toy illustration is presented in Figure~\ref{envp}. Compared to a game environment, the auction environment in SS is itself stochastic due to the stochastic behaviors of users. Hence, the model learned from Day 1 cannot well handle the data from Day 2. Although \cite{wang2017ladder} proposed a sampling mechanism for this issue, it is still difficult to guarantee we obtain the same environment for different days. Another challenge that existing methods fail to address is the multi-agent problem. That is, there are usually many ads competing with one another in auctions of SS. Therefore, it is important to consider them jointly to achieve better global bidding performance. Motivated by the challenges above, this paper proposes a new DRL method for the SS-RTB problem. In our work, we captured various discriminative information in impressions such as market price and conversion rate (CVR), and also try to fully capture the dynamics of the underlying environment. The core novelty of our proposed method lies in how the environment changing problem is handled. We solve this problem by observing the fact that statistical features of proper aggregation (e.g. by hour) of impressions has strong periodic state transition patterns in contrast to impression level data. Inspired by this, we design a robust MDP at the hour-aggregation level to represent the sequential decision process in the SS auction environment. At each state of the MDP, rather than generating bid prices directly, we decide a bidding model for impressions of that hour and perform real-time bidding accordingly. In other words, the robust MDP aims to learn the optimal parameter policy to control the real-time bidding model. Different from the traditional ``control-by-action'' paradigm of RL, we call this scheme ``control-by-model''. By this control-by-model learning scheme, our system can do real-time bidding via capturing impression-level features, and meanwhile also take the advantage of RL to periodically control the bidding model according to the real feedback from the environment. Besides, considering there are usually a considerable number of ads, we also design a massive-agent learning algorithm by combining competitive reward and cooperative reward together. The contribution of this work is summarized as follows: (1) We propose a novel research problem, Sponsored Search Real-Time Bidding (SS-RTB), and properly motivate it. (2) A novel deep reinforcement learning (DRL) method is developed for SS-RTB which can well handle the environment changing problem. It is worth to note that, the robust MDP we proposed is also a general idea that can be applied to other applications. We also designed an algorithm for handling the massive-agent scenario. (3) We deploy the DRL model in the Alibaba search auction platform, one of the largest e-commerce search auction platforms in China, to carry out evaluation. The offline evaluation and standard online A/B test demonstrate the superiority of our model. \begin{figure} \includegraphics[height=2in, width=3.2in]{envp4.eps} \caption{Auction Environment vs Game Environment} \label{envp} \end{figure} \section{Related Work} In this section, we briefly review two fields related to our work: reinforcement learning and bidding optimization. \subsection{Reinforcement Learning} In reinforcement learning (RL) theory, a control system is formulated as a Markov Decision Process (MDP). A MDP can be mathematically represented as a tuple <$\mathcal{S}, \mathcal{A}, p, r$>, where $\mathcal{S}$ and $\mathcal{A}$ represent the state and action space respectively, $p(\cdot)$ denotes the transition probability function, and $r(\cdot)$ denotes the feedback reward function. The transition probability from state $s \in \mathcal{S}$ to $s' \in \mathcal{S}$ by taking action $a \in \mathcal{A}$ is $p(s, a, s')$. The reward received after taking action $a$ in state $s$ is $r(s,a)$. The goal of the model is to learn an optimal policy (a sequence of decisions mapping state $s$ to action $a$), so as to maximize the expected accumulated long term reward. Remarkably, deep neural networks coupled with RL have achieved notable success in diverse challenging tasks: learning policies to play games \cite{silver2016mastering,mnih2013playing,mnih2015human}, continuous control of robots and autonomous vehicles \cite{levine2014learning,gu2016continuous,hafner2011reinforcement}, and recently, online advertising \cite{cai2017real,wang2017ladder,amin2012budget}. While the majority of RL research has a consistent environment, applying it to online advertising is not a trivial task since we have to deal with the environment changing problem mentioned previously. The core novelty of our work is that we propose a solution which can well handle this problem. Moreover, when two or more agents share an environment, the performance of RL is less understood. Theoretical proofs or guarantees for multi-agent RL are scarce and only restricted to specific types of small tasks \cite{schwartz2014multi,busoniu2008comprehensive,tampuu2017multiagent}. The authors in \cite{tampuu2017multiagent} investigated how two agents controlled by independent Deep Q-Networks (DQN) interact with each other in the game of Pong. They used the environment as the sole source of interaction between agents. In their study, by changing reward schema from competition to cooperation, the agents would learn to behave accordingly. In this paper, we adopt a similar idea to solve the multi-agent problem. However, the scenario in online advertising is quite different. Not only the agent number is much larger, but also the market environment is much more complex. No previous work has explored using cooperative rewards to address the multi-agent problem in such scenarios. \subsection{Bidding optimization} In sponsored search (SS) auctions, bidding optimization has been well studied. However, most previous works focused on the keyword-level auction paradigm, which is concerned with (but not limited to) budget allocation \cite{borgs2005multi,feldman2007budget,muthukrishnan2007stochastic}, bid generation for advanced match \cite{even2009bid,broder2011bid,fuxman2008using}, keywords' utility estimation \cite{borgs2007dynamics,kitts2004optimal}. Unlike in SS, RTB has been a leading research topic in display advertising (DA) \cite{yuan2013real,wang2015real}. Different strategies of RTB have been proposed by researchers \cite{zhang2014optimal,wu2015predicting,cai2017real,chen2011real,lee2013real}. In \cite{zhang2014optimal}, the authors proposed a functional optimization framework to learn the optimal bidding strategy. However, their model is based on an assumption that the auction winning function has a consistent concave shape form. Wu \emph{et al.} proposed a fixed model with censored data to predict the market price in real-time \cite{wu2015predicting}. Although these works have shown significant advantage of RTB in DA, they are not applicable to the SS context due to the differences between SS and DA discussed in Section~1. In addition to these prior studies, recently, a number of research efforts in applying RL to bidding optimization have been made \cite{amin2012budget,wang2017ladder,cai2017real}. In \cite{amin2012budget}, Amin \emph{et al.} combined the MDP formulation with the Kaplan-Meier estimator to learn the optimal bidding policy, where decisions were made on keyword level. In \cite{cai2017real}, Cai \emph{et al.} formulated the bidding decision process as a similar MDP problem, but taking one step further, they proposed a RTB method for DA by employing the MDP as a long term reward estimator. However, both of the two works considered the transition probabilities as static and failed to capture impression-level features in their MDPs. More recently, the authors in \cite{wang2017ladder} proposed an end-to-end DRL method with impression-level features formulated in the states and tried to capture the underlying dynamics of the auction environment. They used random sampling to address the environment changing problem. Nevertheless, random sampling still cannot guarantee an invariant underlying environment. Our proposed method is similar to that of \cite{wang2017ladder} in that we use a similar DQN model and also exploit impression-level features. However, the fundamental difference is that we propose a robust MDP based on hour-aggregation of impressions and a novel control-by-model learning scheme. Besides, we also try to address the multi-agent problem in the context of online advertising, which has not been done before. \section{Problem Definition}\label{section:problem} In this section, we will mathematically formulate the problem of real-time bidding optimization in sponsored search auction platforms (SS-RTB). In a simple and general scenario, an ad has a set of keyword tuples $\{kwinf_1$, $kwinf_2$, $\dots$, $kwinf_m\}$, where each tuple $kwinf\_i$ can be defined as <$belong\_ad, keyword, bidprice$>. Typically, the $bidprice$ here is preset by the advertiser. The process of an auction $auct$ could then be depicted as: everytime a user $u$ visits and types a query, the platform will retrieve a list of relevant keyword tuples, [$kwinf_1$, $kwinf_2$, $\dots$, $kwinf_r$]\footnote{Typically, an ad can only have one keyword tuple (i.e. the most relevant one) in the list}, from the ad repository for auction. Each involved ad is then assigned a ranking score according to its retrieved keyword tuple as $bidscore * bidprice$. Here, $bidscore$ is obtained from factors such as relevance and personalization, etc. Finally, top ads will be presented to the user $u$. For SS-RTB, the key problem is to find another $opt\_bidprice$ rather than $bidprice$ for the matched keyword tuples during real-time auction, so as to maximize an ad's overall profit. Since we carry out the research in an e-commerce search auction platform, in the following we will use concepts related to the e-commerce search scenario. Nevertheless, the method is general and could be adapted to other search scenarios. We define an ad's goal as maximizing the purchase amount $PUR\_AMT_d$ as income in a day $d$, while minimizing the cost $COST_d$ as expense in $d$, with a constraint that the $PUR\_AMT_d$ should not be smaller than the advertiser's expected value $g$. We can formulate the problem as: \begin{equation} \label{eq:obj_1} \begin{aligned} & \max \quad PUR\_AMT_d / COST_d \\ & \quad s.t. \quad PUR\_AMT_d >= g \end{aligned} \end{equation} Observing that $PUR\_AMT_d$ has highly positive correlation with $COST_d$, we can change it to: \begin{equation} \label{eq:obj_2} \begin{aligned} & \max \quad PUR\_AMT_d \\ & \quad s.t. \quad COST_d = c \end{aligned} \end{equation} Eq.~(\ref{eq:obj_2}) is equivalent to Eq.~(\ref{eq:obj_1}) when $COST_d$ is positively correlated with $PUR\_AMT_d$ (as is the usual case). We omit the proof due to space limitation. The problem we study in this paper is to decide $opt\_bidprice$ in real-time for an ad in terms of objective (\ref{eq:obj_2}). \section{Methodology} \subsection{A Sketch Model of Reinforcement Learning}\label{subsection:sketch} Based on the problem we defined in section \ref{section:problem}, we now formulate it into a sketch model of RL: \noindent \textbf{State $s$}: We design a general representation for states as $s$ = <$b$, $t$, $\overrightarrow{auct}$>, where $b$ denotes the budget left for the ad, $t$ denotes the step number of the decision sequence, and $\overrightarrow{auct}$ is the auction (impression) related feature vector that we can get from the advertising environment. It is worth to note that, for generalization purpose, the $b$ here is not the budget preset by the advertiser. Instead, it refers to the cost that the ad expects to expend in the left steps of auctions. \noindent \textbf{Action $a$}: The decision of generating the real-time bidding price for each auction. \noindent \textbf{Reward $r(s, a)$}: The income (in terms of $PUR\_AMT$) gained according to a specific action $a$ under state $s$. \noindent \textbf{Episode $ep$}: In this paper, we always treat one day as an episode. Finally, our goal is to find a policy $\pi(s)$ which maps each state $s$ to an action $a$, to obtain the maximum expected accumulated rewards: $\sum_{i=1}^n \gamma^{i-1} r(s_i, a_i) $. $\{\gamma^i\}$ is the set of discount coefficients used in a standard RL model \cite{sutton1998reinforcement}. Due to the randomness of user query behavior, one might never see two auctions with exactly the same feature vector. Hence, in previous work of online advertising, there is a fundamental assumption for MDP models: two auctions with similar features can be viewed as the same \cite{amin2012budget,wang2017ladder,cai2017real}. Here we provide a mathematical form of this assumption as follows. \newtheorem{assumption}{Assumption} \begin{assumption} \label{assumption: eq_pv} Two auction $\overrightarrow{auct}_i$ and $\overrightarrow{auct}_j$ can be a substitute to each other as they were the same if and only if they meet the following condition: \begin{displaymath} \frac {\Arrowvert \overrightarrow {auct}_i - \overrightarrow {auct}_j\Arrowvert^{2} } {\min(\Arrowvert\overrightarrow {auct}_i\Arrowvert^2,\Arrowvert\overrightarrow {auct}_j\Arrowvert^2)} < 0.01 \end{displaymath} This kind of substitution will not affect the performance of a MDP-based control system. \end{assumption} However, the above sketch model is defined on the auction level. This cannot handle the environment change problem discussed previously (Figure~\ref{envp}). In other words, given day 1 and day 2, the model trained on $ep_1$ cannot be applied to $ep_2$ since the underlying environment changes. In the next, we present our solution to this problem. \subsection{The Robust MDP model} Our solution is inspired by a series of regular patterns observed in real-data. We found that, by viewing the sequences of auctions at an aggregation level, the underlying environments of two different days share very similar dynamic patterns. We illustrate a typical example in Figure~\ref{fig:level}, which depicts the number of clicks of an ad at different levels of aggregation (from second-level to hour-level) in Jan. 28th, 2018 and Jan. 29th, 2018 respectively. It can be observed that, the second-level curves does not exhibit a similar pattern (Figure~\ref{fig:level}(a) and (b)), while from both minute-level and hour-level we can observe a similar wave shape. In addition, it also suggests that the hour-level curves are more similar than those of minute-level. We have similar observations on other aggregated measures. \begin{center} \begin{figure} \subfigure[] { \begin{minipage}[t]{0.45\linewidth} \includegraphics[height=25mm, width=35mm]{click_second_0128.eps} \end{minipage} } \subfigure[] { \begin{minipage}[t]{0.45 \linewidth} \includegraphics[height=25mm, width=35mm]{click_second_0129.eps} \end{minipage} } \subfigure[] { \begin{minipage}[t]{0.45\linewidth} \includegraphics[height=25mm, width=35mm]{click_minute_0128.eps} \end{minipage} } \subfigure[] { \begin{minipage}[t]{0.45\linewidth} \includegraphics[height=25mm, width=35mm]{click_minute_0129.eps} \end{minipage} } \subfigure[] { \begin{minipage}[t]{0.45\linewidth} \includegraphics[height=25mm, width=35mm]{click_hour_0128.eps} \end{minipage} } \subfigure[] { \begin{minipage}[t]{0.45\linewidth} \includegraphics[height=25mm, width=35mm]{click_hour_0129.eps} \end{minipage} } \caption{Patterns of Different Level Clicks} \label{fig:level} \end{figure} \end{center} The evolving patterns of the same measure are very similar between two days at hour-level, indicating the underlying rule of this auction game is the same. Inspired by these regular patterns, we will take advantage of hour-aggregated features rather than auction-level features to formulate the MDP model. Intuitively, if we treat each day as a 24 steps of auction game, an episode of any day would always have the same general experiences. For example, it will meet an auction valley between 3:00AM to 7:00AM, while facing a heavy competitive auction peak at around 9:00AM and a huge amount of user purchases at around 8:00PM. We override the sketch MDP model as follows. \noindent \textbf{State Transition.} The auctions of an episode will be grouped into $m$ ($m=24$ in our case) groups according to the timestamp. Each group contains a batch of auctions in the corresponding period. A state $s$ is re-defined as <$b, t, \vec g$>, where $b$ is the left budget, $t$ is the specific time period, $\vec g$ denotes the feature vector containing aggregated statistical features of auctions in time period $t$, e.g. number of click, number of impression, cost, click-through-rate (CTR), conversion rate (CVR), pay per click (PPC), etc. In this way, we obtain an episode with fixed steps $m$. In the following, we show that the state transition probabilities are consistent between two days. Suppose given state $s$ and action $a$, we observe the next state $s'$. We rewrite the state transition probability function $p(s, a, s')$ as \begin{equation} \label{eq:transition_1} \begin{aligned} p(s, a, s') & = p(S = s' | S = s, A = a) \\ & = p(S = (b-\delta, t+1, {\vec g}') | S = (b, t, \vec g), A = a) \\ & = p(T = t+1 | T = t, A = a) \\ & \quad \cdot p(B = b-\delta, G = {\vec g}' | B = b, G = \vec g, A = a) \\ & = p(B = b-\delta, G = {\vec g}' | B = b, G = \vec g, A = a) \\ \end{aligned} \end{equation} where upper case letters represent random variables and $\delta$ is the cost of the step corresponding to the action $a$. Since $B$ is only affected by $\delta$ which only depends on the action $a$, Eq.~(\ref{eq:transition_1}) could be rewritten as: \begin{equation} \label{eq:transition_2} \begin{aligned} p(s, a, s') & = p(Cost = \delta, G = {\vec g}' | G = \vec g, A = a) \\ \end{aligned} \end{equation} Because $Cost$ is also designed as a feature of ${\vec g}'$, Eq.~(\ref{eq:transition_2}) then becomes: \begin{equation} \label{eq:transition_3} \begin{aligned} p(s, a, s') & = p(G = {\vec g}' | G = \vec g, A = a) \\ & = \prod_i p(g_i' | g_i, A = a) \end{aligned} \end{equation} where each $g_i$ represents an aggregated statistical feature and we use the property that features are independent with one another. By inspecting auctions from adjacent days, we have the following empirical observation. \newtheorem{observation}{Observation} \begin{observation} \label{assumption: fea} Let $g_{i,t}$ be the aggregated value of feature $i$ at step $t$. When $g_{i,t}$ and the action $a_t$ are fixed, $g_{i,t+1}$ will meet: \begin{displaymath} g_{i,t+1} \in [(1-\eta) \bar{g}, (1+\eta) \bar{g}] \end{displaymath} Where $\bar{g}$ is the sample mean of $g_{i,t+1}$ when $g_{i,t}$ and $a_t$ are fixed, and $\eta$ is a small value that meets $\eta < 0.03$. \end{observation} This indicates that the aggregated features change with very similar underlying dynamics within days. When $g_{i,t}$ and $a_t$ are fixed, for any two possible values $\hat{g}$ and $\tilde{g}$ of $g_i^{t+1}$, we have: \begin{equation} \label{eq:cover} \begin{aligned} \frac {\Arrowvert \hat{g} - \tilde{g} \Arrowvert ^2 } {\min(\Arrowvert \hat{g} \Arrowvert^2, \Arrowvert \tilde{g} \Arrowvert^2)} & \leq \left( \frac{2\eta} {1-\eta} \right)^2 \\ & \leq 0.01 \\ \end{aligned} \end{equation} According to Assumption~\ref{assumption: eq_pv}, we can deem any possible value of $g_i^{t+1}$ to be the same, which means $p(g_i' | g_i, A = a) = 1$. According to (\ref{eq:transition_3}), finally we get: \begin{equation} \label{eq:transition_4} p(s, a, s^{'}) = 1 \end{equation} This means the state transition is consistent among different days, leading to a robust MDP. \noindent \textbf{Action Space.} With established state and transition, we now need to formulate the decision action. Most previous works used reinforcement learning to control the bid directly, so the action is to set bid prices (costs). However, applying the idea to our model would result in setting a batch cost for all the auctions in the period. It is hard to derive impression level bid price and more importantly, this cannot achieve real-time bidding. Instead of generating bid prices, we take a control-by-model scheme: we deploy a linear approximator as the real-time bidding model to fit the optimal bid prices, and we utilize reinforcement learning to learn an optimal policy to control the real-time bidding model. Hence, the action here is the parameter control of the linear approximator function, rather than the bid decision itself. Previous studies have shown that the optimal bid price has a linear relationship with the impression-level evaluation (e.g. CTR) \cite{perlich2012bid,lee2012estimating}. In this paper, we adopt the predicted conversion rate (PCVR) as the independent variable in the linear approximator function for real-time bidding which is defined as: \begin{equation} \label{eq:rtb} opt\_bidprice = f(PCVR) = \alpha \cdot PCVR \end{equation} To sum up, the robust MDP we propose is modeled as follows: \begin{center} \begin{tabular}{|c|c|} \hline state & $<b, t, \vec g>$ \\ \hline action & set $\alpha$ \\ \hline reward & $PUR\_AMT$ gained in one step \\ \hline episode & a single day \\ \hline \end{tabular} \end{center} \label{subsection:prof} \subsection{Algorithm} In this work, we take a value-based approach as our solution. The goal is to find an optimal policy $\pi(s_t)$ which can be mathematically written as: \begin{equation} \label{eq:bellman1} \pi(s_t) = \mathop{\arg\max}_{a} Q(s_t, a_t) \end{equation} Where, \begin{equation} \label{eq:q_f} Q(s_t, a_t) = \mathbb{E} [R_t | S = s_t, A = a_t] \end{equation} \begin{equation} \label{eq:rt} R_t = \sum_{k=0}^{m-t} \gamma^{k} r(s_{t+k}, a_{t+k}) \end{equation} $R_t$ in Eq.~(\ref{eq:rt}) is the accumulated long term reward that need to be maximized. $Q(s_t, a_t)$ in Eq. (\ref{eq:q_f}) is the standard action value function \cite{sutton1998reinforcement,poole2010artificial} which captures the expected value of $R_t$ given $s_t$ and $a_t$. By finding the optimal $Q$ function for each state $s_t$ iteratively, the agent could derive an optimal sequential decision. By Bellman equation \cite{sutton1998reinforcement,poole2010artificial}, we could get: \begin{equation} \label{eq:bellman} Q^{*}(s_t, a_t) = \mathbb{E} [ r(s,a) + \gamma \max_{a_{t+1}} Q^{*}(s_{t+1}, a_{t+1}) \arrowvert S = s_t, A = a_t ] \end{equation} Eq. (\ref{eq:bellman}) reveals the relation of $Q^{*}$ values between step $t$ and step $t+1$, where the $Q^*$ value denotes the optimal value for $Q(s,a)$ given $s$ and $a$. For small problems, the optimal action value function can be exactly solved by applying Eq. (\ref{eq:bellman}) iteratively. However, due to the exponential complexity of our model, we adopt a DQN algorithm similar to \cite{mnih2013playing,mnih2015human} which employs a deep neural network (DNN) with weights $\theta$ to approximate $Q$. Besides, we also map the action space into 100 discrete values for decision making. Thus, the deep neural network can be trained by minimizing the loss functions in the following iteratively: \begin{equation} \label{eq:loss_1} L_i(\theta_i) = \mathbb{E} [ (y_i - Q_{train} (s_t, a_t; \theta_i))^{2} ] \end{equation} Where, $y_i = r(s,a) + \gamma \max_{a_{t+1}} Q_{target}(s_{t+1}, a_{t+1}) $ The core idea of minimizing the loss in Eq. (\ref{eq:loss_1}) is to find a DNN that can closely approximate the real optimal $Q$ function, using Eq. (\ref{eq:bellman}) as an iterative solver. Similar to \cite{mnih2013playing}, the target network is utilized for stable convergence, which is updated by train network every C steps. \makeatletter \def\BState{\State\hskip-\ALG@thistlm} \makeatother \begin{algorithm}[h] \caption{DQN Learning} \label{algorithm:dqn} \begin{algorithmic}[1] \For{$epsode=1$ to $n$} \State Initialize replay memory $D$ to capacity $N$ \State Initialize action value functions $(Q_{train}, Q_{ep}, Q_{target})$ with weights $\theta_{train}, \theta_{ep}, \theta_{target}$ \For{$t=1$ to $m$} \State With probability $\epsilon$ select a random action $a_t$ \State otherwise select $a_t = \mathop{\arg\max}_{a} Q_{ep}(s_t, a; \theta_{ep}) $ \State Execute action $a_t$ to auction simulator and observe state $s_{t+1}$ and reward $r_t$ \State if budget of $s_{t+1}$ < 0, then continue \State Store transition $(s_t, a_t, r_t, s_{t+1})$ in $D$ \State Sample random mini batch of transitions $(s_j, a_j, r_j, s_{j+1})$ from $D$ \If{$j = m$} \State Set $y_j = r_j$ \Else \State Set $y_j = r_j + \gamma \mathop{\arg\max}_{a_{'}} Q_{target}(s_{j+1}, a_{,}, \theta_{target})$ \EndIf \State Perform a gradient descent step on the loss function $(y_j - Q_{train}(s_j, a_j; \theta_{train}))^{2}$ \EndFor \State Update $\theta_{ep}$ with $\theta$ \State Every C steps, update $\theta_{target}$ with $\theta$ \EndFor \end{algorithmic} \end{algorithm} The corresponding details of the algorithm is presented in Algorithm \ref{algorithm:dqn}. In addition to train network and target network, we also introduce an episode network for better convergence. Algorithm \ref{algorithm:dqn} works in 3 modes to find the optimal strategy: 1) Listening. The agent will record each <$s_t, a_t, r(s_t, a_t), s_{t+1}$> into a replay memory buffer; 2) Training. The agent grabs a mini-batch from the replay memory and performs gradient descent for minimizing the loss in Eq. (\ref{eq:loss_1}). 3) Prediction. The agent will generate an action for the next step greedily by the Q-network. By iteratively performing these 3 modes, an optimal policy could be found. \label{subsec:algorithm} \subsection{The Massive-agent Model} The model in Section \ref{subsec:algorithm} works well when there are only a few agents. However, in the scenario of thousands or millions of agents, the global performance would decrease due to competition. Hence, we proposed an approach for handling the massive-agent problem. The core idea is to combine the private competitive objective with a public cooperative objective. We designed a cooperative framework: for each ad, we deploy an independent agent to learn the optimal policy according to its own states. The learning algorithm for each agent is very similar to Algorithm~\ref{algorithm:dqn}. The difference is, after all agents made decisions, each agent will receive a competitive feedback representing its own reward and a cooperative feedback representing the global reward of all the agents. The learning framework is illustrated in Figure~\ref{fig:massive}. \begin{figure} \includegraphics[height=1.2in, width=2.6in]{multi.eps} \caption{Massive-agent Framework} \label{fig:massive} \end{figure} \subsection{System Architecture} In this subsection, we provide an introduction to the architecture of our system depicted by Figure~\ref{fig:archi}. There are mainly three parts: Data Processor, Distributed Tensor-Flow Cluster, Search Auction Engine. \begin{figure} \includegraphics[height=2in, width=3.2in]{archi_new5.eps} \caption{System Achitecture} \label{fig:archi} \end{figure} \noindent \textbf{Data Processor} The core component of this part is the simulator, which is in charge of RL exploration. In real search auction platforms, it is usually difficult to obtain precise exploration data. On one hand, we cannot afford to perform many random bidding predictions in online system; on the other hand, it is also hard to generate precise model-based data by pure prediction. For this reason, we build a simulator component for trial and error, which utilizes both model-free data such as real auction logs and model-based data such as predicted conversion rate to generate simulated statistical features for learning. The advantage of the simulator is, auctions with different bid decision could be simulated rather than predicted, since we have the complete auction records for all ads. In particular, we don't need to predict the market price, which is quite hard to predict in SS auction. Besides, for corresponding effected user behavior which can't be simply simulated (purchase, etc), we use a mixed method with simulation and PCVR prediction, With this method, the simulator can generate various effects, e.g. ranking, clicks, costs, etc. \noindent \textbf{Distributed Tensor-Flow Cluster} This is a distributed cluster deployed on tensor-flow. The DRL model will be trained here in a distributed manner with parameter servers to coordinate weights of networks. Since DRL usually needs huge amounts of samples and episodes for exploration, and in our scenario thousands of agents need to be trained parallelly, we deployed our model on 1000 CPUs and 40 GPUs, with capability of processing 200 billion sample instances within 2 hours. \noindent \textbf{Search Auction Engine} The auction engine is the master component. It sends requests and impression-level features to the bidding model and get bid prices back in real-time. The bidding model, in turn, periodically sends statistical online features to and get from the decision generator optimal policies which are outputted by the trained Q-network. \label{subsection:sys} \section{Experimental Setup} Our methods are tested both by offline evaluation (Section \ref{section:offline}) and via online evaluation (Section \ref{section:online}) on a large e-commerce search auction platform of Alibaba Corporation with real advertisers and auctions. In this section, we introduce the dataset, compared methods and parameter setting. \subsection{Dataset} We randomly select 1000 big ads in Alibaba's search auction platform, which on average cover 100 million auctions per day on the platform, for offline/online evaluation. The offline benchmark dataset is extracted from the search auction log for two days of late December, 2017. Each auction instance contains (but not limited to) the bids, the clicks, the auction ranking list and the corresponding predicted features such as PCVR that stand for the predicted utility for a specific impression. For evaluation, we use one day collection as the training data and the other day collection for test. Note that we cannot use the test collection directly for test since the bidding actions have already been made therein. Hence, we perform evaluation by simulation base on the test collection. Both collections contain over 100 million auctions. For online evaluation, a standard A/B test is conducted online. Over 100 million auction instances of the 1000 ads are collected one day in advance for training, and the trained models are used to generate real bidding decisions online. In order to better evaluate the effectiveness of our single-agent model, we also conduct separate experiments on 10 selected ads with disjoint keyword sets, for both offline and online evaluation. Besides, we use the data processor in our system to generate trial-and-error training data for RL methods. In particular, 200 billion simulated auctions are generated by the simulator (described in Section \ref{subsection:sys}) for training in offline/online evaluation. The simulated datasets are necessary for boosting the performance of RL methods. \subsection{Compared Methods and Evaluation Metric} The compared bidding methods in our experiments include: \vspace{2mm} \noindent \textbf{Keyword-level bidding (KB)}: KB bids based on keyword-level. It is a simple and efficient online approach adopted by search auction platforms such as the Alibaba's search auction platform. We treat this algorithm as the fundamental baseline of the experiments. \vspace{2mm} \noindent \textbf{RL with auction-level MDP (AMDP)}: AMDP optimizes sequence bidding decisions by auction-level DRL algorithm \cite{wang2017ladder}. As in \cite{wang2017ladder}, this algorithm samples an auction in every 100 auctions interval as the next state. \vspace{2mm} \noindent \textbf{RL with robust MDP (RMDP)}: This is the algorithm we proposed in this paper. RMDP is single-agent oriented, without considering the competition between ads. \vspace{2mm} \noindent \textbf{Massive-agent RL with robust MDP (M-RMDP)}: This is the algorithm extended from RMDP for handling the massive-agent problem. To evaluate the performance of the algorithms, we use the evaluation metric $PUR\_AMT / COST$ under the same $COST$ constraint. It should be noted that, due to Alibaba's business policy, we temporarily cannot expose the absolute performance values for the KB algorithm. Hence, we use relative improvement values with respect to KB instead. This do not affect performance comparison. We are applying for an official data exposure agreement currently. \subsection{Hyper-parameter Setting} To facilitate the implementation of our method, we provide the settings of some key hyper-parameters in Table \ref{tab:hyper}. It is worth to note that, for all agents we use the same hyper-parameter setting and DNN network structure. \begin{center} \begin{table} \footnotesize \caption{Hyper-parameter settings} \label{tab:hyper} \begin{tabular}{cc} \toprule Hyper-parameter & Setting \\ \midrule Target network update period & 10000 steps \\ Memory size & 1 million \\ Learning rate & 0.0001 with RMSProp method \cite{tieleman2012lecture} \\ Batch size & 300 \\ Network structure & 4-layer DNN \\ DNN layer sizes & [15, 300, 200, 100] \\ \bottomrule \end{tabular} \end{table} \end{center} \section{Offline Evaluation} The purpose of this experiment is to answer the following questions. (i) How does the DRL algorithm works for search auction data? (ii) Does RMDP outperform AMDP under changing environment? (iii) IS the multi-agent problem well handled by M-RMDP? \label{section:offline} \subsection{Single-agent Analysis} The performance comparison in terms of $PUR\_AMT / COST$ is presented in Table~\ref{tab:single_agent_offline}, where all the algorithms are compared under the same cost constraint. Thus, the performance in Table~\ref{tab:single_agent_offline} actually depicts the capability of the bidding algorithm in obtaining more $PUR\_AMT$ under same cost, compared to KB. It shows that, on the test data RMDP outperforms KB and AMDP. However, if we compare the performance on the training dataset, the AMDP algorithm is the best since it models decision control at the auction level. Nevertheless, AMDP performs poorly on the test data, indicating serious overfitting to the training data. This result demonstrates that the auction sequences cannot ensure a consistent transition probability distribution between different days. In contrast, RMDP shows stable performance between training and test, which suggests that RMDP indeed captures consistent transition patterns under environment changing by hour-aggregation of auctions. Besides, Table~\ref{tab:single_agent_offline} also shows that for each of the 10 ads RMDP consistently learns a much better policy that KB. Since we use the same hyper-parameter setting and network structure, it indicates the performance of our method is not very sensitive to hyper-parameter settings. Furthermore, the results showed in Table \ref{tab:single_agent_offline} illuminate us a general thought about reinforcement learning in the online advertising field. The power of reinforcement learning is due to sequential decision making. Normally, the more frequently the model can get feedback and adjust its control policy, the better the performance will be (AMDP on the training data). However, in the scenario of progressively changing environment, a frequent feedback information might contain too much stochastic noise. A promising solution for robust training is to collect statistical data with proper aggregation. Nevertheless, the drawback of this technique is sacrificing adjust frequency. Generally, a good approach of DRL for online advertising is actually the consequence of a good trade-off between feedback frequency and data trustworthiness (higher aggregation levels exhibit more consistent transition patterns and thus are more trustworthy). \begin{table} \footnotesize \caption{Results for the offline single-agent case. Performance is relative improvement of $PUR\_AMT / COST$ compared to KB.} \label{tab:single_agent_offline} \begin{tabular}{p{1cm}p{1.1cm}p{1.1cm}p{1.3cm}p{1.3cm} \toprule ad\_id & AMDP(train) & AMDP(test) & RMDP(train) & RMDP(test) \\ \midrule 740053750 & 334.28\% & 5.56\% & 158.81\% & 136.86\% \\ 75694893 & 297.27\% & -4.62\% & 95.80\% & 62.18\% \\ 749798178 & 68.89\% & 8.04\% & 38.54\% & 34.14\% \\ 781346990 & 227.91\% & -20.08\% & 79.52\% & 57.99\% \\ 781625444 & 144.93\% & -72.46\% & 53.62\% & 38.79\% \\ 783136763 & 489.09\% & 38.18\% & 327.88\% & 295.76\% \\ 750569395 & 195.42\% & -15.09\% & 130.46\% & 114.29\% \\ 787215770 & 253.64\% & -41.06\% & 175.50\% & 145.70\% \\ 802779226 & 158.50\% & -44.67\% & 79.07\% & 72.71\% \\ 805113454 & 510.13\% & -8.86\% & 236.08\% & 195.25\% \\ Avg. & 250.03\% & -10.06\% & 120.01\% & 98.74\% \\ \bottomrule \end{tabular} \end{table} \subsection{Multi-agent Analysis} To investigate how DRL works with many agents competing with each other, we run KB, RMDP and M-RMDP on all the 1000 ads of the offline dataset. In this experiment and the following online experiments, we do not involve AMDP since it has already been shown to perform even worse than KB in the single-agent case. The averaged results for the 1000 ads are shown in Figure~\ref{fig:expoffline}. The first thing we can observe is that, the costs of all the algorithms are similar (note that the y-axis of Figure~\ref{fig:expoffline}(a) measures the ratio to KB's cost), while the $PUR\_AMT / COST$ results are different. It shows that RMDP still outperforms KB, but the relative improvement is not as high as in the single-agent case. Compared to RMDP, M-RMDP shows a prominent improvement in terms of $PUR\_AMT / COST$. This consolidates our speculation that by equipping each agent with a cooperative objective, the performance could be enhanced. \begin{center} \begin{figure} \subfigure[$COST/COST_{KB}$] { \begin{minipage}[t]{0.4\linewidth} \includegraphics[height=30mm, width=40mm]{new_cost.eps} \end{minipage} } \subfigure[$PUR\_AMT/COST$] { \begin{minipage}[t]{0.4\linewidth} \includegraphics[height=30mm, width=40mm]{new_buy.eps} \end{minipage} } \caption{Performance on 1000 ads (offline).} \label{fig:expoffline} \end{figure} \end{center} \section{Online evaluation} This section presents the results of online evaluation in the real-world auction environment of the Alibaba search auction platform with a standard A/B testing configuration. As all the results are collected online, in addition to the key performance metric $PUR\_AMT$ / $COST$, we also show results on metrics including conversion rate (CVR), return on investment (ROI) and cost per click (PPC). These metrics, though different, are related to our objective. \label{section:online} \subsection{Single-agent Analysis} We continue to use the same 10 ads for evaluation. The detailed performance of RMDP for each ad is listed in Table~\ref{tab:single_agent_online}. It can be observed from the last line that the performance of RMDP outperforms that of KB with an average of 35.04\% improvement of $PUR\_AMT / COST$. This is expected as the results are similar to those of the offline experiment. Although the percentages of improvement are different between online and offline cases, this is also intuitive since we use simulated results based on the test collection for evaluation in the offline case. This suggests our RMDP model is indeed robust when deployed to real-world auction platforms. Besides, we also take other related metrics as a reference. We find that there is an average of 23.7\% improvement in CVR, an average of 21.38\% improvement in ROI and a slight average improvement (5.16\%) in PPC (the lower, the better). This means our model could also indirectly improve other correlated performance metrics that are usually considered in online advertising. The slight improvement in PPC means that we help advertisers save a little of his/her cost per click, although not prominent. \begin{table} \footnotesize \caption{Results for the online single-agent case. Performance is relative improvement of RMDP compared to KB.} \label{tab:single_agent_online} \begin{tabular}{ccccl} \toprule ad\_id & $PUR\_AMT / COST$ & CVR & ROI & PPC \\ \midrule 740053750 & 65.19\% & 60.78\% & 19.01\% & -2.67\% \\ 75694893 & 23.59\% & 8.83\% & 12.75\% & -11.94\% \\ 749798178 & 4.15\% & -7.98\% & -0.63\% & -11.66\%\\ 781346990 & 41.6\% & 49.12\% & 43.86 \% & 5.33\% \\ 781625444 & -9.79\% & 30.95\% & 7.73\% & 14.28\%\\ 783136763 & 55.853\% & 27.03\% & 52.87\% & -18.49\% \\ 750569395 & 2.854\% & 1.65\% & 19.60\% & 8.81\%\\ 787215770 & 21.52\% & 32.97\% & 46.94\% & -8.61\% \\ 802779226 & 31.44\% & 46.93\% & 19.97\% & 11.78\%\\ 805113454 & 57.08\% & 78.64\% & 68.73\% & 13.74\%\\ Avg. & 35.04\% & 23.11\% & 21.38\% & -5.16\% \\ \bottomrule \end{tabular} \end{table} \subsection{Multi-agent Analysis} A standard online A/B test on the 1000 ads is carried out on Feb. 5th, 2018. The averaged relative improvement results of RMDP and M-RMDP compared to KB are depicted in Table \ref{tab:massive_agent}. We can see that, similar to the offline experiment, M-RMDP outperforms the online KB algorithm and RMDP in several aspects: i) higher $PUR\_AMT / COST$, which is the objective of our model; ii) higher ROI and CVR, which are related key utilities that advertisers concern. It is again observed that PPC is slightly improved, which means that our model can slightly help advertisers save their cost per click. The performance improvement of RMDP is lower that that in the online single-agent case (Table~\ref{tab:single_agent_online}). The reason could be that the competition among the ads affect its performance. In comparison, M-RMDP can well handle the multi-agent problem. \begin{table} \footnotesize \caption{Results for the online multi-agent case. Performance is relative improvement compared to KB.} \label{tab:massive_agent} \begin{tabular}{cccccl} \toprule Algorithm & $PUR\_AMT / COST$ & ROI & CVR & PPC \\ \midrule RMDP & 6.29\% & 26.51\% & 3.12\% & -3.36\% \\ M-RMDP & 13.01\% & 39.12\% & 12.62\% & -0.74\% \\ \bottomrule \end{tabular} \end{table} \subsection{Convergence Analysis} We provide convergence analysis of the RMDP model by two example ads in Figure~\ref{fig:converge}. Figures~\ref{fig:converge}(a) and~\ref{fig:converge}(c) show the $Loss$ (i.e. Eq.~(\ref{eq:loss_1})) curves with the number of learning batches processed. Figures~\ref{fig:converge}(b) and~\ref{fig:converge}(d) present the $PUR\_AMT$ (i.e. our optimization objective in Eq.~(\ref{eq:obj_2})) curves accordingly. We observe that, in Figures~\ref{fig:converge}(a) and~\ref{fig:converge}(c) the $Loss$ starts as or quickly increases to a large value and then slowly converge to a much smaller value, while in the same batch range $PUR\_AMT$ improves persistently and becomes stable (Figures~\ref{fig:converge}(b) and~\ref{fig:converge}(d)). This provides us a good evidence that our DQN algorithm has a solid capability to adjust from a random policy to an optimal solution. In our system, the random probability $\epsilon$ of exploration in Algorithm~\ref{algorithm:dqn} was initially set to $1.0$, and decays to 0.0 during the learning process. The curves in Figure \ref{fig:converge} demonstrate a good convergence performance of RL. Besides, we observe that the loss value converges to a relatively small value after about 150 million sample batches are processed, which suggests that the DQN algorithm is data expensive. It needs large amounts of data and episodes to find an optimal policy. \begin{center} \begin{figure} \subfigure[] { \begin{minipage}[t]{0.45\linewidth} \includegraphics[height=30mm, width=40mm]{converge_1_loss.eps} \end{minipage} } \subfigure[] { \begin{minipage}[t]{0.45\linewidth} \includegraphics[height=30mm, width=40mm]{converge_1_buy.eps} \end{minipage} } \subfigure[] { \begin{minipage}[t]{0.45\linewidth} \includegraphics[height=30mm, width=40mm]{converge_2_loss.eps} \end{minipage} } \subfigure[] { \begin{minipage}[t]{0.45\linewidth} \includegraphics[height=30mm, width=40mm]{converge_2_buy.eps} \end{minipage} } \caption{convergence Performance.} \label{fig:converge} \end{figure} \end{center}
{'timestamp': '2018-03-02T02:07:46', 'yymm': '1803', 'arxiv_id': '1803.00259', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00259'}
arxiv
\section{Introduction} Our lives are surrounded with several complex phenomena which are at times very difficult to explain or understand. These phenomena usually encompass a lot of spheres of our lives. One such phenomena is how certain biological, geological, physical, astronomical, financial and social systems show a very peculiar similarity that is they all exhibit a so called \emph{Scale Free Property} \cite{Scale-free networks}. This property says that certain features of these systems follow a common pattern. For example in case of geology, most of the earthquakes that occur on this planet are nominal whereas few are gigantic, in case of financial systems most people on earth have small incomes and a few have a monumental incomes, in case of social systems, there are few celebrities who are extremely popular whereas most of the other are not and this list of examples continues on and on. As it turns out this kind of a Scale free pattern has been known to scientists and researchers for long. Herbert Simon \cite{behavioral model} showed the existence of such properties way back in the 1950s. Although this property is very common, present literature exhibits that there is not much understanding of as to why and how it occurs. In recent years with the advent of new technologies like the internet, WWW, social media etc., a new stream of research has come up which seeks to explain this phenomenon in several complex systems by employing mathematical models. Here the key is to find the existence of a graph theoretic structure that is present in these systems and show that the Scale Free Property is present in that graph. Researchers have shown that the presence of this property means that the corresponding graph follows the \emph{power law} degree distribution. The most well known among such models is the model of Barab$\acute{a}$si-Albert that describes a model based on \emph{preferential attachment}. This model ensures that as this graph evolves by the addition of new nodes, each new node gets attached to a set of $m$ existing nodes where the attaching probability of the new node is proportional to the degree of that node already present in the graph. This model although considered to be fairly satisfactory, is not very realistic at times and has several drawbacks. Due to this several generalizations of this model has been proposed that try to improvise on the properties of the graph generated. In this paper we propose a new model that is a generalization of the AB model and is based on the \emph{cuts} in the graph. Our model is very novel and has no apparent links with the already existing generalization of the Barab\'asi-Albert (BA) model. In this paper, we introduce our model, which we have named as the \emph{EvoCut} model, and describe its properties. We further bring out how this model is more realistic than the already existing models. \subsection{The Scale Free Property} As mentioned in the previous section, the scale free property \cite{Scale-free networks} basically means that the occurrence of very high is small and there is an abundance of small. In the context of networks and graphs this means that there are very few nodes with high degree and there are a lot of nodes with small degree. A more technical way of putting it is to say that the degree distribution follows the \emph{power law} i.e. $p(k) \propto k^{-\gamma}$ where $\gamma \in (2,3]$; $p(k)$ is the number of nodes with degree $k$ divided by $2m$ (which is the total degree of nodes). This alternatively means that on log scale the plot of $p(k)$ vs. $k$ is linear. \includegraphics[scale = 0.35]{power.png} \section{Prior Work on Generalization of Albert-Barab\'asi model} In this section we present some prior models that are based on the generalization of the Barab$\acute{a}$si-Albert model. \subsection{Dorogovtsev-Mendes-Samukhin (DMS) \\Model} Dorogovtsev, Mendes and Samukhin present a model \cite{Structure} that generalizes the BA model in the following sense, they incorporate the initial state of the nodes in the network and the degree ($k$) is dependent on the initial state ($s$) and time ($t$). They come up with a dynamics that achieves power law when the degree is very large i.e. $p(k) \propto k^{-\gamma}$ when $k \rightarrow \infty$ and $\gamma \in (2,\infty)$. The average connectivity $k(s,t) \propto (s/t)^{-\beta}$ as $(s/t) \rightarrow 0$. This generalization makes the model very unrealistic because $\gamma \in (2,\infty)$ whereas in reality $\gamma \in (2,3]$, as supported by AB model. \subsection{Antal-Krapivsky-Redner (AKR) Model} The AKR model \cite{Dynamics} generalizes the BA model by considering a graph in which the links are associated with a notion of friendship (+1) or enmity (-1) and the notion of a node is replaces by a collection of three nodes linked with either (+1) or (-1) links, which is called a triad. The model defines a notion of a balance which is the product of all the values of the links in a particular triad. If this product is equal to 1 then it is called \emph{balanced} otherwise it is called \emph{imbalanced}. In this model, the authors define a dynamics that tries to maintain the balance of the triads and describes how the degree of a link (which is the number of triads in which it is involved) changes with time as the network is allowed to evolve according to the dynamics. They derive a set of differential equations that governs this rate and solve them to get a distribution same as the power law. \subsection{Sole-Pastor-Satorras-Smith-Kepler (SPSK) Model} The Sol$\acute{e}$, Pastor-Satorras, Smith, Kepler (SPSK) model \cite{proteome evolution} uses 3 mechanisms \emph{duplicate}, \emph{divergence} and \emph{mutate} for the process of evolution. Using the operation \emph{Duplicate} one can copy a randomly selected node along with its connections, using \emph{Divergence} operation one can delete some connections made after the duplicate operation and the \emph{Mutate} operation allows us to add connections once the duplicate operation is applied. It has been shown by them that this generalization produces the \emph{power law} but leads to unrealistic assortativity and clustering. This is a generalization of the BA model because it allows more possible ways of connection of a new node with the existing graph. \includegraphics[scale = 0.65]{9} It is customary to note that there have been some generalizations of preferential attachment model that are based on the addition and deletion of nodes \cite{Topological,Exact solutions}. \section{Our Contribution} In this paper we present a new model that generalizes the BA model. As compared to the previous models our model is a natural generalization of the BA model and is more intuitive than the previous generalizations. It uses the combinatorial properties of the given graph and does not create unrealistic links as in the case of SPSK model and DMS model. Our model has two variants, one of which generates scale free networks (as in BA model) and the other one gives rise to a family of graphs in which the degree distribution follows the stretched exponential distribution rather than the power law, which is similar to the SPSK model. In the following sections we describe in detail our proposed model and also discuss the properties of the two variants of the model. \section{Preliminaries} We model the network as an undirected graph in which nodes represent the network members and an undirected edge represents a relationship between them. Initially the graph is considered to have $n_0$ number of nodes with a few links $m_0$. Our evolution process crucially uses the notion of cuts which is an important combinatorial property of a graph. Given a graph $G = (V,E)$ a subset of vertices $S$ and $\bar{S}= V\backslash S$, a \emph{Cut} is defined as the set $E(S,\bar{S})$ $= \{(a,b) | a \in S \mbox{ and } b\in \bar{S}\}$. Our evolution process uses the size of the cut crucially making it substantially different from all the prior models that do not use the notion of cut in any way. We also define a $k$-neighborhood of a particular vertex $v$ as the number of nodes of $G$ which are with in a distance $k$ from the node $v$. Thus $B(v,k) = \{u | d(v,u) \leq k \}$. We also define the set $B'(v,k)$ as the set \\ $\{u\in B(v,k) | (u,v) \in E(B(v,k), \overline{B(v,k)}); v \in \overline{B(v,k)} \}$ \section{The EvoCut Model} In this section we introduce our model and describe in detail its two variants. In the first variant a new node is attached to a node which has the maximum pulling power which is based on the size of the $k$-neighborhood of that node whereas in the second variant the node is attached to a randomly chosen node which is on the boundary of the $k$-neighborhood set of the node with maximum pulling power. \begin{algorithm} \SetAlgoLined $G_0 = (V_0,E_0)$ ; $t = 0$; $|V_0| = n_0$ and $E_0 = m_0$, $k = k_o$, $Y = 0$, $m = 0$\; \While{($n_t \leq N$)}{ Let $v_t$ be the new node at time $t$\; \For{$v \in V_t$}{ Compute $x = |E(B(v,k), \overline{B(v,k)}|$\; $Y = Y + x$\; } Compute $x_v = \mbox{max}_v\{\frac{|E(B(v,k), \overline{B(v,k)}|}{Y}$\}\; Compute $v'= \mbox{argmax}_v\{x_v\}$\; $E_t = E_t \bigcup (v_t,v'); V_t = V_t \bigcup v_t$\; $t = t+1$\; $Y = 0$\; } \caption{Model A} \end{algorithm} \begin{algorithm} \SetAlgoLined $G_0 = (V_0,E_0)$ ; $t = 0$; $|V_0| = n_0$ and $E_0 = m_0$, $k = k_o$, $Y = 0$, $m = 0$\; \While{($n_t \leq N$)}{ Let $v_t$ be the new node at time $t$\; \For{$v \in V_t$}{ Compute $x = |E(B(v,k), \overline{B(v,k)}|$\; $Y = Y + x$\; } Compute $x_v = \mbox{max}_v\{\frac{|E(B(v,k), \overline{B(v,k)}|}{Y}$\}\; Select a node $v'$ randomly uniformly from the set $B'(v,k)$\; $E_t = E_t \bigcup (v_t,v'); V_t = V_t \bigcup v_t$\; $t = t+1$\; $Y = 0$\; } \caption{Model B} \end{algorithm} \section{Properties of the EvoCut Model} In this section we describe in detail the properties and the reasoning behind coming up with these models. In this model we allow the nodes to be attached one by one and the pulling power of a particular node is defined by the size of the cut $E(B(v,k), \overline{B(v,k)}$ which the number of edges in the $k$-neighborhood of the node $v$ where $k$ is a parameter between $[0-(n-1)]$. The pulling power is same for both the models $A$ and $B$. The other features of the models is being mentioned in the following subsections. \subsection{Model A - Deterministic Case} In this model a particular node is attached to that node which has the maximum pulling power based on a given value of $k$. This model is thus fully \emph{deterministic} i.e. doesn't use any source of randomness. The process starts with an initial graph $G_0 = (V_0,E_0)$ and goes until the number of nodes in the graph is less than $N$. Every time when a new node arrives, the \textbf{for} loop computes the normalizing factor \begin{eqnarray} \sum_{v}|E(B(v,k), \overline{B(v,k)}| \end{eqnarray} and the later part of the model computes the node $v$ that maximizes the ratio \begin{eqnarray} \frac{B(v,k)}{\sum_{u}|E(B(u,k), \overline{B(u,k)}|} \end{eqnarray} and attaches the new node with this node. \subsection{Model B - Randomized Case} In this model a particular node is attached to a randomly chosen node on the boundary of the set $B(v,k)$. The boundary is defined as the nodes in $B(v,k)$ which are incident to the edges in the set $E(B(v,k), \overline{B(v,k)}$. This model thus uses randomness in choosing the node to which the incoming node should be added. As in the previous case the model first computes the node $v$ that maximizes the factor \begin{eqnarray} \frac{B(v,k)}{\sum_{u}|E(B(u,k), \overline{B(u,k)}|} \end{eqnarray} and then randomly chooses a node from the set $B'(v,k)$ and attach the new node with that node. \subsection{As a Generalization of BA Model} One can observe that in both the models mentioned above if we fix the parameter $k$ as 0, then we get the (BA) model. This is simply because when $k=0$, $B(v,k) = v$ and the set $E(B(v,k), \overline{B(v,k)}$ is equal to the degree of $v$ and in that case the attaching probability distribution is exactly equal to the degree distribution of the graph at time $t$ which is same as the BA model. Thus, in our model, only the special case of $k=0$ results in the BA model. \section{Experimental Results and Analysis} In this section we present the degree distributions that we obtain as we let our model to evolve on a set of nodes with certain initial condition. \subsection{Analysis of Model A} The following are the plots that we obtain once the degree distributions are generated for \emph{Model A}. \includegraphics[scale = 0.29]{m11.png} \includegraphics[scale = 0.29]{m12.png} According to the plots that are generated we can infer the following: \begin{itemize} \item For small values of $k$ this model gives rise to a scale free distribution when $k$ is even and for larger values of $k$ the degree distribution follows the \emph{stretched exponential distribution} in the log-scale. This in turn implies that in the normal scale the plot ensures that the number of nodes with high degree is fairly large as compared to the \emph{scale free distribution} which implies that for large values of $k$ there are several nodes with high degree. \item The intuitive reasoning for the aforementioned result is that for small values of $k$ this model behaves basically similar to the BA model. Whereas for larger values of $k$ we can observe that once a new node gets attached to the already existing node the pulling power of the already existing node does not increase and the pulling power of the $k^{th}$-neighbor increases. This phenomenon creates some sort of an oscillation on the increase in the degree of the certain number of nodes which implies that this set of nodes experience enhancement of degree simultaneously. This explains the \emph{stretched exponential distribution} in the log-scale for larger values of $k$. \end{itemize} \subsection{Analysis of Model B} The following are the plots that we obtain once the degree distributions of \emph{Model B} are generated and based on these we infer the following \begin{itemize} \item As said earlier in this model the incoming node is attached to that node which is on the boundary of the $k$-neighborhood of the node that maximizes the objective function. \item From the plots, it is clear that for both small and large values of $k$ we get a \emph{power law} distribution. This observation can be explained intuitively as follows: since the incoming node $x$ is getting attached to a node which is on the boundary of the $k$-neighborhood of a node $y$, the pulling power of node $y$ increases with time because it is defined as the number of edges on the boundary of the $k$-neighborhood of $y$ and hence in further iterations the node $y$ gets enhancement in its power. \item This makes the model a generalization of the BA model which is quite similar to it. \end{itemize} \includegraphics[scale = 0.29]{m21.png} \includegraphics[scale = 0.29]{m22.png} \section{Comparison with Prior Models} In this section we compare our models with the prior generalizations of the BA model and also discuss how close to reality these models can be considered. \subsection{Comparison with DMS Model} As mentioned before, the DMS model starts with an initial state and the degree of the node is dependent on the initial state of the evolution process, a feature which our models also possess. The DMS model achieves the power law for large values of the degree whereas in our case the Model B achieves power law even for small values of the degree. \subsection{Comparison with AKR Model} In the AKR model the authors come up with a notion of a balance of the values present in a triad which is a collection of three nodes and the directed links among them. The dynamics of the model tries to maintain the balance of the triads. This model, although a generalization of the BA model uses only \emph{local} modifications whereas our models are \emph{global} in the sense that each node looks around a $k$-neighborhood where $k$ can be fairly large. This allows our model to look at the global influence of the nodes which is not present in the AKR model. \subsection{Comparison with SPSK Model} In the SPSK Model, the evolution of the graph is based on some operations done on the original graph called \emph{duplicate}, \emph{divergence} and \emph{mutate}. This make the model very restrictive because a node can only get attached to the existing graph by performing a duplicate operation which is basically the replication of the connection of an already existing node. Our models are not restrictive in that sense and a new node is not forced to follow the topology of an already existing node and is attached purely based on the pulling power of a particular node. Despite the difference in nature of SPSK and our models we observe that the degree distribution of this model and Model A proposed by us is quite similar and follows the stretched exponential distribution. \section{Real Life Implications of EvoCut} One of the important questions regarding the models of evolution of complex networks is how realistic are they. The BA model although satisfactory is not considered to be very realistic. Thus there is definitely a need to come up with models which not only give rise to the power law distribution but are also realistic. In this section we justify how our models can explain the realities of certain complex networks. In the case of Model A, as we had observed that this model leads to a degree distribution \cite{power-law networks} in which there are lots of nodes with large degrees. Although this doesn't follow the scale free property but explains the nature of some real political networks. It is well known that \cite{Stretched exponential} the stretched exponential distribution describe very well the distributions of radio and light emissions from galaxies, of country population sizes, of daily Forex US-Mark and Franc-Mark price variations, of Vostok temperature variations and of citations of the most cited physicists in the world. This type of distribution may not be considered to be explainable by the BA model and its generalizations which tend to result in a power law distribution, but can be explained by Model A. \\ In the case of Model B we notice that since the model looks at a $k$-neighborhood of a particular node to compute its pulling power this allows us to look at a larger influence of a node as compared to the standard BA model. In fact in realistic scenarios one can conceive of several situations in which when a new node comes it doesn't get attached to the node with maximum pulling power but gets attached to a node which is at a certain distance from the node. Consider the example of celebrities in real life networks, when a person considers himself as a follower of a particular celebrity then he gets himself linked to another follower of the same celebrity rather than directly getting linked with the celebrity, and this follower might as well not be one of the closest to the celebrity i.e. one gets attached to a \emph{fan club} rather than the celebrity himself. \\ We can also consider the example of any hierarchical ecosystem \cite{Hierarchical} present in an organization like judiciary, police, banking system or a corporation in which any customer is not allowed to connect with the highest authority in that system but gets connected to a node that is lowest in that hierarchy. This notion is being captured in the case of Model B, in the sense that the $k$-neighborhood of a node basically creates a hierarchy around that node considering that node as most powerful. As the distance from the node increases we get down in the hierarchy, and hence when a new node comes under the influence of the $k$-neighborhood of a particular node at the $k^{th}$ level of the hierarchy. \\ \includegraphics[scale = 0.46]{corporate.jpeg}\\ Consider the aforementioned figure in which the CEO represents the node whose pulling power is being computed and the 1-neighborhood of it consists of VP of Sales and VP of Service, the 2-neighborhood consists of Sales Managers and Service Managers and the 3-neighborhood consists of Sales and Support. Thus when an new customer comes it is likely to get in touch with the 3-neighborhood rather than the CEO. Thus in several scenarios Model B gives a better picture of the evolution of the network and hence is much more realistic than the BA model. \section{Conclusion and Future Work} In this paper, we have presented a new generalization of the Barab\'asi-Albert (BA) model that is based on the neighborhood properties of nodes in the evolving graph. This generalization is substantially different from the previous generalizations of the BA model and one of its variant gives rise to the power law distribution and can model the growth of several real life networks which don't seem to be explainable by the BA model. The other variant of our Model, despite the fact doesn't give the scale free property models the growth of some other real life networks and gives rise to a stretched exponential distribution. We believe that our model is very powerful and further investigation into it can make it a stronger candidate in understanding the growth of several complex networks. \\ As part of future work it would interesting to get a mathematical proof of the distribution generated by our models and also discover new interesting variants of our model.
{'timestamp': '2018-03-02T02:07:56', 'yymm': '1803', 'arxiv_id': '1803.00263', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00263'}
arxiv
\section{Introduction}\label{sec:intro} Graphical causal models are popular tools for reasoning about assumed causal relationships between random variables and their implications \citep{Pearl2009,Elwert2013}. Such models represent the mechanisms that are assumed to generate an observed joint probability distribution. By analyzing the model structure, one can deduce which variables introduce potential bias (confounding) when the causal effect of exposure variables ($ {\bf X} $) on outcome variables ($ {\bf Y} $) is to be determined. \highlightrevision{r3c2}{ In population research within Epidemiology \citep{RothmanGL2008}, the Social Sciences \citep{Elwert2013}, or Econometrics, causal inference often needs to be based on observational rather than experimental data for practical or ethical reasons. Confounding is a major threat to causal inference in such applications. } A traditional approach to address confounding is to simply adjust for (e.g., by stratification) as many covariates as possible that temporally precede the exposure variable (pre-exposure variables) \cite{Shrier2008,Rubin2008}. This practice has roots in the analysis of data from randomized trials, in which confounding can only occur by chance. For observational data, however, it can be easily shown using graphical causal models that conditioning on pre-exposure variables can induce dependencies between other pre-treatment variables that affect exposure and outcome (Figure~\ref{fig:mbias}). If those variables have not been or cannot be measured (e.g., if we could not observe variable MR in Figure~\ref{fig:mbias}), then we could increase rather then reduce bias by conditioning on a pre-exposure variable. Such examples show that it is impossible to decide which covariates one should adjust for to address confounding without at least some knowledge of the causal relationships between the involved covariates. To our knowledge, graphical causal models are currently the only causal inference framework in which it is possible to state a set of causal assumptions and derive from those assumptions a conclusive answer to the question whether, and how, a causal effect of interest is identifiable via covariate adjustment. Covariate adjustment is not complete for identification; other methods like the front-door criterion \cite{Fulcher2017} or do-calculus \cite{Pearl2009} can permit identification even if covariate adjustment is impossible. \highlightrevision{r1c2}{When multiple options are available, however, adjustment may be an attractive option for effect estimation because its statistical properties are well understood, giving access to useful methodology like robust estimators and confidence intervals.} A famous result that characterizes valid sets of variables for covariate adjustment in a given graphical model is the back-door criterion by Pearl \citet{Pearl2009}. We call such sets of variables \emph{adjustment sets} or simply \emph{adjustments}. Although the back-door criterion is \emph{sound}, meaning that sets fulfilling the criterion are indeed valid adjustments, it is not \emph{complete} -- not all valid adjustments fulfill the criterion. It is even possible that none of the valid adjustments in a causal model fulfill the back-door criterion, which would lead a user to incorrectly conclude that a different method is required. Shpitser and colleagues \cite{ShpitserVR2010} gave the first sound and complete criterion to characterize adjustments in DAGs. This criterion achieves completeness by weakening the simple but overly restrictive condition in the back-door criterion that adjustment sets must not contain any descendants of the exposure variable; such variables can be allowed provided they do not block causal paths or create new biasing paths. However, a characterization of adjustment sets in terms of blocked paths does not yield a practical algorithm for adjustment set construction. Although enumerating all subsets of covariates and all paths would work, such a brute-force approach is only feasible in very small graphs. Thus, to help researchers find the most suitable strategy to identify a given causal effect, algorithmically efficient methods are needed that exhaustively characterize all available options. \begin{figure} \begin{center} \begin{tabular}{cccc} {\bf (a)} & {\bf (b)} & {\bf (c)} & {\bf (d)}\\ \begin{tikzpicture} \node [align=left] (z1) at (0,1.5) {FI}; \node [align=left] (z2) at (3,1.5) {MR}; \node (w) at (1.5,.75) {MD}; \node (x) at (0,0) {LE}; \node (y) at (3,0) {D}; \draw [very thick,->] (z1) -- (w); \draw [very thick,->] (z1) -- (x); \draw [->] (z2) -- (w); \draw [->] (z2) -- (y); \draw [very thick,->] (w) -- (y); \draw [->] (x) -- (y); \end{tikzpicture} & \begin{tikzpicture} \node [align=left] (z1) at (0,1.5) {FI}; \node [align=left] (z2) at (3,1.5) {MR}; \node [adjusted] (w) at (1.5,.75) {MD}; \node (x) at (0,0) {LE}; \node (y) at (3,0) {D}; \draw [very thick,->] (z1) -- (w); \draw [very thick,->] (z1) -- (x); \draw [very thick,->] (z2) -- (w); \draw [very thick,->] (z2) -- (y); \draw [->] (w) -- (y); \draw [->] (x) -- (y); \end{tikzpicture} & \begin{tikzpicture} \node [align=left] (z1) at (0,1.5) {FI}; \node [adjusted,align=left] (z2) at (3,1.5) {MR}; \node [adjusted] (w) at (1.5,.75) {MD}; \node (x) at (0,0) {LE}; \node (y) at (3,0) {D}; \draw [->] (z1) -- (w); \draw [->] (z1) -- (x); \draw [->] (z2) -- (w); \draw [->] (z2) -- (y); \draw [->] (w) -- (y); \draw [->] (x) -- (y); \end{tikzpicture} & \begin{tikzpicture} \node [adjusted,align=left] (z1) at (0,1.5) {FI}; \node [align=left] (z2) at (3,1.5) {MR}; \node [align=left] (w) at (1.5,.75) {MD}; \node (x) at (0,0) {LE}; \node (y) at (3,0) {D}; \draw [->] (z1) -- (w); \draw [->] (z1) -- (x); \draw [->] (z2) -- (w); \draw [->] (z2) -- (y); \draw [->] (w) -- (y); \draw [->] (x) -- (y); \end{tikzpicture} \end{tabular} \end{center} \caption{Causal diagram \cite[Chapter 12]{RothmanGL2008} describing the effect of low education (LE) on diabetes risk (D) with the covariates family income (FI), mother's genetic risk to develop diabetes (MR), and mother's diabetes (MD). The unadjusted estimate (a) is biased due to the common ancestor FI -- bias ``flows'' via the biasing path LE $\gets$ FI $\to$ MD $\to$ D (bold edges). Adjustment for MD (b) blocks this biasing path, but opens a new one by creating an association between FI and MR. The minimal adjustments $\{\text{MD},\text{MR}\}$ (c) and $\{\text{FI}\}$ (d) close all biasing paths. Note that, if both FI and MR were unmeasured, it would be impossible to know whether adjustment for only MD would increase or reduce bias. This shows that, unlike for experimental data, conditioning on pre-exposure variables can be both beneficial and detrimental in observational data.} \label{fig:mbias} \end{figure} This paper provides efficient algorithms that provide exhaustive answers to the question: Given a causal graph ${\cal G}$, which covariates ${\bf Z}$ can we adjust for to estimate the causal effect of the exposures ${\bf X}$ on the outcomes ${\bf Y}$? We address many variants of this question, such as requiring $ {\bf Z} $ to be minimal or minimum as well as imposing the constraint ${\bf I}\subseteq{\bf Z}\subseteq{\bf R}$ for given sets $ {\bf I},{\bf R} $. All our algorithms handle sets of multiple, possibly interrelated exposures ${\bf X}$ and outcomes $ {\bf Y} $, \highlightrevision{r2c47}{ which is important in applications such as case-control studies that screen several putative causes of a disease \citep{Greenland1994}}. The basis for our algorithms are theorems that reduce adjustment to $d$-separation or $m$-separation in a subgraph, combined with a generic, efficient and flexible algorithmic framework to find, verify, and enumerate separating sets. Our algorithms are guaranteed to find all valid adjustments for a given model with polynomial delay. Besides adjustment, the framework is potentially useful for other applications, as we illustrate by applying it to model consistency testing. We also perform an extensive empirical evaluation of the power of covariate adjustment compared to other identification techniques in random causal graphs. When there are multiple adjustments available, practical considerations can help to decide between these. We consider two different scenarios to help making such decisions. First, not all covariates might be equally well suited for adjustment. Measuring some variables may be difficult or expensive, or could be affected by substantial measurement error. For instance, in Figure~\ref{fig:mbias}, measuring the variable MR (the genetic risk inherited from the mother) would require knowledge of the genetic variants that lead to a higher diabetes risk and availability of the genomes of the mothers of all study participants, but under these circumstances, it could be measured rather reliably. The family income, on the other hand, could be determined rather easily using a questionnaire, which however could suffer from substantial bias (e.g., people with high incomes could be less willing to report them). In such cases adjustments in which some cost (such as measurement error) is minimized are potentially interesting. We provide algorithms to list only those sets that minimize a user-supplied cost function. Second, precision is an important issue when estimating effects. Even if adjustment for a certain variable is not required to minimize bias, it may still be desirable to adjust for that variable to increase precision, even if it means the resulting adjustment set is no longer minimal. In Figure~\ref{fig:mbias}, for example, variable MD (mother's diabetes) will likely be substantially correlated with variable D (child's diabetes), so its inclusion into the statistical model that estimates LE's effect on D might well increase precision even if this means that either FI or MR also need to be included. To allow such considerations, we consider the setting where we search for adjustment sets containing a pre-defined subset of variables. A model represented as a DAG assumes causal sufficiency, i.e., that every relevant variable is included in the model. If this is not the case and there are unknown latent variables, one can use a maximal ancestral graph (MAG) model that just specifies the ancestral relations between the variables \cite{Richardson2002}. An adjustment in a MAG remains valid when the MAG is extended by any number of additional latent variables as long as the ancestral relations and $m$-separating sets are preserved. This is an important feature because the assumption that all relevant confounders have been measured and included in a model is often unrealistic. We show that our entire algorithmic framework for computing adjustment sets can be generalized to MAGs, allowing practitioners to substantially relax the assumption of causal sufficiency that DAG-based analyses rely on. \newcommand{ et al. }{ et al. } \begin{table} \centering\begin{tabular}{ccc} &\multicolumn{2}{c}{\bf }\\ \bf Graph class & \bf First sound and complete criterion & \bf First sound and complete constructive criterion \\ DAGs & Shpitser et al. \cite{ShpitserVR2010} & this paper (conference version \cite{zander2014constructing}) \\ MAGs & this paper (conference version \cite{zander2014constructing}) & this paper (conference version \cite{zander2014constructing})\\ CPDAGs &Perkovi\'{c} et al. \cite{PerkovicEtAl2018} &van der Zander and Li\'{s}kiewicz \cite{vanderZander2016separators}\\ PAGs &Perkovi\'{c} et al. \cite{PerkovicEtAl2018} &Perkovi\'{c} et al. \cite{PerkovicEtAl2018}\\ CGs &van der Zander and Li\'{s}kiewicz \cite{vanderZander2016separators}&van der Zander and Li\'{s}kiewicz \cite{vanderZander2016separators}\\ maximal PDAGs & Perkovi\'{c} et al. \cite{PerkovicEtAl2017} & Perkovi\'{c} et al. \cite{PerkovicEtAl2017} \\ \end{tabular} \caption{ Using covariate adjustment to estimate causal effects: an overview of our results and related work for directed acyclic graphs (DAGs), maximal ancestral graphs (MAGs), completed partially directed acyclic graphs (CPDAGs), partial ancestral graphs (PAG), chain graphs (CGs), and maximally oriented partially directed acyclic graphs (PDAGs). A criterion is sound if it is only satisfied by adjustment sets. It is complete if every adjustment set satisfies it. It is constructive if it leads to an efficient algorithm for constructing an adjustment set. Paper \cite{zander2014constructing} is the preliminary conference version of this work, and all subsequent results are based on the techniques developed in this paper.}\label{table:related} \end{table} Beyond DAGs and MAGs, our proof techniques have been successfully applied to obtain complete and constructive adjustment criteria for several other classes of graphical causal models since the publication of our preliminary version~\cite{zander2014constructing}. Perkovi\'{c} et al. \cite{PerkovicEtAl2018} provide a generalized adjustment criterion (GAC) which is sound and complete for DAGs, CPDAGs, MAGs and PAGs. CPDAGs (PAGs) are a class of causal models where a single graph represents a Markov equivalence class of DAGs (MAGs), in which all DAGs (MAGs) have the same conditional independences. Such models occur naturally when learning models from observed data, where in general, several possible models are consistent with the data. Finally, in \cite{vanderZander2016separators} we were able to extend our techniques to chain graphs (CGs) and Perkovi\'{c} et al. \cite{PerkovicEtAl2017} applied these to maximally oriented partially directed acyclic graphs (PDAGs) -- graphs providing an elegant framework for modeling and analyzing a broad range of Markov equivalence classes. We summarize these results in Table~\ref{table:related}. In this paper, we focus on complete criteria for DAGs and MAGs because this substantially simplifies the presentation of the results, and the application of these techniques to other graph classes is relatively straightforward \cite[Section~4.3]{PerkovicEtAl2018}. This paper is structured as follows. % Section~\ref{sec:preliminaries} introduces notation and basic concepts. In Section~\ref{sec:algo}, we present algorithms for verifying, constructing, and listing $m$-separating sets $ {\bf Z} $ in ancestral graphs. All algorithms handle unconstrained separators, minimal and minimum separators, and the constraint $ {\bf I} \subseteq {\bf Z} \subseteq {\bf R} $ for given sets $ {\bf I},{\bf R} $. They subsume a number of earlier solutions for special cases of these problems, e.g., the Bayes-Ball algorithm for verification of $d$-separating sets \citep{Shachter1998} or the use of network flow calculations to find minimal $d$-separating sets in DAGs~\citep{TianPP1998,AcidC03}. Section \ref{sec:basissets} presents DAG consistency testing as a possible application of these algorithms beyond adjustment sets. In Section~\ref{sec:dagadjust}, we give a constructive back-door criterion (CBC) that reduces the construction of adjustment sets to finding separating sets in DAGs, explore variations of the CBC and compare it to Pearl's back-door criterion \cite{Pearl2009}. Section~\ref{sec:algorithms:adjustment} explains how to apply the algorithms of Section~\ref{sec:algo} to the graphs resulting from the criterion of Section~\ref{sec:dagadjust}, which yields polynomial time algorithms for verifying, constructing, and listing adjustment sets in DAGs. This combination leads to the first efficient implementation of the sound and complete adjustment criterion by Shpitser and colleagues \citet{ShpitserVR2010}. Section~\ref{sec:cbcext} extends our criterion by addressing some cases where, even though covariate adjustment is not possible, it is still not necessary to invoke the do-calculus since the causal effect can be identified in another simple manner. In Section~\ref{sec:experiments} we compare the results and performance of our adjustment criterion (with and without the extensions derived in Section~\ref{sec:cbcext}) with Pearl's back-door criterion as well as the IDC algorithm, which finds all identifiable causal effects, on randomly generated DAGs. Finally, in Section~\ref{sec:magadjust}, we extend our constructive back-door criterion of Section~\ref{sec:dagadjust} to MAGs, which generalizes the sound but incomplete adjustment criterion for MAGs without constraints by Maathuis and Colombo \cite{Maathuis2013}. \section{Preliminaries}\label{sec:preliminaries} We denote sets by bold upper case letters (${\bf S}$), and sometimes abbreviate singleton sets $\{S\}$ as $S$. Graphs are written calligraphically $({\cal G})$, and variables in upper-case $(X)$. \subsection{General background} \paragraph{Mixed graphs, walks and paths} We consider mixed graphs ${\cal G}=({\bf V},{\bf E})$ with nodes (vertices, variables) ${\bf V}$ and directed ($A \to B$), undirected ($A-B$), and bidirected ($A \leftrightarrow B$) edges ${\bf E}$. Nodes linked by an edge are \emph{adjacent} and \emph{neighbors} of each other. A \emph{walk} of length $n$ is a node sequence $V_1,\ldots,V_{n+1}$ such that there exists an edge sequence $E_1,E_2,\ldots,E_{n}$ for which every edge $E_i$ connects $V_{i},V_{i+1}$. Then $V_1$ is called the \emph{start node} and $V_{n+1}$ the \emph{end node} of the walk. A \emph{path} is a walk in which no node occurs more than once. Given a node set ${\bf X}$ and a node set ${\bf Y}$, a walk from $X \in {\bf X}$ to $Y\in{\bf Y}$ is called \emph{$ {\bf X} $-proper} if only its start node is in ${\bf X}$. If $ {\bf X} $ is clear from the context, it is omitted and we just say the path is \emph{proper}. Given a graph ${\cal G}=({\bf V},{\bf E})$ and a node set ${\bf V}'$, the \emph{induced subgraph} ${\cal G}_{{\bf V}'}=({\bf V}',{\bf E}')$ contains the edges ${\bf E}' = {\bf E}\cap ({\bf V}'\times{\bf V}')$ from ${\cal G}$ that are adjacent only to nodes in ${\bf V}'$. The \emph{skeleton} of ${\cal G}$ is a graph with the same nodes in which every edge is replaced by an undirected edge. A \emph{connected component} is a subgraph in which every pair of nodes is connected by a path. A subgraph containing only a single node is also a connected component. A connected component is a \emph{bidirectionally connected component} if for every pair of nodes there exists a connecting path that contains only bidirected edges. Throughout, $n$ stands for the number of nodes and $m$ for the number of edges of a graph. \paragraph{Ancestry} A walk of the form $V_1 \to \ldots \to V_n$ is \emph{directed}, or \emph{causal}. A non-causal walk is \emph{biasing}. A graph is \emph{acyclic} if no directed walk from a node to itself is longer than $0$. All directed walks in an acyclic graph are paths. If there is a directed path from $U$ to $V$, then $U$ is called an \emph{ancestor} of $V$ and $V$ a \emph{descendant} of $U$. A walk is \emph{anterior} if it were directed after replacing all edges $U - V$ by $U \to V$. If there is an anterior path from $U$ to $V$, then $U$ is called an \emph{anterior} of $V$. All ancestors of $V$ are anteriors of $V$. Every node is its own ancestor, descendant, and anterior. For a node set ${\bf X}$, the set of all of its ancestors is written as $\textit{An}({\bf X})$. The descendant and anterior sets $\textit{De}({\bf X})$, $\textit{Ant}({\bf X})$ are analogously defined. Also, we denote by $\textit{Pa}({\bf X})$, ($\textit{Ch}({\bf X})$, $\textit{Ne}({\bf X})$), the set of parents (children, neighbors) of ${\bf X}$. \paragraph{$m$-Separation} This concept is a generalization of the well-known $d$-separation criterion in DAGs \citep{Pearl2009} for ancestral graphs. A node $V$ on a walk $w$ is called a \emph{collider} if two arrowheads of $w$ meet at $V$, e.g., one possible collider is $U \leftrightarrow V \gets Q$. There can be no collider if $w$ is shorter than 2. Two nodes $U,V$ are called \emph{collider connected} if there is a path between them on which all nodes except $U$ and $V$ are colliders. Adjacent vertices are collider connected. Two nodes $U,V$ are called \emph{$m$-connected} by a set ${\bf Z}$ if there is a path $\pi$ between them on which every node that is a collider is in $\textit{An}({\bf Z})$ and every node that is not a collider is not in ${\bf Z}$. Then $\pi$ is called an $m$-connecting path. The same definition can be stated simpler using walks: $U,V$ are called $m$-connected by ${\bf Z}$ if there is a walk $w$ between them on which all colliders and only colliders are in ${\bf Z}$. Similarly, such $w$ is called an $m$-connecting walk. If $U,V$ are $m$-connected by the empty set, we simply say they are $m$-connected. If $U,V$ are not $m$-connected by ${\bf Z}$, we say that ${\bf Z}$ \emph{$m$-separates} them or \emph{blocks} all paths between them. Two node sets ${\bf X},{\bf Y}$ are $m$-separated by ${\bf Z}$ if all their nodes are pairwise $m$-separated by ${\bf Z}$. \paragraph{DAGs and ancestral graphs} A DAG is an acyclic graph with only directed edges. A mixed graph ${\cal G}=({\bf V},{\bf E})$ is called an \emph{ancestral graph} (AG) \citep{Richardson2002} if the following two conditions hold: (1) For each edge $A\gets B$ or $A \leftrightarrow B$, $A$ is not an anterior of $B$. (2) For each edge $A-B$, there are no edges $A \gets C$, $A \leftrightarrow C$, $B \gets C$ or $B \leftrightarrow C$. From these conditions it follows that there can be at most one edge between two nodes in an AG. \highlightrevision{r2c12}{ If one restricts AGs to graphs consisting of only directed and bidirected edges, as we do in Section~\ref{sec:magadjust}, then a simple and intuitive equivalent definition characterizes an AG as a graph without directed and almost-directed cycles, i.e., without subgraphs of the form $V_1 \to \ldots \to V_n \to V_1$ or $V_1 \leftrightarrow V_2 \to \ldots \to V_n \to V_1$.} Syntactically, all DAGs are AGs and all AGs containing only directed edges are DAGs. An AG ${\cal G}=({\bf V},{\bf E})$ is a \emph{maximal ancestral graph} (MAG) if every non-adjacent pair of nodes $U,V$ can be $m$-separated by some ${\bf Z} \subseteq {\bf V} \setminus\{U,V\}$. It is worth noting that syntactically a DAG is also a MAG \cite{Zhang2008}. Moreover every AG ${\cal G}$ can be turned into a MAG ${\cal M}$ by adding bidirected edges between node pairs that cannot be $m$-separated, which preserves all $m$-separation relationships in the graph~\citep[Theorem 5.1]{Richardson2002}. \paragraph{Graph transformations} A DAG ${\cal G} = ({\bf V},{\bf E})$ is represented by a MAG ${\cal M} = {\cal G}[^{\bf S}_{\bf L}$ with nodes $ {\bf V} \setminus ({\bf S} \cup {\bf L}) $ for sets ${\bf S},{\bf L}\subseteq{\bf V}$, whereby $ {\cal M} $ has an edge between a pair of nodes $U,V$ if $U,V$ cannot be $d$-separated in ${\cal G}$ by any ${\bf Z}$ with ${\bf S} \subseteq {\bf Z} \subseteq {\bf V}\setminus{\bf L}$. That edge has an arrowhead at node $ V $, if $V \notin \textit{An}(U \cup {\bf S})$. Notice that for empty ${\bf S}$ and ${\bf L}$ we have ${\cal G}[_{\emptyset}^{\emptyset}={\cal G}$. The \emph{canonical DAG} ${\cal C}({\cal M})$ of a MAG ${\cal M}$ is the DAG obtained from ${\cal M}$ by replacing every $\leftrightarrow$ edge with $\gets L \to$ and every $-$ edge with $\to S \gets$ with new nodes $L$ or $ S $ which form sets ${\bf L}$, ${\bf S}$. Clearly ${\cal C}({\cal M})[^{\bf S}_{\bf L} = {\cal M}$ (for more details see \citep{Richardson2002} or Section~\ref{sec:magadjust} in our paper). The \emph{augmented graph} $({\cal G})^a$ of a certain AG ${\cal G}$ is an undirected graph with the same nodes as ${\cal G}$ whose edges are all pairs of nodes that are collider connected in ${\cal G}$. Two node sets ${\bf X}$ and ${\bf Y}$ are $m$-separated by a node set ${\bf Z}$ in ${\cal G}$ if and only if ${\bf Z}$ is an ${\bf X}$-${\bf Y}$ node cut in $({\cal G}_{\textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf Z})})^a$ \citep{Richardson2002}. For DAGs the augmented graph is also called the moralized graph, so the construction of the augmented graph is termed \emph{moralization}. For any subset ${\bf A}$ and ${\bf B}$ of ${\bf V}$, by ${\bf A} \to {\bf B}$ we denote the set of all edges $A \to B$ in ${\bf E}$, such that $A \in {\bf A}$ and $B\in {\bf B}$; the sets ${\bf A} \gets {\bf B}$, ${\bf A} \leftrightarrow {\bf B}$, and ${\bf A} - {\bf B}$ are defined analogously. \highlightrevision{r2c13}{Pearl's do-calculus \cite{Pearl2009} defines the following two transformations.} First, the graph obtained from a graph $ {\cal G} = ({\bf V},{\bf E}) $ by removing all edges entering ${\bf X}$ is written as $ {\cal G}_{\overline{{\bf X}}} = ({\bf V}, {\bf E} \setminus (( {\bf V} \to {\bf X} ) \cup ( {\bf V} \leftrightarrow {\bf X} ) )) $. Second, the removal of all edges leaving $ {\bf X} $ is written as $ {\cal G}_{\underline{{\bf X}}} = ({\bf V}, {\bf E} \setminus (( {\bf X} \to {\bf V} ) \cup( {\bf X} - {\bf V} ) )) $. The application of both these operations $ ({\cal G}_{\overline{{\bf X}}})_{\underline{{\bf X}'}} $ is abbreviated as $ {\cal G}_{\overline{{\bf X}}\underline{{\bf X}'}} $ matching the notation of do-calculus \cite{Pearl2009}. Descendants and ancestors in these graphs are written as set subscript at the corresponding function without specifying the graph, e.g., $ \textit{De}_{\overline{{\bf X}}} $ or $ \textit{An}_{\underline{{\bf X}}} $. This notation is used for DAGs and MAGs. Note that for DAGs in each case only the first kind of edges needs to be removed as there are no $\leftrightarrow$ or $-$ edges in DAGs. \subsection{Identification via covariate adjustment} \paragraph{Do-operator and identifiability}% A DAG ${\cal G}$ encodes the factorization of a joint distribution $P$ for the set of variables ${\bf V}=\{X_1,\ldots,X_n\}$ as $P({\bf v})=\prod_{j=1}^n P(x_j \mid \textit{pa}_j)$, where $\textit{pa}_j$ denotes a particular realization of the parent variables % of $X_j$ in ${\cal G}$. When interpreted causally, an edge $X_i \to X_j$ is taken to represent a direct causal effect of $X_i$ on $X_j$. Formally, this can be defined in terms of the do-operator \cite{Pearl2009}: Given DAG ${\cal G}$ and a joint probability density $P$ for ${\bf V}$ the post-intervention distribution can be expressed in a truncated factorization formula \begin{equation}\label{do:truncated:formula} P({\bf v} \mid \textit{do}({\bf x})) = \left\{ \begin{array}{ll} \displaystyle \prod_{ X_j \in{\bf V} \setminus {\bf X}} P(x_j \mid \textit{pa}_j)& \text{for ${\bf v}$ consistent with ${\bf x}$,} \\[1mm] 0& \text{otherwise,} \end{array} \right. \end{equation} where ``${\bf v}$ consistent with ${\bf x}$'' means that ${\bf v}$ and ${\bf x}$ assign the same values to the variables in ${\bf X} \cap {\bf V}$. For disjoint ${\bf X},{\bf Y}\subseteq {\bf V}$, the \emph{(total) causal effect} of ${\bf X}$ on ${\bf Y}$ is $P({\bf y} \mid \textit{do}({\bf x}))$ where $\textit{do}({\bf x})$ represents an intervention that sets ${\bf X}={\bf x}$. In a DAG, this intervention corresponds to removing all edges into ${\bf X}$, disconnecting ${\bf X}$ from its parents, i.e., constructing the graph ${\cal G}_{\overline{{\bf X}}}$. When all variables in ${\bf V}$ are observed (we model this by setting ${\bf R}={\bf V}$), the causal effect $P({\bf y} \mid \textit{do}({\bf x}))$ of ${\bf X}$ on ${\bf Y}$ in a given graph ${\cal G}$ can be determined uniquely from the pre-intervention distribution $P$ using the factorization above. However, when some variables are unobserved, the question whether $P({\bf y} \mid \textit{do}({\bf x}))$ is \emph{identifiable}, i.e., if it can be computed from the pre-intervention distribution independent of the unknown quantities for the unobserved variables ${\bf V}\setminus {\bf R}$, becomes much more complex. For a formal definition of identifiability see~\cite[Section 3.2]{Pearl2009}. Figure~\ref{fig:notident:ident:viaadj} shows an example DAG ${\cal G}_1$ for which the causal effect of $X$ on $Y$ is not identifiable, and two DAGs ${\cal G}_2$ and ${\cal G}_3$ for which the effect is identifiable. \paragraph{Adjustment sets} Identification via covariate adjustment, studied in this paper, is defined for DAGs below and can be extended to MAGs in the usual way \citep{Maathuis2013} (we will give a formal definition Section~\ref{sec:magadjust}). \begin{definition}[Covariate adjustment \cite{Pearl2009}] \label{def:adjustment:set} Given a DAG ${\cal G}=({\bf V},{\bf E})$ and pairwise disjoint ${\bf X},{\bf Y},{\bf Z} \subseteq {\bf V}$, ${\bf Z}$ is called \emph{adjustment set for estimating the causal effect of ${\bf X}$ on ${\bf Y}$}, or simply \emph{adjustment} (set), if for every distribution % $P$ consistent with ${\cal G}$ we have \begin{equation}\label{eq:adjustment:def} P({\bf y}\mid \textit{do}({\bf x})) = \left\{ \begin{array}{ll} P({\bf y}\mid {\bf x}) & \text{if ${\bf Z} = \emptyset$,}\\[2mm] \sum_{{\bf z}} P({\bf y}\mid {\bf x},{\bf z}) P({\bf z}) & \text{otherwise.} \end{array} \right. \end{equation} \end{definition} \begin{figure} \centering ${\cal G}_1$: \begin{tikzpicture}[xscale=0.8,baseline=1em] \node (X) at (0,0) {$X$}; \node (U) at (1,1) {$U$}; \node (Y) at (2,0) {$Y$}; \graph { (X) -> (Y) ; (X) <- (U) -> (Y) ; }; \end{tikzpicture} \hspace*{10mm}${\cal G}_2$: \begin{tikzpicture}[xscale=0.8,baseline=1em] \node (X) at (-0.5,0) {$X$}; \node (U) at (1,1) {$U$}; \node (Z) at (1,0) {$V$}; \node (Y) at (2.5,0) {$Y$}; \graph { (X) -> (Z) -> (Y) ; (X) <- (U) -> (Y) ; }; \end{tikzpicture} \hspace*{10mm}${\cal G}_3$: \begin{tikzpicture}[xscale=0.8,baseline=1em] \node (X) at (-0.5,0) {$X$}; \node (U) at (0.0,1) {$U$}; \node[adjusted] (Z) at (1.5,1) {$Z$}; \node (V) at (1,0) {$V$}; \node (Y) at (2.5,0) {$Y$}; \graph { (X) -> (V) -> (Y) ; (X) <- (U) -> (Z) -> (Y) ; (V) -> (Y)}; \end{tikzpicture}\caption{Identification of $P(y \mid \textit{do}(x))$ in graphs with the unobserved nodes ${\bf V}\setminus{\bf R}=\{U\}$: In ${\cal G}_1$ the effect is not identifiable. In ${\cal G}_2$, it is identifiable (using the front-door method \cite{Pearl2009}) but for this DAG no adjustment set ${\bf Z}$ exists, with ${\bf Z}\subseteq{\bf V}\setminus\{U\}$. In ${\cal G}_3$ the effect can be identified via adjustment ${\bf Z}=\{Z\}$. } \label{fig:notident:ident:viaadj} \end{figure} Identification via covariate adjustment is not complete in the sense that there exist graphs for which $P({\bf y}\mid \textit{do}({\bf x}))$ is identifiable but for which no adjustment set ${\bf Z}$, with ${\bf Z} \subseteq {\bf R}$, exists. For an example of such a DAG see Figure~\ref{fig:notident:ident:viaadj}. In \cite{pearl1995causal} (see also \cite[Section~3.4]{Pearl2009}) Pearl introduced the \emph{do-calculus} of intervention that was proven to be complete for identifying causal effects \cite{shpitser2006identification,huang2006pearl}. Based on the rules of the do-calculus, the IDC algorithm proposed by Shpitser and Pearl \cite{ShpitserIDCAlgorithm} computes a formula for $P({\bf y} \mid \textit{do}({\bf x}))$ if (and only if) the effect is identifiable. \highlightrevision{r1c1}{ Researchers might thus use IDC to decide if an effect of interest is identifiable at all, and then use one of the algorithms provided in this paper to verify if identification is also possible via adjustment, which has some statistically favorable properties.} However, for complex graphs, it may not be practical to run the IDC algorithm as we show later, whereas adjustment sets can still be found quickly if they exist. \paragraph{Minimality} In this paper we present methods for computing an adjustment set that satisfies the condition of Definition~\ref{def:adjustment:set} for a given instance. An important feature of our approach is that it allows also to find adjustment sets satisfying some additional desirable constraints, e.g., minimality. Below we define this notion formally both for adjustment and separation sets. For pairwise disjoint ${\bf X},{\bf Y},{\bf Z} \subseteq {\bf V}$, and a subset ${\bf M}$ of ${\bf V}$, an $m$-separator (resp. adjustment set) ${\bf Z}$ relative to $({\bf X},{\bf Y})$ is \textit{${\bf M}$-minimal}, if ${\bf M}\subseteq {\bf Z}$ and no set ${\bf Z}' \subsetneq {\bf Z}$ with ${\bf M} \subseteq {\bf Z}'$ is an $ m $-separator (adjustment set) relative to $({\bf X},{\bf Y})$. An $ m $-separator (adjustment) ${\bf Z}$ is \textit{$ {\bf M} $-minimum} according to a cost function $w: {\bf V}\to \mathbb{R}^+$ if ${\bf M}\subseteq {\bf Z}$ and no $ m $-separator (adjustment) ${\bf Z}'$ with ${\bf M} \subseteq {\bf Z}'$ and $ \sum_{Z\in{\bf Z}'} w(Z) < \sum_{Z\in{\bf Z}} w(Z) $ exists. In particular, $\emptyset$-minimality ($\emptyset$-minimum) coincides with the standard notion of minimality (minimum), which we will also call \emph{strong-minimality} (\emph{strong-minimum}). A more detailed explanation of these concepts along with some examples is provided in Section~\ref{sec:sepalgo:dense}. While ${\bf M}$-minimality is defined with respect to any set ${\bf M} \subseteq {\bf V}$, in this paper we will only consider the two cases ${\bf M}=\emptyset$ and ${\bf M}={\bf I}$, i.e., we consider $m$-separators and adjustments ${\bf Z}$ that are supersets of the constraining set ${\bf I}$. For a given constraining set ${\bf I}$ we will abbreviate the ${\bf I}$-minimal/minimum ${\bf Z}\supseteq {\bf I}$ as \emph{weakly-minimal/minimum} or just as \emph{minimal/minimum}. Note a subtle, but important difference between weak and strong minimality. For example, the existence of a weakly-minimal $m$-separator does not necessarily imply that a strongly-minimal separator exists. E.g., in the DAG $X \to I \gets V \to Y$, set ${\bf Z}=\{I,V\}$ is an $I$-minimal $d$-separator relative to $(X,Y)$ but in the graph there exists no strongly-minimal $d$-separator ${\bf Z}'$, with $I \subseteq {\bf Z}'$. On the other hand, it is easy to see that every strongly-minimal $m$-separator ${\bf Z}$, with ${\bf I}\subseteq {\bf Z}$, is also an ${\bf I}$-minimal one and the same holds for the minimum sets. \section{Algorithms for $m$-separation in ancestral graphs} \label{sec:algo} In this section, we compile an algorithmic framework for solving a host of problems related to verification, construction, and enumeration of $m$-separating sets in an ancestral graph ${\cal G} = ({\bf V},{\bf E})$ with $n$ nodes in ${\bf V}$ and $m$ edges in ${\bf E}$. The problems are defined in Table~\ref{fig:problems}, which also shows the asymptotic runtimes of our algorithms. % The goal is to test or to output % either arbitrary $m$-separating sets ${\bf Z}$ without further constraints or $m$-separating sets that have a minimal size, so that no node can be removed from the set without turning it into a non-separating set. A further constraint is that ${\bf Z}$ should be bounded by arbitrary given sets ${\bf I} \subseteq {\bf R}$ as ${\bf I} \subseteq {\bf Z} \subseteq {\bf R}$. The variables in ${\bf I}$ will always be included in the $ m $-separating set, even if the set remains a separator without these variables. The set ${\bf V}\setminus{\bf R}$ corresponds to a set of \emph{unobserved} variables, which are known to exist, but have not been (or cannot be) measured. This constraint can also be used to model correlated errors between variables, i.e., rather than connecting such variables with a bidirected edge like in a semi-Markovian model, the variables are connected to another variable not in ${\bf R}$. Both constraints together are also an important technical tool for the design of efficient enumeration algorithms and the adjustment algorithms in the later sections. The rest of this section describes our algorithms solving these problems, which are mostly generalizations of existing algorithms from \citep{Acid1996,Shachter1998,TianPP1998,TextorLiskiewicz2011}. For each problem, we present the algorithm as a function of the same name as the problem, so that the association between problem and algorithm is easy to follow and the algorithms can be built upon each other. In contrast to the preliminary conference version of this work \cite{zander2014constructing}, we state the algorithms separately for sparse and dense graphs. We introduce the notion ${\bf M}$-minimality to analyze the minimal sets found by the algorithms and show that they find weakly-minimal separators, since finding strong-minimal separators is intractable. \begin{table*} \centering \begin{tabular}{lllll} &&&Runtime&Reference \\ \multicolumn{3}{l}{\textbf{Verification:} \text{For given ${\bf X}, {\bf Y},{\bf Z}$ and constraint ${\bf I}$ decide if $\ldots$ }} &&\\ \hspace*{2mm} & {\sc TestSep} & ${\bf Z}$ $m$-separates ${\bf X},{\bf Y}$ & ${\cal O}(n+m)$ &Proposition~\ref{prop:TestSep}\\ & {\sc TestMinSep} & ${\bf Z}\supseteq {\bf I}$ $m$-separates ${\bf X},{\bf Y}$ and ${\bf Z}$ is $\ldots$ &&\\ & & \hspace*{3mm} $ {\bf I} $-minimal & ${\cal O}(n^2)$ &Proposition~\ref{prop:TestMinSep}\\ & & \hspace*{3mm} strongly-minimal & ${\cal O}(n^2)$ &Proposition~\ref{prop:TestMinSep} \\[2mm] \multicolumn{3}{l}{\textbf{Construction:} \text{For given ${\bf X}, {\bf Y}$ and constraints ${\bf I}, {\bf R}$, output an $\ldots$}} & & \\ \hspace*{2mm} & {\sc FindSep} & $m$-separator ${\bf Z}$ with ${\bf I}\subseteq{\bf Z}\subseteq{\bf R}$ & ${\cal O}(n+m)$ &Proposition~\ref{prop:FindSep}\\ & {\sc FindMinSep} & $m$-separator ${\bf Z}$ with ${\bf I}\subseteq{\bf Z}\subseteq{\bf R}$ which is $\ldots$ &&\\ & & \hspace*{3mm} $ {\bf I} $-minimal & ${\cal O}(n^2)$ &Proposition~\ref{prop:FindMinSep}\\ & & \hspace*{3mm} strongly-minimal & NP-hard &Proposition~\ref{prop:np-complete}\\ & {\sc FindMinCostSep} & $m$-separator ${\bf Z}$ with ${\bf I}\subseteq{\bf Z}\subseteq{\bf R}$ which is $\ldots$ &&\\ & & \hspace*{3mm} $ {\bf I} $-minimum & ${\cal O}(n^3)$ &Proposition~\ref{prop:FindMinCostSepI}\\ & & \hspace*{3mm} strongly-minimum & ${\cal O}(n^3)$ &Proposition~\ref{prop:FindMinCostSep:proper}\\[2mm] \multicolumn{3}{l}{\textbf{Enumeration:} \text{For given ${\bf X}, {\bf Y}, {\bf I}, {\bf R}$ enumerate all $\ldots$ } }&Delay&\\ & {\sc ListSep} &$m$-separators ${\bf Z}$ with ${\bf I}\subseteq {\bf Z} \subseteq {\bf R}$ &${\cal O}(n(n+m))$ &Proposition~\ref{prop:ListSep}\\ & {\sc ListMinSep} & $ {\bf I} $-minimal $m$-separators ${\bf Z}$ with ${\bf I} \subseteq {\bf Z} \subseteq {\bf R}$ &${\cal O}(n^3)$ &Proposition~\ref{prop:ListMinSep}\\ \end{tabular} \caption{Definitions of algorithmic tasks related to $m$-separation in an ancestral graph ${\cal G}$ of $n$ nodes and $m$ edges and the time complexities of algorithms given in this section that solve the associated problems. Throughout, ${\bf X},{\bf Y},{\bf R}$ are pairwise disjoint node sets, the set ${\bf Z}$ is disjoint with the non-empty sets ${\bf X},{\bf Y}$, and each of the sets ${\bf I},{\bf R},{\bf Z}$ can be empty. A minimum $m$-separator minimizes the sum $\sum_{Z\in{\bf Z}} w(Z)$ for a cost function $w$ respecting the given constraints, % i.e., $w(V) = \infty$ for $V \notin {\bf R}$. The construction algorithms output $\bot$ if no set fulfilling the listed condition exists. Delay complexity for {\sc ListSep} and {\sc ListMinSep} refers to the time needed per solution when there can be exponentially many solutions (see~\cite{Takata2010}).} \label{fig:problems} \end{table*} \subsection{Linear-time algorithms for testing and finding $m$-separators} The problems {\sc TestSep} and {\sc FindSep} can be solved immediately in the ancestral graph. {\sc TestSep} just requires us to verify the $m$-separation definition for given sets ${\bf X}, {\bf Y}, {\bf Z}$. In DAGs $d$-separation is usually tested with the Bayes-Ball algorithm \citep{Shachter1998}, which can be visualized as sending balls through the graph along the edges, tracking which nodes have been visited from either their parents or children, until all reachable nodes have been visited. In other words, Bayes-Ball is basically a breadth-first-search with some rules that determine if an edge pair lets the ball pass, bounces it back on the same edge or blocks it completely. These rules can be adapted to $ m $-separation as shown in Figure~\ref{fig:bayes:ball}, which leads to the following algorithm for testing if a given ${\bf Z}$ $m$-separates ${\bf X}$ and ${\bf Y}$ in an AG ${\cal G}$: \def\bayesball#1#2#3#4#5#6#7#8{\begin{scope}[xshift=#1] \node[] (C) at (0,1) {T}; \node[#2] (M) {$M$}; \draw[#3] (C) -- (M); \node[] (O) at (-0.9,-1) {$O$} ; \draw[#4,->] (M) -- (O); \node[] (I) at (-0.3,-1) {$I$} ; \draw[#5,<-] (M) -- (I); \node[] (B) at (0.3,-1) {$B$} ; \draw[#6,<->] (M) -- (B); \node[] (U) at (0.9,-1) {$U$} ; \draw[#7] (M) -- (U); \node[text width=2em,anchor=north,draw] at (-0.9,1.2) {#8}; \end{scope}} \begin{figure} \centering \begin{tikzpicture}[b/.style={color=red,postaction={decorate,decoration={markings, mark=at position 0.5 with {\draw[-] (0,-3pt) -- (0,3pt);}}}},Z/.style={adjusted}] \node[] at (-2,1.5) {$M\notin {\bf Z} $:}; \bayesball{0cm}{}{->}{}{b}{b}{}{$\to \to$\\$\to -$} \bayesball{3cm}{}{<-}{}{}{}{}{$\gets \to$\\$\gets\gets$\\$\gets\leftrightarrow$\\$\gets-$} \bayesball{6cm}{}{<->}{}{b}{b}{}{$\leftrightarrow \to$\\$\leftrightarrow -$} \bayesball{9cm}{}{ }{}{}{}{}{$- \to$\\$-\gets$\\$-\leftrightarrow$\\$-\ -$} \begin{scope}[yshift=-3cm] \node[] at (-2,1.5) {$M\in {\bf Z} $:}; \bayesball{0cm}{Z}{->}{b}{}{}{b}{$\to\gets$\\$\to\leftrightarrow$} \bayesball{3cm}{Z}{<-}{b}{b}{b}{b}{} \bayesball{6cm}{Z}{<->}{b}{}{}{b}{$\leftrightarrow\gets$\\$\leftrightarrow\leftrightarrow$} \bayesball{9cm}{Z}{ }{b}{b}{b}{b}{} \end{scope} \end{tikzpicture} \caption{Expanded rules for Bayes-Ball in AGs, listing (in boxes) all combinations of edge pairs through which the ball is allowed to pass. The Bayes ball starts at the top node $ T $ and passes through the middle node $ M $ to one of the bottom nodes $\{O,I,B,U\}$. Forbidden passes are \onlyincolor{marked in red and }crossed out. Here, by a pair of edges we mean an edge between $T$ (Top node) and $M$ (Middle node) and $M\to O$ (Out-node), resp. $M\gets I$ (In-node), $M\leftrightarrow B$ (Bidirected edge), and $M-U$ (Undirected edge). The figure above shows all possible types of edges between $T$ and $M$. We consider two cases: $M\not\in {\bf Z}$ and $M\in {\bf Z}$ (gray). The leaving edge can correspond to the entering edge, i.e., $T$ can belong to $\{O,I,B,U\}$, in which case the ball might return to $T$, which is called a bouncing ball in the literature.}\label{fig:bayes:ball} \end{figure} \begin{algo}{TestSep}{${\cal G}, {\bf X}, {\bf Y}, {\bf Z}$}{\label{algo:issep}}{15cm} \State{${\bf P} \gets \{ (\gets,X) \mid \text{$X \in {\bf X}$ }\}$ }\Comment{list of pairs (type of edge, node) whose visit is pending} \State{${\bf Q} \gets {\bf P}$ }\Comment{all pending and ever visited nodes} \While{ $ {\bf P} $ not empty } \State{Let $(e,T)$ be a (type of edge, node) pair of ${\bf P}$} \State{Remove $(e,T)$ from ${\bf P}$} \For{all neighbors $N$ of $T$} \State{Let $T$ and $N$ be connected by edge $f$} \If{$e, T, f$ is an $m$-connecting path segment % {\bf and } $(f,N)\notin {\bf Q}$} \State{Add $(f,N)$ to ${\bf P}$ and $ {\bf Q} $} \EndIf \EndFor \If{$M \in {\bf Y}$}{ {\bf return} false} \EndIf \EndWhile \State{\Return true} \end{algo} \begin{analal} From the rules in Figure~\ref{fig:bayes:ball} it is obvious that the following statement about algorithm \call{algo:issep} holds: The ball only passes through the walk segment of two consecutive edges if the segment is an $m$-connected walk. The correctness follows from the fact that the algorithm searches over all walks starting in ${\bf X}$. The runtime is linear as it is a breadth-first-search and each node is visited at most four times. The rules for entering a node through edges $\to$ and $\leftrightarrow$ as well as through edges $\gets$ and $-$ are the same, so an implementation could merge these cases in $ {\bf Q} $, so each node is visited at most twice. % \end{analal} \begin{proposition}\label{prop:TestSep} Using the algorithm above, the task {\sc TestSep} can be solved in time ${\cal O}(n+m)$. \end{proposition} The next problem {\sc FindSep} asks for a set ${\bf Z}$ $m$-separating given ${\bf X}$ and ${\bf Y}$ with ${\bf I} \subseteq {\bf Z}\subseteq{\bf R}$. A canonical solution for this problem is given in the following lemma, \highlightrevision{r2c26}{which is an extended version of a lemma by Spirtes, Glymour and Scheines \cite[p. 136]{Spirtes2000} allowing the restriction ${\bf I}$.} \begin{lemma}\label{lemma:auxiliary:m:sep} Let ${\bf X}, {\bf Y}, {\bf I}, {\bf R}$ be sets of nodes with ${\bf I} \subseteq {\bf R}$, ${\bf R} \cap ({\bf X} \cup {\bf Y}) = \emptyset$. If there exists an $m$-separator ${\bf Z}_0$ relative to $({\bf X},{\bf Y})$ with ${\bf I} \subseteq {\bf Z}_0 \subseteq {\bf R}$, then ${\bf Z} = \textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf I}) \cap {\bf R} $ is an $m$-separator. \end{lemma} \begin{proof} Let us consider a proper walk $w = X , V_1, \ldots, V_{n} , Y$ with $X \in {\bf X}$ and $Y \in {\bf Y}$. If $w$ does not contain a collider, all nodes $V_i$ are in $\textit{Ant}({\bf X} \cup {\bf Y})$ and the walk is blocked by ${\bf Z}$, unless $\{V_1,\ldots, V_n\} \cap {\bf R} = \emptyset$ in which case the walk is not blocked by ${\bf Z}_0$ either. If the walk contains colliders ${\bf C}$, it is blocked, unless ${\bf C} \subseteq {\bf Z} \subseteq {\bf R}$. Then all nodes $V_i$ are in $\textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf I})$ and the walk is blocked, unless $\{V_1,\ldots, V_n\}\cap {\bf R} = {\bf C} $. Since ${\bf C} \subseteq {\bf Z}$ is a set of anteriors, there exists a shortest (possible of length zero) % path $\pi_j = V_j \to \ldots \to W_j$ for each $V_j \in {\bf C}$ with $W_j \in {\bf X} \cup {\bf Y} \cup {\bf I}$ (it cannot contain an undirected edge, since there is an arrow pointing to $V_j$). Let $\pi_j' = V_j \to \ldots \to W'_j$ be the shortest subpath of $\pi_j$ that is not blocked by ${\bf Z}_0$. Let $w'$ be the walk $w$ after replacing each $V_j$ by the walk $V_j \to \ldots \to W'_j \gets \ldots \gets V_j$. If any of the $W_j$ is in ${\bf X} \cup {\bf Y}$ we truncate the walk, such that we get the shortest walk between nodes of ${\bf X}$ and ${\bf Y}$. Since $\pi'_j$ is not blocked, $w'$ contains no colliders except $w'_j$ and all other nodes of $w'$ are not in ${\bf R}$, $w'$ is not blocked and ${\bf Z}_0$ is not a separator. \end{proof} This yields the following algorithm to find an $m$-separator relative to ${\bf X},{\bf Y}$: \begin{algo}{FindSep}{${\cal G}, {\bf X}, {\bf Y}, {\bf I}, {\bf R}$}{\label{algo:findsep}}{8cm} \State{${\bf R}' \gets {\bf R} \setminus ({\bf X}\cup{\bf Y})$} \State{${\bf Z}\gets \textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf I}) \cap {\bf R}'$} \If{\call{algo:issep}$({\cal G}, {\bf X}, {\bf Y}, {\bf Z})$} {\Return{${\bf Z}$}} \Else { \Return{$\bot$}} \EndIf \end{algo} \begin{analal} The algorithm finds an $ m $-separator due to Lemma~\ref{lemma:auxiliary:m:sep} and runs in linear time, since the set $\textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf I}) \cap {\bf R}$ can be calculated in linear time and the algorithm {\sc TestSep} runs in linear time as well. \end{analal} \begin{proposition}% \label{prop:FindSep} Using the algorithm above, the task {\sc FindSep} can be solved in time ${\cal O}(n+m)$. \end{proposition} Set $ {\bf R} $ is required to be disjoint with ${\bf X}$ and ${\bf Y}$, because $ m $-separation of a set $ {\bf Z} $ relative to $ {\bf X}, {\bf Y} $ is not defined when ${\bf Z}$ contains a node of $ {\bf X}$ or $ {\bf Y} $, so ${\bf Z}$ is always a subset of $ {\bf R}\subseteq {\bf V}\setminus ({\bf X} \cup {\bf Y})$. However, our algorithms still remove ${\bf X}\cup{\bf Y}$ from ${\bf R}$, as it might prevent bugs in practical implementations and it is reasonable to find a separator that does not contain the variables to be separated. \subsection{Polynomial time algorithms for minimal and minimum $m$-separators } \label{sec:sepalgo:dense} In this section we present algorithms for testing minimal $m$-separators for both variants of the minimality. We give also algorithms for constructing weakly- and strongly-minimum $m$-separators ${\bf Z}$ satisfying constraints ${\bf I} \subseteq {\bf Z} \subseteq {\bf R}$ and for finding weakly-minimal separators. \highlightrevision{r2c20}{ To illustrate the differences between these different versions of minimality, we again consider the possible adjustment sets in Figure~\ref{fig:mbias}. The set $\{\text{FI}\}$ is a strongly-minimal adjustment set. When we use the simple cost function $c(v)=1$ that assigns to each separator a cost that is equal to the number of variables it contains, it is also a strongly-minimum adjustment set. Now, suppose we set ${\bf I}=\{\text{MD}\}$ because $\{\text{MD}\}$ is expected to explain a lot of the variance in the outcome D. If we adjust for MD, then we also need to adjust for at least one other variable, so all adjustment sets ${\bf Z}$ respecting ${\bf Z} \supseteq {\bf I}$ must have a cardinality of at least 2. Therefore, because the strongly-minimum adjustment set $\{\text{FI}\}$ has a cardinality of 1, it is clear that no strongly minimum adjustment set satisfying ${\bf Z} \supseteq {\bf I}$ exists. The set ${\bf Z}=\{\text{MD},\text{MR}\}$ is a minimal adjustment set that satisfies ${\bf Z} \supseteq {\bf I}$, so it is both strongly minimal and ${\bf I}$-minimal; it is also ${\bf I}$-minimum. By contrast, the set ${\bf Z}=\{\text{MD},\text{FI}\}$ is also ${\bf I}$-minimum and ${\bf I}$-minimal, but it is not strongly minimal. } \highlightrevision{r2c27}{ The only one of these four variations that appears to be turned into a hard problem by the restriction ${\bf Z}\supseteq {\bf I}$ is computing strongly-minimal separators \textendash\ we discuss its complexity in detail in the next section.} This is a very surprising result since finding objects of minimum costs or sizes is typically, harder than constructing minimal objects. Our algorithms for the other three cases are easily implementable and have runtimes ${\cal O}(n^2)$, resp. ${\cal O}(n^3)$. These time complexities are reasonable particularly in case of dense ancestral graphs, i.e., graphs with a large number of edges $n \ll m \le n^2$ and $ {\cal O}(n+m) = {\cal O}(n^2) $. In Section~\ref{sec:separators:sparse:AGs} we propose algorithms that are faster than those presented below when the instance graphs are sparse. The algorithms for minimal $m$-separators consist of two phases. First we convert the ancestral graph to an augmented graph (analogous to moralization for DAGs \cite{Spirtes2000}; see Preliminaries). Then, we find a minimal separator as a vertex cut in the augmented graph. This approach generalizes the $d$-separation algorithms of \cite{TianPP1998} and \cite{TextorLiskiewicz2011}, particularly the handling of the undirected graph after the moralization step is the same as in \cite{TianPP1998}. \highlightrevision{r2c29}{It is important to avoid iterating over all pairs of nodes and searching for collider connected paths between them in the construction of the augmented graph, as this would lead to a suboptimal algorithm.} Instead, the following algorithm achieves an asymptotically optimal (linear time in output size) runtime for AGs: \begin{lemma}[Efficient AG moralization] Given an AG ${\cal G}$, the augmented graph $({\cal G})^a$ can be computed in time ${\cal O}(n^2)$. \end{lemma} \begin{proof} The algorithm proceeds in four steps. \begin{enumerate} \item Start by setting $({\cal G})^a$ to the skeleton of ${\cal G}$. \item Partition ${\cal G}$ in all its maximal bidirectionally connected components. \item For each pair $U,V$ of nodes from the same component, add the edge $U-V$ to $({\cal G})^a$ if it did not exist already. \item For each component, identify all its parents % and link them all by undirected edges in $({\cal G})^a$. \end{enumerate} Now two nodes are adjacent in $({\cal G})^a$ if and only if they are collider connected in ${\cal G}$. All four steps can be performed in time ${\cal O}(n^2)$. \end{proof} \highlightrevision{r2c32}{ Lemma~\ref{lemma:auxiliary:m:sep} gave us a closed form solution to find \emph{one} $m$-separator. By extending this result only slightly, we obtain a constraint on \emph{all} minimal $m$-separators:} \begin{corollary}[Ancestry of $ {\bf M} $-minimal separators] Given an AG ${\cal G}$ and three sets ${\bf X},{\bf Y},{\bf M}$, every ${\bf M}$-minimal $m$-separator ${\bf Z}$ % is a subset of $\textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf M})$. \label{lemma:moralmingeneralm} \end{corollary} \begin{proof} Assume there is an $ {\bf M} $-minimal separator ${\bf Z}$ with $ {\bf Z} \not\subseteq \textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf M})$. Setting ${\bf I}= {\bf M}$ and ${\bf R}={\bf Z}$, Lemma~\ref{lemma:auxiliary:m:sep} shows that ${\bf Z}' = \textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf M}) \cap {\bf Z}$ is an $m$-separator with ${\bf M} \subseteq {\bf Z}'$. But ${\bf Z}' \subseteq \textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf M})$ and ${\bf Z}' \subseteq {\bf Z}$, so ${\bf Z} \not= {\bf Z}'$ and ${\bf Z}$ is not an $ {\bf M} $-minimal separator. \end{proof} \begin{corollary}[Ancestry of minimal separators] Given an AG ${\cal G}$ and three sets ${\bf X},{\bf Y},{\bf I}$, every $ {\bf I} $-minimal or $ \emptyset$-minimal $m$-separator % is a subset of $\textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf I})$. \label{lemma:moralmin} \end{corollary} \begin{proof} This follows from Corollary~\ref{lemma:moralmingeneralm} with ${\bf M}= {\bf I}$ or ${\bf M}= \emptyset$. In both cases we have $\textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf M})\subseteq\textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf I})$. \end{proof} Corollary~\ref{lemma:moralmin} applies to minimum separators as well because every minimum separator must be minimal. For all strongly-minimal (i.e., recall, $ \emptyset $-minimal) or $ {\bf I} $-minimal $ m $-separator ${\bf Z}$ satisfying ${\bf I} \subseteq {\bf Z}$ the corollary implies $\textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf Z}) = \textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf I})$ and thus $({\cal G}_{\textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf Z})})^a = ({\cal G}_{\textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf I})})^a$, so the augmented graph $({\cal G}_{\textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf Z})})^a$ can be constructed without knowing the actual ${\bf Z}$. We will use $\EAninMoralGraph$ to denote the number of edges in $({\cal G}_{\textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf I})})^a$. Since nodes in ${\bf I}$ as well as nodes outside ${\bf R}$ are known to either be in ${\bf Z}$ or to be excluded from ${\bf Z}$, they do not need to be considered by the algorithms and can be removed from the augmented graph as shown in Figure~\ref{fig:removeIR}, similarly to the approach in \cite{Acid1996}.% \def\dicefive#1{ \node[] (M) at (0,0.5) {$V$}; \node[#1,color=red, cross out] at (M) {}; \node[] (A) at (-1,-1) {$N$}; \node[] (B) at (1,-1) {$M$}; \node[] (C) at (-1,1) {$O$}; \node[] (D) at (1,1) {$P$}; } \begin{figure}\centering \begin{tikzpicture}[] \begin{scope} \node at (-1,1.75) {$V$ and its neighbors $\textit{Ne}(V)$ in ${\cal G}^a$: }; \dicefive{}; \draw (M) -- (A); \draw (M) -- (B); \draw (M) -- (C); \draw (M) -- (D); \end{scope} \begin{scope}[xshift=5cm] \node at (-1,1.75) {\bf Case: $V \in {\bf I}$ }; \dicefive{draw}; \end{scope} \begin{scope}[xshift=10cm] \node at (-1,1.75) {\bf Case: $V \notin {\bf R}$ }; \dicefive{draw}; \draw (A) -- (B);\draw (A) -- (C);\draw (A) -- (D); \draw (B) -- (C);\draw (B) -- (D); \draw (C) -- (D); \end{scope} \end{tikzpicture} \caption{This figure explains the removal of nodes in ${\bf I}$ and outside of ${\bf R}$ from the augmented graph $({\cal G}_{\textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf I})})^a$. Shown is an exemplary node $V$ with all its neighbors in the augmented graph. In the case $V \in {\bf I}$ the node $V$ blocks all paths through $V$, so the second graph obtained by removing $V$ has no remaining edges. In the case $V \notin {\bf R}$ no path is blocked by $V$, so after removing the node all its neighbors need to be linked to preserve the connectivities as shown in the third graph. The time needed to insert the new edges is ${\cal O}(|{\bf V}\setminus{\bf R}| \cdot |\textit{Ne}({\bf V}\setminus{\bf R})|^2) = {\cal O}(n^3)$, so this removal of nodes outside ${\bf R}$ is only used for algorithm {\sc ListMinSep} in Section \ref{sec:algo:enum} and the other algorithms handle such nodes with different approaches. }\label{fig:removeIR} \end{figure} {\sc TestMinSep} and {\sc FindMinSep} can now be solved by a modified breadth-first-search in the graph $({\cal G}_{\textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf M})})^a$. We start with providing the function {\sc TestMinSep} which tests if ${\bf Z}\subseteq {\bf R}$ is an ${\bf M}$-minimal $m$-separator relative to $({\bf X},{\bf Y})$ in an AG ${\cal G}$: \begin{algo}{TestMinSep}{${\cal G}, {\bf X}, {\bf Y}, {\bf Z}, {\bf M}, {\bf R}$}{\label{algo:isminimalsepmoral}}{14cm} \If{${\bf Z} \setminus \textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf M}) \neq \emptyset $ {\bf or }${\bf Z} \not\subseteq {\bf R} $} \Return{false}\EndIf \If{\textbf{not} \call{algo:issep}$({\cal G}, {\bf X}, {\bf Y}, {\bf Z} )$} {\Return{false}}\EndIf \State{${\cal G}'^a \gets ({\cal G}_{\textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf M})})^a$} \State{Remove from ${\cal G}'^a$ all nodes of ${\bf M}$.} \State{$R_x \gets \{Z\in {\bf Z}\mid \exists \text{ path from } X \text{ to } Z \text{ in } {\cal G}'^a \text{ not intersecting } {\bf Z} \setminus \{Z\} \}$} \If{$ {\bf Z} \neq R_x$} \Return{false}\EndIf \State{$R_y \gets \{Z\in {\bf Z} \mid \exists \text{ path from } Y \text{ to } Z \text{ in } {\cal G}'^a \text{ not intersecting } {\bf Z} \setminus \{Z\} \}$} \If{$ {\bf Z} \neq R_y$} \Return{false}\EndIf \State{\Return{true}} \end{algo} \begin{analal}\call{algo:isminimalsepmoral}, runs in ${\cal O}(\EAninMoralGraph)$ because $R_x$ and $R_y$ can be computed with an ordinary search that aborts when a node in ${\bf Z}$ is reached. If each node in ${\bf Z}$ is reachable from both ${\bf X}$ and ${\bf Y}$, the set is $ {\bf M}$-minimal as no node can be removed without opening a connecting path as shown in the example of Figure~\ref{fig:minseptest}. By setting the parameter $ {\bf M} = {\bf I}$, the algorithm tests ${\bf I}$-minimality of ${\bf Z}$. By setting $ {\bf M} = \emptyset $, the algorithm tests strong-minimality. \end{analal} \begin{proposition}\label{prop:TestMinSep} Using the algorithm above, the task {\sc TestMinSep}, both for testing ${\bf I}$-minimality and strong-minimality, can be solved in time ${\cal O}(\EAninMoralGraph) = {\cal O}(n^2)$. \end{proposition} \begin{figure} \centering ${\cal G}$: \begin{tikzpicture}[xscale=0.8,baseline=1em] \node (X) at (-2,0) {$X$}; \node[adjusted] (Z1) at (-1,1) {$Z_1$}; \node[adjusted] (Z2) at (0,1) {$Z_2$}; \node (Y) at (1,0) {$Y$}; \node (V1) at (-3,1) {$V_1$}; \node (V2) at (-0.5,-0.5) {$V_2$}; \graph { (V1) -> (X) <- (Z1) <- (Z2) -> (Y) -> (V2) <- (X); }; \end{tikzpicture} ${\cal G}_{\textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf M})}$: \begin{tikzpicture}[xscale=0.8,baseline=1em] \node (X) at (-2,0) {$X$}; \node[adjusted] (Z1) at (-1,1) {$Z_1$}; \node[adjusted] (Z2) at (0,1) {$Z_2$}; \node (Y) at (1,0) {$Y$}; \node (V1) at (-3,1) {$V_1$}; \node (V2) at (-0.5,-0.5) {}; \graph { (V1) -> (X) <- (Z1) <- (Z2) -> (Y) ; }; \end{tikzpicture} ${\cal G}^a_{\textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf M})}$: \begin{tikzpicture}[xscale=0.8,baseline=1em] \node (X) at (-2,0) {$X$}; \node[adjusted] (Z1) at (-1,1) {$Z_1$}; \node[adjusted] (Z2) at (0,1) {$Z_2$}; \node (Y) at (1,0) {$Y$}; \node (V1) at (-3,1) {$V_1$}; \node (V2) at (-0.5,-0.5) {}; % \graph { (Z1) -- (V1) -- (X) -- (Z1) -- (Z2) -- (Y) ; }; \end{tikzpicture} \caption{The transformation of a graph ${\cal G}$ to ${\cal G}_{\textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf M})}$ to $({\cal G}_{\textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf M})})^a$ with ${\bf M} = \emptyset$. The $m$-separating set $\{Z_1,Z_2\}$ is not minimal as no node is reachable from both ${\bf X}$ and ${\bf Y}$, but each node alone $\{Z_1\}$ or $\{Z_2\}$ is a minimal $m$-separator.}\label{fig:minseptest} \end{figure} The difference between $ {\bf I} $-minimal and strongly-minimal separation sets ${\bf Z}\supseteq {\bf I}$ is illustrated in Figure~\ref{fig:minseptest}. There are exactly two strongly-minimal separating sets: $ \{Z_1\} $ and $ \{Z_2\} $. No other $m$-separator will be strongly-minimal regardless of which nodes are added to a constraining set $ {\bf I} $. Therefore, for $ {\bf I} = \emptyset $, both $m$-separators satisfy the constraint, for $ {\bf I}= \{Z_1\} $ or $ {\bf I}=\{Z_2\} $, only one of them does and, for a $ {\bf I} = \{Z_1, Z_2\}$ or $ V_1 \in {\bf I} $, no strongly-minimal $m$-separator satisfies it. The constraint $ {\bf I} $ just chooses some $m$-separators of a fixed set of strongly-minimal $m$-separators. On the other hand, when computing an $ {\bf I} $-minimal $m$-separator, we treat the nodes of $ {\bf I} $ as fixed and search for a minimal $m$-separator among all supersets of $ {\bf I} $. In Figure~\ref{fig:minseptest}, if $ {\bf I}$ is either $ \{Z_1\}$, $\{Z_2\} $ or $\{Z_1,Z_2\} $, then $ {\bf I} $ itself is an $ {\bf I} $-minimal $m$-separator and no other $ {\bf I} $-minimal $m$-separator exists. If $ {\bf I} = \{V_1\} $, then $ \{Z_1, V_1\} $ and $ \{Z_2, V_1\} $ are $ {\bf I} $-minimal. This is an easier and in some sense more natural concept, since it can be modeled by removing the nodes of $ {\bf I} $ from the graph and searching a minimal $m$-separator for the remaining nodes. From a covariate adjustment perspective, the definition of $ {\bf M} $-minimality is most meaningful in the case ${\bf M}=\emptyset$ or ${\bf M}={\bf I}$. However, our algorithms technically also allow ${\bf M}$ to lie ``between'' $\emptyset$ and ${\bf I}$ or even partly outside ${\bf M}$, even though this is less relevant for our application. For example if $ \emptyset \not= {\bf M} \subset {\bf I} $, the nodes of $ {\bf M} $ can be ignored for the minimality, while the nodes of $ {\bf I}\setminus{\bf M} $ must be unremovable like all nodes in the case of $ \emptyset $-minimality. In an example in Figure~\ref{fig:minseptest}, for $ {\bf M}=\{V_1\}, {\bf I}= \{Z_1, V_1\} $ would only accept $ \{Z_1, V_1\} $ as $m$-separator. $ {\bf M}=\{Z_1\}, {\bf I}= \{Z_1, Z_2\} $ would not allow any. Every $m$-separator $ {\bf Z}$ is ${\bf Z}$-minimal. Next we give an algorithm to \emph{find} an $ {\bf I} $-minimal $ m $-separator: \begin{algo}{FindMinSep}{${\cal G}, {\bf X}, {\bf Y}, {\bf I}, {\bf R}$}{\label{algo:findminimalsepmoral}}{14cm} \State{${\cal G}' \gets {\cal G}_{\textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf I})}$} \State{${\cal G}'^a \gets ({\cal G}_{\textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf I})})^a$} \State{Remove from ${\cal G}'^a$ all nodes of ${\bf I}$.} \State{${\bf Z}' \gets {\bf R} \cap \textit{Ant}({\bf X} \cup {\bf Y} ) \setminus ({\bf X}\cup{\bf Y})$} \State{${\bf Z}'' \gets \{ Z \in {\bf Z}' \mid \exists \text{ a path from } {\bf X} \text{ to } Z \text{ in } {\cal G}'^a \text{ not intersecting } {\bf Z}' \setminus \{Z\} \}$ } \State{${\bf Z} \gets \{ Z \in {\bf Z}'' \mid \exists \text{ a path from } {\bf Y} \text{ to } Z \text{ in } {\cal G}'^a \text{ not intersecting } {\bf Z}'' \setminus \{Z\} \}$ } \If{\textbf{not} \call{algo:issep}$({\cal G}', {\bf X}, {\bf Y}, {\bf Z})$} {\Return{$\bot$}} \EndIf \State{\Return{${\bf Z}\cup {\bf I}$}} \end{algo} \begin{analal} Algorithm \call{algo:findminimalsepmoral} begins with the separating set ${\bf R} \cap \textit{Ant}({\bf X} \cup {\bf Y})\setminus ({\bf X}\cup{\bf Y})$ and finds a subset satisfying the conditions tested by algorithm \call{algo:isminimalsepmoral}. As \call{algo:isminimalsepmoral} it can be implemented in ${\cal O}(\EAninMoralGraph)$ using a breadth-first-search starting from ${\bf X}$ (${\bf Y}$) that aborts when a node in ${\bf Z}'$ (${\bf Z}''$) is reached. \end{analal} Algorithm {\sc FindMinSep} finds an $ {\bf I} $-minimal $ m $-separator. \highlightrevision{r3c4}{ Note that setting the argument $ {\bf I}$ of the algorithm to $\emptyset $ does not lead to a strongly-minimal separator ${\bf Z}$ that satisfies the constraint $ {\bf I} \subseteq {\bf Z} \subseteq {\bf R} $ for a given non-empty set ${\bf I}$.} \begin{proposition} \label{prop:FindMinSep} The algorithm above finds an ${\bf I}$-minimal $m$-separator ${\bf Z}$, with ${\bf I}\subseteq{\bf Z}\subseteq{\bf R}$, in time ${\cal O}(\EAninMoralGraph) = {\cal O}(n^2)$. \end{proposition} In the problem {\sc FindMinCostSep}, each node $V$ is associated with a cost $w(V)$ given by a cost function $w: {\bf V} \to \mathbb{R}^+$ and the task is to find a set ${\bf Z}$ $m$-separating ${\bf X}$ and ${\bf Y}$ which minimizes the total cost $\sum_{Z\in{\bf Z}} w(Z)$ under the constraint ${\bf I} \subseteq {\bf Z}\subseteq {\bf R}$. In order to find an $m$-separator of minimum size, we can use a function $ w(V) = 1\ \forall V \in {\bf R}$ that assigns unit cost to each node. Alternatively we might want to find an $m$-separator that minimizes the cost of measuring the variables in the separator or that minimizes the number of combinations that the values of these variables can take. When each node $V$ corresponds to a random variable that can take $k_V$ different values, there are $ \prod_{V\in{\bf V}} k_V $ combinations, which can be minimized by a logarithmic cost function $ w(V) = \log k_V\ \forall V \in {\bf R}$. % We again construct the augmented graph and can afterwards solve the problem with any weighted min-cut algorithm. \begin{algo}{FindMinCostSep}{${\cal G}, {\bf X}, {\bf Y}, {\bf I}, {\bf R}, w$}{\label{algo:findminimumsep}}{16cm} \State{${\cal G}' \gets {\cal G}_{\textit{Ant}({\bf X} \cup {\bf Y}\cup{\bf I})}$} \State{${\cal G}'^a \gets ({\cal G}_{\textit{Ant}({\bf X} \cup {\bf Y}\cup{\bf I})})^a$} \State{Add a node $X^m$ connected to all nodes in ${\bf X}$, and a node $Y^m$ connected to all nodes in~${\bf Y}$.} \State{Assign infinite cost to all nodes in ${\bf X} \cup {\bf Y} \cup ({\bf V} \setminus {\bf R})$ and cost $w(Z)$ to every other node $Z$.} \State{Remove all nodes of ${\bf I}$ from ${\cal G}'^a$.} \State{\Return {a minimum vertex cut ${\bf Z}$ separating $ X^m $ and $ Y^m $ in the undirected graph.}} \end{algo} \begin{analal} The correctness % follows from the fact that a minimum set is a minimal set and the minimum cut found in the ancestor moralized graph is therefore the minimum $ m $-separating set. The minimum cut can be found using a maximum flow algorithm in $ {\cal O}(n^3) $ due to the well-known min-cut-max-flow theorem \cite[Chapter~6]{Even1979graphalgorithm}. \end{analal} \begin{proposition} \label{prop:FindMinCostSepI} The algorithm above solves in time ${\cal O}(n^3)$ the task {\sc FindMinCostSep} in case of ${\bf I}$-minimality. \end{proposition} The runtime primarily depends on the used min-cut/max-flow algorithm. Using a state-of-the-art max-flow algorithm recently presented by Orlin improves the runtime to $ {\cal O}(n \EAninMoralGraph) $ \cite{maxflowOrlin2013}, although this is not necessarily an improvement in our setting, because the augmented graph can have $ m_a = {\cal O}(n^2) $ edges and then $ {\cal O}(n \EAninMoralGraph)$ and ${\cal O}(n^3) $ are the same. Faster max-flow algorithms are also known for specific graph classes or specific cost functions. In the special case of a unit cost function $w(V) = 1$ on undirected graphs an $ {\cal O}(\EAninMoralGraph \sqrt{n}) $ algorithm is known \cite{Even1979graphalgorithm}, which is not directly applicable, since algorithm {\sc FindMinCostSep} changes the nodes $ {\bf X} \cup {\bf Y} \cup ({\bf V} \setminus {\bf R}) $ to have infinite costs. However, we can apply the max-flow algorithm to a new graph containing only nodes in $ {\bf R}' = ({\bf R}\setminus({\bf X} \cup {\bf Y})) \cap \textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf I})$ by removing the nodes of $ {\bf V}\setminus{\bf R} $ iteratively in ${\cal O}((n - |{\bf R}|) n^2)$ as shown in Figure~\ref{fig:removeIR} or by creating a new graph only containing those nodes in $ {\cal O}(|{\bf R}'| \EAninMoralGraph) $ as described in \cite{TianPP1998}, resulting in a total runtime of $ {\cal O}(\min((n - |{\bf R}|) n^2, |{\bf R}'|\EAninMoralGraph) + \EAninMoralGraph \sqrt{|{\bf R}'|}) = {\cal O}(|{\bf R}'|\EAninMoralGraph) $ for a unit cost function. The set $ {\bf Z} $ returned by algorithm {\sc FindMinCostSep} is also strongly-minimum, unless no strongly-minimum set ${\bf Z}$ exists under the given constraints $ {\bf I}\subseteq {\bf Z}\subseteq {\bf R} $. To see this assume $ {\bf Z} $ is not strongly-minimum and there exists a strongly-minimum set $ {\bf Z}' $ satisfying the constraint. Then $ \sum_{Z\in{\bf Z}'} w(Z) < \sum_{Z\in{\bf Z}} w(Z) $. But $ {\bf Z}' $ satisfies $ {\bf I} \subseteq {\bf Z}' $, so $ {\bf Z} $ was not $ {\bf I} $-minimum, a contradiction. All strongly-minimum sets for a graph have the same minimum sum $ \sum_{Z\in{\bf Z}} w(Z) $, regardless of the constraint $ {\bf I} $, so we can test if the set returned by {\sc FindMinCostSep} is strongly-minimum by finding one strongly-minimum set $ {\bf Z}' $ and testing if $ \sum_{Z\in{\bf Z}} w(Z) = \sum_{Z\in{\bf Z}'} w(Z) $. Such a strongly-minimum set $ {\bf Z}' $ can be obtained by calling {\sc FindMinCostSep} again with parameter $ {\bf I} = \emptyset $. Although $ {\bf Z}' $ might not fulfill the constraint $ {\bf I} \subseteq{\bf Z}' $, it has the same required sum. Thus, we get the following: \begin{proposition}\label{prop:FindMinCostSep:proper} Finding an $m$-separator ${\bf Z}$, with ${\bf I}\subseteq{\bf Z}\subseteq{\bf R}$, which is strongly-minimum can be done in time ${\cal O}(n^3)$. \end{proposition} The same arguments as above show that $ {\bf Z} $ is $ {\bf M} $-minimum for any $ {\bf M} \subset {\bf I} $, if an $ {\bf M} $-minimum $ m $-separator satisfying the constraints exist. \subsection{The hardness of strong-minimality} For most problems it is easier to find a minimal solution than a minimum one, but for $m$-separators the opposite is true. If a strongly-minimum $m$-separator exists, it is also strongly-minimal. However there is a gap, where no strongly-minimum $m$-separator exists, and the ${\bf I}$-minimum or $ {\bf I} $-minimal $m$-separators are not strongly-minimal. In this section we show that it is hard to find a strongly-minimal $ m $-separator even for singleton $X, Y$ in DAGs, in which $ m $-separation and $ d $-separation are equivalent. \highlightrevision{r2c34}{ Due to the equivalence between $d$-separation and vertex separators in the moralized graph, this implies that it is also NP-hard to find strongly-minimal vertex separators in undirected graphs. Together with the characterizations of adjustment sets in the coming sections, it will follow that it is also NP-hard to find strongly-minimal adjustments in DAGs or ancestral graphs. } \begin{proposition}\label{prop:np-complete} It is an NP-complete problem to decide if in a given DAG there exists a strongly-minimal $d$-separating set ${\bf Z}$ containing ${\bf I}$. \end{proposition} \begin{proof} The problem is in NP, since given $ {\bf Z} $ verifying $ {\bf I}\subseteq {\bf Z} $ is trivial and the strong-minimality can be efficiently tested by algorithm \textsc{TestMinSep} with parameter $ {\bf I}= \emptyset $. \begin{figure} \centering\begin{tikzpicture} \node (X) at (-3,0) {$X$}; \node (Y1) at (0,-1) {$Y$} ; \node[adjusted] (I1) at (0,0) {$I_1$} ; \node (V1l) at (-1,1) {$V_{1,l}$} ; \node (V1r) at (1,1) {$V_{1,r}$} ; \node (V1) at (-1,0) {$V_1$}; \node (V1neg) at (1,0) {$\overline{V}_1$}; \draw[->] (I1) -- (V1l); \draw[->] (I1) -- (V1r); \draw[->] (V1l) -- (V1); \draw[->] (V1r) -- (V1neg); \draw[->] (I1) -- (Y1); \draw[->] (V1) -- (Y1); \draw[->] (V1neg) -- (Y1); \begin{scope}[xshift=3cm] \node (Y2) at (0,-1) {$Y$} ; \node[adjusted] (I2) at (0,0) {$I_2$} ; \node (V2l) at (-1,1) {$V_{2,l}$} ; \node (V2r) at (1,1) {$V_{2,r}$} ; \node (V2) at (-1,0) {$V_2$}; \node (V2neg) at (1,0) {$\overline{V}_2$}; \draw[->] (I2) -- (V2l); \draw[->] (I2) -- (V2r); \draw[->] (V2l) -- (V2); \draw[->] (V2r) -- (V2neg); \draw[->] (I2) -- (Y2); \draw[->] (V2) -- (Y2); \draw[->] (V2neg) -- (Y2); \end{scope} \begin{scope}[xshift=6cm] \node (Y3) at (0,-1) {$Y$} ; \node[adjusted] (I3) at (0,0) {$I_3$} ; \node (V3l) at (-1,1) {$V_{3,l}$} ; \node (V3r) at (1,1) {$V_{3,r}$} ; \node (V3) at (-1,0) {$V_3$}; \node (V3neg) at (1,0) {$\overline{V}_3$}; \draw[->] (I3) -- (V3l); \draw[->] (I3) -- (V3r); \draw[->] (V3l) -- (V3); \draw[->] (V3r) -- (V3neg); \draw[->] (I3) -- (Y3); \draw[->] (V3) -- (Y3); \draw (V3neg) edge [->] (Y3); \end{scope} \node at (8cm, 0.5) {$\ldots$}; \node[adjusted] (IC1) at (1.5,-2.25) {$ I'_1 $}; \node[adjusted] (IC2) at (4.5,-2.25) {$ I'_2 $}; \draw[dashed,->] (V1neg) to (IC1) (V2) edge[->] (IC1) (V3) edge[->] (IC1); \draw[dashed,->] (V1neg) to (IC2) (V2neg) edge[->] (IC2) (V3neg) edge[->,bend left=20] (IC2); \node at (6cm, -2.5) {$\ldots$}; \draw (IC1) edge [->,bend left=15] (X); \draw (IC2) edge [->,bend left=35] (X); \draw (V1l.west) edge [->,bend right=20] (X); \draw (V1r.north west) edge [->,bend right=30] (X); \draw (V2l.north west) edge [->,bend right=35] (X); \draw (V2r.north west) edge [->,bend right=40] (X); \draw (V3l.north west) edge [->,bend right=45] (X); \draw (V3r.north west) edge [->,bend right=50] (X); \end{tikzpicture} \caption{The graph used in the proof of Proposition~\ref{prop:np-complete}, which represents the first three variables $V_1, V_2, V_3$, and two clauses $(\overline{V}_1 \vee V_2 \vee V_3)$ and $(\overline{V}_1 \vee \overline{V}_2 \vee \overline{V}_3)$. All shown $Y$ nodes can be considered to be a single node $Y$, but we display them separately to reduce the number of overlapping edges in the figure. % }\label{fig:minimality:proof:graph} \end{figure} To show the NP-hardness we take an instance of 3-SAT, a canonical NP-complete problem \cite{michael1979computersNP}, and construct a DAG $ {\cal G} $ and a set $ {\bf I} $, such that a strongly-minimal $d$-separating set containing ${\bf I}$ exists in $ {\cal G} $, if and only if the 3-SAT formula is satisfiable. % The 3-SAT instance consists of $k$ variables $ V_1, \ldots, V_k $, and $ \ell $ clauses $C_i = ( W_{i,1} \vee W_{i,2} \vee W_{i,3} ) $ of literals $ W_{i,j} \in \{V_1, \ldots, V_k, \overline{V}_1, \ldots, \overline{V}_k \} $. It is NP-hard to decide if there exists a Boolean assignment $ \phi: \{V_1,\ldots V_k\} \to \{\text{true},\text{false}\} $ that satisfies the formula $ C_1 \wedge \ldots \wedge C_\ell $. \highlightrevision{r2c35}{ The basic idea of the construction is to ensure that any $m$-separator must contain some nodes to block a path between $X$ and $Y$, while no $m$-separator can contain all those nodes, because all nodes together would block all paths from $X$ to nodes in ${\bf I}$ making the separator not ${\bf I}$-minimal. The choice of a node will correspond to choosing an assignment to a variable of the satisfiable problem. } Let $ {\cal G} = ({\bf V},{\bf E}) $ be defined as: \newcommand{\mid i \in \{1,\ldots,k \}}{\mid i \in \{1,\ldots,k \}} \newcommand{\mid i \in \{1,\ldots,\ell \}}{\mid i \in \{1,\ldots,\ell \}} \[\begin{array}{rccl} {\bf V} &=&& \{ X, Y\} \cup \{ V_{i,l}, V_{i,r}, V_i, \overline{V}_i, I_i \mid i \in \{1,\ldots,k \} \} \cup \{I'_i \mid i \in \{1,\ldots,\ell \} \}\\ {\bf E} &=&& \{ X \gets V_{i,l} \to V_i \to Y \mid i \in \{1,\ldots,k \} \} \\ && \cup& \{ X \gets V_{i,r} \to \overline{V}_i \to Y \mid i \in \{1,\ldots,k \} \} \\ && \cup& \{ I_i \to V_{i,l},\ I_i \to V_{i,r},\ I_i \to Y \mid i \in \{1,\ldots,k \} \}\\ && \cup& \{ I'_i \to X \mid i \in \{1,\ldots,\ell \} \}\\ && \cup& \{ W_{i,j} \to I'_i \mid i \in \{1,\ldots,\ell \}, W_{i,j} \in C_i \}\\ {\bf I} &=&& \{I_i \mid i \in \{1,\ldots,k \} \} \cup \{I'_i \mid i \in \{1,\ldots,\ell \}\} \end{array} \] The resulting graph is shown in Figure~\ref{fig:minimality:proof:graph}. We identify the literal $V_i$ ($ \overline{V}_i $) in the formula with the node $ V_i $ ($ \overline{V}_i $) in the graph. $V_{i,l}$ ($V_{i,r}$) is a left (right) node, $,l$ in the index should not be confused with the number of clauses $\ell$. β€œ$\Leftarrow$”: Let $ \phi $ be a Boolean assignment that satisfies the formula. Let \[ {\bf Z} = {\bf I} \cup \{ V_i, V_{i,r} \mid i \in \{1,\ldots,k \},\ \phi(V_i) = \text{false} \}\cup \{ \overline{V}_i, V_{i,l} \mid i \in \{1,\ldots,k \},\ \phi(V_i) = \text{true} \}. \] To show that $ {\bf Z} $ $ d$-separates $ X $ and $ Y $, we begin a breadth first search at $ X $ and enumerate all reachable nodes. Immediately reachable are nodes $ I'_i $, but they are in ${\bf I}\subseteq {\bf Z} $, so the path stops there. The parents $ V_{i,l} $ are reachable, but they are either in $ {\bf Z} $ or only $ V_i, I_i \in {\bf Z} $ are reachable and the path stops there. Likewise no path through $ V_{i,r} $ can reach $ Y $. Hence $ {\bf Z} $ is a $ d $-separator. $ {\bf Z} $ is also strongly-minimal: If $ V_i \in {\bf Z}$, $ V_{i,l} \notin {\bf Z} $ and $ {\bf Z}\setminus\{V_i\} $ would not block the path $X \gets V_{i,l} \to V_i \to Y$. A similar path would be opened by removing $ \overline{V}_i,\ V_{i,l}$ or $ V_{i,r} $. $ {\bf Z} \setminus \{ I_i\} $ is not a $ d $-separator as it would not block either the path $ X \gets V_{i,l} \to I_i \to Y $ or $ X \gets V_{i,r} \to I_i \to Y $. If a clause $ C_i $ is satisfied by a literal $ V_j$, $ {\bf Z} \setminus \{ I'_i\} $ is not a $ d $-separator, as it would not block the path $ X \gets I'_i \gets V_j \to Y $ . Likewise $ X \gets I'_i \gets \overline{V}_j \to Y $ would be opened by removing $ I'_i $ if the clause $ C_i $ is satisfied by a literal $ \overline{V}_j $. Therefore $ {\bf Z} $ is a strongly-minimal $ d $-separator. β€œ$\Rightarrow$”: Now we show that a strongly-minimal $ d $-separator $ {\bf Z} $ yields a satisfying assignment $ \phi $. For every $i$ the two paths $X \gets V_{i,l} \to V_i \to Y $ and $X \gets V_{i,r} \to \overline{V}_i \to Y $ need to be blocked by a node of $ \{V_{i,l}, V_i\} $ and a node of $ \{V_{i,r}, \overline{V}_i\} $. If neither $V_i$ nor $ \overline{V}_i $ are in $ {\bf Z} $, both $V_{i,l}$ and $V_{i,r}$ must be in ${\bf Z}$, so $I_i$ is not reachable from $X$, ${\bf Z} \setminus \{I_i\}$ is a $d$-separator and ${\bf Z}$ is not strongly-minimal. Therefore $V_i$ or $\overline{V}_i$ is in ${\bf Z}$ and the following Boolean assignment $\phi$ to the variables is well-defined: \[\phi(V_i) = \begin{cases} \text{true}& V_i \notin {\bf Z}, \\ \text{false}& \overline{V}_i \notin {\bf Z},\\ \text{false}& otherwise. \end{cases}\] Since $I'_i \in {\bf I}$ for all $ i $, $I'_i$ has to be reachable from $Y$, so there is an open path $I'_i \gets V_j \to Y$ (or $I'_i \gets \overline{V}_j \to Y$) and $ V_j $ (or $ \overline{V}_j $) is not in $ {\bf Z} $ for some $ j $. This $ V_j $ (or $ \overline{V}_j $) satisfies clause $ C_i $ according to the definition of $ \phi $. Hence every clause and the formula is satisfiable. \end{proof} \subsection{Algorithms for minimal $m$-separators in sparse graphs} \label{sec:separators:sparse:AGs} Subsection~\ref{sec:sepalgo:dense} gave ${\cal O}(n^2)$ algorithms for the problems {\sc TestMinSep} and {\sc FindMinSep} in case of ${\bf I}$-minimality, which is optimal for dense graphs. The runtime of these algorithms is limited by the time required to construct the augmented graph, which might contain nodes and edges that have no influence on the minimal $ m $-separator and are thus included unnecessarily. This leads to the question, can we test or find the minimal $ m $-separator without constructing the augmented graph? The obvious way is to test the definition of minimality directly by removing each of the nodes of $ {\bf Z} $ and testing if the smaller set is still an $ m $-separator, which yields ${\cal O}(|{\bf Z}|(n+m)) = {\cal O}(| \textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf I} ) | (n + m)) = {\cal O}(n(n+m))$ algorithms. This is generally slower than the previous runtimes, however in sparse graphs that have a low number of edges $ m \approxeq n $ and a low number of ancestors $ | \textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf I} ) | \ll n $, it might be faster. This alternative algorithm for {\sc TestMinSep} in sparse graphs, in case of ${\bf I}$-minimality, is as follows \begin{algo}{TestMinSepSparse}{${\cal G}, {\bf X}, {\bf Y}, {\bf Z}, {\bf I}, {\bf R}$}{\label{algo:isminimalsepnaive}}{10cm} \If{${\bf Z} \setminus \textit{Ant}({\bf X} \cup {\bf Y}\cup{\bf I}) \neq \emptyset $ {\bf or } $ {\bf Z} \not\subseteq {\bf R} $} \Return{false}\EndIf \If{\textbf{not} \call{algo:issep}$({\cal G}, {\bf X}, {\bf Y}, {\bf Z} )$} \Return{false}\EndIf \State{${\cal G}' \gets {\cal G}_{\textit{Ant}({\bf X} \cup {\bf Y}\cup{\bf I})}$} \For {all $U \gets {\bf Z} \setminus {\bf I}$} \If{\call{algo:issep}$({\cal G}', {\bf X}, {\bf Y}, {\bf Z} \setminus \{U\})$} \Return{false}\EndIf \EndFor \Return{true} \end{algo} An ${\bf I}$-minimal $ m $-separator relative to $ ({\bf X}, {\bf Y}) $ can be computed using the algorithm \begin{algo}{FindMinSepSparse}{${\cal G}, {\bf X}, {\bf Y}, {\bf I}, {\bf R}$}{\label{algo:findminimalsepnaive}}{8cm} \State{${\cal G}' \gets {\cal G}_{\textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf I})}$} \State{${\bf Z} \gets {\bf R} \cap \textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf I}) \setminus ({\bf X} \cup {\bf Y})$} \If{\textbf{not} \call{algo:issep}$({\cal G}', {\bf X}, {\bf Y}, {\bf Z})$} {\Return{$\bot$}} \EndIf \For {all $U$ in ${\bf Z}\setminus {\bf I}$} \If{\call{algo:issep}$({\cal G}', {\bf X}, {\bf Y}, {\bf Z} \setminus \{U\})$} \State{${\bf Z} \gets {\bf Z} \setminus \{U\}$}\EndIf \EndFor \State{\Return{${\bf Z}$}} \end{algo} \begin{proposition} The tasks {\sc TestMinSep} and {\sc FindMinSep} for ${\bf I}$-minimal separators can be solved in time ${\cal O}( (n+m) \cdot | \textit{Ant}({\bf X} \cup {\bf Y} \cup {\bf I}) | )$. \end{proposition} The correctness of these algorithms depends on the non-obvious fact that $m$-separators are monotone: if ${\bf Z} \setminus V$ is not an $m$-separator, no ${\bf Z} \setminus {\bf V}$ with $V\in {\bf V}$ is one either. This monotonicity was proven for $d$-separation by \cite{TianPP1998} and we will state their results in terms of $m$-separation: % \begin{lemma}\label{lem:monotone:m:separators} Let ${\bf X}$, ${\bf Y}$ be two sets and let ${\bf Z}$ be an $m$-separator relative to $({\bf X},{\bf Y})$. If the set ${\bf Z} \cup \{Z_1, \ldots, Z_n\}$ is also an $ m $-separator, where $Z_1, \ldots, Z_n$ are single nodes which are not in ${\bf Z}$ then either ${\bf Z} \cup \{Z_1\}$, or ${\bf Z} \cup \{Z_2\}$, $\ldots$ or ${\bf Z}\cup \{Z_n\}$ must be another $ m $-separator between $ {\bf X} $ and $ {\bf Y} $. \end{lemma} \begin{corollary} If ${\bf Z}$ and ${\bf Z} \cup {\bf Z}_n$ are m-separators, where ${\bf Z}_n = \{Z_1, \ldots, Z_n\}$, then there exist a series of $n-1$ m-separators: ${\bf Z} \cup {\bf Z}_i$, $i=1,\ldots,n-1$, with ${\bf Z}_1 \subset \ldots \subset {\bf Z}_{n-1} \subset {\bf Z}_n $ such that each ${\bf Z}_i$ contains exactly $i$ nodes. \end{corollary} \begin{corollary}\label{cor:monotonicity:sep} If no single node can be removed from a m-separator ${\bf Z}$ without destroying m-separability, then ${\bf Z}$ is minimal. \end{corollary} To generalize the proofs of \cite{TianPP1998} to $m$-separation, it is sufficient to replace $d$-separation with $m$-separation, DAGs with AGs and ancestors with anteriors throughout their arguments. Therefore, we do not repeat the proofs here. % In principle one needs to take care of the order in which the nodes are enumerated when searching a minimal subset of a $m$-separator by removing nodes one-by-one like we do in algorithm \call{algo:findminimalsepnaive}. For example to obtain a minimal subset of $\{Z_1, Z_2\}$ in a DAG $X \to Z_2 \gets Z_1 \to Y$ the node $Z_2$ must be removed first, or $Z_1$ could not be removed. However, this is not an issue when all nodes of ${\bf Z}$ are anteriors in $\textit{Ant}({\bf X}\cup{\bf Y}\cup{\bf I})$ due to the correspondence of $m$-separators to separators in the augmented graph, since removing a node cannot block a path in the augmented graph. From this correspondence one can also conclude Lemma~\ref{lem:monotone:m:separators} restricted to anteriors. \subsection{Algorithms for enumerating all $m$-separators}\label{sec:algo:enum} Lastly, we consider the problem of listing \emph{all} $m$-separators and \emph{all} minimal $m$-separators between ${\bf X}$ and ${\bf Y}$ in ${\cal G}$. Since there might be an exponential number of (minimal) $m$-separators, it is not possible to list them all in polynomial time. For example in a path $X \gets V \gets V' \gets Y$ either $V$ or $V'$ must be in a minimal $m$-separator between $X$ and $Y$, so a graph containing $k$ such paths will have at least $2^k$ different $m$-separators. Therefore we will describe algorithms running with ${\cal O}(n^3)$ delay, which means that at most ${\cal O}(n^3)$ time will pass between the start or the output of an $m$-separator and the output of the next $m$-separator or the end of the algorithm. They are based on the enumeration algorithm for minimal vertex separators of \citep{Takata2010}. \begin{algo}{ListSep}{${\cal G}, {\bf X}, {\bf Y}, {\bf I}, {\bf R}$}{\label{algo:enumsep}}{8cm} \If{ {\sc FindSep}$({\cal G}, {\bf X}, {\bf Y}, {\bf I}, {\bf R}) \neq \bot$} \If{${\bf I} = {\bf R}$} {Output ${\bf I}$} \Else \State {$V \gets $ an arbitrary node of ${\bf R} \setminus {\bf I}$} \State{{\sc ListSep}(${\cal G}, {\bf X}, {\bf Y}, {\bf I} \cup \{V\}, {\bf R}$)} \State{{\sc ListSep}(${\cal G}, {\bf X}, {\bf Y}, {\bf I}, {\bf R}\setminus\{V\}$)} \EndIf \EndIf \end{algo} \begin{analal} Algorithm {\sc ListSep} performs backtracking to enumerate all ${\bf Z}$, with ${\bf I} \subseteq {\bf Z} \subseteq {\bf R}$, aborting branches that will not find a valid separator. Since every leaf will output a separator, the tree height is at most $n$ and the existence check needs ${\cal O}(n+m)$, the delay time is ${\cal O}(n(n+m))$. The algorithm generates every separator exactly once: if initially ${\bf I} \subsetneq {\bf R}$, with $V\in {\bf R}\setminus {\bf I}$, then the first recursive call returns all separators ${\bf Z}$ with $V\in {\bf Z}$ and the second call returns all ${\bf Z}'$ with $V\not\in {\bf Z}'$. Thus the generated separators are pairwise disjoint. \end{analal} \begin{proposition}\label{prop:ListSep} Using the algorithm above, the task {\sc ListSep} can be solved with polynomial delay ${\cal O}(n(n+m))$. \end{proposition} To enumerate all minimal $ m $-separators we can directly apply Takata's enumeration algorithm \cite{Takata2010} after transforming the ancestral graph to its augmented graph: \begin{algo}{ListMinSep}{${\cal G}, {\bf X}, {\bf Y}, {\bf I}, {\bf R}$}{\label{algo:enumminimalsep}}{12cm} \State{${\cal G}' \gets {\cal G}_{\textit{Ant}({\bf X} \cup {\bf Y}\cup{\bf I})}$} \State{${\cal G}'^a \gets ({\cal G}_{\textit{Ant}({\bf X} \cup {\bf Y}\cup{\bf I})})^a$} \State{Add a node $X^m$ connected to all ${\bf X}$ nodes.} \State{Add a node $Y^m$ connected to all ${\bf Y}$ nodes.} \State{Remove nodes of ${\bf I}$.} \State{Remove nodes of ${\bf V} \setminus {\bf R}$ connecting the neighbors of each removed node.} \State{Use the algorithm in~\citet{Takata2010} to list all sets separating $X^m$ and $Y^m$.} \end{algo} \begin{analal} The correctness is shown by \citet{TextorLiskiewicz2011} for adjustment sets and generalizes directly to $m$-separators, because after moralization, both problems are equivalent to enumerating vertex cuts of an undirected graph. The handling of ${\bf I}$ is shown by \citet{Acid1996}. \end{analal} \begin{proposition}\label{prop:ListMinSep} The task {\sc ListMinSep} can be solved with polynomial delay ${\cal O}(n^3)$. \end{proposition} \section{Empirical analysis of DAG consistency testing} \label{sec:basissets} The concept of $m$-separation in ancestral graphs, or $d$-separation in DAGs, is of central importance in the field of Bayesian networks and graphical causal models because it couples the graphical model structure to conditional independences in the corresponding probability distribution. Perhaps the most direct application of graphical separation is therefore \emph{consistency testing}, where we check whether a graphical causal model is in fact consistent with the dataset it is intended to represent. If a graphical causal model fails to pass this test, then any downstream analyses, such as implied adjustment sets, are potentially nullified. In this section, we illustrate how the algorithmic framework that we developed in Section~\ref{sec:algo} can be harnessed for graphical causal model checking by applying it to the problem of deriving \emph{basis sets} for testing the consistency of a DAG to a given probability distribution. A DAG ${\cal G}$ is called \emph{consistent} with a probability distribution $P$ if for all pairwise disjoint subsets ${\bf X},{\bf Y},{\bf Z} \subseteq {\bf V}$, where only ${\bf Z}$ may be empty, ${\bf X}$ and ${\bf Y}$ are conditionally independent given ${\bf Z}$ in $P$ whenever ${\bf Z}$ $d$-separates ${\bf X}$ and ${\bf Y}$ in ${\cal G}$. Therefore, to test consistency, we could in principle enumerate all $d$-separation relations in ${\cal G}$ and then perform the corresponding conditional independence tests. However, that set of relations can be very large -- there is already an exponential number of subsets ${\bf X}$ and ${\bf Y}$ to consider, each of which could be separated by an exponential number of sets ${\bf Z}$. A \emph{basis set} of $d$-separation statements entails all other statements implied by ${\cal G}$ when combining them using the axioms of conditional independence \cite{Dawid1979}. The \emph{canonical} basis set has the form $$ \{ \forall X \in {\bf V}: X \independent {\bf V} \setminus (\textit{Pa}(X) \cup \textit{De}(X)) \mid \textit{Pa}(X) \}, $$ or in words, every variable must be jointly independent of its non-descendants conditioned on its parents. This basis set only contains $n$ elements but the independences to be tested can be of very high order. In practice, conditional independence is often tested using methods that do not distinguish between joint and pairwise independence, such as partial correlation or linear regression. In such cases, even simpler basis sets can be derived. For instance, Pearl and Meshkat \cite{PearlMeshkat1999} discuss basis sets for hierarchical linear regression models (also known as path models or structural equation models \cite{Thoemmes2017}). We here consider the vertices ${\bf V}=\{X_1,\ldots,X_n\}$ to be indexed topologically, such that for $j > i$, we have that $X_j \notin \textit{An}(X_i)$. Then we consider basis sets having the form $$ \{ \forall j > i, X_i \to X_j \notin {\bf E} : X_i \independent X_j \mid {\bf Z}_{ij} \}, $$ or in words, we include one separation statement for every nonadjacent pair of variables. These are pairwise rather than joint independences, which is equivalent when we measure dependence only by partial correlation \cite{PearlMeshkat1999}. An obvious choice is ${\bf Z}_{ij}=\textit{Pa}(X_j)$, in which case we simply obtain a pairwise version of the canonical basis set above. We call that basis set the \emph{parental basis set}. However, Pearl and Meshkat show that another valid choice is any separating set ${\bf Z}_{ij}$ that contains only nodes whose distance to $X_j$ is smaller than the distance between $X_i$ and $X_j$ (where the distance is defined length of a shortest path between two nodes). We call any such set a \emph{sparse basis set}. Note that every parental basis set is also sparse, but the separators in sparse basis sets can be substantially smaller than in parental basis sets. \subsection{Simulation setup} We evaluate the difference between parental and sparse basis sets on random DAGs. These are generated with various numbers of variables $ n \in \{10, 25, 50, 100\}$. The edges are chosen independently with individual probabilities $P(\textit{edge})=\frac{l}{(n-1)}$, where $l \in 2,5,10,20$. For small $n$ the probabilities are capped at 1. For example, for $l= n = 10$, the parameter $P(\textit{edge}) = \min\{\frac{10}{(10-1)}, 1\} =1$ will only generate complete graphs. Parameter $l$ describes the expected number of neighbors of a node in a generated DAG. This leads to an expected number of edges in generated graphs $\EX[m] \approxeq l n / 2$, as there are $ \frac{n (n-1)}{2} $ possible edges in a DAG of $n$ nodes, each existing with probability $P(\textit{edge})$. Our algorithmic framework makes it straightforward to compute sparse basis sets with minimal separating sets by simply setting ${\bf R} = \{ X_k \in {\bf V} \mid d(X_k,X_j) < d(X_i, X_j)\}$, where we use $d(X_a, X_b)$ to denote the distance between two nodes. \subsection{Empirical results} We empirically evaluate the sizes of parental and sparse basis sets in these random DAGs (Figure~\ref{fig:modelchecking}). The results show that the benefit of using sparse rather than parental basis sets does not depend much on the size of the DAG but rather on the amount of edges. For instance, when nodes had on average $5$ neighbors, sparse basis sets had between 20\% and 40\% fewer conditioning variables than the canonical parental basis sets. These results provide a first example of how our framework can be applied in the context of graphical causal modeling. In the rest of this paper, we focus on covariate adjustment as our focus application area. However, given that separators play a central role in many aspects of graphical causal models, we expect that there should be many more applications in addition to those shown in this paper. \input{experiments-modelchecking} \section{Adjustment in DAGs} \label{sec:dagadjust} We now leverage the algorithmic framework of Section~\ref{sec:algo} together with a constructive, sound and complete criterion for covariate adjustment in DAGs to solve all problems listed in Table~\ref{fig:problems} for adjustment % sets rather than $m$-separators in the same asymptotic time. % First, note that the formal definition of adjustments (Definition~\ref{def:adjustment:set}) cannot be used to actually find an adjustment set as there are infinitely many probability distributions that are consistent to a certain graph. Fortunately, it is possible to characterize adjustment sets in graphical terms. \begin{definition}[Adjustment criterion (AC) \citep{ShpitserVR2010}]\label{def:ac:general} Let ${\cal G} = ({\bf V},{\bf E})$ be a DAG, and ${\bf X},{\bf Y},{\bf Z} \subseteq {\bf V}$ be pairwise disjoint subsets of variables. The set ${\bf Z}$ satisfies the adjustment criterion relative to $({\bf X}, {\bf Y})$ in ${\cal G}$ if \begin{enumerate} \item[$(a)$] no element in ${\bf Z}$ is a descendant in ${\cal G}_{\overline{{\bf X}}}$ of any $W \in {\bf V} \setminus {\bf X}$ which lies on a proper causal path from ${\bf X}$ to ${\bf Y}$ and \item[$(b)$] all proper non-causal paths in ${\cal G}$ from ${\bf X}$ to ${\bf Y}$ are blocked by ${\bf Z}$. \end{enumerate} \end{definition} However, even this criterion does not lead to efficient algorithms to find adjustment sets, because there can be exponentially many paths and blocking one non-causal path might open other paths. We address this problem below by presenting a constructive adjustment criterion that reduces non-causal paths to ordinary $ m $-separation, which can be reduced further to a reachability problem in undirected graphs. \subsection{Constructive back-door criterion} \begin{figure} \begin{center} \begin{tabular}{ccc} \begin{tikzpicture}[yscale=0.9,xscale=0.9] \node (g) at (-.7,1.25) {${\cal G}$:}; \node (x1) at (0,0) {$X_1$}; \node (x2) at (1,0) {$X_2$}; \node (v1) at (2,0) {$D_1$}; \node (y1) at (3,0) {$Y$}; \node[adjusted] (z1) at (2,1) {$Z$}; \node (v2) at (1,-1) {$V$}; \node (v3) at (2,-1) {$D_2$}; \node (v4) at (3,-1) {$D_3$}; \draw [->] (x1) -- (x2); \draw [->] (v1) -- (y1); \draw [->] (z1) -- (y1); \draw [->] (z1) -- (x2); \draw [->] (x2) -- (v2); \draw [->] (v1) -- (v3); \draw [->] (y1) -- (v4); \draw [->] (x2) -- (v1); \draw [->] (x2) -- (v3); \end{tikzpicture}\hspace*{10mm} & \begin{tikzpicture}[yscale=0.9,xscale=0.9] \node (g) at (-0.7,1.25) {$\cG^{pbd}_{\bX\bY}$:}; \node (x1) at (0,0) {$X_1$}; \node (x2) at (1,0) {$X_2$}; \node (v1) at (2,0) {$D_1$}; \node (y1) at (3,0) {$Y$}; \node[adjusted] (z1) at (2,1) {$Z$}; \node (v2) at (1,-1) {$V$}; \node (v3) at (2,-1) {$D_2$}; \node (v4) at (3,-1) {$D_3$}; \draw [->] (x1) -- (x2); \draw [->] (v1) -- (y1); \draw [->] (z1) -- (y1); \draw [->] (z1) -- (x2); \draw [->] (x2) -- (v2); \draw [->] (v1) -- (v3); \draw [->] (y1) -- (v4); \draw [->] (x2) -- (v3); \end{tikzpicture}\hspace*{10mm} & \begin{tikzpicture}[yscale=0.9,xscale=0.9] \node (g) at (-0.7,1.25) {$\cG^{pbd,\bC}_{\bX\bY}$:}; \node (x1) at (0,0) {$X_1$}; \node (x2) at (1,0) {$X_2$}; \node (v1) at (2,0) {$D_1$}; \node (y1) at (3,0) {$Y$}; \node[adjusted] (z1) at (2,1) {$Z$}; \node (v2) at (1,-1) {$V$}; \node (v3) at (2,-1) {$D_2$}; \node (v4) at (3,-1) {$D_3$}; \draw [->] (x1) -- (x2); \draw [->] (v1) -- (y1); \draw [->] (z1) -- (y1); \draw [->] (z1) -- (x2); \draw [->] (x2) -- (v2); \draw [->] (v1) -- (v3); \draw [->] (y1) -- (v4); \draw[dotted] (v1.north west) rectangle (v4.south east); \node at (3.5,-1) {${\bf C}$}; \end{tikzpicture} \end{tabular} \end{center} \caption{A DAG that permits exactly two adjustment sets for estimating the causal effect of ${\bf X}=\{X_1,X_2\}$ on ${\bf Y}=\{Y\}$: ${\bf Z}=\{Z\}$ and ${\bf Z}'=\{Z,V\}$. Because ${\bf V} \setminus \textit{Dpcp}(\bX,\bY)= \{X_1,X_2,Z,V\}$, every adjustment is a subset of $\{Z,V\}$. The nodes $D_1, D_2, D_3$ are not allowed in any adjustment as they are not in $ \{Z,V\}$ \textendash\ the set of descendants of a non-${\bf X}$ node on the (only) proper causal path $X_2 \to D_1 \to Y$. Moreover, every adjustment must contain the variable $Z$ to block the path between $X_2$ and $Y$ in $\cG^{pbd}_{\bX\bY}$. Graph $\cG^{pbd,\bC}_{\bX\bY}$ illustrates a parametrized proper back-door graph (Definition~\ref{def:ac:general:bdc:prime}) with parameter ${\bf C}=\textit{Dpcp}(\bX,\bY)=\{D_1,D_2,D_3,Y\}$ surrounded by a dotted rectangle. Removing edge $X_2 \to D_2$ from $\cG^{pbd}_{\bX\bY}$ simplifies the DAG while preserving the reduction of finding adjustment sets to $d$-separation. } \label{fig:CBCexample} \end{figure} The graph of this reduction will be called the proper back-door graph: \begin{definition}[Proper back-door graph] \label{def:adj:graph:} Let ${\cal G} = ({\bf V},{\bf E})$ be a DAG, and ${\bf X},{\bf Y}\subseteq {\bf V}$ be pairwise disjoint subsets of variables. The \emph{proper back-door graph}, denoted as $\cG^{pbd}_{\bX\bY}$, is obtained from ${\cal G}$ by removing the first edge of every proper causal path from ${\bf X}$ to ${\bf Y}$. \end{definition} For an example proper back-door graph $\cG^{pbd}_{\bX\bY}$, see Fig.~\ref{fig:CBCexample}. Note the difference between the proper back-door graph $\cG^{pbd}_{\bX\bY}$ and the famous back-door graph ${\cal G}_{\underline{{\bf X}}}$ of \cite{Pearl2009}: in ${\cal G}_{\underline{{\bf X}}}$ \emph{all} edges leaving ${\bf X}$ are removed while in $\cG^{pbd}_{\bX\bY}$ only those that lie on a proper causal path (see Figure~\ref{fig:ShpitserVsPearl} for an example illustrating the difference). However, to construct $\cG^{pbd}_{\bX\bY}$ still only elementary operations are sufficient. \highlightrevision{r2c43}{ Indeed, we remove all edges $X \to D$ in ${\bf E}$ such that $X\in {\bf X}$ and $D$ is in the subset of nodes on proper causal paths, which we abbreviate as $\textit{PCP}(\bX,\bY)$, and which is defined as follows:} \begin{equation}\label{eq:pcp:contsr:def} \textit{PCP}(\bX,\bY) = (\textit{De}_{\overline{{\bf X}}}({\bf X}) \setminus {\bf X}) \cap \textit{An}_{\underline{{\bf X} }}({\bf Y}). \end{equation} Hence, the proper back-door graph can be constructed from ${\cal G}$ in linear time ${\cal O}(m+n)$. Note that using the notation $\textit{PCP}$ the proper back-door graph can be specified as $$\cG^{pbd}_{\bX\bY} = ({\bf V},{\bf E} \setminus ({\bf X} \to \textit{PCP}(\bX,\bY) )).$$ Now we propose the following adjustment criterion. For short, we will denote the set $\textit{De}(\textit{PCP}(\bX,\bY))$ as $\textit{Dpcp}(\bX,\bY)$. \begin{definition}[Constructive back-door criterion (CBC)]\label{def:ac:general:bdc} Let ${\cal G} = ({\bf V},{\bf E})$ be a DAG, and let ${\bf X},{\bf Y},{\bf Z} \subseteq {\bf V}$ be pairwise disjoint subsets of variables. The set ${\bf Z}$ satisfies the \emph{constructive back-door criterion} relative to $({\bf X}, {\bf Y})$ in ${\cal G}$ if \begin{enumerate} \item[$(a)$] ${\bf Z} \subseteq {\bf V} \setminus \textit{Dpcp}(\bX,\bY)$ and \item[$(b)$] ${\bf Z}$ $d$-separates ${\bf X}$ and ${\bf Y}$ in the proper back-door graph $\cG^{pbd}_{\bX\bY}$. \end{enumerate} \end{definition} Figure~\ref{fig:CBCexample} shows how the constructive back-door criterion can be applied to find an adjustment set in an example DAG. The CBC is surprisingly robust to modifications of its definition which allows a flexible handling of the forbidden nodes for adjustments and edges one can remove from the DAG to build a proper back-door graph. An example of a modified proper back-door graph is given in Figure~\ref{fig:CBCexample} (rightmost graph): we can remove some further edges from the proper back-door graph simplifying its structure while preserving the property of interest, i.e., finding adjustment sets via $d$-separation. The following extended definition incorporates various possible variants determined by specific parameters, which will turn out to be useful when proving the correctness of the CBC and other related criteria. \begin{definition}[Parametrization of the constructive back-door criterion (CBC(${\bf A},{\bf B},{\bf C} $))]\label{def:ac:general:bdc:prime} Let ${\cal G} = ({\bf V},{\bf E})$ be a DAG, and let ${\bf X},{\bf Y},{\bf Z} \subseteq {\bf V}$ be pairwise disjoint subsets of variables. Let ${\bf A} \subseteq {\bf X} \cup {\bf Y} $, ${\bf B} \subseteq {\bf X} $, ${\bf C} \subseteq \textit{Dpcp}(\bX,\bY)$. The set ${\bf Z}$ satisfies CBC(${\bf A},{\bf B},{\bf C} $) % relative to $({\bf X}, {\bf Y})$ in ${\cal G}$ if \begin{enumerate} \item[$(a')$] ${\bf Z} \subseteq {\bf V} \setminus De_{\overline{{\bf A}}\underline{{\bf B}}}(\textit{PCP}(\bX,\bY))$, and \item[$(b')$] ${\bf Z}$ $d$-separates ${\bf X}$ and ${\bf Y}$ in the graph $\cG^{pbd,\bC}_{\bX\bY} := ({\bf V},{\bf E} \setminus ({\bf X} \to (\textit{PCP}(\bX,\bY) \cup {\bf C}) ))$. \end{enumerate} \end{definition} Clearly CBC($ \emptyset $, $ \emptyset $, $\emptyset$) = CBC. The variants CBC($ {\bf X} $, $ \emptyset $, $\emptyset$) and CBC($ \emptyset $, $ \emptyset $, $\textit{Dpcp}(\bX,\bY)$) might be the most interesting. Condition $ (a') $ of CBC($ {\bf X} $, $ \emptyset $, $\emptyset$) forbids less nodes than $(a)$ of the CBC, namely it excludes the descendants of $\textit{PCP}(\bX,\bY)$ in $ {\cal G}_{\overline{{\bf X}}} $. So, this condition $ (a') $ is identical to condition $ (a) $ of the AC (Definition~\ref{def:ac:general}) which helps to prove the correctness of the CBC. Condition $ (a') $ of CBC($ \emptyset $, $ \emptyset $, $\textit{Dpcp}(\bX,\bY)$), see Figure~\ref{fig:CBCexample} for an example, forbids exactly the same nodes as $(a)$ of the CBC but according to the condition~$ (b') $ more edges can be removed than due to $(b)$ of the CBC, which might improve the performance in an implementation. Note that the definition excludes CBC($ \emptyset $, $ {\bf Y} $, $\emptyset $), which could be considered as modifying condition $(a)$ to forbid the descendants of $ \textit{PCP}(\bX,\bY) $ in the graph $ {\cal G}_{\underline{{\bf Y}}}$. This would not lead to a valid criterion as it would allow an adjustment set $ \{Z\} $ in the graph $ X \to Y \to Z $, where $ \{Z\} $ is not an adjustment. However, removing edges into $ {\bf Y} $ as in the graph $ {\cal G}_{\overline{{\bf Y}}} $ of CBC($ {\bf Y} $, $ \emptyset $, $ \emptyset $) does not change the descendants at all, since the relevant $ Y $ are in $ \textit{PCP}(\bX,\bY) $ themselves. We can show that none of these modifications change the criterion: \begin{lemma}\label{lem:cbc:variants} Let ${\cal G} = ({\bf V},{\bf E})$ be a DAG, and let ${\bf X},{\bf Y}\subseteq {\bf V}$ be pairwise disjoint subsets of variables. Let ${\bf A} \subseteq {\bf X} \cup {\bf Y} $, ${\bf B} \subseteq {\bf X} $, ${\bf C} \subseteq \textit{De}(\textit{PCP}(\bX,\bY))$. Then CBC(${\bf A}$, ${\bf B}$, ${\bf C} $) is equivalent to the CBC. \end{lemma} \begin{proof} Let $ {\bf Z} $ be a set that satisfies the CBC. Since $ {\bf Z} \subseteq {\bf V} \setminus \textit{Dpcp}(\bX,\bY) = {\bf V} \setminus \textit{De}(\textit{PCP}(\bX,\bY)) $ and $ De_{\overline{{\bf A}}\underline{{\bf B}}}(\textit{PCP}(\bX,\bY)) \subseteq \textit{De}(\textit{PCP}(\bX,\bY))$, the condition $(a')$ $ {\bf Z} \subseteq {\bf V} \setminus De_{\overline{{\bf A}}\underline{{\bf B}}}(\textit{PCP}(\bX,\bY)) $ is satisfied for CBC(${\bf A}$, ${\bf B}$, ${\bf C} $). $ {\bf Z} $ $ d $-separates $ {\bf X} $ and $ {\bf Y} $ in $ \cG^{pbd}_{\bX\bY} $, and thus also in $ \cG^{pbd,\bC}_{\bX\bY} $, because every edge or path of $ \cG^{pbd,\bC}_{\bX\bY} $ also exists in $ \cG^{pbd}_{\bX\bY} $. Thus $(b')$ is true as well. Hence, $ {\bf Z} $ satisfies CBC(${\bf A}$, ${\bf B}$, ${\bf C} $). To see the other direction, let $ {\bf Z} $ be a set that satisfies CBC(${\bf A}$, ${\bf B}$, ${\bf C} $), but not CBC. If $ {\bf Z} $ does not satisfies CBC~$(a)$, there exists a node $ Z\in{\bf V} \setminus De_{\overline{{\bf A}}\underline{{\bf B}}}(\textit{PCP}(\bX,\bY))$ that is not in $ {\bf V} \setminus \textit{Dpcp}(\bX,\bY) = {\bf V} \setminus \textit{De}(\textit{PCP}(\bX,\bY)) $. Then there must exist a proper causal path from ${\bf X}$ to ${\bf Y}$ on which a node $W \in {\bf V} \setminus {\bf X}$ is an ancestor of $ Z $ in $ {\cal G} $, but not in $ {\cal G}_{\overline{{\bf A}}\underline{{\bf B}}} $, i.e., there is a causal path from a node of $ {\bf X} $ over $W$ to $Z$ which intersects ${\bf A} \cup {\bf B} $. We can assume the nodes were chosen such that the length of the subpath between $ W $ and $ Z $ is minimal. Let $W \to \ldots \to Y$ denote the suffix of the path from ${\bf X}$ to ${\bf Y}$ starting in $W$. Note that this path might consist of only the vertex $W$. Additionally, for the causal path from $W$ to $Z$, let $W \to \ldots \to A$ be its shortest prefix with $ A \neq W $ which ends in ${\bf A}\cup{\bf B}\cup{\bf X} \subseteq {\bf X} \cup {\bf Y}$. Notice that $W$ itself cannot be in $ {\bf B}$ and, if it is in ${\bf A}$, it does not change the paths. Then, from the condition $(a')$, we know that no vertex of $W \to \ldots \to A$ belongs to ${\bf Z}$. If $A \in {\bf X}$, this leads to a contradiction with the condition $(b')$ since $A \gets \ldots \gets W \to \ldots \to Y$ is a path $ \cG^{pbd,\bC}_{\bX\bY} $ from ${\bf X}$ to ${\bf Y}$ that is not blocked by ${\bf Z}$. % Otherwise we have $A \in {\bf Y}$, so $A \in \textit{PCP}(\bX,\bY)$ and the path from $A$ to $ Z $ is shorter than the path from $ W $ to $ Z $, which contradicts the choice of $ W $. If $ {\bf Z} $ does not satisfies CBC~$(b)$, but satisfies CBC~$(a)$, there exists a path $ \pi $ between ${\bf X} $ and $ {\bf Y} $ not blocked in $ \cG^{pbd}_{\bX\bY} $ by $ {\bf Z} $ that is blocked in $ \cG^{pbd,\bC}_{\bX\bY} $ due to a removed edge $ X \to C $ with $ X \in {\bf X}, C\in {\bf C} $. If $ X \to C $ is on $ \pi $, we can assume it is the last such edge on $ \pi $. If the subpath from $ C $ to $ Y $ is causal, this edge is also removed in $ \cG^{pbd}_{\bX\bY} $, a contradiction. So this subpath becomes non-causal at a collider $ \to C' \gets $ unblocked in $ \cG^{pbd}_{\bX\bY} $, which has a descendant in ${\bf Z}$ that is also a descendant of $ C $ contradicting CBC~$(a)$. If the removal of the edge $X \to C $ prevents the opening of a collider, $ C $ is also the ancestor of a node in $ {\bf Z} $, which contradicts CBC~$(a)$ either. \end{proof} We will see the usefulness of the parametrization of the constructive back-door criterion in the proof of the main result of this subsection: \begin{theorem}\label{th:ac:equivalence} The constructive back-door criterion (CBC) is equivalent to the adjustment criterion (AC). \end{theorem} \begin{proof} First observe that the condition $(a)$ of the adjustment criterion AC is identical to condition $(a')$ of the constructive back-door criterion CBC($ {\bf X} $, $ \emptyset $, $\emptyset$). Assume conditions $(a)$ and $(b)$ of the adjustment criterion AC hold. Due to Lemma~\ref{lem:cbc:variants}, it is sufficient to show that condition $(b)$ of the constructive back-door criterion is satisfied. Let $\pi$ be any proper path from ${\bf X}$ to ${\bf Y}$ in $\cG^{pbd}_{\bX\bY}$. Because $\cG^{pbd}_{\bX\bY}$ does not contain causal paths from ${\bf X}$ to ${\bf Y}$, $\pi$ is not causal and has to be blocked by ${\bf Z}$ in ${\cal G}$ by the assumption. Since removing edges cannot open paths, $\pi$ is blocked by ${\bf Z}$ in $\cG^{pbd}_{\bX\bY}$ as well. Now we show that $(a)$ and $(b)$ of the constructive back-door criterion CBC together imply $(b)$ of the adjustment criterion AC. If that were not the case, then there could exist a proper non-causal path $\pi$ from ${\bf X}$ to ${\bf Y}$ that is blocked in $\cG^{pbd}_{\bX\bY}$ but open in ${\cal G}$. There can be two reasons why $\pi$ is blocked in $\cG^{pbd}_{\bX\bY}$: (1) The path starts with an edge $X \to D$ that does not exist in $\cG^{pbd}_{\bX\bY}$. Then we have $D \in \textit{PCP}(\bX,\bY)$. For $\pi$ to be non-causal, it would have to contain a collider $C \in \textit{An}({\bf Z}) \cap \textit{De}(D) \subseteq \textit{An}({\bf Z}) \cap \textit{Dpcp}(\bX,\bY)$. But because of CBC~$(a)$, $\textit{An}({\bf Z}) \cap \textit{Dpcp}(\bX,\bY)$ is empty. (2) A collider $C$ on $\pi$ is an ancestor of ${\bf Z}$ in ${\cal G}$, but not in $\cG^{pbd}_{\bX\bY}$. Then there must be a directed path from $C$ to ${\bf Z}$ via an edge $X \to D$ with $D \in \textit{An}({\bf Z}) \cap \textit{PCP}(\bX,\bY) $, contradicting CBC~$(a)$. \end{proof} \subsection{CBC vs Pearl's back-door criterion}\label{sec:singletons} \begin{figure} \begin{center} \begin{tabular}{ccc} \begin{tikzpicture}[yscale=0.85,xscale=0.7] \node (g) at (-1.5,-1.5) {${\cal G}$:}; \node (x1) at (0,0) {$X_1$}; \node[adjusted] (z1) at (1.2,-1) {$Z_1$}; \node[adjusted] (z2) at (.8,-2) {$Z_2$}; \node (x2) at (0,-3) {$X_2$}; \node (y1) at (2,0) {$Y_1$}; \node (y2) at (2,-3) {$Y_2$}; \draw [->] (x1) -- (z1); \draw [->] (x1) -- (y1); \draw [->] (z1) -- (z2); \draw [->] (z2) -- (x2); \draw [->] (y2) -- (z2); \end{tikzpicture}\hspace*{15mm} & \begin{tikzpicture}[yscale=0.85,xscale=0.7] \node (g) at (-1.5,-1.5) {$\ensuremath{\cG_{\underline{\bX}}}$:}; \node (x1) at (0,0) {$X_1$}; \node[adjusted] (z1) at (1.2,-1) {$Z_1$}; \node[adjusted] (z2) at (.8,-2) {$Z_2$}; \node (x2) at (0,-3) {$X_2$}; \node (y1) at (2,0) {$Y_1$}; \node (y2) at (2,-3) {$Y_2$}; \draw [->] (z1) -- (z2); \draw [->] (z2) -- (x2); \draw [->] (y2) -- (z2); \end{tikzpicture}\hspace*{15mm} & \begin{tikzpicture}[yscale=0.85,xscale=0.7] \node (g) at (-1.5,-1.5) {$\cG^{pbd}_{\bX\bY}$:}; \node (x1) at (0,0) {$X_1$}; \node[adjusted] (z1) at (1.2,-1) {$Z_1$}; \node[adjusted] (z2) at (.8,-2) {$Z_2$}; \node (x2) at (0,-3) {$X_2$}; \node (y1) at (2,0) {$Y_1$}; \node (y2) at (2,-3) {$Y_2$}; \draw [->] (x1) -- (z1); \draw [->] (z1) -- (z2); \draw [->] (z2) -- (x2); \draw [->] (y2) -- (z2); \end{tikzpicture} \end{tabular} \end{center} \caption{A DAG where for ${\bf X}=\{X_1,X_2\}$ and ${\bf Y}=\{Y_1,Y_2\}$, ${\bf Z}=\{Z_1,Z_2\}$ is a valid and minimum adjustment, but no set fulfills the back-door criterion \citep{Pearl2009} (Definition~\ref{def:back-door:pearl}), and the parents of ${\bf X}$ are not a valid adjustment set either. } \label{fig:ShpitserVsPearl} \end{figure} In this section we relate our constructive back-door criterion to the well-known back-door criterion by Pearl \cite{Pearl2009}: \begin{definition}[Pearl's back-door criterion (BC) \cite{Pearl2009}]\label{def:back-door:pearl} A set of variables ${\bf Z}$ satisfies the \emph{back-door criterion} relative to an ordered pair of variables $(X, Y)$ in a DAG ${\cal G}$ if: \begin{enumerate} \item[$(a)$] ${\bf Z} \subseteq {\bf V} \setminus \textit{De}(X)$ and \item[$(b)$] ${\bf Z}$ blocks every path between $X$ and $Y$ that contains an arrow into $X$. \end{enumerate} Similarly, if ${\bf X}$ and ${\bf Y}$ are two disjoint subsets of nodes in ${\cal G}$, then ${\bf Z}$ is said to satisfy the back-door criterion relative to $({\bf X},{\bf Y})$ if it satisfies the back-door criterion relative to any pair $(X,Y)$ such that $X\in{\bf X}$ and $Y\in{\bf Y}$. \end{definition} In Definition~\ref{def:back-door:pearl} condition $(b)$ is often replaced by the equivalent condition that ${\bf Z}$ $d$-separates ${\bf X}$ and ${\bf Y}$ in the back-door graph ${\cal G}_{\underline{X}}$. In \cite{TextorLiskiewicz2011} it was shown that for minimal adjustment sets in ${\bf X}$-loop-free DAGs the adjustment criterion and the back-door criterion of Pearl are equivalent. A DAG is ${\bf X}$-loop-free for an exposure set ${\bf X}$, if no directed path between two different nodes of ${\bf X}$ contains a node not in ${\bf X}$. If $X$ is a singleton, there are no two different nodes of ${\bf X}$ and every DAG is ${\bf X}$-loop-free, so the criteria are always equivalent for minimal adjustments. In this case it is still possible that an adjustment set ${\bf Z}$ satisfies the CBC and not the back-door criterion, but there will always be a minimal subset ${\bf Z}' \subseteq {\bf Z}$ that satisfies the back-door criterion. Since an adjustment set satisfying the back-door criterion also satisfies the generalized back-door criterion of \cite{Maathuis2013}, and all sets of the generalized back-door criterion satisfy our CBC, all three criteria are equivalent to test the \emph{existence} of an (minimal) adjustment set for a singleton $X$ in DAGs. The situation changes if the effect of multiple exposures is estimated. Theorem~3.2.5 in \citet{Pearl2009} claims that the expression for $P({\bf y} \mid \textit{do}({\bf x}))$ is obtained by adjusting for $\textit{Pa}({\bf X})$ if ${\bf Y}$ is disjoint from $ % \textit{Pa}({\bf X})$ in graphs without latent nodes, but, as the DAG in Figure~\ref{fig:ShpitserVsPearl} shows, this is not true: the set ${\bf Z}=\textit{Pa}(X_1,X_2) = \{Z_2\}$ is not an adjustment set according to $\{X_1,X_2\}$ and $\{Y_1,Y_2\}$. In this case one can identify the causal effect by adjusting for ${\bf Z}=\{Z_1,Z_2\}$ only. Indeed, for more than one exposure, no adjustment set may exist at all even without latent covariates and even though ${\bf Y} \cap ({\bf X}\cup \textit{Pa}({\bf X})) = \emptyset$, e.g., in the DAG \begin{tikzpicture}[text height=.4em,xscale=1,,baseline=-.18em] \node (x1) at (.2,0) {$X_1$}; \node (x2) at (1,0) {$X_2$}; \node (z) at (2,0) {$Z$}; \node (y) at (3,0) {$Y$}; \draw [->] (z) -- (x2); \draw [->] (y) -- (z); \draw [->] (x1) edge [bend left=25] (z); \end{tikzpicture} and for ${\bf X}=\{X_1,X_2\}$ and ${\bf Y}=\{Y\}$. In the case of multiple exposures ${\bf X}$ it is also harder to use the back-door criterion to actually find an adjustment set. Although the back-door criterion reduces adjustment to $d$-separation in the back-door graph ${\cal G}_{\underline{X}}$, this is not the graph ${\cal G}_{\underline{{\bf X}}}$, so for each exposure $X \in {\bf X}$ the criterion would find a separate adjustment set, which do not lead directly to a combined adjustment set for all exposures. For an example see Figure~\ref{fig:ShpitserVsPearl}. Table~\ref{tab:bdc:vs:cbc} summarizes the relationships between CBC and the Pearl's back-door criterion. \begin{table} \begin{center} \begin{tabular}{lcll} \multicolumn{3}{l}{Statement for arbitrary DAGs and all sets ${\bf Z}$:}& proof \\[1mm] ${\bf Z}$ satisfies CBC & $\not\Rightarrow$ & ${\bf Z}$ satisfies back-door & $ Z \gets X \to Y $ \\ ${\bf Z}$ satisfies CBC & $\not\Rightarrow$ & $\exists{\bf Z}'$ satisfying back-door & see Figure~\ref{fig:ShpitserVsPearl} \\ ${\bf Z}$ satisfies CBC and $ {\bf Z} $ is minimal & $\not\Rightarrow$ & ${\bf Z}$ satisfies back-door & see Figure~\ref{fig:ShpitserVsPearl} \\ ${\bf Z}$ satisfies CBC and $ {\bf Z} $ is minimal & $\not\Rightarrow$ & $\exists{\bf Z}'$ satisfying back-door & see Figure~\ref{fig:ShpitserVsPearl} \\ \\[-3mm] \multicolumn{4}{l}{Statement for all ${\bf X}$-loop-free DAGs (e.g., for singleton $X$) and all sets ${\bf Z}$:}\\[1mm] ${\bf Z}$ satisfies CBC &$\not\Rightarrow$ & ${\bf Z}$ satisfies back-door & $ Z \gets X \to Y $ \\ ${\bf Z}$ satisfies CBC & $\Rightarrow$ & $\exists{\bf Z}'$ satisfies back-door & via minimal $ {\bf Z}'\subseteq{\bf Z} $ \\ ${\bf Z}$ satisfies CBC and $ {\bf Z} $ is minimal & $\Rightarrow$ & ${\bf Z}$ satisfies back-door & see \cite{TextorLiskiewicz2011} \\ ${\bf Z}$ satisfies CBC and $ {\bf Z} $ is minimal & $\Rightarrow$ & $\exists{\bf Z}'$ satisfying back-door & ${\bf Z}'={\bf Z}$ \end{tabular} \end{center}\vspace*{-3mm} \caption{A summary of the relationship between the existence of a Pearl back-door-adjustment set and the existence of an CBC-adjustment set in unconstrained DAGs and ${\bf X}$-loop-free DAGs. Symbol $\not\Rightarrow$ means that the implication does not hold, in general. On the other hand, due to the completeness property of the CBC, we have that if one replaces in the left hand sides "CBC" by "back-door" and in the right hand sides "back-door" by "CBC", then the corresponding implications are always true.} \label{tab:bdc:vs:cbc} \end{table} \section{Algorithms for testing and computing adjustment sets in DAGs} \label{sec:algorithms:adjustment} Having proved the constructive back-door criterion, we are now licensed to apply our separation algorithms from Section~\ref{sec:algo} to solve adjustment set problems. This works because the adjustment relative to $ {\bf X} $ and $ {\bf Y} $ in $ {\cal G} $ corresponds to an $ m $-separator between $ {\bf X} $ and $ {\bf Y} $ in $ \cG^{pbd}_{\bX\bY} $ subject to the constraint given by CBC~$(a)$. Table~\ref{fig:problemsadj} gives an overview of the relevant tasks. A small difference exists between testing and constructing adjustment sets when handling CBC~$(a)$: Testing requires us to check if the given set $ {\bf Z} $ contains nodes of $ \textit{Dpcp}(\bX,\bY) $, whereas constructing requires that the returned set ${\bf Z}$ must not contain any of the nodes in $\textit{Dpcp}(\bX,\bY)$. The latter requirement can be straightforwardly implemented by imposing the constraint $ {\bf Z} \subseteq {\bf R}' = {\bf R}\setminus\textit{Dpcp}(\bX,\bY) $, which can be given as parameter to our separation algorithms. \begin{table*} \centering \begin{tabular}{llll} &&&Runtime \\ \multicolumn{3}{l}{\textbf{Verification:} \text{For given ${\bf X}, {\bf Y},{\bf Z}$ and constraint ${\bf I}$ decide if $\ldots$ }} &\\ \hspace*{2mm} & {\sc TestAdj} & ${\bf Z}$ is an adjustment for $({\bf X},{\bf Y})$ & ${\cal O}(n+m)$ \\ & {\sc TestMinAdj} & ${\bf Z}\supseteq {\bf I}$ is an adjustment for $({\bf X},{\bf Y})$ and ${\bf Z}$ is $\ldots$ &\\ & & \hspace*{3mm} $ {\bf I} $-minimal & ${\cal O}(n^2)$ \\ & & \hspace*{3mm} strongly-minimal & ${\cal O}(n^2)$ \\[2mm] \multicolumn{3}{l}{\textbf{Construction:} \text{For given ${\bf X}, {\bf Y}$ and constraints ${\bf I}, {\bf R}$, output an $\ldots$}} & \\ \hspace*{2mm} & {\sc FindAdj} & adjustment ${\bf Z}$ for $({\bf X},{\bf Y})$ with ${\bf I}\subseteq{\bf Z}\subseteq{\bf R}$ & ${\cal O}(n+m)$ \\ & {\sc FindMinAdj} & adjustment ${\bf Z}$ for $({\bf X},{\bf Y})$ with ${\bf I}\subseteq{\bf Z}\subseteq{\bf R}$ which is $\ldots$ &\\ & & \hspace*{3mm} $ {\bf I} $-minimal & ${\cal O}(n^2)$ \\ & & \hspace*{3mm} strongly-minimal & NP-hard \\ & {\sc FindMinCostAdj} & adjustment ${\bf Z}$ for $({\bf X},{\bf Y})$ with ${\bf I}\subseteq{\bf Z}\subseteq{\bf R}$ which is $\ldots$ &\\ & & \hspace*{3mm} $ {\bf I} $-minimum & ${\cal O}(n^3)$ \\ & & \hspace*{3mm} strongly-minimum & ${\cal O}(n^3)$ \\[2mm] \multicolumn{3}{l}{\textbf{Enumeration:} \text{For given ${\bf X}, {\bf Y}, {\bf I}, {\bf R}$ enumerate all $\ldots$ } }&Delay\\ & {\sc ListAdj} & adjustments ${\bf Z}$ for $({\bf X},{\bf Y})$ with ${\bf I}\subseteq {\bf Z} \subseteq {\bf R}$ &${\cal O}(n(n+m))$ \\ & {\sc ListMinAdj} & $ {\bf I} $-minimal adjustments ${\bf Z}$ with ${\bf I} \subseteq {\bf Z} \subseteq {\bf R}$ &${\cal O}(n^3)$ \\ \end{tabular} \caption{Definitions of algorithmic tasks related to adjustment in DAGs. The meaning of parameters ${\bf X}, {\bf Y}, {\bf Z}, {\bf I},$ and ${\bf R}$ is the same as in the definitions of tasks related to $m$-separation in Table~\ref{fig:problems}. The right column shows the associated time complexities given in this section. Due to our linear-time reduction from causal effect identification by adjustment to $m$-separation in a subgraph of an input DAG, the time complexities to solve the problems above are the same as in Table~\ref{fig:problems}. } \label{fig:problemsadj} \end{table*} \newcommand{De_{\overline{{\bf X}}}(\{W \in {\bf V} \mid \exists \text{proper path } {\bf X} \stackrel{+}{\to} W \stackrel{*}{\to} {\bf Y} \})}{De_{\overline{{\bf X}}}(\{W \in {\bf V} \mid \exists \text{proper path } {\bf X} \stackrel{+}{\to} W \stackrel{*}{\to} {\bf Y} \})} \newcommand{\{X \to D \mid X \in {\bf X}, D \in {\cal D} \}}{\{X \to D \mid X \in {\bf X}, D \in {\cal D} \}} Hence {\sc TestAdj} can be solved by testing if ${\bf Z}\cap \textit{Dpcp}(\bX,\bY) = \emptyset$ and if ${\bf Z}$ is a $d$-separator in the proper back-door graph $\cG^{pbd}_{\bX\bY}$ using algorithm {\sc TestSep}. Since $\cG^{pbd}_{\bX\bY}$ can be constructed from ${\cal G}$ in linear time, the total time complexity of this algorithm is ${\cal O}(n+m)$. {\sc TestMinAdj} can be solved by testing again if ${\bf Z}\cap \textit{Dpcp}(\bX,\bY) = \emptyset$ and calling {\sc TestMinSep} to verify that $ {\bf Z} $ is minimal within the back-door graph $ \cG^{pbd}_{\bX\bY} $. This leads to a runtime of $ {\cal O}(n^2) $ which is optimal for dense graphs. Alternatively {\sc TestMinSepSparse} with its runtime of ${\cal O}(|\textit{Ant}({\bf X} \cup {\bf Y})| \cdot |\text{Edges of } (\cG^{pbd}_{\bX\bY})^a | ) = {\cal O}(n(n+m)) $ can be used in sparse graphs. It is worth noting that since the back-door graph is formed by removing edges, it is even sparser than the input graph. This approach only works because the minimal adjustment corresponds to a \emph{minimal} separator in the proper back-door graph: every subset of an adjustment must still satisfy condition CBC~$(a)$. It also implies the following corollary which generalizes the result of \citet{TianPP1998} from $d$-separators to adjustment sets: \begin{corollary} \highlightrevision{r2c49}{ An adjustment set ${\bf Z}$ is minimal if and only if no single node $Z$ can be removed from ${\bf Z}$ such that the resulting set ${\bf Z}'={\bf Z}\setminus Z$ is no longer an adjustment set.} \end{corollary} The problem {\sc FindAdj} can be solved by a closed form solution. For a DAG ${\cal G}=({\bf V},{\bf E})$ and constraints $ {\bf I},{\bf R} $ we define the set \begin{newpartinrevision}[r2c50] $$ \textit{Adjustment}({\bf X},{\bf Y}) = \textit{An}({\bf X} \cup {\bf Y} \cup {\bf I}) \cap {\bf R} \setminus ({\bf X} \cup {\bf Y} \cup \textit{Dpcp}(\bX,\bY)). $$ \end{newpartinrevision} \begin{theorem}\label{th:adj:set:cosctr} Let ${\cal G}=({\bf V},{\bf E})$ be a DAG, let ${\bf X},{\bf Y} \subseteq V$ be disjoint node sets and $ {\bf I}, {\bf R} $ constraining node sets with ${\bf I} \subseteq {\bf R} \setminus ({\bf X} \cup {\bf Y} \cup \textit{Dpcp}(\bX,\bY))$. Then the following statements are equivalent: \begin{enumerate} \item There exists an adjustment $ {\bf Z} $ in ${\cal G}$ w.r.t. ${\bf X}$ and ${\bf Y}$ with $ {\bf I}\subseteq{\bf Z}\subseteq{\bf R} $. \item $\textit{Adjustment}({\bf X},{\bf Y})$ is an adjustment w.r.t. ${\bf X}$ and ${\bf Y}$. \item $\textit{Adjustment}({\bf X},{\bf Y})$ $d$-separates ${\bf X}$ and ${\bf Y}$ in the proper back-door graph $\cG^{pbd}_{\bX\bY}$. \end{enumerate} \end{theorem} \begin{proof} The implication $\it (3)\Rightarrow(2)$ follows directly from the criterion Def.~\ref{def:ac:general:bdc} and the definition of $\textit{Adjustment}({\bf X},{\bf Y})$. Since the implication $\it (2)\Rightarrow(1)$ is obvious, it remains to prove $\it (1)\Rightarrow(3)$. Assume there exists an adjustment set ${\bf Z}_0$ w.r.t. ${\bf X}$ and ${\bf Y}$. From Theorem~\ref{th:ac:equivalence} we know that ${\bf Z}_0 \cap \textit{Dpcp}(\bX,\bY)= \emptyset$ and that ${\bf Z}_0$ $d$-separates ${\bf X}$ and ${\bf Y}$ in $\cG^{pbd}_{\bX\bY}$. Our task is to show that $\textit{Adjustment}({\bf X},{\bf Y})$ $d$-separates ${\bf X}$ and ${\bf Y}$ in $\cG^{pbd}_{\bX\bY}$. This follows from Lemma~\ref{lemma:auxiliary:m:sep} used for the proper back-door graph $\cG^{pbd}_{\bX\bY}$ if we take ${\bf I}'={\bf I}$, ${\bf R}'={\bf R} \setminus ({\bf X} \cup {\bf Y} \cup \textit{Dpcp}(\bX,\bY))$. \end{proof} From Equation~\eqref{eq:pcp:contsr:def} and the definition $\textit{Dpcp}(\bX,\bY) = \textit{De}(\textit{PCP}(\bX,\bY))$ we then obtain immediately: \begin{corollary}\label{enum:fastas} Given two disjoint sets ${\bf X}, {\bf Y} \subseteq {\bf V}$, $\textit{Adjustment}({\bf X},{\bf Y})$ can be found in ${\cal O}(n+m)$ time. \end{corollary} The remaining problems, {\sc FindMinAdj}, {\sc FindMinCostAdj}, {\sc ListAdj} and {\sc ListMinAdj} can be solved using the corresponding algorithms for finding, resp. listing $m$-separations applied to the proper back-door graph. Since the proper back-door graph can be constructed in linear time the time complexities to solve the problems above are the same in Table~\ref{fig:problems} and Table~\ref{fig:problemsadj}. The NP-hardness of finding strongly-minimal adjustment sets follows from Proposition~\ref{prop:np-complete} and the fact that the graph constructed in the proof of the proposition contains no causal paths between $ X $ and $ Y $, so there are no forbidden nodes and that graph is the same as its back-door graph. \section{Extending the CBC} \label{sec:cbcext} While our complete adjustment criterion is guaranteed to find all instances in which a causal effect can be identified via covariate adjustment, it is well known that not all identifiable effects are also identifiable via adjustment. The do-calculus \cite{Pearl2009} is a complete method that characterizes all identifiable causal effects, but which comes at a price of substantially increased formula and runtime complexity. In this section, we however show that many cases in which covariate adjustment is not applicable do not require the power of the do-calculus either. Specifically, we provide three lemmas that permit identification of total causal effects in the following three cases (which are not mutually exclusive) as shown in Figure~\ref{fig:cases:beyond:cbc}: (1) ${\bf X}$ does not have a causal effect on ${\bf Y}$; (2) \highlightrevision{r3c8}{${\bf X}=X$ is singleton and all its parents are observed;} (3) ${\bf X}$ and ${\bf Y}$ partition ${\bf V}$. While in each case the adjustment criterion may or may not be applicable, our lemmas show that identifiability is always guaranteed, and the total effect can be computed by reasonably simple formulas. Moreover, each lemma provides an easy algorithm for testing whether the corresponding case applies. \tikzset{exp/.style={color=green!50!black}} \tikzset{res/.style={color=blue}} \tikzset{lat/.style={color=gray}} \begin{figure}\arxivonly{\small}\begin{center} (1) \begin{tikzpicture}[baseline] \graph { v1[res,as=$Y_1$] -!- v2[as=$V_2$], v3[lat,as=$V_1$] -!- v4[exp,as=$X_1$], v1 -> v4, v1 -> v2 -> v4, v3 -> v1, v3 -> v4 }; \end{tikzpicture} \phantom{long cat} (2) \begin{tikzpicture}[baseline] \graph { v1[res,as=$Y_1$] -!- v2[exp,as=$X_1$], v3[lat, as=$V_1$] -!- v4[res,as=$Y_2$], v1 -> v4, v1 -> v2 -> v4, v3 -> v1, v3 -> v4 }; \end{tikzpicture} \phantom{long cat} (3) \begin{tikzpicture}[baseline] \graph { v1[res,as=$Y_1$] -!- v2[exp,as=$X_1$], v3[exp,as=$X_2$] -!- v4[res,as=$Y_2$], v1 -> v4, v1 -> v2 -> v4, v3 -> v1, v3 -> v4 }; \end{tikzpicture} \end{center} \caption{The three cases analyzed in this section. Exposure and outcome nodes are marked as $X$ and $Y$; latent nodes are shown in gray. In case (1) the causal effect is given by $P(y_1 \mid \textit{do}(x_1)) = P(y_1)$, in case (2) by $P(y_1, y_2 \mid \textit{do}(x_1)) = P(y_1) P(y_{2} \mid x_1, y_1)$, and in case (3) by $P(y_1, y_2 \mid \textit{do}(x_1, x_2)) = P(y_1 \mid x_2 ) P(y_2 \mid y_1, x_1, x_2 ) $. }\label{fig:cases:beyond:cbc} \end{figure} \subsection{Identification by plain formulas}\label{sec:observation} One case in which identification is trivial is if there is no causal effect of $X$ on $Y$ at all. When all non-causal paths between $X$ and $Y$ can be blocked, then this case is covered by the CBC; however, if there is a non-causal path consisting solely of unobserved nodes, then the (void) effect is not obtainable through the adjustment formula. In such cases, however, we simply have $P({\bf y}\mid \textit{do}({\bf x})) = P({\bf y})$, which we will call the \emph{plain formula}. The following proposition provides a characterization of all cases in which this plain formula works in terms of $d$-separation. \begin{proposition}\label{prep:observation:is:causal} Let ${\cal G}=({\bf V},{\bf E})$ be a DAG and let ${\bf X},{\bf Y}\subseteq {\bf V}$ be disjoint subsets of variables and let ${\bf R} \subseteq {\bf V}$ be an arbitrary set of observed variables, with $ {\bf X}\cup {\bf Y} \subseteq{\bf R}$. Then % ${\bf X}$ and ${\bf Y}$ are $d$-separated in ${\cal G}_{\overline{{\bf X}}}$, expressed symbolically as \begin{equation}\label{eq:plain:condition} ({\bf Y} \independent {\bf X})_{{\cal G}_{\overline{{\bf X}}}} \end{equation} if and only if the effect of intervention of ${\bf X}$ on ${\bf Y}$ % is given by the plain formula $P({\bf y} \mid \textit{do}({\bf x})) = P({\bf y})$, \highlightrevision{r2c53}{i.e., there is no causal effect from ${\bf X}$ on ${\bf Y}$.} Particularly, if $Y \in \textit{An}(X)$ then $(Y \independent X)_{{\cal G}_{\overline{X}}}$ and thus $P(y \mid \textit{do}(x)) = P(y)$. \end{proposition} \begin{proof} The soundness of the statement % follows directly by the application of rule 3 (intervention/deletion of actions; for the precise definition of the do-calculus rules see Theorem~3.4.1 in \citep{Pearl2009}). The completeness of the statement can be shown similarly to the completeness of the adjustment criterion~\cite{ShpitserVR2010}. If ${\bf Y}$ and ${\bf X}$ are not $ d $-separated in ${\cal G}_{\overline{{\bf X}}}$, there exists a shortest causal path $ X \to \ldots \to Y $ for $ X \in {\bf X},Y \in {\bf Y} $. In the subgraph $ {\cal G}' = ({\bf V}', {\bf E}')$ consisting only of this path, the causal effect is given by an empty adjustment set $P(y\mid \textit{do}(x)) = P(y\mid x)$. If we take a model $P' $ where $P'(y \mid x) \neq P'(y) $ for some values $ x, y $, like e.g. in a model on binary variables $ X$, $Y $ with \[ P'(x) = \frac{1}{2}\quad \text{and} \quad P'(y\mid x) = \begin{cases} \frac{1}{3}& x = y,\\ \frac{2}{3}& x \neq y, \end{cases} \] the causal effect is not given by $P'(y)$. This model can be extended to a model $ P $ on the full graph $ {\cal G} $ by assuming all other variables are independent, i.e., $ P({\bf v}) = (\frac{1}{2})^{|{\bf V} \setminus {\bf V}'|} P'({\bf v}') $. This model is consistent with $ {\cal G} $ (though not faithful, but faithfulness is not required) and we have \[ P({\bf y}\mid \textit{do}({\bf x})) \ = \ P({\bf y} \setminus Y) P(y\mid \textit{do}(x)) \ = \ P({\bf y} \setminus Y) P'(y\mid \textit{do}(x)) \neq P({\bf y} \setminus Y) P'(y) \ = \ P({\bf y} \setminus Y) P(y) = P({\bf y}). \] \end{proof} \subsection{Identification by generalized parent adjustment} Another case that permits the identification of causal effects using simple formulas occurs if the exposure $ {\bf X} = {X} $ is a singleton and all its parents are observed, i.e., $ \textit{Pa}(X) \subseteq {\bf R} $. Then adjusting for the parents of $X$ blocks all biasing paths and suffices for identification, but one needs to be careful as there might be variables $ {\bf Y}_{pa} = \textit{Pa}(X) \cap {\bf Y} $ that are both parents and outcome nodes. Proposition~\ref{prop:singleton} below shows that in this case the causal effect is given by $P({\bf y} \mid \textit{do}(x)) \ =\ \sum_{{\bf z}} P({\bf z}, {\bf y}_{pa}) P({\bf y}_{np} \mid x, {\bf z}, {\bf y}_{pa})$, where $ {\bf Y}_{pa} \cup {\bf Y}_{np}$ is a partition of $ {\bf Y} $ and $ {\bf Y}_{pa} \cup {\bf Z} $ is a partition of $ \textit{Pa}(X) $. % This is a slight generalization of identification via adjustment: we still sum over the values of variables $ {\bf Z} $ and multiply the conditional probability with a factor, but rather than multiplying with the probability of the same variables $ P({\bf z}) $ that are used in the sum, we multiply with a factor $ P({\bf z}, {\bf y}_{pa}) $ involving additionally the variables in $ {\bf Y}_{pa} $. The situation is even simpler when $ Y $ is also a singleton. Then one of the sets $ {\bf Y}_{pa}, {\bf Y}_{np} $ vanishes, so there are only two cases: either $Y \notin \textit{Pa}(X)$ and $\textit{Pa}(X)$ is an adjustment set \citep[Theorem~3.2.2]{Pearl2009}, or $Y \in \textit{Pa}(X)$ and no adjustment exists, but the causal effect is identified as $P(y \mid \textit{do}(x)) = P(y)$. One can see that in the case $Y\in \textit{An}(X)\setminus\textit{Pa}(X)$ the effect of intervention $\textit{do}(X=x)$ can be given both by the plain expression $P(y \mid \textit{do}(x)) = P(y)$ and by adjustment in parents of $X$. % \begin{proposition}\label{prop:singleton} Let ${\cal G}=({\bf V},{\bf E})$ be a DAG and let $X \in {\bf V}$ be a node with observed parents $ \textit{Pa}(X) \subseteq {\bf R} $ and ${\bf Y}\subseteq {\bf V} \setminus X$. Furthermore, let ${\bf Y}_{pa} = {\bf Y} \cap \textit{Pa}(X)$ and let ${\bf Y}_{np} = {\bf Y} \setminus \textit{Pa}(X)$ be a partition of $ {\bf Y} = {\bf Y}_{pa} \cup {\bf Y}_{np} $ and let $ {\bf Z} = \textit{Pa}(X) \setminus {\bf Y}_{pa} $ form with $ {\bf Y}_{pa} $ a partition of $ \textit{Pa}(X) = {\bf Y}_{pa} \cup {\bf Z} $. Then \[ P({\bf y} \mid \textit{do}(x)) \ =\ \begin{cases} P({\bf y}_{pa}) P({\bf y}_{np} \mid x, {\bf y}_{pa}) & \text{if ${\bf Z}=\emptyset$, i.e., if $\textit{Pa}(X)\subseteq {\bf Y}$,} \\[1mm] \sum_{{\bf z}} P({\bf z}, {\bf y}_{pa}) P({\bf y}_{np} \mid x, {\bf z}, {\bf y}_{pa}) & \text{if ${\bf Z}\not=\emptyset$,} \end{cases} \] where $P({\bf y}_{pa})$ (resp. $ P({\bf y}_{np} \mid x, {\bf y}_{pa})$ and $ P({\bf y}_{np} \mid x, {\bf z}, {\bf y}_{pa})$) should be read as $1$ if ${\bf Y}_{pa}=\emptyset$ (resp. ${\bf Y}_{np}=\emptyset$). \end{proposition} \begin{proof} This follows from a straightforward calculation using the do-calculus: \begin{align*} P({\bf y} \mid \textit{do}(x)) \ =\ & P({\bf y}_{pa}, {\bf y}_{np} \mid \textit{do}(x))\\ =\ & \sum_{{\bf z}} P({\bf z}, {\bf y}_{pa}, {\bf y}_{np} \mid \textit{do}(x))\\ =\ & \sum_{{\bf z}} P({\bf z}, {\bf y}_{pa}\mid \textit{do}(x)) P({\bf y}_{np} \mid \textit{do}(x), {\bf z}, {\bf y}_{pa}) \\ =\ & \sum_{{\bf z}} P({\bf z}, {\bf y}_{pa}) P({\bf y}_{np} \mid \textit{do}(x), {\bf z}, {\bf y}_{pa}) &\rlap{\hspace*{-2.5cm}\parbox{5.5cm}{do-calculus rule 3 in \cite[Subsect. 3.4.2]{Pearl2009}\\$({\bf Y}_{pa}, {\bf Z} \independent X )\text{ in }{\cal G}_{\overline{X}}$}} \\ =\ & \sum_{{\bf z}} P({\bf z}, {\bf y}_{pa}) P({\bf y}_{np} \mid x, {\bf z}, {\bf y}_{pa}). &\rlap{\hspace*{-2.5cm}\parbox{5.5cm}{do-calculus rule 2 in \cite[Subsect. 3.4.2]{Pearl2009}\\$({\bf Y}_{np} \independent X \mid {\bf Z}, {\bf Y}_{pa})\text{ in } {\cal G}_{\underline{X}}$}} \\ \end{align*} \end{proof} If some of parents $\textit{Pa}(X)$ are unobserved, the causal effect might not be identifiable at all, like e.g., in the DAG ${\cal G}_1$ in Figure~\ref{fig:notident:ident:viaadj}. To decide if the effect is identifiable in such a case, one can use the CBC criterion which, like for ${\cal G}_3$ in Figure~\ref{fig:notident:ident:viaadj}, can confirm the identifiability. However, while the CBC is complete to decide if the effect is expressible via covariate adjustment it is not complete to decide if the effect is identifiable or not. For an example, see the DAG ${\cal G}_2$ in Figure~\ref{fig:notident:ident:viaadj}. To solve the identification problem in this case, when the CBC does not work, one has to use a complete criterion, like this based on the do-calculus. \subsection{Identification when ${\bf X}$ and ${\bf Y}$ partition ${\bf V}$}\label{sec:special:case:v:partition} Here we consider the case of DAGs in which ${\bf X}$ and ${\bf Y}$ partition the set of variables ${\bf V}$, which implies that there are no unobserved nodes. Again, in this case the CBC may not be applicable as there may be an arrow from ${\bf Y}$ to ${\bf X}$, but still the causal effect can be given by a closed-form solution as we present below. \begin{lemma} Let $ {\cal G} = ({\bf V}, {\bf E}) $ be a DAG and $ {\bf X}, {\bf Y} \subset {\bf V} $ be a partition of $ {\bf V} = {\bf X} \cup {\bf Y} $. The following statements hold \begin{enumerate}[$(a)$] % \item The causal effect of $ {\bf X} $ on $ {\bf Y} $ is given by \[ P({\bf y} \mid \textit{do}({\bf x})) = \prod\limits_{Y\in{\bf Y}} P(Y = y \mid \textit{Pa}(Y) ). \] \item If no edge $ X \to Y $ with $X \in {\bf X}, Y \in {\bf Y} $ exists, the causal effect is also given by the plain formula \[ P({\bf y} \mid \textit{do}({\bf x})) = P({\bf y}). \] \item The causal effect can be identified by adjustment if and only if no edge $ Y \to X $ with $X \in {\bf X}, Y \in {\bf Y} $ exists. \item If identification by adjustment is possible, the adjustment set is $ {\bf Z} = \emptyset $ and the causal effect of $ {\bf X} $ on $ {\bf Y} $ is given by \[ P({\bf y} \mid \textit{do}({\bf x})) = P({\bf y} \mid {\bf x} ). \] \end{enumerate} \end{lemma} \begin{proof} Statement (a) follows from the definition of the causal effect: \begin{align*} P({\bf y} \mid \textit{do}({\bf x})) \ =\ & \sum_{{\bf x}'} P({\bf X}= {\bf x}', {\bf Y}= {\bf y} \mid \textit{do}({\bf X}= {\bf x}))\\ =\ & P({\bf x}, {\bf y} \mid \textit{do}({\bf x})) &\rlap{\hspace*{-2.5cm}\parbox{6cm}{${\bf x} \neq {\bf x}'$ makes the causal effect inconsistent}} \\ =\ & P({\bf v} \mid \textit{do}({\bf x})) \\ =\ & \prod_{ Y_j \in{\bf Y} } P(y_j \mid \textit{pa}_j) &\rlap{\hspace*{-2.5cm}\parbox{4.5cm}{definition of the causal effect}} \\ =\ & \prod_{Y\in{\bf Y}} P(Y = y \mid \textit{Pa}(Y) ) \end{align*} For Statements $(b)$ and $(c)$ note that edges $ {\bf X} \to {\bf X} $ or $ {\bf Y} \to {\bf Y} $ do not affect $d$-connectedness between $ {\bf X} $ and $ {\bf Y} $. Hence with the assumption in Statement~$(b)$, the sets ${\bf X}$ and ${\bf Y}$ are $d$-separated in the graph ${\cal G}_{\overline{{\bf X}}}$, where all edges ${\bf Y}\to{\bf X} $ and ${\bf X}\to{\bf X} $ are deleted. Then we know from Proposition~\ref{prep:observation:is:causal} that the causal effect is identified by a plain formula. Since no node is outside of $ {\bf X} \cup {\bf Y} $, the only possible adjustment set is $ {\bf Z} = \emptyset $, which is Statement~$(d)$. Finally, an adjustment set $ {\bf Z} = \emptyset$ always satisfies the first condition of the CBC. % The back-door graph is formed by removing all edges $ {\bf X} \to {\bf Y} $ as those edges form a causal path of length one. Thus $ {\bf Z} $ is an adjustment set, if and only if no edge $ {\bf Y} \to {\bf X} $ exists, which is Statement~$(c)$. % \end{proof} When $ {\bf V} = {\bf X}\cup{\bf Y} $, the R package {\tt causaleffect} \cite{RpackageCausalEffect}, which we used in our experiments described in the next section, returns the formula $ P({\bf y} \mid \textit{do}({\bf x})) = \prod_{Y\in{\bf Y}} P(Y \mid \textit{An}(Y) \setminus Y ) $ when configured to be fast and find \emph{any} identification formula rather than a short one. Thus it is worth to mention that $\prod_{Y\in{\bf Y}} P(Y \mid \textit{An}(Y) \setminus Y ) = \prod_{Y\in{\bf Y}} P(Y \mid \textit{Pa}(Y) )$, because the parents of a node $Y$ block all paths from other ancestors of $Y$ to $Y$. \section{Empirical analysis of identifiability by adjustment}\label{sec:experiments} As mentioned before, not all identifiable total effects are identifiable via covariate adjustment, but if covariate adjustment is possible, then it is usually preferred to other methods due to its benign statistical properties. This raises the question how often we will actually have to go beyond covariate adjustment when identifying causal effects. The completeness and algorithmic efficiency of the CBC allowed us to perform an empirical analysis of identifiability via adjustment in random graphs, including graphs of substantial size. The basic setup of our experiments is as follows. We (1) generate a random graph; (2) set nodes to be unobserved at random; (3) choose random disjoint subsets ${\bf X},{\bf Y}$ of pre-specified cardinalities from the observed nodes; and (4) test whether $P({\bf y} \mid \textit{do}({\bf x}))$ is identifiable in the resulting graph. We test the identifiability of $P({\bf y} \mid \textit{do}({\bf x}))$ using four increasingly powerful criteria: (1) Pearl's back-door criterion \cite{Pearl2009}; (2) the CBC; (3) an extended version of the CBC that also covers the special cases discussed in Section~\ref{sec:cbcext}; and (4) the do-calculus, which characterizes all effects that are identifiable at all. Full details are given below. We included the classic back-door criterion (Definition~\ref{def:back-door:pearl}) in our analysis because it is still very present in the applied literature on DAGs (e.g., \cite{Elwert2013}) whereas the generalized version is still barely mentioned. It is known that the back-door criterion is not complete and can thus fail to identify an adjustment set, which raises the question how often the back-door criterion fails to find an adjustment set when our CBC criterion succeeds. In Section~\ref{sec:singletons} it was shown that this is never the case for a singleton $X$ (although the CBC may still find more adjustment sets than the BC). Our extensions to the CBC in Section~\ref{sec:cbcext} were motivated by our observation from preliminary experiments that many cases where an effect is not identifiable by adjustment are anyway identifiable due to simple reasons like the absence of any causal path from ${\bf X}$ to ${\bf Y}$, which can be addressed quite easily without invoking the full machinery of the do-calculus. We now proceed to give the technical details of how we set up our empirical analysis. \subsection{Instance generation}\label{sub:sub:sect:parameters} We evaluate identifiability on random DAGs, which we generate as described in Section~\ref{sec:basissets}. The random DAGs are generated with different numbers of variables ${\bf V}$ \[ |{\bf V}| = n \in \{10, 25, 50, 100, 250, 500, 1000, 2000\}. \] These variables are divided % into four sets: ordinary observed nodes ${\bf R}$, unobserved nodes ${\bf V}\setminus {\bf R}$, exposure nodes ${\bf X}\subseteq {\bf R}$, and outcome nodes ${\bf Y}\subseteq {\bf R}$ (with ${\bf X} \cap {\bf Y} = \emptyset$) depending on parameters \[ P(\textit{unobserved}) \in \{0, 0.25, 0.5, 0.75\} \quad \text{and}\quad |{\bf X}| = |{\bf Y}| = k \in \left\{1,2,5,\lfloor \sqrt{n} \rfloor,\lfloor 0.1n \rfloor\right\}. \] To select those sets, we proceed as follows: Initially mark all variables in ${\bf V}$ as observed. Next, for every node mark it as unobserved with probability $P(\textit{unobserved})$ until all nodes are considered or the number of nodes which remain observed reaches the threshold value $2k$. Finally, from the observed ${\bf R}$ pick randomly two disjoint subsets ${\bf X}$ and ${\bf Y}$ of size $k$. The expected size of ${\bf R}$ is bounded by $\EX[|{\bf R}|] > n\cdot(1-P(\textit{unobserved}))$, with the difference being very small for $n \gg 2k$, but substantial for $n \gtrapprox 2k$. For example for $n=10$ and $k = |{\bf X}| = |{\bf Y}| = 5$, all nodes are in ${\bf R} = {\bf X} \cup {\bf Y} = {\bf V}$ % regardless of the probability $P(\textit{unobserved})$ -- the case discussed already in Section~\ref{sec:special:case:v:partition}. % We perform experiments for each parametrization tuple \begin{equation}\label{eq:tuples} (n, l, k, P(\textit{unobserved})), \end{equation} where, recall, $l$ determines the probability $P(\textit{edge})$ as described in Section~\ref{sec:basissets}. In this section we will report our results in detail only for $ P(\textit{unobserved}) \in \{0,0.75\}.$ The remaining cases are shown in the appendix. We generated 10~000 graphs for each parameter tuple using the function {\tt GraphGenerator.randomDAG} of our DAGitty library \cite{dagittyIJE} in node.js. Figure~\ref{fig:experiments:typical:dags} shows example instances sampled for $ n = 10 $ and illustrates the four cases we are interested in. \begin{figure}\arxivonly{\small} (a) \begin{tikzpicture}[baseline] \graph { /-!-v1[exp,as=$X_1$], v7[exp,as=$X_2$] -!- v3[as=$V_0$] -!- /-!-v2[res,as=$Y_1$] , v5[lat,as=$V_1$] -!- v4[res,as=$Y_2$] -!-v6[lat,as=$V_2$], v10[exp,as=$X_3$] -!- v9[lat,as=$V_3$] -!- v8[res,as=$Y_3$], v1[exp]-> {v2[res],v3,v7[exp]}, v2-> {v6[lat],v8[res]}, v3-> {v4[res],v6,v8}, v4-> {v8,v9[lat]}, v5[lat]-> {v9,v10[exp]}, v6-> {}, v7-> {}, v8-> {}, v9-> {}, v10-> {} }; \end{tikzpicture} (c) \begin{tikzpicture}[baseline] \graph { / -!- / -!- v1[lat,as=$V_1$] -!- v2[exp,as=$X_1$], / -!- v3[as=$V_0$] -!- v7[res,as=$Y_1$], v5[res,as=$Y_2$] -!- v4[exp,as=$X_2$] -!- v6[res,as=$Y_3$] -!- v9[lat,as=$V_2$], -!- v8[exp,as=$X_3$] -!- / -!- v10[lat,as=$V_3$], v1[lat]-> {v3,v7[res]}, v2[exp]-> {v7,v9[lat]}, v3-> {v5[res],v8[exp],v9}, v4[exp]-> {v10[lat]}, v5-> {v8}, v6[res]-> {v10}, v7-> {v9}, v8-> {}, v9-> {v10}, v10-> {} }; \end{tikzpicture} (p) \begin{tikzpicture}[baseline] \graph { / -!- v2[res,as=$Y_1$] -!- / -!- v3[lat,as=$V_1$], v1[lat,as=$V_2$] -!- v4[lat,as=$V_3$] -!- v7[exp,as=$X_1$] -!- v6[res,as=$Y_2$] -!- v9[exp,as=$X_2$], v8[res,as=$Y_3$] -!- v5[lat,as=$V_4$] -!- v10[exp,as=$X_3$], v1-> {v5,v8}, v2-> {v4}, v3-> {v7,v9}, v4-> {v5,v10}, v5-> {}, v6-> {v10}, v7-> {}, v8-> {}, v9-> {v10}, v10-> {}}; \end{tikzpicture} (n) \begin{tikzpicture}[baseline] \graph { v2[exp,as=$X_1$] -!- v1[lat,as=$V_1$] , v3[lat,as=$V_2$] -!- v4[lat,as=$V_3$] -!- v6[exp,as=$X_2$], v5[lat,as=$V_4$] -!- v7[res,as=$Y_1$] -!- v8[res,as=$Y_2$], v9[exp,as=$X_3$] -!- v10[res,as=$Y_3$], v1[lat]-> {v3[lat],v4[lat],v6[exp]}, v2[exp]-> {v3}, v3-> {v7[res]}, v4-> {}, v5[lat]-> {v9[exp]}, v6-> {v7,v8[res]}, v7-> {v9}, v8-> {v10[res]}, v9-> {}, v10-> {} }; \end{tikzpicture} \caption{Example DAGs sampled for the parameters $n = 10, P(\textit{edge}) = 2/9, P(\textit{unobserved}) = 0.5$, and $k= |{\bf X}|=|{\bf Y}|=3$. Nodes are relabeled such that exposures are called $X_1,X_2,X_3$, outcomes are called $Y_1,Y_2,Y_3$, and all nodes except $V_0$ are unobserved. Case (a)djustment is identified by using the empty set and by the formula $ \sum_{v_{0}}[P(y_{1}\vert x_{1})P(v_{0}\vert x_{1})P(y_{3}\vert x_{1},y_{1},v_{0},y_{2})P(y_{2}\vert x_{1},v_{0})]$ found by the ID-algorithm. Instance (c)omplex is identified by the complex formula $\sum_{v_{0}}[P(v_{0}\vert x_{1})P(y_{1}\vert x_{1},v_{0})P(y_{2}\vert v_{0})P(y_{3})]$ and instance (p)lain is identified by the plain formula $ P(y_{1},y_{2},y_{3})$, although in this case no adjustment set exists. The final example is (n)ot identifiable. }\label{fig:experiments:typical:dags} \end{figure} \subsection{Algorithms}\label{sec:experiments:algorithms:abbreviations} The main goal of our experiments was to examine the influence of the instance complexity, like density of a DAG, numbers of exposures and outcomes, and the ratio of unobserved to observed variables, on the identifiability by adjustment compared to general identifiability. Throughout, we use the following abbreviations for the algorithms we examine: \begin{itemize \item[CBC:] our constructive back-door criterion (Definition~\ref{def:ac:general:bdc}, Theorem~\ref{th:adj:set:cosctr}). We used our DAGitty library, specifically the function {\tt GraphAnalyzer.canonicalAdjustmentSet}, which implements algorithm {\sc FindAdj} based on the CBC. We also tested another implementation of our CBC criterion, the {\tt gac} function of the R package {\tt pcalg} \cite{pcalg}. \item[CBC$^+$:] combination of the CBC and plain formula (Proposition~\ref{prep:observation:is:causal}). We implement the plain formula using the DAGitty function {\tt GraphAnalyzer.dConnected}, which implements algorithm {\sc TestSep} (Proposition~\ref{prop:TestSep}). \item[BC:] Pearl's back-door criterion (Definition~\ref{def:back-door:pearl}). It has been shown that if an adjustment set ${\bf Z}$ that satisfies BC exists, it can be found by removing all descendants of ${\bf X}$ from ${\bf Z}$ \cite{PerkovicEtAl2018}. This means we can implement BC by trivial post-processing of the CBC output. \item[IDC:] general identifiability as determined by do-calculus (see \cite[Chapter 3.4.2]{Pearl2009}). Specifically, we use the IDC algorithm by Shpitser and Pearl \cite{ShpitserIDCAlgorithm}, which is well known to be complete for the identification of causal effects \cite{shpitser2006identification,huang2006pearl}, meaning that the algorithm computes a formula involving only the pre-intervention distribution that expresses the causal effect if such a formula exists; otherwise it outputs that identification is impossible. Our experiments are based on the IDC implementation provided by the R package {\tt causaleffect} \cite{RpackageCausalEffect}. Due to its high time complexity, we were only able to use this algorithm for small instances. \end{itemize \subsection{Results} \input{experiments-table1} The results for all methods and parameters $n,k,l$ described above are shown in Table~\ref{table:global:stat:unobs0:count} (for the case $P(\textit{unobserved})=0$) and in Table~\ref{table:global:stat:unobs0.75:count} ($P(\textit{unobserved})=0.75$). We now discuss the results in more detail. \paragraph{Identification by adjustment sets or plain formulas} Tables~\ref{table:global:stat:unobs0:count} and \ref{table:global:stat:unobs0.75:count} provide counts for instances identifiable by adjustment alone (columns CBC) or by adjustment enhanced by using the plain formula (CBC$^+$). The number of effects only identified by the plain formula, but not by CBC, is thus given by the difference between these columns. Figure~\ref{table:global:stat:grid:grey} summarizes the counts for CBC and CBC$^+$ reported in Table~\ref{table:global:stat:unobs0:count} and~\ref{table:global:stat:unobs0.75:count} for $k=1,2,5$ and $n\ge 25$. We omit the instances with $n=10$, since for $k=5$ these cases were discussed separately in Section~\ref{sec:special:case:v:partition}. Moreover, for parameter values $l=10$ and $l=20$ the individual probabilities for edge selection, $P(\textit{edge})=\max\{l/(n-1),1\}$, imply that every node has $9<l$ neighbors while in our analyses we want that $l$ specifies the expected number of neighbors of a node. Identification by plain formula and identification by adjustment are overlapping concepts. Some cases can be identified using either approach, while in other instances only one of them works. \highlightrevision{r2c58}{ Many cases for which adjustment does not work can be solved instead by the plain formula, meaning that in those DAGs there is in fact no causal effect of ${\bf X}$ on ${\bf Y}$.} This can be seen especially in dense graphs, e.g., DAGs in which each node has $l=20$ neighbors on average, and for singleton ${\bf X}$ and ${\bf Y}$, i.e., $k=1$. For example, for $l=20$, $k=1$, $P(\textit{unobserved}) = 0.75$, in DAGs with $n = 2000$ ($n=1000$, $n=500$) nodes, up to 65 \% (63 \%, 61 \%) of all instances are identifiable by the plain formula but not by adjustment. Furthermore, increasing $n$ from $25$ to $2000$ we observe that this percentage ranges between $51 \%$ and the maximum $65 \%$, a rather narrow range. The counts for CBC and CBC$^+$ are illustrated in Figure~\ref{table:global:stat:grid:grey} as gray squares in the columns labeled as $(l,k)=(20,1)$ (case: $P(\textit{unobserved}) = 0.75$). The difficulty of identification by adjustment grows with increasing $k$ and $l$, but it decreases with increasing number of nodes $n$, both for $P(\textit{unobserved}) = 0$ and for $0.75$. In Figure~\ref{table:global:stat:grid:grey}, columns are sorted increasingly by the total number of identifiable effects per column. This shows that the most difficult case is $(l,k)=(20,5)$: for $P(\textit{unobserved}) = 0$ the counts grows very slowly with $n$ reaching the maximum value of $3 \%$ of identifiable graphs for $n=2000$; for $P(\textit{unobserved}) = 0.75$ almost no instances are identifiable by adjustment (compare the upper panels in Figure~\ref{table:global:stat:grid:grey}). However, as we can see in Table~\ref{table:global:stat:unobs0.75:count}, for $n=250$ only $2.5 \%$ of cases are identifiable at all. Figures~\ref{fig:global:n:curves} and \ref{fig:global:l:curves} summarize the difficulty of identification stratified by $n$ (Figure~\ref{fig:global:n:curves}) and $l$ (Figure~\ref{fig:global:l:curves}), respectively. \inputiffinal{experiments-grid} \paragraph{Comparison of CBC to the back-door criterion by Pearl} We were also interested in how often Pearl's back-door criterion (BC) would fail to find an adjustment set. Tables~\ref{table:global:stat:unobs0:count} and~\ref{table:global:stat:unobs0.75:count} show that the difference between BC and the CBC is rather small, especially for simple (or hard) instances where nearly every (or no) DAG has an adjustment set, and as expected given our results in Section~\ref{sec:singletons}, for singletons ${\bf X} = \{X\}, {\bf Y}= \{Y\}$ the counts for BC and CBC are indeed equal. However, for larger ${\bf X}, {\bf Y}$ and parameters where only a few graphs have an adjustment set, the difference between BC and CBC becomes more substantial. The greatest difference occurs for $n = 10$, $|{\bf X}| = |{\bf Y}| = 3$, $m \approxeq n$, and $P(\textit{unobserved}) = 0$, where in 10\% of all cases there is an adjustment set whereas BC finds none. This is followed by $n = 10$, $|{\bf X}| = |{\bf Y}| = 2$, where BC fails to find existing adjustment sets in 7\% to 9\% of the cases, depending on $ P(\textit{edge})$ and $P(\textit{unobserved})$. \inputiffinal{experiments-n-curves} \inputiffinal{experiments-l-curves} \paragraph{Complete identification by do-calculus compared to identification by adjustment or plain formula} As explained above, in small graphs we checked for general identifiability of causal effects using the IDC algorithm \cite{ShpitserIDCAlgorithm}. Results are shown for $P(\textit{unobserved}) = 0.75$ and $ n \leq 250 $ in Table~\ref{table:global:stat:unobs0.75:count}. Since the IDC algorithm is complete for the identification problem, the corresponding counts also show how many instances are identifiable at all. It is known that in the case $ P(\textit{unobserved}) = 0$ the causal effect is always identifiable, so we skip the counts for IDC in Table~\ref{table:global:stat:unobs0:count}. The cases with $ n=10$, $k=|{\bf X}|=|{\bf Y}| = 5$ (Table~\ref{table:global:stat:unobs0.75:count}) might seem suspicious as the number of identifiable graphs (i.e., counts in column IDC) increases drastically compared to the graphs with smaller $ {\bf X}, {\bf Y} $, while in all the other cases (see Table~\ref{table:global:stat:unobs0.75:count}) this number decreases with increasing cardinality of $ {\bf X}, {\bf Y} $. However, this is explained by the cap on the number of unobserved nodes. When $|{\bf X}|+|{\bf Y}|=10$ for $ n=10 $, there are no nodes outside of $ {\bf X}\cup{\bf Y}$ remaining that could become unobserved regardless of $P(\textit{unobserved})$, similarly to the cases in Table~\ref{table:global:stat:unobs0:count}, and all graphs must be identifiable as shown in Section~\ref{sec:special:case:v:partition}. Figures~\ref{fig:global:n:curves} and \ref{fig:global:l:curves} present the data for CBC$^+$ (the same data as in the lower right panel of Figure~\ref{table:global:stat:grid:grey}) in comparison to identification by IDC. As we observed in Figure~\ref{table:global:stat:grid:grey}, the most difficult case for CBC$^+$ is $(l,k)=(20,5)$ and the difficulty decreases with $k$ and $l$ when $n$ is fixed (Figure~\ref{fig:global:n:curves}). The situation is very similar for IDC. In Figure~\ref{fig:global:l:curves}, we see that identifiability for both CBC$^+$ and IDC grows roughly in parallel. Similarly to the results for adjustment sets, one can see that with increasing $|{\bf X}|, |{\bf Y}|, l$ the number of identifiable graphs decreases, when $ P(\textit{unobserved}) > 0 $. % These experiments also provide a verification of our DAGitty implementation as every adjustment set found by the {\tt causaleffect} package has been found by DAGitty, as well as a ground truth of the unidentifiable graphs, since a causal effect not identified by the IDC algorithm cannot be identified by any method. \highlightrevision{r2c59}{ Moreover, as expected, for DAGs with no unobserved variables and with $|{\bf X}| = |{\bf Y}| = 1 $, all causal effects are already identified by a plain formula or adjustment without involving the IDC algorithm (see Table~\ref{table:global:stat:unobs0:count}).} \inputiffinal{runtimes} \inputiffinal{experiments-runtimes-table} \paragraph{Comparative runtimes of the algorithms} Figure~\ref{fig:runtime:nodes} (black lines) shows the time needed by DAGitty for these experiments on one core of a 2.1 GHz (up 3 GHz with Turbo Core) AMD Opteron 6272 for graphs with $P(\textit{unobserved}) = 0.75$. Graphs with a lower probability $P(\textit{unobserved})$ are processed slightly faster. For small sets ${\bf X}$ and ${\bf Y}$ the time increases roughly linearly with the number of edges $m$. For larger sets the time also increases with the size of ${\bf X},{\bf Y}$, which could either mean that DAGitty does not reach the optimal asymptotic runtime of ${\cal O}(n+m)$ due to inefficient set operations, or that the time actually only depends on ${\cal O}(\textit{An}({\bf X}, {\bf Y}))$ which can be much smaller than ${\cal O}(m)$ when the sets and degrees are small. However, for all models of a size currently used in practice, DAGitty finds the adjustment set nearly instantaneously. The runtimes of the {\tt causaleffect} package are shown \onlyincolor{as red plot }in Figure~\ref{fig:runtime:nodes}. Since the IDC algorithm is far more complex than the expression of Theorem~\ref{th:adj:set:cosctr}, it performs generally one to two orders of magnitude slower than the implementation in DAGitty, or equivalently in the same time DAGitty can process graphs that are one to two orders of magnitude larger. Due to this speed difference it was not possible for us to run the IDC algorithm experiments on the larger graphs. We have also investigated a different implementation of the CBC in the R package pcalg \cite{pcalg}. The {\tt gac} function in that package implements the CBC criterion for DAGs and other graph classes. Unlike DAGitty, the pcalg package does not find an adjustment set, but only verifies whether a given set meets the criterion. Hence, after loading the graphs in R and calculating the adjacency matrices required by pcalg, we compute the canonical adjustment set $ \textit{Adjustment}({\bf X},{\bf Y}) $ in R as\\ % {\tt \hspace*{1cm} Dpcp = De(G, intersect(setminus(De(GNoInX, x), x), An(GNoOutX, y)))\\ \hspace*{1cm} z = setminus(An(G, union(x,y)), union(union(x,y),union(Dpcp, obs)))}\\ with sets {\tt x}, {\tt y}, {\tt obs}erved nodes {\tt obs}, graphs {\tt G} $ ={\cal G} $, {\tt GNoInX} $ = {\cal G}_{\overline{X}} $, {\tt GNoOutX} $ = {\cal G}_{\underline{X}} $ and helper functions {\tt An} and {\tt De} implemented using the {\tt subcomponent} function of the R package {\tt igraph}. We then compare the time required by {\tt pcalg} to test whether {\tt z} is a valid adjustment set to the time required by DAGitty to find and test a set. The runtimes of the {\tt gac} function are plotted \onlyincolor{in purple }in Figure~\ref{fig:runtime:nodes}. They show that the {\tt gac} function is several orders of magnitude slower than DAGitty. These results are expected given that the {\tt pcalg} package tests the CBC by tracing all $m$-connected paths using backtracking, an approach that suffers from exponential worst-case complexity; in fact this backtracking algorithm is even slower than the general implementation of the do-calculus in the {\tt causaleffect} package. Only the cases with small $ n $ are shown as the remaining computations did not terminate in reasonable time. In summary, our experimental results show that many causal effects in random DAGs cannot be identified by covariate adjustment. Nevertheless, many of these cases are easily addressed by extending the CBC slightly, and then most effects become identifiable without having to resort to do-calculus, at least in the random graphs we tested. This finding is reassuring given that the implementation of our algorithmic framework in DAGitty is the only identification method of those we tested that is applicable to large graphs. \section{Adjustment in MAGs} \label{sec:magadjust} Finally, in this section, we generalize our complete constructive criterion for identifying adjustment sets from DAGs to MAGs, making our algorithmic framework applicable to this class of graphical models as well. Two examples may illustrate why this generalization is not trivial. First, take ${\cal G}=X \to Y$. If ${\cal G}$ is interpreted as a DAG, then the empty set is valid for adjustment. If ${\cal G}$ is however taken as a MAG, then there exists no adjustment set (for a formal definition of an adjustment set in a MAG see below) as ${\cal G}$ represents among others the DAG \begin{tikzpicture}[xscale=0.7,baseline=-2.3ex] \node [anchor=north] (l) at (0,0) {$U$}; \node [anchor=north] (x) at (1,0) {$X$}; \node [anchor=north] (y) at (2,0) {$Y$}; \draw [->] (x) -- (y); \draw [->] (l) -- (x); \draw [->] (l) edge [bend right=20] (y); \end{tikzpicture} where $U$ is an unobserved confounder. Second, take ${\cal G}=A \to X \to Y$. In that case, the empty set is an adjustment set regardless of whether ${\cal G}$ is interpreted as a DAG or a MAG. The reasons will become clear as we move on. First, let us recall the semantics of a MAG. The following definition can easily be given for AGs in general, but we do not need this generality for our purpose. \begin{definition}[DAG representation by MAGs \citep{Richardson2002}] Let ${\cal G}=({\bf V},{\bf E})$ be a DAG, and let ${\bf S},{\bf L} \subseteq {\bf V}$. The MAG ${\cal M}={\cal G}[^{\bf S}_{\bf L}$ is a graph with nodes ${\bf V}\setminus({\bf S}\cup{\bf L})$ and edges defined as follows. (1) Two nodes $U$ and $V$ are adjacent in ${\cal G}[^{\bf S}_{\bf L}$ if they cannot be $m$-separated by any ${\bf Z}$ with ${\bf S} \subseteq {\bf Z} \subseteq {\bf V}\setminus{\bf L}$ in ${\cal G}$. (2) The edge between $U$ and $V$ is \begin{description} \item $U-V$ if $U \in \textit{An}({\bf S}\cup V)$ and $V \in \textit{An}({\bf S} \cup U)$; \item $U\to V$ if $U \in \textit{An}({\bf S}\cup V)$ and $V \notin \textit{An}({\bf S} \cup U)$; \item $U\leftrightarrow V$ if $U \notin \textit{An}({\bf S}\cup V)$ and $V \notin \textit{An}({\bf S} \cup U)$. \end{description} We call ${\bf L}$ \emph{latent} variables and ${\bf S}$ \emph{selection} variables. We say there is \emph{selection bias} if ${\bf S} \neq \emptyset$. \label{def:mags} \end{definition} Hence, every MAG represents an infinite set of underlying DAGs that all share the same ancestral relationships. \begin{lemma}[Preservation of separating sets \citep{Richardson2002}] Set ${\bf Z}$ $m$-separates ${\bf X},{\bf Y}$ in ${\cal G}[^{\bf S}_{\bf L}$ if and only if ${\bf Z}\cup{\bf S}$ $m$-separates ${\bf X},{\bf Y}$ in ${\cal G}$. \end{lemma} Selection bias (i.e., ${\bf S} \neq \emptyset$) substantially complicates adjustment, and in fact nonparametric causal inference in general \citep{Zhang2008}\footnote{ A counterexample is the graph $A \gets X \to Y$, where we can safely assume that $A$ is the ancestor of a selection variable. A sufficient and necessary condition to recover a distribution $P({\bf y} \mid {\bf x})$ from a distribution $P({\bf y} \mid {\bf x},{\bf s})$ under selection bias is ${\bf Y} \independent {\bf S} \mid {\bf X}$ \citep{Barenboim2014}, which is so restrictive that most statisticians would probably not even speak of ``selection bias'' anymore in such a case. }. Due to these limitations, we restrict ourselves to the case ${\bf S}=\emptyset$ in the rest of this section. Note however that recovery from selection bias is sometimes possible with additional population data, and graphical conditions exist to identify such cases \citep{Barenboim2014}. We now extend the concept of adjustment to MAGs in the usual way \citep{Maathuis2013}. \begin{definition}[Adjustment in MAGs] \label{def:adjustment:set:in:MAAGs} Given a MAG ${\cal M}=({\bf V},{\bf E})$ and two variable sets ${\bf X},{\bf Y} \subseteq {\bf V}$, ${\bf Z} \subseteq {\bf V}$ is an adjustment set for $({\bf X},{\bf Y})$ in ${\cal M}$ if for all DAGs ${\cal G}=({\bf V}',{\bf E}')$ for which ${\cal G}[^\emptyset_{\bf L}\ ={\cal M}$ with ${\bf L} = {\bf V}'\setminus {\bf V}$ the set ${\bf Z}$ is an adjustment set for $({\bf X},{\bf Y})$ in ${\cal G}$. \end{definition} This definition is equivalent to requiring that $P({\bf y} \mid \textit{do}({\bf x}))$ is equal to $ \sum_{{\bf z}} P({\bf y} \mid {\bf x}, {\bf z}) P({\bf z})$ for every probability distribution $P({\bf v}')$ consistent with a DAG ${\cal G}=({\bf V}',{\bf E}')$ for which ${\cal G}[^\emptyset_{\bf L}\ ={\cal M}$ with ${\bf L} = {\bf V}'\setminus {\bf V}$. If one was to extend the definition to include selection bias $ {\bf S} $, one would need to give a requirement that holds for all DAGs ${\cal G}=({\bf V}',{\bf E}')$ with ${\cal G}[^{\bf S}_{\bf L}\ ={\cal M}$ and ${\bf L} \cup {\bf S} = {\bf V}'\setminus {\bf V}$. Thereby one can define $ P({\bf y} \mid \textit{do}({\bf x})) $ as $\sum_{{\bf z}} P({\bf y} \mid {\bf x}, {\bf z}, {\bf s} ) P({\bf z} \mid {\bf s})$ , $ \sum_{{\bf z}} P({\bf y} \mid {\bf x}, {\bf z}, {\bf s} ) P({\bf z}) $ or $ \sum_{{\bf s}} \sum_{{\bf z}} P({\bf y} \mid {\bf x}, {\bf z}, {\bf s} ) P({\bf z}, {\bf s})$. The last definition is equivalent to $ {\bf Z} \cup {\bf S} $ being an adjustment set in all these DAGs, but existing literature has used the second case\citep{Barenboim2014}. However, the first case captures the spirit of selection bias the most, since in the presence of selection bias the probability distribution is only known given some selected bias $ {\bf s} $. % Notice that, due to the definition of adjustment in MAGs (Def.~\ref{def:adjustment:set:in:MAAGs}), in our considerations we can restrict MAGs to mixed graphs consisting of only directed and bidirected edges. \subsection{Adjustment amenability} In this section we first identify a class of MAGs in which adjustment is impossible because of causal ambiguities -- e.g., the simple MAG $X \to Y$ falls into this class, but the larger MAG $A \to X \to Y$ does not. \begin{definition}[Visible edge \citep{Zhang2008}] Given a MAG ${\cal M}=({\bf V},{\bf E})$, an edge $X \to D$ in ${\bf E}$ is called \emph{visible} if in all DAGs ${\cal G}=({\bf V}',{\bf E}')$ with ${\cal G}[^\emptyset_{\bf L}={\cal M}$ for some ${\bf L} \subseteq {\bf V}'$, all $d$-connected walks between $X$ and $D$ in ${\cal G}$ that contain only nodes of ${\bf L}\cup X\cup D$ are directed paths. Otherwise $X \to D$ is said to be \emph{invisible}. \end{definition} Intuitively, an invisible directed edge $X \to D$ means that there may exist hidden confounding factors between $X$ and $D$, which is guaranteed not to be the case if the edge is visible. \begin{lemma}[Graphical conditions for edge visibility \citep{Zhang2008}] In a MAG ${\cal M}=({\bf V},{\bf E})$, an edge $X \to D$ in ${\bf E}$ is visible if and only if there is a node $A$ not adjacent to $D$ where (1) $A \to X \in {\bf E}$ or $A \leftrightarrow X \in {\bf E}$, or (2) there is a collider path $A \leftrightarrow V_1 \leftrightarrow \ldots \leftrightarrow V_n \leftrightarrow X$ or $A \to V_1 \leftrightarrow \ldots \leftrightarrow V_n \leftrightarrow X$ where all $V_i$ are parents of $D$. \label{lemma:pureedge} \end{lemma} \begin{definition} We call a MAG ${\cal M}=({\bf V},{\bf E})$ \emph{adjustment amenable} w.r.t. ${\bf X},{\bf Y} \subseteq {\bf V}$ if all proper causal paths from ${\bf X}$ to ${\bf Y}$ start with a visible directed edge. \end{definition} \begin{lemma} If a MAG ${\cal M}=({\bf V},{\bf E})$ is not adjustment amenable w.r.t. ${\bf X},{\bf Y} \subseteq {\bf V}$ then there exists no valid adjustment set for $({\bf X},{\bf Y})$ in ${\cal M}$. \label{lemma:amenable} \end{lemma} \begin{proof} If the first edge $X \to D$ on some causal path to ${\bf Y}$ in ${\cal M}$ is not visible, then there exists a consistent DAG ${\cal G}$ where there is a non-causal path between $X$ and ${\bf Y}$ via $D$ that could only be blocked in ${\cal M}$ by conditioning on $D$ or some of its descendants. But such conditioning would violate the adjustment criterion in ${\cal G}$. \end{proof} \highlightrevision{r2c65}{Note that adjustment amenability does not yet guarantee the existence of an adjustment set; the smallest example is the MAG $X \gets Y$, which is amenable but admits no adjustment set.} Let $N(V)$ denote all nodes adjacent to $V$, and $\textit{Sp}(V)$ denote all spouses of $V$, i.e., nodes $W$ such that $W \leftrightarrow V \in {\bf E}$. The adjustment amenability of a graph ${\cal M}$ w.r.t sets ${\bf X}, {\bf Y}$ can be tested with the following algorithm: \newcommand{{\bf C}}{{\bf C}} \newcommand{{\bf A}}{{\bf A}} \begin{algo}{TestAdjustmentAmenability}{${\cal M}, {\bf X}, {\bf Y}$}{\label{algo:isadjustmentamenable}}{10cm} \For {all $D$ in $\textit{Ch}({\bf X}) \cap \textit{PCP}(\bX,\bY)$} \State{${\bf C} \gets \emptyset$; ${\bf A} \gets \emptyset$} \Function{check}{V} \If{${\bf C}[V]$} {\Return ${\bf A}[V]$}\EndIf \State{${\bf C}[V] \gets$ true} \State{${\bf A}[V] \gets ((\textit{Pa}(V) \cup \textit{Sp}(V)) \setminus N(D) \neq \emptyset)$} \For {all $W \in \textit{Sp}(V) \cap \textit{Pa}(D)$ } \If{\textsc{check}$(W)$} ${\bf A}[V] \gets $ true \EndIf \EndFor \Return ${\bf A}[V]$ \EndFunction \For {all $X$ in ${\bf X} \cap \textit{Pa}(D)$ } \If{$\neg\textsc{check}(X)$} {\Return false}\EndIf \EndFor \EndFor \end{algo} \begin{analal} \highlightrevision{r2c66}{ The algorithm checks for visibility of every edge $X\to D$ by trying to find a node $Z$ not connected to $D$ but connected to $X$ via a collider path through the parents of $D$, according to the conditions of Lemma~\ref{lemma:pureedge}; note that condition (1) of Lemma~\ref{lemma:pureedge} is identical to condition (2) with an empty collider path.} Since $\textsc{check}$ performs a depth-first-search by checking every node only once and then continuing to its neighbors, each iteration of the outer for-loop in the algorithm runs in linear time ${\cal O}(n+m)$. Therefore, the entire algorithm runs in ${\cal O}(k(n+m))$ where $k \leq |Ch({\bf X})|$. \end{analal} \subsection{Adjustment criterion for MAGs} We now show that the adjustment criterion for DAGs generalizes to adjustment amenable MAGs. The adjustment criterion and the constructive back-door criterion are defined like their DAG counterparts (Definitions~\ref{def:ac:general} and~\ref{def:adj:graph:}), replacing β€œDAG” with β€œMAG” and $d$- with $m$-separation for the latter. \begin{definition}[Adjustment criterion]\label{def:ac:general:mag} Let ${\cal M} = ({\bf V},{\bf E})$ be a MAG, and ${\bf X},{\bf Y},{\bf Z} \subseteq {\bf V}$ be pairwise disjoint subsets of variables. The set ${\bf Z}$ satisfies the adjustment criterion relative to $({\bf X}, {\bf Y})$ in ${\cal M}$ if \begin{enumerate} \item[$(a)$] no element in ${\bf Z}$ is a descendant in ${\cal M}$ % of any $W \in {\bf V} \setminus {\bf X}$ which lies on a proper causal path from ${\bf X}$ to ${\bf Y}$ and \item[$(b)$] all proper non-causal paths in ${\cal M}$ from ${\bf X}$ to ${\bf Y}$ are blocked by ${\bf Z}$. \end{enumerate} \end{definition} Note that the above definition uses β€œdescendants in $ {\cal M} $” instead β€œdescendants in $ {\cal M}_{\overline{{\bf X}}} $” as Definition \ref{def:ac:general}. However, Lemma \ref{lem:cbc:variants} implies that the conditions are equivalent. \begin{definition}[Proper back-door graph] \label{def:adj:graph:mag} Let ${\cal M} = ({\bf V},{\bf E})$ be a MAG, and ${\bf X},{\bf Y}\subseteq {\bf V}$ be pairwise disjoint subsets of variables. The \emph{proper back-door graph}, denoted as $\cG^{pbd}_{\bX\bY}$, is obtained from ${\cal M}$ by removing the first edge of every proper causal path from ${\bf X}$ to ${\bf Y}$. \end{definition} \begin{figure} \begin{center} \begin{tabular}{ccccc} \begin{tikzpicture}[yscale=0.9,xscale=0.9] \node (g) at (-0.35,1.25) {${\cal M}_1$:}; \node (x1) at (0,0) {$X$}; \node (v1) at (1,0) {$V$}; \node (y1) at (2,0) {$Y$}; \node (z1) at (1,1) {$Z$}; \draw [red,thick,->] (x1) -- (v1); \draw [->] (v1) -- (y1); \draw [->] (z1) -- (y1); \end{tikzpicture} & \begin{tikzpicture}[yscale=0.9,xscale=0.9] \node (g) at (-0.35,1.25) {${\cal M}_2$:}; \node (x1) at (0,0) {$X$}; \node (v1) at (1,0) {$V$}; \node (y1) at (2,0) {$Y$}; \node[adjusted] (z1) at (1,1) {$Z$}; \draw [->] (x1) -- (v1); \draw [->] (v1) -- (y1); \draw [->] (z1) -- (y1); \draw [->] (z1) -- (x1); \end{tikzpicture} & \begin{tikzpicture}[yscale=0.9,xscale=0.9] \node (g) at (-0.35,1.25) {${\cal M}_3$:}; \node (x1) at (0,0) {$X$}; \node (v1) at (1,0) {$V$}; \node (y1) at (2,0) {$Y$}; \node (z1) at (1,1) {$Z$}; \draw [red,thick,->] (x1) -- (v1); \draw [->] (v1) -- (y1); \draw [->] (z1) -- (y1); \draw [->] (z1) -- (x1); \draw [->] (z1) -- (v1); \end{tikzpicture} & \begin{tikzpicture}[yscale=0.9,xscale=0.9] \node (g) at (-0.35,1.25) {${\cal M}_4$:}; \node (x1) at (0,0) {$X$}; \node (v1) at (1,0) {$V$}; \node (y1) at (2,0) {$Y$}; \node (z1) at (1,1) {$W$}; \draw [->] (x1) -- (v1); \draw [->] (v1) -- (y1); \draw [<->] (z1) -- (y1); \draw [<->] (z1) -- (x1); \end{tikzpicture} & \begin{tikzpicture}[yscale=0.9,xscale=0.9] \node (g) at (-0.35,1.25) {${\cal M}_5$:}; \node (x1) at (0,0) {$X_2$}; \node (x2) at (1,0) {$X_1$}; \node (v1) at (2,0) {$V$}; \node (y1) at (3,0) {$Y$}; \node[adjusted] (z1) at (2,1) {$Z$}; \draw [->] (x1) -- (x2); \draw [->] (x2) -- (v1); \draw [->] (v1) -- (y1); \draw [->] (z1) -- (y1); \draw [->] (z1) -- (x1); \draw [->] (z1) -- (x2); \draw [->] (z1) -- (v1); \end{tikzpicture} \end{tabular} \end{center} \caption{Five MAGs in which we search for an adjustment relative to $(X,Y)$ or $(\{X_1,X_2\},Y)$. ${\cal M}_1$ and ${\cal M}_3$ are not adjustment amenable, since the edge $ X \to V$ is not visible, so no adjustment exists. In the other three MAGs the edge is visible, due to the node $Z$ in ${\cal M}_2$, the node $W$ in ${\cal M}_4$ and the node $X_2$ in ${\cal M}_5$. The only valid adjustment in ${\cal M}_2$ and ${\cal M}_5$ is $\{Z\}$, and in ${\cal M}_4$ only the empty set is a valid adjustment. If ${\cal M}_1$ and ${\cal M}_3$ were DAGs, the set $\{Z\}$ would be an adjustment in each.} \label{fig:CBCMAGexample} \end{figure} \begin{definition}[Constructive back-door criterion (CBC)]\label{def:ac:general:bdc:mag} Let ${\cal M} = ({\bf V},{\bf E})$ be a MAG, and let ${\bf X},{\bf Y},{\bf Z} \subseteq {\bf V}$ be pairwise disjoint subsets of variables. The set ${\bf Z}$ satisfies the \emph{constructive back-door criterion} relative to $({\bf X}, {\bf Y})$ in ${\cal M}$ if \begin{enumerate} \item[$(a)$] ${\bf Z} \subseteq {\bf V} \setminus \textit{Dpcp}(\bX,\bY)$ and \item[$(b)$] ${\bf Z}$ $m$-separates ${\bf X}$ and ${\bf Y}$ in the proper back-door graph $\cG^{pbd}_{\bX\bY}$. \end{enumerate} \end{definition} The main result of this section (Theorem~\ref{thm:agadjust}) shows that for any adjustment amenable MAG and node sets ${\bf X}$ and ${\bf Y}$, a set ${\bf Z}$ is an adjustment relative to $({\bf X},{\bf Y})$ if and only if the CBC is satisfied. Figure~\ref{fig:CBCMAGexample} shows some examples. Similarly to DAGs, we provide a generalization of the CBC for MAGs allowing parametrization of the criterion: \begin{definition}[Parametrization of the Constructive back-door criterion (CBC(${\bf A},{\bf B},{\bf C} $))]\label{def:ac:general:bdc:mag:prime} Let ${\cal M} = ({\bf V},{\bf E})$ be a MAG, and let ${\bf X},{\bf Y},{\bf Z} \subseteq {\bf V}$ be pairwise disjoint subsets of variables. Let ${\bf A} \subseteq {\bf X} \cup {\bf Y} $, ${\bf B} \subseteq {\bf X} $, ${\bf C} \subseteq \textit{De}(\textit{PCP}(\bX,\bY))$. The set ${\bf Z}$ satisfies the CBC(${\bf A},{\bf B},{\bf C} $) relative to $({\bf X}, {\bf Y})$ in ${\cal M}$ if \begin{enumerate} \item[$(a)$] ${\bf Z} \subseteq {\bf V} \setminus De_{\overline{{\bf A}}\underline{{\bf B}}}(\textit{PCP}(\bX,\bY))$, and \item[$(b)$] ${\bf Z}$ $d$-separates ${\bf X}$ and ${\bf Y}$ in the graph $\cG^{pbd,\bC}_{\bX\bY} := ({\bf V},{\bf E} \setminus ({\bf X} \to (\textit{PCP}(\bX,\bY) \cup {\bf C}) ))$. \end{enumerate} \end{definition} With these definitions we are ready to give: \begin{theorem} Given an adjustment amenable MAG ${\cal M}=({\bf V},{\bf E})$ and three disjoint node sets ${\bf X},{\bf Y},{\bf Z} \subseteq {\bf V}$, the following statements are equivalent: \begin{enumerate} \item[$(i)$] ${\bf Z}$ is an adjustment relative to $({\bf X},{\bf Y})$ in ${\cal M}$. \item[$(ii)$] ${\bf Z}$ fulfills the adjustment criterion (AC) w.r.t. $({\bf X},{\bf Y})$ in ${\cal M}$. \item[$(iii)$] ${\bf Z}$ fulfills the constructive back-door criterion (CBC) w.r.t. $({\bf X},{\bf Y})$ in ${\cal M}$. \item[$(iv)$] ${\bf Z}$ fulfills a variant of constructive back-door criterion (CBC({\bf A},{\bf B},{\bf C})) w.r.t. $({\bf X},{\bf Y})$ in ${\cal M}$ for ${\bf A} \subseteq {\bf X} \cup {\bf Y} $, ${\bf B} \subseteq {\bf X} $, ${\bf C} \subseteq \textit{De}(\textit{PCP}(\bX,\bY))$. \end{enumerate} \label{thm:agadjust} \end{theorem} Before proving the theorem, let us recall the concept of an \emph{inducing path}, which we will use in our proof and the further analysis. \begin{definition}[Inducing path \citep{Richardson2002}] Let ${\cal G}=({\bf V},{\bf E})$ be a DAG and ${\bf Z},{\bf L} \subseteq {\bf V}$ be disjoint. A path $\pi=V_1,\ldots,V_{n+1}$ in ${\cal G}$ is called \emph{inducing} with respect to ${\bf Z}$ and ${\bf L}$ if all non-colliders on $\pi$ except $V_1$ and $V_{n+1}$ are in ${\bf L}$ and all colliders on $\pi$ are in $\textit{An}(\{V_1,V_{n+1}\}\cup{\bf Z})$. \label{def:inducing:path} \end{definition} We will use also the following notion: \begin{definition}[Inducing ${\bf Z}$-trail] Let ${\cal G}=({\bf V},{\bf E})$ be a DAG and ${\bf Z},{\bf L} \subseteq {\bf V}$ be disjoint. \highlightrevision{r2c77}{ Let $\pi=V_1,\ldots,V_{n+1}$ be a path in ${\cal G}[^\emptyset_{\bf L}$ such that $V_2,\ldots,V_n \in {\bf Z}$, $V_1,V_{n+1} \notin {\bf Z}$, for each $i \in \{1,\ldots,n\}$, there is an inducing path w.r.t. $\emptyset,{\bf L}$ linking $V_i, V_{i+1}$, and for each $i \in \{2,\ldots,n\}$, these inducing paths have arrowheads at $V_i$.} Then $\pi$ is called an inducing ${\bf Z}$-trail. \label{def:inducing:trail} \end{definition} \begin{proof}[Proof of Theorem~\ref{thm:agadjust}] The equivalence of $(ii)$, $(iii)$ and $(iv)$ is established by observing that the proofs of Theorem~\ref{th:ac:equivalence} and Lemma~\ref{lem:cbc:variants} generalize to $m$-separation. Below we establish equivalence of $(i)$ and $(ii)$. $\neg (ii) \Rightarrow \neg (i)$: If ${\bf Z}$ violates the adjustment criterion in ${\cal M}$, it does so in the canonical DAG ${\cal C}({\cal M})$, and thus is not an adjustment in ${\cal M}$. $\neg (i) \Rightarrow \neg (ii)$: In the proof we rely on properties from Lemmas~\ref{lemma:auxiliary:walkpathconversion}, \ref{lemma:auxiliary:truncatemaxsub}, and \ref{lemma:inducing:adjacent:when:visible} presented in Subsection \ref{sec:aux:lemmas}. Let ${\cal G}$ be a DAG, with ${\cal G}[^\emptyset_{\bf L}={\cal M}$, in which ${\bf Z}$ violates the AC. We show that $(a)$ if ${\bf Z} \cap \textit{Dpcp}(\bX,\bY)\neq \emptyset$ in ${\cal G}$ then ${\bf Z} \cap \textit{Dpcp}(\bX,\bY) \neq \emptyset$ in ${\cal M}$ as well, or there exists a proper non-causal path in ${\cal M}$ that cannot be $m$-separated; and $(b)$ if ${\bf Z} \cap \textit{Dpcp}(\bX,\bY) = \emptyset$ in ${\cal G}$ and ${\bf Z}$ $d$-connects a proper non-causal path in ${\cal G}$, then it $m$-connects a proper non-causal path in ${\cal M}$. $(a)$ Suppose that in ${\cal G}$, ${\bf Z}$ contains a node $Z$ in $\textit{Dpcp}(\bX,\bY)$, and let ${\bf W} = \textit{PCP}({\bf X}, {\bf Y})\cap\textit{An}(Z)$. If ${\cal M}$ still contains at least one node $W_1 \in {\bf W}$, then $W_1$ lies on a proper causal path in ${\cal M}$ and $Z$ is a descendant of $W_1$ in ${\cal M}$. Otherwise, ${\cal M}$ must contain a node $W_2 \in \textit{PCP}_{\cal G}({\bf X}, {\bf Y}) \setminus \textit{An}(Z)$ (possibly $W_2 \in {\bf Y}$) such that $W_2 \leftrightarrow A$, $X \to W_2$, and $X \to A$ are edges in ${\cal M}$, where $A \in \textit{An}(Z)$ (possibly $A=Z$; see Figure~\ref{fig:agadjust}). Then ${\cal M}$ contains an $m$-connected proper non-causal path $X \to A \leftrightarrow W_2 \to \ldots \to Y$. \begin{figure} \begin{center} \begin{tabular}{cc} \begin{tikzpicture}[xscale=1.2] \node (g) at (-1.5,-0.5) {DAG ${\cal G}$:}; \node (x) at (0,0) {$X$}; \node (m2) at (1,-1) {$W_1$}; \node (m3) at (2,-1) {$W_2$}; \node (y) at (2,0) {$Y$}; \node [adjusted] (w) at (0,-1) {$Z$}; \draw [->] (x) -- (m2); \draw [->] (m2) -- (m3); \draw [->] (m3) -- (y); \draw [->] (m2) -- (w); \end{tikzpicture}\hspace*{15mm} & \begin{tikzpicture}[xscale=1.2] \node (g) at (-1.5,-0.5) {MAG ${\cal M}={\cal G}[^\emptyset_{W_1}$:}; \node (x) at (0,0) {$X$}; \node (m3) at (2,-1) {$W_2$}; \node (y) at (2,0) {$Y$}; \node [adjusted] (w) at (0,-1) {$Z$}; \draw [->] (x) -- (m3); \draw [->] (x) -- (w); \draw [->] (m3) -- (y); \draw [<->] (m3) -- (w); \end{tikzpicture} \end{tabular} \end{center} \caption{ Illustration of the case in the proof of Theorem \ref{thm:agadjust} where $Z$ descends from $W_1$ which in a DAG ${\cal G}$ is on a proper causal path from $X$ to $Y$, but is not a descendant of a node on a proper causal path from $X$ to $Y$ in the MAG ${\cal M}$ after marginalizing $W_1$. In such cases, conditioning on $Z$ will $m$-connect $X$ and $Y$ in ${\cal M}$ via a proper non-causal path.} \label{fig:agadjust} \end{figure} $(b)$ Suppose that in ${\cal G}$, ${\bf Z}\cap\textit{Dpcp}(\bX,\bY)=\emptyset$, and there exists an open proper non-causal path from ${\bf X}$ to ${\bf Y}$. Then there must also be a proper non-causal \emph{walk} $w_{\cal G}$ from some $X \in {\bf X}$ to some $Y \in {\bf Y}$ (Lemma~\ref{lemma:auxiliary:walkpathconversion}), which is $d$-connected by ${\bf Z}$ in ${\cal G}$. Let $w_{\cal M}$ denote the subsequence of $w_{\cal G}$ formed by nodes in ${\cal M}$. It includes all colliders on $w_{\cal G}$, because ${\bf Z} \cap {\bf L}=\emptyset$. The sequence $w_{\cal M}$ is a walk in ${\cal M}$, but is not necessarily $m$-connected by ${\bf Z}$; all colliders on $w_{\cal M}$ are in ${\bf Z}$ because every non-${\bf Z}$ must be a parent of at least one of its neighbors, but there might be subsequences $U,Z_1,\ldots,Z_k,V$ on $w_{\cal M}$ where all $Z_i \in {\bf Z}$ but some of the $Z_i$ are not colliders on $w_{\cal M}$. However, then we can form from $w_{\cal M}$ an $m$-connected walk by bypassing some sequences of ${\bf Z}$-nodes (Lemma~\ref{lemma:auxiliary:truncatemaxsub}). Let $w_{\cal M}'$ be the resulting walk. If $w_{\cal M}'$ is a proper non-causal walk, then there must also exist a proper non-causal path in ${\cal M}$ (Lemma~\ref{lemma:auxiliary:walkpathconversion}), violating the AC. It therefore remains to show that $w_{\cal M}'$ is not a proper causal path. This must be the case if $w_{\cal G}$ does not contain colliders, because then the first edge of $w_{\cal M}=w_{\cal M}'$ cannot be a visible directed edge out of $X$. Otherwise, the only way for $w_{\cal M}'$ to be proper causal is if all ${\bf Z}$-nodes in $w_{\cal M}$ have been bypassed in $w_{\cal M}'$ by edges pointing away from ${\bf X}$. In that case, one can show by several case distinctions that the first edge $X \to D$ of $w_{\cal M}'$, where $D \notin {\bf Z}$, cannot be visible (see Figure~\ref{fig:agadjust:b} for an example of such a case). \begin{figure}[h] \begin{center} \begin{tabular}{cc} \begin{tikzpicture}[xscale=1.2] \node (g) at (-1.5,-0.8) {DAG ${\cal G}$:}; \node (l1) at (0.2,0) {$L_1$}; \node [adjusted] (z) at (1,0) {$Z$}; \node (y) at (2,-1) {$Y$}; \node (l2) at (1.8,0) {$L_2$}; \node (x) at (0,-1) {$X$}; \node (a) at (0.6,-1.6) {$A$}; \draw [->] (l1) -- (z); \draw [->] (z) -- (y); \draw [->] (l2) -- (y); \draw [->] (z) -- (x); \draw [->] (x) -- (y); \draw [->] (l2) -- (z); \draw [->] (l1) -- (x); \draw [->] (a) -- (x); \end{tikzpicture}\hspace*{15mm} & \begin{tikzpicture}[xscale=1.2] \node (g) at (-1.5,-0.8) {MAG ${\cal M}={\cal G}[^\emptyset_{\{L_1,L_2\}}$:}; \node [adjusted] (z) at (1,0) {$Z$}; \node (y) at (2,-1) {$Y$}; \node (x) at (0,-1) {$X$}; \node (a) at (0.6,-1.6) {$A$}; \draw [->] (z) -- (y); \draw [->] (z) -- (x); \draw [->] (x) -- (y); \draw [->] (a) -- (x); \draw [->] (a) -- (y); \end{tikzpicture} \end{tabular} \end{center} \caption{Case (b) in the proof of Theorem~\ref{thm:agadjust}: A proper non-causal path $w_{\cal G}=X \gets L_1 \to Z \gets L_2 \to Y$ in a DAG is $d$-connected by ${\bf Z}$, but the corresponding proper non-causal path $w_{\cal M}=X \gets Z \to Y$ is not $m$-connected in the MAG, and its $m$-connected subpath $w_{\cal M}'=X \to Y$ is proper causal. However, this also renders the edge $X \to Y$ invisible, because otherwise $A$ could be $m$-separated from $Y$ by ${\bf U}=\{X,Z\}$ in ${\cal M}$ but not in ${\cal G}$. } \label{fig:agadjust:b} \end{figure} For simplicity, assume that ${\cal M}$ contains a subpath $A \to X \to D$ where $A$ is not adjacent to $D$; the other cases of edge visibility like $A \leftrightarrow X \to D$ (Lemma~\ref{lemma:pureedge}) are treated analogously. In ${\cal G}$, there are inducing paths (possibly several $\pi_{AX}$ from $A$ to $X$ and $\pi_{XD}$ from $X$ to $D$ w.r.t $\emptyset,{\bf L}$; $\pi_{AX}$ must have an arrowhead at $X$. We distinguish several cases on the shape of $\pi_{XD}$. (1) A path $\pi_{XD}$ has an arrowhead at $X$ as well. Then $A,D$ are adjacent (Lemma~\ref{lemma:inducing:adjacent:when:visible}), a contradiction. (2) No inducing path $\pi_{XD}$ has an arrowhead at $X$. Then $w_{\cal G}$ must start with an arrow out of $X$, and must contain a collider $Z \in \textit{De}(X)$ because $w_{\cal G}$ is not causal. (a) $Z \in \textit{De}(D)$. This contradicts ${\bf Z}\cap\textit{Dpcp}(\bX,\bY)=\emptyset$. So (b) $Z \notin \textit{De}(D)$. Then by construction of $w_{\cal M}'$ (Lemma~\ref{lemma:auxiliary:truncatemaxsub}), $w_{\cal M}$ must start with an inducing ${\bf Z}$-trail $X \to Z,Z_1,\ldots,Z_n,D$, which is also an inducing path from $X$ to $D$ in ${\cal G}$ w.r.t. $\emptyset,{\bf L}$. Then $Z,Z_1,\ldots,Z_n,D$ must also be an inducing path in ${\cal G}$ w.r.t. $\emptyset,{\bf L}$ because $\textit{An}(X)\subseteq\textit{An}(Z)$. Hence $Z$ and $D$ are adjacent. We distinguish cases on the path $X \to Z,D$ in ${\cal M}$. Now we can conclude: If $X\to Z \to D$, then $Z$ lies on a proper causal path, contradicting ${\bf Z}\cap\textit{Dpcp}(\bX,\bY)=\emptyset$; If $X\to Z \leftrightarrow D$, or $X\to Z \gets D$, then we get an $m$-connected proper non-causal walk along $Z$ and $D$. \end{proof} \subsection{Adjustment set construction} In the previous section, we have already shown that the CBC is equivalent to the AC for MAGs as well; hence, adjustment sets for a given MAG ${\cal M}$ can be found by forming the proper back-door graph $\cM^{pbd}_{\bX\bY}$ and then applying the algorithms from the previous section. In principle, care must be taken when removing edges from MAGs as the result might not be a MAG; however, this is not the case when removing only directed edges. \begin{lemma}[Closure of maximality under removal of directed edges] Given a MAG ${\cal M}$, every graph ${\cal M}'$ formed by removing only directed edges from ${\cal M}$ is also a MAG. \end{lemma} \begin{proof} Suppose the converse, i.e., ${\cal M}$ is no longer a MAG after removal of some edge $X \to D$. Then $X$ and $D$ cannot be $m$-separated even after the edge is removed because $X$ and $D$ are collider connected via a path whose nodes are all ancestors of $X$ or $D$ \citep{Richardson2002}. The last edge on this path must be $C\leftrightarrow D$ or $C \gets D$, hence $C \notin \textit{An}(D)$, and thus we must have $C \in \textit{An}(X)$. But then we get $C \in \textit{An}(D)$ in ${\cal M}$ via the edge $X \to D$, a contradiction. \end{proof} \begin{corollary} For every MAG ${\cal M}$, the proper back-door graph $\cM^{pbd}_{\bX\bY}$ is also a MAG. \end{corollary} For MAGs that are not adjustment amenable, the CBC might falsely indicate that an adjustment set exists even though that set may not be valid for some represented graph. Fortunately, adjustment amenability is easily tested using the graphical criteria of Lemma~\ref{lemma:pureedge}. For each child $D$ of ${\bf X}$ in $\textit{PCP}(\bX,\bY)$, we can test the visibility of all edges ${\bf X} \to D$ simultaneously using depth first search. This means that we can check all potentially problematic edges in time ${\cal O}(n+m)$. If all tests pass, we are licensed to apply the CBC, as shown above. Hence, we can solve all algorithmic tasks in Table~\ref{fig:problemsadj} for MAGs in the same way as for DAGs after an ${\cal O}(k(n+m))$ check of adjustment amenability, where $k\leq|\textit{Ch}({\bf X})|$. Hence our algorithms can construct an adjustment set for a given MAG $ {\cal M} $ and variables $ {\bf X},{\bf Y} $ in $ O((k+1)(n+m)) $ time. If an additional set $ {\bf Z} $ is given, it can be verified that $ {\bf Z} $ is an adjustment set in the same time. Minimal adjustments sets can be constructed and verified in $ O(k(n+m) + n^2) $ or $ O(n(n+m)) $ time using our algorithms {\sc FindMinAdj}, {\sc TestMinAdj} for dense or sparse graphs. The algorithms for the remaining problems of finding a minimum cost adjustment set {\sc FindMinCostAdj} and enumerating adjustment sets {\sc ListAdj} or {\sc ListMinAdj} in MAGs have the same runtime as the corresponding algorithms in DAGs, since their time surpasses the time required for the adjustment amenability test. \begin{newpartinrevision}[r2c7] \subsection{Empirical analysis} \begin{figure}\arxivonly{\small} \centering DAG ${\cal G}$ and MAG ${\cal G}[^\emptyset_\emptyset$: \begin{tikzpicture} \graph { /-!-v3[lat,as=$V_3$], v2[as=$V_2$] -> v8[as=$V_8$] -!- /-!-v9[lat,as=$V_9$] , v7[as=$V_7$] <- v6[lat,as=$V_6$] -!- v4[lat,as=$V_4$] <- v1[as=$V_1$] -> v5[res,as=$Y_1$], /-!-v10[exp,as=$X_1$] -!- v9[lat,as=$V_9$] -!- v8[res,as=$Y_1$], {v1-> {v4,v5}, v2-> {v3,v7,v8}, v3-> {v8,v9}, v4-> {v6,v10}, v5-> {v9}, v6-> {v7,v9}, v7-> {v10}, v8-> {v9}, v9-> {}, v10-> {}} }; \end{tikzpicture} \hspace*{10mm} MAG ${\cal G}[_{\bf L}^\emptyset$: \begin{tikzpicture} \graph { v2[as=$V_2$] -> v8[as=$V_8$], /-!- v7[as=$V_7$] <- v1[as=$V_1$] -> v5[res,as=$Y_1$], /-!- v10[exp,as=$X_1$], v1 -> v10, v1 -> v5, v1 -> v7, v2 -> v10, v2 -> v7, v2 -> v8, v7 -> v10 }; \end{tikzpicture} \caption{Example of a DAG and resulting MAG sampled for the parameter tuple $n = 10, P(\textit{edge}) = 2/9, P(\textit{unobserved}) = 0.75$, and $k= |{\bf X}|=|{\bf Y}|=1$. Nodes are relabeled such that exposures are called $X_1$ and outcomes are called $Y_1$. The nodes ${\bf L} = \{V_3, V_4, V_6, V_9\}$ are unobserved. $\{V_1\}$ is an adjustment set in ${\cal G}, {\cal G}[^\emptyset_\emptyset$ and $ {\cal G}[_{\bf L}^\emptyset$. }\label{fig:experiments:mags:example} \end{figure} We test for a DAG ${\cal G}=({\bf V},{\bf E})$, generated as described in Section~\ref{sec:experiments}, whether the causal effect in the MAGs ${\cal G}[^\emptyset_\emptyset$ and ${\cal G}[_{\bf L}^\emptyset$ can be identified via adjustment. Hereby ${\bf L} = {\bf V}\setminus{\bf R}$ is the set of unobserved nodes, which is used to determine the MAG ${\cal G}[_{\bf L}^\emptyset$. Thus, all nodes of ${\cal G}[_{\bf L}^\emptyset$ are considered as observed and all of them are allowed to occur in adjustment sets. The MAG ${\cal G}[_\emptyset^\emptyset$ is syntactically equal to ${\cal G}$ and ${\bf L}$ specifies forbidden nodes for adjustments. The MAGs ${\cal G}[_{\bf L}^\emptyset$ can be constructed according to Definition~\ref{def:mags}, however we have implemented the DAG-to-MAG conversion algorithm from \cite{Zhang2008} in DAGitty, which is based on Theorem 4.2 in \citep{Richardson2002} that two nodes $A, B$ are adjacent in ${\cal G}[^\emptyset_{\bf L}$ if and only if there exists an inducing path between $A$ and $B$ with respect to $\emptyset, {\bf L}$ (see Definition~\ref{def:inducing:path}), because testing if an inducing path exists appears easier than testing if two nodes are $d$-separable by any set. Since ${\cal G}$ and ${\cal G}[^\emptyset_\emptyset$ are syntactically equal, the only difference between using the CBC in a DAG ${\cal G}$ and the CBC in ${\cal G}$ interpreted as a MAG is that the last case needs a test for adjustment amenability of the graph. Figure~\ref{fig:experiments:mags:example} shows an example. The results of our experiments are shown in Table~\ref{table:mags:0} and \ref{table:mags:0.75}. As expected we find fewer adjustment sets in the MAGs than in the DAGs, since any adjustment set found in the MAG is valid for all represented DAGs. There are also always fewer adjustment sets in ${\cal G}[_{\bf L}^\emptyset$ than in ${\cal G}[^\emptyset_\emptyset$, because with fewer nodes and edges in ${\cal G}[_{\bf L}^\emptyset$ there are fewer visible edges and ${\cal G}[_{\bf L}^\emptyset$ might not be adjustment amenable, even if ${\cal G}[^\emptyset_\emptyset$ is. For example in the DAG ${\cal G}=L \to X \to Y$ and the MAG ${\cal G}[^\emptyset_\emptyset = L \to X \to Y$ the empty set is an adjustment set. However, in the MAG ${\cal G}[_L^\emptyset = X \to Y$ there exists no valid adjustment set. For $n=10$, $l=10\ (20)$ we have $P(\textit{edge})=\max\{10/9,1\}=1$, so the experiments generate only \emph{complete} DAGs, such that all nodes are adjacent in the DAG and corresponding MAGs. This implies that there is either an edge $X \gets Y$, in which case adjustment is impossible in both the DAG and the MAG, or there is an edge $X \to Y$, which then would need to be visible for adjustment in the MAG due to Lemma~\ref{lemma:amenable}. However, there are no visible edges in complete graphs, since a visible edge $X\to Y$ would require a node not adjacent to $Y$. Thus, no adjustment sets are found for these parameters. The runtimes of these experiments are listed in Table~\ref{table:mags:runtimes}. The time required to find the adjustment set in the MAG is similar to finding it in the original DAG and quick enough to be negligible. We did not run the experiments on even larger graphs since constructing a MAG from a DAG has quadratic runtime complexity in the worst case (as a quadratic number of edges needs to be added), which makes constructing the MAGs too slow. \end{newpartinrevision} \input{experiments-mags-plot.tex} \input{experiments-mags-table.tex} \input{experiments-mags-runtimes.tex} \color{black} \subsection{Auxiliary lemmas for proof of Theorem~\ref{thm:agadjust}} \label{sec:aux:lemmas} In this section, we present the auxiliary lemmas used in the proof of Theorem~\ref{thm:agadjust}. For Lemmas~\ref{lemma:auxiliary:truncatemaxsub} and~\ref{lemma:inducing:adjacent:when:visible}, we also give separate preparing claims and existing results before stating the lemmas themselves. \begin{lemma} Given a DAG ${\cal G}$ and sets ${\bf X}, {\bf Y}, {\bf Z}\subseteq {\bf V}$ satisfying ${\bf Z}\cap\textit{Dpcp}(\bX,\bY)=\emptyset$, ${\bf Z}$ $m$-connects a proper non-causal path between ${\bf X}$ and ${\bf Y}$ if and only if it $m$-connects a proper non-causal walk between ${\bf X}$ and~${\bf Y}$. \label{lemma:auxiliary:walkpathconversion} \end{lemma} \begin{proof} $\Leftarrow$: Let $w$ be the $m$-connected proper non-causal walk. It can be transformed to an $m$-connected path $\pi$ by removing loops of nodes that are visited multiple times. Since no nodes have been added, $\pi$ remains proper, and the first edges of $\pi$ and $w$ are the same. So if $w$ does not start with a $\to$ edge, $\pi$ is non-causal. If $w$ starts with an edge $X \to D$, there exists a collider with a descendant in ${\bf Z}$ which is in $\textit{De}(D)$. So $\pi$ has to be non-causal, or it would contradict ${\bf Z}\cap\textit{Dpcp}(\bX,\bY)=\emptyset$. $\Rightarrow$: Let $\pi$ be an $m$-connected proper non-causal path. It can be changed to an $m$-connected walk $w$ by inserting $C_i \to \ldots \to Z_i \gets \ldots \gets C_i$ for every collider $C_i$ on $\pi$ and a corresponding $Z_i \in {\bf Z}$. Since no edges are removed from $\pi$, $w$ is non-causal, but not necessarily proper, since the inserted walks might contain nodes of ${\bf X}$. However, in that case, $w$ can be truncated to a proper walk $w'$ starting at the last node of ${\bf X}$ on $w$. Then $w'$ is non-causal, since it contains the subpath ${\bf X} \gets \ldots \gets C_i$. \end{proof} In all of the below, ${\cal G}=({\bf V},{\bf E})$ is a DAG, ${\bf Z},{\bf L} \subseteq {\bf V}$ are disjoint, and ${\cal M}={\cal G}[^\emptyset_{\bf L}$. We notice first, that every inducing path w.r.t. ${\bf Z}$ and ${\bf L}$ is $m$-connected by ${\bf Z}$. \begin{lemma}[\citet{Richardson2002}] \label{lemma:inducing:nosep} If there is an inducing path $\pi$ from $U \in {\bf V}$ to $V \in {\bf V}$ with respect to ${\bf Z},{\bf L}$, then there exists no set ${\bf Z}'$ with ${\bf Z} \subseteq {\bf Z}' \subseteq ({\bf V}\setminus{\bf L})$ such that ${\bf Z}'$ $d$-separates $U$ and $V$ in ${\cal G}$ or $m$-separates $U$ and $V$ in ${\cal G}[^\emptyset_{\bf L}$. \end{lemma} \begin{proof} This is Theorem~4.2, cases (v) and (vi), in~\cite{Richardson2002}. \end{proof} \begin{claim} \label{lemma:inducing:bypass} Two nodes $U,V$ are adjacent in ${\cal G}[^\emptyset_{\bf L}$ if and only if ${\cal G}$ contains an inducing path $\pi$ between $U$ and $V$ with respect to $\emptyset,{\bf L}$. Moreover, the edge between $U,V$ in ${\cal G}[^\emptyset_{\bf L}$ can only have an arrowhead at $U$ ($V$) if all such $\pi$ have an arrowhead at $U$ ($V$) in ${\cal G}$. \end{claim} \begin{proof} The first part on adjacency is proved in~\citep{Richardson2002}. For the second part on arrowheads, suppose $\pi$ does not have an arrowhead at $U$, then $\pi$ starts with an edge $U \to D$. Hence $D \notin \textit{An}(U)$, so $D \in \textit{An}(V)$ because $\pi$ is an inducing path and therefore also $U \in \textit{An}(V)$. Hence, the edge between $U$ and $V$ in ${\cal G}[^\emptyset_{\bf L}$ must be $U \to V$. The argument for $V$ is identical. \end{proof} \begin{claim} \label{lemma:inducing:concat} Suppose $Z_0,Z_1,Z_2$ is a path in ${\cal G}[^\emptyset_{\bf L}$ on which $Z_1$ is a non-collider. Suppose an inducing path $\pi_{01}$ from $Z_0$ to $Z_1$ w.r.t. $\emptyset,{\bf L}$ in ${\cal G}$ has an arrowhead at $Z_1$, and an inducing path $\pi_{12}$ from $Z_1$ to $Z_2$ w.r.t. $\emptyset,{\bf L}$ has an arrowhead at $Z_1$. Then the walk $w_{012} = \pi_{01}\pi_{12}$ can be truncated to an inducing path from $Z_0$ to $Z_2$ w.r.t. $\emptyset,{\bf L}$ in ${\cal G}$. \end{claim} \begin{proof} The walk $w_{012}$ does not contain more non-colliders than those on $\pi_{01}$ or $\pi_{12}$, so they must all be in ${\bf L}$. It remains to show that the colliders on $w_{012}$ are in $\textit{An}(Z_0\cup Z_2)$. Because $Z_1$ is not a collider on $Z_0,Z_1,Z_2$, at least one of the edges $Z_0,Z_1$ and $Z_1,Z_2$ must be a directed edge pointing away from $Z_1$. Assume without loss of generality that $Z_0 \gets Z_1$ is that edge. Then all colliders on $\pi_{01}$ are in $\textit{An}(Z_0 \cup Z_1)=\textit{An}(Z_0) \subseteq \textit{An}(Z_0 \cup Z_2)$, and all colliders on $\pi_{12}$ are in $\textit{An}(Z_1 \cup Z_2) \subseteq \textit{An}(Z_0 \cup Z_2)$. $Z_1$ itself is a collider on $w_{012}$ and is also in $\textit{An}(Z_0)$. Hence, the walk $w_{012}$ is $d$-connected, and can be truncated to an inducing path that starts with the first arrow of $\pi_{01}$ and ends with the last arrow of $\pi_{12}$. \end{proof} \begin{claim} \label{lemma:inducing:invariance} Let $\pi=V_1,\ldots,V_{n+1}$ be an inducing ${\bf Z}$-trail, and let $\pi'$ be a subsequence of $\pi$ formed by removing one node $V_i$ of $\pi$ such that $V_i \in {\bf Z}$ is a non-collider on $\pi$. Then $\pi'$ is an inducing ${\bf Z}$-trail. \end{claim} \begin{proof} According to Claim~\ref{lemma:inducing:concat}, if $V_i$ is a non-collider on $\pi$, then $V_{i-1}$ and $V_{i+1}$ are linked by an inducing path $\pi$ that contains an arrowhead at $V_{i-1}$ ($V_{i+1}$) if $V_{i-1}\in{\bf Z}$ ($V_{i+1}\in{\bf Z}$). Therefore, $V_{i-1}$ and $V_{i+1}$ are themselves adjacent, $\pi'$ is a path, and is a ${\bf Z}$-trail. \end{proof} \begin{corollary}\label{cor:inducing:z:trail:has:subpath} Every inducing ${\bf Z}$-trail $\pi=V_1,\ldots,V_{n+1}$ has a subpath $\pi'$ that is $m$-connected by ${\bf Z}$. \end{corollary} \begin{proof} Transform $\pi$ into $\pi'$ by replacing non-collider nodes in ${\bf Z}$ by the direct edge linking their neighbors until no such node exists anymore. By inductively applying Claim~\ref{lemma:inducing:invariance}, we see that $\pi'$ is also an inducing ${\bf Z}$-trail, and every node in ${\bf Z}$ is a collider because otherwise we would have continued transforming. So $\pi'$ must be $m$-connected by ${\bf Z}$. \end{proof} \begin{lemma} \label{lemma:auxiliary:truncatemaxsub} Let $w_{\cal G}$ be a walk from $X$ to $Y$ in ${\cal G}$, $X, Y \notin {\bf L}$, that is $d$-connected by ${\bf Z}$. Let $w_{\cal M}=V_1,\ldots,V_{n+1}$ be the subsequence of $w_{\cal G}$ consisting only of the nodes in ${\cal M}={\cal G}[^\emptyset_{\bf L}$. Then ${\bf Z}$ $m$-connects $X$ and $Y$ in ${\cal M}$ via a path along a subsequence $w_{\cal M}'$ formed from $w_{\cal M}$ by removing some nodes in ${\bf Z}$ (possibly $w_{\cal M}'=w_{\cal M}$). \end{lemma} \begin{proof} First, truncate from $w_{\cal M}$ all subwalks between nodes in ${\bf Z}$ that occur more than once. Now consider all subsequences $V_1,\ldots,V_{n+1}$, $n>1$, of $w_{\cal M}$ where $V_2,\ldots,V_n \in {\bf Z}$, $V_1,V_{n+1} \notin {\bf Z}$, which now are all paths in $w_{\cal M}$. On those subsequences, every $V_i$ must be adjacent in ${\cal G}$ to $V_{i+1}$ via a path containing no colliders, and all non-endpoints on that path must be in ${\bf L}$. So there are inducing paths w.r.t. $\emptyset,{\bf L}$ between all $V_{i}, V_{i+1}$, which have arrowheads at $V_i$ ($V_{i+1}$) if $V_i\in{\bf Z}$ ($V_{i+1}\in{\bf Z}$). So $V_1,\ldots,V_{n+1}$ is an inducing ${\bf Z}$-trail, and has a subpath which $m$-connects $V_1$, $V_{n+1}$ given ${\bf Z}$ due to Corollary~\ref{cor:inducing:z:trail:has:subpath}. Transform $w_{\cal M}$ to $w_{\cal M}'$ by replacing all inducing ${\bf Z}$-trails by their $m$-connected subpaths. According to Claim~\ref{lemma:inducing:bypass}, non-colliders on $w_{\cal M}$ cannot be colliders on $w_{\cal M}'$, as bypassing inducing paths can remove but not create arrowheads. Moreover, all nodes in ${\bf Z}$ on $w_{\cal M}'$ are colliders. Hence $w_{\cal M}'$ is $m$-connected by ${\bf Z}$. \end{proof} \begin{corollary} Each edge on $w_{\cal M}'$ as defined above corresponds to an inducing path w.r.t $\emptyset,{\bf L}$ in ${\cal G}$ along nodes on $w_{\cal G}$. \end{corollary} \begin{claim}\label{lemma:inducing:concat:collider} Suppose there exists an inducing path $\pi_{01}$ from $Z_0$ to $Z_1$ w.r.t. ${\bf S}, {\bf L}$ with an arrowhead at $Z_1$ and an inducing path from $Z_1$ to $Z_2$ w.r.t. ${\bf S}', {\bf L}$ with an arrowhead at $Z_1$. Then the walk $w_{012} = \pi_{01}\pi_{12}$ can be truncated to an inducing path from $Z_0$ to $Z_2$ w.r.t. ${\bf S} \cup {\bf S}' \cup \{Z_1\},{\bf L}$ in ${\cal G}$. \end{claim} \begin{proof} The walk $w_{012}$ does not contain more non-colliders than those on $\pi_{01}$ or $\pi_{12}$, so they must all be in ${\bf L}$. All colliders on $\pi_{0,1}$ and $\pi_{1,2}$ as well as $Z_1$ are in $\textit{An}(Z_0, Z_{1}, Z_2,{\bf S},{\bf S}')$, and therefore also all colliders of $w_{012}$. Hence, the walk $w_{012}$ is $d$-connected, and can be truncated to an inducing path that starts with the first arrow of $\pi_{01}$ and ends with the last arrow of $\pi_{12}$. \end{proof} \begin{claim}\label{lemma:inducing:concat:colliderseq} Suppose $Z_0,Z_1,\ldots,Z_{k+1}$ is a path in ${\cal G}[^\emptyset_{\bf L}$ with an arrowhead at $Z_{k+1}$ on which all $Z_1, \ldots, Z_k$ are colliders. Then there exists an inducing path from $Z_0$ to $Z_{k+1}$ w.r.t. $\{Z_1, \ldots, Z_k\},{\bf L}$ with an arrowhead at $Z_{k+1}$. \end{claim} \begin{proof} Because all $Z_i, Z_{i+1}$ are adjacent and all $Z_1, \ldots, Z_k$ are colliders there exist inducing paths $\pi_{i,i+1}$ w.r.t. $\emptyset, {\bf L}$ from $Z_i$ to $Z_{i+1}$ that have arrowheads at $Z_1, \ldots, Z_k$ (Claim~\ref{lemma:inducing:bypass}). The claim follows by repeatedly applying Claim~\ref{lemma:inducing:concat:collider} to the $\pi_{i,i+1}$'s. \end{proof} \begin{lemma} \label{lemma:inducing:adjacent:when:visible} Suppose $A \to V_1 \leftrightarrow \ldots \leftrightarrow V_k \leftrightarrow X \to D$ or $A \leftrightarrow V_1 \leftrightarrow \ldots \leftrightarrow V_k \leftrightarrow X \to D$ is a path in ${\cal G}[^\emptyset_{\bf L}$ (possibly $k=0$), each $V_i$ is a parent of $D$ and there exists an inducing path $\pi_{XD}$ from $X$ to $D$ w.r.t $\emptyset, {\bf L}$ that has arrowheads on both ends. Then $A$ and $D$ cannot be $m$-separated in ${\cal G}[^\emptyset_{\bf L}$. \end{lemma} \begin{proof} Assume the path is $A \to V_1 \leftrightarrow \ldots \leftrightarrow V_k \leftrightarrow X \to D$. The case where the path starts with $A \leftrightarrow V_1$ can be handled identically, since the first arrowhead does not affect $m$-separation. Assume $A$ and $D$ can be $m$-separated in ${\cal G}[^\emptyset_{\bf L}$, and let ${\bf Z}$ be such a separator. If $V_1$ is not in ${\bf Z}$ then the path $A \to V_1 \to D$ is not blocked, so $V_1 \in {\bf Z}$. Inductively it follows, if $V_i$ is not in ${\bf Z}$, but all $\forall j<i: V_j\in{\bf Z}$ then the path $A \to V_1 \leftrightarrow \ldots \leftrightarrow V_{i-1} \leftrightarrow V_i \to D$ is not blocked, so $V_i \in {\bf Z}$ for all $i$. There exist an inducing path $\pi_{AX}$ from $A$ to $X$ with an arrowhead at $X$ w.r.t. to $\{V_1,\ldots,V_k\},{\bf L}$ (Claim~\ref{lemma:inducing:concat:colliderseq}) which can be combined with $\pi_{XD}$ to an inducing path from $A$ to $D$ w.r.t. to $\{V_1,\ldots,V_k,X\},{\bf L}$ (Claim~\ref{lemma:inducing:concat:collider}). Hence no $m$-separator of $A,D$ can contain $\{X,V_1,\ldots,V_k\}$ (Lemma~\ref{lemma:inducing:nosep}). Then there cannot exist an $m$-separator, because every separator must include $V_1,\ldots,V_k$ and the path $A \to V_1 \leftrightarrow V_2 \leftrightarrow \ldots \leftrightarrow V_k \leftrightarrow X \to D$ is open without $X \in {\bf Z}$. \end{proof} \section{Discussion} We provide a framework of efficient algorithms to verify, find, and enumerate $m$-separating sets in MAGs, which we then harness to solve the same problems for adjustment sets in DAGs and MAGs. In both graph classes, this provides a complete and informative answer to the question when, and how, a desired causal effect between multiple exposures and outcomes can be estimated by covariate adjustment. For DAGs, our results show that from a computational complexity perspective, there is no disadvantage of using our complete constructive back-door criterion (CBC) instead of Pearl's back-door criterion (BC) -- in other words, using CBC instead of BC gives us the guarantee of completeness ``for free''. Therefore, at least for implementation in software packages, we would see no reason to use BC instead of CBC. Nevertheless, our empirical evaluation also suggests that the number of cases covered by CBC but not by BC might be relatively small. In contrast to DAGs, MAGs are not widely used to encode causal models, as their semantics are more complex and direct edges do not necessarily correspond to direct causal relationships. Still, our CBC for MAGs can also be used as a form of ``sensitivity analysis'' for researchers performing DAG-based analyses because every DAG can be converted to a MAG -- if it contains no latent variables, it can simply be read as if it were a MAG. If the MAG resulting from that conversion still admits covariate adjustment, then we have shown that the adjustment set postulated for the original DAG is in fact valid for an infinite set of DAGs, namely all those represented by the MAG. This strategy might allow researchers to partly relax the often untenable ``causal sufficiency assumption'' that all relevant variables are known and were measured. Our results rest on two key concepts: reduction of adjustment to $m$-separation in a subgraph (the \emph{proper back-door graph}), and \emph{adjustment amenability} for graphical models that are more causally ambiguous than DAGs. Since the publication of the preliminary version of this work \cite{TextorLiskiewicz2011,zander2014constructing}, these techniques were shown to be applicable to adjustment in four additional classes of graphical causal models: CPDAGs \cite{PerkovicEtAl2018}, PAGs \cite{PerkovicEtAl2018}, chain graphs \cite{vanderZander2016separators}, and maximal PDAGs \cite{PerkovicEtAl2017}. Likewise, it has been shown that our algorithms can be applied to extended graphical criteria that allow to deal with selection bias \cite{CorreaBarenboim2017}. As we have illustrated briefly in Section~\ref{sec:basissets}, we expect our algorithmic framework to be useful in other areas as well, due to the central role of $m$-separation in the theory of graphical models. In \cite{ZanderTL15,ZanderL16} we have demonstrated how $d$-separators can be harnessed for efficiently finding generalized instrumental variables: for this purpose we apply constrained separators but using different restrictions than the ones discussed in this paper. Our empirical analysis in this paper shows that our algorithmic framework is efficient enough to be used in practice, even on large (MAGs) or very large (DAGs) models. The practical feasibility of our algorithms is illustrated by the fact that they underpin both the web application ``dagitty.net'' as well as the associated R package \cite{dagittyIJE}, which currently have a substantial user community. We hope that future work will expand on our initial empirical results, and there are many potential avenues to follow. For instance, we generated random DAGs, but these are likely not representative of ``typical'' causal graphs encountered in practical applications. While our understanding of the ``typical'' structure of causal graphs is currently limited, one could test the robustness of our findings to the graph structure by considering other well-known graph-generating models, such as scale-free~\cite{barabasi_emergence_1999}, small-world~\cite{watts_collective_1998}, or lattice-like~\cite{Ozik2004} networks. A further interesting open question to be pursued in future research would be whether the approaches presented here could be generalized to accommodate confounding that arose by chance in a given sample, rather than for structural reasons \cite{Greenland2015}. \section{Acknowledgments} This work was supported by the Deutsche Forschungsgemeinschaft (DFG) grant LI 634/4-1 and LI 634/4-2. We also thank Marcel WienΓΆbst for help in performing the experiments, particularly for implementing the parsing of the generated graph files in R. \section{References} \bibliographystyle{elsarticle-num}
{'timestamp': '2019-01-25T02:18:52', 'yymm': '1803', 'arxiv_id': '1803.00116', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00116'}
arxiv
\section{Introduction} In application development it is desirable to have extensibility via integrating multiple (and possibly separately developed) software modules. This lets an application achieve new functionality or modify existing functionality with the least change in its existing code. Browser plug-ins are good examples of this approach. Although extensions give flexibility for application development, protecting application security is crucial, too. A buggy or malicious extension can subvert the application. Software-based Fault Isolation (\textit{SFI}) is an effective solution that constrains an untrusted module by loading and executing it with separated code and data segments from the hosting application. SFI enforces security policies which ensure that the untrusted code can only access its own resources and can only invoke a list of pre-approved system calls. Native Client (\textit{NaCl} for short)~\cite{yeeNaCl} is a Google Chrome browser service that allows incorporating native (e.g., x86) code into a web application. This gives the web application the computational performance of native code. To protect the browser's security from potentially buggy or malicious native code, NaCl enforces a sandboxing policy. This policy ensures the native code executes just within its own code, accesses just its own data, and communicates with the browser just through predefined interfaces. To be NaCl-compatible, native code needs to be compiled with the NaCl build chain. The NaCl compiler inserts checking instructions and aligns instructions to enforce sandboxing policies. A validator is responsible for checking policy adherence before the native code may execute. NaCl implements SFI for both CISC (x86-32 and x64) and RISC (ARM and MIPS) architectures. This gives the browser native-code performance across the most common underlying architectures. In the CISC implementation, NaCl incorporates a conservative instruction padding scheme like the one first proposed in PittSFIeld~\cite{mccamantPittS}. While this padding scheme is crucial to enforce the sandboxing policy (via instruction alignment), it imposes a runtime overhead on the execution by introducing more instructions to be executed and reducing the effectiveness of instruction caching and prefetching. In this paper we improve performance by changing the NaCl padding scheme. In addition to implementing our changes in the instruction alignment of the NaCl build chain, we changed the validator appropriately to ensure our changes do not disrupt NaCl sandboxing policy enforcement. We implemented and evaluated our padding scheme for both x86-32 and x64 NaCl, the two NaCl architectures that use artificial alignment. We chose NaCl for our evaluation because it is well-known and represents the state of the art, but a similar change would apply to other systems that use artificial alignment to limit control flow. In May 2017, Google announced that it is phasing out support for NaCl in most parts of Google Chrome/Chromium in favor of WebAssembly, which has better cross-browser support~\cite{nelsonChromiumBlog}. This is an understandable choice because Chrome already has a JavaScript JIT in its trusted computing base (TCB), but the static compilation and small verification TCB offered by SFI are appealing in other contexts as well. For instance, NaCl has also been applied to provide isolation for distributed analytics~\cite{Rad2014} and edge clouds~\cite{JonathanROCW2017}, and for native libraries included in the JDK~\cite{SiefersTM2010} or used in Android apps~\cite{AthanasopoulosK2016}. We proved the correctness of the changed validator using the Coq proof assistant~\cite{Coq}. For this project, we incorporated a greedy algorithm for padding instructions. Our evaluations show that changing the padding scheme can improve code performance, though in some cases the analysis is complicated by other CPU optimizations like branch prediction. To support performance analysis we adapted the Valgrind/Cachegrind tool to monitor Native Client execution. The rest of this paper is organized as follows: in Section~\ref{background} we discuss some background notions essential to the rest of the paper. In Section~\ref{related} we survey previous projects related to SFI. In Section~\ref{cbi-nacl} we discuss our changes to the NaCl build chain and validator. Section~\ref{eval} describes our evaluation method and presents the results and their analysis. Section~\ref{challenge} talks about some technical obstacles we faced during this project and the ways we solved them; and Sections \ref{future} and \ref{concl} present the future work and the conclusion, respectively. \section{Background} \label{background} In this section we go through some related background. First we introduce the notion of Software-based Fault Isolation (SFI) and its advantages. Then we compare this to another closely related security mechanism, and discuss branch prediction in a CPU and its relevance to our project. \subsection{Software-Based Fault Isolation} In the context of software systems, fault isolation is the ability to contain a potentially faulty module from other parts of the system, meaning that untrusted module failure does not affect other modules. In a more extreme case, even a malicious untrusted module should not be able to interfere with other modules' functionality. One approach to this problem is loading each module into a separate address space. This can be supported by hardware, and guarantee there is no way to access other modules' resources, e.g. OS process isolation. Such hardware-based isolation is robust but inefficient as inter-module communication incurs context switch overhead. Wahbe et al.~\cite{wahbeSFI} propose a software-based solution. In this approach isolation is provided within a single hardware address space. The untrusted module has its own code and data region (the sandbox), and is prohibited from jumping or accessing other modules' regions. This prohibition is implemented by rewriting the untrusted module code to limit control transfer or data access instructions. In case of direct addressing (like \texttt{jmp 0x100019b}), such instructions can be checked statically even before the execution starts. That is because knowing the destination address enables the check (requiring non-writable code during execution guarantees the checked address will not change at runtime). The key challenge is with indirect addressing (instructions like \texttt{jmp~*\%ecx} or \texttt{mov \$0x63,(\%ecx)}); in these cases the destination address cannot be resolved until the point of instruction execution. Therefore SFI inserts some checking instructions to ensure the register contains a valid address. The challenge is that these checks must be efficient and unable to be bypassed. In Section~\ref{related} we will go through different SFI techniques that address this challenge. A related security mechanism is Control Flow Integrity (CFI) which first was proposed by Abadi et al.~\cite{abadiCFI}. CFI tries to enforce \textit{control flow graph (CFG) integrity} by restricting all indirect control transfers to go only to intended targets. In the original approach of Abadi et al., a system first statically determines valid targets for call and return instructions. To enforce the extracted CFG, an ID is used for valid targets and is placed right before the target location. Then each indirect call and return instruction is instrumented to first check the target address ID and to jump only if the ID is correct. This technique also requires non-writable code because IDs must be tamper-proof and non-reproducible. Compared to SFI, CFI enforces a smaller set of places an indirect jump can target. In SFI it is sufficient that no indirect control flow evades the sandboxed code region, but in CFI it is further required that the address be an intended target address. SFI is sometimes described as being based on a weak form of CFI, where the set of valid targets is all the sandboxed area. However the control-flow enforcement used in SFI would not be a strong CFI technique, and the data protection that SFI provides is also needed in isolation applications. \subsection{Branch Prediction} In micro-architecture design, branch prediction is important to hide latency and allow instruction level parallelism and therefore improved performance. A poor branch prediction can harm performance as every misprediction disrupts the instruction pipeline. Branch prediction includes predicting the direction and target of a branch. Direction prediction means anticipating whether the branch transfers control or falls through, while target prediction means determining where the control is going if the branch is taken. There are many prediction techniques discussed in the architecture literature, e.g \cite{ertlOpt, hennessyComputer, thangarajanSurvey}. As indirect branches are important in SFI, and we found it significant in some of our benchmarks (section \ref{eval}), we focus on indirect branch prediction. For direction prediction, indirect branches are statically predicted to be always taken. The most widely used target predictor for indirect branches is a \textit{branch target buffer (BTB)} \cite{ertlOpt}. A BTB is a cache-like structure indexed by instruction address. It stores the last used target address for a branch instruction. As the size of a BTB is limited, it can suffer from capacity and collision misses. In most modern CPUs (like Intel Sandy Bridge as our test machine) there is a BTB for indirect branch target prediction (but the size and indexing function are not officially documented). As return addresses are the most common form of indirect branches, a return-address stack \cite{webbSubroutine} is provided in CPUs as a separate structure to resolve return addresses early. Naturally it is a stack where on a function call the return address is pushed and on a function return the address is popped. The advantage of a return-address stack over a BTB is evident for functions that are called from multiple call sites. While the BTB just can predict the return from the last call, a return-address stack can remember the returns as long as its size allows. \section{Related Work} \label{related} \textbf{Software-Based Fault Isolation} The notion of Software-Based Fault Isolation was first introduced by Wahbe et al.~\cite{wahbeSFI}. Their idea of protecting code and data integrity was directing an unsafe instruction (i.e. indirect jump or memory write\footnote{This work and many subsequent ones consider data reads less harmful, so to avoid higher overhead they tend to not cover secret data protection as a design goal.}) through a dedicated register and masking the register value appropriately at runtime. First they defined an unsafe instruction as any instruction which jumps or writes to an address that cannot be resolved before execution begins. Then they divide an application's address space into a code segment and a data segment where all addresses inside a segment have the same upper bits. The policy is that an untrusted application can execute code only from its own code segment and can write only into its own data segment. The implementation of such a policy using dedicated registers is straightforward: before any unsafe instruction, sandboxing instructions are inserted to set the upper bits of the dedicated register to an appropriate value and then the unsafe instruction is executed. As long as unsafe instructions are preceded by the sandboxing instructions, the execution is deemed safe. A verifier is provided to statically check that such an invariant is respected. \textbf{PittSFIeld} The original work on SFI was for RISC architectures, but on CISC architectures like x86, variable-length instructions can lead to many different instruction streams. An indirect jump can take control to any address in the code segment and if the address is not the start of an intended instruction, then a different stream of instructions can be executed. To tackle this challenge, PittSFIeld~\cite{mccamantPittS} imposes an artificial alignment on x86 instructions. Memory is divided into \textit{bundles} (called \textit{chunks} by the PittSFIeld authors) of size 16 bytes, and jump instructions are only permitted to target the beginning of a bundle. To enforce this property, every indirect jump instruction is preceded by a checking instruction to ensure the 4 lower bits of the target address are zero. In addition, no instruction is allowed to cross bundle boundaries, and the pair of a checking instruction and the following jump, cannot be split across two different bundles. McCamant and Morrisett proposed the use of no-ops to align the target of a jump at the beginning of a bundle. This way control flow cannot jump into the middle of an instruction and interpret a different and unintended stream of instructions. To ensure return address alignment, each \textit{call} instruction must be the last instruction of a bundle. To avoid having the compiler and assembler in its trusted code base, PittSFIeld ensures binaries comply with the security policy via a static verifier. The verifier checks simple policies (e.g. no indirect branch instruction may be at the beginning of a bundle) before execution starts. \textbf{Native Client} Native Client~\cite{yeeNaCl} is a project developed by Google to let browser-based applications benefit from the computational speed of native code. NaCl is a sandbox permitting a native x86 binary (x64 and ARM binaries in later versions) to be executed as a browser plug-in. It provides operating system portability for untrusted native code while preserving system security via data and code sandboxing. NaCl consists of two main parts: an \textit{inner sandbox} and an \textit{outer sandbox}. The inner sandbox is similar to PittSFIeld in terms of constraining control flow using instruction alignment in 32-byte bundles. To reduce runtime overhead, the inner sandbox uses x86 segmented memory to contain memory references. The outer sandbox is responsible for blocking side effects by capturing system calls made by the process running the native module. System calls issued by untrusted native code are compared against a white list and only allowed ones are permitted. As the inner sandbox of NaCl is our interest in this project, we elaborate on it in more detail. The inner sandbox implements software-based fault isolation. Security rules are embedded into a native binary via a modified version of the \textit{gcc} compilation toolchain. A static verifier validates that the rules are followed by the native code just before loading. As mentioned before, NaCl implements data sandboxing using the segmented memory mechanism provided by the x86-32 architecture. This way there is no need to put extra instructions to limit data load and stores. Using instruction alignment at 32-byte bundles, NaCl makes sure that disassembling the binary from start to end gives the only instruction stream visible to the processor. Having such disassembly allows unsafe instructions to be identified and prohibited. Some such unsafe instructions include: \textit{syscall} or \textit{int} as the native code should not interact with OS directly, \textit{lds} as the native code is not allowed to update segment registers, and \textit{ret} as returning from function calls must be implemented by a sandboxed indirect jump. To constrain control flow, direct branches are computed statically and checked to target an instruction identified during disassembly. For indirect branches a combination of segmented addressing and address masking guarantees that the branch is sandboxed. Using the \textit{CS} register the address is constrained in the code segment and by masking the 5 lower bits of the branch target address it will be pointing to a bundle start. The operation of the validator is crucial for security. The NaCl validator is a small trusted library which is responsible for disassembling untrusted code and checking security policies. Starting from the first instruction, the validator first checks that it is a valid instruction, and that it is not crossing a bundle boundary. Then, if it is an indirect branch, its preceding masking instruction must be in the same bundle. For the case of direct branches, the target address is calculated and stored in an array. If all of these checks pass, the instruction's address is stored as a valid address. At the end all addresses in the branch targets array are checked to be valid addresses. The original proposal of NaCl was only for x86-32. In later research Native Client was extended to the x64 and ARM architectures~\cite{sehrNaclx64}. The most challenging part of these ports was the lack of the segmented memory feature of x86-32. Therefore the authors decided to abandon sandboxing load instructions and just use masked sandboxing and guard pages on store instructions. Also in control flow containment, the high-order bits are masked, too. For the case of x64, dedicating a register to hold the sandboxed address, and reserving large guard regions, helped in efficient implementation. Because introducing bundles is a significant change to code layout, it is most convenient to perform rewriting before assembly as part of the compilation toolchain, when labels are still symbolic; NaCl uses a modified version of the {\em gas} assembler. Recent advances in tools that can recover symbolic labels from stripped binaries~\cite{WangWW2015,Ramblr} could be used as a pre-processing step to extend NaCl to off-the-shelf executables. \textbf{RockSalt} The original version of NaCl's verifier was a hand written program in C, responsible for ensuring sandboxing policies. As the policy enforcement is dependent on code disassembly, it is challenging to make sure the verifier is doing its job right. To address this issue Morrisett et al.\@ proposed \textit{RockSalt}, \cite{morrisettRocksalt} a DFA-based verifier for NaCl. They built a formal model of a large subset of the x86 instruction set and proved verifier correctness on it. Their DFA-style verification approach was also adopted into later versions of NaCl. RockSalt is notable for having a very detailed model of an SFI system, but some previous projects also applied formal methods to SFI. The PittSFIeld project~\cite{mccamantPittS} formalized 7 instructions of x86 and proved SFI policies are respected by those instructions. Earlier Winwood and Chakravarty~\cite{winwoodProvably} provided a machine-checked proof using Isabelle/HOL for an instruction rewriting technique for RISC architecture. Their method replaces any indirect jump with a direct jump into a trusted dispatcher code. \textbf{Monitor Integrity Protection} In more recent research, \textit{Monitor Integrity Protection} \cite{niuMIP} is proposed. Here the authors try to tackle the variable-length instruction problem with a different approach. Instead of using no-ops to align instructions into fixed-sized chunks, they divide the code region into variable-sized chunks and record the beginning of each chunk in a bitmap named the \textit{chunk-table}. All branches are restricted to target only the beginning of a chunk. In case of direct branches, such a property can be checked statically, and for indirect branches a dynamic check looks up the chunk-table to ensure the branch target is valid. Compared to alignment-based techniques, \textit{MIP} is more space efficient (as no no-ops are used). Each \textit{MIP} object in addition to code and data region, contains a chunk-table. To support separate compilation, when modules are combined, their chunk-tables are merged. The authors implemented SFI using \textit{MIP} and showed that it has competitive performance with alignment-based SFI. \section{\normalfont N\MakeLowercase{a}C\MakeLowercase{l} \scshape Allowing Cross-Bundle Instructions} \label{cbi-nacl} Even though padding instructions (using no-ops) to aligned addresses is an effective solution to variable length instructions in CISC architectures, it has some drawbacks. The main disadvantage of inserting no-ops is harming instruction caching and prefetching. As an example, consider a loop in which all instructions in the loop can fit in the L1 instruction cache, but once padded, some portion of the loop does not fit in the L1 cache anymore. In this scenario, every iteration of the loop will cause instruction cache misses. Similarly instruction prefetch is less effective as the code space becomes sparse. As no-ops make actual instructions farther from each other, in each cycle prefetch loads fewer actual instructions from the memory. Another drawback of no-op instructions is wasting CPU cycles once such instructions are loaded and executed. As an optimization, NaCl will jump over any sequence of 16 bytes or longer of no-ops, to avoid CPU cycle waste. In addition, padding the binary increases its size; this is not desirable especially for NaCl where native modules need to be first downloaded on a client machine and then executed. An increase in binary size will result in an increase in download time (though less with compression). Considering these drawbacks encouraged us to look for possible ways to reduce the number of no-ops used for padding. So as the main idea of this project, we try to remove unnecessary no-ops while still satisfying the same safety requirements as in vanilla NaCl. \begin{algorithm}[!t] \begin{algorithmic}[1] \Procedure{pad\_removal}{\textit{assemblyFile}, \textit{padInfo}} \ForAll{$pad$ \textbf{in} \textit{padInfo}} \State $val \gets \text{FALSE}$ \State $savedSize \gets pad.size$ \State $succPad \gets \textit{padInfo}.successor(pad)$ \State $savedSuccSize \gets succPad.size$ \State $pad.size \gets 0$ \While{$pad.size \leq savedSize$} \If{$succPad$} \State $\textit{diff} \gets savedSize~-~pad.size$ \State $succPad.size \gets$ \\ \hfill $(savedSuccSize + \textit{diff}) \mathbin{\%} 32$ \EndIf \State $nexe \gets \textsc{build}(\textit{assemblyFile}, \textit{padInfo})$ \State $val \gets \textbf{validate}(nexe)$ \If{$val = \text{TRUE}$} \State \textbf{break} \EndIf \State $pad.size \mathrel{+}= 1 $ \EndWhile \EndFor \EndProcedure \Procedure{build}{\textit{assemblyFile}, \textit{padInfo}} \State $objFile \gets \textbf{assemble}(\textit{assemblyFile}, \textit{padInfo})$ \State $nexe \gets \textbf{link}(objFile)$ \State \textbf{return} $nexe$ \EndProcedure \end{algorithmic} \caption{Greedy Pad Removal}\label{pad_removal} \end{algorithm} \subsection{Changing NaCl Padding Scheme} \label{sec:pad_rm} In vanilla NaCl, an instruction will be padded in three cases: 1) if it is an indirect jump target, 2) if it is a call, or 3) if it crosses a bundle boundary. In case 1, the instruction is aligned at the beginning of the next 32-byte bundle. In case 2, the call instruction is padded to be positioned at the end of a bundle. In case 3, the instruction is padded to the beginning of the next bundle. Cases 1 and 2 are necessary for sandboxing to preserve the code's behavior. Since the target of an indirect jump is masked so that it will point to a 32-byte-aligned address, the target instructions must be positioned at bundle starts. In case 2, the instruction after the call is the target of return instruction, so pushing the call to the end of the bundle positions the target instruction at the next bundle start. Case 3 pads instructions which would otherwise start in one bundle and end in the next bundle. This type of padding is to eliminate unintended or invalid instructions. But it is conservative; we could allow a cross-bundle instruction if we make sure no unsafe instruction is interpretable from the crossing point. In this way we can decrease the number of no-ops. From now on we use \textit{Cross-Bundle Instruction (CBI) NaCl} to refer to our changed version of NaCl which relaxes the requirements of case 3. The main challenge is deciding which no-ops can be removed while ensuring the binary still passes the verifier. It is an optimization problem, which for now we use a greedy method to solve. For simplicity our approach reuses the validator with its standard interface. (As future work we would like to explore other algorithms, mentioned in Section~\ref{future}.) In our method, for each padding of type 3 (cross-bundle instruction), we start by removing the whole padding sequence, and iteratively we increase the padding size by one byte and check the effect on the validation. If validation succeeds, it means no-op removal did not create any invalid instructions, so we can replace the current padding with a shorter one, and go to the next padding. Algorithm \ref{pad_removal} shows the pseudocode for greedy pad removal. For each source code file, we retrieve assembly code using the \textit{-S} switch to \textit{gcc}. We also made a change in the NaCl build chain to extract information related to pad placement. The modified assembler produces a sequence of entries each of which consists of a location (saying which instruction is padded), and a size (the length of the pad in bytes) which are collected into a data structure named \textit{padInfo}. In Algorithm \ref{pad_removal} the loop at line 2 keeps this invariant that at the start of each iteration the \textit{padInfo} leads to a valid binary. For each element in \textit{padInfo} we start by setting the size of padding to zero and increase it one by one if necessary. In order to evaluate just the effect of current padding size change, the size difference will be added to the next element in the \textit{padInfo} (line 10). This way, in the inner loop (line 8) the whole binary will be like the previous step except for the current padding size change. Note that the addition is modulo bundle size as we can remove any full bundle of no-ops. Another perspective is that this approach moves padding instructions towards the end of the file instead of removing them directly. But in fact, in each iteration the accumulated pads are modulo 32, which means any pads over 32 will be shrunk, and also at the end of the file, any remaining pads can be safely removed without changing the binary's validity. \subsection{Multipass Validator} The NaCl validator checks instructions in one pass starting from the beginning of the code and going to the end. The validator maintains two bitmaps: one for safe addresses to jump to (named \textit{valid targets}), and one for actual addresses which the code will jump to (named \textit{jump targets}). For each instruction, it checks whether it is a valid instruction or not. If it is valid, then the instruction address is marked in the \textit{valid targets} bitmap. If the instruction is a direct branch, the target address is marked in the \textit{jump targets} bitmap. In the case of an indirect branch, the validator checks that it is preceded by appropriate masking instructions. At the end of the validation pass, the two bitmaps \textit{valid targets} and \textit{jump targets} are compared to make sure all direct jumps are targeting valid instructions. Considering our changes in the NaCl padding scheme, we need to make changes in the validator to cover all possible instruction streams. As we are allowing cross bundle instructions, we must make sure that any instruction stream starting from the crossing point will not reach an invalid instruction. To do this we validate a binary in multiple passes. Each validation pass starts from a bundle start (as the bundle start is the possible crossing point); and in each pass, the validation is the same as vanilla NaCl. Algorithm \ref{multipass} presents the multipass validator pseudocode which is an adaptation of RockSalt's validator \cite{morrisettRocksalt}. The changes from the RockSalt algorithm are highlighted in gray. \begin{algorithm}[!t] \centering \algdef{SE}[CWHILE]{CWhile}{CEndWhile}[1]{\colorbox{gray!20}{\algorithmicwhile\ #1\ \algorithmicdo}}{\colorbox{gray!20}{\algorithmicend\ \algorithmicwhile}}% \algtext*{CEndWhile \begin{algorithmic}[1] \Procedure{validate}{$code$, $size$} \State initialize two arrays of size $size$ named $valid$ and $target$ to FALSE \State $bundleStart \gets 0$ \State $result \gets \text{TRUE}$ \CWhile{$bundleStart < size$} \State $pos \gets bundleStart$ \While{$pos < size$ \colorbox{gray!20}{\&\& $!valid[pos]$}} \State $valid[pos] \gets \text{TRUE}$ \State $savedPos \gets pos$ \If{\textbf{match\_maskedJump\_insn}( $code$, $\&pos$, \\ \hfill $size$)} \State \textbf{continue} \EndIf \If{\textbf{match\_nonControlFlow\_insn}($code$,\\ \hfill $\&pos$, $size$)} \State \textbf{continue} \EndIf \If{\textbf{match\_directJump\_insn}($code$, $\&pos$, \\ \hfill $size$)} \State $dst \gets$ \textbf{extract\_dest}($code$, $savedPos$,\\ \hfill $pos$, $size$) \State $target[dst] \gets \text{TRUE}$ \State \textbf{continue} \EndIf \State \textbf{return} FALSE \EndWhile \State \colorbox{gray!20}{$bundleStart$ += $32$} \CEndWhile \For{ $i=0$ to $size$} \If {$target[i]$ \&\& $!valid[i]$} \State $result \gets \text{FALSE}$ \EndIf \If{ $i$ is 5-bit aligned $\&\&$ $!valid[i]$} \State $result \gets \text{FALSE}$ \EndIf \EndFor \State \textbf{return} $result$ \EndProcedure \end{algorithmic} \caption{Multipass Validator}\label{multipass} \end{algorithm} The Validate procedure takes two parameters, a pointer to the code location, and the size of the code. At line 2, two arrays (\textit{valid} and \textit{target}) of size of the code are initialized to FALSE. The \textit{valid} array is used to mark all valid instructions addresses (which in turn can be valid jump destinations). The \textit{target} array records those addresses that are jumped to by some direct jump or call instructions. Two nested while loops at lines 5 and 7 are responsible for going through the code in multiple passes and validating all possible addresses which can be the start of an instruction. The while loop at line 5 iterates over all aligned addresses (bundle starts), and in each iteration it validates instruction streams beginning from the bundle start. The inner loop at line 7, executes if the address in \textit{pos} has not already been validated. If it was, it means the instruction stream was seen in previous iterations and there is no need to be re-validated. Otherwise, for each address in \textit{pos}, the algorithm tries to match the bytes in \textit{code} starting from \textit{pos} against the three classes of instructions (masked jump, non-control flow, and direct jump). Once matched, \textit{pos} is advanced by the size of matched instruction and the process goes to the next iteration. The \textit{match\_maskedJump\_insn} procedure matches a masking instruction on register \textit{r} followed by an indirect call or jump through \textit{r} (line 10). The \textit{match\_nonControlFlow\_insn} procedure matches any instruction allowed by NaCl which does not affect control flow (line 13). The \textit{match\_directJump\allowbreak\_insn} procedure matches direct call or jump instructions (line 16). When this procedure is matched, the \textit{extract\_dst} procedure extracts the target of the direct jump or call (line 18), and the destination is recorded in the \textit{target} array (line 20). When the while loops finishes, the algorithm checks at line 25 that each target address is a valid address, and at line 27, it checks that each aligned address is the beginning of a valid instruction. The vanilla NaCl validator processes a binary in linear time (proportional to the code size). Making multiple passes makes validation more expensive, but it is still asymptotically linear. It might seem the nested loops would have quadratic complexity. However there can be a limited number of distinct execution streams in the same code bytes: eventually most streams will have to converge. Once an execution stream converges with an already-validated instruction stream, the rest of the already-validated stream does not need to be rechecked. Algorithm \ref{multipass} implements this optimization by checking the flags in the {\em valid} array. If the {\em valid} flag for the current address is already set, the validation of the current stream stops and we return to the outer loop. Each iteration of the inner loop marks a previously-unseen instruction, and instructions are never unmarked, so every byte of the code will be processed (as start of an instruction) at most once. The worst-case number of instruction checks increases from the number of intended instructions in the code, to the number of byte locations in the code, but the validator running time is still linear in the binary size. The optimization of not rechecking already-validated instructions does not change the validator result because all of the operations performed when checking an instruction are idempotent. In other words, performing them once has the same effect as performing them repeatedly: the matching result depends only on the instruction bytes, which do not change, and once flags in the {\em target} array are set, they stay set. The sequence of remaining instructions in a stream is uniquely determined from any address in the stream. When the algorithm encounters an already-processed instruction, it is equivalent to skip the checking of the rest of the stream, because all of the result of that checking have already been recorded. The \textit{match\_maskedJump\_insn} check treats two x86 instructions as one pseudo-instruction, where jumping directly to the second of the two instructions would be unsafe. The algorithm treats this in the same way as an unsafe instruction found by interpreting bytes within a single x86 instruction: the second instruction is not valid on its own, so validation will fail if it is reachable in any other way, including by a direct jump, by occurring at a bundle boundary, or along an overlapping-instruction stream. \subsection{Correctness of the Multipass Validator} After describing the changes made in NaCl, here we argue why our changes do not violate NaCl sandboxing policies. The NaCl validator is responsible for policy enforcement. If we can show that despite our changes, the validator still enforces the sandboxing policies correctly, then we are done. The RockSalt~\cite{morrisettRocksalt} authors proved the correctness of their validator which in turn reflected in the current NaCl validator. So we can assume that the NaCl validator is correct and will argue that our changes on making the validation process multipass does not disrupt the validator correctness. The proof in \cite{morrisettRocksalt} relies on the fact that during the binary execution contents of segment registers are not changed from the initialization moment and also the bytes in the code segment are not altered after being validated. The validator prevents untrusted code from updating segment registers by filtering such instructions. As we did not change set of forbidden instructions, therefore the multipass validator provides same protection. This way, if the untrusted binary is loaded in an appropriate environment as long as the instruction pointed to by \textit{pc} (program counter register) is valid, the sandboxing policy is satisfied. The multipass validator covers all addresses that can ever be an instruction address. That is because for the case of direct jumps, the loop at line 20 of Algorithm \ref{multipass} makes sure jump destinations are valid instructions; and for the case of indirect jumps (as they are just allowed to target aligned addresses) the outer loop at line 5 covers all aligned bundle starts. So based on our changes, if the multipass validator returns \textit{TRUE} on a binary, it means in every pass staring from a bundle start, the validator deemed the instruction stream to be in accordance with the sandboxing policy. To get a machine-checked verification of our reasoning, we have also formalized the above argument in the Coq~\cite{Coq} proof assistant as a modification to the previous RockSalt~\cite{morrisettRocksalt} proof. The original RockSalt proof modeled a single-pass validator, so we modified it to model a multipass validator as in Algorithm~\ref{multipass}. Loops are modeled as recursive functions in Coq, and we reused the function implementing the loop of the single-pass validator as the inner loop of the multipass validator (the model does not include the optimization of exiting the inner loop early when encountering an already-validated instruction). We then inserted a new recursive function corresponding to the outer loop that starts a verification pass at each bundle start address. To allow the rest of the proof to work with this change, we had to inductively prove several properties about the outer loop that were already proved for the inner loop, for instance that when an instruction was added to the {\em valid} bitmap, it was within the range of the code region and was in fact the address of a valid instruction. In total we changed about 20 lines of the model and wrote about 650 lines of new lemmas and their proofs. The proof is available at \url{https://pastebin.com/gN026Hte}. With these changes, the security guarantee proved for RockSalt applies with the same force for our modified approach, so we have a strong assurance that allowing cross-bundle instructions does not decrease security. \section{Evaluation} \label{eval} To evaluate our changes to Native Client we used the SPEC CPU suite (a standard set of CPU-intensive programs). We began with SPECint2000 as it was used in the NaCl papers \cite{yeeNaCl, sehrNaclx64}. We then decided to move on to SPECint2006 as it consists of benchmarks with bigger code sizes. We expected our CBI NaCl to show better performance on bigger binaries that have higher instruction-cache pressure. (We also looked into the recently-released SPEC CPU 2017 suite, but it appears to have more severe porting obstacles related to Native Client's older GCC version and memory usage limits.) We used GCC version 4.4.3, and the test machine was an Intel Core i7-3770 (Sandy Bridge) CPU at 3.40GHz, with 16GB of memory, running Ubuntu 16.04. We made a virtual machine containing the CBI NaCl software (source code, compiled binaries, and scripts) which can be accessed at \url{https://www-users.cs.umn.edu/~emamd001/cbi-nacl.html}. \begin{figure*} \centering \includegraphics[width=0.95\textwidth]{NormalizedRuntime3.eps} \caption{Running time overhead comparison for SPECint2000 (normalized with respect to vanilla NaCl)} \label{fig:runtime} \end{figure*} \subsection{Results for SPECint2000} \label{sec:result2000} The SPECint2000 package consists of 12 programs (11 written in C and one in C++). We built these benchmarks on x86-32 architecture and measured the running time of each sample. Figure \ref{fig:runtime} shows the running time overhead comparison for the SPECint benchmarks as built by \textit{GNU GCC}, vanilla NaCl, and CBI NaCl compilers. Each benchmark was run 11 times, and after discarding the first result, the average running time for 10 runs was reported. The best case overhead reduction is for \textit{gap} with 17.9\% and on average CBI NaCl binaries show 4.78\% improvement in running time. For the case of \textit{perlbmk} CBI NaCl binary we observed an increased runtime overhead of 0.8\%. This increased overhead is unexpected, and we describe a more detailed investigation in \ref{anomaly}. Table \ref{tab:filesize} shows the code size of the benchmarks for each compiler in bytes. As it can be seen, except in two cases, our changed compiler generated a smaller binary compared to vanilla NaCl. This size difference is due to pad removal, as we did not change the data layout of binaries and only changed the code layout. For the cases of \textit{181.mcf} and \textit{252.eon} we see a small increase in the binary size of CBI NaCl. That is because at the time of compilation, we put a bundle (32 bytes) of NOP instructions at the end of each object file. These extra bundles are placed to merge the validation paths once all the object files are linked together to build the final binary. For these two benchmarks, the size of the extra bundles exceeds the number of bytes removed from the padding. But as these NOP bundles are placed after the last instruction of the last function of each object file, they will not be executed and have no effect on the number of actually executed instructions. \begin{table} \centering \caption{Code size for SPECint CPU2000 in bytes.} \label{tab:filesize} \begin{tabular}{|c||r|r|r|} \hline \textbf{Benchmark}&\textbf{GNU GCC}&\textbf{Vanilla NaCl}&\textbf{CBI NaCl} \\ \hline \hline 164.gzip&97,816&244,205&243,889\\ \hline 175.vpr&254,574&622,047&621,683\\ \hline 176.gcc&2,030,316&5,598,520&5,598,512\\ \hline 181.mcf&29,405&92,248&92,464\\ \hline 186.crafty&333,524&699,416&699,176\\ \hline 197.parser&276,651&784,118&782,806\\ \hline 252.eon&575,211&4,840,324&4,844,416\\ \hline 253.perlbmk&829,860&2,444,380&2,441,480\\ \hline 254.gap&956,543&2,273,206&2,268,190\\ \hline 255.vortex&754,974&2,070,729&2,067,929\\ \hline 256.bzip2&96,640&207,686&206,438\\ \hline 300.twolf&415,700&1,056,335&1,055,975\\ \hline \end{tabular} \end{table} Table \ref{tab:insn} shows the number of instructions executed by each benchmark at runtime. These numbers are collected by running each sandboxed benchmark under Valgrind/Cachegrind tool. As shown, our pad removal decreased the number of instructions executed. The removed instructions are the padding instructions which have no effect on the benchmark's functionality. \begin{table} \centering \caption{Number of runtime instructions for SPECint CPU2000.} \label{tab:insn} \begin{tabular}{|c||r|r|c|} \hline &\textbf{Vanilla NaCl}&\textbf{CBI NaCl}& \!\small{Decrease}\!\! \\ \hline \hline 164.gzip&438,584,902,313&429,015,758,807&2.8\%\\ \hline 175.vpr&200,396,220,469&200,384,630,579&\textless0.1\%\\ \hline 176.gcc&175,502,236,335&174,171,040,934&0.7\%\\ \hline 181.mcf&55,730,276,258&54,432,114,188&2.3\%\\ \hline 186.crafty&226,135,233,139&223,841,297,154&1.0\%\\ \hline 197.parser&342,435,548,778&340,426,993,766&0.5\%\\ \hline 252.eon&215,902,254,049&215,902,222,993&1.4\%\\ \hline 253.perlbmk&400,334,639,815&396,991,025,588&0.8\%\\ \hline 254.gap&248,434,693,423&245,972,158,831&1.0\%\\ \hline 255.vortex&380,247,713,301&374,391,454,899&1.5\%\\ \hline 256.bzip2&348,260,041,064&343,301,990,583&1.4\%\\ \hline 300.twolf&351,235,815,588&347,811,831,402&1.0\%\\ \hline \end{tabular} \end{table} We should mention that as we are using a greedy method for pad removal, the result may be sub-optimal and therefore the overhead reduction may not be the best possible. But still these results confirm the effect of pad removal on improving performance. To determine an upper bound on how much performance benefit we can get by any approach to remove type 3 padding (such as replacing our current greedy algorithm with a globally-optimal one), we did the following experiment. We recompiled all 12 SPECint2000 benchmarks with the NaCl build chain but removed all type 3 padding. This is not secure and the generated binaries are rightfully rejected by the NaCl validator, but we can still measure their performance overhead. We executed these generated binaries 11 times and reported the average running time of the last 10 executions. The fourth column in figure \ref{fig:runtime} depicts this result. This experiment showed that type 3 pad removal yields about 5.3\% overhead reduction on average. Comparing this result to CBI NaCl running time confirms that our current approach achieves more than 90\% of the possible running time improvement. \subsection{Results for SPECint2006} As the performance improvements for SPECint2000 were unsatisfying, we decided to next consider the newer SPECint2006 suite. We believed as most of the SPECint2000 benchmarks have relatively smaller code sizes, they could fit mostly in current CPU instruction caches. So we were interested to see how using a set of benchmarks with bigger code sizes could affect the performance improvement. SPECint2006 consists of 12 benchmarks (9 in C, and 3 in C++). We managed to build 10 of these benchmarks and measured the running time for 4 different compile setups. We could not successfully execute one of these benchmarks (\textit{400.perlbench}) inside the sandbox (neither vanilla NaCl, nor CBI NaCl) and one other benchmark (\textit{483.xalancbmk}) failed even to compile using g++ 4.4.3. Figure \ref{fig:runtime2006} shows the running time overhead comparison of SPECint2006 benchmarks. Each benchmark was run 11 times, and after discarding the first run, the average running time of 10 runs was reported. The average overhead reduction is 8.6\% which shows a meaningful performance improvement compared to \ref{sec:result2000}. As we mentioned before, we hypothesize that the bigger code sizes of SPECint2006 are a significant reason for such differences. The best case overhead reduction is for \textit{mcf} with 21.8\%. Table \ref{tab:insn2006} depicts the number of instructions executed of benchmarks for each compiler. For this experiment we were not able to monitor SPEC2006 benchmarks under Valgrind because these benchmarks required a larger address space to run, conflicting with Valgrind's memory allocation scheme. Therefore we used OProfile (a statistical profiler for Linux binaries)~\cite{OProfile} to estimate the number of retired instructions with a sampling rate of $10^6$. This table shows the CBI binaries executed on average 15\% fewer instructions at runtime. \begin{figure*}[!t] \centering \includegraphics[width=.95\textwidth]{NormalizedRuntime-2006.eps} \caption{Running time overhead comparison for compatible benchmarks from SPECint2006 (normalized with respect to vanilla NaCl)} \label{fig:runtime2006} \end{figure*} \begin{table} \centering \caption{Number of runtime instructions for SPECint CPU2006.} \label{tab:insn2006} \begin{tabular}{|c||r|r|c|} \hline &\textbf{Vanilla NaCl}&\textbf{CBI NaCl}& \!\small{Decrease}\!\! \\ \hline \hline 401.bzip2&3,379,347 $\times 10^6$&2,917,477$\times 10^6$&13.6\%\\ \hline 403.gcc&1,799,683$\times 10^6$&1,402,218$\times 10^6$&22.0\%\\ \hline 429.mcf&563,035$\times 10^6$&423,872$\times 10^6$&24.7\%\\ \hline 445.gobmk&2,400,400$\times 10^6$&1,957,218$\times 10^6$&18.4\%\\ \hline 456.hmmer&4,452,957$\times 10^6$&3,564,759$\times 10^6$&19.9\%\\ \hline 458.sjeng&3,276,737$\times 10^6$&2,734,397$\times 10^6$&16.5\%\\ \hline 462.libquantum&2,992,638$\times 10^6$&2,974,543$\times 10^6$&0.6\%\\ \hline 464.h264ref&4,688,793$\times 10^6$&3,991,415$\times 10^6$&14.8\%\\ \hline 471.omnetpp&943,026$\times 10^6$&846,961$\times 10^6$&10.1\%\\ \hline 473.astar&1,625,798$\times 10^6$&1,491,833$\times 10^6$&8.2\%\\ \hline \end{tabular} \end{table} \subsection{Investigating the Anomaly}\label{anomaly} As figures \ref{fig:runtime} and \ref{fig:runtime2006} show, in some cases, pad removal unexpectedly caused a slightly increased overhead. To investigate the cause, we investigated more detailed profiling of the benchmark execution. These results suggest address-dependent indirect branch prediction as a source of performance variation. We first made some changes in the NaCl (described in section \ref{challenge}) to be able to run under Valgrind/Cachegrind. Though Cachegrind has the advantage of not requiring statistical sampling, its results did not seem very predictive of performance overhead. From further investigation we hypothesize that this is because its simulation of indirect branch prediction is currently relatively simplistic: it uses a direct-mapped cache indexed by the low 9 bits of an instruction address, which is much simpler than the BTB in a modern CPU. Therefore we used OProfile to estimate some interesting events for each benchmark execution (events include the number of instructions retired, instruction cache misses, branch misprediction, etc). From the OProfile logs we observed there is an increase in the number of branch mispredictions for the case of our CBI NaCl compiled binaries. So we hypothesized that our pad removal had an unpredictable side effect on indirect branch prediction success. That could be the case because once we remove padding, instruction addresses will change. Indirect branch prediction (via the BTB) is dependent on the address of indirect branch, so changes to collisions in the BTB may increase the miss rate. A small change in a program can perturb its layout which affects the cache and branch predictors in complex ways. To confirm the effect of branch misprediction on runtime, we took an approach like one proposed by Curtsinger et al.~\cite{curtsingerStabilizer} to generate multiple samples of the SPECint2000 \textit{perlbmk} benchmark with randomized layout. We changed the way the assembler places indirect call instructions in a bundle. One layout is like vanilla NaCl, meaning that an indirect call instruction is placed at the end of current bundle. Another layout placed the indirect call instruction at the end of a new bundle. Then, the assembler randomly selects one of these layouts for each indirect call instruction. This way we can produce different versions of same benchmark binary with different instruction address layout. We build 80 different versions of \textit{perlbmk} binaries (for vanilla NaCl and CBI). Then we monitored these samples' execution under OProfile and collected the number of instructions retired, number of indirect branch mispredictions, and CPU clock cycles. To separate the effects of changing the number of instructions executed and the number of mispredicted branches, we fit a linear relationship shown in (\ref{formula}) between these variables. The coefficient $x$ is the number of cycles per instruction, while $y$ is the penalty in cycles for a mispredicted indirect branch. \begin{small} \begin{equation} \label{formula} (\text{CPU cycles}) = x\times(\text{\# of insns}) + y\times(\text{\# of mispredictions}) \end{equation} \end{small} These variables turn out to be strongly related; the linear fit is shown graphically in Figure~\ref{matlab-fit}. With these three variables the $R^2$ statistic is 0.904; $x$ is 0.388 CPI, while $y$ is a 35.8 cycle misprediction penalty. By comparison, if the mispredictions are omitted, the $R^2$ is only 0.796. These results suggest that the cause of the anomaly was an increased number of indirect branch mispredictions. In some cases, pad removal may affect the effectiveness of the BTB by changing the instruction address layout. To avoid this kind of disruption, one might incorporate instruction re-ordering to place indirect branch instructions at different addresses. We leave investigating such remedies for future work. \begin{figure*}[!t] \centering \subfloat[Fitting]{\includegraphics[width=0.8\textwidth]{fit} \label{a}} \hfil \subfloat[Residual]{\includegraphics[width=0.8\textwidth]{resid} \label{b}} \caption{Correlation between CPU Clock Cycles and Indirect Branch Misprediction for \textit{perlbmk}} \label{matlab-fit} \end{figure*} \subsection{What about x64?} The CBI NaCl approach is also applicable to the x64 architecture; unfortunately it provides much less benefit there. The main reason is that the x64 validation rules allow fewer instructions. Under x86-32 NaCl, most instructions that access memory are allowed because the address will be checked with segmentation at runtime. Under x64 NaCl, by contrast, only a restricted set of addressing modes are legal, and because of this, fewer overlapping instructions can be allowed. To isolate and measure this effect in more detail, we performed an experiment with random byte sequences. (Though overlapping instructions are not truly random, they are outside our tool's control.) We generated 1 million bundle-length byte sequences, and checked whether each sequence was legal under the rules of the x86-32 or x64 validators. On average 9.1\% of random byte sequences are allowed on x86-32, while only 0.37\% are allowed on x64. We have also implemented CBI NaCl for x64 and evaluated its performance effect. However the performance benefit is small, averaging less than 0.5\%. Examining the binaries, our system was rarely able to remove padding, confirming the effect suggested by the random-byte-sequence experiment. \section{Challenges} \label{challenge} In this section we talk about further implementation details of the project which were necessary to accomplish our main goals. \subsection{On Generating Valid NaCl Binaries} \label{sec:gen-nexe} As mentioned in Section \ref{sec:pad_rm}, Algorithm \ref{pad_removal} processes each source code file one by one and tries to remove padding as much as possible, while maintaining the invariant that the object file passes validation. Then these object files are linked into a complete \textit{nexe} executable. Maintaining this standard C separate compilation approach in padding removal is helpful for scalability, but it requires that the linking step not break validation. The assembler is the tool that puts instructions in the object file and determines the relative address of instructions. We implemented the padding removal by changing the way \textit{gas} puts padding into the object file. The binary content is the same from object file to final \textit{nexe} except for the relocation entries which are filled in by the linker. Once pad removal decides appropriate padding for all source code files, their corresponding object files are linked together to generate the final \textit{nexe}, and this final \textit{nexe} is passed to the validator to make sure the generated \textit{nexe} is a valid one. The final linking step is where relocations (like function names or jump destinations) are resolved to actual addresses inside the binary. This means relocations are replaced by addresses, so the byte stream which the final validation sees is different from the streams validated in intermediate validations. So if we are not careful, it may happen when the relocations are replaced by actual values, the changed bytes may be interpreted to form an unsafe instruction. To avoid such situations, we wish to be conservative toward labels and avoid having paths with labels crossing the bundle boundaries. Conceptually, we would like the validation of a single object file to fail if any value for a relocation address would cause validation to fail. To approximate this check using the existing validator, we replace labels with byte values that are most likely to cause validation to fail if they are interpreted as an instruction. Specifically, in intermediate steps we replace labels with the hex bytes \texttt{c3 c3 c3 c3}. \texttt{0xc3} is the opcode for a one-byte \texttt{ret} instruction, which is prohibited by the validator. Thus if any location inside the label could be reached as an instruction, we conservatively reject the layout. (The change is made only for the purposes of validation testing, not in the object file used for linking, because the label bytes can contain information used by the linker.) However this approach is not quite complete: for instance in SPECint2000, it fails for two benchmarks (\textit{crafty} and \textit{vortex}). The failure occurs when a byte from a label is interpreted not as an opcode but as a mod-r/m byte, which affects the length of an instruction and in turn the stream of later instructions. We handled this case by generalizing the \texttt{0xc3} approach to allow re-testing per-object validation with other byte values as well. Since this problem is relatively rare, our system first attempts to compile a binary testing with just \texttt{0xc3}. If validation fails after linking, our system extracts the label byte value that led to the validation failure, adds it to the testing set, and retries the compilation. For SPECint2000 \textit{crafty} and \textit{vortex}, final validation succeeds with the addition of \texttt{0x9f} or \texttt{0xbf} respectively. While building SPECint2006, the tool found other filtered bytes for three more benchmarks. It found \texttt{0xa0} for \textit{gcc}, \texttt{0xe0} for \textit{gobmk}, and both \texttt{0xa0} and \texttt{0x20} for h264ref. \subsection{On Adapting Valgrind to Run on NaCl} As we mentioned in section \ref{eval}, it was appealing to us to be able to monitor a NaCl sandboxed binary under Valgrind: the Valgrind-based \textit{cachegrind} tool simulates a binary's interaction with the system cache and branch predictor), and Valgrind is also useful for other kinds of debugging. The NaCl project provides scripts to let developers run Valgrind/Memcheck and ThreadSanitizer on x64 versions of NaCl binaries. But our need was to run Valgrind's Cachegrind on x86-32 binaries. The way NaCl loads the sandboxed binary into the memory, and the use of segment-based addressing are the main obstacles to running Valgrind/Cachegrind on NaCl. NaCl first allocates a memory region with a random base address, then initializes the segment registers appropriately, and then uses an \texttt{ljmp} instruction to jump into the sandbox. We decided to disable segment-based addressing in NaCl during Valgrind debugging. At a high level, the changes we made are that first we fixed the base address that NaCl loads the binary into, and then report address zero as the virtual address. In this way the base address of the segments will become zero (i.e. there is no need to use the base address of segment registers for correct addressing). We then located the NaCl code which updates segment registers and transfers the control into and out of the sandbox. We replace this code with equivalent instruction that do not change segments. For example we replace every usage of the \texttt{lss} instruction (which loads \texttt{\%esp} and the stack segment register \texttt{\%ss}) with regular \texttt{mov} instruction to load an offset into \texttt{\%esp}. As another example we replaced every instruction working with \texttt{\%cs} (like \texttt{ljmp} or \texttt{lcall}) with a regular \texttt{jmp} or \texttt{call} via the offset. With these changes we were able to load and execute a sandboxed binary with NaCl under Valgrind. Using the Cachegrind tool, we were able to count the number of instructions executed by each benchmark at runtime (Table \ref{tab:insn}). Even though with the aforementioned changes we were able to execute NaCl under Valgrind, still the debugging information of the untrusted code was not loaded. This made it difficult to connect the results to the original source code. The reason was in the way Valgrind and NaCl load the binary. First the untrusted code is loaded to a temporary address (with \textit{read-only} permission), then NaCl copies the code into the sandboxing area with appropriate permissions (code section with \texttt{rx} and data section with \texttt{rw}). This causes Valgrind to lose the association between debugging information and the execution addresses. As mentioned before, we fixed the untrusted binary execution location, so when Valgrind tries to load the untrusted binary at first, we force it to look for the debugging information, and if present, load it and associate it with the execution location of the untrusted binary. This way we made it possible to execute NaCl under Valgrind. It can be helpful for debugging purposes as the behavior of untrusted code can be monitored inside the sandbox, a capability which was not available before. \section{Future Work} \label{future} Next we enumerate a few open directions for further research. The greedy algorithm for choosing padding instructions to remove (Algorithm~\ref{pad_removal}) already appears to achieve a good proportion of the available overhead reduction, and it is straightforward to implement because it reuses the validator using its existing interface. However repeatedly re-validating portions of object files is inefficient, and there is no guarantee that the greedy approach will leave a minimal number of padding bytes overall. Intuitively, we expect that an efficient algorithm that is close to optimal in removing padding should be possible by taking a dynamic programming approach. The key observation is that for the most part, the validation of an instruction does not depend on its entire address, only on its position relative to a bundle boundary, i.e. its address modulo 32. For instance, there is never a reason to pad by more than 31 bytes. Thus considering 32 (equivalence classes of) locations for each instruction is sufficient to choose locations that globally minimize the need for padding bytes. Our upper bound measurements of overhead when all type-3 padding is removed give an idea of the maximum speedup that can be achieved with better padding removal, though there are also possible layout changes not covered by that upper bound, such as re-ordering instructions (using semantically re-orderings, or with added direct jumps). Such changes might also be used to avoid conflicts that disrupt indirect branch prediction. \section{Conclusion} \label{concl} In this paper we investigated the effect of padding on the performance of Software-based Fault Isolation. We took Native Client as one of the most recent and advanced implementations of SFI and changed its padding scheme while still providing the same level of security. Our changes in the NaCl padding scheme demonstrate the possibility of improving SFI performance by avoiding conservative padding. This performance improvement is a result of decrease in the number of instructions executed and better use of instruction caches and prefetch. Based on our evaluations, because the binaries with bigger code sizes put more pressure on the CPU instruction caches and prefetch, our changes yield in higher performance improvement in such cases. As we reported, the running time reduction for SPECint2006 was on average 8.6\%, while this reduction for SPECint2000 was on average 4.78\%. These results support our intuition about the negative effect of instruction padding on instruction cache and prefetch. The change in the NaCl padding scheme is implemented in the NaCl assembler. An updated version of the NaCl validator is provided to cover all the possible instruction streams of the binary which the assembler generates. A formal proof of correctness of this new validator is provided, too. In a detailed performance analysis for x86-32 NaCl (supported by a NaCl-compatible Valgrind tool), we noticed in some cases the new address layout caused by pad removal can lead to higher branch mispredictions. This in turn can cancel out the performance benefits of executing fewer instructions or suffering fewer instruction cache misses. We also implemented the same modification for x64 NaCl code production and validation. We found that few changes were needed to the technique, but the performance benefit was less than for x86-32 because fewer overlapping instructions can safely be allowed to execute. \section*{Acknowledgments} We thank the anonymous reviewers for suggestions which have helped us improve the paper's presentation. The question of whether alignment-based SFI could be improved by allowing some overlapping instructions was originally suggested by Greg Morrisett. This research was supported by the University of Minnesota, and by the National Science Foundation under grant no. 1526319. \IEEEtriggeratref{25} \bibliographystyle{IEEEtranS}
{'timestamp': '2018-03-02T02:05:38', 'yymm': '1803', 'arxiv_id': '1803.00169', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00169'}
arxiv
\section{Introduction} \label{sec.intro} The development and progression of glaucoma is characterized by complex 3D structural changes within the optic nerve head (ONH) tissues. These include the thinning of the retinal nerve fiber layer (RNFL) \cite{RN29,RN6,RN3}, changes in the minimum-rim-width \cite{RN2}, choroidal thickness \cite{RN1,RN5}, lamina cribrosa (LC) depth \cite{RN30,RN10,RN218}, and posterior scleral thickness \cite{RN11}; and migration of the LC insertion sites \cite{RN32,RN396}. If these parameters (and their changes) could be extracted automatically from optical coherence tomography (OCT) images, this could assist clinicians in their day-to-day management of glaucoma.\\ While there exist several tools to automatically segment the ONH tissues \cite{RN244,RN16,RN517,RN236,RN238,RN243,RN19,RN310,RN255}, and thus extract these parameters, each tissue currently requires a different algorithm (tissue-specific). In our previous study, we developed a histogram-based \cite{RN239} approach that was able to β€˜digitally stain’ (isolate) the connective and neural tissues of the ONH. Following this, we proposed a more accurate deep-learning (patch-based) \cite{RN516} approach to isolate these tissues.\\ Tissue-specific segmentation tools are computationally expensive \cite{RN321} and are often prone to segmentation errors in images with pathologies \cite{RN504}(e.g, age-related macular degeneration, optic disc edema). The segmentation accuracy of these tools is also affected by the reduced deep-tissue visibility and shadow artifacts \cite{RN229} in the OCT images. Combining compensation technology (to remove the deleterious effects of light attenuation) \cite{RN20} with our recently proposed methods, we were able to isolate the ONH tissues more accurately. Yet, the histogram-based approach was limited as it required an initial manual input and could not fully separate different tissues (e.g. sclera from choroid). On the other hand, the patch-based approach failed to offer precise tissue boundaries, failed to separate the LC from the sclera, and presented artificial LC-scleral insertions.\\ In this study, we present DRUNET (Dilated-Residual U-Net), a novel deep-learning approach capturing both the local (tissue texture) and contextual information (spatial arrangement of the tissues) to digitally stain neural and connective tissues of the ONH. We present a comparison with our earlier deep-learning (patch-based) approach to assert the robustness of DRUNET. Our long-term goal is to offer a framework for the automated extraction of neural and connective tissue structural parameters from OCT images of the ONH. \section{Methods} \subsection{Patient Recruitment} A total of 100 subjects were recruited at the Singapore National Eye Center. All subjects gave written informed consent. This study adhered to the tenets of the Declaration of Helsinki and was approved by the institutional review board of the hospital. The cohort consisted of 40 normal (healthy) controls, 41 subjects with primary open angle glaucoma (POAG) and 19 subjects with primary angle closure glaucoma (PACG). The inclusion criteria for normal controls were: an intraocular pressure (IOP) less than 21 mmHg, healthy optic nerves with a vertical cup-disc ratio (VCDR) less than or equal to 0.5 and normal visual fields test. Primary open angle glaucoma was defined as glaucomatous optic neuropathy (GON; characterized as loss of neuroretinal rim with a VCDR $> 0.7$ and/or focal notching with nerve fiber layer defect attributable to glaucoma and/or asymmetry of VCDR between eyes $> 0.2$) with glaucomatous visual field defects. Primary angle closure glaucoma was defined as the presence of GON with compatible visual field loss, in association with a closed anterior chamber angle and/or peripheral anterior synechiae in at least one eye. A closed anterior chamber angle was defined as the posterior trabecular meshwork not being visible in at least $180$ of anterior chamber angle. \subsection{Optical Coherence Tomography Imaging} The subjects were seated and imaged under dark room conditions after dilation with $1\%$ tropicamide solution. The images were acquired by a single operator (TAT), masked to diagnosis with the right ONH being imaged in all the subjects, unless the inclusion criteria were met only in the left eye, in which case the left eye was imaged. A horizontal B-scan (0\textdegree) of 8.9 mm (composed of 768 A-scans) was acquired through the center of the ONH for all the subjects using spectral-domain OCT (Spectralis, Heidelberg Engineering, Heidelberg, Germany). Each OCT image was averaged 48x and enhanced depth imaging (EDI) was used for all scans. \subsection{Shadow Removal and Light Attenuation: Adaptive Compensation} We used adaptive compensation (AC) to remove the deleterious effects of light attenuation \cite{RN20}. AC can help mitigate blood vessel shadows and enhance the contrast of OCT images of the ONH \cite{RN20,RN249}. A threshold exponent of 12 (to limit noise over-amplification at high depth) and a contrast exponent of 2 (for improving the overall image contrast) were used for all the B-scans \cite{RN249}. \subsection{Manual Segmentation} An expert observer \textbf{(SD)} performed manual segmentation of all OCT images using Amira (version 5.4, FEI, Hillsboro, OR). This was done to \textbf{1)} train our algorithm to identify and isolate the ONH tissues; and to \textbf{2)} validate the accuracy of digital staining. Each OCT image was segmented into the following classes: (refer \textbf{Figure \ref{fig:1}}):\textbf{(1)} the RNFL and the prelamina (in red); \textbf{(2)} the retinal pigment epithelium (RPE; in pink); \textbf{(3)} all other retinal layers (in cyan); \textbf{(4)} the choroid (in green); \textbf{(5)} the peripapillary sclera (in yellow); and \textbf{(6)} the (LC) (in blue). Noise (in gray) and the vitreous humor (in black) were also isolated. Note that we were unable to obtain a full thickness segmentation of the peripapillary sclera and the LC due to limited visibility \cite{RN249}. Only their visible portions were segmented.\\ \begin{figure}[h] \centering \includegraphics[width=.75\textwidth]{figure1} \caption{Manual Segmentation of a compensated OCT image. The RNFL and the prelaminar tissue are shown in red, the RPE in pink, all other retinal layers in cyan, the choroid in green, the peripapillary sclera in yellow, the LC in blue, noise in grey and the vitreous humor in black.} \label{fig:1} \end{figure} \subsection{Digital Staining of the ONH} In this study, we developed the architecture \textbf{DRUNET} (Dilated-Residual U-Net): a fully convolutional neural network inspired by the widely used U-Net \cite{RN329}, to digitally stain the ONH tissues. DRUNET exploits the inherent advantages of the U-Net skip connections \cite{RN509}, residual learning \cite{RN23} and dilated convolutions \cite{RN24} to offer a robust digital staining with a minimal number of trainable parameters. The U-Net skip connections allowed capturing both the local and contextual information \cite{RN509,RN329}, while the residual connections allowed a better flow of the gradient information through the network. Using the dilated convolutional filters, we were able to better exploit the contextual information: this was crucial as we believe local information (i.e. tissue texture) is insufficient to delineate precise tissue boundaries. DRUNET was trained with OCT images of the ONH and their corresponding manually segmented ground truths. \\ \subsection{Network Architecture} The DRUNET architecture was composed of a downsampling and an upsampling tower \textbf{Figure \ref{fig:2}}, connected to each other via skip-connections. Each tower consisted of one standard block and two residual blocks. Both the standard and the residual blocks were constructed using two dilated convolution layers, with 16 filters (size 3x3) each. The identity connection in the residual block was implemented using a 1x1 convolution layer, as described in \textbf{Figure \ref{fig:2}}. In the downsampling tower, the input image of size 496x768 was fed to a standard block with a dilation rate of 1 followed by two residual blocks with dilation rates of 2 and 4 respectively. After every block in the downsampling tower, a max-pooling layer of size 2x2 was used to reduce the dimensionality and exploit the contextual information. A residual block with a dilation rate of 8 was used to transfer the features from the downsampling to the upsampling tower. These features were then passed through two residual blocks with dilation rates of 4 and 2 respectively. A standard block with a dilation rate of 1 was used to restore the image to its original resolution. After every block in the upsampling tower, a 2x2 upsampling layer was used to sequentially restore the image to its original resolution. The output layer was implemented as a 1x1 convolution layer with a number of filters equal to the number of classes (8 = 6 tissues + noise + vitreous humour). We then applied a softmax activation to this output layer to obtain the class-wise probabilities for each pixel. Finally, each pixel was assigned the class of the highest probability. Skip connections \cite{RN509} were established between the downsampling and upsampling towers to recover the spatial information lost during the downsampling. \begin{figure}[H] \centering \includegraphics[width=1.0\textwidth]{figure2} \caption{DRUNET comprises of two towers: (1) A downsampling tower – to capture the contextual information (i.e., spatial arrangement of the tissues), and an (2) upsampling tower – to capture the local information (i.e., tissue texture). Each tower consists of two blocks: (1) a standard block, and (2) a residual block. The entire network consists of 40,000 trainable parameters in total. } \label{fig:2} \end{figure} In both towers, all the layers except the last output layer were batch normalized and activated by an exponential linear unit function ELU \cite{RN27}. In each residual block, the residual layers were batch normalized and ELU activated before their addition.\\ The entire network was trained end-to-end using stochastic gradient descent with nesterov momentum (momentum=0.9). An initial learning rate of 0.1 (halved when the validation loss failed to improve over two consecutive epochs) was used to train the network and the model with the best validation loss was chosen for all the experiments in this study. The loss function $\mathcal{L}$ was based on the mean of Jaccard-type Index calculated for each tissue, \begin{align*} \mathcal{L}= 1 - \frac{1}{C} \, \sum_{c=1}^{C} \frac{\widehat{y}_c \odot y_c}{\widehat{y}_c + y_c - \widehat{y}_c \odot y_c}, \end{align*} where $C$ denotes the total number of classes, the notation $\widehat{y}_c \odot y_c$ denotes the component-wise multiplication between the matrices $\widehat{y}_c $ and $y_c$, the quantity $\widehat{y}_c \in (0,1)$ is the predicted pixel-wise probability of belonging to class $c \in \{1,2, \ldots, C\}$ and $y_c \in \{0,1\}$ is the ground truth segmentation matrix (or map). The final network consisted of 40,000 trainable parameters. The proposed architecture was trained and tested on a NVIDIA GTX 1080 founder’s edition GPU with CUDA v8.0 and cuDNN v5.1 acceleration. With the given hardware configuration, each OCT image was digitally stained in 80 ms. \subsection{Data Augmentation} An extensive online data augmentation was performed to overcome the sparsity of our training data. Data augmentation consisted of random rotation (8 degrees clockwise and anti-clockwise), horizontal flipping, nonlinear intensity shifts, addition of white noise and multiplicative speckle noise \cite{RN510}, elastic deformations \cite{RN514} and occluding patches. \\ Nonlinear intensity shifts were of the type $\overline{I} = \phi(I)$, for a random (non-linear) function $\phi$, where the quantities $I$ and $\overline{I}$ denote intensities (pixel-wise) before and after the nonlinear intensity shift respectively. This made the network invariant to intensity inhomogeneity within/between tissue layers (a common problem in OCT images affecting the performance of automated segmentation tools \cite{RN533}). The elastic deformations \cite{RN514} can be viewed as an image warping technique to produce the combined effects of shearing and stretching. This was done in an attempt to make our network invariant to images with atypical morphology (i.e., ONH tissue deformations as seen in glaucoma \cite{RN535}). Twenty occluding patches of size 60x20 pixels were also added at random locations to reduce the visibility in certain tissues, in an effort to make our network invariant to blood vessel shadowing that is common in OCT images. Each occluding patch resulted in the reduction of intensity in the entire occluded region by a random factor (random number between 0.2 and 0.8). An example of data augmentation performed on a single OCT image is shown in \textbf{Figure \ref{fig:3}}. \begin{figure}[H] \centering \includegraphics[width=1.\textwidth]{figure3} \caption{Extensive data augmentation was performed to overcome the sparsity of our training data. \textbf{(A)} represents a compensated OCT image of a glaucoma subject. \textbf{(B)} represents the same image having undergone data augmentation. The data augmentation includes horizontal flipping, rotation (8 degrees clockwise), additive white noise and multiplicative speckle noise \cite{RN510}, elastic deformation \cite{RN514} and occluding patches. A portion of the image undergoing elastic deformation and occlusion from patches is bounded by blue and red box respectively. The elastic deformations (combination of shearing and stretching) made our network invariant to images with atypical morphology (i.e., ONH tissue deformation in glaucoma \cite{RN535}). The occluding patches reduced visibility of certain tissues, making our network invariant to blood vessel shadows.} \label{fig:3} \end{figure} \subsection{Training and Testing of our network} The dataset of 100 B-scans (40 healthy, 60 glaucoma) was split into training and testing datasets. The training set was composed of an equal number of compensated glaucoma and healthy OCT images of the ONH, along with their corresponding manual segmentations. The trained network was then evaluated on the unseen testing set (composed of the remaining compensated OCT images of the ONH and their corresponding manual segmentations). A training set of 40 images (60 testing images) were chosen for all the experiments discussed in this study.\\ To assess the consistency of the proposed methodology, the model was trained on five training sets of 40 images each and tested on their corresponding testing sets. Given the limitation of a total of only 100 OCT images, it was not possible to obtain five distinct training sets, thus each training set had some images repeated. To study the effect of compensation on digital staining, the entire process (training and testing) was repeated with the baseline (uncompensated) images. A comparative study was also performed between the DRUNET architecture and our previously published patch-based digital staining approach \cite{RN516}. For this, we trained and tested both the techniques with the same dataset. \subsection{ Digital Staining: Qualitative Analysis} All the digitally stained images obtained were manually reviewed by an expert observer (SD) and qualitatively compared with their corresponding manual segmentations.\\ \subsection{Digital Staining: Quantitative Analysis} We used the following metrics to assess the accuracy of the digital staining: (1) the dice coefficient ($\mathrm{DC}$); (2) Specificity ($\mathrm{Sp}$); and (3) ($\mathrm{Sn}$). For each image, the metrics were computed for the following classes: (1) RNFL and prelamina, (2) RPE, (3) all other retinal layers, and (4) choroid. Note that the metrics could not be applied directly to the peripapillary sclera and the LC as their true thickness could not be obtained from the manual segmentation. However, digital staining of the peripapillary sclera and of the LC was qualitatively assessed. Noise and vitreous humor were also exempted from such a quantitative analysis.\\ The dice coefficient was used to measure the spatial overlap between the manual segmentation and the digital staining. It is defined between 0 and 1, where 0 represents no overlap and 1 represents a complete overlap. For each image in the testing set, the dice coefficient was calculated for each tissue as follows, \begin{align*} \mathrm{DC}_i = 2 \, \times \, \frac{\left| \mathrm{DS}_i \cap \mathrm{MS}_i \right|}{ \left| \mathrm{DS}_i \right| + \left| \mathrm{MS}_i\right|} \end{align*} where $\mathrm{MS}_i$ is the set of pixels representing the tissue $i$ in the manual segmentation, while $\mathrm{DS}_i$ represents the same in the digitally stained image.\\ Specificity was used to assess the true negative rate of the proposed method.\\ \begin{align*} \mathrm{Sp}_i = \frac{\left| \overline{\mathrm{DS}}_i \cap \overline{\mathrm{MS}}_i \right|}{\left| \overline{\mathrm{MS}}_i\right|} \end{align*} where $\overline{\mathrm{DS}}_i$ and $\overline{\mathrm{MS}}_i$ are the set of all the pixels not belonging to class $i$ in the digitally stained and the corresponding manually segmented image respectively. Sensitivity was used to assess the true positive rate of the proposed method as is defined as: \begin{align*} \mathrm{Sn}_i = \frac{\left| \mathrm{DS}_i \cap \mathrm{MS}_i \right|}{\left| \mathrm{MS}_i\right|} \end{align*} Both specificity and sensitivity were reported on a scale of 0--1. To assess the performance of the digital staining between glaucoma and healthy OCT images, for each experiment, the metrics were calculated separately for the two groups. \section{Results} \subsection{Qualitative Analysis} The baseline, compensated, manually segmented, and the digitally-stained images for 4 selected subjects (1$ \& $2: POAG, 3: Healthy, 4: PACG) are shown in \textbf{Figure \ref{fig:4}}.\\ \begin{figure}[H] \centering \includegraphics[width=1.0\textwidth]{figure4} \caption{Baseline (1st row), compensated (2nd row), manually segmented (3rd row), digitally-stained images (trained on 10 compensated images; 4th row), and digitally-stained images (trained on 10 baseline images; 5th row) for 4 selected subjects (1$ \& $2: POAG, 3: Healthy, 4:PACG )} \label{fig:4} \end{figure} When trained with the compensated images (\textbf{Figure \ref{fig:4}, 4th Row}) or the uncompensated images (\textbf{Figure \ref{fig:4}, 5th Row}), DRUNET was able to simultaneously isolate the different ONH tissues, i.e. the RNFL $+$ prelamina (in red), the RPE (in pink), all other retinal layers (in cyan), the choroid (in green), the sclera (in yellow) and the LC (in blue). Noise and vitreous humor were isolated in gray and black respectively. In both cases, the digital staining of the ONH tissues were qualitatively similar, comparable and consistent with the manual segmentation. A smooth delineation of the choroid-sclera interface was obtained in both cases. Irregular (\textbf{Figure \ref{fig:4}, Subject 2 and 4}) LC boundaries that were inconsistent with the manual segmentations were obtained in few images irrespective of the training data (compensated/uncompensated images). When validated against the respective manual segmentations, there was no visual difference in the performance of digital staining on healthy or glaucoma OCT images across all experiments.\\ \subsection{Quantitative Analysis} When trained with compensated images, across all the five testing sets, the mean dice coefficients for the healthy/glaucoma OCT images were: $0.92 \pm 0.05/0.92 \pm 0.03$ for the RNFL + prelamina, $0.83 \pm .04/0.84 \pm 03$ for the RPE, $0.95 \pm 0.01/ 0.96 \pm 0.07$ for all other retina layers, and $0.90 \pm 0.03/ 0.91 \pm 0.05$ for the choroid. The mean sensitivities for the healthy/glaucoma OCT images were $0.92 \pm 0.01/0.92 \pm 0.03$ for the RNFL + prelamina, $0.87 \pm 0.04/0.88 \pm 0.03$ for the RPE, $0.96 \pm 0.04/0.96 \pm 0.03$ for all other retina layers, and $0.89 \pm 0.06/0.91 \pm 0.02$ for the choroid respectively. For all the tissues, the mean specificities were always above $0.99$ for both glaucoma and healthy subjects. In all experiments, there were no significant differences (mean dice coefficients, specificities and sensitivities) in the performance of digital staining between glaucoma and healthy OCT images (\textbf{Figure \ref{fig:5}}). \begin{figure}[H] \centering \includegraphics[width=1.0\textwidth]{figure5} \caption{A quantitative analysis of the proposed method is presented to assess the consistency and performance of digital staining between glaucoma and healthy images. A total of 5 datasets were used for training (40 images) and its corresponding testing (60 images). (A-C) represent the dice coefficients, sensitivities and specificities as box plots for the RNFL + prelamina for healthy (in yellow) and glaucoma (in green) images in the testing sets. (D-F) represent the same for the RPE, (G-I) represent the same for all other retinal layers and (J-L) represent the same for the choroid.} \label{fig:5} \end{figure} Further, the performance of the digital staining did not significantly improve when using compensation (\textbf{Figure \ref{fig:6}}). \begin{figure}[H] \centering \includegraphics[width=1.0\textwidth]{figure6} \caption{The effect of compensation on the digital staining accuracy is presented. A total of 5 compensated and uncompensated datasets were used for training (40 images) and its corresponding testing (60 images). (A-C) represent the dice coefficients, sensitivities and specificities as box plots for the RNFL + prelamina for compensated (healthy in yellow; glaucoma in green) and uncompensated images (healthy in blue; glaucoma in red). (D-F) represent the same for the RPE, (G-I) represent the same for all other retinal layers and (J-L) represent the same for the choroid.} \label{fig:6} \end{figure} Overall, the DRUNET performed significantly better for all the tissues compared to the patch-based approach, except for the RPE, in which case it performed similar (\textbf{Figure \ref{fig:7}}). \begin{figure}[H] \centering \includegraphics[width=1.20\textwidth]{figure7} \caption{A comparative study between DRUNET and the patch-based digital staining approach is presented. A total of 5 datasets were used for training (40 images) the DRUNET/patch based architecture and its corresponding testing (60 images). (A-C) represent the dice coefficients, sensitivities and specificities as box plots for the RNFL + prelamina obtained from DRUNET (healthy in yellow; glaucoma in green) and the patch-based method (healthy in blue; glaucoma in red). (D-F) represent the same for the RPE, (G-I) represent the same for all other retinal layers and (J-L) represent the same for the choroid.} \label{fig:7} \end{figure} \section{Discussion} In this study, we present DRUNET, a deep learning approach that is able to capture both local and contextual features to simultaneously stain (i.e. highlight) connective and neural tissues in OCT images of the ONH. The proposed study leverages on the inherent advantages of skip connections, residual learning and dilated convolutions. Having successfully trained, tested and validated on the OCT images from 100 subjects, we were able to consistently achieve a good qualitative and quantitative digital staining. Thus, we may be able to offer a robust segmentation framework, for the automated parametric study of the ONH tissues. \\ Using DRUNET, we were able to simultaneously isolate the RNFL+prelamina, the RPE, all other retinal layers, the choroid, the peripapillary sclera, the LC, noise and the vitreous humor with good accuracy. When trained and tested on compensated images, there was good agreement with manual segmentation, with the overall dice coefficient (mean of all tissues) being $0.91 \pm 0.04$ and $0.91 \pm 0.06$ for glaucoma and healthy subjects respectively. The mean sensitivities for all the tissues were $0.92 \pm 0.04$ and $0.92 \pm 0.04$ for glaucoma and healthy subjects respectively while the mean specificities were always higher than $0.99$ for all cases.\\ We observed that DRUNET offered no significant differences in the performance of digital staining when tested upon compensated (blood vessel shadows removed), or uncompensated images, as opposed to our previous patch-based method \cite{RN516}, that performed better on compensated images. This may be attributed to the extensive online data augmentation we used herein that also included occluding patches to mimic the presence of blood vessel shadows. In uncompensated images, the presence of retinal blood vessel shadows typically affects the automated segmentation of the RNFL \cite{RN527,RN522}, that can yield incorrect RNFL thickness measurements. This phenomenon may be more pronounced in glaucoma subjects that exhibit very thin RNFL. Our DRUNET framework, being invariant to the presence of blood vessel shadows, could potentially be extended to provide an accurate and reliable measurement of RNFL thickness. We believe this could improve the diagnosis and management of glaucoma. However, given the benefits of compensation in enhancing deep tissue visibility \cite{RN249}, and contrast \cite{RN20}, it may be advised to digitally stain compensated images for a reliable clinical interpretation of the isolated ONH tissues.\\ When trained and tested with the same cohort, DRUNET offered smooth and accurate delineation of tissue boundaries with reduced false predictions. Thus, it performed significantly better than the patch-based approach for all the tissues, except for the RPE, in which case it performed similarly. This may be attributed to DRUNET’s ability in capturing both local (tissue texture) and contextual features (spatial arrangement of tissues), compared to the patch-based approach that captured only the local features.\\ DRUNET consisted of 40,000 trainable parameters as opposed to the patch-based approach that required 140,000 parameters. Besides, DRUNET also eliminated the need for multiple convolutions on similar sets of pixels as seen in patch-based approach. Thus, DRUNET offers a computationally inexpensive and faster segmentation framework that only takes 80 ms to digitally stain one OCT image. This could be extended for the real time segmentation of OCT images as well. We are currently exploring such an approach.\\ We found that DRUNET was able to dissociate the LC from the peripapillary sclera. This provides an advantage as opposed to previous techniques that were able to segment only the LC \cite{RN536,RN326}, or the LC fused with the peripapillary sclera \cite{RN516}. To the best of our knowledge, no automated segmentation techniques have been proposed to simultaneously isolate all individual ONH connective tissues. We believe our network was able to achieve this because we used the Jaccard Index as part of the loss function. During training, by computing the Jaccard Index for each tissue, the network was able to learn the representative features equally for all tissues. This reduced the inherent bias in learning features of a tissue represented by a large number of pixels (e.g., retinal layers) as opposed to a tissue represented by a small number of pixels (e.g., LC/RPE). \\ We observed no significant differences in the performance of digital staining when tested on glaucoma or healthy images. The progression of glaucoma is characterized by thinning of the RNFL \cite{RN29,RN6,RN3} and decreased reflectivity (attenuation) of the RNFL axons \cite{RN526}, thus reducing the contrast of the RNFL boundaries. Existing automated segmentation tools for the RNFL rely on these boundaries for their segmentation and are often prone to segmentation artifacts \cite{RN518,RN519,RN520,RN521} (incorrect ILM/ posterior RNFL boundary), resulting in inaccurate RNFL measurements. This error increases with the thinning of the RNFL \cite{RN522}. Thus, glaucomatous pathology increases the likelihood of errors in the automated segmentation of the RNFL, leading to under- or over-estimated RNFL measurements that may affect the diagnosis of glaucoma \cite{RN522}. An automated segmentation tool that is invariant to the pathology is thus highly needed to robustly measure RNFL thickness. We believe DRUNET may be a solution for this problem, and we aim to test this hypothesis in future works. \\ With the proposed methodology, one could extract key structural parameters from the isolated tissues as an immediate clinical application of our technique. For instance, the peripapillary RNFL/choroidal thickness could be computed from digitally stained images as the number of vertical coloured pixels representing it, multiplied by a physical scaling factor. Upon isolation of the RPE from the central scan, the Bruch's membrane opening (BMO) points can be identified its end tips. The minimum-rim width can then be computed as the minimum distance between the BMO points and the inner limiting membrane \cite{RN543} (also obtained from digital staining). Further, one could also obtain key connective tissue parameters such as anterior LC insertion distance \cite{RN545}, LC surface depth \cite{RN546}, prelaminar thickness \cite{RN544} and prelaminar depth \cite{RN544} in a similar manner from the isolated sclera and LC. We believe, obtaining these parameters can improve the diagnosis, management and risk profiling of glaucoma. We are currently working on such a clinical translation of the proposed approach.\\ \noindent There are several limitations to this study that warrant further discussion. \begin{itemize} \item The accuracy of the algorithm was validated against the manual segmentations provided by a single expert observer (SD). The future scope of this study would be to provide a validation against multiple expert observers. Nevertheless, we offer a proof of concept for the simultaneous digital staining of the ONH tissues in OCT images. \item The algorithm was trained with the images from a single machine (Spectralis). Currently, it is unknown if the algorithm would perform the same way if tested on images from multiple OCT devices. We are exploring other options to develop a device-independent digital staining approach. \item We observed irregular LC boundaries that were inconsistent with that of the manual segmentations in few images. When extended for the automated parametric study, this could affect the LC parameters such as LC depth \cite{RN387}, LC curvature \cite{RN545}, and the global shape index \cite{RN376}. Given the significance of LC morphology in glaucoma \cite{RN396,RN387,RN376,RN397,RN401,RN403,RN395,RN394,RN228}, a more accurate delineation of the LC boundary would be required to obtain reliable parameters for a better understanding of glaucoma. This could be addressed using transfer learning \cite{RN531, RN529} by incorporating more information about LC morphology within the network. We are currently exploring such an approach. \item A quantitative validation of the peripapillary sclera and the LC could not be performed as their true thickness could not be obtained from the manual segmentations due to limited visibility \cite{RN249}. \item We were unable to provide further validation to our algorithm by comparing it with data obtained from histology. This is a challenging task, given that one would need to image a human ONH with OCT, process it with histology and register both datasets. However, it is important to bear in mind that the understanding of OCT ONH anatomy stemmed from a single comparison of a normal monkey eye scanned in vivo at an IOP of 10 mm Hg and then perfusion fixed at time of sacrifice at the same IOP \cite{RN511}. Our algorithm produced tissue classification results that match the expected relationships obtained in this above-mentioned work. The absence of published experiments matching human ONH histology to OCT images, at the time of writing this paper, inhibits an absolute validation of our proposed methodology. \item A robust and accurate isolation of the ganglion cell complex (GCC) \cite{RN506} and the photoreceptor layers \cite{RN507}, whose structural changes are associated with the progression of glaucoma was not possible in both compensated and uncompensated images. The limitation of an accurate intra-retinal layer segmentation from ONH images can be attributed to the inherent speckle noise and intensity inhomogeneity \cite{RN517} which affects the robust delineation of the intra-retinal layers. This could be resolved by using advanced pre-processing techniques for image denoising (e.g. deep learning based) or a multi-stage tissue isolation approach (i.e., extraction of retinal layer followed by the isolation of intra-retinal layers). \item Given the limitation of a small dataset (100 images), and the need for performing multiple experiments (repeatability), we were able to use only 40 images for training (60 images for testing) in each experiment. It is currently unknown if the performance of digital staining would improve when trained upon a larger dataset. Also, we would also like to emphasize again that there was no mixing of the training and testing sets in a given experiment. However, across all the experiments, there was indeed a small leakage of the testing/training sets. Nevertheless, we offer a proof of principle for a robust deep learning approach to digital stain ONH tissues that could be used by other groups for further validation. \end{itemize} In conclusion, we have developed a deep learning algorithm for the simultaneous isolation of the connective and neural tissues in OCT images of the ONH. Given that the ONH tissues exhibit complex changes in their morphology with the progression of glaucoma, their simultaneous isolation may be of great interest for the clinical diagnosis and management of glaucoma. \section*{Funding} Singapore Ministry of Education Academic Research Funds Tier 1 (R-155-000-168-112 [AHT]); National University of Singapore (NUS) Young Investigator Award Grant (NUSYIA$\textunderscore$FY16$\textunderscore$P16; R-155-000-180-133; AHT); National University of Singapore Young Investigator Award Grant (NUSYIA$\textunderscore$FY13$\textunderscore$P03; R-397-000-174-133 [MJAG]); Singapore Ministry of Education Tier 2 (R-397-000-280-112 [MJAG]);National Medical Research Council (Grant NMRC/STAR/0023/2014 [TA]).\\ \section*{Disclosures} The authors declare that there are no conflicts of interest related to this article.\\ \bibliographystyle{unsrt}
{'timestamp': '2018-03-02T02:06:54', 'yymm': '1803', 'arxiv_id': '1803.00232', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00232'}
arxiv
\section{Introduction} \label{sec:introduction} Machine translation (MT) is an interesting task not only for its practical applications but also for the formidable learning challenges it poses, from how to transduce variable length sequences, to searching for likely sequences in an intractably large hypothesis space, to dealing with the multi-modal nature of the prediction task, since typically there are several correct ways to translate a given sentence. The research community has made great advances on this task, recently focusing the effort on the exploration of several variants of neural models~\citep{bahdanau2014neural,luong2015effective,gehring2017convs2s,vaswani2017transformer} that have greatly improved the state of the art performance on public benchmarks. However, several open questions remain~\citep{koehn17}. In this work, we analyze top-performing trained models in order to answer some of these open questions. We target better understanding to help prioritize future exploration towards important aspects of the problem and therefore speed up progress. For instance, according to conventional wisdom neural machine translation (NMT) systems under-estimate rare words~\citep{koehn17}, why is that? Is the model poorly calibrated? Is this due to exposure bias~\citep{mixer}, i.e., the mismatch between the distribution of words observed at training and test time? Or is this due to the combination of uncertainty in the prediction of the next word and inference being an $\arg\max$ selection process, which always picks the most likely/frequent word? Similarly, it has been observed~\citep{koehn17} that performance degrades with large beams. Is this due to poor fitting of the model which assigns large probability mass to bad sequences? Or is this due to the heuristic nature of this search procedure which fails to work for large beam values? In this paper we will provide answers and solutions to these and other related questions. The underlying theme of all these questions is \textit{uncertainty}, i.e. the one-to-many nature of the learning task. In other words, for a given source sentence there are several target sequences that have non negligible probability mass. Since the model only observes one or very few realizations from the data distribution, it is natural to ask the extent to which an NMT model trained with token-level cross-entropy is able to capture such a rich distribution, and whether the model is calibrated. Also, it is equally important to understand the effect that uncertainty has on search and whether there are better and more efficient search strategies. Unfortunately, NMT models have hundreds of millions of parameters, the search space is exponentially large and we typically observe only one reference for a given source sentence. Therefore, measuring fitness of a NMT model to the data distribution is a challenging scientific endeavor, which we tackle by borrowing and combining tools from the machine learning and statistics literature~\citep{structpredcalib, guo17}. With these tools, we show that search works surprisingly well, yielding highly likely sequences even with relatively narrow beams. Even if we consider samples from the model that have similar likelihood, beam hypotheses yield higher BLEU on average. Our analysis also demonstrates that although NMT is well calibrated at the token and set level, it generally spreads too much probability mass over the space of sequences. This often results in individual hypotheses being under-estimated, and overall, poor quality of samples drawn from the model. Interestingly, systematic mistakes in the data collection process also contribute to uncertainty, and a particular such kind of noise, the target sentence being replaced by a copy of the corresponding source sentence, is responsible for much of the degradation observed when using wide beams. This analysis -- the first one of its kind -- introduces tools and metrics to assess fitting of the model to the data distribution, and shows areas of improvement for NMT. It also suggests easy fixes for some of the issues reported by practitioners. We also release the data we collected for our evaluation, which consists of ten human translations for 500 sentences taken from the WMT'14 En-Fr and En-De test sets.\footnote{Additional reference translations are available from:\\ \url{https://github.com/facebookresearch/analyzing-uncertainty-nmt}.} \section{Related Work} In their seminal work, \citet{zoph15} frame translation as a compression game and measure the amount of information added by translators. While this work precisely quantifies the amount of uncertainty, it does not investigate its effect on modeling and search. In another context, uncertainty has been considered for the design of better evaluation metrics~\citep{hyter,galley2015deltableu}, in order not to penalize a model for producing a valid translation which is different from the provided reference. Most work in NMT has focused on improving accuracy without much consideration for the intrinsic uncertainty of the translation task itself~\citep{bahdanau2014neural,luong2015effective,gehring2017convs2s,vaswani2017transformer} (\textsection\ref{sec:data_unc}). Notable exceptions are latent variable models~\citep{blunsom08,vae_nmt} which explicitly attempt to model multiple modes in the data distribution, or decoding strategies which attempt to predict diverse outputs while leaving the model unchanged~\citep{gimpel13,diverse_bs_batra16,diverse_bs_li16,npad}. However, none of these works check for improvements in the match between the model and the data distribution. Recent work on analyzing machine translation has focused on topics such as comparing neural translation to phrase-based models~\citep{bentivogli16, toral17}. \citet{koehn17} presented several challenges for NMT, including the deterioration of accuracy for large beam widths and the under-estimation of rare words, which we address in this paper. \citet{isabelle17} propose a new evaluation benchmark to test whether models can capture important linguistic properties. % Finally, \citet{niehues17} focus on search and argue in favor of better translation modeling instead of improving search. \section{Data Uncertainty} \label{sec:data_unc} Uncertainty is a core challenge in translation, as there are several ways to correctly translate a sentence; but what are typical sources of uncertainty found in modern benchmark datasets? Are they all due to different ways to paraphrase a sentence? In the following sections, we answer these questions, distinguishing uncertainty inherent to the task itself (\textsection\ref{sec:intrinsic}), and uncertainty due to spurious artifacts caused by the data collection process (\textsection\ref{sec:extrinsic}). \subsection{Intrinsic Uncertainty} \label{sec:intrinsic} One source of uncertainty is the existence of several \textit{semantically equivalent} translations of the same source sentence. This has been extensively studied in the literature~\citep{hyter,pado09}. Translations can be more or less literal, and even if literal there are many ways to express the same meaning. Sentences can be in the active or passive form and for some languages determiners and prepositions such as `the', `of', or `their' can be optional. Besides uncertainty due to the existence of distinct, yet semantically equivalent translations, there are also sources of uncertainty due to \textit{under-specification} when translating into a target language more inflected than the source language. Without additional context, it is often impossible to predict the missing gender, tense, or number, and therefore, there are multiple plausible translations of the same source sentence. Simplification or addition of cultural context are also common sources of uncertainty~\citep{venuti08}. \subsection{Extrinsic Uncertainty} \label{sec:extrinsic} Statistical machine translation systems, and in particular NMT models, require lots of training data to perform well. To save time and effort, it is common to augment high quality human translated corpora with lower quality web crawled data~\citep{smith2013dirt}. This process is error prone and responsible for introducing additional uncertainty in the data distribution. Target sentences may only be partial translations of the source, or the target may contain information not present in the source. A lesser-known example are target sentences which are entirely in the source language, or which are primarily \textit{copies of the corresponding source}. For instance, we found that between 1.1\% to 2.0\% of \textit{training} examples in the WMT'14 En-De and WMT'14 En-Fr datasets (\textsection\ref{sec:datasets}) are ``copies'' of the source sentences, where a target sentence is labeled as ``copy'' if the intersection over the union of unigrams (excluding punctuation and numbers) is at least 50\%. Source copying is particularly interesting since we show that, even in small quantities, it can significantly affect the model output (\textsection\ref{sec:beam_failure}). Note that \textit{test} sets are manually curated and never contain copies. \section{Experimental Setup} \label{sec:setting} \subsection{Sequence to Sequence Model} \label{sec:modeldesc} Our experiments rely on the pre-trained models of the \emph{fairseq-py} toolkit~\citep{gehring2017convs2s}, which achieve competitive performance on the datasets we consider. Formally, let $\mathbf{x}$ be an input sentence with $m$ words $\{x_1, \dots, x_m\}$, and $\mathbf{t}$ be the ground truth target sentence with $n$ words $\{t_1, \dots, t_n\}$. The model is composed of an \textit{encoder} and a \textit{decoder}. The encoder takes $\mathbf{x}$ through several convolutional layers to produce a sequence of hidden states, $\mathbf{z} = \{z_1, \dots, z_m\}$, one per input word. At time step $k$, the decoder takes a window of words produced so far (or the ground truth words at training time), $\{t_{k-1}, \dots, t_{k-i}\}$, the set of encoder hidden states $\mathbf{z}$ and produces a distribution over the current word: $p(t_{k} | t_{k-1}, \dots, t_{k-i}, \mathbf{z})$. More precisely, at each time step, an \textit{attention} module~\citep{bahdanau2014neural} summarizes the sequence $\mathbf{z}$ with a single vector through a weighted sum of $\{z_1, \dots, z_m\}$. The weights depend on the source sequence $\mathbf{x}$ and the decoder hidden state, $h_{k}$, which is the output of several convolutional layers taking as input $\{t_{k-1}, \dots, t_{k-i}\}$. From the source attention vector, the hidden state of the decoder is computed and the model emits a distribution over the current word as in: $p(t_{k} | h_{k}) = \mbox{softmax}(W h_{k} + b)$. \citet{gehring2017convs2s} provides further details. To train the translation model, we minimize the cross-entropy loss: $\mathcal{L} = -\sum_{i=1}^n \log p(t_i | t_{i-1}, \dots, t_{1}, \mathbf{x})$, using Nesterov's momentum~\citep{sutskever2013icml}.\footnote{We also obtain similar results with models trained with sequence-level losses~\cite{edunov2018classical}.} At test time, we aim to output the most likely translation given the source sentence, according to the model estimate. We approximate such an output via \textit{beam search}. Unless otherwise stated, we use beam width $k=5$, where hypotheses are selected based on their length-normalized log-likelihood. Some experiments consider \emph{sampling} from the model conditional distribution $p(t_{i}|t_{i-1}, \mathbf{h}_{i-1}, \mathbf{x})$, one token at a time, until the special end of sentence symbol is sampled. \subsection{Datasets and Evaluation} \label{sec:datasets} We consider the following datasets: \noindent {\bf WMT'14 English-German (En-De):} We use the same setup as~\citet{luong2015effective} which comprises 4.5M sentence pairs for training and we test on newstest2014. We build a validation set by removing 44k random sentence-pairs from the training data. As vocabulary we use 40k sub-word types based on a joint source and target byte pair encoding (BPE; Sennrich et al., 2016)\nocite{bpe}. \noindent {\bf WMT'17 English-German (En-De):} The above pre-processed version of WMT'14 En-De did not provide a split into sub-corpora which we required for some experiments. We therefore also experiment on the 2017 data where we test on newstest2017. The full version of the dataset (\emph{original}) comprises 5.9M sentence pairs after length filtering to 175 tokens. We then consider the news-commentary portion with 270K sentences (\emph{clean}), and a \emph{filtered} version comprising 4M examples after removing low scoring sentence-pairs according to a model trained on the cleaner news-commentary portion. \noindent {\bf WMT'14 English-French (En-Fr):} We remove sentences longer than 175 words and pairs with a source/target length ratio exceeding 1.5 resulting in 35.5M sentence pairs for training. The source and target vocabulary is based on 40k BPE types. Results are reported on both newstest2014 and a validation set held-out from the training data comprising 26k sentence pairs. We evaluate with tokenized BLEU~\citep{bleu} on the corpus-level and the sentence-level, after removing BPE splitting. Sentence-level BLEU is computed similarly to corpus BLEU, but with smoothed $n$-gram counts (+1) for $n>1$~\citep{lin2004orange}. \section{Uncertainty and Search} \label{sec:beam} \begin{figure*}[t] \centering \vspace{-.25cm} \includegraphics[width=\linewidth]{samples_oracle.pdf} \vspace{-1cm} \caption{ \small \emph{Left}: Cumulative sequence probability of hypotheses obtained by beam search and sampling on the WMT'14 En-Fr valid set; \emph{Center}: same, but showing the average per-token probability as we increase the number of considered hypotheses, for each source sentence we select the hypothesis with the maximum probability (orange) or sentence-level BLEU (green); \emph{Right}: same, but showing averaged sentence-level BLEU as we increase the number of hypotheses. } \label{fig:oracle_bleu} \end{figure*} In this section we start by showing that the models under consideration are well trained (\textsection\ref{sec:welltrained}). Next, we quantify the amount of uncertainty in the model's output and compare two search strategies: beam search and sampling (\textsection\ref{sec:beamisgood}). Finally we investigate the influence of a particular kind of extrinsic uncertainty in the data on beam search, and provide an explanation for the performance degradation observed with wide beams (\textsection\ref{sec:beam_failure}). \begin{table}[!t \small \centering \begin{tabular}{lcc} \toprule & En-Fr & En-De \\ \midrule \multicolumn{1}{l}{\bf Automatic evaluation} \\ \quad train PPL & 2.54 & 5.14 \\ \quad valid PPL & 2.56 & 6.36 \\ \quad test BLEU & 41.0 & 24.8 \\ \midrule \multicolumn{2}{l}{\bf Human evaluation (pairwise)} \\ \quad Ref $>$ Sys & 42.0\% & 80.0\% \\ \quad Ref $=$ Sys & 11.6\% & 5.6\% \\ \quad Ref $<$ Sys & 46.4\% & 14.4\% \\ \bottomrule \end{tabular} \caption{\small Automatic and human evaluation on a 500 sentence subset of the WMT'14 En-Fr and En-De test sets. Models generalize well in terms of perplexity and BLEU. Our human evaluation compares (reference, system) pairs for beam $5$.} \label{tab:humanstudy} \end{table} \normalsize \subsection{Preliminary: Models Are Well Trained} \label{sec:welltrained} We start our analysis by confirming that the models under consideration are well trained. Table~\ref{tab:humanstudy} shows that the models, and particularly the En-Fr model, achieve low perplexity and high BLEU scores. To further assess the quality of these models, we conducted a human evaluation with three professional translators. Annotators were shown the source sentence, reference translation, and a translation produced by our model through \emph{beam search}---a breadth-first search that retains only the $k$ most likely candidates at each step. Here, we consider a relatively narrow beam of size $k=5$. The reference and model translations were shown in random order and annotators were blind to their identity. We find that model translations roughly match human translations for the En-Fr dataset, while for the En-De dataset humans prefer the reference over the model output 80\% of the time. Overall, the \textbf{models are well trained}---particularly the En-Fr model---and beam search can find outputs that are highly rated by human translators. \subsection{Model Output Distribution Is Highly Uncertain} \label{sec:beamisgood} How much uncertainty is there in the model's output distribution? What search strategies are most \emph{effective} (i.e., produce the highest scoring outputs) and \emph{efficient} (i.e., require generating the fewest candidates)? To answer these questions we sample $10$k translations and compare them to those produced by beam search with $k=5$ and $k=200$. Figure~\ref{fig:oracle_bleu} (\emph{Left}) shows that \textbf{the model's output distribution is highly uncertain}: even after drawing $10$k samples we cover only 24.9\% of the sequence-level probability mass. And while beam search is much more efficient at searching this space, covering 14.6\% of the output probability mass with $k=5$ and 22.4\% of the probability mass with $k=200$, these finding suggest that most of the probability mass is spread elsewhere in the space (see also \textsection\ref{subsec:seq_level_calibration}). Figure~\ref{fig:oracle_bleu} also compares the average sentence-level BLEU and model scores of hypotheses produced by sampling and beam search. Sampling results for varying sample size $n=1, \dots, 10k$ are on two curves: orange reports probability (\emph{Center}) and sentence BLEU (\emph{Right}) for the sentence with the highest probability within $n$ samples, while green does the same for the sentence with the highest sentence BLEU in the same set~\citep{sokolov08}. We find that sampling produces hypotheses with similar probabilities as beam search (\emph{Center}), however, for the same likelihood beam hypotheses have higher BLEU scores (\emph{Right}). We also note that \textbf{BLEU and model probability are imperfectly correlated}: while we find more likely translations as we sample more candidates, BLEU over those samples eventually decreases (\emph{Right}, orange curve).\footnote{Hypothesis length only decreases slightly with more samples, i.e., the BLEU brevity penalty moves from 0.975 after drawing 300 samples to 0.966 after 10k samples.} Vice versa, hypotheses selected by BLEU have lower likelihood score beyond 80 samples (\emph{Center}, green curve). We revisit this surprising finding in \textsection\ref{sec:beam_failure}. \begin{figure}[t] \centering \includegraphics[width=0.85\linewidth]{percentiles_wmt14_en2fr_valid} \vspace{-0.5cm} \caption{\small Probability quantiles for tokens in the reference, beam search hypotheses ($k=5$), and sampled hypotheses for the WMT'14 En-Fr validation set. } \vspace{-0.5cm} \label{fig:logprob_quantile} \end{figure} Finally, we observe that the model on average assigns much lower scores to the reference translation compared to beam hypotheses (Figure~\ref{fig:oracle_bleu}, \emph{Center}). To better understand this, in Figure~\ref{fig:logprob_quantile} we compare the token-level model probabilities of the reference translation, to those of outputs from beam search and sampling. We observe once again that \textbf{beam search is a very effective search strategy}, finding hypotheses with very high average token probabilities and rarely leaving high likelihood regions; indeed only 20\% of beam tokens have probabilities below 0.7. In contrast, the probabilities for sampling and the human references are much lower. The high confidence of beam is somewhat surprising if we take into account the exposure bias~\citep{mixer} of these models, which have only seen gold translations at training time. We refer the reader to \textsection\ref{subsec:seq_level_calibration} for discussion about how well the model actually fits the data distribution. \subsection{Uncertainty Causes Large Beam Degradation} \label{sec:beam_failure} In the previous section we observed that repeated sampling from the model can have a negative impact on BLEU, even as we find increasingly likely hypotheses. Similarly, we observe lower BLEU scores for beam 200 compared to beam 5, consistent with past observations about performance degradation with large beams~\citep{koehn17}. Why does the BLEU accuracy of translations found by larger beams deteriorate rather than improve despite these sequences having higher likelihood? To answer this question we return to the issue of extrinsic uncertainty in the training data (\textsection\ref{sec:extrinsic}) and its impact on the model and search. One particularly interesting case of noise is when target sentences in the training set are simply a copy of the source. In the WMT'14 En-De and En-Fr dataset between 1.1\% and 2.0\% of the training sentence pairs are ``copies'' (\textsection\ref{sec:extrinsic}). How does the model represent these training examples and does beam search find them? It turns out that \textbf{copies are over-represented in the output of beam search}. On WMT'14 En-Fr, beam search outputs copies at the following rates: 2.6\% (beam=1), 2.9\% (beam=5), 3.2\% (beam=10) and 3.5\% (beam=20). To better understand this issue, we trained models on the news-commentary portion of WMT'17 English-German which does not contain copies. We added synthetic copy noise by randomly replacing the true target by a copy of the source with probability $p_{\rm noise}$. Figure~\ref{fig:copy_synth_beam} shows that larger beams are much more affected by copy noise. Even just 1\% of copy noise can lead to a drop of 3.3 BLEU for a beam of $k=20$ compared to a model with no added noise. For a 10\% noise level, all but greedy search have their accuracy more than halved. \begin{figure}[t] \centering \vspace{-.2cm} \includegraphics[width=0.9\linewidth]{copy_source_bleu.pdf} \vspace{-.6cm} \caption{\small Translation quality of models trained on WMT'17 English-German news-commentary data with added synthetic copy noise in the training data (x-axis) tested with various beam sizes on the validation set.} \label{fig:copy_synth_beam} \end{figure} \begin{figure}[t] \centering \vspace{-.3cm} \includegraphics[width=0.96\linewidth]{logprobpos_wmt14_en2fr_valid} \vspace{-.5cm} \caption{\small Average probability at each position of the output sequence on the WMT'14 En-Fr validation set, comparing the reference translation, beam search hypothesis ($k=5$), and copying the source sentence. } \label{fig:costlogprob} \end{figure} Next, we examine model probabilities at the token-level. Specifically, we plot the average per position log-probability assigned by the En-Fr model to each token of: (i) the reference translation, (ii) the beam search output with $k=5$, and (iii) a synthetic output which is a copy of the source sentence. Figure~\ref{fig:costlogprob} shows that the probability of copying the first source token is very unlikely according to the model (and actually matches the ground truth rate of copy noise). However, after three tokens the model switches to almost deterministic transitions. Because beam search proceeds in strict left-to-right manner, the copy mode is only reachable if the beam is wide enough to consider the first source word which has low probability. However, once in the beam, the copy mode quickly takes over. This explains why large beam settings in Figure~\ref{fig:copy_synth_beam} are more susceptible to copy noise compared to smaller settings. Thus, while larger beam widths are effective in finding higher likelihood outputs, such sequences may correspond to copies of the source sentence, which explains the drop in BLEU score for larger beams. Deteriorating accuracy of larger beams has been previously observed~\citep{koehn17}, however, it has not until now been linked to the presence of copies in the training data or model outputs. Note that this finding does not necessarily imply a failure of beam nor a failure of the model to match the data distribution. Larger beams do find more likely hypotheses. It could very well be that the true data distribution is such that no good translation individually get a probability higher than the rate of copy. In that case, even a model perfectly matching the data distribution will return a copy of the source. We refer the reader to \textsection\ref{subsec:seq_level_calibration} for further analysis on this subject. The only conclusion thus far is that \textbf{extrinsic uncertainty is (at least partially) responsible for the degradation of performance of large beams}. \begin{figure}[t] \centering \vspace{-.25cm} \includegraphics[width=\linewidth]{fig_copyfilter} \vspace{-.75cm} \caption{\small BLEU on newstest2017 as a function of beam width for models trained on all of the WMT'17 En-De training data (\emph{original}), a filtered version of the training data (\emph{filtered}) and a small but clean subset of the training data (\emph{clean}). We also show results when excluding copies as a post-processing step (\emph{no copy}).} \label{fig:copyfilter} \end{figure} Finally, we present two simple methods to mitigate this issue. First, we pre-process the training data by removing low scoring sentence-pairs according to a model trained on the news-commentary portion of the WMT'17 English-German data (\emph{filtered}; \textsection\ref{sec:datasets}). Second, we apply an inference constraint that prunes completed beam search hypotheses which overlap by 50\% or more with the source (\emph{no copy}). Figure~\ref{fig:copyfilter} shows that BLEU improves as beam gets wider on the clean portion of the dataset. Also, the performance degradation is greatly mitigated by both filtering the data and by constraining inference, with the best result obtained by combining both techniques, yielding an overall improvement of 0.5 BLEU over the \emph{original} model. Appendix~\ref{app:copynoise} describes how we first discovered the copy noise issue. \section{Model Fitting and Uncertainty} \label{sec:modelVSdata} The previous section analyzed the most likely hypotheses according to the model distribution. This section takes a more holistic view and compares the estimated distribution to the true data distribution. Since exact comparison is intractable and we can only have access to few samples from the data distribution, we propose several necessary conditions for the two distributions to match. First, we inspect the match for unigram statistics. Second, we move to analyze calibration at the set level and design control experiments to assess probability estimates of sentences. Finally, we compare in various ways samples from the model with human references. We find uncontroversial evidence that the model spreads too much probability mass in the hypothesis space compared to the data distribution, often under-estimating the actual probability of individual hypothesis. Appendix~\ref{app:matchfulldistr} outlines another condition. \subsection{Matching Conditions at the Token Level} \begin{figure}[t] \centering \vspace{-.25cm} \includegraphics[width=0.95\linewidth]{freqhistpct_wmt14_en2fr_train_tight} \vspace{-.5cm} \caption{\small Unigram word frequency over the human references, the output of beam search ($k=5$) and sampling on a random subset of 300K sentences from the WMT'14 En-Fr training set.} \label{fig:unigram_freq} \end{figure} If the model and the data distribution match, then unigram statistics of samples drawn from the two distributions should also match (not necessarily vice versa). This is a particularly interesting condition to check since NMT models are well known to under-estimate rare words~\citep{koehn17}; is the actual model poorly estimating word frequencies or is this just an artifact of beam search? Figure~\ref{fig:unigram_freq} shows that samples from the model have roughly a similar word frequency distribution as references in the training data, except for extremely rare words (see Appendix~\ref{app:moredata} for more analysis of this issue). On the other hand, beam search over-represents frequent words and under-represents more rare words, which is expected since high probability sequences should contain more frequent words. \begin{figure}[t] \centering \vspace{-.25cm} \includegraphics[width=\linewidth]{fig_replace_synth} \vspace{-.75cm} \caption{\small Comparison of how often a word type is output by the model with beam search or sampling compared to the data distribution; prior is the data distribution. Values below prior underestimate the data distribution and vice versa.} \label{fig:replace_synth} \end{figure} Digging deeper, we perform a synthetic experiment where we select 10 target word types $w \in W$ and replace each $w$ in the training set with either $w_1$ or $w_2$ at a given \emph{replacement rate} $p(w_1|w)$.\footnote{Each replaced type has a token count between 3k-7k, corresponding to bin 20 in Fig.~\ref{fig:unigram_freq}. $|W| =$ 50k.} We train a new model on this modified data and verify whether the model can estimate the original replacement rate that determines the frequency of $w_1$ and $w_2$. Figure~\ref{fig:replace_synth} compares the replacement rate in the data (prior) to the rate measured over the output of either beam search or sampling. Sampling closely matches the data distribution for all replacement rates but beam greatly overestimates the majority class: it either falls below the prior for rates of 0.5 or less, or exceeds the prior for rates larger than 0.5. These observations confirm that the \textbf{model closely matches unigram statistics except for very rare words, while beam prefers common alternatives to rarer ones}. \subsection{Matching Conditions at the Sequence Level} \label{subsec:seq_level_calibration} In this section, we further analyze how well the model captures uncertainty in the data distribution via a sequence of necessary conditions operating at the sequence level. \textbf{Set-Level Calibration.} Calibration~\citep{guo17,structpredcalib} verifies whether the model probability estimates $p_m$ match the true data probabilities $p_d$. If $p_d$ and $p_m$ match, then for any set $S$, we observe: \[ \mathop{\mathbb{E}}_{x \sim p_d}[\mathbb{I}\{x \in S\}] = p_m(S). \] The left hand side gives the expected rate at which samples from the data distribution appear in $S$; the right hand side sums the model probability estimates over $S$. \begin{figure}[t] \centering \vspace{-.25cm} \includegraphics[width=0.8\linewidth]{calibration_exp} \caption{\small Matching distributions at the set level using 200 beam search hypotheses on the WMT'14 En-Fr valid and test set. Points are binned so that each represents 10\% of sentences. The lowest probability bin (not shown) has value 0 (reference never in $S$). } \label{fig:calibration_exp} \end{figure} In Figure~\ref{fig:calibration_exp}, we plot the left hand side against the right hand side where $S$ is a set of $200$ beam search hypotheses on the WMT'14 En-Fr validation set, covering an average of 22.4\% of the model's probability mass. Points are binned so that each point represents 10\% of sentences in the validation or test set~\citep{nguyen2015emnlp}. For instance, the rightmost point in the figure corresponds to sentences for which beam collects nearly the entire probability mass, typically very short sentences. This experiment shows that the \textbf{model matches the data distribution remarkably well at the set level} on both the validation and test set. \begin{figure}[t] \centering \vspace{-.25cm} \includegraphics[width=0.9\linewidth]{copy_source_seqprob.pdf} \vspace{-.5cm} \caption{\small Rate of copy of the source sentence (exact and partial) as a function of the amount of copy noise present in the model's train data (\textsection\ref{sec:beam_failure}). Results on WMT'17 En-De validation set. } \label{fig:copy_synth_seqprob} \end{figure} \textbf{Control Experiment.} To assess the fit to the data distribution further, we re-consider the models trained with varying levels of copy noise ($p_{\rm noise}$, cf. \textsection\ref{sec:beam_failure}) and check if we reproduce the correct amount of copying (evaluated at the sequence level) when sampling from the model. Figure~\ref{fig:copy_synth_seqprob} shows a large discrepancy: at low $p_{\rm noise}$ the model underestimates the probability of copying (i.e., too few of the produced samples are \emph{exact copies} of the source), while at high noise levels it overestimates it. Moreover, since our model is smooth, it can assign non-negligible probability mass to partial copies\footnote{Partial copies are identified via the IoU at 50\% criterion (\textsection\ref{sec:extrinsic}).} which are \emph{not} present in the training data. When we consider both partial and exact copies, the model correctly reproduces the amount of copy noise present in the training data. Therefore, although the model appears to under-estimate some hypotheses at low copy rates, it actually \textbf{smears probability mass in the hypothesis space}. Overall, this is the first concrete evidence of the model distribution not perfectly fitting the data distribution. \textbf{Expected Inter-Sentence BLEU} is defined as $$ \mathop{\mathbb{E}}_{x\sim p, x'\sim p}[BLEU(x,x')] $$ which corresponds to the expected BLEU between two translations sampled from a distribution $p$ where $x$ is the hypothesis and $x'$ is the reference. If the model matches the data distribution, then the expected BLEU computed with sentences sampled from the model distribution $p_m$ should match the expected BLEU computed using two independent reference translations (see \textsection\ref{sec:multref} for more details on data collection). We find that the expected BLEU is $44.5$ and $32.1$ for human translations on the WMT'14 En-Fr and WMT'14 En-De datasets, respectively.\footnote{We also report inter-human pairwise corpus BLEU: 44.8 for En-Fr and 34.0 for En-De; and concatenated corpus BLEU over all human references: 45.4 for En-Fr and 34.4 for En-De.} However, the expected BLEU of the model is only $28.6$ and $24.2$, respectively. This large discrepancy provides further evidence that \textbf{the model spreads too much probability mass across sequences}, compared to what we observe in the actual data distribution. \subsection{Comparing Multiple Model Outputs to Multiple References} \label{sec:multref} Next we assess if model outputs are similar to those produced by multiple human translators. We collect 10 additional reference translations from 10 distinct humans translators for each of 500 sentences randomly selected from the WMT'14 En-Fr and En-De test sets. We also collect a large set of translations from the model via beam search ($k=200$) or sampling. We then compute two versions of \emph{oracle BLEU} at the sentence-level: (i) \textit{oracle reference} reports BLEU for the most likely hypothesis with respect to its best matching reference (according to BLEU); and (ii) \textit{average oracle} computes BLEU for every hypothesis with respect to its best matching reference and averages this number over all hypotheses. Oracle reference measures if one of the human translations is similar to the top model prediction, while average oracle indicates whether most sentences in the set have a good match among the human references. The average oracle will be low if there are hypotheses that are dissimilar from all human references, suggesting a possible mismatch between the model and the data distributions. Table~\ref{tab:oracleBLEU} shows that beam search (besides degradation due to copy noise) produces not only top scoring hypotheses that are very good (single reference scoring at 41 and oracle reference at 70) but most hypotheses in the beam are close to a reference translation (as the difference between oracle reference and average oracle is only 5 BLEU points). Unfortunately, beam hypotheses lack diversity and are all close to a few references as indicated by the coverage number, which measures how many \emph{distinct} human references are matched to at least one of the hypotheses. In contrast, hypotheses generated by sampling exhibit opposite behavior: the quality of the top scoring hypothesis is lower, several hypotheses poorly match references (as indicated by the 25 BLEU points gap between oracle reference and average oracle) but coverage is much higher. This finding is again consistent with the previous observation that the \textbf{model distribution is too spread in hypothesis space}. We conjecture that the excessive spread may also be partly responsible for the lack of diversity of beam search, as probability mass is spread across similar variants of the same sequence even in the region of high likelihood. This over-smoothing might be due to the function class of NMT; for instance, it is hard for a smooth class of functions to fit a delta distribution (e.g., a source copy), without spreading probability mass to nearby hypotheses (e.g., partial copies), or to assign exact 0 probability in space, resulting in an overall under-estimation of hypotheses present in the data distribution. \begin{table}[t] \small \centering \begin{tabular}{lccc} \toprule & \multicolumn{2}{c}{\bf beam} & \multicolumn{1}{c}{\bf sampling} \\ & $k=5$ & $k=200$ & $k=200$ \\ \midrule \bf Prob.\ covered & 4.7\% & 11.1\% & 6.7\% \\ \midrule \multicolumn{3}{l}{\bf Sentence BLEU} \\ \quad single reference & 41.4 & 36.2 & 38.2 \\ \quad oracle reference & 70.2 & 61.0 & 64.1 \\ \quad average oracle & 65.7 & 56.4 & 39.1 \\ \quad \ -\ \# refs covered & 1.9 & 5.0 & 7.4 \\ \midrule \multicolumn{3}{l}{\bf Corpus BLEU (\texttt{multi-bleu.pl})} \\ \quad single reference & 41.6 & 33.5 & 36.9 \\ \quad 10 references & 81.5 & 65.8 & 72.8 \\ \bottomrule \end{tabular} \caption{\small Sentence and corpus BLEU for beam search hypotheses and 200 samples on a 500 sentence subset of the WMT'14 En-Fr test set. ``Single reference" uses the provided reference and the most likely hypothesis, while oracle reference and average oracle are computed with 10 human references.\label{tab:oracleBLEU}} \vspace{-0.25cm} \end{table} \normalsize \section{Conclusions and Final Remarks} \label{sec:conclusions} In this study we investigate the effects of uncertainty in NMT model fitting and search. We found that search works remarkably well. While the model is generally well calibrated both at the token and sentence level, it tends to diffuse probability mass too much. We have not investigated the causes of this, although we surmise that it is largely due to the class of smooth functions that NMT models can represent. We instead investigated some of the effects of this mismatch. In particular, excessive probability spread causes poor quality samples from the model. It may also cause the ``copy mode'' to become more prominent once the probability of genuine hypotheses gets lowered. We show that this latter issue is linked to a form of extrinsic uncertainty which causes deteriorating accuracy with larger beams. Future work will investigate even better tools to analyze distributions and leverage this analysis to design better models. \section*{Acknowledgements} We thank the reviewers, colleagues at FAIR and Mitchell Stern for their helpful comments and feedback.
{'timestamp': '2018-08-14T02:19:16', 'yymm': '1803', 'arxiv_id': '1803.00047', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00047'}
arxiv
\section{CONCLUDING REMARKS}\label{sec:conc} \rma{In this paper, the power of MFG based control methodologies has been applied to the problem of modulating the aggregate load of vast numbers of energy storage associated devices in power systems, in particular electric space heaters (or air conditioners), acting as a buffer against the intermittency of renewable energy sources such as solar and wind, or as a virtual battery coordinated by an aggregator entity on the energy markets. The MFG framework combines the ability of bottom up modeling approaches to answer ``what if'' types of questions arising in demand response or load dispatch schemes, with the decentralized control theoretic potential of game theory. From technically challenging in terms of complexity of control and monitoring needs, the large numbers involved in the load management of residential and commercial loads, are turned into an advantage as the laws of large numbers exploited in MFG formulations kick in. A novel integral control scheme acting on the cost coefficients of a suitably engineered LQG individual agent cost is introduced, and a class of collective target following problems is defined. The corresponding fixed point equations characterizing Nash equilibria are shown to have at least one solution. The latter may or may not be desirable (i.e. converging to target). An algorithm for a desirable near Nash equilibrium is presented; agents contribute according to their current abilities, yet the mean dwelling temperature converges to the target. The mean field based integral control formulation adds robustness to uncertainties in the elemental device models formulation , and are a first step towards an extension of the classical disturbance rejection control theory into collective dynamics control problems. In future work, we hope to develop MFG based collective dynamics formulations whereby not only piecewise constant slowly changing perturbations can be rejected, but also disturbances within arbitrary signal classes. Furthermore, we intend to study cooperative collective target tracking solutions, as well as the impact of saturation constraints on the synthesis of control laws.} \begin{ack}{Acknowledgment } The authors gratefully acknowledge the support of Natural Resources Canada, and the Natural Sciences and Engineering Research Council of Canada. \end{ack} \section{FIXED POINT ANALYSIS}\label{fpa} We now tackle the fixed point analysis for \eqref{eqn:qwatMFgen}-\eqref{eqn:meanwatMFgen}. We consider the case $y\leq \bar x_0$, i.e. when the target temperature \rma{set by the aggregator} is less than or equal to the initial mean temperature of the population. The analysis is very similar for the case $\bar x_0\leq y$; which therefore will be omitted. Note that for $y \leq \bar x_0$, $z$ is set to be less than $y$; i.e., $z=l \leq y \leq \bar x_0 \leq h$, so that the agents \emph{collectively decrease} their temperatures by moving towards that target (see \rsa{Fig.} \ref{legend}). \begin{figure}[th] \centering \includegraphics[width=.7\hsize]{figures/legend} \caption{An Energy Release Situation $(z\leq y \leq \bar x_0)$} \label{legend} \end{figure} \subsection{CTT MF Equation System}\label{cctmf} Considering the CTT MF Equation System \eqref{eqn:qwatMFgen}-\eqref{eqn:meanwatMFgen}, we introduce in the following the operators $\Delta$ and $\T^s$, $1 \leq s \leq m$, where $\M\teq \sum_{s=1}^m n_s\T^s \circ \Delta,\, \M(\bar x):\b{C}_b[0,\infty)\rightarrow\b{C}[0,\infty)$, characterizes the complete equation system . We define the operator $\Delta:\b{C}_b[0,\infty)\rightarrow \b{C}_{l}[0,\infty) $: \rma{\begin{equation} q^y_t = \left\lvert \int_0^t g(\bar x_\tau - y) d\tau \right\rvert\teq \Delta{ (\bar{x}_{\tau}; {\tau}\in [0; \infty)) }(t).\label{deltaDef} \end{equation}} \rma{Hereon, for notational convenience, the value at time $t$ of the function to the extreme right-hand side of \eqref{deltaDef}, will be denoted $\Delta(\bar x)(t)$ .} Next for each $1 \leq s \leq m$, we define $\T^s:\b{C}_{l}[0,\infty) \conv\b{C}[0,\infty)$ for the equation system \eqref{eqn:piwatMFgen}-\eqref{eqn:barwatMFgen} with input $q^y_t$ and output $\bar x_t^{s}$, which is equivalent to \begin{equation}\label{tDef} \bar x_t^{s} \teq (\T^s q)(t). \end{equation} Hence, one can write the MF equation system for CTT as \begin{align}\label{mDef} \bar x_t = \left(\sum_{s=1}^m n_s\T^s \circ \D \right) (\bar x)(t) \teq( \M \bar x)(t). \end{align} \begin{rem}\label{rem:optinterp} It should be noted that the image by $\T^s$ of $q$, $\T^s(q)$, is the optimal state of the following deterministic LQR tracking optimal control problem, \begin{align} \label{optimalinterp} J(u)=&\int_0^\infty e^{-\delta t}\Big(\frac{q_t}{2} (x_t - z)^2 + \frac{q^{x_0}}{2}(x_t-\bar x_0)^2 + \frac{r}{2}u^2\Big) dt \nonumber\\ \text{s.t. } &\frac{d}{dt}x = -a^{s}(x-\bar x_0) + b^{s} u, \qquad x(0)=\bar x_0. \end{align} \end{rem} We need to restrict the operator $\mathcal{M}$ on an invariant subset of a Banach Space over which it is continuous. This allows us to apply a fixed point theorem, such as Schauder's theorem \cite{1973Ru}, and show the existence of a solution to the CTT MF equations. As shown later, the image of $\mathcal{M}$ is included in the set $\mathcal{G}:= \{x: x \in \b{C}_b[0,\infty) , \quad z \leq x(t) \leq x_0 \}$. Hence, one of the candidate subsets is $\mathcal{G}\subset(\b{C}_b[0,\infty),\|.\|_\infty)$. Indeed, the Banach space $(\b{C}_b[0,\infty),\|.\|_\infty)$ was used in the classical LQG MFG theory. We give however in the following subsection, an example where the continuity of $\mathcal{M}$ fails to hold on $\mathcal{G}\subset(\b{C}_b[0,\infty),\|.\|_\infty)$. As a result, existence of a fixed point is not guaranteed. Instead here, we propose a suitable norm that weakens the topology and enlarges the space in order to force continuity. This paves the way in Subsection \ref{sec:fpt} for our proof of the existence of a fixed point. \subsection{Failure of continuity under the sup-norm and suitable Banach space} \label{failurecont} We start by giving an explicit formula for the operator $\T^s \circ \Delta$. Solving equation \eqref{eqn:swatMFgen}, and replacing the solution in \eqref{eqn:barwatMFgen} give for all $\bar x \in \mathcal{G}$, \begin{align} &\left(\T^s\circ \Delta \right) (\bar{x})(t)= \phi^s(t,0)\bar{x}_0 +\frac{(b^s)^2}{r} z \int_0^t \phi^s(t,\eta) \pi_\eta^s d\eta \nonumber\\ & +a^s \bar{x}_0 \int_0^t \phi^s(t,\eta) d\eta+\frac{(b^s)^2}{r} (\bar{x}_0-z) \times \label{phidef}\\ &\int_0^t \phi^s(t,\eta) \int_\eta^\infty \psi^s(\tau,\eta) (-a^s \pi_\tau^s+ q^{x_0}) d\tau d\eta, \nonumber \end{align} with $\phi^s(t,\eta)=\exp\left(-\int_\eta^t(a^s+(b^s)^2\pi_\tau^s r^{-1})d\tau\right)$ and $\psi^s(t,\eta)=\exp\left(-\int_\eta^t(a^s+\delta+(b^s)^2\pi_\tau^s r^{-1})d\tau\right)$. Using the fact that $(b^s)^2 \pi_t^s r^{-1}$ is the derivative w.r.t. $t$ of $\int_\tau^t (b^s)^2 \pi_\eta^s r^{-1} d\tau $, one can show that \begin{equation}\label{op_M} \begin{aligned} &\left(\T^s\circ \Delta \right) (\bar{x})(t)=z+ \phi^s(t,0)(\bar{x}_0-z) \\ & +C^s\int_0^t \phi^s(t,\eta) \int_\eta^\infty \psi^s(\tau,\eta) d\tau d\eta. \end{aligned} \end{equation} where $C^s=((b^s)^2 r^{-1}q^{x_0} +(a^s)^2 + a^s\delta)(\bar x_0-z)$. The proof of the following lemma is given in Appendix \ref{gLemmas}. \begin{lem}\label{counterexample} Consider $g(x)=x$, $\bar{x}_0=1$, $y=0$ and $z=-1$. The operator $\mathcal{M} : \mathcal{G} \subset (\b{C}_b[0,\infty),\|\|_\infty) \to (\b{C}_b[0,\infty),\|\|_\infty)$ is not continuous. \end{lem} In the proof of Lemma \ref{counterexample} it is shown that the continuity of $\mathcal{M}$ does not hold because of the way the sup-norm evaluates the magnitude of a function. Indeed, the proof involves a sequence $\mathcal{M}(\bar x^n)$ which converges uniformly to $\mathcal{M}(y)$ when restricted to any \textit{finite} time horizon. But, since the sup-norm assigns a non-negligible value to any function with a non-negligible value at the tail, $\mathcal{M}(\bar x^n)$ does not converge to $\mathcal{M}(y)$ under this norm. Thus, we need a norm that suppresses the value of a function at the tail. A good candidate is the norm $\|x\|_k:=\sup\limits_{t\in [0,\infty)}|e^{-kt}x_t|$. We also need to enlarge the space $\b{C}_b[0,\infty)$ to get a Banach space under this new norm. Thus, we define the following function space, \[ \b{C}_{k}[0,\infty) =\{x: x \in \b{C}[0,\infty) | \sup\limits_{t\in [0,\infty)}|e^{-kt}x_t|<\infty \}, \] where $k>0$. We establish in Lemma \ref{lem_1} of Appendix \ref{gLemmas} some properties of the spaces $\b{C}_{k}[0,\infty) $, which are used in the remainder of this paper. \subsection{Fixed Point Theorem}\label{sec:fpt} Following the preliminary results, we present our fixed point existence theorem, \rsa{where the proof is given in Appendix \ref{proofs}.} We make the following technical assumption. \begin{hypot}\label{liptass} We assume that the function $g$ is Lipschitz continuous on compact subsets. \end{hypot} \begin{thm}\label{thmFixed} Fix $0< k <\min\limits_s a^s+\delta$. Under \ass{liptass}, the following statements hold: \begin{enumerate}[i.] \item for all $\bar x'$ and $\bar x''$ in $\mathcal{G}$, $\|\mathcal{M}(\bar x')-\mathcal{M}(\bar x'')\|_k \leq \lambda R_k \|\bar x'-\bar x''\|_k$, where $R_k$ is a positive constant that depends on $k$, and $\lambda$ is the Lipschitz constant of $g$ on $[-|\bar x_0-y|,|\bar x_0-y|]$. \item the map $\mathcal{M}:\mathcal{G} \subset (\b{C}_{k}[0,\infty) ,\|.\|_k) \to \mathcal{G} \subset (\b{C}_{k}[0,\infty) ,\|.\|_k)$ has at least one fixed point. \end{enumerate} \end{thm} \begin{rem} If $\lambda$ is small enough, then the operator $\mathcal{M}$ is a contraction, and there exists a \textit{unique} fixed point $\bar x \in \mathcal{G}$. The existence of a fixed point for \eqref{eqn:qwatMFgen}-\eqref{eqn:meanwatMFgen} in essence implies the existence of a Nash equilibrium for an infinite population game. \rma{At} the equilibrium, the prescribed control actions are the best responses for infinitesimal agents, and there is no unilateral profitable deviation. \end{rem} Finally, we establish that the infinite population Nash equilibrium of Theorem \ref{thmFixed} is in fact an $\epsilon$-Nash equilibrium when applied to the practical case of a large but finite population. The proof of this result is similar to the proof of Theorem 5.6 in \cite{2007HCM_TAC}, and is therefore omitted. \begin{thm}\label{thm:watMain_MF_thm} \emph{CTT MF Stochastic Control Theorem:} Assume that \ass{x0Ass} and \ass{liptass} hold. Then, the set $\{ (u^i)^\circ;1\leq N < \infty\}$, where $(u^i)^\circ$ is defined in \eqref{eqn:colOpt} for a fixed point $\bar x$ of $\M$, yields an $\epsilon$-Nash equilibrium in the sense that, for all $\epsilon>0$, there exists $N(\epsilon)$ such that for all $N \geq N(\epsilon)$ \begin{align*} J_i\left((u^i)^\circ, (u^{-i})^\circ\right)-\epsilon \leq \inf_{u^i \in\rsa{\U_i} }& J_i\left(u^i, (u^{-i})^\circ\right). \end{align*} \end{thm} \section{DESIRABLE NEAR FIXED POINT ALGORITHM}\label{num} Theorem \ref{thmFixed} states that there exists at least one fixed point of $\mathcal{M}$. However, it does not guarantee the existence of of a practically useful fixed point. A fixed point which is desirable in practice is a sustainable mean trajectory (i.e.replicated as the mean of best responses to the associated pressure field), such that its steady-state value is \textit{equal} to the target temperature $y$. In the following, we propose an algorithm that generates desirable approximate fixed points in case (i) $g(x)=\mu x $, and (ii) $g$ is a continuous function equal to $\mu(e^{\beta x}-1)$ when restricted to $[z-y,\bar x_0 -y]$, and constant outside this interval. Here $\beta$ and $\mu$ are positive scalars. In both cases, the function $g$ satisfies $|g(x)| \leq C(1+|x|)$, for some $C>0$, under Assumption \ass{liptass}. In the second case, the part of $g$ that is actually involved in determining the fixed points is $\mu(e^{\beta x}-1)$, since a fixed point always belongs to the set $\mathcal{G}$. The extension of $g$ by a constant function outside the interval $[z-y,\bar x_0 -y]$ is to force the inequality $|g(x)| \leq C(1+|x|)$ to hold everywhere. In the following, we denote the operators $\mathcal{M}$ and $\Delta$ by $\mathcal{M}_\mu$ and $\Delta_\mu$ to emphasize their dependence on $\mu$. We consider only the uniform case, i.e. a population with only one type of space heater. Thus, we omit the superscript $s$ in this section. The idea of the algorithm is to construct a family of mean trajectories indexed by $\mu$, $\{\bar x(\mu)\}_\mu$, such that $\lim\limits_{t \to \infty} \bar x_t(\mu)=\lim\limits_{t \to \infty} \mathcal{M}_\mu\big(\bar x(\mu)\big)_t=y$. Subsequently, we look for a $\mu_*$ that minimizes $\|\bar x(\mu)-\mathcal{M}_\mu\big(\bar x(\mu)\big)\|_{L_2}$. \rma{As a result,} the mean trajectory $\bar x(\mu_*)$ is approximately a fixed point, i.e. a near Nash equilibrium of the infinite population limit. Moreover, when the infinite population optimally responds to this mean, its mean $\mathcal{M}_{\mu_*}\big(\bar x(\mu_*)\big)$ is \rma{ guaranteed to converge to $y$} as $t \to \infty$. In order to get $\lim\limits_{t \to \infty} \mathcal{M}_\mu\big(\bar x(\mu)\big)_t=y$, the cost coefficient trajectory $q_t^y (\mu)= \Delta_\mu(\bar x(\mu))$ must converge to ${q_\infty^y}^*$, satisfying the following algebraic equations: \begin{align*} 0&= (-2a - \delta)\pi_\infty - b^2 r^{-1} \pi_\infty^2 +{q^y_\infty}^* + q^{x_0},\\ 0 &= (-a - \delta - b^2 \pi_\infty r^{-1}) s_\infty + (a \pi_\infty - q^{x_0})( \bar x_0 - z),\\ 0 & = (-a -b^2 \pi_\infty r^{-1} ) y -b^2 r^{-1} (s_\infty - \pi_\infty z) + a \bar x_0 , \end{align*} where $\pi_\infty,\, s_\infty$ denote the steady state values for Riccati and offset equations respectively. Solving the equation system for ${q^y_\infty}^*$ yields the unique solution: \begin{equation}\label{eqn:qInf} {q^y_\infty}^* = \frac{ [a (a+\delta) r + q^{x_0} b^2] }{b^2}\left ( \frac{\bar x_0 - y}{y - z} \right). \end{equation} Thus, it remains to find a family of mean trajectories $\{\bar x(\mu)\}_\mu$ that converge to $y$ as $t \to \infty$, and such that their corresponding cost coefficient trajectories converge to ${q^y_\infty}^*$ as $t \to \infty$. Indeed, the near Nash desirable mean trajectory will be sought for within that family. We construct the family as follows. We start by applying the cost coefficient trajectory $q_t^y=n_1 {q_\infty^y}^*$ for $t\in [0,t_0]$ and $q_t^y={q_\infty^y}^*$ for $t>t_0$, for some $n_1>1$ and $t_0>0$. This cost coefficient trajectory generates a mean trajectory $\bar x^{sup}=\mathcal{T}(q_t^y)$ which will constitute an upper boundary of our search set. Clearly, $\bar x^{sup}$ converges to $y$, in fact exponentially so, since the $q_t^y$ that generates it becomes constant after finite time $t_0$. Similarly, we get $\bar x^{inf}$, the lower boundary of the search set, by applying the same cost coefficient where we replace $n_1$ by a larger number $n_2$. $\bar x^{sup}$ is greater than $\bar x^{inf}$ since it is generated by a cost coefficient lower than that of $\bar x^{inf}$, thus corresponding to a lower pressure field \cite{Bitmead1991}. Afterward, we define $\mu_{sup}={q_\infty^y}^*/\lim\limits_{t \to \infty}\Delta_1(\bar x^{sup})$, with the integral in the denominator guaranteed to remain finite, because of the exponential convergence of the mean to the target. Thus, by construction, $q^{sup}=\Delta_{\mu_{sup}}(\bar x^{sup})$ converges to ${q_\infty^y}^*$. Similarly, we define $\mu_{inf}$, such that $q^{inf}=\Delta_{\mu_{inf}}(\bar x^{inf})$ converges to ${q_\infty^y}^*$. If we choose $t_0$ small, $n_1$ and $n_2$ close to one, then $\bar x^{inf}$ and $\bar x^{sup}$ undershoot the target temperature $y$ for a small interval of time and climb back to $y$. As a result, the negative parts of the integrals $\int_0 ^\infty g(\bar x^{inf} -y )dt$ and $\int_0 ^\infty g(\bar x^{sup} -y )dt$ do not outweigh the positive parts. In this way, for any $\mu>0$, if $\bar x^{inf}\leq \bar x \leq \bar x' \leq \bar x^{sup}$, then $\lim\limits_{t\to \infty}\Delta_\mu (\bar x) \leq \lim\limits_{t\to \infty}\Delta_\mu (\bar x') $. In particular, $\mu_{sup} < \mu_{inf}$. Hence, for each $\mu_{sup}<\mu<\mu_{inf}$, $\Delta_\mu(\bar x^{sup})$ converges to a value greater than ${q_\infty^y}^*$, while $\Delta_\mu(\bar x^{inf})$ to a value lower than ${q_\infty^y}^*$. We define for each $f\in [0,1]$ the trajectory $\bar x^f = (1-f) \bar x^{inf}+f\bar x^{sup}$. Using the continuity of $\lim\limits_{t\to \infty}\Delta_\mu (\bar x^f)$ with respect to $f$, one can use the dichotomy method to find for each $\mu_{sup}<\mu<\mu_{inf}$, a $f^\mu \in [0,1]$, equivalently, a convex combination $\bar x(\mu)=\bar x^{f^{\mu}}$ of $\bar x^{sup}$ and $\bar x^{inf}$, such that $\Delta_\mu (\bar x(\mu))$ converges to ${q_\infty^y}^*$. This gives the desired family of mean trajectories. We summarize the numerical scheme in Algorithm \ref{FPalgorithm}. \begin{algorithm}[H] \caption{Desirable near fixed point algorithm} \label{FPalgorithm} \begin{algorithmic}[1] \State Initiate $n_2>n_1>1$, $t_0,d\mu,e_1,e_2,\gamma$ \Procedure{Generation of $\bar x^{sup}$ and $\bar x^{inf}$}{} \State Apply $q_t^y=n_1 {q_\infty^y}^*$ for $t\in [0,t_0]$ and $q_t^y={q_\infty^y}^*$ for $t>t_0$, and generate $\bar x^{sup} = \mathcal{T}(q_t^y)$. \State Apply $q_t^y= n_2{q_\infty^y}^*$ for $t\in [0,t_0]$ and $q_t^y={q_\infty^y}^*$ for $t>t_0$, and generate $\bar x^{inf} = \mathcal{T}(q_t^y)$ \State $\mu_{sup}=\frac{{q_\infty^y}^*}{\lim\limits_{t \to \infty}\Delta_1(\bar x^{sup})}$ and $\mu_{inf}=\frac{{q_\infty^y}^*}{\lim\limits_{t \to \infty}\Delta_1(\bar x^{inf})}$ \EndProcedure \State Initiate $\mu$ between $\mu_{sup}$ and $\mu_{inf}$ \Procedure{Gradient descent to compute $\mu_*$}{} \While{ $err_1>e_1$ } \For{$i=\mu$ and $i=\mu+d\mu$} \State $f^m=0$, $f^M=1$, $\bar x^m = \bar x^{inf}$, $\bar x^M = \bar x^{sup}$ \Procedure{Computation of $\bar x(i)$}{} \While{$err_2>e_2$} \State $f=(f^m+f^M)/2$ \State $\bar x(i)=f \bar x^{m}+(1-f)\bar x^{M}$ \If{$\lim\limits_{t \rightarrow \infty} \Delta_i(\bar x^f) \geq {q_\infty^y}^*$} \State $f^M=f$, $\bar x^M=\bar x(i)$ \Else \State $f^m=f$, $\bar x^m=\bar x(i)$ \EndIf \State $err_2=|\lim\limits_{t \rightarrow \infty} \Delta_i(\bar x(i)) - {q_\infty^y}^*|$ \EndWhile \EndProcedure \EndFor \State $\nabla=\big(\|\bar x(\mu+d\mu)-\mathcal{M}_{\mu+d\mu}\big(\bar x(\mu+d\mu)\big)\|_{L_2} -\|\bar x(\mu)-\mathcal{M}_{\mu}\big(\bar x(\mu)\big)\|_{L_2} \big)/d\mu$ \State $\mu=\mu-\gamma \nabla$ \EndWhile \State $err_2=|G|$ \EndProcedure \State Output: $\mu_*=\mu$ and $\bar x(\mu)$ a desirable near fixed point \end{algorithmic} \end{algorithm} \section{Introduction}\label{intro} Since the seventies, load management via direct load control and its predominantly price induced variant, demand response, have been considered as tools for shaping the load demand in power systems so as to achieve peak load shaving and valley filling \cite{mitchell1977electricity}. Such measures help defer generation and capacity expansion, and operate generators in the vicinity of their most efficient operating point. However, the seriousness with which demand response (or load dispatch) are being considered is a relatively recent phenomenon. It is mainly caused by the increasing share of intermittent renewable energy sources (such as wind and solar) in the energy mixes of power producers worldwide \cite{calenergycom,worldwatch,nytimes}. The ensuing variability and diminished predictability of generation has indeed put strong pressures on the ability of independent system operators to maintain grid stability and insure reliable power delivery and transmission to consumers in their power pool \cite{hirth2013control,ackermann2015integrating}. One of the striking characteristics of so-called smart grids is an ability to rely on both an increasingly pervasive communication network, and an improved electricity distribution network, to shift the responsibility of balancing electricity demand with power generation from being solely a generation side task, to one shared increasingly by both producers and customers. Furthermore, the role of consumers is gradually changing in that they can also contribute to power generation or delivery, mostly through rooftop solar panels, electric batteries in dwellings or electric vehicles (EV's)\cite{el2016prospect}. \rma{ In that context, pricing or control dictated coordination of certain deferrable classes of loads (ex. pool pump loads, or energy storage capable loads such as electric space heaters or air conditioners) to compensate for fluctuations in intermittent renewable} \ark{energy} \rma{has become increasingly attractive relative to expensive battery storage alternatives. Dispersed energy storage for frequency regulation in the presence of wind energy is investigated in \cite{2009Cal}. Pricing based demand response of large commercial buildings is analyzed in \cite{mathieu2011variability}, while state estimation for the direct control of thermostatic populations is considered in \cite{mathieu2013state}; domestic heating systems are employed as heat buffers in \cite{2011TSAR_CDC}, while a coordinated randomized control of Florida pool pumps is considered in \cite{meyn2015ancillary}, and the related state estimation problems are studied in \cite{chen2017state}. A decentralized mean field based charging control strategy for large populations of plug-in electric vehicles (PEVs) is presented in \cite{ma2013decentralized}.} \rma{The resulting drastically modified electric grid landscape has produced: (a) \textit{new modeling requirements} as power system operators will increasingly need bottom up type models to anticipate the aggregate behavior of customer loads to real time demand response pricing signals, in particular synchronization effects and the ensuing load rebound (see \cite{muratori2016residential}); or the effects of direct control signals in load dispatch approaches; (b) \textit{new large scale load control challenges}.} \rma{This is particularly true when residential type load controls, or EV charging coordination are considered for demand dispatch, as the sheer number of control points (possibly in the millions) needed to achieve significant system impact make it essentially impossible to monitor centrally every load, and compound computational challenges; in that case, effective forms of hierarchical coordination with decentralized/distributed controls are most advisable (see \cite{callaway2011achieving,meyn2015ancillary}). They allow scalability as computations become parallelized, provide more resilience to communication failure, an increased level of privacy, and a guarantee that local constraints can be locally satisfied. Decentralized control is also consistent with the multi-agent framework advocated for smart grids and microgrids in \cite{mcarthur2007multi,hasanpor2017transactive}}. As a result, on the modeling front, the approaches inspired from statistical physics, which start from physically based stochastic microscopic descriptions of loads and build via ensemble analysis macroscopic aggregate descriptions, and started in the eighties (\cite{1985MC_TAC,1994LM}), are making a strong comeback (see \cite{2009Cal,2013TLW,chen2017state,ma2013decentralized,2013ZLCK_PES}). On the control theoretic front, game theory has witnessed a surge. More importantly though, one has to note the relatively novel development of so-called mean field games (MFG's) (\cite{2006LL,2006HMC_CIS,2007HCM_TAC,Caines2017}): they combine in effect the \rma{bottom-up} modeling power of statistical physics with the decentralized control theoretic potential of game theory. They are at their most basic level a game theory of large groups of class wise interchangeable agents, whose individual influence on the group asymptotically vanishes with the size, thus leading in the limit, under Nash equilibrium conditions to (i) predictability of the group behavior via the law of large numbers, (ii) decentralized individual control policies with a dependence on local state and statistical information on the agents' dynamic and cost parameters, as well as their initial states distribution. \rma{MFG approaches have found applications in numerous areas including economics (see\cite{7526095} and the references therein), and engineering systems in general including CDMA communication systems, virus propagation in computer systems, crowd dynamics, traffic analysis, etc. (see \cite{ElectronEng-01-00018} for a survey)}. In this paper, we intend to illustrate how MFG's constitute a natural tool in aggregator based load dispatch, with the particular class of thermostatic electric heating loads aimed at. An aggregator is considered as a technically equipped broker, acting on behalf of a pool of customers to coordinate their loads as a virtual battery on the energy markets. Her role is to rely on a regularly updated aggregate load model to assess the time dependent load absorption or relief potential of the load pool under its responsibility, and to compute and send piecewise constant mean pool energy content targets which are feasible under comfort and security constraints, and which will result in overall economic gains for the pool, and indirectly, the quality of the environment. A MFG based computation of individual load control strategies will lead to decentralized locally computable and implementable controls thus achieving computational scalability, with minimal communication requirements, local compliance with comfort and security constraints, and as we shall see, a size of device contribution in direct relation to the device current ability to contribute. Besides the application context, on the technical level, the fundamental novelty here is the introduction of integral control in the cost coefficients of what is otherwise an instance of a linear quadratic Gaussian MFG \cite{2007HCM_TAC}. The integral control in the cost coefficient introduces with it both the potential benefits of robustness of integral controllers to inadequate modeling and disturbances which has been so successfully leveraged in applications \cite{ortega2002nonlinear}, and the unfortunate risk of a cost coefficient going unbounded. After setting up our microscopic controlled device model and defining a cost function which weighs the individual's reluctance to contribute against the objective of having to meet the global aggregate target, we establish the existence of an asymptotic Nash equilibrium on an appropriately defined Banach space. This equilibrium may be on target (desirable equilibrium), or may correspond to an undesirable equilibrium (a cost coefficient going unbounded). We then develop an algorithm to reliably compute a near Nash strategy corresponding to a desirable equilibrium. Numerical results illustrate the flexibility of the approach and the robustness to modeling errors conferred by the integral control structure. The rest of the paper is organized as follows. In Section \ref{hm} we introduce the model that will be used throughout the paper and propose our collective target tracking mean field formulation. In Section \ref{fpa} we present a fixed point analysis for the equation system characterizing the limiting mean field, and we develop our $\epsilon$-Nash Theorem indicating that an approximate Nash Equilibrium is attained. We provide in Section \ref{num} an algorithm that generates approximate desirable fixed point mean trajectories. Lastly, in Section \ref{sec:sim}, we provide simulation results together with comparisons to a prevailing target tracking control formulation. The following notation is defined; the set of nonnegative real numbers is denoted by $\R_+$. The set $\b{C}[0,\infty)$ denotes the family of all continuous functions on $[0,\infty)$, $\b{C}_{l}[0,\infty) =\{x: x \in \b{C}[0,\infty),\exists k_0>0,0\leq x(t)\leq k_0t, \forall t\geq 0 \}$, $\b{C}_b[0,\infty)=\{ x:x\in \b{C}[0,\infty),\sup_{t\geq 0} | x_t | < \infty\}$, and for any $x\in\b{C}_b$, $\lVert \cdot \rVert_\infty$ denotes the supremum norm: $\lVert x \rVert_\infty\teq \sup_{t\geq 0} | x_t |$. \section{ELECTRIC SPACE HEATER MODELS}\label{hm} In the following, we first introduce the model for space heating dynamics that will be employed throughout the paper. Subsequently, a \emph{collective target tracking mean field} control model is defined together with the individual control actions and the corresponding mean field system of equations is developed. \begin{figure}[th] \centering \begin{circuitikz} \draw (0, 0) node[left]{$x^{out}$} to [R=$\frac{1}{U_a}$] (4,0) node[right]{$x^{in}$} ; \draw [C=$C_a$] (4,0) to (4,-1.7) ; \draw (4,-1.7) to (0,-1.7) to (0,0); \draw [I = $Q_h$] (4,3) to (4,0); \draw (4,3) to (0,3) to (0,0); \draw [I = $dw$] (0.8,1.7) to (3.2,1.7); \draw (0.8,1.7) to (0.8,0); \draw (3.2,1.7) to (3.2,0); \end{circuitikz} \caption{Equivalent thermal parameter (ETP) model of a household} \label{etp} \end{figure} We employ a one dimensional equivalent thermal parameter (ETP) model (see Fig.\ \ref{etp}) \cite{1978So} to describe the thermal dynamics of a single household, which is written as \begin{equation}\label{eqn:etp} d x_t^{in} = \frac{1}{C_a} [ -U_a (x_t^{in}-x^{out}) + Q_h(t) ]dt + \sigma dw_t, \end{equation} where $t\geq 0$, $x^{in}$ is the air temperature inside the household, $x^{out}$ is the outside ambient temperature, $C_a$ is the thermal mass of air inside, $U_a$ is conductance of the walls and $Q_h$ is the heat flux from the heater. Note that $w_t,\, t\geq 0,$ is a standard Wiener process defined on $\probs$ to reflect the noise on the system caused by random processes of heat gain and loss due to customer activity within the dwellings, and $\sigma$ is its volatility term. For brevity of notation, the system for heater $\mathcal A_i,\,1 \leq i \leq N,$ is equivalently written as \begin{equation}\label{eqn:heatdyn} dx_t^i=[-a^i (x_t^i - x^{out,i}) + b^i u_t^i] dt + \sigma dw_t^i, \end{equation} where $x^i \teq x^{in,i}$ and $u^i \teq Q_h^i$ for $1 \leq i \leq N$; $a^i=U_a^i/C_a^i$ and $b^i=({C_a^i})^{-1}$. $\{w^i,1 \leq i \leq N\}$ are $N$ independent Wiener processes on a probability space $(\Omega,\mathcal{F},\mathbb{P},\{\mathcal{F}_t\}_{t \in [0,T]})$. $\{\mathcal{F}_t\}_{t \in [0,T]}$ is the augmented filtration of $\{\sigma(x^i_0,w^i_s,0 \leq s \leq t,1 \leq i \leq N)\}_{t\in [0,T]}$ \cite[Section 2.7]{1988KS}, where $x^i_0$, $1 \leq i \leq N$, are the initial temperatures assumed i.i.d. with distribution $P_0$ and finite second moments $\mathbb{E} |x^i_0|^2 < \infty$, and also independent of $\{w^i,1 \leq i \leq N\}$. Note that this model is similar to the model given in \cite{1985MC_TAC}, where the thermostat control is exchanged with a linear control. We consider that users ``naturally" would like their devices to stay at their initial temperatures (normally attained via thermostatic action and before the intervention of the power utility control center). Thus, we have reformulated the control effort as the signal required to make them deviate from that initial temperature; more precisely, the control effort to stay at the initial temperature is considered free and will not be penalized by the cost function to be defined. The corresponding dynamical equation is written as \begin{equation}\label{eqn:heatdynU} dx_t^i=[-a^i (x_t^i - x^{out,i}) + b^i (u_t^i+u^{free,i})] dt + \sigma dw_t^i, \end{equation} where $u^{free,i} \teq {(b^i)}^{-1}a^i(x_0^i - x^{out,i})$. \begin{hypot}\label{x0Ass} \rsa{We assume that the mean temperature is bounded from above and below by comfort levels; i.e., $l \leq \E x_0^i \leq h$.}\\ \rma{Note that $l$ and $h$ respectively represent the lowest and highest temperatures considered tolerable in the controlled dwellings (see Fig.3 below). These numbers are to be initially agreed upon with the participants in the control program (In our simulations, we took them to be respectively 17 and 25 degrees celsius).}\\ We assume a population of $m$ types of agents, that is, the vector of individual parameters $\theta^i:=(a^i,b^i,x^{out,i})$ takes values in a finite set $\{\Theta_1,\dots,\Theta_m\}$, which does not depend on the size of the population $N$. The empirical probability measure of the sequence $\{\theta^i\}_{i=1,\dots,N}$ is denoted by $P^N_\theta(\Theta_s) = 1/N \sum_{i=1}^N 1_{\{\theta^i = \Theta_s \}}$ for $s=1,\dots,m$. We assume that $(P^N_\theta(\Theta_1),\dots,P^N_\theta(\Theta_m))$ converges to $P_\theta=(n_1,\dots,n_m)$, as $N \to \infty$, where $n_s>0$ for all $1 \leq s \leq m$. \end{hypot} \subsection \rma{General Characteristics of a Desirable Load Coordination Scheme }\label{sec:Charac}} \rma{In this subsection, we briefly discuss the important characteristics of a desirable load coordination scheme by the aggregator. Given the potentially very large number of residential loads that the aggregator needs to coordinate to form a virtual battery of sufficient size, it is impossible to assume it will be able to centrally observe all loads. However, the aggregator can be assumed to have the ability to broadcast common signals such as a temperature target $y$. Thus, a first essential characteristic of the control scheme must be \textbf{(i) Decentralization}. This is because in the absence of local state observation and given the uncertain/stochastic nature of individual loads, open loop control signals could send regularly individual temperatures at undesirable levels, thus potentially causing customer withdrawals from the aggregator's power pool. \textit{A local controller can always use the local information to insure that comfort/security constraints are not violated}. Another important feature is that the resulting control actions should lead quickly to the desired result with least disturbance to the customer, again to avoid potential customer withdrawals. This can be summarized as \textbf{(ii) Minimality of forced temperature excursions}. A third feature which is desirable but not essential is the minimization of the signalling overhead to achieve the objective, and summarized as \textbf{(iii) Parsimony of communications.} In the following, we discuss the advantages, yet shortcomings of a simple, intuitive, standard LQG tracking controller which would have every device track the desired mean temperature level $y$, and later compare its would be performance to that of our proposed MFG Based integral controller. } \subsection \rsa{Advantages and Shortcomings of a }Standard LQG Tracking Controller}\label{sec:clasTrack} \rma{Assuming the aggregator has set the objective of attaining a given population mean temperature target $y$, a simple and effective control scheme for doing so is to broadcast $y$ to all devices, and have each solve an LQG based control scheme for tracking level $y$. For example, the individual cost function of devices would be as follows:} \begin{equation}\label{eqn:clasLQGcost} J_i^{LQ}(u^i) = \E \int_0^\infty e^{-\delta t} \left [ ( x_t^i - y )^2{q}^{LQ} + (u_t^i)^2 r \right ] dt. \end{equation} \rma{Clearly, such a control scheme, besides being very simple to implement, meets the criteria \textbf{(i)} and \textbf{(iii)} above, i.e. it is both decentralized and communications parsimonious. However, the fundamental shortcoming of such a controller is that, while the aggregator is interested only in having the mean population state settle at target $y$, this controller sends instead \textit{all devices} to that target. This not only maximizes individual user temperature excursions, thus falling short on criterion \textbf{(ii)} above, but furthermore will result in general in a slow controller since some devices are "undoing" the contribution of other devices (some devices are heating further, while others are cooling in order to reach a mean state $y$.) } \rsa{In the coordination scheme we propose next, instead of each agent state trying to track a common target $y$, the individual cost structures (see \eqref{eqn:modCost} below) are formulated such that ultimately, it is only \textit{the mean} of the population trajectories that tracks the desired target. In the resulting MFG, the novelty is that the mean field effect is mediated by the \emph{quadratic cost function parameters} under the form of an integral error. The resulting concept will be called \textit{collective mean target tracking}.} \subsection{The Collective Mean Target Tracking Model}\label{sec:cttmfm} We employ the dynamics for the heaters given in \eqref{eqn:heatdyn}, \rma{with the input redefined based on \eqref{eqn:heatdynU} }. \rma {Following a prescriptive game theoretic view of the coordination problem,} the infinite horizon discounted cost function for agent $\mathcal A_i,1 \leq i \leq N$, is defined as: \begin{align}\label{eqn:modCost} J_i(u^i,u^{-i}) = &\E \int_0^\infty e^{-\delta t} \Big [ \frac{q^{y}_t}{2}( x_t^i - z )^2 \nonumber \\ &+ \frac{q^{x_0}}{2}( x_t^i - x_0^i )^2 + \frac{r}{2} (u_t^i)^2 \Big ] dt. \end{align} \rma{ We now discuss the role of each term in the integrand in \eqref{eqn:modCost}, proceeding from left to right. $z$ is actually either one of the limiting temperatures $l$ and $h$ referred to in Assumption \ass{x0Ass}. $z$ is set to $l$ if the objective is overall dwellings power/ energy decrease, or $h$ if instead it is overall increase. The value of $z$ will thus define the direction (up or down) according to which individual dwelling temperatures will drift. However, the pressure to move in that direction is dictated by the coefficient $q^y_t$, defined below as the integral of an increasing function of the deviation between the average state of agents and a temperature target $y$.} \rma{Thus: \begin{equation}\label{q:eqn} q^y_t = \left\lvert \int_0^t g(x^{(N)}_\tau - y) d\tau \right\rvert,\quad t\geq 0, \end{equation} where $g$ is a real increasing continuous function on $\mathbb{R}$ with $|g(x)| \leq C(1+ |x|)$ for some $C>0$, $\forall x\in \mathbb{R}$, $y$ is the main control center dictated mean target constant level, and $x^{(N)} \triangleq (1/N) \sum_{i=1}^N x^i$. Note that the time varying coefficient $q^y_t$ is \textit{the only channel through which the mean field} (mean dwellings temperature in our case) \textit{influence is felt by individual agents}.\\ The target $y$ is decided upon by the aggregator. The latter uses a macroscopic aggregate model of the dwellings to evaluate their current energy storage, and their short term power/ energy release or increase potential so as to make bids on the energy market. Alternatively, in a microgrid for example, the aggregator could also be buiding an optimal dwellings energy content schedule, based on forecasts of the intermittent renewable power that will be available in the microgrid. We further note that energy content targets are equivalent to mean temperature targets.\\ While the first term was introduced to mathematically capture the aggregator's objective of producing upwards/downwards drift of average dwellings temperature, the next term will simulate resistance of individuals to changes in their initial temperature at the start of the control period. Indeed, the associated cost increases whenever $x^i_t$ moves away from its initial value $x_0^i$. Note that this introduces a further element of heterogeneity amongst agents. Finally, the last term penalizes the control effort, again redefined (recall \eqref{eqn:heatdynU}) as the agent effort involved in moving away from $x_0^i$. In summary, while the first term favors the aggregator, the next two terms in the cost integrand favor the individual agents. } The justification for the above cost function is that by pointing individual agents towards what is considered as the minimum (or maximum) comfort temperature $z$, it dictates a global decrease (or increase) in their individual temperatures. This pressure persists as long as the differential between the mean temperature and the mean target $y$ is high. The role of the integral controller is to mechanically compute the \emph{right} level of penalty coefficient $q^y_t,t \in [0,\infty),$ which, in the steady-state, should maintain the mean population temperature at $y$. When this happens, individual agents reach themselves their steady states (in general different from $y$ and closer to their initial diversified states than standard LQG tracking would dictate). Furthermore, if the \rsa{mean state of }agents is observed, this integral control adds robustness to model imperfections or inaccurate ambient temperature estimation. \rma{ Note that other approaches to robustness in a MFG context are possible \cite{huang2017robust,wang2017social}}. \rma{ However, they could not produce exact tracking of targets as integral control based algorithms can. } For each heater $i$, the set of admissible control laws is the set \rsa{$\mathcal{U}_i$} of $\mathcal{F}_t-$progressively measurable \rsa{$u^i_t$} such that \rsa{$\mathbb{E}\int_0^\infty e^{-\frac{2\delta}{3}t}|u_t^i|^2dt<\infty$}. It should be noted that whenever \rsa{$(u^i,u^{-i}) \in \prod_{i=1}^N\mathcal{U}_i$}, then $J_i(u^i,u^{-i})<\infty$. The $2\delta/3$ in the definition of \rsa{$\mathcal{U}_i$} is to force the term with $q_t^y(x_t^i-z)^2$ in the cost to be finite. In order to derive the limiting infinite population MF equation system, we start this time assuming a given (albeit initially unknown) cost penalty trajectory $q^y \in \b{C}_{l}[0,\infty) $ and constant $q^{x_0}$. We show later in Lemma \ref{lem_3} that the candidates $q^y$ actually belong to $\b{C}_{l}[0,\infty) $. Given $q^y$ and $q^{x_0}$, individual agents $\mathcal A_i,\, 1\leq i \leq N$, solve a standard target tracking LQG problem \cite{1989AM} with time varying cost coefficient. Using techniques similar to those used in \cite[Lemma A.2]{2010Hu_SIAM}, one can show that the optimal control law of this LQG problem is, \begin{equation}\label{eqn:colOpt} (u^i_t)^\circ=-b^i r^{-1} (\pi^i_t x^i_t + \alpha^i_t - \pi^i_t z), \quad t\geq 0, \end{equation} with $\pi^i$ and $\alpha^i$ respectively the unique solution and unique bounded solution of \begin{align} \label{colPi:eqn}&\frac{d\pi_t^i}{dt} = (2a^i+\delta)\pi_t^i + \frac{{(b^i)}^2}{r} (\pi_t^i)^2 - q^y_t - q^{x_0},\\ \label{colS:eqn}& \frac{d\alpha^i_t}{dt} = (a^i + \delta + \frac{{(b^i)}^2}{r} \pi_t^i) \alpha^i_t - (a^i \pi_t^i - q^{x_0})(x_0^i-z). \end{align} The calculation of the unknown $q^y_t,\, t\geq 0,$ is obtained by requiring that $q^y_t$ be such that when individual agents implement their associated best responses, they collectively replicate the posited $q^y_t$, trajectory. This fixed point requirement leads to the specification below of the collective target tracking MF equation system. In the remainder of this paper a superscript $s$ refers to a heater of type $s$ . \begin{defn} \emph{Collective Target Tracking (CTT) MF Equation System \rma{refers to the following coupled system of integro-differential equations on $t \in [0,\infty)$}:} \begin{align} q^y_t &= \left\lvert \int_0^t g(\bar x_\tau - y) d\tau \right\rvert, \label{eqn:qwatMFgen}\\ \frac{d\pi^s_t}{dt} &= (2a^s +\delta)\pi^s_t + \frac{(b^s)^2}{r} ({\pi^s_t})^2 - q^y_t - q^{x_0} \label{eqn:piwatMFgen}\\ \frac{d\alpha^s_t}{dt} &= (a^s + \delta + \frac{({b^s})^2}{r} \pi^s_t) \alpha^s_t - (a^s \pi^s_t - q^{x_0})(\bar x_0 - z)\label{eqn:swatMFgen}\\ \frac{d\bar x^s_t}{dt} & = -(a^s +\frac{({b^s})^2}{r} \pi^s_t ) \bar x^s_t -\frac{({b^s})^2}{r} (\alpha^s_t -\pi^s_t z)+ a^s \bar x_0 \label{eqn:barwatMFgen}\\ \bar x_t & = \sum_{s=1}^m n_s \bar x_t^{s},\label{eqn:meanwatMFgen} \end{align} \end{defn} $1\leq s \leq m$, \rsa{where $n_s$ is defined below Assumption A\ref{x0Ass}}. \rsa{Equation \eqref{eqn:piwatMFgen} is the Riccati equation that corresponds to the LQG optimal tracking problem \rma{solved by an} agent of type $s$.}The \rma{solution} of the collective target tracking (CTT) MF equation system \eqref{eqn:qwatMFgen}-\eqref{eqn:meanwatMFgen} is obtained offline locally by each agent only based on statistical information $P_\theta=(n_1,\dots,n_m)$ and $P_0$, \rma{assumed } available at the start of the control horizon. In theory, the control scheme is fully decentralized; i.e., no communication \rma{needs to take} place among the controllers throughout the horizon. In practice however, because of the anticipated prediction error accumulations over time, \rma{it is more advisable} to readjust periodically the control laws over long intervals based on aggregate \rma{ system measurements based on a limited set of randomly sampled agents} (see \rsa{Fig.} \ref{ca}). \rma{As we shall see in Section \ref{sec:sim}, this also helps robustifying the control performance against mismodeling}. Note that the MF Equations for this model are significantly different from (4.6)-(4.9) in \cite{2007HCM_TAC} which is amenable to analysis within a linear systems framework, while uniqueness of the fixed point is obtained via a sufficient contraction condition. In contrast, system \eqref{eqn:qwatMFgen}-\eqref{eqn:meanwatMFgen} is fundamentally nonlinear (because of the form of $q^y_t$), and \rma{$q^y_t$} itself could indeed become unbounded. Special arguments have to be developed for the analysis. \tikzstyle{block} = [draw, rectangle, minimum height=3em, minimum width=6em] \tikzstyle{input} = [minimum height=3em, minimum width=6em] \tikzstyle{output} = [minimum height=.01em, minimum width=.01em] \begin{figure} \centering \begin{tikzpicture}[auto, node distance=4cm,>=latex'] \footnotesize \node [block] (c1) {Controller 1}; \node [input, below of = c1, node distance=1cm] (c2) { \vdots }; \node [block, below of = c2, node distance=1cm] (cN) {Controller $N$}; \node [block, right of = c1, node distance=2.7cm] (w1) {space heater 1}; \node [block, right of = cN, node distance=2.7cm] (wN) {space heater N}; \node [output, right of = w1, node distance=2cm] (o1) {}; \node [output, right of = wN, node distance=2cm] (oN) {}; \node [draw,dashed,inner sep=.35cm,rectangle,fit=(c1) (c2) (cN) (w1) (wN) (o1) (oN)] (pop) {}; \node [block, above of = pop, node distance = 3cm] (s) {Scheduler}; \path (c1) edge[->] node {$u^1_t$} (w1); \path (cN) edge[->] node {$u^N_t$} (wN); \path (w1) edge[->] node {$x^1_t$} (o1); \path (wN) edge[->] node {$x^N_t$} (oN); \draw [->] ($(w1.east) + (.5cm,0)$ ) -- ++(0,-.75) -| (c1.south); \draw [->] ($(wN.east) + (.5cm,0)$ ) -- ++(0,-.75) -| (cN.south); \draw [->] ($(s.west)+(0,-.1cm)$) -| ($(pop.west) + (-1.0cm,.6cm)$) -- node {$x^{(N)}_0$} ($(pop.west) + (0,.6cm)$) ; \draw [->] ($(s.west)+(0,.1cm)$) -| ($(pop.west) + (-1.2cm,-.6cm)$) -- node {$y[0,T]$} ($(pop.west) + (0,-.6cm)$) ; \draw [->] (pop.east) -- node {$ x^{(N)}_t$} ($(pop.east) + (0.7cm,0)$) |- (s.east); \end{tikzpicture} \caption{Control Architecture in Practice} \label{ca} \end{figure} \section{SIMULATIONS}\label{sec:sim} For our numerical experiments we simulate a population of 200 space heaters. We consider a uniform population of heaters; adopt a single layer ETP model as given in \eqref{eqn:etp}, where the capacitance $(C_a)$ and conductance $(U_a)$ parameters \cite{param} are chosen to be 0.57 kWh/\degree\ and 0.27 kW/\degree\ respectively, the ambient temperature is set to -10 \degree, and the volatility parameter is set to 0.15 $\degree/\sqrt{h}$. The initial temperatures of the heaters are drawn from a Gaussian distribution with a mean of 21\degree\ and a variance of $1$. The cost function parameters $\delta$, $q^{x_0}$ and $r$ are uniformly chosen to be $0.001$, $200$ and $10$ respectively. We consider two scenarios. In the first scenario the heaters are controlled by the mean-field controllers \eqref{eqn:colOpt}, while in the second scenario they apply, for comparison purposes, the LQG controllers of Section \ref{sec:clasTrack}. We limit the size of computations by considering a finite time horizon of length $T=3$ hours. For the mean field game based controller, we use the function $g(x)=\mu_* x$, where $\mu_*=1484$ is computed using the algorithm of Section \ref{num}. \rsa{Fig.} \ref{fixedpoint} shows the Near Nash Trajectory (NNT), i.e. near fixed point desirable temperature trajectory $\bar x$ generated by the algorithm of Section \ref{num}, the resulting Theoretical Output Mean Trajectory (TOMT) $\mathcal{M}(\bar x)$ and the Empirical Average Temperature (EAT) of the $200$ space heaters when they optimally respond to $\bar x$ by applying the mean-field controllers \eqref{eqn:colOpt}. As shown in the figure, the three trajectories are approximately identical and converge to the target temperature $y=20\degree$. This figure illustrates also the EAT under the LQG controllers. It should be noted that both approaches, MF and LQG, succeed in forcing the empirical average space heater temperatures to converge to the target temperature. But, as shown in \rsa{Fig.} \ref{samples} the user disturbance is much greater in the LQG case than it is in the mean field case. Indeed, this figure, which reports the temperature profiles of $10$ heaters when they apply respectively the mean field and LQG controllers, shows that all the temperatures must move to $y$ in the LQG case, while in the mean field case the temperatures stay close to their initial values, and individual devices contribution is in direct relation with their initial energy content. Next, we consider the case where $g(x)=\mu_*(e^{3x}-1)$, with $\mu_*=218$ is determined by the algorithm of Section \ref{num}. As shown in \rsa{Fig.} \ref{meanexp}, the TOMT reaches for the first time the target faster than the case with linear $g$, but needs more time to resettle on $y$. This is due to the fact that when $\bar x > y$, the dominant part of $g$ is the exponential. This creates a high pressure field towards $y$. When $\bar x$ undershoots $y$, the linear part of $g$, the scalar $-1$, becomes the dominant part, and the mean climbs slowly towards $y$. Finally, we consider the case where the heaters have biased a priori estimates of the initial mean and ambient temperatures. We assume that the estimates are respectively equal to $21\degree$ and $-10\degree$, while the actual values are respectively equal to $21.5\degree$ and $-11\degree$. If the heaters apply the mean field controllers with linear $g$, which are computed based on the estimates, then the EAT will not converge to the target temperature $y=20\degree$. To compensate the estimation error, the heaters apply at the beginning the mean field controllers. When the EAT reaches a steady state, the controllers switch to the steady-state mean field controllers, i.e. \eqref{eqn:colOpt} where the coefficient $q_t^y$ is replaced by a constant equal to the current $q_t$ computed using the EAT. This constant is updated continuously, and the controller recomputed at each instant. The results are illustrated in \rsa{Fig.} \ref{robust}. The mean field controllers are applied between $t=0$ and $t=0.75$ hours. Because of the biased mean and ambient temperatures estimates, the EAT reaches a steady-state value equal to $20.5\degree$ at $t=0.75$ hours. At this instant, the heaters switch to the steady-state mean field controllers. As a result, the controllers compensate the estimation error and force the EAT to converge to $y=20\degree$. \begin{figure}[h] \centering \includegraphics[width=0.9\hsize,height=0.7\hsize]{figures/figure_mean.pdf} \caption{NNT and EAT in the mean-field (linear $g$) and LQG control cases} \label{fixedpoint} \end{figure} \begin{figure}[h] \centering \includegraphics[width=0.9\hsize,height=0.7\hsize]{figures/figure_samples.pdf} \caption{Sample paths in the mean-field (linear $g$) and LQG control cases} \label{samples} \end{figure} \begin{figure}[h] \centering \includegraphics[width=0.9\hsize,height=0.7\hsize]{figures/figure_meanexp.pdf} \caption{NNT, EAT and sample paths in the mean-field (exponential $g$) case} \label{meanexp} \end{figure} \begin{figure}[h] \centering \includegraphics[width=0.9\hsize,height=0.7\hsize]{figures/robust.pdf} \caption{Robustness of the mean field integral control} \label{robust} \end{figure}
{'timestamp': '2018-10-23T02:31:03', 'yymm': '1803', 'arxiv_id': '1803.00040', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00040'}
arxiv
\section{Introduction} Automatic text detection and recognition is an important task in computer vision, with many uses ranging from autonomous driving to book digitization. This problem has been extensively studied, and has been divided into two problems at different levels of difficulty: text detection and recognition in document images, and text detection and recognition in natural images. The former is less challenging and many commercial tools are already available. However, text detection and recognition in natural images are still challenging. For example, a character may have very different appearances in different images due to style, font, resolution, or illumination differences; characters may also be partially occluded, distorted, or have complex background, which makes detection and recognition even harder. Sometimes we even have to deal with high intra-class versus low inter-class differences~\cite{DBLP:journals/corr/CuiZLB15}. As shown in Figure~\ref{fig:fine_grain}, the three characters differ a little, but the instances of the same character could have large appearance differences. \begin{figure}[t!] \centering \begin{tabular}{c c c c c c c c c} \includegraphics[width=0.04\textwidth]{figure/fine_grain/tian_1.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/tian_2.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/tian_3.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/tian_4.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/tian_5.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/tian_6.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/tian_7.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/tian_8.jpg} & \includegraphics[width=0.04\textwidth]{figure/fine_grain/tian.png} \\ \includegraphics[width=0.04\textwidth]{figure/fine_grain/da_1.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/da_2.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/da_3.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/da_4.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/da_5.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/da_6.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/da_7.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/da_8.jpg} & \includegraphics[width=0.04\textwidth]{figure/fine_grain/da.png} \\ \includegraphics[width=0.04\textwidth]{figure/fine_grain/tai_1.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/tai_2.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/tai_3.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/tai_4.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/tai_5.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/tai_6.jpg} & \hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/tai_7.jpg} &\hspace{-0.12in} \includegraphics[width=0.04\textwidth]{figure/fine_grain/tai_8.jpg} & \includegraphics[width=0.04\textwidth]{figure/fine_grain/tai.png} \end{tabular} \caption{High intra-class variance versus low inter-class variance. Each row shows instances of a Chinese character. The first character differs from the second character by a single stroke, and the second character differs from the third character by another stroke. While the three characters are very similar in shape, the instances of the same character have very different appearance, due to color, font, occlusion, and background differences, etc. The most right column shows the corresponding Chinese character. } \label{fig:fine_grain} \end{figure} The past few years have witnessed a boom of deep learning in many fields, including image classification, speech recognition, and so on. Very deep networks with tens or even more than a hundred layers (such as VGG-19, Google Inception or ResNet) have nice modeling capacity, and have shown promising performance in a variety of detection, classification, recognition tasks. These models need massive amount of data for training. Availability of data is, indeed, a key factor in the success of deep neural networks. The public datasets, such as Image-Net dataset~\cite{imagenet_cvpr09}, the Microsoft COCO dataset~\cite{DBLP:journals/corr/LinMBHPRDZ14} and the ADE20K dataset~\cite{zhou2016semantic}, have become a key driver for progress in computer vision. In this paper we present a large dataset of Chinese text in natural images, named \emph{Chinese Text in the Wild} (CTW). The dataset contains \totalimage\ images with \totalcharacter\ Chinese characters, going much beyond previous datasets. The images are from Tencent Street View. They are captured from tens of different cities in China, without preference for any particular purpose. The dataset is a challenging dataset, due to its diversity and complexity. It contains planar text, raised text, text in cities, text in rural areas, text under poor illumination, distant text, partially occluded text, etc. For each image, we annotate all Chinese texts in it. For each Chinese character, we annotate its underlying character, its bounding box, and 6 attributes to indicate whether it is occluded, having complex background, distorted, 3D raised, wordart, and handwritten, respectively. We have used the dataset as a basis to train deep models using several state-of-the-art approaches for character recognition, and character detection in images. These models are also presented as baseline algorithms. The dataset, source code and baseline algorithms will all be publicly available. We expect the dataset to greatly stimulate future development of detection and recognition algorithms of Chinese texts in natural images. The rest of this paper is organized as follows. We discuss related work in Section~\ref{sec:related_work}, and give details of our dataset in Section~\ref{sec:dataset}. The baseline algorithms trained using our dataset and experimental results are given in Section~\ref{sec:experiment}, and conclusions are presented in Section~\ref{sec:discussion}. \section{Related work} \label{sec:related_work} Text detection and recognition has received much attention during the past decades in the computer vision community, albeit mostly for English text and numbers. We briefly review both benchmark datasets and approaches from recent years. Here, we treat text recognition in documents as a separate well studied problem, and only focus on text detection and recognition in natural images. \subsection{Datasets of text in natural images} Datasets of text in natural images could be classified into two categories: those that only contain real world text~\cite{Smith2016,veit2016cocotext,MishraBMVC12,Lucas2005}, and those that contain synthetic text~\cite{de2009character,Jaderberg14c}. Images in these datasets are mainly of two kinds: Internet images, and Google Street View images. For example, the SVHN~\cite{37648} and SVT~\cite{6126402} datasets utilize Google Street View images, augmented by annotations for numbers and text, respectively. Most previous datasets target English text in the Roman alphabet, and digits, although several recent datasets consider text in other languages and character sets. Notable amongst them are the KAIST scene text dataset~\cite{jung2011touch} for Korean text, FSNS~\cite{Smith2016} for French text, and MSRA-TD500~\cite{Yao:2012:DTA:2354409.2354851} for Chinese text. However, MSRA-TD500 dataset~\cite{Yao:2012:DTA:2354409.2354851} only contains 500 natural images, which is far from sufficient for training deep models such as convolutional neural networks. In contrast, our dataset contains over 30 thousand images and about 1 million Chinese characters. \subsection{Text detection and recognition} Text detection and recognition approaches can be classified as those approaches that use hand-crafted features, and those approaches that use automatically learned features (as deep learning does). We draw a distinction between \emph{text detection}, detecting a region of an image that (potentially) contains text, and \emph{text recognition}, determining which characters and text are present, typically using the cropped areas returned by text detection. The most widely used approach to text detection based on hand-crafted features is the \emph{stroke width transform} (SWT)~\cite{5540041}. The SWT transforms an image into a new stroke-width image with equal size, in which the value of each pixel is the stroke width associated with the original pixel. This approach works quite well for relatively clean images containing English characters and digits, but often fails on more cluttered images. Another widely used approach is to seek text as maximally stable extremal regions (MSERs)~\cite{Matas2004761,6116200,6471224,Neumann2011}. Such MSERs always contain non-text regions, so a robust filter is needed for candidate text region selection. Recently, deep learning based approaches have been adopted for text detection, including both fully convolutional networks (FCN)~\cite{zhang2016multi} and cascaded convolutional text networks (CCTN)~\cite{DBLP:journals/corr/HeH0Y16}. Given cropped text, recognition methods for general objects can be adapted to text recognition. Characters and words are at two different levels in English, and different approaches have been proposed for character recognition and word recognition separately. For character recognition, both SVM based approaches~\cite{http://dx.doi.org/10.5244/C.26.13} and part-based models~\cite{6619225} have been applied and found to work well. Word recognition provides additional contextual information, so Bayesian inferencing~\cite{1211512}, conditional random fields~\cite{6247990} and graph models~\cite{Lee:2008:CCH:1332129.1332191} can now be used. A recent trend is to focus on `end-to-end' recognition~\cite{6460871}; more can be found in a detailed survey by Ye and Doermann~\cite{10.1109/TPAMI.2014.2366765}. \section{Chinese Text in the Wild Dataset} \label{sec:dataset} In this section, we present Chinese Text in the Wild (CTW), a very large dataset of Chinese text in street view images. We will discuss how the images are selected, annotated, split into training and testing sets, and we also provide statistics of the dataset. For denotation clearness, we refer to each unique Chinese character as a \emph{character category} or as a \emph{category}, and refer to an observed instance of a Chinese character in an image as a \emph{character instance}, or as an \emph{instance}. \subsection{Image selection} \label{selection} We have collected 122,903 street view images from Tencent Street View. Among them, 98,903 images are from the Tsinghua-Tencent 100K dataset~\cite{Zhu_2016_CVPR}, and 24,000 directly from Tencent Street View. These images are captured from tens of different cities in China, and each image has a resolution of $2048 \times 2048$. We manually check all street view images, and remove those images which do not contain any Chinese characters. Besides, since the street view images were captured at fixed intervals (i.e., 10 to 20 meters), successive images may have large duplicated areas. Hence, we manually check each pair of successive images, if duplicated areas cover more than 70\% of the total image size, we also remove one image. Finally, \totalimage\ images are selected. \subsection{Annotation} \begin{figure*} \centering \includegraphics[width=1.0\textwidth]{figure/annotating_workflow.jpg} \\ (a)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(b)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(c)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(d) \caption{Annotation pipeline: drawing a bounding box for the sentence (a), drawing a bounding box for each character instance (b), labeling its corresponding character category (c), and labeling its attributes (d).} \label{fig:pipeline} \end{figure*} We now describe the annotation process in detail. For each image, all Chinese character instances are annotated. Characters in English and other languages are not annotated. Our annotation pipeline is illustrated in Figure~\ref{fig:pipeline}. A bounding box is first drawn around a sentence of Chinese text. Next, for each character instance, a more tight bounding box is drawn around it, and its corresponding character instance and its attributes are also specified. There are six attributes to annotate, which are occlusion attribute, complex background attribute, distortion attribute, raised attribute, wordart attribute, and handwritten attribute. For each character, \emph{yes} or \emph{no} is specified for each attribute. The occlusion attribute indicates whether the character is occluded, partially occluded by other objects or not. The complex background attribute indicates whether the character has complex background, shadows on it or not. The distortion attribute indicates whether the character is distorted, rotated or it is frontal. The raised attribute indicates whether the character is 3D raised or it is planar. The wordart attribute indicates whether the character uses a artistic style or uses a traditional font. The handwritten attribute indicates whether the character is handwritten or printed. Character examples of each attribute are illustrated in Figure~\ref{fig:attributes}. We provide these attributes since the texts have large appearance variations due to color, font, occlusion, and background differences, etc. With the help of these attributes, it will be easier to analyze the algorithm performance on different styles of texts. Researcher may also design algorithms for specific styles of Chinese texts, i.e., 3D raised texts. \begin{figure} \centering \begin{tabular}{c c c c c c c c c c} \includegraphics[width=.045\textwidth]{figure/attributes/occluded/1029261_7.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/occluded/3041653_22.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/occluded/3031160_25.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/occluded/1002678_19.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/occluded/1044357_23.jpg} & \hspace{-0.1in} \includegraphics[width=.045\textwidth]{figure/attributes/not_occluded/1015644_2.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_occluded/2023932_1.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_occluded/2025381_57.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_occluded/2033123_3.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_occluded/2042954_16.jpg} \\ \multicolumn{5}{c}{(a) occluded} & \multicolumn{5}{c}{(b) not occluded} \\ \includegraphics[width=.045\textwidth]{figure/attributes/bg_complex/1000764_7.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/bg_complex/1017998_26.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/bg_complex/3002017_19.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/bg_complex/3020160_4.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/bg_complex/3030675_26.jpg} & \hspace{-0.1in} \includegraphics[width=.045\textwidth]{figure/attributes/bg_not_complex/1005743_4.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/bg_not_complex/1043628_17.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/bg_not_complex/2033688_40.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/bg_not_complex/2041584_7.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/bg_not_complex/3023931_91.jpg} \\ \multicolumn{5}{c}{(c) complex background} & \multicolumn{5}{c}{(d) clean background} \\ \includegraphics[width=.045\textwidth]{figure/attributes/transformed/1018498_4.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/transformed/1042002_1.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/transformed/3001834_93.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/transformed/3022243_0.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/transformed/3025751_11.jpg} & \hspace{-0.1in} \includegraphics[width=.045\textwidth]{figure/attributes/not_transformed/1046175_7.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_transformed/2030166_55.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_transformed/3005933_87.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_transformed/3007164_54.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_transformed/3007422_29.jpg} \\ \multicolumn{5}{c}{(e) distorted} & \multicolumn{5}{c}{(f) frontal} \\ \includegraphics[width=.045\textwidth]{figure/attributes/raised/1018475_32.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/raised/1018729_24.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/raised/1019968_7.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/raised/1040476_9.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/raised/3025428_25.jpg} & \hspace{-0.1in} \includegraphics[width=.045\textwidth]{figure/attributes/not_raised/1016620_2.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_raised/1022328_85.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_raised/1025108_295.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_raised/1028803_32.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_raised/3013371_8.jpg} \\ \multicolumn{5}{c}{(g) 3D raised} & \multicolumn{5}{c}{(h) planar} \\ \includegraphics[width=.045\textwidth]{figure/attributes/wordart/1032532_60.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/wordart/1040257_0.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/wordart/1046273_84.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/wordart/2016409_15.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/wordart/2007929_4.jpg} & \hspace{-0.1in} \includegraphics[width=.045\textwidth]{figure/attributes/not_wordart/1005068_14.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_wordart/1025540_2.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_wordart/1026187_11.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_wordart/1040160_19.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_wordart/2003581_2.jpg} \\ \multicolumn{5}{c}{(i) wordart} & \multicolumn{5}{c}{(j) not wordart} \\ \includegraphics[width=.045\textwidth]{figure/attributes/handwriting/3020257_5.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/handwriting/3026475_17.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/handwriting/3032689_0.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/handwriting/3026517_5.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/handwriting/3032689_8.jpg} & \hspace{-0.1in} \includegraphics[width=.045\textwidth]{figure/attributes/not_handwriting/1016756_10.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_handwriting/2045870_27.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_handwriting/3018013_14.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_handwriting/3031484_83.jpg} & \hspace{-0.2in} \includegraphics[width=.045\textwidth]{figure/attributes/not_handwriting/3042703_21.jpg} \\ \multicolumn{5}{c}{(k) handwritten} & \multicolumn{5}{c}{(l) printed} \\ \end{tabular} \caption{Examples with different attributes. } \label{fig:attributes} \end{figure} In order to ensure high quality, we invite 40 annotation experts for the annotation process. They are employed by a professional image annotation company and are well trained for image annotations tasks. We also invite two inspectors to verify the quality of annotations. Before annotating, we first invite them to take a training session on annotation instructions. The whole annotation process took about 2 months. In total, \totalcharacter\ Chinese character instances are annotated. Figure~\ref{fig:teaser} shows two images in our dataset and the corresponding annotation. \begin{figure}[t!] \centering \includegraphics[width=.5\textwidth]{figure/teaser.jpg} \caption{Left: two images in our dataset. Right: corresponding ground truth annotation.} \label{fig:teaser} \end{figure} \subsection{Dataset splitting} \label{subsec:data_split} We split our dataset to a training set and a testing set. The testing set is further split into a recognition testing set for the recognition task (Section~\ref{subsec:recognition}) and a detection testing set for the detection task (Section~\ref{subsec:end_to_end_det_and_rec}). We set the ratio of the sizes of the three sets to $8:1:1$. We randomly distribute all the images into the three sets according to the ratio. To avoid correlation between training and testing images, we constrain that the images captured on the same street must be in the same set. After splitting, the training set contains 25,887 images with 812,872 Chinese characters, the recognition testing set contains 3,269 images with 103,519 Chinese characters, and the detection testing set contains 3,129 images with 102,011 Chinese characters. \subsection{Statistics} Our CTW dataset contains \totalimage\ images with \totalcharacter\ Chinese character instances. It contains \indicharacter\ character categories (i.e., unique Chinese characters). In Figure~\ref{fig:instance_per_category}, for the top 50 most frequent observed character categories, we show the number of character instances in each category in the training set and in the testing set, respectively. In Figure~\ref{fig:instances_categories} (a), we show the number of images contains specific number of character instances in the training set and in the testing set, respectively. In Figure~\ref{fig:instances_categories} (b), we show the number of images containing specific number of character categories in the training set and in the testing set, respectively. In Figure~\ref{fig:instance_by_size}, we provide the number of character instances with different sizes in the training set and in the testing set, respectively, where the size is measured by the long side of its bounding box in pixels. In Figure~\ref{fig:instance_by_attributes}, we provide the percentage of character instances with different attributes in all/large/medium/small character instances, respectively. Small, medium, and large refer to character size $<16$, $\in [16,32)$ and $\ge32$, respectively. We could find that large character instances are more likely to have complex attributes. For example, in all character instances, 13.2\% of them are occluded, while in all large character instances, a higher proportion (19.2\%) of them are occluded. \begin{figure*} \centering \includegraphics[width=0.9\textwidth]{figure/stats/stat_most_freq.pdf} \caption{Number of character instances for the 50 most frequent observed character categories in our dataset.} \label{fig:instance_per_category} \end{figure*} \begin{figure}[t!] \centering \begin{tabular}{c} \includegraphics[width=.45\textwidth]{figure/stats/stat_num_char.pdf} \\ (a) \\ \includegraphics[width=.45\textwidth]{figure/stats/stat_num_uniq_char.pdf} \\ (b) \end{tabular} \caption{Histograms. (a) Number of images containing specific number of character instances; (b) Number of images containing specific number of character categories.} \label{fig:instances_categories} \end{figure} \begin{figure}[t!] \centering \includegraphics[width=.5\textwidth]{figure/stats/stat_instance_size.pdf} \caption{The number of character instances with different sizes. The size is measured by the long side of its bounding box in pixels.} \label{fig:instance_by_size} \end{figure} \begin{figure}[t!] \centering \includegraphics[width=.5\textwidth]{figure/stats/stat_properties.pdf} \caption{The percentage of character instances with different attributes in all/large/medium/small character instances, respectively. Small, medium, and large refer to character size $<16$, $\in [16,32)$ and $\ge32$, respectively. } \label{fig:instance_by_attributes} \end{figure} \textbf{Diversity} The above statistics show that our dataset has good diversity on character categories, character sizes, and attributes (i.e., occlusion, background complexity, 3D raised, etc.). As shown in Figure~\ref{fig:instance_by_attributes}, 13.2\% character instances are occluded, 28.0\% have complex background, 26.0\% are distorted, and 26.9\% are raised text. As shown in Figure~\ref{fig:diversity}, our dataset contains planar text (a), raised text (b), text in cities (c), text in rural areas (d), horizontal text (e), vertical text (f), distant text (g), nearby text (h), text under poor illumination (i), and partially occluded text (j). Due to such diversity and complexity, our CTW dataset is a challenging dataset. \begin{figure} \centering \begin{tabular}{c c c c c } \hspace{-0.1in} \rotatebox{90}{~~~~~~~(a)} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/pingmian1.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/pingmian2.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/pingmian3.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/pingmian4.jpg} \\ \hspace{-0.1in} \rotatebox{90}{~~~~~~~(b)} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/liti1.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/liti2.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/liti3.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/liti4.jpg} \\ \hspace{-0.1in} \rotatebox{90}{~~~~~~~(c)} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/chengshi1.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/chengshi2.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/chengshi3.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/chengshi4.jpg} \\ \hspace{-0.1in} \rotatebox{90}{~~~~~~~(d)} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/jiaoqu1.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/jiaoqu2.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/jiaoqu3.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/jiaoqu4.jpg} \\ \hspace{-0.1in} \rotatebox{90}{~~~~~~~(e)} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/heng1.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/heng2.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/heng3.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/heng4.jpg} \\ \hspace{-0.1in} \rotatebox{90}{~~~~~~~(f)} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/shu1.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/shu2.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/shu3.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/shu4.jpg} \\ \hspace{-0.1in} \rotatebox{90}{~~~~~~~(g)} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/yuan1.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/yuan2.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/yuan3.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/yuan4.jpg} \\ \hspace{-0.1in} \rotatebox{90}{~~~~~~~(h)} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/jin1.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/jin2.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/jin3.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/jin4.jpg} \\ \hspace{-0.1in} \rotatebox{90}{~~~~~~~(i)} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/yin1.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/yin2.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/yin3.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/yin4.jpg} \\ \hspace{-0.1in} \rotatebox{90}{~~~~~~~(j)} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/zhedang1.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/zhedang2.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/zhedang3.jpg} & \hspace{-0.17in} \includegraphics[width=.11\textwidth]{figure/diversity/zhedang4.jpg} \end{tabular} \caption{Dataset diversity. (a) planar text, (b) raised text, (c) text in cities, (d) text in rural areas, (e) horizontal text, (f) vertical text, (g) distant text, (h) nearby text, (i) text under poor illumination, (j) partially occluded text.} \label{fig:diversity} \end{figure} \section{Baseline Algorithms and Performance} \label{sec:experiment} We now describe the baseline algorithms and their performance using the proposed CTW dataset. Our experiments were performed on a desktop with a 3.5GHz Intel Core i7-5930k CPU, NVIDIA GTX TITAN GPU and 32GB RAM. We considered two tasks: character recognition from cropped regions, and character detection from images. \subsection{Recognition} \label{subsec:recognition} Given a cropped rectangular region showing a Chinese character instance, the goal of the character recognition task is to predict its character category. We have tested several state-of-the-art convolutional neural network structures for the recognition task using TensorFlow, including: AlexNet~\cite{NIPS2012_4824}, OverFeat~\cite{DBLP:journals/corr/SermanetEZMFL13}, Google Inception~\cite{DBLP:journals/corr/SzegedyLJSRAEVR14}, 50 layer ResNet~\cite{DBLP:journals/corr/HeZRS15}(ResNet50) and 152 layer ResNet (ResNet152). We use the training set and the recognition testing set as described in Section~\ref{subsec:data_split} for training and testing, respectively. Since a majority of the character categories are rarely-used Chinese characters, which have very few samples in the training data and also have very rare usage in practice, we only consider recognition of the top 1000 frequent observed character categories. We consider recognition as a classification problem of 1001 categories. Besides the used 1000 character categories, an 'others' category is added. We trained each network using tens of thousands of iterations, and the parameters of each model are finely tuned. On the testing set, the top-1 accuracy achieved by these networks was: AlexNet (73.0\%), OverFeat (76.0\%), Google Inception (80.5\%), ResNet50 (78.2\%) and ResNet152 (79.0\%), respectively. In Table~\ref{tab:recognition}, we also give the top-1 accuracy of the top 10 frequent observed character categories. In Figure~\ref{fig:result_recognition_task}, we show 20 character instances randomly chosen from the testing set. In each row, from left to right, we show the cropped region of a character instance, the ground truth character category, and the recognition results of different methods. Among the above methods, Google Inception achieves the best accuracy rate. In Figure~\ref{fig:recognition_attributes}, we provide the top-1 accuracy using Google Inception for character instances with different attributes and different sizes, respectively. The results are consistent with our intuition, e.g., characters with clean backgrounds, printed characters, and large characters are easier to recognize than those with complex background, handwritten characters, and small characters, respectively. An interesting observation is that the recognition accuracy of large wordart characters (70.0\%) is lower than the accuracy of medium wardart characters (72.3\%). The reason is that large characters are more likely to be occluded or have complex background (as shown in Figure~\ref{fig:instance_by_attributes}), making them harder to be recognized. More details can be found on the website. \begin{table*} \centering \caption{Top-1 accuracy of the 10 most frequent character categories.} \begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|} \hline & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-0.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-1.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-2.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-3.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-4.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-5.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-6.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-7.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-8.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-9.png} \end{minipage} \\ \hline AlexNet & 79.8\% & 66.2\% & 78.4\% & 83.6\% & 87.3\% & 82.7\% & 79.9\% & 78.9\% & 80.4\% & 84.1\% \\ \hline OverFeat & 82.7\% & 69.5\% & 84.0\% & 87.2\% & 89.0\% & 86.3\% & 83.4\% & 83.6\% & 82.0\% & 87.1\% \\ \hline Inception & 88.9\% & 74.6\% & 88.1\% & 90.9\% & 91.2\% & 89.2\% & 90.3\% & 88.4\% & 87.8\% & 90.6\% \\ \hline ResNet50 & 86.4\% & 72.6\% & 84.0\% & 89.1\% & 90.3\% & 87.1\% & 86.5\% & 84.7\% & 84.1\% & 87.5\% \\ \hline ResNet152 & 87.4\% & 73.0\% & 85.5\% & 89.3\% & 91.0\% & 87.6\% & 87.1\% & 86.8\% & 84.3\% & 88.4\% \\ \hline \end{tabular} \label{tab:recognition} \end{table*} \begin{figure} \centering \includegraphics[width=.9\linewidth]{figure/result_task1.png} \caption{Some examples of the recognition task. In each row, from left to right, we give: the cropped region of a character instance, the ground truth character category, and the recognition results of different methods. Corrected recognitions are painted with green. The percentage number shows the confidence of the results.} \label{fig:result_recognition_task} \end{figure} \begin{figure*} \includegraphics[width=0.95\textwidth]{figure/experiments/cls_precision_by_props_size_inception_v4.pdf} \caption{the top-1 accuracy using Google Inception for character instances with different attributes and different sizes. Small, medium, and large refer to character size $<16$, $\in [16,32)$ and $\ge32$, respectively. $\sim$ denotes without a specific attribute , e.g., $\sim$occluded means not occluded character instances.} \label{fig:recognition_attributes} \end{figure*} \subsection{Detection} \label{subsec:end_to_end_det_and_rec} Given an image, the goal of the character detection task is to detect the bounding boxes of all character instances and also recognize each character instance, i.e., predict its character category. We have tested the YOLOv2 algorithm~\cite{DBLP:journals/corr/RedmonF16} for the detection task. Given an image, the output of YOLOv2 is a list of recognized character instances, each is associated with a character category, a bounding box, and a confidence score in $[0,1]$. We use the training set and the detection testing set as described in Section~\ref{subsec:data_split} for training and testing, respectively. Following the recognition task (Section~\ref{subsec:recognition}), we also limit the number of categories to 1001, i.e., the top 1000 frequent observed character categories and an 'others' category. Since the resolution of images in our dataset is large (i.e., $2048\times 2048$), we have slightly modified YOLOv2 to adapt it to our dataset. For training, first, we set input resolution of YOLOv2 to $672\times 672$. Secondly, each image ($2048\times 2048$ resolution) is uniformly segmented into 196 subimages, each of which has resolution of $168\times 168$ and is overlapped with each other by 23-24 pixels. The subimages are scaled to resolution of $672\times 672$, and then are fed into YOLOv2 as input. For testing, since character instances vary a lot in sizes, in order to detect character instances of different sizes, we perform a multi-scale scheme. First, we set input resolution of YOLOv2 to $1216\times 1216$. Secondly, we segment each input image into 16 subimages ($608\times 608$ resolution) with overlapping of 128 pixels, and also segment the same input image into 64 smaller subimages ($304\times 304$ resolution) with overlapping of 54-55 pixels. After that, all the 80 subimages from both scales are resized to resolution of $1216 \times 1216$ and then are fed into YOLOv2 as input. Finally, non-maximum suppression is applied to remove duplicated detections. In the testing set, YOLOv2 achieves an mAP of 71.0\%. In Table ~\ref{tab:detection}, we also show the AP scores for the top 10 frequent observed character categories. The AP scores range from 80.3\% to 90.3\%. In Figure~\ref{fig:detection}, we give the overall precision-recall curve, and the precision-recall curve for characters with different sizes. In Figure~\ref{fig:detection_attributes}, we provide the recall rates of YOLOv2 for character instances with different attributes and different sizes, respectively. To compute the recall rates, for each image in the testing set, denoting the number of annotated character instances as $n$, we select $n$ recognized character instances with the highest confidences as output of YOLOv2. The results are also consistent with our intuition, i.e., simple characters are easier to be detected and recognized. For example, the recall rates of not occluded characters (71.6\%), printed characters (69.8\%) are higher than the recall rates of occluded characters (56.7\%), handwritten characters (53.8\%), respectively. However, the recall rate of planar characters (69.4\%) is lower than that of raised characters (70.1\%). The reason might be that raised characters have stronger structures than planar characters and hence they are easier to be detected. We also illustrate some detection results of YOLOv2 in Figure~\ref{fig:result_yolo}. More details can be found on the website. \begin{table*} \centering \caption{AP of the 10 most frequent Chinese characters.} \label{tab:detection} \begin{tabular}{|l|l|l|l|l|l|l|l|l|l|l|} \hline & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-0.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-1.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-2.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-3.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-4.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-5.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-6.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-7.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-8.png} \end{minipage} & \begin{minipage}{3.5mm} \includegraphics[width=\linewidth,trim=0 0 0 -2]{figure/texts/0-9.png} \end{minipage} \\ \hline YOLOv2 & 86.2\% & 81.6\% & 87.0\% & 82.3\% & 89.7\% & 81.6\% & 90.3\% & 81.6\% & 80.3\% & 84.2\% \\ \hline \end{tabular} \end{table*} \begin{figure} \centering \includegraphics[width=.9\linewidth]{figure/experiments/det_AP_curve.pdf} \caption{Precision-recall curves of the detection task using YOLOv2~\cite{DBLP:journals/corr/RedmonF16}. We show precision-recall curve for all character instances (blue), and curves for character instances with large (yellow), medium (green), and small sizes (red), respectively. } \label{fig:detection} \end{figure} \begin{figure*} \includegraphics[width=0.95\textwidth]{figure/experiments/det_recall_by_props_size.pdf} \caption{The recall rates of YOLOv2~\cite{DBLP:journals/corr/RedmonF16} for character instances with different attributes and different sizes. Small, medium, and large refer to character size $<16$, $\in [16,32)$ and $\ge32$, respectively. $\sim$ denotes without a specific attribute , e.g., $\sim$occluded means not occluded character instances. } \label{fig:detection_attributes} \end{figure*} \begin{figure*} [t!] \centering \begin{tabular}{c c c c} \includegraphics[width=.225\linewidth]{figure/yolo/1017943_0_700_600_500_dt.pdf} & \includegraphics[width=.225\linewidth]{figure/yolo/1024562_150_520_600_500_dt.pdf} & \includegraphics[width=.225\linewidth]{figure/yolo/2001286_0_580_600_500_dt.pdf} & \includegraphics[width=.225\linewidth]{figure/yolo/2026059_843_659_600_500_dt.pdf} \\ \includegraphics[width=.225\linewidth]{figure/yolo/2031598_224_663_600_500_dt.pdf} & \includegraphics[width=.225\linewidth]{figure/yolo/3031589_1448_740_600_500_dt.pdf} & \includegraphics[width=.225\linewidth]{figure/yolo/3032440_325_767_600_500_dt.pdf} & \includegraphics[width=.225\linewidth]{figure/yolo/3041012_850_800_600_500_dt.pdf} \end{tabular} \caption{Detection results by YOLOv2~\cite{DBLP:journals/corr/RedmonF16}. For each image, we give the detected characters and their bounding boxes. Correct detections are shown in green while wrong detections are shown in yellow. } \label{fig:result_yolo} \end{figure*} \section{Conclusions} \label{sec:discussion} We have introduced Chinese Text in the Wild, a very large dataset of Chinese text in street view images. It contains \totalimage\ images with \totalcharacter\ Chinese character instances, and will be the largest publicly available dataset for Chinese text in natural images. We annotate all Chinese characters in all images. For each Chinese character, the annotation includes its underlying character, the bounding box, and six attributes. We also provide baseline algorithms for two tasks: character recognition from cropped regions, and character detection from images. We believe that our dataset will greatly stimulate future works in Chinese text detection and recognition. {\small \bibliographystyle{ieee}
{'timestamp': '2018-03-02T02:02:53', 'yymm': '1803', 'arxiv_id': '1803.00085', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00085'}
arxiv
\section{Introduction} \label{sec:intro} Astronomical surveys are the primary source of information about the universe beyond our solar system. They are essential for addressing key open questions in astronomy and cosmology about topics such as the life cycles of stars and galaxies, the nature of dark energy, and the origin and evolution of the universe. \begin{figure}[hb] \centering \includegraphics[width=2in]{sdss_fields} \caption{Sample data from the Sloan Digital Sky Survey (SDSS). Image boundaries appear as grey lines. All images have the same rectangular size; there is overlap.} \label{fig:sdss_fields} \end{figure} The principal products of astronomical imaging surveys are catalogs of light sources, such as stars and galaxies. These catalogs are generated by identifying light sources in survey images (e.g., Figure~\ref{fig:sdss_fields}) and characterizing each according to physical parameters such as flux\footnote{Flux is the amount of energy transferred in the form of photons at a certain distance from the source per unit area per second. ``Brightness'' is a colloquial term for flux.}, color, and morphology. Astronomical catalogs are the starting point for many scientific analyses. First, catalogs assist with discovering new types of astronomical objects, such as new populations of stars or galaxies, or entirely new objects. The catalog can either resolve the research question directly, or it may serve to inform the design of follow-on surveys using more advanced or specialized instrumentation. Second, catalogs enable demographic inference, which can address fundamental cosmological questions. For example, researchers may need to know the spatial and luminosity distributions for specific classes of stars or galaxies. For these ``population-level'' analyses, accurate quantification of uncertainty in the point estimates of parameters is as important as the accuracy of the point estimates themselves. Catalog construction today is based on software pipelines. For concreteness, we describe the Hyper Suprime-Cam (HSC) software pipeline~\citep{bosch2018hyper}. The contrasts we subsequently draw between our proposed approach and HSC, however, apply to catalog pipelines in general. We focus on HSC because it is the state of the art in nearly all respects. Its code has been merged into the cataloging pipeline for the Large Synoptic Survey Telescope~\citep{lsst}---one of the most important upcoming sky surveys. HSC draws upon the algorithmic development of both the Sloan Digital Sky Survey (SDSS) software pipeline~\citep{lupton2001sdss} and SExtractor~\citep{bertin1996sextractor}. The HSC software pipeline comprises a sequence of steps, including 1) detrending, 2) cosmic ray masking, 3) ``repair'' of saturated and bad pixels through interpolation, 4) estimating the sky background, 5) detecting ``peaks'', 6) estimating the centroids of light sources, 7) estimating the shape of light sources, 8) estimating the flux of light sources, 9) matching light sources to external catalogs, 10) estimating the point-spread function, and 11) performing star/galaxy separation. Most of these steps depend on estimates from other steps, and many have circular dependencies. Steps with circular dependencies are repeated multiple times. For example, at first a circular Gaussian serves as a crude approximation of a star for masking cosmic rays. Later the cosmic ray detector is rerun with a refined star model. For the initial sequence of steps (i.e., a ``stage''), the semi-iterative sequence steps are executed on all images independently, regardless of any overlap. During later stages, constraints are added that require the algorithm to use a shared estimate for a light source in an overlapping region. The matching itself depends on aligning the images correctly, which in turn depends on correctly detected light sources---an additional circular dependency. Ultimately, aligned, calibrated, and deblended images are ``co-added'' (superimposed) to create one image for each light source. The final estimate of a light source's properties is based on the co-added images and accompanying per-pixel variance estimates. The uncertainty estimates for a light source's flux include only this pixel-level variability. They do not account for all the other sources of uncertainty that cannot reasonably be modeled as independent across pixels: uncertainty about the light source's centroid, the number of light sources, the image alignments, cosmic ray detection, light sources' shapes, and nearby light sources' fluxes and shapes. The reported uncertainties are based on a Gaussian statistical model of pixels, but one that conditions on the previous stages' estimates of all these quantities. Effectively, the reported uncertainties are for a conditional distribution rather than a marginal distribution. Modern cataloging pipelines have struck a balance between algorithmic efficiency and statistical rigor that has enabled much of the progress in astronomy to date. Upcoming surveys, however, will probe deeper into the visible universe, creating new challenges. In particular, whereas blending was thought to affect just a small number of light sources, in LSST, it is estimated that 68\% of light sources will be blended, requiring new approaches to deblending~\citep{bosch2018hyper}. In addition, new approaches may let us better interpret existing survey data. Our aim in this work is to put catalog construction on sounder statistical footing. Our first contribution is a statistical model (Section~\ref{sec:model}) that can simultaneously find centroids, determine photometry (flux, color, and galaxy morphology), deblend overlapping light sources, perform star/galaxy separation, and adjust estimates of all quantities based on prior information. Our procedure for all these tasks is based on a single probabilistic model. The properties of cataloged light sources are modeled as unobserved random variables. The number of photons recorded by each pixel is modeled by a Poisson distribution with a rate parameter unique to the pixel. The posterior distribution induced over the unobserved physical properties of the light sources encapsulates knowledge about the catalog's entries, combining prior knowledge of astrophysics with survey imaging data in a statistically efficient manner. With the model, we can reason about uncertainty for any quantity in our catalog without conditioning on other estimates being known exactly. Unfortunately, exact Bayesian posterior inference is NP-hard for most probabilistic models of interest~\citep{bishop2006pattern}, including this one. Approximate Bayesian inference is an area of active research. Markov chain Monte Carlo (MCMC) is the most common approach. Two recent studies demonstrate that Bayesian modeling is the gold standard for astronomical inference, while casting doubt on whether MCMC is viable for constructing a whole astronomical catalog. ~\citet{brewer2013probabilistic} use a single 10,000-pixel image as the dataset for an MCMC procedure. Obtaining samples from the posterior distribution takes one day using a modern multi-core computer. \citet{portillo2017improved} run twelve Intel Xeon cores for an entire day to yield useful results on a similar dataset. The Sloan Digital Sky Survey---a modern astronomical survey---contains over a billion times as many pixels as these test images. The upcoming Large Synoptic Survey Telescope (LSST) will collect at least ten terabytes nightly---hundreds of petabytes in total \citep{lsst}. Even basic management of this data requires substantial engineering effort. Before our work, Tractor~\citep{tractor} was the only program for Bayesian posterior inference that had been applied to a complete modern astronomical imaging survey. Tractor is an unpublished work. It relies on the Laplace approximation: the posterior is approximated by a multivariate Gaussian distribution centered at the mode, having a covariance matrix equal to the negative Hessian of the log-likelihood function at that mode. This approximation is not suitable for either categorical random variables or random variables with multi-modal posteriors---no Gaussian distribution approximates them well. Additionally, because Laplace approximation centers the Gaussian at the mode of the target, rather than the mean, the solution depends on the problem parameterization~\citep{bishop2006pattern}. Variational inference (VI) is an alternative to MCMC and the Laplace approximation. Like the latter, it uses numerical optimization, not sampling, to find a distribution that approximates the posterior~\citep{blei2017variational}. In practice, the resulting optimization problem is often orders of magnitude faster to solve compared to MCMC approaches. It can be simpler, too. Whereas MCMC transition operators must satisfy strict constraints for validity, the variational optimization problem can in principle be solved using any off-the-shelf technique for numerical optimization. Scaling VI to large datasets is nonetheless challenging. Our second contribution is to develop two approximate posterior inference procedures for our model, to assess their quality, and to demonstrate how to scale approximate inference to an entire astronomical survey. Section~\ref{sec:mcmc} and Section~\ref{sec:vi} present inference procedures based on MCMC and VI, respectively. Neither is a routine application of Bayesian machinery. The MCMC procedure combines annealed importance sampling and slice sampling. The VI procedure breaks with tradition by optimizing with a variant of Newton's method instead of closed-form coordinate ascent. Section~\ref{sec:experiments} presents experimental results for both inference procedures, applied to synthetic and real astronomical images. We find that MCMC better quantifies uncertainty, but VI is much faster. Section~\ref{sec:at-scale} describes scaling VI to the entire Sloan Digital Sky Survey (SDSS) using a supercomputer. To our knowledge, this is the largest-scale reported application of VI by at least one order of magnitude. Section~\ref{sec:discussion} draws conclusions about each inference procedure. We consider not just the runtime and accuracy, but also our experience deriving the algorithms, implementing them, and maintaining code for each inference technique. \section{Statistical model} \label{sec:model} Stars and galaxies radiate photons. An astronomical image records photons---each originating from a particular celestial body or from background atmospheric noise---that pass through a telescope's lens during an exposure. A single image contains photons from many sources; even a single pixel may capture photons from multiple sources. Section~\ref{light-sources} describes our model of light sources. Quantities of interest, such as direction\footnote{A direction is a position on the celestial sphere.}, color, and flux, are random variables. Section~\ref{images} describes a generative model of astronomical images: the distribution of each pixel's value---an observed random variable---depends on the latent variables that we aim to infer. Pixel intensities are conditionally independent given these latent random variables. Figure~\ref{graphical_model} presents our statistical model as a graphical model. Table~\ref{structural-table} lists the model's structural constants, denoted by capital Roman letters. All are positive integers. None are estimated. Table~\ref{rv-table} lists the model's random variables, either for a particular light source $s \in \{1,\ldots,S\}$, or a particular image $n \in \{1,\ldots, N\}$ and a particular pixel $m \in \{1,\ldots,M\}$. (S, N, and M appear in Table~\ref{structural-table}.) All are denoted by lowercase Roman letters. All are scalars except for the color vector $c_s$ and the direction vector $u_s$. Inferring the posterior distribution of the unobserved random variables in Table~\ref{rv-table} is the primary problem addressed by this article. Table~\ref{params-table} lists model parameters. The first eight parameters, which are distinguished by calligraphic font, parameterize the prior. They are estimated by empirical Bayes, as described in Section~\ref{prior}. The remaining parameters, denoted by lowercase Greek letters, are set by the SDSS pipeline. \subsection{Light sources} \label{light-sources} An astronomical catalog is a table with one row for each light source. The number of light sources, $S$, is a constant determined by existing cataloging software~\citep{bertin1996sextractor}. Modeling $S$ as random we defer to future work. Light sources in our model are either stars or galaxies, as are the vast majority of light sources in the universe. Exceptions include quasars and supernovae. Asteroids, planets, airplanes, and man-made satellites also occasionally appear in astronomical images. For light source $s=1,\ldots,S$, the latent random variable \begin{align} a_s &\sim \mathrm{Bernoulli}(\mathcal A) \end{align} indicates whether it is a star (${a_s=1}$) or a galaxy (${a_s=0}$). Here $\mathcal{A}$ is the prior probability that a light source is a star. (We discuss how we set $\mathcal A$, and all other prior parameters, in Section~\ref{prior}.) \FloatBarrier \begin{table} \centering \caption{Structural constants in our model.} \label{params} \centering \begin{tabular}{lll} \toprule \textbf{name} & \textbf{brief description} & \textbf{SDSS value} \\ \hline B & number of filter bands & 5\\ E & number of PSF ``eigenimages'' & 4\\ F & number of knots per PSF eigenimage & $51 \times 51$\\ H & number of rows of pixels per image & 2048 \\ I & number of source types (i.e., star, galaxy) & 2\\ J & number of components in the color prior mixture & 8\\ K & number of components in the galaxy mixture model & 8\\ L & number of parameters in a WCS header & 16\\ M & number of pixels per image & $H \times W$\\ N & number of images & 4,690,230\\ Q & number of knots for the sky background model & $192 \times 256$\\ S & number of light sources & 469,053,874\\ W & number of columns of pixels per image & 1361 \\ \hline \end{tabular} \label{structural-table} \end{table} \begin{table} \centering \caption{Random variables in our model.} \centering \begin{tabular}{llll} \hline \textbf{name} & \textbf{brief description} & \textbf{units} & \textbf{domain} \\ \hline $a_s$ & galaxy / star indicator & unitless & \{0, 1\} \\ $c_s$ & colors & magnitude & $\mathbb R^{B-1}$ \\ $e_s^{angle}$ & angle of galaxy's major axis & degrees & $[0, 180)$ \\ $e_s^{radius}$ & galaxy's half-light radius & arcseconds & $(0, \infty)$ \\ $e_s^{profile}$ & galaxy's profile mixing weight & unitless & $[0, 1]$ \\ $e_s^{axis}$ & galaxy's minor-major axis ratio & unitless & $(0, 1)$ \\ $r_s$ & reference-band flux density & nanomaggies & $[0, \infty)$ \\ $u_s$ & direction (longitude, latitude) & degrees & $[0, 360) \times [-90, 90]$ \\ $x_{nm}$ & pixel intensity (observed) & photon count & $\{0,1,2,\ldots\}$ \\ \hline \end{tabular} \label{rv-table} \end{table} \begin{table} \centering \caption{Parameters in our model. \centering \begin{tabular}{lll} \hline \textbf{name} & \textbf{brief description} & \textbf{domain} \\ \hline $\mathcal A$ & prior probability a light source is a star & $[0, 1]$\\ $\mathcal C^{weight}$ & color prior mixture weights & $\mathbb R^{I \times J}$\\ $\mathcal C^{mean}$ & color prior mixture component means & $\mathbb R^{I \times J \times (B - 1)}$\\ $\mathcal C^{cov}$ & color prior mixture component covariance matrices & $\mathbb R^{I \times J \times (B - 1) \times (B - 1)}$\\ $\mathcal E^{radius}$ & galaxy half-light radius prior parameters & $\mathbb R^2$\\ $\mathcal E^{profile}$ & galaxy profile prior parameters & $\mathbb R^2$\\ $\mathcal E^{axis}$ & galaxy axis ratio prior parameters & $\mathbb R^2$\\ $\mathcal R$ & reference-band flux prior parameters & $\mathbb R^{I \times 2}$\\ \hline $\sigma_{n}$ & sky background model & $\mathbb R^Q$\\ $\psi_n^{calib}$ & expected number of photons per nanomaggy & $\mathbb R^H$\\ $\psi_n^{wcs}$ & image alignment & $\mathbb R^L$\\ $\psi_n^{weight}$ & point spread function loadings & $\mathbb R^E$\\ $\psi_n^{image}$ & point spread function principal components & $\mathbb R^{E \times F}$\\ $\beta_n $ & filter band & $\{1,2,\ldots,B\}$\\ \hline \end{tabular} \label{params-table} \end{table} \FloatBarrier \begin{figure}[ht!] \includegraphics[width=1.8in]{figures/celeste_graphical_model.png} \caption{The proposed graphical model. The shaded vertex represents observed random variables. Empty vertices represent latent random variables. Black dots represent constants, set before inference takes place. Edges signify conditional dependencies. Rectangles (``plates'') represent independent replication. Tables~\ref{structural-table},~\ref{rv-table}, and~\ref{params-table} summarize the variables. } \label{graphical_model} \end{figure} The latent random two-vector $u_s$ denotes the direction of light source $s$ in the units of the World Coordinate System \citep{greisen2002representations}. Figure~\ref{sdss_coverage} illustrates this system of coordinates. The first coordinate is longitude and the second coordinate is latitude. Both are measured in degrees. A priori, $u_s$ is uniformly distributed over the sphere. Treating light sources as uniformly distributed is a simplification---some regions of the sky are known a priori to have more light sources than others, e.g., the galactic plane. This is known as directional dependence. Additionally, it is a simplification to model light sources as positioned independently of each other; gravity causes some clustering among light sources. \subsubsection{Flux} \label{flux} The flux of light source $s$ is defined as its expected total radiation reaching a unit area of Earth's surface directly facing $s$, per unit of time. We can measure the flux as the portion of this radiation (per square meter per second) that passes through each filter in a standardized filter set. Such a set is called a filter system. These standardized filters are approximately band-pass: each allows most of the energy in a certain band of wavelengths through, while blocking most of the energy outside the band. The physical filters attached to a telescope lens closely match the standardized filters of some filter systems. The five SDSS filters are named for the wavelengths they are most likely to let pass: ultraviolet ($u'$), green ($g'$), red ($r'$), near infrared ($i'$), and infrared ($z'$). Figure~\ref{sdss-filter-curves} shows how likely a photon of particular wavelength is to pass through each filter. \cite{fukugita1996sloan} further describe the SDSS filter system. We model flux with respect to the $B = 5$ filters of the SDSS filter system. We designate a particular filter as the ``reference'' filter, letting the random variable $r_s$ denote the flux of object $s$ with respect to that filter. A priori, \begin{align} r_s | (a_s = i) &\sim \mathrm{LogNormal}(\mathcal R_{i1}, \mathcal R_{i2}). \end{align} Our prior depends on $a_s$ to reflect that stars tend to have higher flux density than galaxies. The flux density $r_s$ is measured in nanomaggies~\citep{sdssglossary,nanomaggies}. One nanomaggy is equivalent to $3.631 \times 10^{-6}$ Jansky. A nanomaggy is a linear unit; we expect to receive twice as many photons from a two-nanomaggy light source as from a one-nanomaggy light source. The log-normal distribution reflects that flux is non-negative and that stars' fluxes often differ by orders of magnitude. Empirically, a log-normal distribution fits the SDSS catalog better than any gamma distribution---another common model for non-negative real-valued variables. In future work, we may also explore a power law distribution for galaxy fluxes, as there is some theoretical support for that model. The flux of light source $s$ with respect to the remaining $B-1$ filters is encoded using colors. The color $c_{s\beta}$ is defined as the log ratio of fluxes with respect to filters $\beta$ and $\beta + 1$. Here, the filters are ordered by the wavelength bands they let pass. The $B-1$ colors for object $s$ are collectively denoted by $c_s$, a random $(B-1)$-vector. We denote the colors as \textit{u-g, g-r, r-i}, and \textit{i-z}. The reference-filter flux $r_s$ and the colors $c_s$ uniquely specify the flux for light source $s$ through any filter $\beta$, denoted $\ell_{s\beta}$. Our model uses the color parameterization because stars and galaxies have very distinct prior distributions in color space. Indeed, for idealized stars---blackbodies---all $B - 1$ colors lie on a one-dimensional manifold indexed by surface temperature. On the other hand, though galaxies are composed of stars, theory does not suggest they lie near the same manifold: the stars in a galaxy can have many different surface temperatures, and some of the photons are re-processed to other energies through interactions with dust and gas. Figure~\ref{color_priors} demonstrates that stars are much closer to a one-dimensional manifold in color space than galaxies are. We model the prior distribution on $c_s$ as a $D$-component Gaussian mixture model (GMM): \begin{align} c_s | (a_s = i) &\sim \mathrm{GMM}(\mathcal C_{i}^{weight}, C_{i}^{mean}, \mathcal C_{i}^{cov})\,. \end{align} We discuss how we set $D$ and the color priors' hyperparameters in Section~\ref{color_priors}. \begin{figure} \includegraphics[width=3.5in]{figures/color_priors} \caption{Density plots for two colors, \textit{g-r} and \textit{r-i}, based on the SDSS catalog.} \label{color_priors} \end{figure} \subsubsection{Spatial extent} \begin{figure} \begin{floatrow} \ffigbox{% \includegraphics[width=1.8in]{ngc3610} }{% \caption{A schematic of the galaxy light kernel. The blue ellipse surrounds half of the light emissions of this galaxy. The length of the major axis is the half-light radius $e_s^{radius}$. The angle in degrees of the major axis is~${e_s^{angle} = 45}$. The ratio of the lengths of minor and major axes is~${e_s^{axis} = 1/2}$. Because this galaxy is purely elliptical,~${e_s^{profile} = 0}$.}% \label{cartoon-galaxy} } \ffigbox{% \includegraphics[width=1.6in]{figures/faint_galaxy.png} }{% \caption{A distant galaxy approximately 20 pixels in height, estimated to have half-light radius~${e_s^{radius}=0.6}$ arcseconds, rotation angle~${e_s^{angle}=80}$ degrees, and minor-major axis ratio~${e_s^{axis}=0.17}$.} \label{fig:faint_galaxy} } \end{floatrow} \end{figure} \begin{figure} \begin{subfigure}{0.45\textwidth} \includegraphics[height=1.8in]{figures/messier_87.jpg} \subcaption{Messier 87, a galaxy that exhibits the de Vaucouleurs profile. Credit: NASA} \label{fig:dev_galaxy} \end{subfigure} \hfill \begin{subfigure}{0.45\textwidth} \includegraphics[height=1.8in]{figures/triangulum.jpg} \subcaption{Triangulum, a galaxy that exhibits the exponential profile. Credit: NASA} \label{fig:exp_galaxy} \end{subfigure} \caption{Extremal galaxy profiles.} \label{galaxy-profiles} \end{figure} Consider a light source $s$, centered at some direction $u_s$. Its flux density in filter band $\beta$, measured at a possibly different direction $\mu$, is given by \begin{align} \varphi_{s\beta}(\mu) \coloneqq h_s(\mu) \ell_{s\beta}. \end{align} Here $h_s$ (a density) models the spatial characteristics of light source $s$, quantifying its relative intensity at each direction $\mu$ specified in sky coordinates (not image-specific ``pixel coordinates''). We refer to $h_s$ as the ``light kernel'' for light source $s$. The distance from Earth to any star other than the Sun exceeds the star's radius by many orders of magnitude. Therefore, we model stars as point sources. If light source $s$ is a star (i.e., $a_s = 1$), then $h_s$ is simply a delta function: one if $\mu = u_s$, zero otherwise. Modeling the two-dimensional appearance of galaxies as seen from Earth is more involved. If light source $s$ is a galaxy (i.e., ${a_s = 0}$), then $h_s$ is parameterized by a latent random 4-vector \begin{align} e_s \coloneqq (e_s^{profile}, e_s^{angle}, e_s^{radius}, e_s^{axis}). \end{align} We take $h_s$ to be a convex combination of two extremal profiles, known in astronomy as ``de Vaucouleurs'' and ``exponential'' profiles: \begin{align} h_{s}(\mu) &= e_s^{profile} h_{s1}(\mu) + (1 - e_s^{profile}) h_{s2}(\mu). \end{align} The de Vaucouleurs profile is characteristic of elliptical galaxies, whose luminosities vary gradually in space (Figure~\ref{fig:dev_galaxy}), whereas the exponential profile matches spiral galaxies (Figure~\ref{fig:exp_galaxy})~\citep{feigelson2012modern}. The profile functions $h_{s1}(\mu)$ and $h_{s2}(\mu)$ also account for additional galaxy-specific parameters illustrated in Figure~\ref{cartoon-galaxy}. In particular, each profile function is a rotated, scaled mixture of bivariate normal distributions. Rotation angle and scale are galaxy-specific, while the remaining parameters of each mixture are not: \begin{align} h_{si}(\mu) & = \sum_{j=1}^{J} \alpha_{ij} \phi(\mu; u_{s}, \tau_{ij} \Sigma_{s}), \quad i = 1 \text{ or } 2. \label{eq:hsi} \end{align} Here the $\alpha_{ij}$ and the $\tau_{ij}$ are prespecified constants that characterize the exponential and de Vaucouleurs profiles; $u_s$ is the center of the galaxy in sky coordinates; $\Sigma_s$ is a 2$\times$2-covariance matrix shared across the components; and $\phi$ is the bivariate normal density. The light kernel $h_s(\mu)$ is a finite scale mixture of Gaussians: its mixture components have a common mean $u_s$; the isophotes (level sets of $h_s(\mu)$) are concentric ellipses. Although this model prevents us from fitting individual ``arms,'' like those of the galaxy in Figure~\ref{fig:exp_galaxy}, most galaxies are not sufficiently resolved to see such substructures. Figure~\ref{fig:faint_galaxy} shows a more typical galaxy image. The spatial covariance matrix~$\Sigma_s$ is parameterized by a rotation angle~$e_s^{angle}$, an eccentricity (minor-major axis ratio)~$e_{s}^{axis}$, and an overall size scale~$e_{s}^{radius}$: \begin{align} \Sigma_s \coloneqq R_s^{\top}\begin{bmatrix} [ e_{s}^{radius}]^{2} & 0\\ 0 & [e_{s}^{axis}]^2[e_{s}^{radius}]^{2} \end{bmatrix} R_s, \end{align} where the rotation matrix is given by \begin{align} R_s \coloneqq \begin{bmatrix}\cos e_s^{angle} & -\sin e_s^{angle}\\ \sin e_s^{angle} & \cos e_s^{angle} \end{bmatrix}. \end{align} The scale $e_{s}^{radius}$ is specified in terms of half-light radius---the radius of the disc that contains half of the galaxy's light emissions before applying the eccentricity $e_s^{angle}$. All four entries of $e_s$ are random. The mixing weight prior is given by \begin{align} e_s^{profile} &\sim \mathrm{Beta}(\mathcal E^{profile}_1, \mathcal E^{profile}_2). \end{align} Every angle is equally likely, and galaxies are symmetric, so \begin{align} e_s^{angle} &\sim \mathrm{Uniform}([0, 180]). \end{align} We found that the following half-light-radius distribution fit well empirically: \begin{align} e_s^{radius} &\sim \mathrm{LogNormal}(\mathcal E^{radius}_1, \mathcal E^{radius}_2). \end{align} The ``fatter'' tail of a log-normal distribution fits better than a gamma distribution, for example. A priori, the minor-major axis ratio is beta distributed: \begin{align} e_s^{axis} &\sim \mathrm{Beta}(\mathcal E^{axis}_1, \mathcal E^{axis}_2). \end{align} \subsubsection{Setting the priors' parameters} \label{prior} Our light source prior has 1099 hyperparameters. All but ten are for the GMM color prior. Empirical Bayes is an appealing way to fit this prior because the number of parameters is small relative to the number of light sources (hundreds of millions for SDSS). Unfortunately, re-fitting the prior parameters iteratively during inference---a common way of performing empirical Bayes---is difficult in a distributed setting: fitting the global prior parameters during inference couples together numerical optimization for disparate regions of sky. Instead, we fit the prior parameters based on existing SDSS catalogs through maximum likelihood estimation. Because these prior parameters are fit to a catalog based on the same data we subsequently analyze, this is an empirical Bayes procedure. If the depth of our catalog were much greater than existing SDSS catalogs, we might refit these prior parameters periodically while performing inference. Refitting in this way could be interpreted as a block coordinate ascent scheme. However, in our work to date, the depth of our catalog is limited by the peak-finding preprocessing routine, just as in SDSS. Therefore, for simplicity, we hold these prior parameters fixed during inference. Fitting the color prior warrants some additional discussion. First, maximum-likelihood estimation for a GMM is nonconvex, so the optimization path may matter: we use the GaussianMixture.jl software~\citep{gmm}. Second, we set the number of GMM components $D$ based on computational considerations. In principle, $D$ could be set with a statistical model-selection criterion. In practice, we set $D=8$ without any apparent accuracy reduction for the point estimates, which is the primary way we assess our model in Section~\ref{sec:experiments}. Because we have so much data (millions of light sources), there is no risk of overfitting with $D=8$: held-out log-likelihood improves as $D$ increases up to $D=256$, the largest setting our hardware allowed us to test. There is also little risk that $D=8$ underfits: setting $D=16$ does not substantively change our estimates. Empirical Bayes seems broadly applicable to sky-survey data; the number of light sources in typical surveys is large relative to the number of hyperparameters. But the details of our procedure (e.g., how to set $D$, or whether to update the hyperparameters iteratively during inference) may need to be tailored based on the research goals. If so, our fitted priors may be considered ``interim'' priors. \subsection{Images} \label{images} \begin{figure} \begin{floatrow} \ffigbox{% \includegraphics[width=.6\linewidth]{"figures/sdss_camera"} }{% \caption{The SDSS camera. Its CCDs---each $2048 \times 2048$ pixels---are arranged in six columns and five rows. A different filter covers each row. Credit:~\cite{sdsscamera}.} \label{sdss-camera} } \ffigbox{% \includegraphics[width=\linewidth]{"figures/sdss_filter_curves"} }{% \caption{SDSS filter curves. Filter response is the probability that a photon of a particular wavelength will pass through the filter. Credit:~\cite{doi2010photometric}.} \label{sdss-filter-curves} } \end{floatrow} \end{figure} \begin{figure}[t] \includegraphics[width=3in]{stripemap} \caption{SDSS sky coverage map. Each monocolor arc represents the sky photographed during a particular night. Axes' units are degrees of right ascension (longitude) and declination (latitude). Credit:~\cite{sdsscoverage}.} \label{sdss_coverage} \end{figure} Astronomical images are taken through telescopes. Photons that enter the telescope reach a camera at its base that records the pixel each photon hits, thus contributing an electron. The SDSS camera (Figure~\ref{sdss-camera}) consists of 30 charge-coupled devices (CCDs) arranged in a grid of six columns and five rows. Each row is covered by a different filter---transparent colored glass that limits which photons can pass through and potentially be recorded. Each of the five filters selects, stochastically, for photons of different wavelengths (Figure~\ref{sdss-filter-curves}). Multiple images of the same region of the sky with different filters reveal the colors of stars and galaxies. The SDSS telescope collects images by drift scanning, an imaging regime where the camera reads the CCDs continuously as the photons arrive. Each night the telescope images a contiguous ``arc'' of sky (Figure~\ref{sdss_coverage}). Each arc is divided into multiple image files. SDSS contains $N=$ 4,690,230 of these images, each taken through one of the 30 CCDs. For $n=1,\ldots,N$, the constant $\beta_n$ denotes the filter color for image $n$. Each image is a grid of $M=2048 \times 1361$ pixels. The random variable $x_{nm}$ denotes the count of photons that, during the exposure for image $n$, entered the telescope, passed through the filter, and were recorded by pixel $m$. \subsubsection{Skyglow} The night sky is not completely dark, even in directions without resolvable light sources. This is due to both artificial light production (e.g., light pollution from cities) and natural phenomena. The background flux is called ``skyglow.'' Sources of natural skyglow include sunlight reflected off dust particles in the solar system, nebulosity (i.e., glowing gas---a constituent of the interstellar medium), extragalactic background light from distant unresolved galaxies, night airglow from molecules in Earth's atmosphere, and scattered starlight and moonlight. The flux from skyglow (``sky intensity'') varies by the time of the exposure, due to changing atmospheric conditions. It also varies with direction; for example, sky intensity is typically greater near the galactic plane. We model skyglow as a spatial Poisson process whose rate varies gradually by pixel, independent of stars and galaxies. For the vast majority of pixels, the skyglow is the only source of photons. Sky intensity is estimated during preprocessing by pre-existing software \citep{bertin1996sextractor} and fixed during inference. This software fits a smooth parametric model to the intensities of the pixels that it determines are not near any light source. The sky intensity could, in principle, be fit within our inference procedure; we defer this idea to future work. The sky intensity for image $n$ is stored as a grid of $Q$ intensities in the matrix $\sigma_n$. Typically $Q \ll M$ because the sky intensity varies slowly. To form the sky intensity for a particular pixel, $\sigma_n$ is interpolated linearly. We denote the sky intensity for a particular pixel by $\sigma_{n}(m)$. \subsubsection{Point-spread functions} Astronomical images are blurred by a combination of small-angle scattering in Earth's atmosphere, the diffraction limit of the telescope, optical distortions in the camera, and charge diffusion within the silicon of the CCD detectors. Together these effects are represented by the ``point-spread function'' (PSF) of a given image. Stars are essentially point sources, but the PSF represents how their photons are spread over dozens of adjacent pixels. The PSF is set during preprocessing by pre-existing software~\citep{lupton2001sdss}. This software fits the PSF based on several stars with extremely high flux in each image whose characteristics are well established by previous studies using different instrumentation (e.g., spectrographs). As with sky intensity, we could fit the PSF jointly with light sources through our approximate inference procedure, but we do not pursue this idea here. The PSF is specified through several image-specific parameters that are bundled together in $\psi_n$. The vector $\psi_n^{calib}$ gives the expected number of photons per nanomaggy for each column of image $n$. The vector $\psi_n^{wcs}$ specifies a mapping from sky direction to pixel coordinates. This mapping is linear---an approximation that holds up well locally. The rows of the matrix~$\psi_n^{image}$ give the top principal components from an eigendecomposition of the PSF as rendered on a grid centered at a light source. The vector~$\psi_n^{weight}$ gives the loading of the PSF at any point in the image. It has smooth spatial variation. Consider a one-nanomaggy star having direction $\mu$. We denote its expected contribution of photons to the $m$th pixel of image~$n$ as~$g_{nm}(\mu)$; this is derived as needed from the explicitly represented quantities discussed above. \subsubsection{The likelihood} Let $z_s \coloneqq (a_s, r_s, c_s, e_s, u_s)$ denote the latent random variables for light source $s$. Let $z \coloneqq \{z_s\}_{s=1}^S$ denote all the latent random variables. Then, for the number of photons received by pixel $m$ of image $n$, we take the likelihood to be \begin{align} x_{nm} | z \sim \mathrm{Poisson}(\lambda_{nm}). \label{xnm} \end{align} The dependence of $\lambda_{nm}$ on $z$ is not notated here. We model $x_{nm}$ as observed, though the reality is somewhat more complicated~\citep{frame}: at the end of an exposure, the CCD readout process transfers the electrons to a small capacitor, converting the (discrete) charge to an (analog/continuous) voltage (at the microvolt level) that is amplified and forms the output of the CCD chip. The net voltage is measured and digitized by an analog-to-digital converter (ADC). The conversion is characterized by a conversion gain. The ADC output is an integer called a digital number (DN). The conversion gain is specified in terms of electrons per DN.\footnote{We thank an anonymous reviewer for a precise explanation, which we paraphrase here.} Because of these complexities, it is not clear whether a Poisson distribution is more suitable here than a Gaussian distribution with its mean equal to its variance. We make no claims about the superiority of one or the other. In the SDSS, the sky background is typically at least 500 electrons per pixel, so it seems unlikely that the choice of a Gaussian (with its mean equal to its variance) or a Poisson distribution would matter. Furthermore, neither likelihood simplifies the subsequent inferential calculations. In Equation~\ref{xnm}, the rate parameter $\lambda_{nm}$ is unique to pixel $m$ in image $n$. It is a deterministic function of the catalog (which includes random quantities) given by \begin{align} \lambda_{nm} &\coloneqq \sigma_{n}(m) + \sum_{s=1}^S \ell_{s\beta_n} \int g_{nm}(\mu) h_s(\mu) \,d\mu\,. \end{align} The summation over light sources reflects the assumption that light sources do not occlude one another, or the skyglow. The integral is over all sky locations. In practice, it can be restricted to pixels near pixel $m$---distant light sources contribute a negligible number of photons. Our implementation bases this distance measurement on conservative estimates of light sources' extents from SExtractor~\citep{bertin1996sextractor}. As shorthand, we denote the integral as \begin{align} f_{nms} \coloneqq \int g_{nm}(\mu) h_s(\mu)\,d\mu. \end{align} If light source $s$ is a star, then it is straightforward to express $f_{nms}$ analytically: \begin{align} f_{nms} = g_{nm}(u_s). \end{align} If light source $s$ is a galaxy, the same integral is more complex because galaxies have spatial extent. Our approach is to approximate $\psi_n$ with a mixure of bivariate normal densities. Because Gaussian-Gaussian convolution is analytic, we get an analytic approximation to $f_{nms}$. Our primary use for the model is computing the posterior distribution of its unobserved random variables conditional on a particular collection of astronomical images. We denote the posterior by $p(z | x)$, where $x \coloneqq \{x_{nm}\}_{n=1,m=1}^{N,M}$ represents all the pixel intensities. Exact posterior inference is computationally intractable for the proposed model, as it is for most non-trivial probabilistic models. The next two sections consider two approaches to approximate posterior inference: Markov chain Monte Carlo (MCMC) and variational inference (VI). \section{Markov chain Monte Carlo} \label{sec:mcmc} Markov chain Monte Carlo (MCMC) is a common approach for approximating posterior distributions in computationally challenging Bayesian models. MCMC draws samples from a stochastic process on the parameter space whose stationary distribution is the posterior distribution of interest. The stochastic process is specified by a transition kernel, denoted $\mathcal T$. The empirical distribution of these samples approximates the posterior distribution. Statistics of this empirical distribution, such as its mean and its quantiles, approximate the same statistics of the posterior distribution. Our problem presents two unique challenges for MCMC. First, the state space is extremely high-dimensional---there are multiple random variables for each of millions of light sources. We cannot consider transition kernels that require hand-tuning of dimension-specific parameters, such as step size, proposal variance, or temperature schedule. Second, the state space is trans-dimensional. Galaxies have more parameters than stars, and light source types (star/galaxy) are themselves random. We propose a multi-level sampling procedure. In an outer loop based on (block) Gibbs sampling \citep{bishop2006pattern}, light sources are typically treated sequentially. Each light source's latent variables are sampled with any overlapping light sources' latent variables, denoted $z_{-s}$, held fixed. Formally, in Gibbs iteration $k=1,\ldots,K$, we draw \begin{align} z_s^{(k)} \sim p(z_s | x, z_{-s}) \label{eqzs} \end{align} for light sources $s=1,\ldots,S$ in sequence. To speed up convergence, we initialize $z_1^{(0)},\ldots,z_S^{(0)}$ with approximately correct values determined by a preprocessing routine. This is a valid procedure for sampling from the posterior. The inner loop, based on annealed importance sampling (AIS) \citep{neal2001annealed}, is our procedure for drawing from $p(z_s | x, z_{-s})$. \subsection{Estimating the marginal likelihood} We simulate posterior samples by first separately measuring how well the star and galaxy models explain the observation $x$. First, we use AIS to estimate \begin{align} p(a_s = 1 | x, z_{-s}). \label{eq:source-type-marginal} \end{align} Recall $a_s$ is the Bernoulli random variable that indexes the source type (star/galaxy), and thus the dimension of our state space. AIS allows us to avoid using a trans-dimensional sampler like reversible-jump MCMC \citep{green1995reversible}, a technique that requires constructing a potentially complex trans-dimensional proposal function~\citep{fan2011reversible}. AIS is an iterative procedure to estimate the normalizing constant of an unnormalized probability density $\pi$. In order to estimate distribution in Equation~\ref{eq:source-type-marginal}, we estimate \begin{align} \pi(z_s) \coloneqq p(x | z_s, a_s, z_{-s}) p(z_s | a_s, z_{-s}) \end{align} for both both source types, $a_s = 0$ and $a_s=1$. The normalizing constant of $\pi$ is $p(x | a_s, z_{-s})$. Given an estimate of $p(x | a_s, z_{-s})$ (for both settings of $a_s$) and a prior over $a_s$, we can construct an estimate of $p(a_s | x, z_{-s})$ using Bayes rule. Given a sample from $p(a_s | x, z_{-s})$, we can conditionally simulate an approximate posterior sample of the source type-specific parameters, $p(z_s | a_s, z_{-s}, x)$, using MCMC transitions. In addition to the target $\pi$, AIS takes as input a sequence of $T$ distributions $\pi_0, \pi_1, \dots, \pi_T$ that approach the target. The statistical efficiency of AIS depends on the similarity of intermediate distributions $\pi_{t-1}(z_s) / \pi_{t}(z_s)$. We set $\pi_0(z_s) \coloneqq p(z_s | a_s = 1, z_{-s})$---a normalized density. For $t=1,\ldots,T$, we set \begin{align} \pi_t(z_s) &= \pi_0(z_s)^{1-\gamma_t} \pi(z_s)^{\gamma_t} \end{align} for a sequence of temperatures $0 = \gamma_0 < \gamma_1 < \dots < \gamma_T = 1$. These (unnormalized) distributions interpolate between the prior and the posterior. For $t=1, \dots, T$, let $\mathcal T_t$ be a Markov chain transition that leaves (the normalized version of) $\pi_t$ invariant. To implement each transition kernel, $\mathcal{T}_t$, we use slice sampling, a Markov chain Monte Carlo method that requires no tuning and automatically adapts to the local scale for each variable \citep{neal2003slice}. We iterate over each variable in $z_s$, forming a slice-sampling-within-Gibbs transition kernel. We begin by sampling $z_s^{(0)} \sim \pi_0$. Then, for $t=1, \dots, T$, we draw \begin{align} z_s^{(t)} | z_s^{(t-1)} \sim \mathcal{T}_t(z_s^{(t-1)}, z_s^{(t)}). \end{align} After $T$ iterations, $z_s^{(T)}$ is approximately distributed according to (the normalized version of) $\pi_T = \pi$, and \begin{align} \mathcal Z_s \coloneqq \exp \sum_{t=1}^T \log \frac{\pi_{t}(z_s^{(t-1)})} { \pi_{t-1}(z_s^{(t-1)}) } \end{align} is a consistent estimator of $p(x | a_s = 1, z_{-s})$ \citep{neal2001annealed}. AIS can be viewed as importance sampling over an augmented state-space where the expanded dimensions begin with the prior distribution and gradually anneal to the targeted posterior according to $T$ temperatures. Thus, the ratio of these weights is a consistent estimator of the marginal likelihood. Estimating the marginal likelihood (also referred to as the model evidence) is a rich area of methodological development. \cite{skilling2004nested} presents another popular approach for computing marginal likelihood estimates, known as nested sampling. However, \cite{friel2012estimating} show cases where nested sampling is less efficient statistically and computationally than AIS, motivating our use of AIS in this work. \subsection{Sampling with AIS} The final step of our AIS procedure draws samples from $p(z_s | x, z_{-s})$. For each source type (star/galaxy), we run $N'$ independent repetitions of our AIS procedure. We use the resulting samples as independent starting positions for $N'$ Markov chains. We run these $N'$ chains for $B'$ more steps, monitoring convergence and mixing criteria \citep{gelman1992inference}. This process yields $N'$ estimates of the marginal likelihood, and $N' \times B'$ (correlated) samples drawn from the Markov chain. The summarize, the overall AIS-MCMC sampling procedure corresponding to Equation~\ref{eqzs} is as follows: \begin{itemize} \item For each source type $a_s = a \in \{0, 1\}$ (e.g., ~star or galaxy) \begin{itemize} \item Run $N'$ \emph{independent} marginal likelihood estimators, each with $T$ annealing steps. This results in $N'$ independent estimates of $\log p(x | a_s=a, z_{-s})$ and $N'$ approximate posterior samples from $p(z_s | a_s = a, x, z_{-s})$. \item For each $N'$ approximate posterior samples, run an MCMC chain of length $B'$ (e.g., ~using slice-sampling-within-Gibbs transitions) \end{itemize} \item Use the $\log p(x | a_s = 0, z_{-s})$ and $\log p(x | a_s=1, z_{-s})$ estimates to approximate $p(a_s = a | x, z_{-s})$ \item Use the $N' \times B'$ samples to approximate $p(z_s | a_s = a)$ for both source types $a \in \{0, 1\}$. \item Use the estimate of $p(a_s = a | x, z_{-s})$ to sample a source type $a_s^{(k)}$. Simulate $z_s^{(k)} \sim p(z_s | x, z_{-s}, a_s)$ by randomly choosing one of the $N'$ posterior samples for the sampled source-type $a_s^{(k)}$ to generate samples according to Equation~\ref{eqzs}. \end{itemize} The AIS-MCMC procedure described above requires us to choose a number of samples and iterations. For the experiments we describe in Section \ref{sec:experiments}, we use $T = 200$ annealing steps and $N'=25$ independent samples of the marginal likelihood. For each $N'$ sample, we run an additional slice-sampling MCMC chain for $B'=25$ iterations, producing a total of of $N'\times B' = 625$ correlated posterior samples of $z_s$. \section{Variational inference} \label{sec:vi} Variational inference (VI) chooses an approximation to the posterior distribution $p(z | x)$ from a class of candidate distributions via numerical optimization. The candidate approximating distributions $q_\theta(z)$, called ``variational distributions'', are parameterized by a real-valued vector $\theta$. Through numerical optimization, VI minimizes (with respect to $\theta$) the KL divergence between $q_\theta(z)$ and $p(z|x)$. For an introduction to VI, we recommend \cite{blei2017variational} to statisticians, \cite{mackay1995developments} to physicists, and \cite{smidl2006variational} to readers with a background in signal processing. \subsection{The variational distributions} \label{vi_dist} We restrict the variational distributions to a class that makes KL minimization tractable. Our variational distributions all factorize: \begin{align} q_\theta(z) &=\prod_{s=1}^{S} q(a_{s}) q(u_{s}) q(e_{s}) q(r_{s}|a_{s}) q(c_{s}|a_{s}).\label{eq:q_factorization} \end{align} We have suppressed the subscript $\theta$ in the variational factors. This is not quite mean-field variational inference \citep{blei2017variational}, where the variational distribution factorizes across all random variables, because some factors are conditional on $a_s$ (i.e., whether a light source is a star or a galaxy). The next equations show the constituents of $\theta$. We use ``acute'' and ``hat'' accents to denote variational parameters. For $s=1,\ldots,S$ and $i\in\{0,1\}$ we take \begin{align} q(a_{s}) & \sim\mathrm{Bernoulli}\left( \acute a_s \right),\label{eq0}\\ q\left(r_{s}|a_{s}=i\right) & \sim\mathrm{LogNormal}\left( \acute r_{si}, \hat r_{si}\right),\\ q\left(c_{s}|a_{s}=i\right) & \sim\mathrm{MvNormal}\left( \acute c_{si}, I \hat c_{si}\right),\\ q\left(u_{s}\right) & \sim\mathrm{PointMass}\left( \acute u_s \right),\\ q\left(e_{s}\right) & \sim\mathrm{PointMass}\left( \acute e_s \right).\label{eq1} \end{align} Here $\acute e_s \coloneqq (\acute e_s^{angle}, \acute e_s^{radius}, \acute e_s^{profile}, \acute e_s^{axis})$. Approximating the posterior for $u_s$ and $e_s$ with a point mass is a strong assumption. It is analogous to performing maximum a posteriori (MAP) inference for these parameters. We do so only because of computational considerations: it lets us write the objective function as an analytic expression. Analytic expressions can be optimized efficiently by deterministic numerical optimization routines, which in turn can converge much faster than stochastic optimization \citep{bubeck2015convex}. Ongoing research aims to expand the class of models and variational distributions that can be optimized with deterministic VI, though limitations persist~\citep{fraysse2014measure,zheng2015efficient,giordano2015linear}. \subsection{The variational lower bound} Because $p(x)$ is constant with respect to $\theta$, minimizing $D_{\mathrm{KL}}(q_\theta(z), p(z|x))$ is equivalent to maximizing \begin{align} \mathcal L(\theta) \coloneqq \mathbb{E}_{q_\theta} \left[ \log p(x | z) \right] - D_{KL}(q_\theta(z), p(z)).\label{elbo} \end{align} Maximization of $\mathcal L(\theta)$ is the standard approach; see \cite{blei2017variational} for discussion. The first term of $\mathcal L(\theta)$ is the expected log likelihood of the data. It is \begin{align} \mathbb{E}_{q} \left[\log p(x|z)\right] &=\sum_{n=1}^{N} \sum_{m=1}^{M} \left\{ -\mathbb{E}_{q}\left[\lambda_{nm}\right] + x_{nm}\mathbb{E}_{q}\left[\log \lambda_{nm}\right] -\log\left(x_{nm}!\right) \right\}.\label{eq:log_p_last} \end{align} \subsubsection{Expectation of the rate parameter} The first expectation is \begin{align} \mathbb{E}_{q}\left[\lambda_{nm}\right] &= \sigma_{nm} + \sum_{s=1}^S \mathbb E_q \left[ \ell_{s\beta_n} f_{nms} \right]. \end{align} We can factorize the right-hand expectation based on the factorization of the variational distribution, upon conditioning on $a_s$: \begin{align} \begin{split} \mathbb E_q \left[ \ell_{s\beta_n} f_{nms} \right] = (1 - \acute a_s) &\mathbb E_q \left[ \ell_{s\beta_n} | a_s = 0 \right]\mathbb E_q \left[ f_{nms} | a_s = 0 \right]\\ + \acute a_s &\mathbb E_q \left[ \ell_{s\beta_n} | a_s = 1 \right]\mathbb E_q \left[ f_{nms} | a_s = 1 \right]. \end{split} \label{conditional} \end{align} The integral $\mathbb E_q \left[ \ell_{s\beta} | a_s \right]$ is tractable because flux~$r_s$ and each entry of~$c_s$ (the colors) are independent in the variational distribution given $a_s$. The integral~$\mathbb E_q \left[ f_{nms} | a_s \right]$ is tractable because $u_s$ is a point mass in the variational distribution. \subsubsection{Expectation of the log rate parameter} We approximate the expected logarithm of $\lambda_{nm}$ using the delta method for moments \citep{bickel2015mathematical}. We replace the integrand with a second-order Taylor expansion around its mean: \begin{align} \begin{split} \log(\lambda_{nm}) \approx \log\mathbb{E}_{q}[\lambda_{nm}] &+\frac{1}{\mathbb{E}_{q}[\lambda_{nm}]}\left(\lambda_{nm} - \mathbb{E}_{q}[\lambda_{nm}]\right)\\ &-\frac{1}{2\mathbb{E}_{q}[\lambda_{nm}]^{2}}\left(\lambda_{nm}-\mathbb{E}_{q}[\lambda_{nm}]\right)^{2}\,. \end{split} \end{align} Then, taking expectations, \begin{align} \mathbb{E}_{q}[ \log(\lambda_{nm}) ] &\approx \log\mathbb{E}_{q}[\lambda_{nm}] -\frac{\mathbb{V}_{q}[\lambda_{nm}]}{2\mathbb{E}_{q}[\lambda_{nm}]^{2}}, \end{align} where $\mathbb V_q$ denotes variance with respect to the variational distribution $q$. That term may be further expanded: \begin{align} \mathbb{V}_{q}[\lambda_{nm}] & =\sum_{s=1}^{S}\mathbb{V}_{q}\left[\ell_{s\beta_n}f_{nms}\right]\\ &=\sum_{s=1}^{S} \mathbb{E}_{q}\left[\ell_{s\beta_n}^{2}f_{nms}^{2}\right] - \left(\mathbb{E}_{q}\left[\ell_{s\beta_n}f_{nms}\right]\right)^{2}. \label{vareq} \end{align} The second expectation on the right-hand side is given in Equation~\ref{conditional}. The first is \begin{align} \begin{split} \mathbb{E}_{q}\left[\ell_{s\beta_n}^{2}f_{nms}^{2}\right] &= (1 - \acute a_s) \mathbb E_q \left[ \ell_{s\beta_n}^2 | a_s = 0 \right]\mathbb E_q \left[ f_{nms}^2 | a_s = 0 \right]\\ &+ \acute a_s \mathbb E_q \left[ \ell_{s\beta_n}^2 | a_s = 1 \right]\mathbb E_q \left[ f_{nms}^2 | a_s = 1 \right]. \end{split} \end{align} \subsubsection{KL divergence} Because of the factorization of the variational distribution, the KL term in Equation~\ref{elbo} separates across sources: \begin{align} D_{\mathrm{KL}}(q(z), p(z)) &= \sum_{s=1}^S D_{\mathrm{KL}}(q(z_s), p(z_s)).\label{eq:kl} \end{align} It separates further within each source: \begin{align} \begin{split} D_{\mathrm{KL}}(q(z_s), p(z_s)) &= D_{\mathrm{KL}}(q(a_s), p(a_s))\\ &+ D_{\mathrm{KL}}(q(u_s), p(u_s)) + D_{\mathrm{KL}}(q(e_s), p(e_s))\\ &+ \sum_{i=0}^1 q(a_s = i) \Big[ D_{\mathrm{KL}}(q(r_s | a_s = i), p(r_s | a_s = i))\\ &\qquad\qquad\qquad + D_{\mathrm{KL}}(q(c_s | a_s = i), p(c_s | a_s = i)) \Big]. \end{split} \label{kleq} \end{align} Except for the last, these KL divergences are between common exponential family distributions. We give formulas for them in~\ref{kl}. The last KL divergence is more complicated because the prior on $c_s$ is a Gaussian mixture model. We take the eighth approach from \citet{hershey2007approximating} to identify an upper bound on this KL divergence: \begin{multline} D_{\mathrm{KL}}(q(c_s | a_s = i), p(c_s | a_s = i)) \\ \le D_{\mathrm{KL}}(\xi_i, \mathcal C_{i}^{weights}) + \sum_{j=1}^J \xi_{ij} D_{\mathrm{KL}}(q(c_s | a_s = i), \mathcal C_{ij}). \end{multline} Here $\mathcal C_{i}^{weights}$ is the categorical distribution over the color prior's mixture components, $\mathcal C_{ij}$ is the color prior's $j$th mixture component, and $\xi_{i} \in [0,1]^J$ is a vector of free parameters. To make the bound as tight as possible, we optimize the $\xi_i$ along with the variational lower bound. The optimal $\xi_i$ can also be expressed analytically in terms of $\mathcal C_i$: \begin{align} \xi_{ij}^\star \propto \mathcal C_{ij}^{weights} \exp\{-D_{\mathrm{KL}}(q(c_s | a_s = i), \mathcal C_{ij})\}. \end{align} \subsection{Numerical optimization} \label{numerical} Traditionally, variational lower bounds are maximized through coordinate ascent: each update sets a variational parameter to its optimal value with the others held fixed~\citep{bishop2006pattern,murphy2012machine}. This approach is simple to implement because gradients and Hessians do not need to be explicitly computed. Each update increases the variational lower bound. The algorithm converges to a local optimum even for nonconvex objective functions. However, coordinate ascent can take many iterations to converge when the Hessian of the objective function is not diagonal. Additionally, for many models, including ours, optimal coordinate ascent updates cannot be expressed analytically. Instead, we propose an optimization procedure based on \textit{block} coordinate ascent. Each light source corresponds to a block of 44 parameters: the 37 variational parameters in Equations~\ref{eq0}--\ref{eq1} and the $7$-dimensional parameter $\xi$. We optimize each block by calling a subsolver, explained in the next paragraph. Because most pairs of light sources do not overlap, the Hessian has low fill off the block diagonal. Block coordinate ascent converges quickly in this setting: for light sources that do not overlap with any other light source, just one update step, based on one call to a subsolver, is required to reach a local maximum. For groups of light sources that overlap with each other, a few passes over each light source suffice in practice. Light sources may be optimized in a round-robin order or at random. As a subsolver to optimize one block of parameters with all others fixed, we use Newton's method with a trust-region constraint that restricts each step to a Euclidean ball centered at the previous iterate~\citep{nocedal2006numerical}. The trust-region constraint ensures that we find a local maximum even though the variational objective is nonconvex. The method consistently converges in tens of iterations, whereas first-order methods take thousands. BFGS~\citep{nocedal2006numerical} also on occasion required thousands of iterations per call. Newton iterations are more expensive computationally than the iterations of first-order methods because the former require computing a dense Hessian along with each gradient. For our objective function, computing both a Hessian and a gradient takes $3\times$ longer than computing a gradient alone. In the end, we gain at least an order of magnitude speedup by using Newton's method rather than a gradient-only method because the former requires many fewer iterations. \subsection{Distributed optimization} \label{distributed} Modern compute clusters and supercomputers contain many individual \textit{compute nodes} that execute instructions in parallel. Additionally, each compute node runs many \textit{threads} in parallel---at least one per CPU core. Communication among compute nodes is orders of magnitude slower than communication among threads on the same node. Block coordinate ascent (the outer loop of our optimization procedure) is a serial algorithm: if multiple blocks of parameters are updated simultaneously based on the current iterate, the objective value may decrease, and the algorithm may diverge. By taking of advantage of the structure of our problem, however, we parallelize block coordinate ascent across both compute nodes and CPU cores. Equation~\ref{eq:log_p_last} is a sum over pixels and Equation~\ref{eq:kl} is a sum over light sources. Therefore, our objective function may be expressed as a sum whose terms each depend on the parameters for at most one light source from any particular collection of non-overlapping light sources. Thus, for any collection of non-overlapping light sources, maximizing over each light source's parameters serially is equivalent to maximizing over all these light sources' parameters in parallel. Each compute node is tasked with optimizing all the light sources in a region of the sky. Because these light sources are physically near each other, they appear in many of the same images; we only need to load these images once for to infer parameters for all these light sources. Each node implements a locking mechanism that prevents its threads from optimizing overlapping light sources simultaneously. Because within-node communication is fast, there is almost no overhead from this type of locking mechanism. Communication between nodes is relatively slow. We avoid using an inter-node locking mechanism by assigning each node to optimize different regions of the sky. Because the boundaries of these regions are small relative to the interior, we find an iterate near a stationary point with this approach. A second pass with shifted boundaries ensures that even light sources near a boundary during the first pass are fully optimized. \section{Experimental results} \label{sec:experiments} Our experiments aim to assess 1)~whether the proposed model is a viable alternative to current software pipelines; 2)~how MCMC and VI compare, statistically and computationally; and 3)~how well our procedures quantify uncertainty. We base our experiments both on synthetic images drawn from our model (Section~\ref{sec:synth}) and images from the Sloan Digital Sky Survey (Section~\ref{sec:real}). For both datasets, we run both the MCMC procedure from Section~\ref{sec:mcmc} (henceforth, MCMC) and the variational inference procedure from Section~\ref{sec:vi} (henceforth, VI), and compare their posterior approximations.% \footnote{Open-source software implementing our inference procedures is available from \url{https://github.com/jeff-regier/Celeste.jl}. Jupyter notebooks demonstrating how to replicate all reported results are stored in the \texttt{experiments} directory.} We assess the accuracy of point estimates (e.g., posterior means/modes) and uncertainties (e.g., posterior variances), as well as star/galaxy classification accuracy. Our accuracy measures are averaged over a population of light sources. While no single metric of quality suffices for all downstream uses of catalogs, good performance on the metrics we report is necessary (though perhaps not always sufficient) for good performance on most downstream tasks. \subsection{Synthetic images} \label{sec:synth} \begin{figure}[!hb] \begin{subfigure}{.49\textwidth} \includegraphics[width=0.95\textwidth]{figures/real.jpg} \end{subfigure} \begin{subfigure}{.49\textwidth} \includegraphics[width=0.95\textwidth]{figures/synthetic.jpg} \end{subfigure} \caption{\textit{Left:} An image from SDSS containing approximately 1000 detectable light sources. Pixels in error are ``masked'' (black strips). \textit{Right:} A synthetic image for the same region, generated from our model by conditioning on an SDSS catalog for that region. (Several of the light sources with extremely high flux are excluded---the CCDs cannot record such high flux.)} \label{real-synthetic} \end{figure} \begin{figure} \begin{floatrow} \ffigbox{% \includegraphics[width=\linewidth]{plots-synthetic/pstar_roc_comparison.png} }{% \caption{ROC curve for star/galaxy classification on synthetic data.} \label{roc-synth} } \capbtabbox{% \scalebox{.85}{ \input{plots-synthetic/error_vb_mc_comparison-pair.tex} } \vspace{0.5em} }{% \caption{% Left columns: Mean absolute error on synthetic data. \textbf{Lower is better.} Right column:~Pairwise error differences (and standard error). Statistically significant differences appear in bold font.} \label{tab:err-synth} } \end{floatrow} \end{figure} \begin{figure} \centering \begin{subfigure}{.49\textwidth} \centering \includegraphics[width=\linewidth]{plots-synthetic/error-scatter-log_flux_r-star.png} \caption{log flux (stars)} \end{subfigure} \begin{subfigure}{.49\textwidth} \centering \includegraphics[width=\linewidth]{plots-synthetic/error-scatter-color_ri-star.png} \caption{color r-i (stars)} \end{subfigure} \\ \begin{subfigure}{.49\textwidth} \centering \includegraphics[width=\linewidth]{plots-synthetic/error-scatter-log_flux_r-gal.png} \caption{log flux (galaxies)} \end{subfigure} \begin{subfigure}{.49\textwidth} \centering \includegraphics[width=\linewidth]{plots-synthetic/error-scatter-color_ri-gal.png} \caption{color r-i (galaxies)} \end{subfigure} \caption{VI and MCMC performance on synthetic data. Each pair depicts VI (left, blue) and MCMC (right, orange) with the ground truth along the $x$-axis and the posterior distribution (showing two standard deviations) along the $y$-axis.} \label{qq-synth} \end{figure} \begin{table}[b] \scalebox{.75}{ \input{plots-synthetic/uscore_vb.tex} }~ \scalebox{.75}{ \input{plots-synthetic/uscore_mc.tex} } \vspace{.5em} \caption{ Proportion of light sources having posterior means found by VI (left) and MCMC (right) near the ground truth for synthetic images.} \label{tab:calibration-synth} \end{table} \begin{figure}[b] \begin{subfigure}{.32\textwidth} \centering \includegraphics[width=\linewidth]{plots-synthetic/posterior-comparison-gal-log_flux_r-src-302.png} \caption{} \end{subfigure} \begin{subfigure}{.32\textwidth} \centering \includegraphics[width=\linewidth]{plots-synthetic/posterior-comparison-star-log_flux_r-src-43.png} \caption{} \end{subfigure} \begin{subfigure}{.32\textwidth} \centering \includegraphics[width=\linewidth]{plots-synthetic/posterior-comparison-star-log_flux_r-src-83.png} \caption{} \end{subfigure} \caption{Comparison of posterior uncertainty for the flux of three synthetic light sources where the posterior mean is a poor prediction of the true parameter value. VI underestimates posterior uncertainty. MCMC assigns much greater posterior density to the true values.} \label{uq-synth} \end{figure} Synthetic images let us compare inference methods without model misspecification. On synthetic images, ``ground truth'' for the latent random variables is known. Synthetic images also let us validate our model by visually checking their similarity to real images. To generate realistic synthetic images, we take the non-inferred parameter values from real SDSS images, including the point-spread function $\psi_n$, the sky background $\sigma_n$, and structural constants like the dimensions of the images. To illustrate that synthetic data resemble real images, Figure~\ref{real-synthetic} depicts a synthetic image generated using parameters from an existing catalog. In our experiments, the light sources in synthetic images are instead drawn from the prior. Our synthetic study set comprises five overlapping $2048 \times 1489$-pixel images. Each image is for a different filter band. The images contain approximately 500 detectable light sources. Empirically, MCMC performs better for star/galaxy classification than VI for all thresholds of a receiver operating characteristic (ROC) curve (Figure~\ref{roc-synth}). Both methods have a high area under the curve (AUC). For MCMC, the AUC is 0.994. For VI, the AUC is 0.981. Both methods estimate means well for all continuous latent random variables (Table~\ref{tab:err-synth}). MCMC outperforms VI significantly for some point estimates. ``Direction'' is error, in arcseconds (0.396 pixels), for the directions of the light sources' centers. ``Flux'' measures the reference band (r-band) flux. ``Colors'' are ratios of magnitudes in consecutive bands. ``Galaxy profile'' is a proportion indicating whether a galaxy is de Vaucouleurs or exponential. ``Galaxy axis'' is the ratio between the lengths of a galaxy's minor and major axes. ``Galaxy radius'' is the half-light radius of a galaxy in arcseconds. ``Galaxy angle'' is the orientation of a galaxy in degrees. For color and flux, MCMC often has larger posterior uncertainty. MCMC assigns substantial probability density to the truth more often than VI (Figure~\ref{qq-synth}). For light sources where posterior means are particularly poor predictors of the truth, VI severely underestimates the uncertainty, whereas MCMC assigns much greater posterior density to the true values (Figure~\ref{uq-synth}). For color and log flux---both normally distributed quantities in this synthetic data---errors from MCMC are more nearly normally distributed than those of VI (Table~\ref{tab:calibration-synth}). These empirical results are anticipated by theory: VI underestimates the posterior uncertainty because independence assumptions in the variational distribution do not hold in the posterior~\citep{bishop2006pattern}. Additionally, differences between the candidate variational distributions' marginals and the posteriors' marginals are a source of bias. For the marginals we approximate with point masses (those of $u_s$ and $e_s$), that may be a particularly important source of bias. \subsection{Real images from SDSS} \label{sec:real} Absolute truth is not currently knowable for astronomical catalogs. Fortunately, one area of the sky, called ``Stripe 82,'' has been imaged many times in SDSS. This region provides a convenient validation strategy: combine exposures from all Stripe-82 runs to produce a high signal-to-noise image, then use parameters estimated from the combined exposure as a surrogate ground truth. Photo~\citep{lupton2005sdss} is the primary software pipeline for cataloging SDSS. We use Photo's estimated parameters from the combined Stripe 82 imagery as ground truth. We then run Photo and our method on just one of the 80 image sets, comparing the results from each to the ground truth. Although this ``ground truth'' is still prone to errors, such errors typically favor Photo, since any systematic errors will be consistent in Photo's output. To reduce the runtime of our algorithms, we test them on only a subset of Stripe 82. Our Stripe 82 study set comprises five overlapping $2048 \times 1489$-pixel images for a typical region of sky. Each of these images is captured through a different filter. The images contain approximately 500 detectable light sources. For star/galaxy classification in SDSS data, MCMC outperforms VI at some thresholds and performs slightly worse than VI at others (Figure~\ref{roc-real}). In addition to point estimates, our inference procedures approximate posterior uncertainty for source type (star or galaxy), flux, and colors. This is a novel feature of a Bayesian approach, offering astronomers a principled measure of the quality of inference for each light source; Photo gives only conditional uncertainty estimates. The MCMC procedure is certain ($> 99\%$ certainty) about the classification (star vs. galaxy) for 321 out of 385 light sources. Of these classifications, 319 (99.4\%) are correct. Of the remaining classifications (>1\% uncertainty), 50 (78.1\%) are correct. The VI procedure is certain ($> 99\%$ certainty) about the classification for 322 out of 385 light sources. Of these classifications, 318 (98.8\%) are correct. Of the remaining classifications (>1\% uncertainty), 53 (84.1\%) are correct. Table~\ref{tab:err-s82} is our main empirical result. It quantifies point-estimate error from MCMC and VI for the real-valued latent random variables, as well as providing a paired error comparison between each method. MCMC and VI both substantially outperform Photo. Both make especially large improvements in estimating color. Only our model has a prior on color; Photo estimates band flux independently for each light source. Point-estimate errors for MCMC and VI differed significantly only for galaxy profile and galaxy axis ratio. For galaxy axis, MCMC outperformed VI, repeating our experience with synthetic data. For galaxy profile, however, VI outperformed MCMC---the opposite of how the methods compared on synthetic data. Sampler diagnostics, though not conclusive, suggest that insufficient mixing was not to blame. Model misfit, though an obvious explanation for any result not shared by synthetic data, seems inadequate because MCMC recovered the other galaxy shape parameters at least as well as VI. Our leading explanation is that ``ground truth'' is unreliable for galaxy profile, and that VI more accurately recreates the ground-truth mistakes. Recall ground truth is determined by additively combining many overlapping images. These images were taken through a variety of atmospheric conditions. Errors in the point-spread function (PSF) are likely compounded by the addition of more data. Galaxy profile may be particularly susceptible to errors in the PSF because it has the capacity to model image blur that should have be attributed to the PSF. For SDSS images, MCMC had better calibrated uncertainty estimates, particularly for log flux (Figure~\ref{qq-real}, Figure~\ref{uq-real}, and Table~\ref{tab:calibration-s82}). Recall that on the synthetic data, MCMC substantially outperformed VI at modeling uncertainty, producing empirical uncertainties that followed their theoretical distribution almost exactly (Table~\ref{tab:calibration-synth}). On real data, uncertainty estimates for both MCMC and VI are worse than on synthetic data. Model misspecification appears to have an effect on MCMC that is comparable to the effect of the bias introduced by the independence assumptions of the variational distribution. \begin{figure} \centering \begin{subfigure}{.45\textwidth} \centering \includegraphics[width=\linewidth]{plots-s82/pstar_roc_comparison.png} \end{subfigure} \caption{The receiver operating characteristic (ROC) curve for star/galaxy classification on Stripe 82 data. The area under the curve (AUC) for MCMC is 0.991 and for VI is 0.985. } \label{roc-real} \end{figure} \begin{table} \centering \scalebox{.85}{ \input{plots-s82/error_vb_mc_comparison-pair.tex} } \vspace{0.5em} \caption{% \textit{Left columns:} Mean absolute error on Stripe 82 data. \textbf{Lower is better.} \textit{Right columns:}~Pairwise error differences for each pair of methods (and standard error). Statistically significant differences appear in bold font.} \label{tab:err-s82} \end{table} \begin{figure} \centering \begin{subfigure}{.49\textwidth} \centering \includegraphics[width=\linewidth]{plots-s82/error-scatter-log_flux_r-star.png} \caption{log flux (stars)} \end{subfigure} \begin{subfigure}{.49\textwidth} \centering \includegraphics[width=\linewidth]{plots-s82/error-scatter-color_ri-star.png} \caption{color r-i (stars)} \end{subfigure} \\ \begin{subfigure}{.49\textwidth} \centering \includegraphics[width=\linewidth]{plots-s82/error-scatter-log_flux_r-gal.png} \caption{log flux (galaxies)} \end{subfigure} \begin{subfigure}{.49\textwidth} \centering \includegraphics[width=\linewidth]{plots-s82/error-scatter-color_ri-gal.png} \caption{color r-i (galaxies)} \end{subfigure} \caption{VI and MCMC performance on real data from Stripe 82. Each pair depicts VI (left, blue) and MCMC (right, orange), with the ground truth along the $x$-axis and the posterior distribution (showing two standard deviations) along the $y$-axis.} \label{qq-real} \end{figure} \begin{table} \scalebox{.75}{ \input{plots-s82/uscore_vb.tex} }~ \scalebox{.75}{ \input{plots-s82/uscore_mc.tex} } \vspace{.5em} \caption{% Proportion of light sources having posterior means found by VI (left) and MCMC (right) near the ground truth for SDSS images.} \label{tab:calibration-s82} \end{table} \begin{figure}[b] \begin{subfigure}{.32\textwidth} \centering \includegraphics[width=\linewidth]{plots-s82/posterior-comparison-star-log_flux_r-src-28.png} \caption{} \end{subfigure} \begin{subfigure}{.32\textwidth} \centering \includegraphics[width=\linewidth]{plots-s82/posterior-comparison-star-log_flux_r-src-38.png} \caption{} \end{subfigure} \begin{subfigure}{.32\textwidth} \centering \includegraphics[width=\linewidth]{plots-s82/posterior-comparison-gal-log_flux_r-src-249.png} \caption{} \end{subfigure} \caption{Comparison of posterior uncertainty for the flux of three light sources from Stripe 82 where the posterior mean is a poor prediction of the true parameter value. VI underestimates posterior uncertainty. MCMC assigns much greater posterior density to the true values.} \label{uq-real} \end{figure} \subsection{Runtime comparison} MCMC took approximately $1000\times$ longer in wall-clock time than VI to attain good results. The implementations for MCMC and VI were both carefully optimized for speed, to make their runtimes comparable. In fact, the majority of runtime for MCMC was spent in code also used by VI, since the most computationally intensive calculations (across pixels) are shared by both the variational lower bound and the log likelihood function. This largely rules out ``implementation differences'' as an explanation for the disparity in runtime. The same hardware was used for all timing experiments: a single core of an Intel Xeon E5-2698 v3 clocked at 2.30GHz. Our MCMC experiments use a temperature schedule of length 200 for annealed importance sampling (AIS). We repeated AIS 25 times to generate 25 independent estimates of the normalizing constant for each model. We then ran each of these 25 independent posterior samples for 25 more slice sampling steps, generating 625 correlated samples. For MCMC, the number of samples drawn scales linearly with runtime, presenting a speed/accuracy trade-off. However, the quality of an MCMC posterior approximation is a function of the number of effectively independent samples~\citep{gelman2014bayesian}. We measure the rate at which slice sampling is able to compute effectively independent samples for a single source ($52\times 52$ image patch). For stars, we compute 0.225 effectively independent samples per second. For galaxies, we compute 0.138 effectively independent samples per second. VI is able to compute an approximate posterior distribution for one light source in 9 seconds, on average, for a region of sky imaged once in each of five filter bands. This runtime holds for either synthetic or SDSS data; runtime is largely determined by the number of pixels. \subsection{Deblending} \begin{figure} \begin{subfigure}{0.45\textwidth} \includegraphics[width=1.8in]{figures/three_sources_in_a_row} \subcaption{Two galaxies and one star. Their centers are on a line.} \label{three_sources_in_a_row} \end{subfigure} \hfill \begin{subfigure}{0.45\textwidth} \includegraphics[width=1.8in]{figures/three_sources_two_overlap} \subcaption{Two stars and one galaxy, all having 10-nanomaggy flux density.} \label{three_sources_two_overlap} \end{subfigure} \caption{Simulated astronomical images from GalSim.} \label{galsim_images} \end{figure} For the proposed model, overlapping light sources are not a special case requiring special processing logic. Existing cataloging pipelines, on the other hand, invoke specialized ``deblending'' routines to deal with overlapping light sources, to avoid, for example, double counting photons. In this section, we evaluate our procedure using simulated astronomical images from GalSim~\citep{rowe2015galsim}. Using simulated rather than real data is particularly important for deblending experiments, because ground truth is particularly difficult to establish for overlapping light sources. In contrast to our synthetic data (Section~\ref{sec:synth}), the simulated data is not drawn from our model, so there is the potential for model misfit.% First, we consider images where three or more peaks in a blend appear in a straight line, because this case was the ``single biggest failure mode'' for the deblending algorithm used by the Hyper Suprime-Cam (HSC) software pipeline~\citep{bosch2018hyper}. To verify that this represents no special challenge to our model, we generated the astronomical image in Figure~\ref{three_sources_in_a_row}. The correct r-band fluxes of the light sources, ordered from bottom to top, are 10 nanomaggies, 3 nanomaggies, and 3 nanomaggies. Our VI procedure correctly classifies all three and determines that their respective flux densities are 9.98 nanomaggies, 2.90 nanomaggies, and 3.01 nanomaggies. The classifications are correct (assigning greater than 99\% probability to the truth), and mean galaxy angles are both within a few degrees of the truth. We do not report the HSC pipline's estimation on this image because we could not get it to run without errors. Second, we consider images with more severe blending and compare our algorithm to SExtractor~\citep{bertin1996sextractor}. Unlike the SDSS and HSC pipelines, SExtractor is relatively straightforward to run on new data. Recently released Python bindings make using it particularly straightforward~\citep{barbary2016sep}. SExtractor is among the most used cataloging software today. Figure~\ref{three_sources_two_overlap} shows a second simulated image we used for testing. These light sources all have high flux density---10 nanomaggies each. The approximate posterior mean recovered by our VI procedure assigns 9.87 nanomaggies, 9.95 nanomaggies, and 10.12 nanomaggies to these light sources. SExtractor, on the other hand, estimates their flux densities to be 10.85 nanomaggies, 12.81 nanomaggies, and 14.91 nanomaggies. \cite{melchior2018scarlet} propose a new deblending algorithm, called SCARLET, and report improvements over the HSC approach to deblending. SCARLET appears at first glance to be quite different from our approach: it is based on non-negative matrix factorization (NMF) rather than Bayesian statistics. However, NMF algorithms can be cast as computing a maximum a posteriori (MAP) estimate under some assumptions on the distribution of the data and the factors~\citep{schmidt2009bayesian}, so SCARLET may have some similarity to what we propose. \section{Bayesian inference at petascale} \label{sec:at-scale} Catalog inference is a ``big data'' problem that does not parallelize trivially. This section introduces high-performance computing (HPC) to a statistics audience by describing large-scale runs of our variational inference procedure. We construct a catalog from the entire 50-terabyte SDSS dataset. More importantly, we attain the computational efficiency needed to process the next generation of surveys, which will include $\mathcal O(100)$ petabytes of image data. \subsection{Hardware} Our test platform was the Cori supercomputer---currently ranked eighth in the global ``Top 500'' rankings~\citep{top500}. Cori comprises 9,688 compute nodes connected by a high-speed network~\citep{cori}. Each compute node has 112 GB of memory and one processor, an Intel Xeon Phi 7250, commonly referred to as ``Knights Landing.'' Though Knights Landing runs at only 1.4 GHz, it more than makes up for this relatively slow clock by executing many instructions in parallel during each clock cycle. A single Knights Landing processor has 68 cores---physically distinct regions of the processor that execute instructions in parallel. Each core simultaneously runs two hardware threads that appear to the operating system as separate cores. A hardware thread executes batches of instructions twice per clock cycle: once on the ``up-tick'' and once on the ``down-tick.'' During each tick, a hardware thread may execute the same instruction on eight different 64-byte floating point numbers. This is known as single-instruction multiple-data (SIMD) parallelism. \subsection{Efficient thread-level execution} \label{thread} Supercomputer programs are written almost exclusively in verbose languages like assembly, Fortran, C, and C\texttt{++}. Many statisticians, however, prefer very high-level (VHL) languages like R and Python. These languages often require $5\times$ to $10\times$ fewer lines of code to express the same algorithm. Unfortunately, they also often run $10\times$, $100\times$, or even $1000\times$ slower than equivalent C code~\citep{juliabenchmarks}. For high-performance computing, these languages are therefore limited to serving as ``glue'' code that connects libraries (e.g., BLAS, TensorFlow) that are implemented in more efficient languages. In turn, writing code in two languages prevents many optimizations~\citep{bezanson2017julia}. Our work uses the Julia programming language~\citep{bezanson2017julia} for the first time in an HPC setting. Julia matches both the succinctness of scripting languages and the speed of C. The ``hot spots'' in a Julia codebase, however, must be written carefully to attain C-like speed. The process of tuning Julia code to run in an HPC setting is iterative. It begins with profiling a typical execution of the code to find bottlenecks; intuition about which lines of code are hotspots is a poor substitute for measurement. Our first round of bottlenecks involved memory allocation, where the program requests that the operating system assign it more memory. We removed all these memory allocations from loops that contributed significantly to runtime by allocating the memory up front (i.e., ``pre-allocating'' memory). The next round of bottlenecks was due to memory access: processors cannot execute instructions until data has been transferred from main memory to the processor's registers. A hardware thread may remain idle for approximately 200 clock cycles while fetching one number from main memory. Memory-access bottlenecks need to be fixed on a case-by-case basis. The solution typically involves some reordering of the computation to enable better prefetching of data from main memory. In some cases, we save time by recomputing values rather than fetching them. \subsection{Multi-node scaling} In HPC, ``scalability'' refers to how a program's performance varies with the capacity of the hardware devoted to executing the program \citep{hager2010introduction}. We assess scaling empirically in two ways. First, we vary the number of compute nodes while keeping the amount of work constant per compute node (``weak scaling''); many compute nodes can solve a much larger problem. Here the problem size is the area of the sky that we are constructing a catalog for. Second, we vary the number of compute nodes while keeping the total job size constant (``strong scaling''); many compute nodes have to further subdivide the problem. The two scaling metrics give different perspectives to inform predictions about how a particular supercomputer program will perform on future datasets, which may be much larger than any of the datasets used for testing. Generally, it is harder to use more compute nodes efficiently. Ideal weak scaling is constant runtime as the number of compute nodes increases. Figure~\ref{fig:weak_scaling} shows instead that our runtime roughly doubles as the number of compute nodes increases from 1 to 8192. Ideal strong scaling is runtime that drops by a factor of $1/c$ when the number of compute nodes grows by a factor of $c$. Figure~\ref{fig:strong_scaling} shows instead that our runtime roughly halves as the number of compute nodes quadruples from 2048 to 8192. Additionally, the scaling graphs break out runtime by component. The \textit{image loading} component is the time taken to load images while worker threads are idle. After the first task, images are prefetched in the background, so the majority of image loading time accrues up front. Image loading time is constant in the weak scaling graph and proportional to the inverse of the number of nodes in the strong scaling graph---exactly what we want. We are not I/O bound even at high node counts. The \textit{load imbalance} component is time when processes are idle because no tasks remain, but the job has not ended because at least one process has not finished its current task. Both scaling graphs indicate that load imbalance is our primary scaling bottleneck. Fortunately, the load imbalance is due to having only 4 tasks per process. With at least $1000\times$ more data, the volume we expect from LSST, the load imbalance should become negligible. The \textit{task processing} component is the main work loop. It involves no network or disk I/O, only computation and shared memory access. Because of this, task processing serves as a sanity check for both graphs: it should, and does, stay roughly constant in the weak scaling graph and vary in inverse proportion to the number of nodes in the strong scaling graph. The \textit{other} component is everything else. It is always a small fraction of the total runtime. It includes scheduling overhead, network I/O (excluding image loading), and writing output to disk. \begin{figure}[ht] \begin{subfigure}{.48\textwidth} \begin{tikzpicture}[scale=.9] \begin{semilogxaxis}[ const plot, smooth, width=2.5in, height=2.5in, stack plots=y, area style, xlabel=compute nodes (log scale), xtick={2,8,32,128,512,2048,8192}, xticklabels={2,8,32,128,512,2048,8192}, enlarge x limits=false, log basis x={2}, log ticks with fixed point, ymin=0, ymax=1300, ylabel=seconds, legend pos=north west, legend columns=1, legend cell align={left}, legend style={font=\scriptsize}] \addplot[fill=orange] table[x=nodes,y=opt_srcs] {figures/weak_scaling_GB.txt} \closedcycle; \addlegendentry{task processing} \addplot[fill=cyan] table[x=nodes,y=load_wait] {figures/weak_scaling_GB.txt} \closedcycle; \addlegendentry{image loading} \addplot[fill=magenta] table[x=nodes,y=wait_done] {figures/weak_scaling_GB.txt} \closedcycle; \addlegendentry{load imbalance} \addplot[fill=gray] table[x=nodes,y=other] {figures/weak_scaling_GB.txt} \closedcycle; \addlegendentry{other} \end{semilogxaxis} \end{tikzpicture} \caption{Weak scaling} \label{fig:weak_scaling} \end{subfigure} \hfill \begin{subfigure}{.48\textwidth} \begin{tikzpicture}[scale=.9] \begin{semilogxaxis}[ const plot, smooth, width=2.5in, height=2.5in, stack plots=y, area style, xtick={2048,4096,8192}, xticklabels={2048,4096,8192}, xlabel=compute nodes (log scale), enlarge x limits=false, log basis x={2}, log ticks with fixed point, ymin=0, ymax=2600, ylabel=seconds, legend pos=north east, legend columns=1, legend cell align={left}, legend style={font=\scriptsize}] \addplot[fill=orange] table[x=nodes,y=opt_srcs]{figures/strong_scaling_GB.txt} \closedcycle; \addlegendentry{task processing} \addplot[fill=cyan] table[x=nodes,y=load_wait]{figures/strong_scaling_GB.txt} \closedcycle; \addlegendentry{image loading} \addplot[fill=magenta] table[x=nodes,y=wait_done]{figures/strong_scaling_GB.txt} \closedcycle; \addlegendentry{load imbalance} \addplot[fill=gray] table[x=nodes,y=other]{figures/strong_scaling_GB.txt} \closedcycle; \addlegendentry{other} \end{semilogxaxis} \end{tikzpicture} \caption{\textcolor{black}{Strong scaling}} \label{fig:strong_scaling} \vfill \end{subfigure} \caption{Scaling results. Load imbalance is due to the limited size of our study dataset---real datasets will be much larger. See text for additional discussion.} \label{fig:scaling} \end{figure} \subsection{Peak performance} To assess the peak performance that can be achieved for Bayesian inference at scale, we prepared a specialized configuration for performance measurement in which the processes synchronize after loading images, prior to task processing. We ran this configuration on 9568 Cori Intel Xeon Phi nodes, each running 17 processes of eight threads each, for a total of 1,303,832 threads. 57.8 TB of SDSS image data was loaded over a ten-minute interval. (Some regions were loaded multiple times, as prescribed by our algorithm.) The peak performance achieved was 1.54 PFLOP/s in double-precision. To the best of our knowledge, this experiment (conducted in May 2017) was the first time a supercomputer program in any language other than C, C\texttt{++}, Fortran, or assembly has exceeded one petaflop in double-precision. \subsection{Complete SDSS catalog} In a long-running job with 256 compute nodes, we constructed a preliminary astronomical catalog based on the entire SDSS. The catalog is 21 GB and contains 112 million light sources. Spot checking results gives us high confidence that distributed executions of our program give the same results as serial executions. We are considering both the FITS file format~\citep{wells1979fits} and the HDF5 file format~\citep{folk2011overview} for distributing future catalogs. FITS is the standard format for astronomical images and catalogs, whereas the HDF5 format has better I/O speed and compression~\citep{price2015hdfits}. Another possibility is distributing the catalog inference code rather than the catalog. That approach encourages users to adapt the statistical model and the priors to their needs and to treat the catalog as an intermediate data product~\citep{turon2010telescopes}. \subsection{How to use a Bayesian catalog} Catalogs based on approximate posterior inference need to be used differently than traditional catalogs, which are based on frequentist statistics. \cite{loredo2007analyzing} and \cite{loredo2010bayesian} introduce Bayesian statistics for astronomy. Posterior means and medians minimize $L_2$ and $L_1$ error, respectively, but both point estimates are biased in general for individual light sources. For population-level analysis, in Bayesian statistics, queries are typically addressed by integrating the (approximate) posterior to compute marginal distributions. Integrating may be analytic in some cases for VI. Monte Carlo integration is more universally applicable; that is, drawing samples from the (approximate) posterior and computing statistics on their empirical distribution. Given access to marginal distributions, hypothesis testing amounts to computing a Bayes factor~\citep{leonhard2018on,loredo2007analyzing}. \subsection{Future hardware} In July, 2018, it was reported that Intel will discontinue development of the Xeon Phi line of processors~\citep{phieol}. Future supercomputers will likely be based instead on the Xeon Scalable Family line of processors~\citep{intelroadmap} and the AMD Epyc~\citep{amdepyc}. Both are ``many core'' processors having tens of cores, like the Xeon Phi, but they are clocked at a higher rate. Running efficiently on these processors should not require significant changes to our algorithm or to our Julia implementation. The Julia compiler and LLVM, on the other hand, may require optimizations to fully exploit the capabilities of these processors. The next generation of supercomputers may also rely more on GPUs to attain exascale performance~\citep{summit}. The variable size of imaged light sources makes SIMD parallelization across light sources somewhat challenging. A different approach to parallelization may be advisable for astronomical cataloging on GPU-based clusters. \section{Discussion} \label{sec:discussion} We introduced our work by identifying a limitation of existing cataloging pipelines: centroiding, deblending, photometry, star/galaxy separation, and incorporation of priors happen in distinct stages. Uncertainty is typically not propagated between stages. Any uncertainty estimates these pipelines produce are based on conditional distributions---that is, they are conditional on the output of the previous stages. We developed a joint model of light sources' centers, colors, fluxes, shapes, and types (star/galaxy). Whereas previous approaches to cataloging have been framed in algorithmic terms, statistical formalisms let us characterize our inferences without ambiguity. Statistical formalisms also make modeling assumptions relatively transparent---whether the assumptions are appropriate ultimately depends on the downstream application. We highlighted limitations of the model to guide further development. A model is only useful when it can be applied to data. We proposed two procedures: one based on MCMC and the other on VI. Neither MCMC nor VI could be applied to our model without customization. The need for problem-specific adjustments is a barrier to the broader adoption of both techniques. With MCMC, for example, we went through several iterations before settling on slice sampling and AIS, including Metropolis-Hastings (MH) and reversible jump~\citep{green1995reversible}. Compared to slice sampling, we found MH difficult to tune. We found that reversible-jump MCMC required carefully constructed proposals to jump often enough between the star and galaxy models and was also difficult to tune. VI required even more problem-specific customization. Our VI techniques include the following: 1) approximating an integrand with its second-order Taylor expansion; 2) approximating the point-spread function with a mixture of Gaussians; 3) upper bounding the KL divergence between the color and a GMM prior; 4) limiting the variational distribution to a structured mean-field form; 5) limiting the variational distribution to point masses for some parameters; and 6) optimizing the variational lower bound with a variant of Newton's method rather than coordinate ascent. This final technique was particularly laborious, as it involved manually deriving and implementing both gradients and Hessians for a complicated function. On synthetic data, MCMC was better at quantifying uncertainty, which is likely due to the restrictive form of the variational distribution. Additionally, MCMC provided uncertainty estimates for all latent random variables, whereas VI modeled some random variables as point masses---in effect recovering maximum a posteriori (MAP) estimates for them. However, MCMC was approximately $1000\times$ slower than VI. On real data, while both inference procedures' point estimates were better than current standard practice, neither procedures' uncertainty estimates were well calibrated, particularly for galaxies. Uncalibrated uncertainties can nonetheless be useful, e.g., for flagging particularly unreliable point estimates. Additionally, even if the uncertainties are ignored by downstream analyses, point estimates typically improve when ambiguity is modeled. Uncertainty quantification may be particularly susceptible to model misspecification. For questions requiring calibrated uncertainties, enhancing the galaxy model may help to reduce model misspecification. Though the galaxy model we use---one with elliptical contours---is standard in astronomy, a more flexible galaxy model shows promise~\citep{regier2015deep}. Because astronomical surveys are large (comprising terabytes of data now, and petabytes in the near future), scalability is of paramount concern. We approximated the posterior for a large image dataset and demonstrated the scaling characteristics necessary to apply approximate Bayesian inference to hundreds of petabytes of images from the next generation of astronomical surveys. Our optimization procedure found a stationary point, even though doing so required treating the full dataset as a single optimization problem. Because of the relative ease of deriving and implementing MCMC, it could be a useful tool for trying different models and testing for misspecification prior to implementing VI. In some cases, it may be simpler to expend more computational resources to scale up the MCMC procedure than to implement VI. For the most computationally intensive problems, however, only VI can currently perform approximate inference. \section*{Supplement A: Kullback-Leibler divergences} \label{vi_details} This section gives the formulas for common Kullback-Leibler divergences that appear in the derivation of variational lower bound. The KL divergence for $a_s$ is between two categorical distributions. \begin{align} D_{\mathrm{KL}}(q(a_s), p(a_s)) =\acute a_s\log\frac{\acute a_s}{\mathcal A}+\left(1-\acute a_s\right)\log\frac{1-\acute a_s}{1-\mathcal A} \end{align} The KL divergence for $u_s$ is between a point mass and a uniform distribution. \begin{align} D_{\mathrm{KL}}(q(u_s), p(u_s)) = \frac{1}{360 \times 180} \end{align} The KL divergence for $e_s^{angle}$ is between a point mass and a uniform distribution. \begin{align} D_{\mathrm{KL}}(q(e_s^{angle}), p(e_s^{angle})) = \frac{1}{180} \end{align} The KL divergence for $e_s^{radius}$ is between a point mass and a log-normal distribution. \begin{align} \begin{split} D_{\mathrm{KL}}(q(e_s^{radius}), p(e_s^{radius}))= &-\log 2\pi - \frac{1}{2}\log \mathcal E_2^{radius}\\ &- \frac{(\acute e_s^{radius} - \mathcal E_1^{radius})^2}{2\mathcal E_2^{radius}} \end{split} \end{align} The KL divergence for $e_s^{profile}$ is between a point mass and a Beta distribution. Here $\mathrm B$ denotes the beta function. \begin{align} \begin{split} D_{\mathrm{KL}}(q(e_s^{profile}), p(e_s^{profile})) = &(\mathcal E_1^{profile} - 1)\log \acute e_s^{profile}\\ &+ (\mathcal E_2^{profile} - 1) \log (1 - \acute e_s^{profile})\\ &- \mathrm{B}(\mathcal E_1^{profile}, \mathcal E_2^{profile}) \end{split} \end{align} The KL divergence for $e_s^{axis}$ is between a point mass and a Beta distribution. \begin{align} \begin{split} D_{\mathrm{KL}}(q(e_s^{axis}), p(e_s^{axis})) = &(\mathcal E_1^{axis} - 1)\log \acute e_s^{axis}\\ &+ (\mathcal E_2^{axis} - 1) \log (1 - \acute e_s^{axis})\\ &- \mathrm{B}(\mathcal E_1^{axis}, \mathcal E_2^{axis}) \end{split} \end{align} The KL divergence for $r_s^{axis}$ is between two log-normal distributions. \begin{align} D_{\mathrm{KL}}(q(r_s | a_s = i), p(r_s | a_s = i)) = \log\frac{\mathcal R_{i2}}{\hat r_{si}} +\frac{\hat r_{si} + \left(\acute r_{si}-\mathcal R_{i1}\right)^{2}}{2\mathcal R_{i2}} -\frac{1}{2} \end{align} \section*{Supplement B: Additional experimental results} \label{experiment_plots} This section presents more experimental results for the synthetic and Stripe 82 datasets. \begin{figure} \centering \includegraphics[width=\linewidth]{plots-synthetic/error_vb_mc_comparison_gal-abs.png} \caption{Comparison of error distribution on synthetic data. \textbf{Lower is better.} ``Direction'' is error, in pixels, for the directions of the light sources' centers. ``Flux'' measures the reference band (r-band) flux. ``Colors'' are ratios of magnitudes in consecutive bands. ``Profile'' is a proportion indicating whether a galaxy is de Vaucouleurs or exponential. ``Axis ratio'' is the ratio between the lengths of a galaxy's minor and major axes. ``Radius'' is the half-light radius of a galaxy in pixels. ``Angle'' is the orientation of a galaxy in degrees.} \label{err-synth} \end{figure} \begin{figure} \centering \includegraphics[width=\linewidth]{plots-s82/error_vb_mc_comparison_gal-abs.png} \caption{Comparison of absolute error distributions on Stripe 82 data.} \label{err-real} \end{figure}
{'timestamp': '2018-10-16T02:02:24', 'yymm': '1803', 'arxiv_id': '1803.00113', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00113'}
arxiv
\section{Open challenges \& ongoing work} \label{sec:conclusion} Our simple reinforcement learning approach to join enumeration indicates that there is room for advancement in the space of applying deep reinforcement learning algorithms to query optimization problems. Overall, we believe the ReJOIN\xspace opens up exciting new research paths, some of which we highlight next. \pg{Latency optimization} Cost models depend on cardinality estimates, which are often error-prone. It would be desirable to use the actual latency of an execution plan, as opposed to a cost model's estimation, as a reward signal. ReJOIN\xspace uses the cost model as a proxy for query performance because it enables us to quickly train the algorithm for a large number of episodes -- executing query plans, especially the poor ones generated in early episodes, would be overly time-consuming. We are currently investigating techniques~\cite{dqfd} to ``bootstrap'' the learning process by first observing an expert system (e.g., the Postgres query optimizer), mimicking it, and then improving on the mimicked strategy. \pg{End-to-end optimization} ReJOIN\xspace only handles join order selection, and requires an optimizer to select operators, choose indexes, coalesce predicates, etc. One could begin expanding ReJOIN\xspace to handle these concerns by modifying the action space to include operator-level decisions. \section{Preliminary Results} \label{sec:expr} Here, we present preliminary experiments that indicate that ReJOIN\xspace can generate join ordering with cost and latency as good (and often better) as the ones generated from the PostgreSQL\xspace~\cite{url-postgres} optimizer. \begin{figure} \centering \includegraphics[width=0.45\textwidth]{experiments/converge_relative.pdf} \caption{\small ReJOIN\xspace Convergence} \vspace{-3mm} \label{fig:converge} \end{figure} \begin{figure*} \centering \begin{subfigure}{0.32\textwidth} \centering \includegraphics[width=\textwidth]{experiments/costs.pdf} \caption{\small Cost of join orderings} \label{fig:cost} \end{subfigure} \begin{subfigure}{0.32\textwidth} \includegraphics[width=\textwidth]{experiments/latency.pdf} \caption{\small Latency of generated plans} \label{fig:latency} \end{subfigure} \begin{subfigure}{0.32\textwidth} \includegraphics[width=\textwidth]{experiments/planning_time_relations.pdf} \caption{\small Optimization time} \label{fig:plan} \end{subfigure} \vspace{-3mm} \caption{\small Effectiveness and efficiency results} \vspace{-3mm} \label{fig:variances} \end{figure*} Our experiments are based on the Join Order Benchmark (JOB), a set of queries used in previous assessments of query optimizers~\cite{howgood}. The benchmark includes a set of 113 query instances of 33 query templates over the freely-available IMDB dataset. We have created a virtual machine pre-loaded with the dataset~\cite{url-imdbgithub}. Each query joins between 4 and 17 relations, and the two largest relations contain 36M and 15M rows. ReJOIN\xspace is trained on 103 queries and tested on 10 queries. Our testing query set includes all instances of one randomly selected query template (template \#1), in addition to six other randomly selected queries. The total database size was 11GB (all primary and foreign keys are indexed) using PostgreSQL~\cite{url-postgres} on a virtual machine with 2 cores, 4GB of RAM and a maximum shared buffer pool size of 1GB. We configured PostgreSQL to execute the join ordering generated by ReJOIN\xspace instead of using its own join enumerator~\cite{url-pgeo}. ReJOIN\xspace uses the \emph{Proximal Policy Optimization} (PPO) algorithm~\cite{ppo}, an off-the-shelf~\cite{tensorforce} state-of-the-art DRL technique. We used two hidden layers with 128 rectified linear units (ReLUs)~\cite{relu} each. \pg{Learning Convergence} To evaluate its learning convergence, we ran the ReJOIN\xspace algorithm repeatedly, selecting a random query from the training set at the start of each episode. The results are shown in Figure~\ref{fig:converge}. The x-axis shows the number of queries (episodes) the ReJOIN\xspace agent has learned from so far, and the y-axis shows the cost of the generated plan relative to the plan generated by the PostgreSQL\xspace optimizer, e.g. a value of 200\% represents a plan with double the cost of the plan selected by the PostgreSQL\xspace optimizer. ReJOIN\xspace starts with no information, and thus initially perform very poorly. As the number of observed episodes (queries) increases, the performance of the algorithm improves. At around 8,000 observed queries, ReJOIN\xspace begins to find plans with lower predicted cost than the PostgreSQL\xspace optimizer. After 10,000 queries, {the average cost of a plan generated by ReJOIN\xspace is 80\% of the cost of a plan generated by PostgreSQL\xspace}. \emph{This demonstrates that, with enough training, ReJOIN\xspace can learn to produce effective join orderings.} \pg{Join Enumeration Effectiveness} To evaluate the effectiveness of the join orderings produced by ReJOIN\xspace, we first trained our system over 10,000 queries randomly selected from our 103 training queries (the process took about 3 hours). Then, we used the generated model to produce a join ordering for our 10 test queries. For each test query, we used the converged model to generate a join ordering, but we did not update the model (i.e., the model did not get to add any information about the test queries to its experience set). We recorded the cost (according to the PostgreSQL cost model) of the plans resulting from these test join orderings as well as their execution times. We compare the effectiveness of ReJOIN\xspace with PostgreSQL as well as \emph{Quickpick}~\cite{quickpick}, which heuristically samples 100 semi-random join orderings and selects the join ordering which, when given to the DBMS cost model, results in the lowest-cost plan. \underline{Optimizer costs} We first evaluated the join orderings produced by the ReJOIN\xspace enumerator based on the cost model's assessment. The costs of the plans generated by PostgreSQL\xspace's default enumeration process, Quickpick, and ReJOIN\xspace on the 10 test queries are shown in Figure~\ref{fig:cost}. ``Query XY'' on the x-axis refers to the instance Y of the template X in the JOB benchmark. On average, \emph{ReJOIN\xspace produced join orderings that resulted in query plans that were 20\% cheaper than the PostgreSQL optimizer.} In the worst case, ReJOIN\xspace produced a cost only 2\% higher than the PostgreSQL optimizer (Query 15a). \emph{This shows that ReJOIN\xspace was able to learn a generalizable join order enumeration strategy which outperforms or matches the cost of the join ordering produced by the PostgreSQL optimizer.} The relatively poorer performance of Quickpick demonstrates that ReJOIN\xspace's good performance is not due to random chance. \underline{Query latency} \cut{We additionally checked the execution times of the resulting plans to verify that ReJOIN\xspace's plans had a lower execution time (not just a lower cost according to the cost model).} Figure~\ref{fig:latency} shows the latency of the executed query plans created by Quickpick and ReJOIN\xspace relative to the performance of the plan selected by the PostgreSQL optimizer. Here, each test query is executed 10 times with a cold cache. The graph shows the minimum, maximum, and median latency improvement. \emph{In every case, the plans produced by ReJOIN\xspace's join ordering outperform or matches the plan produced by PostgreSQL.} Hence, ReJOIN\xspace can produce plans with a lower execution time (not just a lower cost according to the cost model). Again, the relatively poorer performance of Quickpick demonstrates that ReJOIN\xspace is not simply guessing a random join ordering. \pg{Join Enumeration Efficiency} A commonly-voiced opinion about neural networks -- and machine learning in general -- is that they require operations that are too expensive to include in database internals. Here, we demonstrate that approaches like ReJOIN\xspace can actually \emph{decrease} query planning time. Figure~\ref{fig:plan} shows the average total query optimization time for the 103 queries in the training set, grouped by the number of relations to be joined. We include the planning time for ReJOIN\xspace with and without policy updates. \underline{Planning latency} For PostgreSQL, as expected, more relations in the query resulted in higher optimization time, as more join orderings need to be considered and ran through the cost model. However, ReJOIN\xspace can apply its model in time linear to the number of relations: at each round, two subtrees are joined until a complete join ordering is produced. As a result, \emph{while PostgreSQL\xspace's query optimization time increases worse-than-linearly, the query optimization time for ReJOIN\xspace is (relatively) flat.} \underline{Policy update overhead} The additional overhead of performing policy updates per-episode using PPO is relatively small, e.g. $< 12ms$. However, once the ReJOIN\xspace model is sufficiently converged, \emph{policy updates can be skipped to reduce query planning times by an additional 10\% to 30\%, achieving even shorter query planning times.} \section{Introduction} Identifying good join orderings for relational queries is one of the most well-known and well-studied problems in database systems (e.g.,~\cite{systemr, volcano, joe_complexity, robust_qo}) since the selected join ordering can have a drastic impact on query performance~\cite{howgood}. One of the challenges in join ordering selection is \emph{enumerating} the set of candidate orderings and identifying the most cost-effective one. Here, searching a larger candidate space increases the odds of finding a low-cost ordering, at the cost of spending more time on query optimization. Join order enumerators thus seek to simultaneously minimize the number of plans enumerated and the final cost of the chosen plan. Traditional database engines employ a variety of join enumeration strategies. For example, System R~\cite{systemr} uses dynamic programming to find the left-deep join tree with the lowest cost, while Postgres~\cite{url-postgres} greedily selects low-cost pairs of relations until a tree is built. Many commercial products (e.g.,~\cite{url-sqlserver}) include an exhaustive enumeration approach, but allow a DBA to controls the size of the candidate plan set by constraining it structurally (e.g., left-deep plans only), or cutting off enumeration after some elapsed time. \cut{Early optimizers (e.g., System R~\cite{}) imposed a structural constraint on plans, considering only those whose joins have at least one base relation as input (left-deep enumeration). Given that this sometimes excludes consideration of superior bushy plans~\cite{}, more recent approaches have attempted to use dynamic programming to exhaustively enumerate and evaluate all possible join orderings (e.g., ~\cite{Vertica, PostgreSQL}). In practice, exhaustive enumeration makes optimization of complex queries prohibitively expensive. Thus, many commercial products allow a DBA to set an optimization-level β€œknob” that controls the size of the candidate plan set. Lowering the optimization level typically constrains this set structurally (e.g., left-deep plans only), or cuts off enumeration after some specified time has passed.} Unfortunately, these heuristic solutions can often miss good execution plans. More importantly, traditional query optimizers rely on \emph{static} strategies, and hence do not learn from previous experience. Traditional systems plan a query, execute the query plan, and forget they ever optimized this query. Because of the lack of feedback, a query optimizer may select the same bad plan repeatedly, never learning from its previous bad or good choices. In this paper, we share our vision of a \emph{learning-based} optimizer that leverages information from previously processed queries, aiming to learn how to optimize future ones more effectively (i.e., producing better query plans) and efficiently (i.e., spending less time on optimization). We introduce a novel approach to query optimization that is based on \emph{deep reinforcement learning} (DRL)~\cite{deep_rl}, a process by which a machine learns a task through continuous feedback with the help of an artificial neural network. We argue that existing deep reinforcement learning techniques can be leveraged to provide better query plans using less optimization time. As a first step towards this goal, we present \emph{ReJOIN\xspace}, a proof-of-concept join order enumerator entirely driven by deep reinforcement learning. In the next section we describe the ReJOIN\xspace learning framework (Section~\ref{sec:method}) and provide promising preliminary results (Section~\ref{sec:expr}) that show ReJOIN\xspace can outperform PostgreSQL in terms of effectiveness and efficiency of the join enumeration process. \cut{ We argue that these systems (1) require a huge amount of human engineering effort, and (2) do not learn from their mistakes.} \cut{\pg{Human effort} All three components of the traditional, cost-based query optimizer are generally implemented heuristically, requiring a very large amount of human effort. For example, a join order enumerator may use a large and complex ruleset to prune unwanted plans. Cardinality estimators often make assumptions about uniformity and independence. Cost models are often hand-tuned formulae involving a large number of parameters. Further, DBAs must additionally tune each optimizer component to get good performance on their particular datasets.} \section{The ReJOIN\xspace Enumerator}\label{sec:method} Next, we present our proof-of-concept \emph{deep \underline{re}inforcement learning \underline{join} order enumerator}, which we call ReJOIN\xspace. \pg{Join Enumeration} ReJOIN\xspace assumes a traditional cost-based approach to query optimization used by many modern DBMSs (e.g.,\cite{vertica,url-postgres}). Specifically, given a SQL query as an input, a \emph{join order enumerator} searches a subspace of all possible join orderings and the ``cheapest'' ordering (according to the cost model) is selected for execution. This enumeration does not perform index selection, join operator selection, etc. -- these tasks are left to other components of the DBMS optimizer. A join ordering is captured by a binary tree, in which each leaf node represents a base relation. Figure~\ref{fig:join_orders} shows three possible join trees on the relations $A$, $B$, $C$, and $D$. \noindent{\bf Reinforcement Learning} Reinforcement learning assumes~\cite{deep_rl} that an \emph{agent} interacts with an \emph{environment} as follows. The environment tells the agent its current state, $s_t$, and a set of potential actions $\mathscr{A}_t = \{a_0, a_1, \dots, a_n\}$ that the agent can take. The agent selects an action $a \in \mathscr{A}_t$, and the environment gives the agent a \emph{reward} $r_t$, with higher rewards being more desirable, along with a new state $s_{t+1}$ and a new action set $A_{t+1}$. This process repeats until the agent selects enough actions that it reaches a \emph{terminal state}, where no more actions are available. This marks the end of an \emph{episode}, after which a new episode begins. The agent's goal is to maximize the reward it receives over episodes by learning from its experience (previous actions, states, and rewards). This is achieved by balancing the \emph{exploration} of new strategies with the \emph{exploitation} of current knowledge \begin{figure} \centering \includegraphics[width=0.40\textwidth]{figures/join_orders-crop.pdf} \caption{\small Three different join orderings} \label{fig:join_orders} \vspace{-3mm} \end{figure} \noindent{\bf Framework Overview} Next, we formulate the join order enumeration process as a reinforcement learning problem. Each query sent to the optimizer (and to ReJOIN\xspace) represents an episode, and ReJOIN\xspace learns over multiple episodes (i.e., continuously learning as queries are sent). Each state will represent subtrees of a binary join tree, in addition to information about query join and selection predicates.\footnote{Since predicates do not change during an episode, we will exclude it from our notation.} Each action will represent combining two subtrees together into a single tree. Note that a subtree can represent either an input relation or a join between subtrees. The episode ends when all input relations are joined (a terminal state). At this point, ReJOIN\xspace assigns a reward to the final output join ordering based on the optimizer's cost model. \cut{ All partial join orderings receive zero reward. \footnote{While traditional optimizers cost each subtree, the ReJOIN\xspace proof-of-concept only costs the final join ordering. This is because (1) it avoids the complication of deeply integrating with the optimizer cost model, as most DBMSes have exposed functionality to cost a complete plan, and (2) our eventual goal is to use the query latency itself as feedback.}} The final join ordering is then dispatched to the optimizer to perform operator selection, index selection, etc., and the final physical plan is executed by the DBMS. The framework of ReJOIN\xspace is shown in Figure~\ref{fig:system}. Formally, given a query $q$ accessing relations $r_1, r_2, \dots, r_n$, we define the initial state of the episode for $q$ as $s_1 = \{r_1, r_2, \dots, r_n\}$. This state is expressed as a \emph{state vector}. This state vector is fed through a neural network~\cite{dnn}, which produces a probability distribution over potential actions. The action set $\mathscr{A}_i$ for any state is every unique ordered pair of integers from $1$ to $|s_i|$, inclusive: $\mathscr{A}_i = \left[1, |s_i| \right] \times \left[1, |s_i| \right]$. The action $(x, y) \in \mathscr{A}_i$ represents joining the $x$th and $y$th elements of $s_i$ together. An action (i.e., a new join) is selected, and sent back to the environment which transitions to a new state. The state $s_{i+1}$ after selecting the action $(x, y)$ is $s_{i+1} = \left(s_i - \{s_i[x], s_i[y]\}\right) \cup \{s_i[x] \bowtie s_i[y]\}$. The new state is fed into the neural network. The reward for every non-terminal state (a partial ordering) is zero, and the reward for an action arriving at a terminal state $s_f$ (a complete ordering) is the reciprocal of the cost of the join tree $t$, $ \mathscr{M} (t)$, represented by $s_f$, $\frac{1}{ \mathscr{M} (t)}$. Periodically, the agent uses its experience to tweak the weights of the neural network, aiming to earn larger rewards. \pg{Example} Figure~\ref{fig:actions} shows a potential episode for a query involving four relations: $A$, $B$, $C$, and $D$ The initial state is $s_1 = \{A, B, C, D\}$. The action set $\mathscr{A}_1$ contains one element for each ordered pair of relations, e.g. $(1, 4) \in \mathscr{A}_1$ represents joining $A$ with $D$, and $(2, 3) \in \mathscr{A}_1$ represents joining $B$ with $C$. The agent chooses the action $(1, 3)$, representing the choice to join $A$ and $C$. The next state is $s_2 = \{ A \bowtie C, B, D \}$. The agent next chooses the action $(2, 3)$, representing the choice to join $B$ and $D$. The next state is $s_3 = \{ A \bowtie C, B \bowtie D\}$. At this point, the agent has only two possible choices, $\mathscr{A}_3 = \{ (1, 2), (2, 1) \}$. Supposing that the agent selects the action $(1, 2)$, the next state $s_4 = \{ (A \bowtie C) \bowtie (B \bowtie D) \}$ represents a terminal state. At this point, the agent would receive a reward based on the cost model's evaluation of the final join ordering. \cut{It is straightforward to prove by induction that any binary join tree can be constructed via some sequence of actions, albeit not uniquely (multiple sequences of actions may construct the same tree).} \begin{figure} \centering \includegraphics[width=0.35\textwidth]{figures/network-crop.pdf} \caption{\small The ReJOIN\xspace Framework} \label{fig:system} \vspace{-5mm} \end{figure} \subsection{State Vectors}\label{s:vectors} \cut{One challenge with reinforcement learning is encoding effective information within the state of the environment. In our case,} ReJOIN\xspace uses a vector representation of each state that captures information about the join ordering (i.e., the binary tree structure) and the join/selection predicates. Next, we outline a simple vectorization strategy which captures this information and demonstrates that reinforcement learning strategies can be effective \emph{even with simple input data}. \cut{Most off-the-shelf reinforcement learning packages~\cite{tensorforce} require states to be represented as vectors. Intuitively, since the reinforcement learning algorithm will only see the vector representation of each state, and not the states themselves, we wish to encode a sufficient amount of data about each state into the vectorized representation. Here, we outline a simple vectorization strategy which captures some information about tree structure and join / column predicates. It is by no means an optimal or production-ready vectorization strategy, nor is it intended to be: our goal is to show that reinforcement learning strategies can be effective \emph{even with limited input data.} We represent each state as three vectors: a tree vector, corresponding to the tree structure of each subtree (this changes after every action), and two predicate vectors, corresponding to the join and column predicates (these are fixed for a given episode).} \noindent{\bf Tree Structure} To capture tree structure data, we encode each binary subtree (i.e., join ordering decided so far) $x \in s_j$ as a row vector $v$ of size $n$, where $n$ is the total number of relations in the database. The value $v_i$ is zero if the $i$th relation is not in $x$, and equal to $\frac{1}{h(i, x)}$ otherwise, where $h(i, x)$ is the height of the relation $r_i$ in the subtree $x$ (the distance from the root). In the example in Figure~\ref{fig:actions}, the first row of the tree vector for the second to last state, $\{A \bowtie C, B \bowtie D\}$, corresponds to $(A \bowtie C)$. The third column of the first row has a value of $\frac{1}{2}$, corresponding to $C$ having a height of 2 in the subtree. The second column of the first row has a value of zero since the relation $B$ is not included in the subtree. \pg{Join Predicates} To capture critical information about join predicates, we create an $n \times n$ binary symmetric matrix $m$ for each episode. The value $m_{i,j}$ is one if there is a join predicate connecting the $i$th and the $j$th relation, and a zero otherwise. This simple representation captures feasible equi-joins operations. Figure~\ref{fig:actions} shows an example of such a matrix $m$. The value $m_{2,1} = m_{1,2} = 1$ because of the predicate \texttt{A.id = B.id}. The value $m_{2,3} = m_{3, 2} = 0$ because there is no join predicate connecting $B$ and $C$. \cut{does not capture complex join predicates (such as inequalities or more advanced functions), but it does capture information about which relations have no predicates between them (the zeros) -- if two relations have no connecting predicates, it is very unlikely that joining them together directly is a good idea} \noindent{\bf Selection Predicates} The selection predicate vector is a $k$-dimensional vector, where $k$ is the total number of attributes in the database (the total number of attributes across all relations). The $i$th value is one when the $i$th attribute has a selection predicate in the given query, and zero otherwise. This does reveal which attributes are not used to filter out tuples. For example, in Figure~\ref{fig:actions} the value corresponding to \texttt{B.a2} is one because of the predicate \texttt{B.a2 > 100}. \subsection{Reinforcement Learning} \label{sec:deep_rl} \cut{In this section we describe the deep learning approach used by ReJOIN\xspace.} \pg{Policy gradient} Our framework relies on policy gradient methods~\cite{reinforce}, one particular subset of reinforcement learning. Policy gradient reinforcement learning agents select actions based on a parameterized \emph{policy} $\pi_\theta$, where $\theta$ is a vector that represents the policy parameters. Given a state $s_t$ and an action set $\mathscr{A}_t$, the policy $\pi_\theta$ outputs a score for each action in $\mathscr{A}_t$ (in our context, a score for combining two join subtrees). Actions are then selected using various methods~\cite{deep_rl}.\cut{Formally: \begin{equation*} \pi_\theta : (s_t, A_t) \to a_i \in A_t \end{equation*}} Reinforcement learning aims to optimize the policy $\pi_\theta$ over episodes, i.e., to identify the policy parameters $\theta$ that optimizes the expected reward $J_\pi(\theta)$. However, the reward $J_\pi(\theta)$ is typically not feasible to precisely compute and hence policy gradient methods search for the optimal policy parameters $\theta$ by constructing an estimator $E$ of the \emph{gradient} of the reward: $E(\theta) \approx \nabla_\theta J_\pi(\theta)$. \cut{For real-world applications require that any change to the policy parameterization has to be smooth as drastic changes can be hazardous for the system as well as useful initializations of the policy based on domain knowledge would otherwise vanish after a single step. For these reasons,} Given an estimate $E$, \emph{gradient ascent} methods tune the initial random parameters $\theta$ by incrementing each parameter in $\theta_i$ by a small value when the gradient $\nabla_{\theta_i} J_\pi(\theta)$ is positive (the positive gradient indicates that a larger value of $\theta_i$ will increase the reward), and decrementing the parameters in $\theta_i$ by a small value when the gradient is negative. \cut{The performance function, or the expected reward that a policy will receive per episode, is denoted $J_\pi(\theta)$. A reinforcement learning agent thus seeks the vector $\theta$ that maximizes the reward $J_\pi(\theta)$, but the reward $J_\pi(\theta)$ is typically not feasible to precisely compute. Policy gradient methods search for such a vector $\theta$ by constructing an estimator $E$ of the \emph{gradient} of the performance function: $E(\theta) \approx \nabla_\theta J_\pi(\theta)$. Given an estimate $E$, \emph{gradient ascent} methods can be used to tune an initial random $\theta$. Intuitively, these methods work by incrementing $\theta_i$ by a small value when the gradient $\nabla_{\theta_i} J_\pi(\theta)$ is positive (the positive gradient indicates that a larger value of $\theta_i$ will increase performance), and decrementing $\theta_i$ by a small value when the gradient is negative. } \pg{Policy gradient deep learning} {Policy gradient deep learning methods} (e.g., ~\cite{ppo}) represent the policy $\pi_\theta$ as a neural network, where $\theta$ is the network weights, thus enabling the efficient differentiation of $\pi_\theta$~\cite{dnn}. Figure~\ref{fig:system} shows the policy network we used in ReJOIN\xspace. A vectorized representation of the current state is fed into the \emph{state layer}, where each value is transformed and sent to the first hidden layer. The first hidden layer transforms and passes its data to the second hidden layer, which passes data to the final \emph{action layer}. Each neuron in the action layer represents one potential action, and their outputs are normalized to form a probability distribution. The policy $\pi_\theta(s_i, A_i)$ selects actions by sampling from this probability distribution, \cut{Selecting the \emph{mode} of the distribution instead of sampling from the distribution would represent a \emph{pure exploitation} strategy. Choosing an action uniformally at \emph{random} would represent a \emph{pure exploration} strategy.} which balances exploration and exploitation~\cite{reinforce}. The policy gradient $\nabla_\theta J_\pi(\theta)$ is estimated using samples of previous episodes (queries). Each time an episode is completed (a join ordering for a given query is selected), the ReJOIN\xspace agent records a new observation $(\theta, r)$. Here, $\theta$ represents the policy parameters used for that episode and the final cost (reward) $r$ received. Given a set of experiences over multiple episodes $X = \{(\theta^0, r^0), (\theta^1, r^1), \dots, (\theta^2, r^2)\}$, various advanced techniques can be used to estimate the gradient $E(\theta)$ of the expected reward~\cite{ac,ppo}. \cut{While relatively simple, deep reinforcement learning techniques have demonstrated success in advanced tasks such as playing Atari video games and controlling complex robots~\cite{deep_rl}.} \begin{figure} \centering \includegraphics[width=0.48\textwidth]{figures/actions-crop.pdf} \caption{\small Two possible join order selection episodes} \label{fig:actions} \vspace{-5mm} \end{figure}
{'timestamp': '2018-03-14T01:03:44', 'yymm': '1803', 'arxiv_id': '1803.00055', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00055'}
arxiv
\section{First design problem} \subsection{The problem} This problem was posed by Valerii Fedorov at the workshop on \emph{Design and Analysis of Experiments in Healthcare} held at the Isaac Newton Institute for Mathematical Sciences at Cambridge, U.K.\ in July 2015. The context is \emph{basket trials}, where several different drugs are treated on several different diseases in a single protocol which involves many medical centres: see \cite{orphan} and \cite{Wood}. The combinatorial properties listed below have been proposed by \cite{VFSL} as potentially giving optimal designs, which may give a benchmark for designs which are achievable in practice. A trial is being designed to compare several drugs for their effects on several different types of cancer. In order to keep the protocol simple for each medical centre involved, it is proposed to limit each medical centre to only a few of the cancer types and only a few of the drugs. Let $v_1$ be the number of cancer types, $v_2$ the number of drugs, and $b$ the number of medical centres. The following properties are desirable: \begin{enumerate}\itemsep0pt \item[(a)] all medical centres involve the same number, say $k_1$, of cancer types, where $k_1<v_1$; \item[(b)] all medical centres use the same number, say $k_2$, of drugs, where $k_2<v_2$; \item[(c)] each pair of distinct cancer types are involved together at the same non-zero number, say $\lambda_{11}$, of medical centres; \item[(d)] each pair of distinct drugs are used together at the same non-zero number, say $\lambda_{22}$, of medical centres; \item[(e)] each drug is used on each type of cancer at the same number, say $\lambda_{12}$, of medical centres. \end{enumerate} The inequalities in conditions~(a) and~(b) force the medical centres to be incomplete both for cancer types and for drugs. Insisting that the parameters in conditions (c) and (d) are non-zero is necessary to prevent the confounding of either cancer types or drugs with medical centres. For brevity, from now on the medical centres will be referred to as blocks. Figure~\ref{f1} shows such a design for six cancer types and five drugs using 10 blocks; it has $k_1=3$ and $k_2=2$. \begin{figure} \begin{center} \includegraphics[width=5in]{image001.png} \end{center} \caption{Design for 6 cancer types and 5 drugs, using 10 blocks; each block has 3 cancer types and 2 drugs.} \label{f1} \end{figure} Conditions~(a) and~(c) specify that the design for cancer types is a balanced incomplete-block design, also known as a $2$-design, or, more specifically, a $2$-$(v_1,k_1,\lambda_{11})$ design. Likewise, conditions~(b) and~(d) specify that the design for drugs is a $2$-design. We call these the C-design and the D-design respectively. We shall call a design satisfying conditions~(a)--(e) a \textit{$2$-part $2$-design} or \textit{$2$-part balanced incomplete block design}. These are not the same as the bipartite designs defined by \cite{hoff}. \subsection{Previous work} \label{sec:BOMA} In Section~\ref{sec:2con} we concentrate on designs with only two different factors (cancer types and drugs), before generalizing to three or more factors in Section~\ref{sec2}. This is partly to help the reader to become familiar with the ideas, and partly because this case seems likely to be of practical importance in the clinical context described. The more general case has already been considered by \cite{sitt}, \cite{muk} and \citet[Section 10.8]{OAbook}. Because conditions (a)--(d) specify balanced incomplete-block designs and condition~(e) is reminiscent of the definition of orthogonal multi-array given by \cite{brick}, \cite{sitt} called these designs \emph{balanced orthogonal multi-arrays}. Brickell's original definition was essentially a generalization of orthogonal arrays of strength two and minimal size, so it included the conditions that $b$ is a square and $\lambda_{12}=1$. \cite{sitt} acknowledged that he was removing those conditions. However, the original definition of orthogonal multi-array continues to be in use in many areas. They give an alternative definition of semi-Latin squares: see \cite{rabSLS} and \cite{LHS1,LHS2}. Dually, they are used in factorial designs: see \cite{rabJSTP}. \cite{WP} used them in the study of tournaments. They are used in cryptography: see, for example, \cite{AMSW} and \cite{seb2}. Recently, \cite{mag} have generalized them to strength~$t$, so that $b$ is a $t$-th power of an integer. This generalization seems to be within the spirit of the original definition, whereas Sitter's does not. Thus we think that ``$2$-part $2$-design'' (or, more generally, a multi-part $2$-design) is a more suitable name. \cite{sitt} also allowed the block size within each type to vary. \cite{muk} called the balanced orthogonal multi-arrays \textit{proper} when this is not allowed. He also restricted attention to the case where $k_i< v_i$, unlike \cite{sitt}. Both allowed $\lambda_{ii}$ to be zero, which permits confounding: in Table~1 of \cite{muk} one type has its levels confounded with blocks. \cite{muk} gave two general constructions for designs of this type. We shall comment on the relationship of these to our constructions at the relevant places. \subsection{Representing the designs} \label{sec:repn} How should we represent a design of this type? Each block has all combinations of $k_1$ cancer types with $k_2$ drugs, so a full display would show $bk_1k_2$ items. For example, in the design in Fig.~\ref{f1}, Block 1 contains the ordered pairs \[ (\mbox{C1}, \mbox{D1}), \quad (\mbox{C1}, \mbox{D5}), \quad (\mbox{C2}, \mbox{D1}), \quad (\mbox{C2}, \mbox{D5}), \quad (\mbox{C3}, \mbox{D1}), \quad (\mbox{C3}, \mbox{D5}). \label{eq:full} \] It might be clearer to show these in rectangular form: \[ \begin{array}{cc} (\mbox{C1}, \mbox{D1}) & (\mbox{C1}, \mbox{D5}) \\ (\mbox{C2}, \mbox{D1}) & (\mbox{C2}, \mbox{D5})\\ (\mbox{C3}, \mbox{D1}) & (\mbox{C3}, \mbox{D5}) \end{array} \] The people running the clinical trial need this full representation. A dual way to represent the design is to use a $v_1 \times v_2$ rectangle with $\lambda_{12}$ entries per cell. Equation~(\ref{eqT3}) below shows that this contains the same number of items as the full representation. The rows are labelled by the cancer types, and the columns by the drugs. The name of each block is shown in each cell $(i,j)$ for which the combination of cancer type~$i$ and drug~$j$ occurs in that block. Figure~\ref{both}(a) shows the design in Fig.~\ref{f1} in this format. This dual representation does not extend easily to the generalizations of the problem in Sections~\ref{sec2}--\ref{sec:last}. \begin{figure} \begin{center} \begin{tabular}{c@{\qquad}c} \begin{tabular}{c||c|c|c|c|c|} & D1 & D2 & D3 & D4 & D5\\ \hline \hline C1 & 1, 2 & 2, \hphantom{0}3 & 3, 4 & 4, 5 & 1, \hphantom{0}5\\ \hline C2 & 1, 6 & 7, 10 & 4, 6 & 4, 7 & 1, 10\\ \hline C3 & 1, 9 & 3, \hphantom{0}7 & 3, 8 & 7, 9 & 1, \hphantom{0}8\\ \hline C4 & 6, 9 & 3, 10 & 3, 6 & 5, 9 & 5, 10\\ \hline C5 & 2, 6 & 2, \hphantom{0}7 & 6, 8 & 5, 7 & 5, \hphantom{0}8\\ \hline C6 & 2, 9 & 2, 10 & 4, 8 & 4, 9 & 8, 10\\ \hline \end{tabular} & \begin{tabular}{ccc} Block & Cancer types & Drugs\\ \hline 1 & C1, C2, C3 & D1, D5\\ 2 & C1, C5, C6 & D1, D2\\ 3 & C1, C3, C4 & D2, D3\\ 4 & C1, C2, C6 & D3, D4\\ 5 & C1, C4, C5 & D4, D5\\ 6 & C2, C4, C5 & D1, D3\\ 7 & C2, C3, C5 & D2, D4\\ 8 & C3, C5, C6 & D3, D5\\ 9 & C3, C4, C6 & D1, D4\\ 10 & C2, C4, C6 & D2, D5 \end{tabular} \\ \mbox{}\\[-3\jot] (a) Dual representation & (b) Concise representation \end{tabular} \end{center} \caption{Alternative representations of the design in Fig.~\ref{f1}. In the dual representation, the rows and columns of the rectangle are labelled by cancer types and drugs respectively, and each entry in each cell is the name of a block.} \label{both} \end{figure} The most concise way to represent the design is simply to list, for each block, the cancer types and drugs allocated to it. This list has $b(k_1+k_2)$ items. This representation was used by \cite{sitt} and \cite{muk}. Figure~\ref{both}(b) gives the concise representation of the design in Fig.~\ref{f1}. We shall use the concise representation for the remainder of this paper. However, it can be misinterpreted when removed from the practical context. For example, the reader might think that Block~1 in Fig.~\ref{both}(b) contains five treatments, those in the union of the sets $\{\mbox{C1},\mbox{C2},\mbox{C3}\}$ and $\{\mbox{D1},\mbox{D5}\}$, rather than the six treatment combinations in the cartesian product of these sets. This misinterpretation gives a block design for $v_1+v_2$ treatments in $b$ blocks of size $k_1+k_2$, which we call the zipped form of the original design. Figure~\ref{f1} avoids this problem, but at the cost of repeating the information about the drugs in each block. This format contains $bk_1k_2$ items, as many as the full representation, but it seems easier to read. Let $N_1$ be the $v_1 \times b$ incidence matrix of cancer types in blocks in the zipped version of the design. The $(i,j)$-entry is $1$ if cancer type~$i$ occurs in block~$j$; otherwise, it is~$0$. Let $N_2$ be the analogous $v_2 \times b$ incidence matrix for drugs in blocks. Then the incidence matrices for the full design are $k_2N_1$ and $k_1N_2$ respectively, not allowing for the unknown number of times that each combination will eventually be used in any block. \subsection{Comparison with other designs} \label{sec:hum} At first sight, the design in Fig.~\ref{f1} appears to be a block design for two treatment factors $C$ and $D$. However, there are important differences between this and previous designs. In our application, the medical centre represented by Block~$1$ will accept into the trial only patients with cancer types $1$, $2$ or~$3$. It has no control in advance over how many such patients will present themselves. For each of these three cancer types, it will randomize approximately equal numbers of patients to drugs~$1$ and $5$ and placebo, or, in a variant of the original proposal, approximately one quarter each to placebo, drug~$1$, drug~$5$ and their combination. \cite{sitt} introduced his designs for use in sampling. In designed experiments, \cite{muk} envisaged a completely different sort of application from the one we describe here. In that, each block represents a single observational unit. For each factor, subsets of the levels are applied, rather than single levels. For example, a group of $k_1$ people might be needed, all playing similar roles, or a hybrid variety of wheat might be bred from $k_2$ pure lines. See also \cite{rabSLS}. In this context, it is not problematic to have $\lambda_{ii}=0$ (so that $k_i=1$) for either $i=1$ or $i=2$. In classical factorial designs with blocks of size~$k$, from \cite{fy}, \cite{rafbook,raf} and \cite{bosefact} onwards, combinations of factor levels do not occur more than once in any block: thus $k_1=k_2=k$. Moreover, the subsets of combinations allocated to blocks are chosen depending on various assumptions about main effects and interactions. For example, if $v_1=v_2=3$ and there are six blocks of three plots each then the design in Fig.~\ref{fact}(a) permits estimation of both main effects with full efficiency and all interaction contrasts with efficiency factor $1/2$. \begin{figure} \begin{center} \begin{tabular}{c@{\qquad}c} \begin{tabular}{cccc} Block 1 & (C1, D1) & (C2, D2) & (C3, D3)\\ Block 2 & (C1, D2) & (C2, D3) & (C3, D1)\\ Block 3 & (C1, D3) & (C2, D1) & (C3, D2)\\ Block 4 & (C1, D1) & (C2, D3) & (C3, D2)\\ Block 5 & (C1, D2) & (C2, D1) & (C3, D3)\\ Block 6 & (C1, D3) & (C2, D2) & (C3, D1) \end{tabular} & \begin{tabular}{c||c|c|c|} & D1 & D2 & D3\\ \hline \hline C1 & 1, 4 & 2, 5 & 3, 6\\ \hline C2 & 3, 5 & 1, 6 & 2, 4\\ \hline C3 & 2, 6 & 3, 4 & 1, 5\\ \hline \end{tabular} \\ \mbox{}\\[-3\jot] (a) Usual representation & (b) Dual representation \end{tabular} \end{center} \caption{Classical factorial design for two $3$-level treatment factors in $6$~blocks of size~$3$.} \label{fact} \end{figure} The dual form of this design is shown in Fig.~\ref{fact}(b). The positions of the block names show clearly how the block design was constructed from a pair of mutually orthogonal Latin squares. However, unlike in Fig.~\ref{both}(a), no block name occurs more than once in any row or column. Consequently, the occurrences of each block name do not have the rectangular layout that they do in Fig.~\ref{both}(a). Later in the twentieth century there was much literature on incomplete-block designs for two non-interacting treatment factors with each treatment combination occurring once, so that $v_1v_2=bk$ and $k_1=k_2=k$, where $k$~is the block size. For example, \cite{dapbcs} gave the design in Fig.~\ref{dap}(a). The dual form is in Fig.~\ref{dap}(b). \begin{figure} \begin{center} \begin{tabular}{c@{\qquad}c} \begin{tabular}{lccc} Block 1 & (C3, D4) & (C4, D3) & (C6, D1)\\ Block 2 & (C4, D5) & (C5, D4) & (C6, D2)\\ Block 3 & (C5, D1) & (C1, D5) & (C6, D3)\\ Block 4 & (C1, D2) & (C2, D1) & (C6, D4)\\ Block 5 & (C2, D3) & (C3, D2) & (C6, D5)\\ Block 6 & (C1, D1) & (C4, D2) & (C3, D5)\\ Block 7 & (C2, D2) & (C5, D3) & (C4, D1)\\ Block 8 & (C3, D3) & (C1, D4) & (C5, D2)\\ Block 9 & (C4, D4) & (C2, D5) & (C1, D3)\\ Block 10 & (C5, D5) & (C3, D1) & (C2, D4)\\ \end{tabular} & \begin{tabular}{c||c|c|c|c|c|} & D1 & D2 & D3 & D4 & D5\\ \hline \hline C1 & \hphantom{0}6 & 4 & 9 & \hphantom{0}8 & \hphantom{0}3\\ \hline C2 & \hphantom{0}4 & 7 & 5 & 10 & \hphantom{0}9\\ \hline C3 & 10 & 5 & 8 & \hphantom{0}1 & \hphantom{0}6\\ \hline C4 & \hphantom{0}7 & 6 & 1 & \hphantom{0}9 & \hphantom{0}2\\ \hline C5 & \hphantom{0}3 & 8 & 7 & \hphantom{0}2 & 10\\ \hline C6 & \hphantom{0}1 & 2 & 3 & \hphantom{0}4 & \hphantom{0}5\\ \hline \end{tabular} \\ \mbox{}\\[-3\jot] (a) Usual representation & (b) Dual representation \end{tabular} \end{center} \caption{Block design for two non-interacting sets of treatments, with $v_1=6$, $v_2=5$, $b=10$ and $k=3$.} \label{dap} \end{figure} Many authors required the block design for each treatment factor separately to be balanced. This is the analogue of conditions~(a)--(d) when $k_1=k_2$. From \cite{ag:sdr} and \cite{dapbka} onwards, another condition was often imposed, eventually called \textit{adjusted orthogonality} by \cite{eccruss:77}: the product $\tilde{N}_1\tilde{N}_2^\top$ should have all its entries equal, where $\tilde{N}_1$ and $\tilde{N}_2$ are the $v_1\times b$ and $v_2\times b$ incidence matrices for the first and second treatment factors, respectively, in blocks. Although this is a consequence of condition~(e), it is not equivalent to it. The duals of designs satisfying these conditions were called \textit{triple arrays} by \cite{trip}. The design in Fig.~\ref{dap}(b) is a triple array. In spite of the similar conditions that they satisfy, triple arrays are not special cases of $2$-part $2$-designs, nor vice versa. In a triple array, no block name occurs more than once in any row or column. In the dual form of a $2$-part $2$-design, any block name that occurs in a given row must occur $k_2$ times in that row. A consequence of the ``non-zero part'' of condition~(d) is that $k_2>1$. Apart from the designs given by \cite{DAPWY}, infinite families of triple arrays have proved frustratingly hard to find: see \citet[Section 13]{bcc}. By contrast, in Sections~\ref{sec:2con} and~\ref{sec:last} of this paper we give many simple constructions of $2$-part $2$-designs and their generalizations. \subsection{Conditions on parameters} \label{sec:thm} An ordinary block design is said to be $\alpha$-resolved if its set of blocks can be partitioned into classes in such a way that each treatment occurs $\alpha$ times in each class. This terminology does not extend easily to $2$-part $2$-designs, because cancer types may occur in different numbers of blocks from drugs. We propose calling a $2$-part block design \textit{$c$-partitionable} if the set of blocks can be grouped into $c$ classes of $b/c$ blocks each, in such a way that every cancer type occurs the same number of times in each class and every drug occurs the same number of times in each class. \begin{theorem} \label{th1} If there is a $2$-part $2$-design with the parameters given in conditions~(a)--(e), then each cancer type occurs in $r_1$ blocks and each drug occurs in $r_2$ blocks, where \begin{equation} r_1=bk_1/v_1, \qquad r_2=bk_2/v_2. \label{eqT1} \end{equation} Moreover, the following equations are satisfied: \begin{equation} v_1(v_1-1)\lambda_{11}=bk_1(k_1-1), \qquad v_2(v_2-1)\lambda_{22}=bk_2(k_2-1), \label{eqT2} \end{equation} and \begin{equation} bk_1k_2=v_1v_2\lambda_{12}, \label{eqT3} \end{equation} as well as the inequality \begin{equation} b\ge v_1+v_2-1. \label{eqT4} \end{equation} If the design is $c$-partitionable then \begin{equation} b \geq v_1 + v_2 +c -2. \label{eq:aha} \end{equation} \end{theorem} \begin{pf} The first two statements are the usual conditions for the $2$-designs on cancer types and drugs respectively, while Equation~(\ref{eqT3}) equates two different ways of counting the number of choices of a cancer type, a drug, and a block containing both. For inequality (\ref{eq:aha}), let $N=(N_1^\top,N_2^\top,N_0^\top)^\top$, where $N_1$ and $N_2$ are the incidence matrices defined in Section~\ref{sec:repn} and $N_0^\top$ is the $b\times c$ incidence matrix of blocks in classes. Then \[NN^\top = \left[ \begin{array}{c@{\quad}c@{\quad}c} (r_1-\lambda_{11})I+\lambda_{11}J & \lambda_{12}J & (r_1/c)J\\ \lambda_{12}J & (r_2-\lambda_{22})I+\lambda_{22}J & (r_2/c)J\\ (r_1/c)J & (r_2/c)J & (b/c)I \end{array} \right], \] where $I$ and $J$ are identity and all-$1$ matrices of the appropriate sizes. We claim that $NN^\top$ has rank $v_1+v_2+c-2$, from which inequality~(\ref{eq:aha}) follows. First, let ${w}_1$, $w_2$ and ${w}_3$ be column vectors of lengths $v_1$, $v_2$, $c$ respectively whose entries sum to $0$. Then \begin{equation} NN^\top \left(\begin{array}{c} w_1\\w_2\\w_3\end{array} \right) = \left(\begin{array}{c} (r_1-\lambda_{11}){w}_1\\ (r_2-\lambda_{22}){w}_2\\ (b/c)w_3 \end{array} \right). \label{eq1} \end{equation} Because the blocks are incomplete, $\lambda_{11}< r_1$ and $\lambda_{22} <r_2$, and so the restriction of this matrix to the space of such vectors, which has dimension $v_1+v_2+c-3$, is invertible. The orthogonal complement of this space consists of all vectors of the form $(xj_1^\top,yj_2^\top,zj_3^\top)^\top$, where $j_1$, $j_2$ and $j_3$ are all-$1$ vectors of lengths $v_1$, $v_2$ and $c$ respectively. The action of $NN^\top$ on this space is obtained by replacing the block matrices by their row sums: using the results in (\ref{eqT1})--(\ref{eqT3}), this simplifies to \[ \left( \begin{array}{ccc} r_1k_1 & r_1k_2 & r_1\\ r_2k_1 & r_2k_2 & r_2\\ (b/c)k_1 & (b/c)k_2 & (b/c) \end{array} \right), \] which has rank~$1$. So the claim~(\ref{eq:aha}) is proved. The first part of the theorem shows that every $2$-part $2$-design is $1$-partitionable. Thus inequality~(\ref{eqT4}) is a special case of inequality~(\ref{eq:aha}). \end{pf} \begin{rem} \cite{muk} remarked on the integrality conditions (\ref{eqT1})--(\ref{eqT3}) without stating them explicitly, and proved inequality (\ref{eqT4}). \end{rem} \begin{rem} Inequality~(\ref{eqT4}) can be regarded as a generalization of both Fisher's and Bose's inequalities: see \citet[Chapter 1]{cvl} and \citet[Chapter 11]{doce}. For Fisher's inequality, take the C-design to be any $2$-design with $v=v_1$, and take a single drug which occurs in all blocks; we have $\lambda_{12}=r_1$ and $\lambda_{22}=0$: although our conditions that $\lambda_{22}>0$ and $k_2<v_2$ fail for the D-design, the proof still works, because the only vector ${w}_2$ in equation~(\ref{eq1}) is the zero vector: thus the proof gives $b\ge v+1-1$. For Bose's inequality, take the C-design to be any resolvable $2$-design with $v=v_1$ and replication $r=r_1$, and the drugs to be labelled by the resolution classes of the design, with a drug in every block in the corresponding resolution class, so that $v_2=r$. We have $\lambda_{12}=1$ and $\lambda_{22}=0$. Again part of condition~(d) fails, but the proof works, giving $b\ge v+r-1$. Inequality~(\ref{eq:aha}) seems to be the true analogue of Bose's inequality for $2$-part $2$-designs. \end{rem} \begin{rem} Although neither triple arrays nor $2$-part $2$-designs are special cases of the other, they both satisfy inequality~(\ref{eqT4}). Proofs for triple arrays are in \cite{Bagchi1998}, \cite{bcc} and \cite{trip}, and the proof that we have given here also works for triple arrays. \end{rem} \section{Constructions of $2$-part $2$-designs} \label{sec:2con} In this section, we give several constructions. In order to identify when two different constructions give designs which are essentially the same, we say that two $2$-part $2$-designs are \textit{isomorphic} to each other if one can be obtained from the other by relabelling some of blocks, cancer types and drugs. Weak isomorphism generalizes this by also allowing the roles of cancer types and drugs to be interchanged. Given two or more non-isomorphic designs for the same parameters, there may be practical reasons for preferring one over the rest. Since interchanging roles does not affect conditions (a)--(e), from now on we usually adopt the convention that \begin{equation} v_1\geq v_2. \label{eq:exchange} \end{equation} Given a $2$-part $2$-design, the procedure of \textit{C-swap} creates a new $2$-part $2$-design. This simply involves replacing the set of cancer treatments in each block with the complementary set. This changes the parameters $k_1$, $\lambda_{11}$ and $\lambda_{12}$ to $v_1-k_1$, $b-2r_1+\lambda_{11}$ and $r_2-\lambda_{12}$, leaving $b$, $v_1$, $v_2$, $k_2$ and $\lambda_{22}$ unchanged. The new design fulfills all the conditions so long as $v_1-k_1\geq 2$. The combination of a C-swap and the analogous D-swap has the effect of replacing each block by its complement (in the zipped version). Thus, in our search for design constructions, we may assume that \begin{equation} \mbox{for $i=1$ and $i=2$, either $k_i\leq v_i/2$ or $k_i=v_i-1$.} \label{eq:swap} \end{equation} All of our tables are limited to parameter sets which satisfy conditions (\ref{eq:exchange}) and (\ref{eq:swap}). \begin{constn} \textbf{(Cartesian products)} \label{c:cart} One obvious method of construction is the cartesian product. This starts with two balanced incomplete-block designs, one for $v_1$ treatments in $b_1$ blocks of size $k_1$, the other for $v_2$ treatments in $b_2$ blocks of size $k_2$. Form all $b_1b_2$ combinations of a block of each sort. For each combination, form the cartesian product of their subsets of treatments. \end{constn} This will usually result in rather large values of $b$. For example, when $v_1=6$, $k_1=3$, $v_2=5$ and $k_2=2$ then the smallest possible values of $b_1$ and $b_2$ are both $10$, so this construction gives a design with $100$ blocks, unlike the design with $10$ blocks in Fig.~\ref{f1}. Table~\ref{t2} shows the parameters of the designs with the least number of blocks which can be constructed by this method with $v_1\geq v_2$, using the table of $2$-designs in Appendix~I of \cite{hall}; note that design~13 in that table should have $k=4$. \begin{table} \caption{Parameter sets for the designs with the least number of blocks that can be made by Construction 1: $v_1$ is the number of cancer types, $v_2$ is the number of drugs, and $b$ is the number of blocks, each of which has $k_1$ cancer types and $k_2$ drugs} \label{t2} \[ \addtolength{\arraycolsep}{-0.5\arraycolsep} \begin{array}{rrrrr} b & v_1 & v_2 & k_1 & k_2\\ \hline 9 & 3 & 3 & 2 & 2\\ 12 & 4 & 3 & 3 & 2\\ 15 & 5 & 3 & 4 & 2\\ 16 & 4 & 4 & 3 & 3\\ 18 & 4 & 3 & 2 & 2\\ 18 & 6 & 3 & 5 & 2 \end{array} \qquad \begin{array}{rrrrr} b & v_1 & v_2 & k_1 & k_2\\ \hline 20 & 5 & 4 & 4 & 3\\ 21 & 7 & 3 & 3 & 2\\ 21 & 7 & 3 & 6 & 2\\\mbox{} 24 & 4 & 4 & 3 & 2\\ 24 & 6 & 4 & 5 & 3\\ \mbox{} \end{array} \qquad \begin{array}{rrrrr} b & v_1 & v_2 & k_1 & k_2\\ \hline 24 & 8 & 3 & 7 & 2\\ 25 & 5 & 5 & 4 & 4\\ 27 & 9 & 3 & 8 & 2\\ 28 & 7 & 4 & 3 &3\\ 28 & 7 & 4 & 6 & 3\\ \mbox{} \end{array} \qquad \begin{array}{rrrrr} b & v_1 & v_2 & k_1 & k_2\\ \hline 30 & 5 & 3 & 2 & 2\\ 30 & 5 & 4 & 4 & 2\\ 30 & 6 & 3 & 3 & 2\\ 30 & 6 & 5 & 5 & 4\\ 32 & 8 & 4 & 7 & 3\\ \mbox{} \end{array} \] \end{table} \begin{constn} \textbf{(Subcartesian products)} \label{c:subcart} If $k_2$ divides $v_2$ then there may exist a resolved $2$-design $\Delta_2$ for $v_2$ drugs in $b_2$ blocks of size~$k_2$ with $r$ resolution classes. Suppose that $\Delta_1$ is a $2$-design for $v_1$ cancer types in $b_1$ blocks of size~$k_1$, where $b_1$ is a multiple of~$r$. Now we can achieve a $2$-part $2$-design without taking the full product. Partition the blocks of $\Delta_1$ into $r$ classes of size $b_1/r$ in any way at all, and match these classes to the resolution classes of $\Delta_2$ in any way. For each matched pair, construct the cartesian product design. Putting these products together gives a design of the required type with $b_1b_2/r$ blocks, considerably fewer than the $b_1b_2$ blocks in the entire product of $\Delta_1$ and $\Delta_2$. More generally, if the design $\Delta_2$ is $c$-partitionable and $c$ divides $b_1$ then replace the resolution classes in this construction by the $c$ classes of blocks. This gives a $2$-part $2$-design with $b_1b_2/c$ blocks. Putting $c=1$ gives Construction~\ref{c:cart} as a special case of this. \end{constn} Figures~\ref{f5two}(a) and~(b) show two possibilities when $v_1=v_2=4$, $k_1=k_2=2$ and $r=3$. \begin{figure} \begin{center} \begin{tabular}{c@{\qquad}c} \begin{tabular}{ccc} Block & Cancer types & Drugs\\ \hline 1 & C1, C2 & D1, D3\\ 2 & C1, C2 & D2, D4\\ 3 & C3, C4 & D1, D3\\ 4 & C3, C4 & D2, D4\\ 5 & C1, C3 & D2, D3\\ 6 & C1, C3 & D1, D4\\ 7 & C2, C4 & D2, D3\\ 8 & C2, C4 & D1, D4\\ 9 & C1, C4 & D1, D2\\ 10 & C1, C4 & D3, D4\\ 11 & C2, C3 & D1, D2\\ 12 & C2, C3 & D3, D4 \end{tabular} & \begin{tabular}{ccc} Block & Cancer types & Drugs\\ \hline 1 & C1, C2 & D1, D3\\ 2 & C1, C2 & D2, D4\\ 3 & C1, C3 & D1, D3\\ 4 & C1, C3 & D2, D4\\ 5 & C1, C4 & D2, D3\\ 6 & C1, C4 & D1, D4\\ 7 & C2, C3 & D2, D3\\ 8 & C2, C3 & D1, D4\\ 9 & C2, C4 & D1, D2\\ 10 & C2, C4 & D3, D4\\ 11 & C3, C4 & D1, D2\\ 12 & C3, C4 & D3, D4 \end{tabular} \\ \mbox{}\\[-3\jot] (a) Constructions 2 and 3 & (b) Construction 2 but not Construction 3 \end{tabular} \end{center} \caption{Two designs for 4 cancer types and 4 drugs, using 12 blocks; each block has 2 cancer types and 2 drugs.} \label{f5two} \end{figure} Table~\ref{t3} shows some parameter sets for designs that can be made by Construction 2, possibly after an interchange or a swap, with $k_i\leq 10$ for $i=1$ and $i=2$. There are two special cases. When $b_1=r$ then we simply match the blocks of $\Delta_1$ to the resolution classes of $\Delta_2$. When $v_1=3$, $k_1=2$, $v_2=4$, $k_2=2$ and $r=3$, this gives the design in Fig.~\ref{f2}. When $v_1=v_2=6$, $k_1=k_2=3$ and $r=10$, this gives the design in Fig.~\ref{f20}(a). When $v_1=7$, $k_1=3$, $v_2=15$, $k_2=3$ and $r=7$, this gives a $2$-part $2$-design with $b=35$, $r_1=5$, $r_2=7$, $\lambda_{11}=5$, $\lambda_{22}=1$ and $\lambda_{12}=3$. \begin{figure} \begin{center} \begin{tabular}{ccc} Block & Cancer types & Drugs\\ \hline 1 & C1, C2 & D1, D3\\ 2 & C1, C2 & D2, D4\\ 3 & C1, C3 & D2, D3\\ 4 & C1, C3 & D1, D4\\ 5 & C2, C3 & D1, D2\\ 6 & C2, C3 & D3, D4 \end{tabular} \end{center} \caption{Design for 3 cancer types and 4 drugs, using 6 blocks; each block has 2 cancer types and 2 drugs.} \label{f2} \end{figure} On the other hand, if $\Delta_1$ is also resolved with replication $r$ then we may match the resolution classes of the two designs. For example, when $v_1=v_2=4$ and $k_1=k_2=2$ then we may take $r=3$ and $b_1=b_2=6$ to get the design in Fig.~\ref{f5two}(a). This is not even weakly isomorphic to the design in Fig.~\ref{f5two}(b), where the pairs of blocks from $\Delta_1$ do not form resolution classes. When $v_1/k_1 = v_2/k_2=2$ and $b_1=b_2$, Construction 3 also gives designs with these parameters. \begin{figure} \begin{center} \begin{tabular}{@{}cc} \begin{minipage}[t]{6cm} \begin{tabular}{ccc} Block & Cancer types & Drugs\\ \hline 1 & C1, C2, C3 & D1, D5, D6\\ 2 & C1, C2, C3 & D2, D3, D4\\ 3 & C1, C5, C6 & D1, D2, D6\\ 4 & C1, C5, C6 & D3, D4, D5\\ 5 & C1, C3, C4 & D2, D3, D6\\ 6 & C1, C3, C4 & D1, D4, D5\\ 7 & C1, C2, C6 & D3, D4, D6\\ 8 & C1, C2, C6 & D1, D2, D5\\ 9 & C1, C4, C5 & D4, D5, D6\\ 10 & C1, C4, C5 & D1, D2, D3\\ 11 & C2, C4, C5 & D1, D3, D6\\ 12 & C2, C4, C5 & D2, D4, D5\\ 13 & C2, C3, C5 & D2, D4, D6\\ 14 & C2, C3, C5 & D1, D3, D5\\ 15 & C3, C5, C6 & D3, D5, D6\\ 16 & C3, C5, C6 & D1, D2, D4\\ 17 & C3, C4, C6 & D1, D4, D6\\ 18 & C3, C4, C6 & D2, D3, D5\\ 19 & C2, C4, C6 & D2, D5, D6\\ 20 & C2, C4, C6 & D1, D3, D4 \end{tabular} \end{minipage} & \begin{minipage}[t]{8cm} \begin{tabular}{cccc} Block & Cancer types & Drugs & Biomarkers\\ \hline 1 & C1, C3, C5 & D1, D4, D5& B1, B2\\ 2 & C2, C4, C6 & D2, D3, D6 & B1, B2\\ 3 & C1, C5, C6 & D3, D5, D6 & B1, B3\\ 4 & C2, C3, C4 & D1, D2, D4 & B1, B3\\ 5 & C1, C2, C3 & D2, D3, D5 & B1, B4\\ 6 & C4, C5, C6 & D1, D4, D6 & B1, B4\\ 7 & C1, C4, C5 & D1, D2, D3 & B1, B5\\ 8& C2, C3, C6 & D4, D5, D6 & B1, B5\\ 9& C1, C4, C6 & D2, D4, D5 & B2, B3\\ 10& C2, C3, C5 & D1, D3, D6 & B2, B3\\ 11 & C1, C3, C4 & D3, D4, D6 & B2, B4\\ 12& C2, C5, C6 & D1, D2, D5& B2, B4\\ 13 & C1, C2, C5 & D2, D4, D6 & B2, B5\\ 14& C3, C4, C6 & D1, D3, D5 & B2, B5\\ 15& C1, C2, C4 & D1, D5, D6 & B3, B4\\ 16& C3, C5, C6 & D2, D3, D4 & B3, B4\\ 17 & C1, C2, C6 & D1, D3, D4 & B3, B5\\ 18 & C3, C4, C5 & D2, D5, D6 & B3, B5\\ 19& C1, C3, C6 & D1, D2, D6 & B4, B5\\ 20 & C2, C4, C5 & D3, D4, D5 & B4, B5 \end{tabular} \end{minipage}\\ (a) Construction 2 & (b) Construction 3 (ignoring the $5$ biomarkers)\\ & followed by Construction 9\\ \end{tabular} \caption{Two designs for 6 cancer types and 6 drugs, using 20 blocks. \label{f20}} \end{center} \end{figure} At first sight, the two general constructions given by \cite{muk} are special cases of this. His first construction needs both $\Delta_1$ and $\Delta_2$ to be $c$-partitionable, and matches the classes. This includes the cartesian product when $c=1$, and when $c=3$ it gives the design in Figure~\ref{f5two}(a) but not the one in Figure~\ref{f5two}(b). His second construction use a $c$-partitionable design $\Delta_2$ only when $b_1=c$. However, if $c$ divides $b_1$ then we may replace $\Delta_2$ by $b_1/c$ copies of it, giving a $b_1$-partionable design whose classes can be matched to the blocks of $\Delta_1$. Thus Construction~\ref{c:subcart} is precisely equivalent to the combination of the two in \cite{muk}. \begin{constn} \textbf{(Hadamard matrices)} \label{c:had} Some $2$-part $2$-designs in which $v_1=v_2$ and $k_1=k_2 =v_1/2$ arise from Construction~2. Another way of getting such designs is to start with a Hadamard matrix $H$ of order $4n$, where $n = k_1$, in which the elements in the first row are all $+1$. Identify the $2n$ cancer types with the columns in which the second row has entry $+1$, and identify the $2n$ drugs with the columns in which the second row has entry $-1$. Each of the remaining rows gives two blocks, one containing all the objects whose columns have entries $+1$, and one containing all the objects whose columns have entries $-1$. Thus $b=8n-4$. Moreover, each pair of blocks contains each cancer type and each drug just once, in the concise representation, so the $2$-part $2$-design is $(4n-2)$-partitionable and the lower bound in inequality~(\ref{eq:aha}) is achieved. \end{constn} For example, when $n=3$ we can take \[ H = \left[ \begin{array}{cccccccccccc} +1 & +1 &+1 &+1 &+1 &+1 &+1 &+1 &+1 &+1 &+1 &+1\\ +1 &+1 &+1 &+1 &+1 &+1 &-1 & -1 & -1 & -1 & -1 & -1\\ +1 & -1 & +1 & -1 & +1 & -1 & +1 & -1 & -1 & +1 & +1 & -1\\ +1 & -1 & -1 & -1 & +1 & +1 & -1 & -1 & +1 & -1 & +1 & +1\\ +1 & +1 & +1 & -1 & -1 & -1 & -1 & +1 & +1 & -1 & +1 & -1\\ +1 & -1 & -1 & +1 & +1 & -1 & +1 & +1 & +1 & -1 & -1 & -1\\ +1 & -1 & -1 & +1 & -1 & +1 & -1 & +1 & -1 & +1 & +1 & -1\\ +1 & -1 & +1 & +1 & -1 & -1 & -1 & -1 & +1 & +1 & -1 & +1\\ +1 & +1 & -1 & -1 & +1 & -1 & -1 & +1 & -1 & +1 & -1 & +1\\ +1 & +1 & -1 & +1 & -1 & -1 & +1 & -1 & -1 & -1 & +1 & +1\\ +1 & +1 & -1 & -1 & -1 & +1 & +1 & -1 & +1 & +1 & -1 & -1\\ +1 & -1 & +1 & -1 & -1 & +1 & +1 & +1 & -1 & -1 & -1 & +1 \end{array} \right]. \] Labelling the columns as $C_1$, \ldots, $C_6$, $D_1$, \ldots, $D_6$ in order, the construction gives the design in the first three columns of Fig.~\ref{f20}(b), ignoring the biomarkers. It is not weakly isomorphic to the design in Fig.~\ref{f20}(a), because all triples of cancer types and all triples of drugs occur. \begin{table} \caption{Parameter sets for the designs with the least number of blocks that can be made by Constructions \ref{c:subcart} or \ref{c:had} but not \ref{c:cart}: $v_1$ is the number of cancer types, $v_2$ is the number of drugs, and $b$ is the number of blocks, each of which has $k_1$ cancer types and $k_2$ drugs; $r$ is a number used in the construction. Asterisks denote the only parameter sets for designs achievable by Construction~3} \label{t3} \[ \addtolength{\arraycolsep}{-0.7\arraycolsep} \begin{array}{crrrrrr} & b & v_1 & v_2 & k_1 & k_2 & r\\ \hline & 6 & 4 & 3 & 2 & 2 & 3\\ {*} & 12 & 4 & 4 & 2 & 2 & 3\\ & 12 & 9 & 4 & 3 & 3 & 4\\ & 14 & 8 & 7 & 4 & 3 & 7\\ & 14 & 8 & 7 & 4 & 6 & 7\\ & 15 & 6 & 5 & 2 & 4 & 5\\ & 18 & 9 & 4 & 8 & 2 & 3\\ & 20 & 6 & 5 & 3 & 2 & 10\\ {*} & 20 & 6 & 6 & 3 & 3 & 5\\ & 20 & 16 & 5 & 4 & 4 & 5\\ & 22 & 12 & 11 & 6 & 5 & 11\\ & 22 & 12 & 11 & 6 & 10 & 11\\ & 24 & 9 & 4 & 3 & 2 & 3\\ & 24 & 9 & 8 & 3 & 7 & 4\\ \end{array} \quad \begin{array}{crrrrrr} & b & v_1 & v_2 & k_1 & k_2 & r\\ \hline & 28 & 8 & 7 & 2 & 3 & \hphantom{0}7\\ & 28 & 8 & 7 & 2 & 6 & 7\\ {*} & 28 & 8 & 8 & 4 & 4 & 7\\ & 30 & 6 & 4 & 2 & 2 & 3\\ & 30 & 6 & 5 & 2 & 2 & 5\\ & 30 & 6 & 6 & 3 & 2 & 5\\ & 30 & 10 & 4 & 4 & 2 & 3\\ & 30 & 15 & 4 & 7 & 2 & 3\\ & 35 & 15 & 7 & 3 & 3 & 7\\ & 35 & 15 & 7 & 3 & 6 & 7\\ & 36 & 9 & 4 & 4 & 2 & 3\\ & 36 & 9 & 9 & 3 & 3 & 4\\ & 36 & 10 & 4 & 9 & 2 & 3\\ {*} & 36 & 10 & 10 & 5 & 5 & 9 \end{array} \quad \begin{array}{crrrrrr} & b & v_1 & v_2 & k_1 & k_2 & r\\ \hline & 40 & 16 & 5 & 4 & 2 & 5\\ & 40 & 16 & 6 & 4 & 3& 5\\ & 42 & 7 & 4 & 2 & 2 & 3\\ & 42 & 8 & 7 & 4 & 2 & 7\\ & 42 & 21 & 4 & 5 & 2 & 3\\ & 42 & 21 & 8 & 5 & 4 & 7\\ {*} & 44 & 12 & 12 & 6 & 6& 11\\ & 45 & 6 & 6 & 2 & 2 & 5\\ & 45 & 10 & 6 & 4 & 2 & 5\\ & 45 & 15 & 6 & 7 & 2 & 5\\ & 48 & 16 & 4 & 6 & 2 & 3\\ & 48 & 16 & 9 & 6 & 3 & 4\\ \ast & 52 & 14 & 14 & 7 & 7& 13\\ & 54 & 27 & 4 & 13 & 2 & 3\\ \end{array} \quad \begin{array}{crrrrrr} & b & v_1 & v_2 & k_1 & k_2 & r\\ \hline & 56 & 8 & 8 & 4 & 2 & 7\\ & 60 & 10 & 4 & 3 & 2 & 3\\ & 60 & 10 & 6 & 3 & 3 & 10\\ & 60 & 16 & 4 & 8 & 2 & 3\\ & 60 & 16 & 6 & 4 & 2 & 5\\ & 60 & 16 & 6 & 8 & 3 & 10\\ & 60 & 16 & 9 & 4 & 3 & 4\\ & 60 & 16 & 10 & 4 & 4 & 5\\ & 60 & 16 & 15 & 4 & 7 & 5\\ {*} & 60 & 16 & 16 & 8 & 8& 15\\ & 60 & 21 & 4 & 7 & 2 & 3\\ & 60 & 21 & 6 & 7 & 3 & 10\\ & 60 & 25 & 4 & 5 & 2 & 3\\ & 60 & 25 & 6 & 5 & 3 & 10\\ \end{array} \] \end{table} The asterisked entries in Table~\ref{t3} show the parameters of the smallest designs that can be constructed by this method. When $n=4$ this construction gives the design in Fig.~\ref{f5two}(a). For some values of $n$, different choices of Hadamard matrix, or different designations of which row is second, can give non-isomorphic designs. It may be that there are some values of $n$ for which there exists a Hadamard matrix of order $4n$ but no $2$-$(2n,n,n-1)$ design. If so, Construction~3 gives a design for these parameters but Construction~2 does not. Such a value of $n$ is likely to be too large to affect designs of practical size. However, we retain this construction, because it produces resolvable designs, which can be used as ingredients in Construction~\ref{c:mprod} in Section~\ref{sec2} to give designs without too many blocks. \begin{constn} \textbf{(Symmetric $2$-designs)} Here is another general method of construction. Consider a symmetric balanced incomplete-block design $\Delta$ for $v$ treatments in $v$ blocks of size $k$. Every pair of distinct treatments concur in $\lambda$ blocks, where $\lambda = k(k-1)/(v-1)$, and every pair of distinct blocks have $\lambda$ treatments in common. Let $\Gamma$ be one block of $\Delta$. Identify the treatments in $\Gamma $ with $k$ drugs $D_1$, \ldots, $D_k$ and the remaining treatments with $v-k$ cancer types $C_1$, \ldots, $C_{v-k}$. Now consider the design~$\Delta'$ consisting of all blocks of $\Delta$ except $\Gamma$. Each of these blocks contains $\lambda$ drugs and $k-\lambda$ cancer types. In $\Delta'$, each pair of drugs concur in $\lambda-1$ blocks; each pair of cancer types concur in $\lambda$ blocks; and each drug occurs with each cancer type in $\lambda$ blocks. Thus $b = v-1$, $v_1=v-k$, $v_2=k$, $k_1=k-\lambda$, $k_2=\lambda$, $\lambda_{11} = \lambda_{12}= \lambda$ and $\lambda_{22} = \lambda -1$. \end{constn} We can use Construction~4 whenever there exists a symmetric $2$-$(v,k,\lambda)$ design with $v=v_1+v_2$, $k=v_2$ and $\lambda=k_2$, provided that $k_1+k_2=v_2$. In order to satisfy condition~(d), $\lambda$~must be bigger than one. The lower bound in inequality~(\ref{eqT4}) is always met. The properties of symmetric $2$-designs guarantee that conditions~(c) and (d) hold, but they also match up the blocks of the C-design and the D-design, which typically produces fewer blocks than previous construction methods. The design in Fig.~\ref{f1} can be obtained by this construction with $v=11$, $k=5$ and $\lambda=2$. Figure~\ref{f2} gives the design with $v=7$, $k=4$ and $\lambda=2$. Table~\ref{t1} lists parameter sets for small designs that can be constructed by this method, with an interchange and swaps where necessary: again using Table~I.1 in \cite{hall}. After allowing for possible interchanges and swaps, this table represents $34$ designs. \begin{table} \caption{Parameter sets for which small designs can be made by Construction~4: $v_1$ is the number of cancer types, $v_2$ is the number of drugs, and $b$ is the number of blocks, each of which has $k_1$ cancer types and $k_2$ drugs; $v$, $k$ and $\lambda$ are parameters of the symmetric $2$-design used in the construction} \label{t1} \[ \addtolength{\arraycolsep}{-0.8\arraycolsep} \begin{array}{rrrrrrrr} b & v_1 & v_2 & k_1 & k_2 &v & k & \lambda\\ \hline 6 & 4 & 3 & 2 & 2 & 7 & 4 & 2\\ 10 &6 & 5& 3 & 2 & 11 & 5 & 2\\ 12 & 9 & 4 & 6 & 3 & 13 & 9 & 6\\ \end{array} \qquad \begin{array}{rrrrrrrr} b & v_1 & v_2 & k_1 & k_2 &v & k & \lambda\\ \hline 14 &8 & 7 & 4 & 3 &15 & 7 & 3\\ 15 &10 & 6 & 4 & 2 & 16 & 6 & 2\\ 18 & 10 & 9 & 5 & 4 & 19 & 9 & 4\\ \end{array} \qquad \begin{array}{rrrrrrrr} b & v_1 & v_2 & k_1 & k_2 &v & k & \lambda\\ \hline 22 & 12 & 11 & 6 & 5 & 23 & 11 & 5\\ 24 & 16 & 9 & 6 & 3 & 25 & 9 & 3\\ \mbox{} \end{array} \] \end{table} \begin{constn} \textbf{(Augmentation)} Given a $2$-part $2$-design~$\Delta$ in which $v_2=2k_2+1$, we may augment it to one for one more drug by increasing $v_2$ to $v_2+1$ and $k_2$ to $k_2+1$ while merely doubling the number of blocks. Replace each block of $\Delta$ by two blocks, both with the same set of cancer types as before. One of these blocks has the previous set of drugs and the extra drug, while the other has all the remaining drugs. \end{constn} For example, augmenting the design in Fig.~\ref{f1} gives the design in Fig.~\ref{f20}(a). Applying the augmentation just to the D-design gives a resolvable $3$-design, as shown in the Extension Theorem of \cite{alltop}. This can be used directly in Construction~\ref{c:subcart}. However, augmentation is such a straightforward way of obtaining one $2$-part $2$-design from another that we think it is worth identifying. \begin{constn} \textbf{(Group-divisible designs)} \label{c:gd} If $v_1=v_2=v$ and $k_1=k_2=k$ then the zipped form of a $2$-part $2$-design is a semi-regular group-divisible incomplete-block design for two so-called groups of $v$ treatments in blocks of size $2k$ with $k>1$: see \cite{srgd}. Unzipping any one of these gives a $2$-part $2$-design. \end{constn} Table VII of \cite{clat} gives three such designs. Unzipping them gives the product design for the first parameter set in Table~\ref{t2}, the design in Fig.~\ref{f5two}(a) and the design in the first three columns of Fig.~\ref{f20}(b). \begin{constn} \textbf{(Group actions)} \label{c:ga} Here is a construction based on group actions. Suppose that the group $G$ acts $2$-transitively on two sets $C$ and $D$ of sizes $v_1$ and $v_2$ respectively, and that $G$ is also transitive in the induced action on $C\times D$. Choose a subset of $C$ and a subset of $D$, each containing at least two points; their union is a block, and the images of this block under $G$ give the remaining blocks. The blocks have to be unzipped to give a $2$-part $2$-design. This does not give much control over $b$, except that we know it is a divisor of the order of $G$. A strategy for finding good designs by this method is to choose a subgroup $H$ of $G$ which acts intransitively on each of $C$ and $D$, and to use fixed sets of $H$ on $C$ and $D$ in the construction. \end{constn} The three examples below arise from this construction, but can be more easily be derived from the $3$-$(22,6,1)$ design $\Xi$ whose automorphism group is the Mathieu group $M_{22}$. It has $22$ points and $77$ blocks of size $6$, any two blocks meeting in zero or two points; see \citet[Chapters 1 and 9]{cvl}. For simplicity, we describe the cancer types as red points and the drugs as green points. Take a block $B_0$ of the design $\Xi$; its points are red, and the remaining $16$ points are green. For each of the $60$ blocks meeting $B_0$ in two points, we define a block of our new design containing two red and four green points. Now two red points lie in five blocks, one of which is $B_0$; so they lie in four more blocks. A red and green point lie in five blocks, each containing two red points. Two green points lie in three blocks meeting $B_0$. For each point of $B_0$ lies in a unique such block, and each block contains two points of $B_0$. So we have an example with $v_1=6$, $v_2=16$, $b=60$, $k_1=2$, $k_2=4$, and $(\lambda_{11},\lambda_{12},\lambda_{22})=(4,5,3)$. Table \ref{t3} shows these parameters for a design made by Construction 2 and an interchange. The other two examples use the $4$-$(23,7,1)$ design $\Theta$ in which the blocks through the extra point are formed by adjoining that point to the blocks of $\Xi$: see \cite{cvl}. The counting arguments that verify their properties are similar to what we have just seen. For the second design, we take a set $A$ of seven points which form a block of $\Theta$ not containing the extra point. These will be red, and the remaining $15$ points of $\Xi$ green. Any block of $\Xi$ meets $A$ in one or three points; we take the blocks meeting $A$ in three points to be the blocks of the required design. We obtain an example with $v_1=7$, $v_2=15$, $b=35$, $k_1=k_2=3$, and $(\lambda_{11},\lambda_{12},\lambda_{22})=(5,3,1)$. This has the same parameters as the fifth design made using Construction~\ref{c:subcart}. Finally, using the $23$-point design $\Theta$ but not throwing away the extra point we obtain a design with $v_1=7$, $v_2=16$, $k_1=3$, $k_2=4$, $(\lambda_{11},\lambda_{12},\lambda_{22})=(20,15,7)$, $b=140$. Another design with these parameters is the cartesian product of the projective plane of order 2 and the affine plane of order 4; these designs are not isomorphic. To build these from the group action construction, the relevant groups are the stabilizers of the sets of six or seven red points in the appropriate Mathieu groups; these are the groups $2^4\colon S_6$, $A_7$, and $2^4\colon A_7$ respectively. \section{Generalizing the design problem} \label{sec2} \subsection{The extended problem} In March 2016 Valerii Fedorov extended the problem as follows. Can we add a third factor, whose levels are biomarkers in this case, subject to the obvious extra conditions? Here we generalize this to an arbitrary number $m$ of factors. The conditions for an $m$-part $2$-design are as follows. The analogue of conditions (a)--(b) is that, for $1\leq i \leq m$, factor~$i$ has $v_i$ levels and each medical centre involves $k_i$ of them, where $k_i<v_i$; the analogue of conditions (c)--(d) is that, for $1\leq i\leq m$, each pair of levels of factor~$i$ are used together at the same non-zero number $\lambda_{ii}$ of medical centres. The generalization of condition~(e) is less clear. When $i=3$, a weak generalization is that each biomarker is used on each cancer type at the same number $\lambda_{13}$ of medical centres and that each biomarker is used with each drug at the same number $\lambda_{23}$ of medical centres. For now, we use this weak version. Note, however, that this gets us into the territory of factorial design, so we might be confounding all or part of a two-factor interaction with all or part of a main effect. By analogy with orthogonal arrays \citep{OAbook}, we call this weak generalization a \textit{$3$-part $2$-design with strength~$2$}, whereas a $3$-part $2$-design with strength~$3$ would have every triple of (cancer type, drug, biomarker) at the same number $\lambda_{123}$ of medical centres. Thus the strength-$2$ generalization of condition~(e) is that, for $1 \leq i <j \leq m$, each level of factor~$i$ occurs with each level of factor~$j$ at the same number $\lambda_{ij}$ of medical centres. \subsection{Conditions on parameters in the extended problem} \begin{theorem} In an $m$-part $2$-design of strength~$2$, all of the following are satisfied. \begin{itemize} \item[(i)] The analogues of equations~(\ref{eqT1}) and~(\ref{eqT2}) hold for each factor. \item[(ii)] Equation~(\ref{eqT3}) generalizes to $bk_ik_j = v_iv_j\lambda_{ij}$ for $1\leq i<j\leq m$. \item[(iii)] If the design is $c$-partitionable then $b \geq v_1+ \cdots + v_m +c-m$. \item[(iv)] In particular, $b \geq v_1 + \cdots + v_m - m+1$. \end{itemize} \end{theorem} Proofs are similar to those in Section~\ref{sec:thm}. Part~(iv) is precisely Theorem~1 of \cite{muk}. \section{Constructions of $m$-part $2$-designs of strength at least~$2$} \label{sec:last} \subsection{Two main constructions} Here we give the main construction of \cite{muk} in the language of this paper. \begin{constn} \textbf{(Orthogonal arrays)} \label{c:oa} Suppose that there is a positive integer~$c$ such that, for $i=1$, \ldots, $m$, $\Delta_i$ is a $c$-partitionable $2$-design for $v_i$ treatments in $b_i$ blocks of size~$k_i$. Moreover, there is an orthogonal array $\Gamma$ with $m$ columns, where column~$i$ contains $b_i/c$ symbols for $1\leq i \leq m$. Match the $c$ classes of blocks of $\Delta_1$, \ldots, $\Delta_m$. For $j=1$, \ldots, $c$ separately, each row $\rho$ of $\Gamma$ gives a block of the new design, as follows. For $i=1$, \ldots, $m$, identify the block in class~$j$ of $\Delta_i$ labelled by the symbol in row $\rho$ and column~$i$ of $\Gamma$: then form the cartesian product of these $m$ blocks. This gives a $c$-partitionable $m$-part $2$-design in $sc$ blocks, where $s$ is the number of rows of $\Gamma$. The strength of this new design is equal to the strength of the orthogonal array $\Gamma$. In one extreme case, $\Gamma$ has all possible different rows, so that $s=\prod_{i=1}^m b_i/c^m$. If, in addition, $c=1$, then $s=\prod_{i=1}^m b_i$ and we obtain the full cartesian product. \end{constn} The design in Fig.~\ref{f8and9}(a) can be made in this way with $c=1$, using an orthogonal array with three columns, each with three symbols. An example with $m=3$ and $c=2$ is shown in Fig.~\ref{f8and9}(b), which is contained in Table~1 of \cite{muk}. Here, $v_i=4$, $k_i=2$ and $b_i=6$ for $i=1$, $2$, $3$, and each of $\Delta_1$, $\Delta_2$ and $\Delta_3$ can be resolved into pairs of blocks. For each design, label the replicates $1$, $2$, $3$ in any order. For $j=1$, $2$, $3$, combine the $j$-th replicates from the three designs, not by the full cartesian product, which would give eight blocks, but by using an orthogonal array of strength~$2$ with four rows and three columns, each with two symbols. This $3$-part $2$-design has strength $2$ but not strength $3$. \begin{figure} \begin{center} \begin{tabular}{@{}cc} \begin{minipage}[t]{6cm} \begin{tabular}{cccc} & Cancer & & Bio-\\ Block & types & Drugs & markers\\ \hline 1 & C1, C2 & D1, D2 & B1, B2\\ 2 & C1, C3 & D1, D3 & B1, B3\\ 3 & C2, C3 & D2, D3 & B2, B3\\ 4 & C1, C2 & D2, D3 & B1, B3\\ 5 & C1, C3 & D1, D2 & B2, B3\\ 6 & C2, C3 & D1, D3 & B1, B2\\ 7 & C1, C2 & D1, D3 & B2, B3\\ 8 & C1, C3 & D2, D3 & B1, B2\\ 9 & C2, C3 & D1, D2 & B1, B3\\ \mbox{}\\ \mbox{}\\ \mbox{} \end{tabular} \end{minipage} & \begin{minipage}[t]{6cm} \begin{tabular}{cccc} & Cancer & & Bio-\\ Block & types & Drugs & markers\\ \hline 1 & C1, C2 & D1, D2 & B1, B2\\ 2 & C1, C2 & D3, D4 & B3, B4\\ 3 & C3, C4 & D1, D2 & B3, B4\\ 4 & C3, C4 & D3, D4& B1, B2\\ 5 & C1, C3 & D1, D3 & B1, B3\\ 6 & C1, C3 & D2, D4 & B2, B4\\ 7 & C2, C4 & D1, D3 & B2, B4\\ 8 & C2, C4 & D2, D4 & B1, B3\\ 9 & C1, C4 & D1, D4 & B1, B4\\ 10 & C1, C4 & D2, D3 & B2, B3\\ 11 & C2, C3 & D1, D4 & B2, B3\\ 12 & C2, C3 & D2, D3 & B1, B4 \end{tabular} \end{minipage} \\ (a) $3$ cancer types, $3$ drugs, $3$ biomarkers & (b) $4$ cancer types, $4$ drugs, $4$ biomarkers \end{tabular} \end{center} \caption{Two $3$-part $2$-designs, both made from Construction~8} \label{f8and9} \end{figure} Table~1 of \cite{sitt} gives a $7$-part $2$-design made in this way with $b=24$ and $v_i=2k_i=4$ for $i=1$, \ldots, $7$. \begin{constn} \textbf{(Products of multi-part designs)} \label{c:mprod} The ingredients of the previous construction are $m$ individual $2$-designs and an orthogonal array, which may be trivial. Instead, we may start with multi-part $2$-designs, or an assortment of $2$-designs and multi-part $2$-designs. The use of orthogonal arrays and/or $c$-partitioning can be extended to this method too. As in Construction~\ref{c:subcart}, we can allow one of the constituent designs to be not $c$-partitionable, as long as its number $b$ of blocks is divisible by $c$. \end{constn} The full product of an $m_1$-part $2$-design $\Theta_1$ with $b_1$ blocks and an $m_2$-part $2$-design $\Theta_2$ with $b_2$ blocks is an $(m_1+m_2)$-part $2$-design with $b_1b_2$ blocks and strength~$2$. If $\Theta_1$ has strength $m_1$ and $m_2=1$ then the full product has strength $m_1+1$. For example, if $m=3$, $v_3=3$ and $k_3=2$ then the product of the design in Fig.~\ref{f1} and a $2$-design with three blocks of size $2$ gives a $3$-part $2$-design with $30$ blocks and strength~$3$. As an example of the relaxation of the $c$-partitionable condition, suppose that $\Theta$ is a $c$-partitionable $m_1$-part $2$-design for drugs and cancer types and $\Delta$ is a $2$-design for $v_3$ biomarkers in $c$ blocks of size $k_3$. We can simply match the blocks of $\Delta$ to the classes of $\Theta$ in any way. The $3$-part $2$-design in Fig.~\ref{f20}(b) was made like this by starting with a $2$-part $2$-design made by Construction~\ref{c:had}, grouping blocks into ten classes of the form $\{2i-1,2i\}$, and matching these classes to the ten blocks of a $2$-design $\Delta$ for five biomarkers. The special case of this with $b=c$ is the second general construction given by \cite{muk}. As noted in Section~\ref{sec:2con}, this specialization does not restrict his designs. However, because we have now given more constructions for the case that $m=2$, applying the various product constructions to them produces new designs for higher values of $m$ also. \subsection{Other constructions} The augmentation method in Construction~5 easily generalizes to three or more factors. If $v_i =2k_i +1$ then $v_i$ and $k_i$ can be increased by one while the number of blocks is merely doubled. If $v_1= \cdots =v_m = v$ and $k_1= \cdots =k_m=k$ then the zipped form of an $m$-part $2$-design is a semi-regular group-divisible design for $mv$ treatments in blocks of size $mk$ with $k>1$. Just as in Construction~6, any such design can be unzipped to give a $m$-part $2$ design. There are two such designs with $m=3$ in Table~VII of \cite{clat}. Their unzipped forms are the designs in Fig.~\ref{f8and9}. The one with $m=4$ gives the design in Figure~\ref{fig:new}, which can also be obtained from a $9\times 4$ orthogonal array with three symbols in each column. \begin{figure} \begin{center} \begin{tabular}{ccccc} & Cancer & & Bio- \\ Block & types & Drugs & markers & Activity\\ \hline 1 & C1, C2 & D1, D2 & B1, B2 & A1, A2\\ 2 & C1, C2 & D2, D3 & B2, B3 & A1, A3\\ 3 & C1, C2 & D1, D3 & B1, B3 & A2, A3\\ 4 & C1, C3 & D1, D2 & B2, B3 & A2, A3\\ 5 & C1, C3 & D2, D3 & B1, B3 & A1, A2\\ 6 & C1, C3 & D1, D3 & B1, B2 & A1, A3\\ 7 & C2, C3 & D1, D2 & B1, B3 & A1, A3\\ 8 & C2, C3 & D2, D3 & B1, B2 & A2, A3\\ 9 & C2, C3 & D1, D3 & B2, B3 & A1, A2\\ \end{tabular} \end{center} \caption{A $4$-part $2$-design} \label{fig:new} \end{figure} The group method in Construction 7 also easily extends to three or more factors: simply take a permutation group with more than two $2$-transitive actions. \section*{Acknowledgement} We thank Valerii Fedorov for posing this interesting problem and for the illustration in Fig.~\ref{f1}.
{'timestamp': '2018-08-03T02:14:26', 'yymm': '1803', 'arxiv_id': '1803.00006', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00006'}
arxiv
\section{Introduction} \label{sec:intro} Spatial ANC systems aim to attenuate undesired noise over a spatial region by generating an anti-noise sound field over the region using secondary sources. Such a system is viewed as an extension to the well-studied single-channel ANC~\cite{kuo1995active,kuo1999active,kajikawa2012recent} to a multi-channel system~\cite{kuo1995active,elliott1987multiple}. However, to control a sound field over an extended region needs a large number of reference and error microphones, to capture the reference noise signals and residual error signals, respectively, as well as many loudspeakers to generate the anti-noise. The requirement to have many microphones limits the viability of using spatial ANC systems in practice. Nevertheless, in most practical applications~\cite{chen2015spatial,samarasinghe2016recent}, the underlying noise field is due to a small number of underlying noise sources. In this paper, we aim to reduce the number of microphones required by spatial ANC systems by using a sparse signal representation. In practice, multiple-channel ANC in the frequency domain~\cite{douglas1999fast,bouchard2003computational} is widely used to attenuate the noise field at multiple points where the error microphones are placed. One drawback of this approach to create a large quite zone is the requirement to uniformly place many error microphones inside the control region. In contrast, spatial-sound-field representation techniques, such as wave field synthesis (WFS)~\cite{berkhout1993acoustic} and higher order ambisonics (HOA)~\cite{poletti2000unified,abhayapala2002theory} are promising techniques to control not only multiple points but the entire space of interest. These techniques have been applied to ANC and have shown that mode-domain ANC can achieve noise attenuation over a large space even with less computational complexity~\cite{morgan1991adaptive,spors2008efficient,zhang2015noise}. However, such systems still require a large number of microphones and loudspeakers to reproduce the sound field properly, thus limiting the feasibility of practical implementations. Without a theoretically sufficient number of sensors, the system suffers from artifacts due to spatial aliasing~\cite{ahrens2012analytic} due to violating the spatial Nyquist sampling criterion. One way to alleviate the aliasing restriction is by expressing the noise field using only a small number of basis functions from an over complete dictionary. This approach is well known as compressive sensing (CS)~\cite{candes2008introduction}, which can provide an accurate solution for underdetermined problems where the sparse characteristic of the underlying signal field is usually used to solve the problem~\cite{malioutov2005sparse}. In this paper, we propose a mode-domain ANC system that can perform noise attenuation in large space beyond the spatial Nyquist frequency using few reference microphones than required by Nyquist theory. We represent the reference noise field as a superposition of weighted plane waves impinging from the far field. Using the estimated plane wave weights calculated by adopting several types of CS methods, we reconstruct the reference mode coefficients, which are expected to include less artifacts caused by spatial aliasing. The proposed methods are evaluated and compared in terms of reference-noise-field reproduction accuracy and noise attenuation level. We demonstrate that our proposed method can overcome the spatial Nyquist frequency limitation. Furthermore, we show that the number of reference microphones can be reduced while controlling the noise field properly. Nicolas~\cite{epain2009application} proposed CS sound field reproduction based on plane wave decomposition by introducing a HOA-based constraint. However, they calculated the loudspeaker weights using amplitude-panning, which cannot be used directly for mode-domain processing. Jihui~\cite{zhangg2016sparse,zhang2016multichannel} proposed the sparse complex FxLMS algorithm although they applied the CS approach to calculate sparse loudspeaker weights so that the spatial-aliasing artifacts cannot be avoided, which is caused by the spatial sampling of the microphone array. \section{Problem statement} \label{sec:formula} Let us consider a circular microphone array capturing a noise field generated by noise sources outside the microphone array in 2D space. We can represent an incident noise field at an arbitrary point ${\bf x} \equiv (r, \phi)$: \begin{eqnarray} S({\bf x},k) &=& \sum^{\infty}_{m=-\infty}\beta_m(k) J_m(kr) e^{im \phi} \label{eq:cylex1} \\ &\approx& \sum^{M}_{m=-M}\beta_m(k) J_m(kr) e^{im \phi} , \label{eq:cylex2} \end{eqnarray} where $k = 2 \pi f / c$ is the wave number, $f$ is the frequency, $c$ is the speed of sound, $\beta_m(k)$ is the $m$th-order circular mode coefficient, and $J_m(\cdot)$ is the $m$th-order Bessel function. In practice, (\ref{eq:cylex1}) can be truncated to $M = \lceil ekR/2 \rceil$~\cite{kennedy2007intrinsic} or $M = \lceil kR \rceil$~\cite{ward2001reproduction}, where $R$ is the radius of a controllable spatial region. The mode coefficient can be calculated utilizing orthogonal exponential functions: \begin{equation} \beta_m(k) = \frac{1}{Q J_m(kr)} \sum^{Q}_{q=1} S({\bf x},k) e^{-im \phi_q} , \label{eq:mode_extract} \end{equation} where $Q$ is the number of microphones and $\phi_q$ is the azimuth angle of the $q$th microphone. We need at least $Q \ge 2M+1$ microphones to avoid spatial aliasing~\cite{samarasinghe2014wavefield}. Figure~\ref{fig:spectrogram} shows the mode coefficients of the noise field captured by a $41$-element circular microphone array of radius $2$~m. The maximum order of the mode coefficients is $M=20$. Observe that spatial aliasing artifacts appear for higher modes above 546 Hz, which is the spatial Nyquist frequency for this condition. The high amplitude of low frequency corresponds to an evanescent wave~\cite{williams1999fourier} of the cylindrical source. This evanescent component only exists near the source, and the amplitude decays exponentially~\cite{ahrens2012analytic}. Therefore, we assume that the impact on the performance of an ANC system inside the control region is minimal. Our objective is to derive an algorithm to acquire precise reference mode coefficients of a noise field, which are then used to perform ANC instead of using direct mode coefficient extraction (\ref{eq:mode_extract}) containing spatial aliasing artifacts caused by the theoretical restriction, i.e. $M = \lceil kR \rceil$. We expect the noise field can be attenuated at higher frequencies beyond the spatial Nyquist frequency, even with an insufficient number of microphones. \begin{figure}[t] \vspace*{-5pt} \centering \centerline{\includegraphics[width=0.7\hsize]{spectrogram.png}} \vspace{-1pt} \caption{Extracted circular mode coefficients of cylindrical wave using microphone outputs. The horizontal broken line indicates the spatial Nyquist frequency.} \label{fig:spectrogram} \vspace{-4pt} \end{figure} \begin{figure}[t] \vspace*{-5pt} \centering \centerline{\includegraphics[width=0.95\hsize]{NCsys.pdf}} \vspace{-1pt} \caption{Geometric setup of feedforward ANC system. The colored circle indicates the control region.} \label{fig:NCsys} \vspace{-4pt} \end{figure} \section{Plane wave weight estimation} \label{sec:estimation} In this section, we derive mode coefficient reconstruction based on plane wave decomposition assuming that the noise field is constructed by a superposition of weighted plane waves. The weights of the plane waves can be estimated accurately by utilizing the CS approach, which can be used to derive a sparse solution using only a few measurements. As an alternative to (\ref{eq:cylex2}), the noise field can be described by $L$ plane waves impinging towards the coordinate origin~\cite{fan2014practical}: \begin{equation} S({\bf x}, k) = \sum^{L}_{\ell=1} \gamma_\ell e^{ik \hat{ {\bf y}}_\ell \cdot {\bf x}} , \label{eq:pwdecomp} \end{equation} where $\gamma_\ell$ is the weight of $\ell$th plane wave and $\hat{ {\bf y}}_\ell \equiv (1, \phi_\ell)$ is a unit vector towards the direction of the $\ell$th plane wave. Circular expansion of the incident noise field due to an unit-magnitude plane wave is given by \begin{equation} e^{ik \hat{ {\bf y}}_\ell \cdot {\bf x}} = \sum^M_{m=-M} i^m e^{-im \phi_\ell} J_m(kr) e^{im \phi} . \label{eq:pw} \end{equation} From (\ref{eq:pwdecomp}) and (\ref{eq:pw}), we have \begin{equation} S({\bf x}, k) = \sum^M_{m=-M} \underbrace{ i^m \sum^{L}_{\ell=1} \gamma_\ell e^{-im \phi_\ell} }_{\beta_m(k)} J_m(kr) e^{im \phi} . \label{eq:coefreconst} \end{equation} Equation~(\ref{eq:coefreconst}) shows that the mode coefficient $\beta_m(k)$ can be reconstructed using the plane wave weight $\gamma_\ell$ to reproduce the incident noise field. In order to apply CS and estimate a sparse solution in (\ref{eq:pwdecomp}), we represent it in matrix form: \begin{equation} \bm{s} = \bm{E} \bm{\gamma} , \label{eq:matrix} \end{equation} where $\bm{s}$ is a $Q \times 1$ vector of the observed signals, $\bm{\gamma}$ is an $L \times 1$ vector of plane wave weights, and $\bm{E}$ is a $Q \times L$ matrix given by \begin{equation} \bm{E} = \begin{bmatrix} e^{ik \hat{ {\bf y}}_1 \cdot {\bf x}_1} & \cdots & e^{ik \hat{ {\bf y}}_L \cdot {\bf x}_1} \\ \vdots & \ddots & \vdots \\ e^{ik \hat{ { \bf y}}_1 \cdot {\bf x}_Q} & \cdots & e^{ik \hat{ {\bf y}}_L \cdot {\bf x}_Q} \end{bmatrix} . \label{eq:matE} \end{equation} We assume that the composition of plane waves is sparse with the underdetermined condition $(Q<L)$ in (\ref{eq:matrix}). \begin{figure}[t] \vspace*{-10pt} \centering \centerline{\includegraphics[width=8.5cm]{sdr.png}} \vspace{-1pt} \caption{SDR of reference sound field at several frequency bins. The vertical broken line indicates the spatial Nyquist frequency corresponding to the reference microphone array.} \label{fig:SDR} \vspace{-4pt} \end{figure} \subsection{$\ell_1$-norm constrained minimization} One of the most widely used technique to estimate a sparse solution is to minimize a cost function with an $\ell_1$ constraint on the plane wave weights: \begin{equation} \mathcal{J} = \| \bm{v} \|^2_2 + \lambda_1 \| \bm{\gamma} \|_1 , \label{eq:l1const} \end{equation} where $\bm{v} = \bm{s} - \bm{E} \bm{\gamma}$ and $\lambda_1$ controls the strength of the sparsity constraint. By utilizing the steepest descent algorithm, we can update the weights $\bm{\gamma}$ as \begin{equation} \bm{\gamma}(n+1) = \bm{\gamma}(n) - \frac{\mu_{\rm mic}}{2} \nabla \mathcal{J}(n) , \label{eq:l1update} \end{equation} where $n$ is the iteration index and $\mu_{\rm mic}$ is the step size. A gradient of the cost function $\mathcal{J}(n)$ can be calculated as~\cite{zhangg2016sparse,zhang2016multichannel} \begin{equation} \nabla \mathcal{J}(n) = 2 \bm{E}^H \bm{v}(n) + \lambda_1 \Bigl( {\rm sgn} \bigl\{ \mathfrak{R}\left[\bm{\gamma}(n)\right] \bigr\} + i {\rm sgn} \bigl\{ \mathfrak{I} \left[(\bm{\gamma}(n)\right] \bigr\} \Bigr) , \label{eq:l1deriv} \end{equation} where $(\cdot)^H$ denotes the Hermitian-transpose operation, ${\rm sgn(\cdot)}$ denotes the sign function, and $\mathfrak{R}(\cdot)$ and $\mathfrak{I}(\cdot)$ denote the real and imaginary parts of the argument. Finally, substituting (\ref{eq:l1deriv}) into (\ref{eq:l1update}), the plane-wave weights can be calculated as: \begin{multline} \bm{\gamma}(n+1) = \bm{\gamma}(n) - \mu_{\rm mic} \bm{E}^H \bm{v} (n) \\ - \frac{1}{2} \mu_{\rm mic} \lambda_1 \Bigl( {\rm sgn} \bigl\{ \mathfrak{R}\left[\bm{\gamma}(n)\right] \bigr\} + i {\rm sgn} \bigl\{ \mathfrak{I} \left[(\bm{\gamma}(n)\right] \bigr\} \Bigr) . \label{eq:l1update2} \end{multline} \subsection{Iteratively reweighted least squares (IRLS)} It is known that by introducing the $\ell_p$-norm and solving the following optimization problem, where $0<p<1$ can provide a sparse solution with much fewer measurements than $p=1$ ~\cite{chartrand2007exact,chartrand2008iteratively}: \begin{equation} \mathop{\rm min}\limits_{\bm{\gamma}} \| \bm{\gamma} \|_p^p, \mbox{ s.t. } \bm{s} = \bm{E} \bm{\gamma} . \label{eq:lpconst} \end{equation} Applying basis pursuit denoising (BPD)~\cite{carrillo2009iteratively}, (\ref{eq:lpconst}) can be written in an unconstrained form as: \begin{equation} \mathop{\rm min}\limits_{\bm{\gamma}} \frac{1}{p} \| \bm{\gamma} \|^p_p + \frac{\lambda_2}{2} \| \bm{v} \|^2_2 . \label{eq:lpunconst} \end{equation} Although the optimization problem (\ref{eq:lpunconst}) is a nonconvex function, we can adopt IRLS~\cite{chartrand2008iteratively,carrillo2009iteratively} to solve it iteratively. IRLS is known to converge relatively fast in terms of the number of iterations, however, the algorithm includes matrix inversion in every iteration, which may lead to high computational cost. There is a fast implementation of the IRLS algorithm~\cite{chen2014fast} to deal with this issue. \section{Mode-Domain Active Noise Control} \label{sec:ANC} \begin{figure}[t] \vspace*{-10pt} \centering \centerline{\includegraphics[width=1.0\hsize]{spectrogram_err.png}} \begin{minipage}{0.49\linewidth} \centering (a) \end{minipage} \begin{minipage}{0.49\linewidth} \centering \hspace{-11mm} (b) \end{minipage} \vspace{-1pt} \caption{Mode coefficients error between original and reconstructed noise field. The horizontal broken line indicates the spatial Nyquist frequency. (a)~MDFF. (b)~Proposed $(p=0.5)$.} \label{fig:spec_err} \vspace{-4pt} \end{figure} In this section, we describe a mode-domain adaptive filtering algorithm based on the filtered-x least mean square (FxLMS) algorithm~\cite{burgess1981active}. Consider two circular microphone arrays placed in a free field, as depicted in Fig.~\ref{fig:NCsys}. The outer circle is a reference microphone array capturing reference signals, and the inner circle is an error microphone array, measuring the residual signals. Between those two microphone arrays, a circular loudspeaker array is placed to drive the anti-noise signals. Adopting the mode-domain feedforward (MDFF) FxLMS algorithm, a residual mode coefficient at step $n$ can be written as: \begin{equation} e_m(n, k) = \beta_m(k) + w_m(n, k) x'_m(n, k) , \label{eq:FxLMS} \end{equation} where $w_m(n, k)$ is the $m$th-order mode weight of the adaptive filter, $x'_m(n, k) = g_m(k) x_m(n, k)$ is the $m$th-order filtered reference mode coefficient, $g_m(k)$ is the $m$th-order mode coefficient of the acoustic transfer function of the loudspeaker, and $x_m(n, k)$ is the $m$th-order reference mode coefficient. In the 2D free-field space, $g_m(k) = -\frac{i}{4} H_m^{(2)}(kR_s)$, where $H_m^{(2)}(\cdot)$ is the second-kind Hankel function of order $m$, and $R_s$ is the radius of the loudspeaker array. The reference mode coefficient can be calculated as \begin{equation} x_m(n, k) = i^m \sum^{L}_{\ell=1} \gamma_\ell(n, k) e^{-im \phi_\ell} , \label{eq:ref} \end{equation} using $\gamma_\ell(n, k)$ reconstructed from the reference signals by solving the optimization problem mentioned in the previous section. Finally, filtered-x normalized least mean square (FxNLMS) ~\cite{slock1993convergence} algorithm updates the mode weight as: \begin{equation} w_m(n+1, k) = w_m(n, k) - \mu_{\rm sp} \frac{e_m(n, k) \overline{x'_m(n, k)}}{\overline{x'_m(n, k)} x'_m(n, k)} , \label{eq:update} \end{equation} where $\overline{(\cdot)}$ denotes the complex conjugate operation and $\mu_{\rm sp}$ is the step size. \section{Experiment} \label{sec:exp} \begin{figure}[t] \vspace*{-10pt} \centering \centerline{\includegraphics[width=8.5cm]{noiselev_f.png}} \caption{Average noise level at several frequency bins after 50 iterations. The vertical broken lines indicate the spatial Nyquist frequencies corresponding to the reference (left) and the error (right) microphone array.} \label{fig:NoiseLevel} \vspace{-3pt} \end{figure} We evaluated and compared the accuracy of the reconstructed reference mode coefficients and noise attenuation level among following methods: (\rnum{1})~MDFF corresponds to the conventional method based on~(\ref{eq:mode_extract}) and~(\ref{eq:update}) as a baseline; (\rnum{2})~Proposed~(L1) corresponding to the $\ell_1$-norm constrained ANC method based on~(\ref{eq:l1update2}); (\rnum{3})~Proposed~$(p=1)$; and (\rnum{4})~Proposed~$(p=0.5)$, corresponding to the IRLS method based on~(\ref{eq:lpunconst}). Since reference microphones for ANC are typically placed outermost, the reference-mode coefficients are more likely to be affected by spatial aliasing artefacts. To overcome this problem, we applied the proposed method to the reference microphone array outputs. The radii of the error and reference microphone arrays are $1$~m and $2$~m, respectively. Each microphone array consists of $41$ omni-directional microphones. The loudspeaker array consists of $41$ monopole loudspeakers and the radius is $1.5$~m. The maximum order of the mode coefficients is $M=20$. For these experimental conditions, the spatial Nyquist frequency corresponding to the reference microphone array is $546$~Hz, and to the error microphone array is $1092$~Hz. We use $L=128$ plane waves to construct the over-complete matrix $\bm{E}$. \subsection{Reference mode coefficient accuracy} We calculated the signal-to-distortion ratio (SDR)~\cite{koyama2014sparse} inside the control region depicted as a colored region in Fig.~\ref{fig:NCsys} to measure the accuracy of the noise field reproduced from the reference signals, which is important to attenuate the noise field properly in feedforward ANC. Figure~\ref{fig:SDR} shows the frequency dependent SDR calculated using several methods. The circular expansion is based on (\ref{eq:mode_extract}). The SDRs using the proposed method were calculated after convergence. We can clearly see that above the spatial Nyquist frequency, the circular expansion method can no longer reproduce the noise field accurately, while the proposed methods can provide better accuracy at higher frequencies. Figure~\ref{fig:spec_err} depicts the mode coefficient error vs frequency and shows spatial aliasing artifacts. There are higher errors appearing from higher modes above the spatial Nyquist frequency in MDFF. Note that the higher errors in the evanescent region have only minimal impact on the ANC system, as previously mentioned. Our preliminary experiment shows that the convergence speed vary among each method. For example, Proposed~(L1) needs around 100 iterations to converge, whereas, Proposed~$(p=0.5)$ needs only around 10 iterations. \subsection{Noise attenuation level} We performed adaptive ANC by adopting several methods and evaluating the noise attenuation level. Figure~\ref{fig:NoiseLevel} shows the noise attenuation level at several frequencies after 50 iterations. The vertical broken lines indicate the spatial Nyquist frequencies correspond to the reference microphone array and the error microphone array, respectively. Below the Nyquist frequency of the reference microphone array, the MDFF and the proposed method gave almost the same results except Proposed~(L1), which gave even worse performance. We found that this was due to the strength of the constraint that was controlled by the parameter $\lambda_1$. The $\ell_1$ constraint was too strong to calculate accurate reference mode coefficients for lower frequencies below the spatial Nyquist frequency. We confirmed that the result improved once we manually tuned the parameter for each frequency, however, we use a fixed parameter in this paper since the issue is out of the scope and also we are not tuning any parameters for other methods. For higher frequencies, the attenuation level of MDFF degrades due to spatial aliasing, however, the proposed method can still attenuate the noise. Above the Nyquist frequency of the error microphone array, all methods were out of control and no attenuation could be achieved. \begin{figure}[t] \vspace*{-10pt} \centering \centerline{\includegraphics[width=1.1\hsize]{micnum.png}} \begin{minipage}{0.49\linewidth} \centering (a) \end{minipage} \begin{minipage}{0.49\linewidth} \centering (b) \end{minipage} \caption{Average noise level among various setups for the number of reference microphones. (a)~MDFF. (b)~Proposed $(p=0.5)$.} \label{fig:micnum} \vspace{-3pt} \end{figure} \subsection{Reduction of the number of reference microphones} When the noise field can be expressed by a sparse set of plane wave weights, we can reduce the number of reference microphones to calculate the reference mode coefficients. Figure~\ref{fig:micnum} shows the average noise level after 50 iterations of ANC. Recalling the Nyquist frequency of the reference microphone array, it is natural that the noise attenuation performance starts degrading above $546$~Hz for $Q=41$ and $1092$~Hz for $Q=81$ in MDFF. On the other hand, we can see that the proposed method performs well over frequencies even though we reduced the number of reference microphones. For both methods, the ANC system starts diverging above $1092$~Hz, which is the Nyquist frequency of the error microphone array. \section{Conclusion} \label{sec:conclusion} In this paper, we explored the mode-domain feedforward ANC system performance using sparse signal representation for the reference signals. We compared several CS methods and showed that the IRLS algorithm with $p=0.5$ performs well in terms of both convergence speed and noise attenuation level. We showed that the proposed method can attenuate the noise field beyond the spatial Nyquist frequency even with fewer reference microphones than required by spatial sampling theory. \bibliographystyle{IEEEbib}
{'timestamp': '2018-03-02T02:06:00', 'yymm': '1803', 'arxiv_id': '1803.00187', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00187'}
arxiv
\section{Introduction and Motivation}\label{sec:intro} Within the information-theoretic learning framework developed in \cite{principe2010information}, correntropy was proposed in \cite{santamaria2006generalized,liu2007correntropy} and serves as a similarity measure between two random variables. Given two scalar random variables U, V, the correntropy $\mathcal{V}_\sigma$ between $U$ and $V$ is defined as $\mathcal {V}_\sigma(U,V)=\mathbb{E} \mathcal{K}_\sigma(U,V)$ with $\mathcal{K}_\sigma$ a Gaussian kernel given by $\mathcal{K}_\sigma(u,v)=\exp\left\{-(u-v)^2/\sigma^2\right\}$, the scale parameter $\sigma>0$, and $(u,v)$ a realization of $(U,V)$. It is noticed in \cite{liu2007correntropy} that the correntropy $\mathcal {V}_\sigma(U,V)$ can induce a new metric between $U$ and $V$. It is argued in \cite{liu2007correntropy,principe2010information} that this new metric could be a better option in measuring the distance between $U$ and $V$ than the Euclidean metric when the random variable defined by the residual $U-V$ admits a non-Gaussian distribution which is frequently encountered in applications. During the past several years, the merits of correntropy have been verifying by numerous real-world applications across various fields, e.g., signal processing \cite{liu2007correntropy,chen2012maximum,chen2016generalized,chen2017maximum,zou2018robust}, image processing \cite{he2011robust,he2011maximum,he20122,hasanbelliu2014information,wang2014robust,wang2015robust,zhu2017correntropy,wang2017correntropy}, time series forecasting \cite{bessa2009entropy,bessa2010information,mendes2011development}, and other machine learning tasks such as regression, classification, and clustering \cite{wang2013non,singh2014c,xu2016robust}. Noticing that most of the above mentioned problems can be interpreted from a regression viewpoint, recently some understanding towards correntropy based regression in statistical learning has been conducted in \cite{fenglearning} and \cite{feng2017statistical}, to which the present study is closely related. We, therefore, first revisit the conclusions on correntropy based regression drawn in \cite{fenglearning} and \cite{feng2017statistical}. \subsection{Formulating Correntropy based Regression} We start with the following frequently assumed data-generating model in nonparametric regression \begin{align}\label{data_generating} Y=f^\star(X)+\varepsilon, \end{align} where $X$ is the independent variable that takes values in a compact metric space $\mathcal{X}\subset\mathbb{R}^d$, $Y$ the dependent variable that takes value in $\mathcal{Y}=\mathbb{R}$, and $\varepsilon$ the noise variable. We assume that $\mathbb{E}(\varepsilon|X)=0$ if it exists, otherwise, we assume that ${\sf{median}}(\varepsilon|X)=0$. In regression problems, it is typical that we can only access a set of i.i.d observations $\mathbf{z}=\{(x_i,y_i)\}_{i=1}^n$ generated by \eqref{data_generating}. Our purpose in regression is to infer the unknown truth $f^\star$ while only referring to these observations. The idea of correntropy based regression is to select the hypothesis from a hypothesis space that maximizes the empirical correntropy estimator between $\{y_i\}_{i=1}^n$ and $\{f(x_i)\}_{i=1}^n$ for any $f:\mathcal{X}\rightarrow\mathbb{R}$, which we term as the Maximum Correntropy Criterion based Regression (MCCR) \cite{fenglearning}. With the correntropy induced regression loss $\ell_\sigma: \mathbb{R}\times\mathbb{R}\rightarrow [0,+\infty)$ defined as $$\ell_\sigma(t)=\sigma^2\left(1-e^{-\frac{t^2}{\sigma^2}}\right),\,\,t\in\mathbb{R},$$ with $\sigma>0$ the scale parameter, MCCR can be formulated into the following empirical risk minimization scheme \begin{align}\label{LearningAlgorithmwithCIL} f_\mathbf{z}:=\arg\min_{f\in\mathcal{H}}\frac{1}{n}\sum_{i=1}^n \ell_\sigma(y_i-f(x_i)), \end{align} where $\mathcal{H}$ is a hypothesis space that is assumed to be a compact subset of $C(\mathcal{X})$. \subsection{MCCR in Statistical Learning} As mentioned above, in the literature, correntropy and its applications in various fields have been investigated. However, in the statistical learning context, theoretical understanding of correntropy based regression estimators is still limited. Unlike commonly employed error metric in regression problems, the error metric induced by correntropy is non-convex and involves a scale parameter $\sigma$, which complicate the analysis. Recently, \cite{fenglearning} investigated correntropy based regression when the scale parameter $\sigma:=\sigma(n)$ goes large in correspondence to the sample size $n$, which was inspired by the studies in \cite{hu2013learning,fan2014consistency} on empirical minimum error entropy minimization algorithms. When the scale parameter $\sigma(n)$ tends to zero, \cite{feng2017statistical} made some efforts in order to understand correntropy in regression problems and assess the performance of the correntropy based regression estimators from a statistical learning viewpoint. The main concerns in \cite{fenglearning} and \cite{feng2017statistical} are the learning performance of $f_\mathbf{z}$ when the sample size $n$ goes to infinity, where different scenarios of the noise variable $\varepsilon$ and the choices of the $\sigma$ values were considered. Briefly, the following conclusions were drawn in the above-mentioned two studies: \begin{itemize} \item By relating the scale parameter $\sigma$ to the sample size $n$ (i.e., $\sigma:=\sigma(n)$) and assuming that the noise variable $\varepsilon$ is zero-mean, with a diverging and properly chosen $\sigma$ value, $f_\mathbf{z}$ can approximate the conditional mean function $f^\star$ robustly. Convergence rates were established in the absence of light-tailed assumptions, which justifies the robustness of $f_\mathbf{z}$. Moreover, the scale parameter $\sigma$, in this case, plays a trade-off role between robustness and the approximation ability of the estimator $f_\mathbf{z}$. \item By relating the scale parameter $\sigma$ to the sample size $n$ and assuming a unique zero global mode of the noise $\varepsilon$, with a tending-to-zero and properly chosen $\sigma$ value, $f_\mathbf{z}$ approaches the conditional mode function $f^\star$. Note that the unique zero global mode assumption on $\varepsilon$ allows asymmetric or heavy-tailed noise, which again explains the robustness of the MCCR estimator $f_\mathbf{z}$ in this case. \item With a properly chosen scale parameter $\sigma$, the correntropy based regression estimator $f_\mathbf{z}$ is shown to be equivalent to least squares regression estimator in the presence of symmetric and bounded noise. In this case, the equivalence is claimed in the following two senses: first, similar as that of the least squares regression estimator under the same noise condition, the population version of $f_\mathbf{z}$ is exactly the conditional mean function $f^\star$. Second, the convergence rates of $f_\mathbf{z}$ to the conditional mean function are comparable to that of least squares regression estimators. \end{itemize} Some merits of MCCR can be observed from the above statements. For example, MCCR can learn $f^\star$ well in the absence of light-tailed noise assumptions where least squares regression estimators are not capable. On the other hand, it also perform comparable with least squares regression estimators in the presence of bounded and symmetric noise where the latter one achieves its optimal performance. We refer to Section $6$ in \cite{feng2017statistical} for a general picture of existing understanding on correntropy based regression in statistical learning. \subsection{Motivation and Contribution} The prominent advantages of MCCR estimator lie in its resistance ability to heavy-tailed noise and outliers. As stated above, the conducted theoretical assessments on MCCR estimators in \cite{fenglearning} and \cite{feng2017statistical} justify its superior performance in dealing with heavy-tailed noise. However, several fundamental problems related to MCCR estimators in statistical learning still remain unclear. For instance: \medskip \noindent\textbf{Problem I: Learning performance of MCCR in the presence of Gaussian noise}. When Gaussian noise is present, least squares regression estimators are known to achieve their optimal performance and optimal learning rates of type $\mathcal{O}(n^{-1})$ have been established in the statistical learning literature, see e.g., \cite{wang2011optimal} and \cite{guo2013concentration}. Under the same noise assumption, asymptotic learning rates of type $\mathcal{O}(n^{-2/3})$ can be deduced by following the work in \cite{fenglearning}, which are not comparable with that of least squares regression estimators. Notice that the correntropy induced loss $\ell_\sigma$ is Lipschitz continuous and bounded on $\mathbb{R}$, and the fact that $\ell_\sigma$ approximates the least squares loss when $\sigma$ is large enough. It is natural to conjecture that optimal learning rates of MCCR estimators may be also achievable as least squares regression estimators in the presence of Gaussian noise. \medskip \noindent\textbf{Problem II: Learning performance of MCCR with heavy-tailed noise}. In the presence of heavy-tailed noise with finite variance, from \cite{fenglearning} we know that asymptotic learning rates of type $\mathcal{O}(n^{-2/3})$ for MCCR can be established under moment assumptions. If the heavy-tailed noise has infinite variance or even infinite first-order moment condition (such as Cauchy noise), asymptotic learning rates of type $\mathcal{O}(n^{-2/5})$ were established in \cite{feng2017statistical} under mild assumptions. However, both of the above two types of learning rates are far from the type $\mathcal{O}(n^{-1})$, which are regarded as optimal in statistical learning. \medskip \noindent\textbf{Problem III: Understanding MCCR in the presence of outliers}. When outliers are presented, how MCCR estimators learn the unknown truth function $f^\star$ still remains unclear, although empirically their superior performance in dealing with outliers has been observed. As mentioned above, this is, in fact, one of the most prominent advantages of MCCR estimators over other regression estimators. The main barrier to understanding MCCR in the presence of outliers lies in the modeling of outliers in analysis. This is because for the time being there exists no general definition of outlier and more frequently, outliers are defined in association with concrete distributions, see e.g., \cite{hawkins1980identification,rousseeuw2005robust,aggarwal2015outlier}. The present study aims to address the above three concerns on correntropy based regression, especially the concern of understanding MCCR in the presence of outliers. We start with the following motivating observation: a very frequently employed technique of generating outliers in robust statistics \cite{tukey1960survey,huber1964robust,jurevckova2005robust,huber2009robust,hampel2011robust}, machine learning \cite{scholkopf2001learning,han2011data}, as well as many engineering applications \cite{kassam1985robust,kozick2000maximum} is as follows \begin{align}\label{noise_mixture} \varepsilon\thicksim \lambda_1\mathcal{N}(\mu_1,\sigma_1^2)+\lambda_2\mathcal{N}(\mu_2,\sigma_2^2), \end{align} where $\lambda_1+\lambda_2=1$, $\lambda_1\gg\lambda_2$, $\sigma_1^2\ll \sigma_2^2$, and $\mathcal{N}(\mu_1,\sigma_1^2)$, $\mathcal{N}(\mu_2,\sigma_2^2)$ are two Gaussian distributions with mean $\mu_1$, $\mu_2$ and variance $\sigma_1^2$, $\sigma_2^2$, respectively. In \eqref{noise_mixture}, $\mathcal{N}(\mu_1,\sigma_1^2)$ is usually considered as background noise while $\mathcal{N}(\mu_2,\sigma_2^2)$ is regarded as the contaminating noise that generates outliers since $\sigma_2^2$ is far larger than $\sigma_1^2$. In some cases, other distributions that have heavier tails than Gaussian (such as Cauchy noise) may be also employed in \eqref{noise_mixture} as contaminating noise. On the other hand, we notice that both Gaussian noise and Cauchy noise belong to the type of symmetric stable noise. These observations remind us to impose the mixture of symmetric stable noise assumption on $\varepsilon$ and study the performance of MCCR in this case. In fact, as we shall see later, mixture of symmetric stable distributions have been frequently employed in many engineering applications to model impulsive noise. Another nice property of mixture of symmetric stable noise lies in that it can approximate the distribution of any noise arbitrarily well. With the introduction of mixture of symmetric stable distributions in modeling heavy-tailed noise or outliers, in this paper, we make a step forward in understanding correntropy based regression in statistical learning. More detailed speaking, concerning the study of correntropy based regression estimators, in this work, we make the following contributions: \begin{itemize} \item We introduce the mixture of symmetric stable distributions to model the noise $\varepsilon$. The family of mixture of symmetric stable noise includes the Gaussian noise, the mixture Gaussian noise, the Cauchy noise, and many other kinds of mixture noise, and so is capable of modeling heavy-tailed noise and outliers. We notice that within the statistical learning framework, we make some first attempts in modeling outliers via mixture of symmetric stable distributions. \item Under the mixture of symmetric stable noise assumption, we demonstrate that MCCR estimators can learn the unknown truth function $f^\star$ in an unbiased way in that the population version of $f_\mathbf{z}$ is exactly $f^\star$. Recall that $f^\star$ is the conditional mean function or the conditional median function, and the mixture of symmetric stable noise consists of a large family of noise from light-tailed to heavy-tailed. This indicates that MCCR could be employed to learn $f^\star$ after seeing enough observations without resorting to the sub-Gaussianity of the noise. \item We establish asymptotic learning rates of type $\mathcal{O}(n^{-1})$ which are comparable with those of least squares regression estimators under the sub-Gaussianity noise assumption. As stated above, the mixture of symmetric stable noise include Gaussian noise and Cauchy noise as two special cases, and can be used to model outliers. Therefore, the present study provides direct answers to the three problems stated above. In fact, establishing almost sure convergence rates of type $\mathcal{O}(n^{-1})$ in learning theory without appealing to finite variance assumption of the noise may be of independent interest. \end{itemize} The rest of this paper is organized as follows. In Section \ref{sec::mixture_stable_noise}, we provide the definitions of symmetric stable distributions and mixture of symmetric stable distributions and introduce some of their applications. Section \ref{sec::MCCR_with_SaS} is concerned with the assessments of correntropy based regression in the presence of mixture of symmetric stable noise. The performance of MCCR, in this case, will be studied in this section, and results on learning rates of MCCR estimators will be presented here. We will also give some comments on the obtained learning rates and the MCCR estimator in this section. The paper is concluded in Section \ref{sec::conclusion}. \section{Mixture of Symmetric Stable Distributions and Its Applications}\label{sec::mixture_stable_noise} In this section, we introduce the mixture of symmetric stable distributions and its applications. To this end, we shall first introduce the symmetric stable distribution. \begin{definition}[Symmetric Stable Distribution \cite{samorodnitsky1994stable}]\label{definition-symmetric_stable} A univariate distribution function is symmetric stable if its characteristic function takes the following form \begin{align*} \phi(t)=\exp\big\{\mathrm{i}\mu t-\gamma|t|^\alpha\big\},\quad \hbox{for any}\quad t\in\mathbb{R}, \end{align*} where $-\infty<\mu<\infty$, $\gamma>0$, $0<\alpha\leq 2$, and $\mathrm{i}$ is the imaginary unit. \end{definition} More precisely, the symmetric stable distribution defined in Definition \ref{definition-symmetric_stable} is said to be $\alpha$-stable and symmetric about the location $\mu$. As shown in Definition \ref{definition-symmetric_stable}, a symmetric stable distribution has three parameters, namely, the location parameter $\mu$, the scale parameter $\gamma$, and the characteristic exponent $\alpha$. The characteristic exponent $\alpha$ is a shape parameter and measures the thickness of the tails of the density function. Two typical examples of symmetric stable distributions are Gaussian distribution ($\alpha=2$) and Cauchy distribution ($\alpha=1$). A symmetric stable distribution with $0<\alpha<2$ only admits absolute moments of order less than $\alpha$. Therefore, all symmetric stable distributions do not have finite variance except for the Gaussian distribution. For more properties of symmetric stable distributions, we refer to \cite{fama1968some,miller1978properties,samorodnitsky1994stable}. When a distribution consists of different components with each of which a symmetric stable distribution and can be expressed as a convex combination of these components, it is called a mixture of symmetric stable distributions \cite{mclachlan1988mixture}. \begin{definition}[Mixture of Symmetric Stable Distributions]\label{mixture_definition-symmetric_stable} A univariate distribution $P$ with density $p$ is a mixture of symmetric stable distributions if it is a convex combination of symmetric stable distributions $\{P_i\}_{i=1}^K$ with density function $\{p_i\}_{i=1}^K$ and $K$ a positive integer, i.e., there exists $\lambda_1,\cdots,\lambda_K$ with $\lambda_i> 0$ for $i=1,\ldots,K$, and $\sum_{i=1}^K\lambda_i=1$, such that \begin{align*} P(t)=\sum_{i=1}^K \lambda_i P_i(t), \quad \hbox{and} \quad p(t)=\sum_{i=1}^K \lambda_i p_i(t), \quad\hbox{for any}\quad t\in\mathbb{R}. \end{align*} \end{definition} In Definition \ref{mixture_definition-symmetric_stable}, $\lambda_1,\ldots,\lambda_K$ are called the mixing weights and $p_1,\ldots,p_K$ are component densities. It is obvious that when $K=1$, a mixture of symmetric stable distributions is reduced to a symmetric stable distribution. In particular, if $p_1,\ldots,p_K$ are normal densities, then $p$ is a mixture of Gaussian. A nice property of the mixture of Gaussian density is that it can approximate any density function to arbitrary accuracy with suitable choice of parameters and enough components $K$ \cite{titterington1985statistical,mclachlan1988mixture}. Symmetric stable distributions have been drawing continuous attention in the statistics literature \cite{fama1968some,fama1971parameter,dumouchel1973stable,miller1978properties,chen2004behavior}. The mixture of symmetric stable distributions, which includes the mixture of Gaussian and symmetric stable distributions as special cases, has been extensively applied into many applications. As mentioned above, in robust statistics, it has been employed to mimic perturbed or heavy-tailed distributions, see e.g., \cite{huber2009robust}. In many engineering applications, especially applications in the field of signal processing, image processing, and wireless communications, it has been frequently applied to model impulsive noise \cite{ shao1993signal,ambike1994detection,nikias1995signal,ilow1998analytic,kuruoglu1998near,eldar2001finite,kosko2001robust,brcich2005stability,lombardi2006line, souryal2008soft,rajan2010diversity,park2011maximin} or outliers \cite{barnett1994outliers,aggarwal2015outlier}. \section{MCCR with Mixture of Symmetric Stable Noise}\label{sec::MCCR_with_SaS} The noise is mixture of symmetric stable noise if its distribution is a mixture of symmetric stable distributions. As stated in the above section, it can be employed to model non-Gaussian noise and outliers. In this section, we study MCCR from a statistical learning viewpoint in the presence of mixture of symmetric stable noise $\varepsilon$. We start with the introduction of several notations and assumptions. \subsection{Notations and Assumptions} We denote the unknown probability distribution over $\mathcal{X}\times\mathcal{Y}$ as $\rho$ and $\rho_{X}$ as the marginal distribution of $\rho$ over $\mathcal{X}$. For any $f\in\mathcal{H}$, the empirical error in \eqref{LearningAlgorithmwithCIL} is denoted as $\mathcal{E}_\mathbf{z}^\sigma(f)$, that is, \begin{align*} \mathcal{E}_\mathbf{z}^\sigma(f)=\frac{1}{n}\sum_{i=1}^n \ell_\sigma(y_i-f(x_i)), \end{align*} and its population version $\mathcal{E}^\sigma(f)$ is defined as \begin{align*} \mathcal{E}^\sigma(f)=\int_{\mathcal{X}\times\mathcal{Y}}\ell_\sigma(y-f(x))\mathrm{d}\rho. \end{align*} The distance between $f$ and $f^\star$ in $L_{\rho_X}^2$ is denoted as $\|f-f^\star\|_\rho^2$. Besides, for any two quantities $a,b$, we denote $a\lesssim b$ if there exists a positive constant $c$ such that $a\leq cb$. \begin{assumption}[Mixture of Symmetric Stable Noise]\label{noise_assumption} The distribution of the noise $\varepsilon$ is a mixture of symmetric stable distributions with location parameter $0$, i.e., the density $p_\mathsmaller{\varepsilon,x}$ of the noise variable $\varepsilon$ for any $x\in\mathcal{X}$ takes the following form \begin{align*} p_\mathsmaller{\varepsilon,x}(t)=\sum_{i=1}^K\lambda_i p_\mathsmaller{\varepsilon,x,i}(t),\quad\hbox{for any}\quad t\in\mathbb{R}, \end{align*} where $K$ is a positive integer, $\lambda_i>0$ for $i=1,\ldots,K$, $\sum_{i=1}^K\lambda_i=1$, and $p_\mathsmaller{\varepsilon,x,i}$ is the density function of the symmetric stable distribution $P_\mathsmaller{\varepsilon,x,i}$ that is centered around $0$ for $i=1,\ldots,K$. \end{assumption} The second assumption is on the complexity of $\mathcal{H}$ in terms of the $\ell^2$-empirical covering number $\mathcal{N}_2(\mathcal{H},\eta)$, see e.g., \cite{wu2007multi,shi2011concentration} for the definition. \begin{assumption}[Complexity Assumption]\label{complexity_assumption} There exist positive constants $s$ and $c$ such that $$\log\mathcal{N}_2(\mathcal{H},\eta)\leq c \eta^{-s},\,\, \forall\,\, \eta>0.$$ \end{assumption} Throughout this paper, we also assume that there exists a positive constant $M$ such that $\sup_{f\in\mathcal{H}}\|f\|_\infty\leq M$, and $\|f^\star\|_\infty\leq M$. \subsection{Unbiasedness of MCCR with Mixture of Symmetric Stable Noise} In the presence of mixture of symmetric stable noise, in this part, we will show that MCCR can learn $f^\star$ in an unbiased way. This is stated in the sense of the following theorem, which is established by applying techniques proposed in \cite{fan2014consistency}. \begin{theorem}\label{equivalent_theorem} Suppose that Assumption \ref{noise_assumption} holds and $f^\star\in\mathcal{H}$. Then we have \begin{align*} f^\star=\arg\min_{f\in\mathcal{H}}\mathcal{E}^\sigma(f), \end{align*} and for any $f\in\mathcal{H}$, it holds that \begin{align*} c_\mathsmaller{\sigma,\gamma,\alpha} \|f-f^\star\|_\rho^2 \leq \mathcal{E}^\sigma(f)-\mathcal{E}^\sigma(f^\star)\leq \|f-f^\star\|_\rho^2, \end{align*} where $c_\mathsmaller{\sigma,\gamma,\alpha}$ is a positive constant that will be given explicitly in the proof. \end{theorem} \begin{proof} From the definitions of the notions, we know that \begin{align*} \mathcal{E}^\sigma(f)-\mathcal{E}^\sigma(f^\star)= \sigma^2\int_{\mathcal{X}}[F_x(f(x)-f^\star(x))-F_x(0)]\mathrm{d}\rho_X(x), \end{align*} where $F_x:\mathbb{R}\rightarrow \mathbb{R}$ is denoted as \begin{align*} F_x(u):=1-\int_{-\infty}^{+\infty}\exp\left\{-\frac{(t-u)^2}{\sigma^2} \right\}p_\mathsmaller{\varepsilon,x}(t){\mathrm{d}}t,\,\,x\in\mathcal{X}. \end{align*} From the Taylor's theorem, we know that \begin{align*} F_x(f(x)-f^\star(x))-F_x(0)= F_x^\prime(0)(f(x)-f^\star(x))+\frac{F_x^{\prime\prime}(\zeta_x)}{2}(f(x)-f^\star(x))^2, \end{align*} where for any $x\in\mathcal{X}$, $0<\zeta_x<f(x)-f^\star(x)$. Due to the symmetry assumption of the noise, for any $x\in\mathcal{X}$, we have \begin{align*} F_x^\prime(0)=-2\int_{-\infty}^{+\infty}\exp\left(-\frac{t^2}{\sigma^2} \right)\left(\frac{t}{\sigma^2}\right)p_\mathsmaller{\varepsilon,x}(t){\mathrm{d}}t=0, \end{align*} and \begin{align*} F_x^{\prime\prime}(\zeta_x)=2\int_{-\infty}^{+\infty}\exp\left\{-\frac{(t-\zeta_x)^2}{\sigma^2} \right\}\left(\frac{\sigma^2-2(t-\zeta_x)^2}{\sigma^4}\right)p_\mathsmaller{\varepsilon,x}(t){\mathrm{d}}t,\,\,x\in\mathcal{X}. \end{align*} It is obvious that for any $x\in\mathcal{X}$, the following inequality \begin{align*} F_x^{\prime\prime}(u)\leq \frac{2}{\sigma^2} \end{align*} holds uniformly for $0<u<f(x)-f^\star(x)$. Therefore, we have \begin{align}\label{upper_bound} \begin{split} \mathcal{E}^\sigma(f)-\mathcal{E}^\sigma(f^\star)&= \sigma^2\int_{\mathcal{X}}[F_x(f(x)-f^\star(x))-F_x(0)]\mathrm{d}\rho_X(x)\\ &=\frac{\sigma^2}{2}\int_\mathcal{X}F_x^{\prime\prime}(\zeta_x)(f(x)-f^\star(x))^2\mathrm{d}\rho_X(x)\\ &\leq \int_{\mathcal{X}}(f(x)-f^\star(x))^2\mathrm{d}\rho_X(x). \end{split} \end{align} On the other hand, with simple computations, we have \begin{align*} \mathcal{E}^\sigma(f)-\mathcal{E}^\sigma(f^\star)&=\sigma^2\int_{\mathcal{X}}\int_{-\infty}^{+\infty} \left[\exp\left(-\frac{t^2}{\sigma^2}\right)-\exp\left(-\frac{(t-[f(x)-f^\star(x)])^2}{\sigma^2}\right)\right]p_\mathsmaller{\varepsilon,x}(t){\mathrm{d}}t\mathrm{d}\rho_X(x)\\ &=\sigma^2\int_{\mathcal{X}}\int_{-\infty}^{+\infty} \left[\exp\left(-\frac{t^2}{\sigma^2}\right)-\exp\left(-\frac{(t-[f(x)-f^\star(x)])^2}{\sigma^2}\right)\right]p_\mathsmaller{\varepsilon,x}(t){\mathrm{d}}t\mathrm{d}\rho_X(x)\\ &=\sigma^2\int_{\mathcal{X}}\int_{-\infty}^{+\infty} \left[\exp\left(-\frac{t^2}{\sigma^2}\right)-\exp\left(-\frac{(t-u_x)^2}{\sigma^2}\right)\right]p_\mathsmaller{\varepsilon,x}(t){\mathrm{d}}t\mathrm{d}\rho_X(x)\\ &=\sigma^2\int_{\mathcal{X}}\int_{-\infty}^{+\infty} \left[\exp\left(-\frac{(t+u_x)^2}{\sigma^2}\right)-\exp\left(-\frac{t^2}{\sigma^2}\right)\right]p_\mathsmaller{\varepsilon,x}(t){\mathrm{d}}t\mathrm{d}\rho_X(x), \end{align*} where for any $x\in\mathcal{X}$, $u_x=f(x)-f^\star(x)$. From Assumption \ref{noise_assumption} on the noise and recalling the linearity property of the Fourier transform, we have \begin{align*} \widehat{p_\mathsmaller{{\epsilon,x}}}(\xi)=\sum_{i=1}^K \lambda_i \widehat{p_\mathsmaller{{\epsilon,x,i}}}(\xi), \end{align*} where $\widehat{p_\mathsmaller{{\epsilon,x}}}$ is the Fourier transform of $p_\mathsmaller{{\epsilon,x}}$, and $\widehat{p_\mathsmaller{{\epsilon,x,i}}}$ is the Fourier transform of $p_\mathsmaller{{\epsilon,x,i}}$, $i=1,\ldots,K$. Moreover, for $i=1,\ldots,K$, since $P_\mathsmaller{{\epsilon,x,i}}$ is a symmetric stable distribution with the location parameter $0$, we know that there exist $\gamma_i>0$ and $0<\alpha_i\leq 2$ such that \begin{align*} \widehat{p_\mathsmaller{{\epsilon,x,i}}}(\xi)=e^{-\gamma_i|\xi|^{\alpha_i}}. \end{align*} Applying the Planchel formula, we obtain \begin{align*} \mathcal{E}^\sigma(f)-\mathcal{E}^\sigma(f^\star)&=\frac{\sigma^3}{2\sqrt{\pi}}\int_\mathcal{X}\int_{-\infty}^{+\infty}\exp\left(-\frac{\sigma^2\xi^2}{4}\right)\widehat{p_\mathsmaller{{\epsilon,x}}}(\xi)\left[1-\bold{e}^{\mathrm{i} \xi u_x }\right]\mathrm{d}\xi \mathrm{d}\rho_X(x)\\ &=\frac{\sigma^3}{\sqrt{\pi}}\sum_{i=1}^K\lambda_i\int_\mathcal{X}\int_{-\infty}^{+\infty}\exp\left(-\frac{\sigma^2\xi^2}{4}\right)\widehat{p_\mathsmaller{{\epsilon,x,i}}}(\xi)\sin^2\left(\frac{\xi(f(x)-f^\star(x))}{2}\right)\mathrm{d}\xi \mathrm{d}\rho_X(x)\\ &= \frac{\sigma^3}{\sqrt{\pi}}\int_\mathcal{X}\sum_{i=1}^K\lambda_i\int_{-\infty}^{+\infty}\exp\left(-\frac{\sigma^2\xi^2}{4}-\gamma_i|\xi|^{\alpha_i}\right)\sin^2\left(\frac{\xi(f(x)-f^\star(x))}{2}\right)\mathrm{d}\xi \mathrm{d}\rho_X(x), \end{align*} where the second equality is due to the fact that $\mathcal{E}^\sigma(f)-\mathcal{E}^\sigma(f^\star)$ is real for any $f\in\mathcal{H}$. For any $x\in\mathcal{X}$, $|u_x|=|f(x)-f^\star(x)|\leq 2M$. When $|\xi|\leq \frac{\pi}{2M}$, from Jordan's inequality, it holds that \begin{align*} \sin^2\left(\frac{\xi(f(x)-f^\star(x))}{2}\right)\geq \frac{2\xi^2(f(x)-f^\star(x))^2}{\pi^2}. \end{align*} As a result, we come to the following conclusion \begin{align}\label{lower_bound} \begin{split} \mathcal{E}^\sigma(f)-\mathcal{E}^\sigma(f^\star)&\geq \frac{2\sigma^3}{\pi^{5/2}}\int_{\mathcal{X}}\sum_{i=1}^K\lambda_i\int_{-\frac{\pi}{2M}}^{\frac{\pi}{2M}}\xi^2\exp\left(-\frac{\sigma^2\xi^2}{4}-\gamma_i|\xi|^{\alpha_i}\right)(f(x)-f^\star(x))^2\mathrm{d}\xi \mathrm{d}\rho_X(x)\\ &=c_\mathsmaller{\sigma,\gamma,\alpha}\int_{\mathcal{X}}(f(x)-f^\star(x))^2\mathrm{d}\rho_X(x), \end{split} \end{align} where \begin{align}\label{constant_c_1} c_\mathsmaller{\sigma,\gamma,\alpha}=\frac{2\sigma^3}{\pi^{5/2}} \sum_{i=1}^K\lambda_i\int_{-\frac{\pi}{2M}}^{\frac{\pi}{2M}}\xi^2\exp\left(-\frac{\sigma^2\xi^2}{4}-\gamma_i|\xi|^{\alpha_i}\right)\mathrm{d}\xi. \end{align} The positiveness of $c_\mathsmaller{\sigma,\gamma,\alpha}$ implies that for any $f\in\mathcal{H}$, we have $\mathcal{E}^\sigma(f)\geq \mathcal{E}^\sigma(f^\star)$. That is, \begin{align*} f^\star=\arg\min_{f\in\mathcal{H}}\mathcal{E}^\sigma(f). \end{align*} To prove the second assertion, we combine inequalities \eqref{upper_bound} and \eqref{lower_bound}, and obtain \begin{align*} c_\mathsmaller{\sigma,\gamma,\alpha} \|f-f^\star\|_\rho^2 \leq \mathcal{E}^\sigma(f)-\mathcal{E}^\sigma(f^\star)\leq \|f-f^\star\|_\rho^2, \end{align*} where $c_\mathsmaller{\sigma,\gamma,\alpha}$ is a positive constant given in \eqref{constant_c_1}. This completes the proof of Theorem \ref{equivalent_theorem}. \end{proof} Theorem \ref{equivalent_theorem} states that in the presence of mixture of symmetric stable noise, the population version of the MCCR estimator $f_\mathbf{z}$ is exactly the underlying unknown truth function $f^\star$ as long as $f^\star$ belongs to $\mathcal{H}$. Therefore, in this sense, $f_\mathbf{z}$ can be regarded as an unbiased estimator of $f^\star$. Another implication of Theorem \ref{equivalent_theorem} is that under the mixture of symmetric stable noise assumption, the excess risk of MCCR can be upper and lower bounded by the $L^2_{\rho_X}$-distance between the MCCR estimator $f_\mathbf{z}$ and the unknown truth $f^\star$. As we shall see later, this leads to fast convergence rates of the MCCR estimator $f_\mathbf{z}$ to $f^\star$. \subsection{Performance of MCCR with Mixture of Symmetric Stable Noise} We are now in a position to evaluate the learning performance of MCCR in the presence of mixture of symmetric stable noise by establishing convergence rates of $\|f_\mathbf{z}-f^\star\|_\rho^2$. \begin{theorem}\label{performance_MCCR} Suppose that Assumption \ref{noise_assumption} and Complexity Assumption with $s>0$ hold. Let $f_\mathbf{z}$ be produced by \eqref{LearningAlgorithmwithCIL} and $f^\star\in\mathcal{H}$. For any $0<\delta<1$, with confidence $1-\delta$, it holds that \begin{align*} \|f_\mathbf{z}-f^\star\|_\rho^2\lesssim \log(1/\delta)n^{-\frac{2}{2+s}}. \end{align*} \end{theorem} When functions in $\mathcal{H}$ are sufficiently smooth, the index $s$ could be arbitrarily small. Therefore, it is immediate to see that the convergence rates established in Theorem \ref{performance_MCCR} are asymptotically of type $\mathcal{O}(n^{-1})$. Recall that in Theorem \ref{performance_MCCR}, the noise $\varepsilon$ is only assumed to be a mixture of symmetric stable noise which include the mixture Gaussian and the Cauchy noise, and can be applied to model outliers. It is interesting to see that in this case the MCCR estimator $f_\mathbf{z}$ can learn the conditional mean function or the conditional median function $f^\star$ well. This, in fact, explains the merits of MCCR in dealing with heavy-tailed noise or outliers. Moreover, as far as we are aware, within the statistical learning framework, we present some first results on the optimal convergence rates of regression estimator without imposing finite-variance or even finite first-order moment conditions on the noise. To prove Theorem \ref{performance_MCCR}, we need the following lemma established in \cite{wu2007multi}. \begin{lemma}\label{empiricalconcen} Let $\mathcal{F}$ be a class of measurable functions on $\mathcal{Z}$. Assume that there are constants $B,c>0$ and $\theta\in[0,1]$ such that $\|f\|_{\infty}\leq B$ and $\mathbb{E}f^2\leq c(\mathbb{E}f)^{\theta}$ for every $f\in \mathcal{F}$. If for some $a>0$ and $s\in (0,2)$, \begin{equation*} \log\mathcal{N}_2\left(\mathcal{F},\eta\right)\leq a\eta^{-s}, \qquad \forall\,\eta >0, \end{equation*} then there exists a constant $\alpha_p$ depending only on $p$ such that for any $t>0$, with probability at least $1-e^{-t}$, there holds \begin{equation*} \mathbb{E}f-\frac{1}{m}\sum_{i=1}^mf(z_i)\leq \frac{1}{2}\gamma^{1-\theta}\left(\mathbb{E}f\right)^{\theta}+\alpha_p\gamma +2\left(\frac{ct}{m}\right)^{\frac{1}{2-\theta}}+\frac{18Bt}{m}, \qquad \forall\, f\in \mathcal{F}, \end{equation*} where $$\gamma:=\max\left\{c^{\frac{2-s}{4-2\theta+s\theta}}\left(\frac{a}{m}\right) ^{\frac{2}{4-2\theta+s\theta}},B^{\frac{2-s}{2+s}}\left(\frac{a}{m}\right) ^{\frac{2}{2+s}}\right\}.$$ \end{lemma} \begin{proof}[Proof of Theorem \ref{performance_MCCR}] To prove Theorem \ref{performance_MCCR}, we apply Lemma \ref{empiricalconcen} to the function set $\mathcal{F}_\mathcal{H}$ defined below \begin{align*} \mathcal{F}_\mathcal{H}=\left\{g \,\,\Big |\,\, g(z)=-\sigma^2\exp\left\{-(y-f(x))^2/\sigma^2\right\}+ \sigma^2\exp\left\{-(y-f^\star(x))^2/\sigma^2\right\}, f\in\mathcal{H},z\in\mathcal{Z}\right\}. \end{align*} We first verify conditions in Lemma \ref{empiricalconcen}. From the definition of $\mathcal{F}_\mathcal{H}$, for any $g\in\mathcal{F}_\mathcal{H}$, we have \begin{align*} \|g\|_\infty\leq \sigma^2+\sigma^2=2\sigma^2, \end{align*} and the following Bernstein condition holds \begin{align}\label{Bernstein_condition} \begin{split} \mathbb{E}g^2&=\int_\mathcal{Z}\left(-\sigma^2\exp\left\{-\frac{(y-f(x))^2}{\sigma^2}\right\}+ \sigma^2\exp\left\{-\frac{(y-f^\star(x))^2}{\sigma^2}\right\}\right)^2\mathrm{d}\rho\\ & \lesssim \sigma^2\int_\mathcal{Z} \left((y-f(x))-(y-f^\star(x))\right)^2\mathrm{d}\rho\\ &=\sigma^2\int_\mathcal{X}(f(x)-f^\star(x))^2\mathrm{d}\rho \lesssim \mathbb{E}g, \end{split} \end{align} where the first inequality is a consequence of the mean value theorem and the boundedness of $\|h^\prime\|$ with $h(t)=-\sigma^2\exp(-t^2/\sigma^2)$, $t\in\mathbb{R}$, and the second inequality is due to Theorem \ref{equivalent_theorem}. On the other hand, for any $g_1$, $g_2\in \mathcal{F}_\mathcal{H}$, there exist $f_1,\,f_2\in\mathcal{H}$ such that \begin{align*} g_1(z)=-\sigma^2\exp\left\{-(y-f_1(x))^2/\sigma^2\right\}+ \sigma^2\exp\left\{-(y-f^\star(x))^2/\sigma^2\right\}, \end{align*} and \begin{align*} g_2(z)=-\sigma^2\exp\left\{-(y-f_2(x))^2/\sigma^2\right\}+ \sigma^2\exp\left\{-(y-f^\star(x))^2/\sigma^2\right\}. \end{align*} By applying the mean value theorem and noticing again the boundedness of $\|h^{\prime}\|_\infty$, we have \begin{align*} \|g_1-g_2\|_\infty\leq \sigma^2\|f_1-f_2\|_\infty. \end{align*} Under the Complexity Assumption with $0<s<2$, the following relation between the $\ell^2$-empirical covering numbers of $\mathcal{F}_\mathcal{H}$ and $\mathcal{H}$ holds \begin{align*} \log\mathcal{N}_2(\mathcal{F}_\mathcal{H},\eta)\leq \log\mathcal{N}_2\Big(\mathcal{H},\eta/\sigma^2\Big)\lesssim \eta^{-s}. \end{align*} Applying Lemma \ref{empiricalconcen} to the function set $\mathcal{F}_\mathcal{H}$, with simple computations, we come to the conclusion that for any $0<\delta<1$ with confidence $1-\delta$, there holds \begin{align*} \left[\mathcal{E}^\sigma(f)-\mathcal{E}^\sigma(f^\star)\right]- \left[\mathcal{E}^\sigma_\mathbf{z}(f)-\mathcal{E}^\sigma_\mathbf{z}(f^\star)\right]-\frac{1}{2}\left[\mathcal{E}^\sigma(f)-\mathcal{E}^\sigma(f^\star)\right]\lesssim \log(1/\delta)n^{-\frac{2}{2+s}}. \end{align*} Noticing that $\mathcal{E}_\mathbf{z}^\sigma(f_\mathbf{z})\leq \mathcal{E}_\mathbf{z}^\sigma(f^\star)$, we have \begin{align*} \frac{1}{2}\left[\mathcal{E}^\sigma(f_\mathbf{z})-\mathcal{E}^\sigma(f^\star)\right]\leq \left[\mathcal{E}^\sigma(f_\mathbf{z})-\mathcal{E}^\sigma(f^\star)\right]- \left[\mathcal{E}^\sigma_\mathbf{z}(f_\mathbf{z})-\mathcal{E}^\sigma_\mathbf{z}(f^\star)\right]-\frac{1}{2}\left[\mathcal{E}^\sigma(f_\mathbf{z})-\mathcal{E}^\sigma(f^\star)\right]. \end{align*} Therefore, for any $0<\delta<1$ with confidence $1-\delta$, it holds that \begin{align*} \|f_\mathbf{z}-f^\star\|_\rho^2\lesssim \log(1/\delta)n^{-\frac{2}{2+s}}. \end{align*} This completes the proof of Theorem \ref{performance_MCCR}. \end{proof} \begin{remark} From the proof of Theorem \ref{performance_MCCR}, we see that the boundedness of the loss function $\ell_\sigma$ and the Bernstein condition \eqref{Bernstein_condition} play a crucial role in establishing fast convergence rates of $f_\mathbf{z}$. The Bernstein condition holds because of the Lipschitz continuity of the loss function $\ell_\sigma$ on $\mathbb{R}$ and the fact that the $L_{\rho_X}^2$-distance between $f_\mathbf{z}$ and $f^\star$ can be upper bounded by the excess risk $\mathcal{E}^\sigma(f_\mathbf{z})-\mathcal{E}^\sigma(f^\star)$, i.e., conclusions in Theorem \ref{equivalent_theorem}. \end{remark} \subsection{Comments on MCCR with Mixture of Symmetric Stable Noise} We now give two remarks on the performance of the MCCR estimator $f_\mathbf{z}$ in the presence of mixture of symmetric stable noise by comparing with that of the least squares estimator. The first remark is on the convergence rates of the two regression estimators. As shown in Theorem \ref{performance_MCCR}, in the presence of mixture of symmetric stable noise and when $f^\star\in\mathcal{H}$, $f_\mathbf{z}$ can learn the unknown truth function $f^\star$ well. The established learning rates are of type $\mathcal{O}(n^{-\frac{2}{2+s}})$ which are optimal in the sense that they are asymptotically of type $\mathcal{O}(n^{-1})$. Moreover, they are comparable with that of least squares estimators \cite{wu2006learning,cucker2007learning}. Our second remark is on the conditions required to established convergence rates for the two regression schemes. Recalling that for least squares regression, to establish learning theory type convergence rates, the response variable (and consequently the noise, under the data-generating model \eqref{data_generating}) is frequently assumed to be uniformly bounded \cite{cucker2007learning,steinwart2008support}, which is usually not the case in practice. In fact, even in the presence of Gaussian noise, to establish learning theory type convergence rates for least squares regression, it is much involved due to the unboundedness of the response variable, in which case many conventional learning theory arguments and tools are not applicable. Recently, some efforts have been made to relax this assumption \cite{wang2011optimal,guo2013concentration,mendelson2015learning}. As far as we are aware, convergence rates for least squares regression estimators cannot be established without resorting to the finite-variance condition. When moving our attention to correntropy based regression, as shown above, in the presence of mixture of symmetric stable noise, optimal learning rates of MCCR estimator are established. Notice that symmetric stable noise with the characteristic exponent parameter $0<\alpha<2$ has infinite variance or even first-order moment. Moreover, as stated above, it can approximate any density function arbitrarily well with properly chosen $K$ and consequently can be applied to model outliers. In this sense, our study presented here explains the capability of MCCR estimators in dealing with outliers. \section{Conclusion}\label{sec::conclusion} In this paper, we studied the correntropy based regression within the statistical learning framework by introducing the mixture of symmetric stable noise which subsume Gaussian noise, Cauchy noise, and mixture of Gaussian noise. In this study, it was introduced to model heavy-tailed noise and outliers, to which the correntropy based regression estimators have been empirically verified to be resistant. In our study, we showed that the empirical risk minimization scheme based on the correntropy induced loss can learn the underlying truth function sufficiently well while allowing the noise to be the mixture of symmetric stable noise. In particular, learning theory analysis was conducted and the learning performance of MCCR with mixture of symmetric stable noise was evaluated. It is interesting to see that, in this case, asymptotically optimal learning rates of type $\mathcal{O}(n^{-1})$ can be developed, which are comparable with that of least squares regression under bounded noise assumption. These theoretical findings successfully explain the efficiency and effectiveness of correntropy based regression estimators in the presence of heavy-tailed noise or outliers. \bibliographystyle{plain}
{'timestamp': '2018-06-26T02:12:39', 'yymm': '1803', 'arxiv_id': '1803.00183', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00183'}
arxiv
\section*{List of important symbols} \section{Introduction} \label{s:intro} This work is concerned with general contact models for adhesion mechanisms that are characterized by coupled adhesion and friction. Such mechanisms appear in both natural and technical applications; they also include the adhesive microstructures of many insects and lizards, which may resemble either soft adhesive pads (e.g.~for flies and beetles) or rather stiff fibrils (e.g.~for the gecko). In particular the gecko mechanism has several other remarkable properties like fast detachment, self-cleaning, and non-clumping \cite{autumn06c}. To replicate the characteristics of bio-adhesives, various synthetic materials were developed \cite{geim03, gorb07, parness09, bartlett12}. Like their natural counterparts, bio-inspired adhesives are often reusable and removable without leaving any residue. This makes them relevant for different medical applications; other possible applications include climbing robots, micro-electro-mechanical systems, and pick-and-place methods. Initiated by the study of Autumn et al.~\cite{autumn02}, it is generally believed that bio-adhesion is mainly caused by van der Waals forces. Nevertheless, also other effects may have an influence, such as capillary~\cite{huber05b} or electrostatic forces~\cite{izadi14}. Within this paper, we mainly focus on dry adhesion due to van der Waals interactions. As experiments reveal, the function of bio- and bio-inspired adhesives further depends on friction (or ``shear'') forces \cite{autumn06, zhao08}. Thus, the applications discussed so far do not only involve dry adhesion but also dry friction. Combined, adhesion and friction play an important role in various other systems; these include small frictional hairs at the legs of insects \cite{labonte14}, the peeling of adhesive tapes \cite{amouroux01}, or elastomer spheres sliding on glass plates \cite{savkoor77, waters10, cohen11, sahli18}. Regarding bio-adhesive systems in general, experiments show that friction forces can occur even if the normal force is negative, i.e., tensile \cite{autumn06, drechsler06, zhao08}. A similar observation can be made in experiments with chemically modified graphite surfaces \cite{deng12}. Note that these findings usually refer to the \emph{total} force in the system, while locally the contact stresses may vary between tension and compression within the same macroscopic contact area. This was demonstrated by Eason et al.~\cite{eason15}, who used a tactile sensor to investigate the distribution of the normal stress underneath an attached gecko toe. If an adhesive system has a large stiffness (or low compliance, respectively), its contact surface tends to be characterized by regions of tensile and regions of compressive contact forces. Then, the fraction of compressive and tensile areas is large compared to a more compliant system, which may justify the application of continuum models that capture friction only at the locally compressed parts of the contact area. However, for compliant, tape-like structures or soft adhesive pads (e.g.~of insects, see \cite{drechsler06}), the assumption of a high stiffness is not realistic. Existing continuum models for combined adhesion and friction include sliding friction only if the local contact stress is positive, i.e., compressive. Although they work well for systems with sufficiently strong (local) compression, they fail to capture sliding resistance for the cases described above. We thus propose two general contact models for the analysis of physical problems that are characterized by coupled adhesion and friction. The first contact model is based on a constant sliding threshold within the contact area, which means the sliding shear is independent of the local distance of the contacting surfaces. This model turns out to be favorable for low normal loads, when friction is purely adhesion-controlled. The second model can be considered as a local version of Amontons' law extended to adhesion. Both models are capable of capturing the frictional behavior for zero or negative (tensile) contact pressures. This approach is motivated by soft and compliant bio-adhesive pads, which are able to generate friction forces under tensile normal loads. We additionally present new experimental results for friction between a smooth elastomer sphere and a smooth glass plate. As shown, the findings from these experiments agree well with the results for the proposed models. Our contact models are formulated in the framework of large deformations, and apply to arbitrary geometries. For many applications this requires applying computational methods for analysis. An implementation of the proposed models in the framework of nonlinear finite element methods is addressed separately \cite{mergelPhD, mergel18comput}. To summarize, this work provides the following new aspects: \vspace*{-2ex} \begin{itemize}\setlength{\itemsep}{0pt} \item A survey of existing models for dry adhesion and friction, which were proposed and applied in different fields of research; \item Experimental results for the onset of sliding of a glass plate on an elastomer sphere in the presence of low normal loads; \item Two new continuum models for coupled adhesion and friction of both biologic and bio-inspired adhesive systems; and \item A comparison of these models with the experiments. \end{itemize} The remainder of this paper is structured as follows. In \cref{s:adhfrict} we discuss various mechanisms that may contribute to dry adhesion and friction, and review existing literature. We then present new experimental results in \cref{s:exp}. In \cref{s:model} we propose two models for adhesion and friction, and discuss their general behavior. \Cref{s:example} then provides a comparison of these models with the experiments, for which we consider the finite element formulation of \cite{mergelPhD, mergel18comput}. \Cref{s:concl} finally concludes this paper. \section{Origin and modeling of adhesive friction} \label{s:adhfrict} This section gives an overview of relevant experimental findings, theoretical models, and computational approaches that have been proposed in the past. In the following we will also refer to the terms \emph{sticking} for static friction, and \emph{sliding} for kinetic (or dynamic) friction, respectively. \subsection{Adhesive and non-adhesive friction} \label{s:originfrict} Like adhesion, dry friction may stem from (combinations of) different mechanisms at smaller length scales. This depends on the involved materials, surface properties, and the considered length scale. Mechanisms that contribute to friction are classified in \cite{nosonovsky07} as follows: 1)~adhesion; 2)~deformation of asperities; 3)~plastic deformation at the interface; 4)~fracture; 5)~interlocking; and 6)~wear or contamination particles between the surfaces. Another possible mechanism is viscous dissipation in the material, e.g.~for rubber or various tissues. Although sliding friction may be caused by a mixture of these mechanisms, in engineering applications it is often described by the well-known formula \begin{equation} F_\mrt = \mu \, F_\mrn, \qquad F_\mrn > 0, \label{e:Coulomb:force} \end{equation} where $\mu$ is the coefficient of sliding friction, which relates the normal and tangential forces, $F_\mrn$ and $F_\mrt$, to each other. \Cref{e:Coulomb:force} results from the following three laws, which were named after Guillaume Amontons and Charles de Coulomb: \begin{enumerate}\setlength{\itemsep}{0pt} \item[1)] The friction force is proportional to the applied normal load. \quad (Amontons' $1\mathrm{st}$ law)\footnote{Note that in engineering mechanics, this is often referred to ``Coulomb's law'' or ``Coulomb friction'' instead.} \item[2)] The friction force is independent of the apparent contact area. \quad (Amontons' $2\mathrm{nd}$ law) \item[3)] The friction force is independent of the sliding velocity.\footnote{According to Nosonovsky and Bhushan \cite{nosonovsky07}, Coulomb stated this relation for intermediate velocities.} \quad (Coulomb's law) \end{enumerate} We will refer to relation~\labelcref{e:Coulomb:force} also as \emph{Coulomb-Amontons friction}. The three laws stated above can be interpreted by introducing both an apparent (nominal) and a real (true) contact area,~${A_\mathrm{real}}$, and assuming that compressive contact occurs only between small microasperities. Such an approach goes back to \cite{derjaguin34, bowden39, archard57}, and explains the apparent contradiction in several experiments showing the friction force to be proportional to the contact area \cite{schallamach52, enachescu99}. In many applications, \cref{e:Coulomb:force} describes frictional sliding of the system appropriately. Nevertheless, for considerably smooth surfaces or soft materials (such as polymers), \cref{e:Coulomb:force} may not be valid anymore~\cite{persson08}. This was also shown for smooth elastomer contacts e.g.~in~\cite{cohen11, sahli18}. In a study of adhesion and friction of crystal layers, Derjaguin~\cite{derjaguin34} used statistical analysis to derive a generalization of Amontons' first law, \begin{equation} F_\mrt = \mu \, (F_0 + F_\mrn) = \mu \, {A_\mathrm{real}} \, (p_0 + p_\mrn). \label{e:extAmontons:orig} \end{equation} Here, $p_\mrn := F_\mrn / {A_\mathrm{real}}$ is an averaged normal pressure, and $p_0 := F_0 / {A_\mathrm{real}}$ is an adhesion parameter. After introducing a material-specific, critical shear stress~$\tau_0 := \mu \, p_0$, \cref{e:extAmontons:orig} becomes \begin{equation} F_\mrt = \tau_0 \, {A_\mathrm{real}} + \mu \, F_\mrn = \tau \, {A_\mathrm{real}}, \qquad \tau := \tau_0 + \mu \, p_\mrn. \label{e:extAmontons} \end{equation} This will be referred to as \emph{extended Amontons' law}. According to Ruths et al.~\cite{ruths05}, \cref{e:extAmontons:orig} describes the friction force between dry surfaces that slide smoothly over each other in the presence of adhesion. For low normal loads, the first term in \cref{e:extAmontons} predominates, which is called \emph{adhesion-controlled} friction. For large normal loads, the second term (equivalent to \cref{e:Coulomb:force}) predominates, which is denoted \emph{pressure-controlled} friction.\footnote{In \cite{ruths05} the expression ``load-controlled'' is used.} The influence of both terms strongly depends on the specific application, and in particular on the smoothness, compliance, and adhesion of the contacting surfaces. This is demonstrated by the experimental results~\cite{homola90} shown in \cref{f:homola}. For two molecularly smooth (and initially undamaged) mica cylinders sliding over each other, the friction force is directly proportional to the contact area; $F_\mrt = \tau_0 \, {A_\mathrm{real}}$. This means that with increasing normal load, the friction force follows the triangles in the figure. At a sufficiently high normal load, damage occurs and forms wear particles at the interface. Afterwards, the normal load is decreased again. From that moment on, the friction force is proportional to the normal load according to \cref{e:Coulomb:force}, and not to the contact area anymore; see the filled circles in \cref{f:homola}. As a comparison of \cref{f:homola:1} and \cref{f:homola:2} reveals, it depends on the specific parameters whether either adhesion- or pressure-controlled friction provide larger friction forces. The transition between both is further discussed in~\cite{berman98, gao04b, jagota11}. \begin{figure}[h] \centering \subfigure[Uncoated surfaces.]{ \begin{minipage}{0.46\textwidth} \vspace*{14ex} Removed for license reasons from arXiv preprint. See Fig.~4(a) in Ref.~\cite{homola90}. \vspace*{16ex} \end{minipage} \label{f:homola:1} }\hspace*{0.03\textwidth} \subfigure[Surfaces coated with calcium stearate.]{ \begin{minipage}{0.46\textwidth} \vspace*{14ex} Removed for license reasons from arXiv preprint. See Fig.~4(b) in Ref.~\cite{homola90}. \vspace*{16ex} \end{minipage} \label{f:homola:2} } \caption{Friction force and contact area measured for two mica cylinders sliding over each other in dry air. Dashed arrows indicate the transition between adhesion- and pressure-dependent friction.} \label{f:homola} \end{figure} \Cref{e:extAmontons} has been considered in various research fields, sometimes with a different terminology. It had already been discussed in a similar form before Derjaguin~\cite{derjaguin34}, also by Coulomb himself~\cite{gao04b}. What he proposed was a fracture criterion for granular and brittle materials, known as the Mohr- or Navier-Coulomb criterion, respectively \cite{deblasio11, popova15}. Besides, Tabor~\cite{tabor81} used \cref{e:extAmontons} to derive a pressure-dependent friction model with an effective coefficient of sliding friction, $\hat{\mu} := F_\mrt / F_\mrn = \tau_0/p_\mrn + \mu$. Extended Amontons' law was further discussed in~\cite{briscoe78, thornton91, yoshizawa93}. It also appeared in the context of microtribology \cite{briscoe79, berman98b, ruths05}, molecular dynamics simulations \cite{gao04b, sivebaek08, mo09}, and adhesive friction of bio- and bio-inspired systems \cite{zeng09, hill11}. \subsection{Existing modeling approaches}\label{s:adhfrict:others} In the following, we give an overview of the most relevant models for dry adhesion and friction, with a special focus on continuum methods that are suitable for computational formulations. For a discussion of friction and tribology from a physical point of view, we refer to monographs~\cite{persson00, bhushan13}. In addition, different aspects of nanotribology are addressed in book~\cite{bhushan05}. A recent review on modeling and simulation in tribology is given by Vakis et al.~\cite{vakis18}. For an overview of computational models for adhesion, see also \cite{sauer16jadh}. In order to model adhesion (and repulsion) due to van der Waals interactions, various continuum models have been developed based on the Lennard-Jones (LJ) potential \begin{equation} \phi(r) = \varepsilon \, {\Big(\frac{r_0}{r}\Big)}^{12} - 2\,\varepsilon \, {\Big(\frac{r_0}{r}\Big)}^6. \label{e:LJ} \end{equation} Here, $\phi$ is the potential between two molecules separated by the distance~$r$; it depends on the parameters~$\varepsilon$ and $r_0$, which denote the depth of the potential well and the molecular equilibrium distance, respectively. In order to increase the efficiency of computational models based on \cref{e:LJ}, the interactions between two (in general arbitrarily shaped) bodies are often approximated by effective volumetric forces \big(with unit $\mrN/\mrm^3$\big) or effective surface tractions \big(with unit $\mrN/\mrm^2$\big). Such an approach is pursued in various computational formulations \cite{sauer07ijnme, du07, sauer09cmame, zhang11, fan15a, jayadeep16}. In general, models based on the Lennard-Jones potential do not contain any contribution due to friction. For this reason, Deng et al.~\cite{deng12} additionally consider a constant tangential contact stress during sliding wherever the normal contact stress is compressive. This corresponds to the first term in \cref{e:extAmontons}, and thus shows similarities to one of our proposed models (\cref{s:model:CA}). Apart from that, Jiang and Park~\cite{jiang15} propose to extend the original Lennard-Jones potential by an additional ``friction potential'' in order to describe the friction properties of layered materials such as graphene. However, this approach is restricted to static friction. Van der Waals forces can also be modeled by fitting traction-separation laws within a cohesive zone model; see e.g.~\cite{yao06a, peng10, sauer13cmbbe, sauer14finel}. Although these papers use models that do not include tangential sliding, there also exist numerous cohesive zone models that additionally include sliding friction. In early works \cite{tvergaard90, lissenden95}, sliding friction according to Coulomb and Amontons was modeled subsequently after full tangential debonding. More recent cohesive zone models account for sliding friction also during partial separation \cite{chaboche97b, raous02, delpiero10, snozzi13}. Besides, there exist several cohesive zone models including friction, which are based on representative interface or volume elements \cite{alfano06, sacco10, sacco12, guiamatsia14}. In all of the cohesion models discussed so far, the damage caused by debonding is considered to be irreversible. This, however, is not realistic for van der Waals interactions. Schryve~\cite{schryvePhD} and Cocou et al.~\cite{cocou10} thus modified model~\cite{raous99} to capture partial recovering (``healing'') of the adhesive strength when the gap between the interfaces is closed again. Schryve applied this approach to investigate adhesion and friction between elastomer and glass. Macroscopic adhesion and friction can also be modeled by statistical homogenization of the microscopic contact behavior \cite{wriggers06}. Tworzydlo et al.~\cite{tworzydlo98}, for instance, combined finite element simulations of small surface asperities with statistical analysis, mainly focusing on metallic surfaces. In that study adhesion was modeled with an integrated Lennard-Jones potential. Besides, there exists a recursive multiscale approach~\cite{wriggers09} to investigate contact of rubber and rough, rigid surfaces (like tire-road contact). This model captures van der Waals interactions by means of a fitted cohesive zone model, and restores adhesion fully when contact is re-established. For completeness we also outline the most relevant models for non-adhesive friction. In a general continuum framework, sliding law~\labelcref{e:Coulomb:force} is usually stated in terms of the normal and tangential contact tractions, $t_\mathrm{n}$ and $\boldsymbol{t}_\mathrm{t}$, \begin{equation} \|\boldsymbol{t}_\mathrm{t}\| = \mu \, t_\mathrm{n}, \qquad t_\mathrm{n} > 0. \label{e:Coulomb:tract} \end{equation} In many engineering applications it is sufficient to consider the coefficient of sliding friction, $\mu$,~as a constant parameter for the material pair at the interface; see e.g.~\cite{ciavarella98, tromborg11, amundsen15, yastrebov16}. Depending on the application, however, $\mu$ may be affected by the sliding velocity \cite{grosch63, wubavouzet10}, contact pressure \cite{scheibert08}, temperature \cite{grosch63}, or microscopic time scales \cite{tromborg14}. For an overview of approaches suitable for different kinds of materials see~\cite{wriggers06}. Note that both the friction and the cohesive zone models discussed above include sliding friction only under local compression. This means that after tangential debonding, frictionless sliding occurs if the normal contact stresses are tensile. Next, we outline the most relevant small-deformation models for adhesion and friction. Regarding the frictionless adhesion of spheres, these include the well-known Johnson-Kendall-Roberts (JKR) \cite{johnson71} and Derjaguin-Muller-Toporov (DMT) \cite{derjaguin75} models, which apply to compliant and stiff materials, respectively. Both models were later combined in~\cite{maugis92}. Although these models are restricted to small deformations and special contact geometries, they have been successfully applied to fit experimental data. In the experimental results shown in \cref{f:homola}, for instance, the contact area agrees well with that predicted by the JKR theory. For adhesion-controlled friction, it is then possible to determine the frictional shear stress~$\tau_0$ (a material-pair parameter) from sphere-plane contact as follows: 1)~Predict the real contact area, ${A_\mathrm{real}}$, with the JKR theory by inserting Young's modulus, the sphere radius, the applied normal load, and the interfacial adhesion energy; 2)~measure the friction force, $F_\mrt$; and 3)~combine both values using $F_\mrt = \tau_0 \, {A_\mathrm{real}}$; see also \cref{s:exp}. In Savkoor and Briggs~\cite{savkoor77}, the JKR theory was extended further to incorporate the influence of tangential shearing. According to that model, for a fixed normal force, the contact area decreases with increasing tangential force. This agrees with the experimental findings presented therein. Related studies and important extensions include~\cite{johnson96, johnson97, waters10}. As mentioned in \cref{s:originfrict}, friction may be explained by small asperities sliding over each other. Asperity-based friction models \cite{braun08, thogersen14} generally differ in the surface shape and the number of involved length scales; examples include periodic and wavy substrate, fractal surfaces, or stochastic profiles. Note that such approaches are also used in many of the papers outlined in \cref{s:originfrict}, in particular to verify a linear relation between the real contact area and the normal force (see also \cite{majumdar91, persson01, barber13}). Asperity-based models are not only used to investigate friction, but also adhesion. Multiasperity contact was combined both with the JKR \cite{fuller75} and DMT theory \cite{chang88, maugis96}. Further extensions include~\cite{greenwood81, rabinovich00}. Like asperity-based friction models, models for rough surface adhesion can be based e.g.~on a single layer of wavy asperities or on single- and multiscale fractal surfaces, respectively \cite{pastewka14, mueser17}. For an overview see also~\cite{persson05}. Finally, there exists the analytical tape model~\cite{kendall75} by Kendall, which was also extended numerous times to investigate directional peeling of thin strips or tapes. Some of these models also incorporate sliding friction. As experiments show, approaches of this type are suitable to accurately capture the peeling force of structures with small bending stiffness such as elastomer films \cite{collino14}, adhesive tape \cite{dalbe16}, and adhesive beetle pads \cite{labonte16}. These models are thus often applied to discuss the properties of bio-adhesive systems. For adhesive fibrils with finite bending stiffness, however, such models may underestimate the actual peel-off force considerably~\cite{sauer11ja, mergel14jadh}. \section{Experimental results for sliding of a smooth elastomer sphere} \label{s:exp} We now present new experimental results for the onset of sliding of a smooth glass plate on a smooth polydimethylsiloxane (PDMS) sphere under low normal loads. Our experimental setup, inspired by Prevost et al.~\cite{prevost13} and fully described in Sahli et al.~\cite{sahli18}, is illustrated in \cref{f:exp:setup}. As shown, the glass plate is attached to a double cantilever, which can deflect in the vertical direction (vertical stiffness $410 \pm 20\,\mrN/\mrm$). The other end of the cantilever is mounted on a vertical translation stage (not shown in the figure), which allows the glass plate to be brought into and out of contact with the elastomer sphere. First contact is found by very slowly moving the double cantilever down and stopping as soon as the sphere snaps into adhesive contact with the glass. Going further down allows to obtain interfaces with increasing initial contact areas, ${A_\mathrm{real}}$. By analyzing the reflection images of the contact interface (see the method described in \cite{sahli18}), it is possible to monitor the evolution of~${A_\mathrm{real}}$ over time. The vertical displacement is then kept constant during the experiments. \begin{figure}[h] \unitlength\textwidth \begin{picture}(1,0.35) \put(0,0){\includegraphics[width=0.65\textwidth]{ExpSetup}} \put(0.50,0.24){\small \begin{tabular}{r@{\quad}c@{\ \ }l} sphere: & $\bullet$ & material: PDMS Sylgard 184 \\[0.3ex] & $\bullet$ & Young's modulus: $E = 1.6 \pm 0.1\,\mrM\mrP\mra$ \\[0.3ex] & $\bullet$ & Poisson's ratio: $0.5$ \\[0.3ex] & $\bullet$ & radius of curvature: $9.42\,\mrm\mrm$ \\[0.3ex] & $\bullet$ & diameter of cap: $12\,\mrm\mrm$ \\[0.3ex] & $\bullet$ & work of adhesion (PDMS / glass): \\[0.3ex] && $\Delta\gamma = 27 \pm 1\,\mrm\mrJ/\mrm^2$ \end{tabular}} \end{picture} \caption{Monitoring of the incipient sliding of a glass plate on an elastomer sphere: Sketch of the experimental setup.} \label{f:exp:setup} \end{figure} Interestingly, once first contact has been formed, it is possible to move the double cantilever back up some distance without losing contact. This allows us to obtain interfaces in a global tensile state. Although our setup does not allow for measuring the resulting normal load directly, it is possible to estimate it from the initial contact area using the JKR theory~\cite{johnson71}. This had been confirmed in an initial calibration on a dedicated device considering the same materials and contact geometry: Fitting the data by means of the JKR formula provided the values for Young's modulus of our PDMS as well as the adhesion energy of our glass/PDMS interface (see \cref{f:exp:setup}). \begin{figure}[h] \centering \subfigure[Normal load vs.~measured initial contact area.]{ \includegraphics[width=0.47\textwidth] {NormalForce_ContactArea_Exp_JKR} \label{f:exp:FnJKR:Ac} }\hspace*{1ex} \subfigure[Normal load vs.~contact radius $r_\mathrm{real}^0 = \sqrt{A_\mathrm{real}^0/\pi}$.]{ \includegraphics[width=0.47\textwidth] {NormalForce_ContactRadius_Exp_JKR} \label{f:exp:FnJKR:rc} } \caption{Initial contact of a glass plate on an elastomer sphere: Initial normal load~$F_\mrn^0$ estimated from the measured initial contact area using the JKR theory and the material parameters in \cref{f:exp:setup}; each colored bar corresponds to a different experiment.} \label{f:exp:FnJKR} \end{figure} \Cref{f:exp:FnJKR:Ac} shows the range of the initial normal forces~$F_\mrn^0$ in dependence of the initial contact areas~$A_\mathrm{real}^0$ measured in our experiments. \Cref{f:exp:FnJKR:rc} shows an alternative representation based on the corresponding contact radii. The horizontal bars in \cref{f:exp:FnJKR} indicate the possible range of values caused by uncertainties in the material parameters~$E$ and~$\Delta \gamma$ (\cref{f:exp:setup}). As these results imply, for some of the experiments the initial normal load is either close to zero or tensile. The vertical translation stage at the end of the double cantilever is mounted on a motorized horizontal translation stage, enabling motion of the glass plate at a constant velocity $v = 0.1 \,\mrm\mrm/\mrs$. We measure the time evolution of the tangential load, $F_\mrt$, by means of a load sensor (resolution ca.~$1\,\mrm\mrN$) as well as the time evolution of~${A_\mathrm{real}}$. A typical evolution of the contact area is shown in the snapshots of \cref{f:exp:snapshots}. As one can see, with increasing tangential loading, the area shrinks due to its left and right edges moving towards each other (with respect to the frame of the camera and the base of the sphere), while the left contact edge starts moving first. \begin{figure}[h] \unitlength\textwidth \centering \begin{picture}(0.995,0.155) \put(0,0){\includegraphics[width=0.125\textwidth]{001021circ}} \put(0.145,0){\includegraphics[width=0.125\textwidth]{001066circ}} \put(0.29,0){\includegraphics[width=0.125\textwidth]{001087circ}} \put(0.435,0){\includegraphics[width=0.125\textwidth]{001094circ}} \put(0.58,0){\includegraphics[width=0.125\textwidth]{001109circ}} \put(0.725,0){\includegraphics[width=0.125\textwidth]{001146circ}} \put(0.87,0){\includegraphics[width=0.125\textwidth]{001196circ}} \put(0.035,0.14){\small $0.00\,\mrs$} \put(0.180,0.14){\small $0.45\,\mrs$} \put(0.325,0.14){\small $0.62\,\mrs$} \put(0.470,0.14){\small $0.73\,\mrs$} \put(0.615,0.14){\small $0.88\,\mrs$} \put(0.760,0.14){\small $1.25\,\mrs$} \put(0.905,0.14){\small $1.75\,\mrs$} \end{picture} \caption{Incipient sliding of a glass plate on an elastomer sphere: Snapshots of the contact area for an initial area of $0.27 \, \mrm\mrm^2$, which is the upper yellow curve in \cref{f:exp:AcTime}; the sphere is fixed with respect to the frame of the camera, while the glass plate moves to the right; the driving velocity is $v = 0.1\,\mrm\mrm/\mrs$; the bar shown in the first figure corresponds to a length of $0.25\,\mrm\mrm$.} \label{f:exp:snapshots} \end{figure} \Cref{f:exp:FtTime} shows the tangential force, $F_\mrt$, as a function of time for different initial contact areas. Here, the origin of time, $t_\mathrm{start}$, is taken when the motor starts moving. For each curve, the typical behavior is the following: $F_\mrt$ increases, first almost linearly and then with a weakening slope, reaches its maximum (the static friction peak), and rapidly drops afterwards before entering a slow decay during macroscopic sliding. This slow decay, arising from a small residual angle between the glass plate and the horizontal, was negligible in~\cite{sahli18}. Here, it is detectable because of the (about 20 times) smaller initial areas and the (about 8 times) stiffer cantilever. The time evolution of the contact area ${A_\mathrm{real}}$ is plotted in \cref{f:exp:AcTime}. As shown also in~\cite{savkoor77, waters10, sahli18}, ${A_\mathrm{real}}$~decreases as the interface is progressively sheared. The rate of area decrease (i.e., the slope of the curve) significantly drops when the contact enters macroscopic sliding. The subsequent slow decrease of the area is the counterpart of the slow decrease of the friction force. Consistently with Waters and Guduru~\cite{waters10}, contacts with the smallest initial areas (below about $0.1\,\mrm\mrm^2$) abruptly vanish upon shearing, without entering a macroscopic sliding regime. In contrast, the contacts with the highest initial areas (above about $0.19\,\mrm\mrm^2$) do not vanish during the time window shown in \cref{f:exp:FtTime,f:exp:AcTime}. For each experiment, this time window covers the time that is necessary to reach the static friction peak (squares in \cref{f:exp:FtTime}), and to slide further by a distance that is equal to half times the width of the contact area at the static friction peak. \begin{figure}[ht] \centering \subfigure[Tangential force over time.]{ \includegraphics[width=0.47\textwidth]{FtTime4} \label{f:exp:FtTime} }\hspace*{1ex} \subfigure[Contact area over time.]{ \includegraphics[width=0.47\textwidth]{AcTime4} \label{f:exp:AcTime} } % \subfigure[Contact area as a function of the tangential force.]{ \includegraphics[width=0.47\textwidth]{AcFt} \label{f:exp:AcFt} }\hspace*{1ex} \subfigure[$F_\mrt\,/\,{A_\mathrm{real}}$ over time for the largest initial contact.]{ \includegraphics[width=0.47\textwidth]{Ratio_FtAc_largestAc} \label{f:exp:tauTime} } \caption{Experimental results for the incipient sliding of a glass plate on an elastomer sphere: Friction force~$F_\mrt$ and contact area ${A_\mathrm{real}}$ measured under low normal loads; each color corresponds to a different initial contact area (also shown in \cref{f:exp:FnJKR}); the squares indicate the states with maximum $F_\mrt$; $t_\mathrm{start}$ is the instant when the motor starts to move at velocity $v = 0.1\,\mrm\mrm/\mrs$.} \label{f:exp:results} \end{figure} \Cref{f:exp:AcFt} shows the dependency between the contact area and the tangential force in the incipient loading phase, before the friction peak is reached. As can be seen, at the onset of sliding (see the squares) the friction force and the contact area are, to a good approximation, proportional to each other. This is consistent with experimental results on identical smooth sphere/plane contacts~\cite{sahli18}, albeit for much larger contacts. It is also consistent with experiments on rough contacts involving soft materials (see e.g.~\cite{wubavouzet10, degrandicontraires12, yashima15, sahli18}). \Cref{f:exp:tauTime} exemplarily shows the evolution of the ratio $F_\mrt\,/\,{A_\mathrm{real}}$ over time for the largest initial contact area (${A_\mathrm{real}} = 0.46\,\mrm\mrm^2$, upper dark blue curve in \crefrange{f:exp:FtTime}{f:exp:AcFt}), for which both the small residual inclination of the glass plate and the resolution of the force sensor have lowest influence. This ratio corresponds to the average tangential traction within the contact area. As seen, it first increases almost linearly until the maximum friction force is reached. From then on, the ratio $F_\mrt\,/\,{A_\mathrm{real}}$ remains nearly constant. As these results demonstrate, considering a constant shear stress during sliding is a reasonable assumption when modeling friction of soft and smooth surfaces. This corresponds to adhesion-controlled friction, when $F_\mrt \approx \tau_0\, {A_\mathrm{real}}$ according to \cref{e:extAmontons}. For our experiments, we measure an average value of $\tau_0 = 0.43 \pm 0.01\,\mrM\mrP\mra$, which is also visualized in \cref{f:exp:AcFt}. \section{Models for adhesive friction}\label{s:model} Before formulating adhesive friction between two arbitrary objects mathematically, we must first quantify the separation of their surfaces appropriately. To this end, we conceptually introduce variables for the distances in normal and tangential directions following classical contact formulations \cite{laursen02,wriggers06}. Using a common notation in continuum mechanics (see e.g.~\cite{bonet97}), we use uppercase letters for variables defined in the \emph{reference} configuration of a body, and small letters for variables in the \emph{current} configuration. For a given point~${\boldsymbol{x}_k}$ on the contact surface of one of the two bodies $\sB_k$, $k=1,2$, we first introduce its closest neighbor (or \textit{projection point}),~${\boldsymbol{x}_\ell^\mathrm{p}}$, on the contact surface of the opposing body $\sB_\ell$, $\ell=2,1$. At~${\boldsymbol{x}_\ell^\mathrm{p}}$, the outward unit normal vector of the surface is denoted~$\boldsymbol{n}_\mathrm{p}$. Once these quantities are determined, we define a normal gap vector, ${\boldsymbol{g}_\mathrm{n}}$, as well as a (scalar) signed normal gap,~${g_\mathrm{n}}$, as \begin{equation} {\boldsymbol{g}_\mathrm{n}} = {\boldsymbol{x}_k} - {\boldsymbol{x}_\ell^\mathrm{p}}, \qquad {g_\mathrm{n}} = {\boldsymbol{g}_\mathrm{n}} \cdot \boldsymbol{n}_\mathrm{p}. \label{e:gn} \end{equation} In addition, we conceptually introduce a vector for the tangential slip, ${\boldsymbol{g}_\mathrm{t}}$, which reduces to the scalar~${g_\mathrm{t}}$ for 2D problems. This quantity contains the magnitude and direction of the tangential displacement between the two surfaces. The normal and tangential gaps, ${g_\mathrm{n}}$ and ${\boldsymbol{g}_\mathrm{t}}$, as well as the normal vector, $\boldsymbol{n}_\mathrm{p}$, will be used to derive and illustrate our new contact models. Their computation is addressed e.g.~in~\cite{sauer13cmame, sauer15ijnme}, while the algorithmic treatment of combined adhesion and friction is discussed by Mergel et al.~\cite{mergelPhD, mergel18comput}. \subsection{Adhesive and repulsive contact}\label{s:model:CGCM} In order to describe general adhesion and repulsion between two bodies under large deformations, we consider the coarse-grained contact model (CGCM) \cite{sauerPhD, sauer07ijnme, sauer09cmame}. This model is derived by first integrating the Lennard-Jones (LJ) potential from \cref{e:LJ} over one of the two bodies (index~$\ell$), assuming that its surface appears flat in the region affected by~$\phi$ (typically a few nanometers). This yields a volumetric force \big(with unit $\mrN/\mrm^3$\big), which acts at each point within the other body (index~$k$). In a second step, this body force is projected onto the surface of body~$\sB_k$ to obtain the contact traction \big(with unit $\mrN/\mrm^2$\big) \begin{equation} {\boldsymbol{T}_{\mathrm{n},k}} = \frac{\theta_k}{J_\ell} \, T_\mathrm{n}({g_\mathrm{n}}) \, \boldsymbol{n}_\mathrm{p}, \qquad T_\mathrm{n}({g_\mathrm{n}}) = \frac{{A_\mathrm{H}}}{2\pi r_0^3} \left[{ \frac{1}{45} {\Big(\frac{r_0}{{g_\mathrm{n}}}\Big)}^9 - \frac{1}{3} {\Big(\frac{r_0}{{g_\mathrm{n}}}\Big)}^3}\right]. \label{e:Tn} \end{equation} Note that this contact law is stated in the undeformed \emph{reference} configuration. As can be seen in \cref{f:Tn}, $T_\mathrm{n}$ can be split into a repulsive (power~9) and an attractive (power~3) term. In \cref{e:Tn}, the parameter ${A_\mathrm{H}} = 2\pi^2 \, \beta_{01} \, \beta_{02} \, \varepsilon \, r_0^6$ is the Hamaker constant \cite{israelachvili11}, which contains the initial molecular densities~$\beta_{0k}$ of the two bodies and the parameters~$\varepsilon$ and $r_0$ of the Lennard-Jones potential. The scalar $J_\ell \geq 0$ denotes the volume change of the surrounding material during deformation. It corresponds to the determinant of the deformation gradient of the body~$\sB_\ell$ \cite{sauer09cmame}. If this body is rigid, incompressible, or considerably stiffer than body~$k$, one can assume that $J_\ell$ is either equal or close to one. The volume change can be related to the local surface stretch~$J_{\mathrm{c}\ell}$ by using $J_\ell = J_{\mathrm{c}\ell} \cdot \lambda_\ell$, where $\lambda_\ell$ is the stretch along the thickness (perpendicular to the surface). Since the potential~$\phi(r)$ rapidly decays to zero at large separations, it is reasonable to assume that within its effective range $\lambda_\ell \approx 1$, see also Sect.~2.3.2 of~\cite{sauer13cmame}. \begin{figure}[ht] \centering \includegraphics[width=0.47\textwidth]{Tn} \caption{Contact traction in the model of Sauer and Wriggers~\cite{sauer09cmame} (``surface force formulation'') for frictionless adhesion and repulsion; $T_0 = {A_\mathrm{H}}\,/\,(2\pi r_0^3)$.} \label{f:Tn} \end{figure} \cref{e:Tn} contains a scalar, $\theta_k$, that includes the current alignment of the two interacting surfaces as well as the volume change of body~$\sB_k$. Like~$J_\ell$, $\theta_k$ requires the computation of the deformation in the vicinity of surface point $\bx_k$. If both surfaces are parallel, and if the influence of the surface stretch of body~$\sB_k$ is negligible, one can set $\theta_k \approx 1$~\cite{sauer09cmame}. In the following, we also assume that $\theta_k \approx 1$. An alternative approximation (similar to $J_\ell \approx J_{\mathrm{c}\ell}$) is proposed by Mergel in~\cite{mergelPhD}. Before we proceed with the frictional part, let us define some characteristic parameters also shown in \cref{f:Tn}: \begin{enumerate}\setlength{\itemsep}{0pt} \item The equilibrium distance ${g_\mathrm{eq}} = r_0\,/\,\sqrt[6]{15}$ at which $T_\mathrm{n}({g_\mathrm{eq}}) = 0$ \cite{sauer11ja}; \item The work of adhesion per unit area for full separation, which is obtained by integrating $|T_\mathrm{n}({g_\mathrm{n}})|$ from ${g_\mathrm{n}} = {g_\mathrm{eq}}$ to ${g_\mathrm{n}} = \infty$ \cite{sauer11ja}, % \begin{equation} W_{\mathrm{adh}} = \frac{\sqrt[3]{15} \, {A_\mathrm{H}}}{16 \pi r_0^2}; \label{e:Wadh} \end{equation} \item The location~${g_\mathrm{max}}$ of the maximum adhesive traction~$T_\mathrm{max}$, % \begin{equation} {g_\mathrm{max}} = \frac{r_0}{\sqrt[6]{5}}, \qquad T_\mathrm{max} = |T_\mathrm{n}({g_\mathrm{max}})| = \frac{\sqrt{5}\,{A_\mathrm{H}}}{9\pi r_0^3}. \label{e:gmaxTnmax} \end{equation} % Since $T_\mathrm{n}({g_\mathrm{max}})$ is negative (i.e., attractive), ${g_\mathrm{max}}$ is the global minimum of $T_\mathrm{n}$. \end{enumerate} Furthermore, in a computational implementation, one may increase robustness by regularizing the normal traction for small normal gaps; see \cref{a:regularize,f:Tn}. This approach prevents ill-conditioning caused by the slope of~$T_\mathrm{n}$ approaching minus infinity for decreasing~${g_\mathrm{n}}$. \subsection{Frictional contact}\label{s:model:frict} We now propose two new phenomenological models that combine adhesion and repulsion with sliding friction. To this end, we assume that the sliding resistance is equal to the threshold for static friction. This means that the tangential traction required to initiate the sliding process agrees with the traction in the final sliding state. This assumption is physically justified by experimental observations for both biological adhesives and rough elastomers, indicating that for such systems static friction is comparable to kinetic friction \cite{autumn00, autumn06, zhao08, gravish10, prevost13}. For the validity and restrictions of this assumption see also \cref{s:model:validity}. To shorten the notation, we now omit index~$k$. Let $\boldsymbol{t}_\mathrm{t}({g_\mathrm{n}},{\boldsymbol{g}_\mathrm{t}})$ denote the tangential traction vector due to frictional sticking or sliding, which is a force per \emph{current} area. $\boldsymbol{t}_\mathrm{t}$~depends on both the normal gap from \cref{e:gn} and the tangential slip~${\boldsymbol{g}_\mathrm{t}}$. We now assume that~$\boldsymbol{t}_\mathrm{t}$ satisfies \begin{equation} \|\boldsymbol{t}_\mathrm{t}({g_\mathrm{n}},{\boldsymbol{g}_\mathrm{t}})\|\ \begin{cases} \ <\ t_\mathrm{slide}({g_\mathrm{n}}) & \text{during\ sticking}, \\ \ =\ t_\mathrm{slide}({g_\mathrm{n}}) & \text{during\ sliding}, \end{cases} \label{e:ttorig} \end{equation} where $t_\mathrm{slide}({g_\mathrm{n}}) \ge 0$ is a function that defines the sliding threshold. For~$t_\mathrm{slide}$ we propose two different approaches in the next two subsections. Note that the classical Coulomb-Amontons law in \cref{e:Coulomb:tract} corresponds to $t_\mathrm{slide} := \mu \, t_\mathrm{n}$ for $t_\mathrm{n} > 0$. \subsubsection{Model~DI: Distance-independent sliding friction in the contact area} \label{s:model:CA} The first proposed friction law is motivated by the experimental results discussed in \cref{s:exp}. We simply assume that the sliding threshold is independent of the distance~${g_\mathrm{n}}$, i.e., constant within the current contact area. As a consequence, the resulting friction force is proportional to this area if the entire body is sliding. Let us first define some cutoff distance, ${g_\mathrm{cut}}$, up to which the surfaces are sufficiently close to each other in order to experience friction. After introducing a constant parameter~$\tau_{\mrD\mrI} > 0$ for the frictional shear strength, we define \begin{equation} t_\mathrm{slide}({g_\mathrm{n}}) = \begin{cases} \tau_{\mrD\mrI}, & {g_\mathrm{n}} \le {g_\mathrm{cut}}, \\ 0, & {g_\mathrm{n}} > {g_\mathrm{cut}}. \end{cases} \label{e:tslideCAunreg} \end{equation} Since this function is discontinuous at ${g_\mathrm{n}} = {g_\mathrm{cut}}$, we regularize it with the logistic function, \begin{equation} t_\mathrm{slide}({g_\mathrm{n}}) = \frac{\tau_{\mrD\mrI}}{1 + \mre^{\, k_{\mrD\mrI} ({g_\mathrm{n}} - {g_\mathrm{cut}})}}, \label{e:tslideCA} \end{equation} where $k_{\mrD\mrI} > 0$ (with unit $1/\mrm$) is a sufficiently large parameter. Both the original and the regularized models are illustrated in \cref{f:tslideCA}. \Cref{f:ttlawCA} depicts the resulting friction law, i.e., the tangential traction-separation relation for arbitrary but fixed normal distances. \begin{figure}[h] \centering \subfigure[Sliding threshold for varying ${g_\mathrm{n}}$.]{ \includegraphics[width=0.47\textwidth]{TslideJ} \label{f:tslideCA} }\hspace*{1ex} \subfigure[Friction law in 2D for different but fixed ${g_\mathrm{n}}$.]{ \includegraphics[width=0.47\textwidth]{TlawJ} \label{f:ttlawCA} } \caption{Model~DI: Constant sliding traction within the contact area defined by the cutoff distance~${g_\mathrm{cut}}$; $\tau_{\mrD\mrI} = 0.5 \, T_\mathrm{max}$, ${g_\mathrm{cut}} = 1.1\,r_0$, and $T_0 = {A_\mathrm{H}} \,/\, (2\pi r_0^3)$; the colored asterisks mark the normal gap values ${g_\mathrm{eq}}$~(where $T_\mathrm{n} = 0$, orange), ${g_\mathrm{max}}$~(yellow), and $1.2\,{g_\mathrm{cut}}$ (purple).} \label{f:modelCA} \end{figure} Note that for the regularized model $t_\mathrm{slide}({g_\mathrm{cut}}) = \tau_{\mrD\mrI}/2$. As seen in \cref{f:modelCA}, for model~DI\ both the value~$\tau_{\mrD\mrI}$ and the cutoff distance~${g_\mathrm{cut}}$ can be chosen independently of the normal traction. Nevertheless, for the sake of comparison with the other model we introduce a coefficient that relates the constant~$\tau_{\mrD\mrI}$ to the maximum adhesive traction~$T_\mathrm{max}$, defined in \cref{e:gmaxTnmax}, as \begin{equation} \mu_{\mrD\mrI} := \frac{\tau_{\mrD\mrI}}{T_\mathrm{max}}. \label{e:muCA} \end{equation} The sliding threshold $\tau_{\mrD\mrI}$ is related to the \emph{actual} contact surface (in the \emph{current} configuration). This is motivated by the experiments from \cref{s:exp}, for which the force is proportional to the current size of the contact area. If we defined the parameter~$\tau_{\mrD\mrI}$ in the \emph{reference} configuration instead, we would miss the change in the contact area. The differences between those two approaches are discussed in~\cite{mergelPhD}. When recapitulating the unregularized version of model~DI, one may recognize that \cref{e:tslideCAunreg} has some similarities to one of the earliest cohesive zone models, the Dugdale model~\cite{dugdale60}. In contrast to that model, however, we here define the sliding threshold for dynamic friction (instead of the normal stress during pure debonding). As mentioned also in \cref{s:adhfrict:others}, a similar approach is used in~\cite{deng12} to model sliding of graphene sheets. Therein, a constant stress during sliding is considered for those parts of the surfaces that are in compressive contact. This would correspond to the unregularized friction law~\labelcref{e:tslideCAunreg} with ${g_\mathrm{cut}} = {g_\mathrm{eq}}$. The current model is more general, because it can also be used to describe sliding resistance for tensile contact. \subsubsection{Model~EA: Extended Amontons' law in local form}\label{s:model:AM} The second proposed traction-separation law is inspired by extended Amontons' law~\labelcref{e:extAmontons}. Importantly, that law was originally formulated in terms of force resultants and average tractions. In our continuum formulation, however, the normal contact stress~\labelcref{e:Tn} can vary within the contact area between attraction and repulsion. To include a tangential resistance against sliding even for zero or negative normal pressures, we now propose a model that can be regarded as extended Amontons' law in \textit{local} form. \begin{figure}[p] \centering \subfigure[Sliding threshold for varying ${g_\mathrm{n}}$; ${s_\mathrm{cut}} = 0$.]{ \includegraphics[width=0.47\textwidth]{TslideA} \label{f:TslideAM:s0} }\hspace*{1ex} \subfigure[Friction law for different but fixed ${g_\mathrm{n}}$; ${s_\mathrm{cut}} = 0$.]{ \includegraphics[width=0.47\textwidth]{TlawA} \label{f:TtlawAM:s0} } \vspace*{1ex} % \subfigure[Sliding threshold for varying ${g_\mathrm{n}}$; ${s_\mathrm{cut}} = 0.5$.]{ \includegraphics[width=0.47\textwidth]{TslideE} \label{f:TslideAM:s05} }\hspace*{1ex} \subfigure[Friction law for different but fixed ${g_\mathrm{n}}$; ${s_\mathrm{cut}} = 0.5$.]{ \includegraphics[width=0.47\textwidth]{TlawE} } \vspace*{1ex} % \subfigure[Sliding threshold for varying ${g_\mathrm{n}}$; ${s_\mathrm{cut}} = 1$.]{ \includegraphics[width=0.47\textwidth]{TslideD} \label{f:TslideAM:s1} }\hspace*{1ex} \subfigure[Friction law for different but fixed ${g_\mathrm{n}}$; ${s_\mathrm{cut}} = 1$.]{ \includegraphics[width=0.47\textwidth]{TlawD} \label{f:TtlawAM:s1} } \caption{Model~EA: Extended Amontons' law in \emph{local} form illustrated for $\mu_{\mrE\mrA} = 0.2$, $J_{\mathrm{c}\ell} \equiv 1$, and three different values of~${s_\mathrm{cut}}$; $T_0 = {A_\mathrm{H}} \,/\, (2\pi r_0^3)$; the colored asterisks mark the normal gap values $0.5\,r_0$~(green), ${g_\mathrm{eq}}$~(where $T_\mathrm{n} = 0$, orange), and ${g_\mathrm{max}}$~(yellow).} \label{f:modelAM} \end{figure} Let us first shift the traction~$T_\mathrm{n}$ in \cref{e:Tn} by a value smaller than or equal to the maximum adhesive traction, $T_\mathrm{max}$; see also \cref{e:gmaxTnmax,f:Tn}. To this end, we introduce a distance, ${g_\mathrm{cut}}$, which lies somewhere between the equilibrium distance,~${g_\mathrm{eq}}$, and the location~${g_\mathrm{max}}$ of~$T_\mathrm{max}$: \begin{equation} {g_\mathrm{cut}} = {s_\mathrm{cut}} \, {g_\mathrm{max}} + (1 - {s_\mathrm{cut}}) \, {g_\mathrm{eq}}, \qquad {s_\mathrm{cut}} \in [0,1]. \label{e:gcutAM} \end{equation} As can be seen in \cref{f:TslideAM:s0,f:TslideAM:s1}, in this range $T_\mathrm{n}({g_\mathrm{cut}})$ is smaller than or equal to zero. We then consider a sliding threshold that is proportional to the shifted curve $T_\mathrm{n}({g_\mathrm{n}}) + |T_\mathrm{n}({g_\mathrm{cut}})|$: \begin{equation} T_\mathrm{slide}({g_\mathrm{n}}) = \begin{cases} \displaystyle \frac{\mu_{\mrE\mrA}}{J_{\mathrm{c}\ell}} \, \big[T_\mathrm{n}({g_\mathrm{n}}) - T_\mathrm{n}({g_\mathrm{cut}})\big], & {g_\mathrm{n}} < {g_\mathrm{cut}}, \\[0.2ex] 0, & {g_\mathrm{n}} \ge {g_\mathrm{cut}}. \end{cases} \label{e:TslideAM} \end{equation} Note that in this case, the sliding threshold,~$T_\mathrm{slide}$, directly depends on the normal traction,~$T_\mathrm{n}$, which is defined in the \emph{reference} configuration (\cref{s:model:CGCM}). \Cref{f:modelAM} illustrates model~EA\ for three different values of the parameter~${s_\mathrm{cut}}$. The left-hand side of the figure shows the dependence of the sliding traction,~$T_\mathrm{slide}$, on the normal gap,~${g_\mathrm{n}}$; dashed lines indicate a regularized version according to \cref{a:regularize}. If ${s_\mathrm{cut}} = 0$ (\cref{f:TslideAM:s0,f:TtlawAM:s0}), tangential sliding occurs only for positive, i.e.~compressive, normal tractions. This corresponds to classical Coulomb-Amontons friction (see \cref{e:Coulomb:tract}) for non-adhesive contact. It is further used in many cohesive zone models (see \cref{s:adhfrict:others}) to include frictional sliding. If ${s_\mathrm{cut}} > 0$, a tangential sliding resistance is present even for tensile normal tractions. Note that the curve for $T_\mathrm{slide}$ is smooth ($C^1$-continuous) only for ${s_\mathrm{cut}} = 1$ (\cref{f:TslideAM:s1}); otherwise, a kink occurs at ${g_\mathrm{n}} = {g_\mathrm{cut}}$, which requires special treatment in a computational implementation \cite{mergelPhD}. For the particular case ${s_\mathrm{cut}} = 0$, this kink is exactly located at the equilibrium position, ${g_\mathrm{eq}}$. \begin{figure}[ht] \centering \subfigure[Model~EA\ with ${g_\mathrm{cut}} = {g_\mathrm{eq}}$.]{ \includegraphics[width=0.47\textwidth]{TnTtA} }\hspace*{1ex} \subfigure[Model~EA\ with ${g_\mathrm{cut}} = ({g_\mathrm{eq}}+{g_\mathrm{max}})/2$.]{ \includegraphics[width=0.47\textwidth]{TnTtE} } % \subfigure[Model~EA\ with ${g_\mathrm{cut}} = {g_\mathrm{max}}$.]{ \includegraphics[width=0.47\textwidth]{TnTtD} }\hspace*{1ex} \subfigure[Model~DI.]{ \includegraphics[width=0.47\textwidth]{TnTtJ} \label{f:TnTt:CA} } \caption{Tangential traction during sliding vs.~normal traction for (a) -- (c) model~EA\ with $J_{\mathrm{c}\ell} \equiv 1$ and (d)~model~DI; $T_0 = {A_\mathrm{H}} \,/\, (2\pi r_0^3)$; the blue arrows indicate the sequence from ${g_\mathrm{n}} = 0$ to ${g_\mathrm{n}} \to \infty$; for the colored asterisks see \cref{f:modelCA,f:modelAM}, respectively.} \label{f:TnTt} \end{figure} \cref{f:TnTt} depicts the (directed) tangential traction during sliding versus the normal traction, either for model~EA\ and different values of~${s_\mathrm{cut}}$, or for model~DI. As shown, for model~EA\ this relation resembles a shifted version of the cone describing the classical friction law \labelcref{e:Coulomb:tract}. In fact, up to ${g_\mathrm{n}} \le {g_\mathrm{cut}}$, it corresponds to the Mohr-Coulomb model mentioned in \cref{s:adhfrict:others}. In model~DI, the tangential traction, $t_\mathrm{t}$, is not a function of the normal traction, $t_\mathrm{n}$, anymore. \subsection{Continuum mechanical equations} For completeness this section outlines the governing equations for adhesive and frictional contact of two bodies. Under quasi-static conditions (for which inertial forces are neglected) the following equilibrium equations must be satisfied at each point~${\boldsymbol{x}_k}$ within the two bodies $\sB_k$ $(k = 1,\,2)$, \begin{equation} \divv\,\bsig_k + \bff_k = \bzero. \label{e:equilibrium} \end{equation} Here, $\bsig_k$ is the Cauchy stress tensor, and $\bff_k$ denotes the vector of distributed volumetric forces. The bodies must further satisfy the contact condition \begin{equation} \bsig_k \, \bn_k = {\boldsymbol{t}_{\mathrm{n},k}} - {\boldsymbol{t}_{\mathrm{t},k}} \label{e:contC} \end{equation} on the contact surface~$\partial_{\mrc} \sB_k$, as well as conditions at the Dirichlet boundaries~$\partial_{\bu}\sB_k$ (where displacements~$\bar{\bu}_k$ are prescribed) \begin{equation} \bx_k - \bX_k = \bar{\bu}_k, \end{equation} and at the Neumann boundaries~$\partial_{\bt}\sB_k$ (where surface tractions~$\bar{\bt}_k$ are applied), \begin{equation} \bsig_k \, \bn_k = \bar{\bt}_k. \label{e:NeumannBC} \end{equation} In \cref{e:contC,e:NeumannBC}, the unit vector~$\bn_k$ denotes the current surface normal at point~${\boldsymbol{x}_k}$. \Cref{e:contC} further contains the normal and tangential tractions defined through our contact models; note that here the sign convention of Laursen~\cite{laursen02} is used. \Crefrange{e:equilibrium}{e:NeumannBC} represent the strong form of the general contact and boundary value problem, expressed in the current configurations of the bodies. Since the analytical solution of these equations is possible only for very special cases (and mainly restricted to small deformations), for general conditions involving arbitrary geometries and large deformations, a computational solution technique is required. For this reason, \cite{mergelPhD, mergel18comput} provide a computational implementation of our models into a nonlinear finite element formulation, and also discuss the algorithmic treatment of friction under large deformations. \subsection{General comments, validity, and restrictions} \label{s:model:validity} Like any other model, our models have limitations. We address those in the following. In \cref{e:ttorig} we assume that the static friction threshold coincides with the resistance for kinetic friction. As mentioned at the beginning of \cref{s:model:frict}, this assumption agrees well with experimental observations for bio-adhesive systems and rough elastomers. Nevertheless, these observations refer to the \emph{globally} measured force resultant instead of the \emph{local} traction at the contact zone. It remains to be discussed further whether static and kinetic friction coincide because of the material itself, or whether this is caused by a split of the effective contact area into a large number of small areas. The influence of such a split on both static friction and stick-slip motion is addressed in~\cite{varenberg07, varenberg09, lorenz12}. Regarding bio-inspired adhesives, it may be arguable whether the assumption of equal static and kinetic friction is valid for all kinds of materials. See, for instance, the experimental results~\cite{varenberg07} obtained for a microstructured polyvinylsiloxane (PVS) surface sliding on glass. If required, our model could be extended to account for differing parameters for static and kinetic friction as well. In our model we consider dry (i.e., non-lubricated) adhesion and friction. We hence omit the influence of any secretion that may cover the adhesive device, as observed for many beetles and other insects. In fact, experimental studies on insect pads show that the depletion of such secretion (caused e.g.~by sliding or by repeating detachment) affects both their frictional resistance~\cite{drechsler06, bullock08} and (although less strongly) their adhesion~\cite{labonte15}. Nevertheless, if the amount of sliding is sufficiently small, one can assume that the frictional resistance does not change considerably. As shown in \cref{s:intro,s:exp}, there exist several applications for which van der Waals forces may affect the macroscopic behavior even at larger scales (micrometers or millimeters). For increasing length scales, a direct computational implementation of adhesion models based on the Lennard-Jones potential, such as the CGCM model (\cref{s:model:CGCM}) and friction model~EA, can become very inefficient, because they require nanoscale finite element resolution. For this reason, it would be very promising to develop an effective adhesion model that is regularized by the compliance of the surrounding material. One approach in this direction has been developed in the context of adhesive joints under small deformations \cite{schmidt10}. Another possibility, which is pursued in~\cite{mergelPhD, mergel18comput} and also here, is to calibrate the parameters in \cref{s:model:CGCM} (like ${A_\mathrm{H}}$, $T_\mathrm{max}$, or $W_{\mathrm{adh}}$) such that they match with experimental data. The curve~\labelcref{e:Tn} is then regularized by an automatic increase of the length parameter~$r_0$. As a consequence, the model does not require nanoscale resolution anymore. When adjusting these parameters it is important to distinguish between the nominal (or apparent) contact area and the true contact area due to very small asperities, which interact at the contact surface; see also the discussion in \cref{s:originfrict}. For the CGCM of \cref{s:model:CGCM} the normal contact stress is integrated over an apparent, nominally flat contact area. Thus, simply inserting the material constant~${A_\mathrm{H}}$ for the considered pair of materials would overestimate the real strength of adhesion by several orders of magnitude. This can be overcome by directly inserting effectively measured values as described before. Note that in general, the ratio between the true and the nominal contact areas may depend on the contact pressure, as discussed in Sect.~5.2.4 of~\cite{wriggers06} from a computational point of view. \section{Qualitative comparison between model and experiment} \label{s:example} We now apply the proposed two models to study adhesive friction between a soft cylindrical cap and a rigid substrate, see \cref{f:cap:setup}. To this end, we use the finite element implementation derived in~\cite{mergelPhD, mergel18comput}. \begin{figure}[ht] \centering \subfigure[Problem setup.]{ \includegraphics[width=0.48\textwidth]{SetupCap} \label{f:cap:setup} } \subfigure[Sliding under zero normal load.]{ \unitlength\textwidth \begin{picture}(0.48,0.1) \put(0,0.0615){\includegraphics[width=0.48\textwidth]{Cap0_xJ}} \put(0.01,0){\includegraphics[width=0.46\textwidth]{Cap0_xJcol}} \end{picture} \label{f:cap:xn} } \caption{Adhesive friction of a soft cap: (a)~Setup; (b)~stress distribution during sliding for zero preload and model~DI\ (${g_\mathrm{cut}} = {g_\mathrm{max}}$, $\mu_{\mrD\mrI} = 1$); the colors show the first invariant of the Cauchy stress in units of~$E$.} \end{figure} We consider this example as a preliminary study to investigate the qualitative behavior of our models, and to show that it agrees with the experimental behavior presented in \cref{s:exp}. For length scale reasons related to the computational adhesion model~\cite{sauer09cmame} (addressed in detail in \cref{s:model:validity} already), a quantitative comparison is not possible at this stage. Therefore, the cap in the example is 2D and smaller than that in \cref{s:exp}. Also, slightly different material parameters (\cref{t:cap:para}) and smaller friction values are used. A 2D plane strain, nonlinear finite element formulation based on a Neo-Hooke material model is used to simulate the example. For further details see~\cite{mergelPhD}. All results shown here are normalized by Young's modulus, $E$, an arbitrary out-of-plane thickness (or width), $W$, and a unit length, $L_0$ (see \cref{t:cap:para}). \begin{table}[h] \centering \begin{tabular} {c@{\qquad}c@{\qquad}c@{\qquad}c@{\qquad}c@{\qquad}c@{\qquad}c} \hline \noalign{\smallskip} $E$ & $\nu$ & $T_\mathrm{max}$ & $W_{\mathrm{adh}}$ & $R$ & H & $L_0$ \\ \noalign{\smallskip} \hline \noalign{\smallskip} $2\,\mrM\mrP\mra$ & $0.4$ & $0.33\,\mrM\mrP\mra$ & $0.027\,\mrJ/\mrm^2$ & $47.1\,L_0$ & $10\,L_0$ & $1\,\mu\mrm$ \\ \noalign{\smallskip} \hline \end{tabular} \caption{Adhesive friction of a soft cap: Parameters.} \label{t:cap:para} \end{table} As illustrated in \cref{f:cap:setup}, we first apply a fixed normal force to the rigid substrate, and then slide it horizontally while keeping the lower boundary of the cap fixed. As a special case we investigate the sliding behavior also under zero load, for which the attractive and repulsive stresses in the contact area equilibrate each other. The finite element mesh of the cap consists of 42,300 Q1N2.1 elements \cite{corbett14}. \Cref{f:cap:xn} shows the stress distribution of the cap during sliding under zero load. Although keeping the normal load constant during sliding is not strictly identical to the boundary conditions in our experiment, in the latter the normal load is expected to remain reasonably close to its initial value predicted from the JKR theory (\cref{f:exp:FnJKR}): Since the end of the double cantilever (see \cref{s:exp}) is kept vertically fixed, the vertical position of the glass plate, and thus the normal load, can change only due to a vertical dilatancy of the elastomer sphere caused by horizontal shear. According to Scheibert et al.~\cite{scheibert09} (see the introduction and references therein), however, in our case of a rigid body (glass plate) in contact with an incompressible half-space (thick elastomer with a Poisson's ratio of approx.~$0.5$), the coupling between the normal displacement and any induced tangential stresses is expected to be negligible. For a qualitative comparison as it is performed here, it is expected that the slight differences in the boundary conditions do not affect our general observations and conclusions. \begin{figure}[p] \centering \subfigure[Friction force under compression, $F_\mrn^* = -0.288$.]{ \includegraphics[width=0.47\textwidth]{Cap_PxD} }\hspace*{1ex} \subfigure[Contact area under compression, $F_\mrn^* = -0.288$.]{ \includegraphics[width=0.47\textwidth]{Cap_AcD} } % \subfigure[Friction force under zero load, $F_\mrn^* = 0$.]{ \includegraphics[width=0.47\textwidth]{Cap_Px0} }\hspace*{1ex} \subfigure[Contact area under zero load, $F_\mrn^* = 0$.]{ \includegraphics[width=0.47\textwidth]{Cap_Ac0} \label{f:cap:Ac0} } % \subfigure[Friction force under tension, $F_\mrn^* = 0.288$.]{ \includegraphics[width=0.47\textwidth]{Cap_PxU} }\hspace*{1ex} \subfigure[Contact area under tension, $F_\mrn^* = 0.288$.]{ \includegraphics[width=0.47\textwidth]{Cap_AcU} } \caption{Adhesive friction of a soft cap: Friction force and contact area for sliding under a constant preload ($\mu_{\mrE\mrA} = \mu_{\mrD\mrI} = 1$); the squares indicate the onset of full sliding; the dots mark the configurations of \cref{f:cap:Aczoom}; $F_\mrn^* = F_\mrn \,/\, \big[E\,L_0\,W\big]$ denotes the normalized preload.} \label{f:cap:PxAndAc} \end{figure} \Cref{f:cap:PxAndAc} shows both the friction force and the contact area for different loads. Here we use models~DI\ with ${g_\mathrm{cut}} = {g_\mathrm{max}}$, EA\ with ${s_\mathrm{cut}} = 1$, and EA\ with ${s_\mathrm{cut}} = 0$ (Coulomb-Amontons friction, see also~\cref{e:Coulomb:tract}). Before full sliding, the qualitative behavior of all models is close to our experimental results in \cref{f:exp:FtTime,f:exp:AcTime}. For classical Coulomb-Amontons friction, however, the sliding force is considerably lower than for the other models, because the compressed area is much smaller than the total contact area. When the entire contact surface is sliding, both the force and the area remain constant for the numerical models. In contrast, in the experiments, the tangential force drops over a finite time scale before entering a rather steady sliding regime. These differences are most likely caused by the viscous behavior of polydimethylsiloxane. It thus makes sense to later consider a viscoelastic material model. \Cref{f:cap:PxOverAc} (like \cref{f:exp:AcFt}) shows the contact area versus the tangential force up to the point of full sliding. The classical law by Coulomb and Amontons (model EA\ for ${s_\mathrm{cut}} = 0$) obviously fails to capture the qualitative behavior observed in the experiments. In contrast, the differences to the experimental results are smaller for model~EA\ with ${s_\mathrm{cut}} = 1$, but they are still considerable. Model DI, on the other hand, agrees very well with the experiments. \begin{figure}[h] \centering \includegraphics[width=0.49\textwidth]{Cap_AcPxall} \caption{Adhesive friction of a soft cap: Contact area as a function of the tangential force for the onset of sliding under different preloads ($\mu_{\mrE\mrA} = \mu_{\mrD\mrI} = 1$); $\tau_{\mrD\mrI} = \mu_{\mrD\mrI} \, T_\mathrm{max}$; see also \cref{f:exp:AcFt}.} \label{f:cap:PxOverAc} \end{figure} \begin{figure}[h] \unitlength\textwidth \begin{picture}(1,0.37) \put(0.32,0.34){\includegraphics[width=0.36\textwidth]{Cap0_AcJ_col}} % \put(0,0.18){\includegraphics[width=0.226\textwidth]{Cap0_AcJ_101}} \put(0.258,0.18){\includegraphics[width=0.226\textwidth]{Cap0_AcJ_201}} \put(0.516,0.18){\includegraphics[width=0.226\textwidth]{Cap0_AcJ_301}} \put(0.774,0.18){\includegraphics[width=0.226\textwidth]{Cap0_AcJ_401}} % \put(0,0){\includegraphics[width=0.226\textwidth]{Cap0_AcJ_501}} \put(0.258,0){\includegraphics[width=0.226\textwidth]{Cap0_AcJ_601}} \put(0.516,0){\includegraphics[width=0.226\textwidth]{Cap0_AcJ_701}} \put(0.774,0){\includegraphics[width=0.226\textwidth]{Cap0_AcJ_801}} % \put(0.024,0.202){\small $\bar{u} = 0.5\,L_0$} \put(0.282,0.202){\small $\bar{u} = 1.0\,L_0$} \put(0.540,0.202){\small $\bar{u} = 1.5\,L_0$} \put(0.798,0.202){\small $\bar{u} = 2.0\,L_0$} % \put(0.024,0.022){\small $\bar{u} = 2.5\,L_0$} \put(0.282,0.022){\small $\bar{u} = 3.0\,L_0$} \put(0.540,0.022){\small $\bar{u} = 3.5\,L_0$} \put(0.798,0.022){\small $\bar{u} = 4.0\,L_0$} % \end{picture} \caption{Adhesive friction of a soft cap: Evolution of the contact interface during sliding for model~DI\ and zero normal load (see the dots in \cref{f:cap:Ac0}); the vertical axis is stretched by the factor $\approx 3.93$; the configuration at zero tangential displacement ($\bar{u} = 0$) as well as its contour are shown in orange; the other colors show the first invariant of the Cauchy stress in units of~$E$.} \label{f:cap:Aczoom} \end{figure} Finally, \cref{f:cap:Aczoom} shows (a vertically stretched view of) the contact interface for model~DI. As a comparison with the first four snapshots of \cref{f:exp:snapshots} implies, model~DI\ appropriately captures the qualitative behavior of the contact edges before the friction force reaches its static friction peak (see the squares in \cref{f:exp:results,f:cap:Ac0}). Beforehand, mainly the left contact edge moves rightward with respect to the base of the sphere. The subsequent leftward motion of the right edge (observed in the experiments, see the last three snapshots in \cref{f:exp:snapshots}) is not seen in the numerical results, which is also likely caused by the viscosity of the material. In summary, combining model~DI\ with a viscous material model seems to be a promising approach to model sliding of smooth rubber spheres on glass. \section{Conclusion} \label{s:concl} In this paper, we present two new continuum contact models for coupled adhesion and friction that are suitable for soft systems like biological and bio-inspired adhesives. These two models are based on a 3D continuum adhesion formulation~\cite{sauer09cmame}, which is suitable to describe large deformations and large sliding motions. As a motivation, we first provide a review of existing experimental studies, theoretical investigations, and modeling approaches for dry adhesion and friction. We also present new experimental results for a smooth glass plate sliding on a smooth PDMS cap under low normal loads. Our findings indicate that the classical law by Coulomb and Amontons (with a linear dependence between the normal and tangential loads) is not applicable for strong adhesion or small roughnesses. In this case the friction force is also affected by an additional adhesion term. For some applications, this additional term dominates, and the sliding resistance is described by a constant, material-dependent frictional shear strength multiplied with the real contact area. Our two continuum models can generate sliding friction even when the normal pressure is zero or negative (i.e., tensile). This is useful because soft bio-adhesive pads are observed to generate non-negligible sliding forces under zero normal load. The proposed models contain the law of Coulomb and Amontons as a special case. As demonstrated in~\cite{mergelPhD, mergel18comput}, for certain applications both models show very similar behavior. This paper focuses on the motivation and derivation of our new contact models. Both their implementation in terms of a nonlinear finite element framework and the algorithmic treatment of adhesive friction are discussed separately \cite{mergelPhD, mergel18comput}. In~\cite{mergelPhD} the model is further incorporated into a beam contact model~\cite{sauer14finel} for adhesive fibrils. As an example we here investigate adhesive friction of a soft cap and a rigid substrate, and show that the model behavior is in qualitative agreement to the experiments. Our work is also a first important step towards a better understanding and modeling of biologic adhesives: As shown in~\cite{mergelPhD}, model~DI\ is also suitable to qualitatively describe the characteristics of friction devices in stick insects. It would thus be very promising to perform additional experiments on those, and to calibrate our friction models accordingly. In future work, several extensions should be developed to overcome the restrictions mentioned in \cref{s:model:validity}, in particular the restriction to small length scales that is inherent to numerical van der Waals-based contact formulations. A contact homogenization technique should be able to overcome this. The current comparison between model and experiment is qualitative. With a refined model, it will be possible to conduct quantitative comparisons, which will require further experiments with both biologic and bio-inspired adhesives. It would also be interesting to apply model~EA\ to problems in which both adhesion- and pressure-controlled friction play a role.
{'timestamp': '2018-08-02T02:01:12', 'yymm': '1803', 'arxiv_id': '1803.00046', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00046'}
arxiv
\section{Introduction} A $d$-dimensional submanifold $\mathcal{X}$ of $\mathbb{R}^n$ is specified by an \textit{atlas}, which is a collection of maps (called \textit{charts}) that give local, smooth identifications of $\mathcal{X}$ with open subsets of $\mathbb{R}^d$. In this work we take ``manifold learning" literally and give a technique for fitting an atlas to an (i.i.d.) sample of points from $\mathcal{X}$. This is achieved by viewing an atlas as a generative model, to which we fit neural networks using the technique of adversarial autoencoders (AAE) \cite{AAE}, which is a special case of the more general framework of Wasserstein autoencoders with a GAN-based penalty (WAE-GAN) \cite{WAE}. This work has both theoretical and practical motivations. From a mathematical perspective, an interesting question is how the topology or homotopy type of a space can be recovered from a sample of points. Besides an atlas containing all of the topological information of a manifold, in the special case that it forms a \textit{good cover} (i.e. the intersection of any collection of charts is contractible) the homotopy type of the manifold can be recovered from a simple combinatorial object, the \v Cech nerve, that keeps track of the intersections between the various charts. An example for the circle is given in figure \ref{S1-atlas}. For embedded submanifolds of $\mathbb{R}^n$, one way of encouraging an atlas to be a good cover is by taking a large number of charts, each of which is the restriction of a linear map $\mathbb{R}^n \to \mathbb{R}^d$. This corresponds to the encoder networks being single, linearly activated layers. \begin{figure}[h] \centering \captionsetup{width=.7\linewidth} \begin{tikzpicture}[scale=.65] \draw[thick] (0,0) circle (1.5cm); \draw[538b, thick] (1.65,0) arc (0:130:1.65cm); \draw[538r, thick] (-.9,1.55884572681) arc (120:250:1.8cm); \draw[538g, thick] (-.975,-1.68874953738) arc (240:370:1.95cm); \end{tikzpicture} \hspace{30pt} \raisebox{0.2\height}{\begin{tikzpicture}[node distance=1.5cm] \node (0) [node, color=538b, fill=538b] {}; \node (1) [node, color=538r, fill=538r, below of=0, left of=0] {}; \node (2) [node, color=538g, fill=538g, below of=0, right of=0] {}; \draw [edge] (0) -- (1); \draw [edge] (0) -- (2); \draw [edge] (1) -- (2); \end{tikzpicture}} \caption{An atlas of the circle $S^1 \subset \mathbb{R}^2$ and its \v Cech nerve. Each node of the graph represents a chart and there is an edge between two nodes if the corresponding charts have a non-empty intersection. Note that the graph itself is homotopy equivalent to $S^1$.} \label{S1-atlas} \end{figure} On the other hand, from the perspective of unsupervised representation learning, the structure of an atlas gives a simultaneous generalization of dimensionality reduction (the case of an atlas that consists of a single chart) and clustering (in the case of an atlas with charts that do not overlap). Our autoencoder based approach is particularly robust since we have a probabilistic encoder, so that we can map new data to the smaller dimensional latent space, as well as a probabilistic decoder, so that we can generate synthetic data from the latent space. \subsection{Related work and background} For another approach to fitting an atlas to a sample of points, see \cite{ATLAS}. An atlas determines in particular a simplicial complex via the \v Cech nerve construction. Similar complexes form the basis of ``Topological Data Analysis", whose methods include persistent homology and the MAPPER algorithm. See \cite{TDA} and the references therein. Good references for the topological objects we discuss (e.g. manifolds, simplicial complexes, nerves, and good coverings) include \cite{BottTu} and \cite{Hatcher}. \section{Setup} Let $\mathcal{X} \subset \mathbb{R}^n$ be an embedded $d$-dimensional submanifold of $\mathbb{R}^n$ and fix a positive integer $k$. From a sample of i.i.d. points $\mathcal{X}_{sample} = \{x_1,\ldots,x_N\} \subset \mathcal{X}$ we wish to infer an atlas of $\mathcal{X}$ consisting of $k$ coordinate charts diffeomorphic to the open set $\mathcal{Z} := (-1,1)^d \subset \mathbb{R}^d$. Specifically, we seek to find maps $\phi_j : \mathcal{Z} \to \mathcal{X}$ for $j=1,\ldots,k$ such that \begin{enumerate} \item Each $\phi_j$ is a diffeomorphism onto its image. \item For every $x \in \mathcal{X}$ there exists some $j$ such that $x \in \phi_j(Z)$. \end{enumerate} \begin{remark}\label{linearity-remark} By taking $k$ to be sufficiently big, we can always find an atlas such that $\phi_j^{-1} : \mathbb{R}^n \supset \phi_j(\mathcal{Z}) \to \mathcal{Z}$ is the restriction of a linear map $\mathbb{R}^n\to \mathbb{R}^d$ (note that this does not mean that $\phi_j$ itself is linear). A mathematical benefit of forcing the $\phi_j^{-1}$'s to be linear is that it encourages the atlas to form a good cover. \end{remark} We view this problem in the framework of generative models, where the latent space is \[ \mathcal{Z} \times\underbrace{\{1, \ldots, k\}}_{:= \mathcal J} \] with the uniform prior $p(Z, J)$ \footnote{We will use the convention of upper-case calligraphic fonts (e.g. $\mathcal{X}$) for a space, upper-case letters for a random variable valued in that space (e.g. $X$) and lower-case letters for a point in the space (e.g. $x$).} and \[ p(X \mid J=j, Z) = \mathbbm 1_{X = \phi_j(Z)}. \] The posterior conditioned on $J$, $p(Z \mid X=x, J=j)$, is deterministic via $\phi_j^{-1}(x)$. This is summarized schematically in figure \ref{schematic}. \begin{figure} \centering \begin{tikzpicture} \node (latent1) [tnode] {$\mathcal{Z}$}; \node (latent2) [tnode, below=.5cm of latent1] {$\mathcal{Z}$}; \node (latentk) [tnode, below=1cm of latent2] {$\mathcal{Z}$}; \node (X) [tnode, right=1cm of latent2] {$\mathcal{X}$}; \draw [arrow] (latent1) -- (X); \draw [arrow] (latent2) -- (X); \draw [arrow] (latentk) -- (X); \draw[dashedarrow] (X) to [out=100,in=0] (latent1); \draw[dashedarrow] (X) to [out=150,in=30] (latent2); \draw[dashedarrow] (X) to [out=270,in=0] (latentk); \path (latent2) -- node[auto=false]{\vdots} (latentk); \end{tikzpicture} \captionsetup{width=.75\linewidth} \caption{Schematic of the generative model. The solid lines denote $p(X \mid J, Z)$ while the dotted lines denote the posteriors $p(Z \mid J, X)$.} \label{schematic} \end{figure} \section{Fitting neural networks}\label{sec-fitting-neural-networks} We use $q$ to represent an approximation to the true probability distribution, $p$. The autoencoder model will be fit using three types of neural networks: \begin{enumerate} \item $k$-many \textit{encoder} networks $q(Z \mid J=1, X), \ldots, q(Z\mid J=k, X)$. \item $k$-many \textit{decoder} networks $q(X \mid J=1, Z), \ldots, q(X\mid J=k, Z)$. \item A \textit{chart membership} network $q(J \mid X)$. \end{enumerate} We will use deterministic encoder and decoder networks, which is consistent with our interpretation in terms of charts. However, much of what we do is applicable to non-determinstic encoders/decoders, in case we wish to model a noisy manifold. We will abuse notation slightly and reuse $\phi_j$ from the last section to denote the approximate $j$th chart corresponding to $q$: \[ q(X\mid J=j, Z) = \mathbbm 1_{X = \phi_j(Z)} \] The function $\psi_j : \mathcal{X} \to \mathcal{Z}$ satisfying \[ q(Z\mid J=j, X) = \mathbbm 1_{Z = \psi_j(X)} \] is to approximate the inverse of $\phi_j$ (when restricted to the image of $\phi_j$). Following the techniques of \cite{WAE} and \cite{AAE}, we seek to minimize the 2-Wasserstein distance between the distribution $p(X)$ (which we estimate using the training data) and the distribution coming from pushing the uniform distribution on the latent space $\mathcal{Z} \times \mathcal J$ to $\mathcal{X}$ via the decoder. This amounts to trying to simultaneously minimize \begin{equation} \mathbb E_{p(X)} \mathbb E_{q(Z, J\mid X)} \mathcal C(X,\phi_J(Z)) \approx \frac{1}{N} \sum_{i=1}^N \sum_{j=1}^k q(j \mid x_i) \mathcal ||x_i - \phi_j(\psi_j(x_i))||^2 \label{AE-objective} \end{equation} and \[ \mathcal D(q(Z, J), p(Z, J)), \] where $\mathcal \mathcal{D}$ is a divergence, which we will take to be the Jensen-Shannon divergence. The distribution $q(Z,J \mid X)$, which is the product of the deterministic part $q(Z \mid X,J)$ and the probabilistic part $q(J \mid X)$, gives the marginal distribution \begin{equation} \label{GAN-generator} q(Z,J) = \int q(Z,J \mid X=x) p(x) dx \approx \frac{1}{N} \sum_{i=1}^N q(J \mid X=x_i) q(Z \mid J, X = x_i), \end{equation} which is matched to the prior $p(Z, J)$ by using adversarial training to minimize the Jensen-Shannon divergence between the two distributions. We thus introduce a discriminator \[ D = (D_1,\ldots, D_k) : \mathcal{Z} \times \mathcal J \to \mathbb{R} \] whose goal is to classify points as coming from the prior distribution. Note that the generator distribution of the GAN is given by (\ref{GAN-generator}). $D$ is trained to maximize the function \begin{align} \mathbb E_{p(Z,J)} &\log D(Z,J) + \mathbb E_{q(Z,J)} \log(1 - D(Z,J)) \nonumber\\ &= \mathbb E_{p(Z,J)} \log D(Z,J) + \mathbb E_{p(X)} \sum_{j=1}^k q(j \mid X) \log(1 - D_j(\psi_j(X))) \nonumber\\ &\approx \mathbb E_{p(Z,J)} \log D(Z,J) + \frac{1}{N} \sum_{i=1}^N \sum_{j=1}^k q(j \mid x_i) \log(1 - D_j(\psi_j(x_i))) \label{D-objective} \end{align} while $G$ is trained to minimize it. As is common in GAN training \cite{GAN, WAE}, we instead train $G$ to maximize \begin{equation} \frac{1}{N} \sum_{i=1}^N \sum_{j=1}^k q(j \mid x_i) \mathbb E_{q(Z \mid j,x_i)} \log D_j(\psi_j(x_i)). \label{G-objective} \end{equation} The case $k=1$ gives exactly an AAE. For higher values of $k$, this amounts to simultaneously training $k$-many AAEs along with the network $q(J \mid X)$, where now the total reconstruction loss and the ``false positive" part of the discriminator loss is the sum of the losses of each AAE, weighted by $q(J\mid X)$. The algorithm thus begins by initializing encoder networks $\psi_1, \ldots, \psi_k$, decoder networks $\phi_1,\ldots, \phi_k$, a chart membership network $q(J\mid X)$, and discriminator networks $D_1, \ldots, D_k$. We sample a mini-batch $\mathcal{X}_{batch}$ from $\mathcal{X}_{data}$ and first update the encoder networks, decoder networks, and chart membership networks using gradient descent to minimize the reconstruction error (\ref{AE-objective}). We then sample from the uniform prior $p(Z,J)$ and use gradient descent to update the discriminator networks to maximize (\ref{D-objective}) on $\mathcal{X}_{batch}$. Finally, we update the encoder networks again to maximize (\ref{G-objective}) on $\mathcal{X}_{batch}$. \subsection{Using linear encoders} By remark \ref{linearity-remark}, it is reasonable to take each encoder network $\psi_j$ to be a single, linear layer as long as $k$ is chosen to be sufficiently large. Using such a simple network for the encoders adds interpretability to the model and also means we do not have to worry about what the structure of the network should be. Further, recent work has highlighted possible issues that may arise from using deterministic and non-linear encoders, especially when the latent space and intrinsic dimension are not equal \cite{WAE-latent}. \section{Topological inferences} \label{sec-topology} \subsection{Estimating dimension} One may hope to extract the intrinsic dimension of $\mathcal{X}$ by studying the losses as the parameter $d$ varies. While increasing $d$ will decrease the reconstruction error in general, for values of $d$ larger than the actual dimension of $\mathcal{X}$ it is expected that the discriminator and generator losses will drop below and above, respectively, their ideal values of $\log 4$ and $\log 2$. This is because the local generators (i.e. encoders) will be unable to make something of lower dimension appear higher (as opposed to generating lower dimensional points from higher dimensional ones). This will be especially true when we take the generators to be linear. As an example we fit atlases (with linear encoders) of varying dimension to the 3-torus $\mathbb T^3 = S^1\times S^1\times S^1$ embedded into $\mathbb{R}^6$ via three copies of the usual embedding $S^1\hookrightarrow \mathbb{R}^2$. Plots of the losses are in figure \ref{T3-losses}. We caution that general instability of GAN training means that one must be careful when making inferences based on losses. \begin{figure}[h] \centering \captionsetup{width=.75\linewidth} \includegraphics[scale=.21]{t3_mse_loss.png} \includegraphics[scale=.21]{t3_gen_loss.png} \caption{The reconstruction and generator losses, over training epochs, for fitting atlases to $\mathbb T^3$ for various choices of $d$.} \label{T3-losses} \end{figure} \subsection{The \v Cech nerve} An atlas of $\mathcal{X}$ gives, in particular, an open cover of the manifold, i.e. a collection of open subsets $\mathcal U = \{U_\alpha\}$ of $\mathcal{X}$ whose union is all of $\mathcal{X}$. The \textit{\v Cech nerve} of $\mathcal U$ is the simplicial complex whose $\ell$-simplicies are \[ \{[\alpha_0, \ldots, \alpha_\ell] \mid U_{\alpha_0} \cap \cdots\cap U_{\alpha_\ell} \ne \emptyset \}. \] Under favorable circumstances, e.g. if the cover is a \textit{good cover} (which means all of the intersections of elements of $\mathcal U$ are contractible), the \v Cech nerve is homotopy equivalent to $\mathcal{X}$. In our probabilistic setup, we use $q(J \mid X)$ to measure how much two charts overlap. We discuss two methods, each of which uses a hyperparameter, $\varepsilon$. \\ \textit{Method 1:} The simplest way is to declare that charts $U_{i_0}, \ldots, U_{i_k}$ overlap if there exists some $x \in \mathcal{X}_{sample}$ such that $q(j_0 \mid X=x), \ldots, q(j_k \mid X=x)$ are all greater than some tolerance $\varepsilon$. \\ \textit{Method 2:} More robustly, the quantity $\mathbb E_{X\sim p(X\mid J=j_0)} p(J=j_1 \mid X)$ is a measure of how much chart $j_0$ is contained in $j_1$. We may then take \[ u_{j_0j_1} = \frac{1}{2} \left(\mathbb E_{X \sim p(X \mid J=j_0)} p(J = j_1 \mid X) + \mathbb E_{X \sim p(X \mid J=j_1)} p(J = j_0 \mid X) \right) \] as a measure of how much charts $j_0$ and $j_1$ overlap. Using $q(J\mid X)$ and the sample distribution on $X$, this is approximated as \begin{equation} u_{j_0j_1} \approx \frac{1}{2}\left( \frac{1}{\sum_i q(j_0 \mid x_i)} + \frac{1}{\sum_i q(j_1 \mid x_i)} \right) \sum_{i=1}^N q(j_0 \mid x_i) q(j_1 \mid x_i). \label{doubleoverlap} \end{equation} Then we consider $U_{j_0}$ and $U_{j_1}$ to overlap if $u_{j_0 j_1} > \varepsilon$. In general, we bootstrap this to higher degree intersections as follows. Suppose all of the $\ell$-fold intersections between sets from $\{U_{j_0}, \ldots, U_{j_\ell}\}$ are deemed to be nonempty. Then we normalize the function $p(x \mid J=j_{r_1}) \cdots p(x \mid J = j_{r_\ell})$, which we denote by $p_{j_{r_1}\cdots j_{r_\ell}}(x)$, to serve as a proxy for the pdf on $U_{j_{r_1}} \cap \cdots \cap U_{j_{r_\ell}}$ and use \begin{align*} u_{j_0\cdots j_\ell} &= \frac{1}{\ell+1} \sum_{k=0}^\ell \mathbb E_{X \sim p_{j_0\cdots \widehat{j_k} \cdots j_{\ell}}(X)} p(J = j_k \mid X) \\ &\approx \frac{1}{\ell + 1} \sum_{k=0}^\ell \left( \frac{1}{\sum_i q(j_0 \mid x_i) \cdots \widehat{q(j_k \mid x_i)} \cdots q(j_\ell \mid x_i) }\right) \sum_{i=1}^N q(j_0 \mid x_i) \cdots q(j_\ell \mid x_i) \end{align*} as a measure for how much $U_0, \ldots, U_\ell$ overlap, where $\hat{~}$ denotes omission. Using either method, for any value of $\varepsilon \in (0,1)$ we get a simplicial complex and we can study the homology of these complexes as $\varepsilon$ varies. This is very similar, and motivated by, the construction of barcodes in persistent homology \cite{TDA}. As an example, we consider the real-projective plane, $\mathbb{R} P^2 := S^2 / (x \sim -x)$, which has a non-trivial first homology group $H_1(\mathbb{R} P^2; \mathbb Z) = \mathbb Z/2$. We fit an atlas using $d=2$ and $k=8$ by embedding $\mathbb{R} P^2$ into $\mathbb{R}^4$ via the map \[ \mathbb{R}^3 \supset S^2 \to \mathbb{R}^4, ~~ (x,y,z) \mapsto (x^2 - y^2, xy, xz, yz) \] and sampling 10,000 points uniformly. Figure \ref{RP2-oneskel} shows how the homology varies over $\log \varepsilon$. \begin{figure} \centering \captionsetup{width=.85\linewidth} \includegraphics[scale=.4]{barcode_final_simple_method.png} \includegraphics[scale=.4]{barcode_final_soph_method.png} \includegraphics[scale=1]{RP2_oneskel.pdf} \caption{Plots of $H_1$ vs. $\log\varepsilon$ for the two methods discussed (left is method 1, right is method 2) and a sample one-skeleton for method 1 with $\log \varepsilon = -5$. For the blue points $H_1 \simeq \mathbb Z/2$ while for the red points $H_1 \simeq \mathbb Z^{factor}$.} \label{RP2-oneskel} \end{figure} \pagebreak \subsection{MNIST} We apply our techniques to the MNIST dataset, consisting of 70,000 28x28 pixel images, and consider both cases of non-linear and linear encoders. With non-linear encoders we achieved good results using 15 charts, while for linear encoders we found that 40-120 charts were needed. In figures \ref{reconstructions} and \ref{generated-images} are examples of reconstructions and generated images, obtained by sampling $j$ uniformly from $\{1,\ldots, k\}$ and then applying $\phi_j$ to a uniform sample from $(-1,1)^d$. \begin{figure} \centering \includegraphics[scale=.25]{non_linear290020dfe_rec.png} \includegraphics[scale=.25]{linear_network2_c546d7c3_rec.png} \caption{Reconstructions. Odd rows are actual datapoints and even rows are their reconstructions. The left image comes from an atlas with $d=11$, 15 charts, and non-linear encoders. The right image comes from an atlas with $d=12$, 40 charts, and linear encoders.} \label{reconstructions} \end{figure} \begin{figure} \centering \includegraphics[scale=.25]{non_linear290020dfe_gen.png} \includegraphics[scale=.25]{linear_network2_c546d7c3_gen.png} \caption{Generated images. The left image comes from an atlas with $d=11$, 15 charts, and non-linear encoders. The right image comes from an atlas with $d=12$, 40 charts, and linear encoders.} \label{generated-images} \end{figure} We also look at visualizations of the one-skeletons (figures \ref{oneskel-d11} and \ref{oneskel-d2}). For $d > 2$ we uniformly draw 64 samples from each latent chart $(-1,1)^d$ and apply the decoders to generate images. For $d=2$ we do a similar thing except instead of generating from random samples we apply each chart's decoder to the set $\{0, 1/8, \ldots, 7/8\} \times \{0, 1/8, \ldots, 7/8\}$. We weigh each of the double overlaps using (\ref{doubleoverlap}) and draw the corresponding edges for the top third, with thickness proportional to $u_{j_0j_1}$. \begin{figure} \centering \includegraphics[scale=.3]{290020dfe.pdf} \caption{Generated images from each of the 15 charts for an atlas with $d=11$. An edge denotes overlap and thicker lines correspond to more substantial overlap.} \label{oneskel-d11} \end{figure} \begin{figure} \centering \includegraphics[scale=.3]{7ed3fabd.png} \caption{Generated images from each of the 15 charts for an atlas with $d=2$ (latent points were chosen evenly across an $8\times8$ grid). An edge denotes overlap and thicker lines correspond to more substantial overlap.} \label{oneskel-d2} \end{figure} \pagebreak \bibliographystyle{plain}
{'timestamp': '2018-03-02T02:05:20', 'yymm': '1803', 'arxiv_id': '1803.00156', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00156'}
arxiv
\section*{Supplementary Material} The accompanying video and dataset is available at \url{prg.cs.umd.edu/SalientDSO.html}. \section{Introduction and Philosophy} Simultaneous Localization and Mapping (SLAM) and Visual Odometry (VO) algorithms have taken center stage in the recent years due to their wide-spread usage. They play a prominent part in the perception and planning pipelines of self-driving cars, autonomous quadrotors, augmented and virtual reality. The never ending quest to come up with realtime solutions for these methods whilst being as accurate as their offline counterparts has led to alternative problem formulations in terms of constraints and optimization methods \cite{monoslam, PTAM, DTAM, LSDSLAM}. Not so long ago, the field was dominated by indirect methods \cite{monoslam, PTAM, ORBSLAM, stuhmer2010real} which rely on feature matching and foundations of multi-view geometry coupled with windowed optimization to build a map of the scene and obtain accurate poses. These approaches are based on the low-level geometric features and do not work very well with environments with repeating structures and texture-less surfaces. Some works have improved upon the previous approaches in-terms of speed and accuracy by incorporating prior knowledge such as the dynamics of the system and/or data from more sensors such as inertial measurement units \cite{ROVIO}, time-of-flight sensors \cite{RGBDSLAM} etc. However, minimalism is a trend forward, i.e., trying to achieve the same tasks with a minimal number of sensors. In the scope of this paper, we focus on a monocular VO solution. The current state-of-the-art in monocular approaches which have the best compromise of speed and accuracy are direct sparse approaches such as Direct Sparse Odometry (DSO)\cite{DSO}. However, object centric SLAM approaches are more robust by nature due to the high level semantics used in the formulation. Lately, joint optimization of 3D poses, stucture and labelled object locations has improved the state-of-the-art significantly. These frameworks rely on the widely successful deep learning based object recognition engine and pose graph optimization frameworks, combining both low-level geometric features and the high-level semantics. However, humans perform the task of mapping very differently. The human visual system interprets the scene for various tasks like recognition, segmentation, tracking and navigation by making a series of fixations \cite{YiannisFixation}. This is called the Active approach \cite{ActiveVision, SukhtameActive, BajcsyActive}, whilst the traditional approach is called the Passive approach (See Table \ref{tab:ActiveVsPassive}). These fixations lie in the proto-segmentation of the salient objects/locations in the scene. The word proto-segmentation refers to the fact that a segmentation around the fixation point may lead to partial/complete segmentation of an object, which depends on the scenario. Solving the problem of recognition and tracking along with segmentation is like a chicken-egg problem. One would need a good segmentation for recognition and tracking and vice-versa. An Expectation-Maximization (EM) type of scheme, where one would jointly/alternatively optimize for the segmentation and recognition/tracking has gained popularity in literature lately, due to the advancement of fast and accurate optimization frameworks. \begin{table}[t!] \centering \caption{Active vs Passive approach for computer vision tasks.} \resizebox{\columnwidth}{!}{ \label{tab:ActiveVsPassive} \begin{tabular}{p{0.2\columnwidth}p{0.4\columnwidth}p{0.4\columnwidth}} \toprule Task & Passive approach & Active approach \\ \hline \\ Segmentation & Graph cut or super-pixel based methods. & Fixation based region segmentation and recognition in a feedback loop. \\ Recognition & Sliding window of filter banks with a classification algorithm for final prediction. & Saliency/fixation based segmentation/clustering followed by selection of attributes and sliding window of filters with a simple classification algorithm.\\ Tracking and Failure recovery & Making an online dictionary for robustness against changes and use detection for failure recovery. & Tightly couple saliency into the tracking filter to reduce search space and use salient regions for failure recovery. By doing so, we introduce high level semantics into the low level processes (feedback).\\ Navigation and Mapping & Map based on features based on image gradients. & Map only using salient region features or objects obtained using fixation based segmentation. Take advantage of the semantic relationships between differently labeled regions.\\ \bottomrule \end{tabular}} \end{table} Very recently, this philosophy of fixation and attention has started to gain popularity in the robot navigation community \cite{SemanticSLAM, KostasSemanticSLAM, an2017semantic, alexis}. This is based on the fact that humans perform the task of mapping very differently from how it has been done in the robotics literature. They build ``sematic/toplogical'' maps to traverse the scene. This paper combines the concepts used by humans and robotics literature to present a framework of indoor visual odometry in which the features are selected based on a visual saliency map that is obtained by human eye tracking data. This work aims to mimic the qualitative human vision in the framework of direct VO. The key contributions of this paper are: \begin{itemize} \item We present a framework of indoor visual odometry in which the features are selected based on a visual saliency map (Sample output is shown in Fig. \ref{fig:Overview}). \item We present a method to filter saliency map based on scene parsing. \item We provide experimental results on various simulated and real indoor environments to demonstrate the improved performance of the proposed approach with comparisons to the state-of-the-art. \end{itemize} The rest of the paper is organized as follows: Sec. \ref{sec:SalientDSO} presents the different parts of the proposed SalientDSO framework along with the preliminaries required. Sec. \ref{sec:PointSel} describes the visual saliency and scene parsing driven point selection algorithm used in SalientDSO. Detailed experiments along with quantitative and qualitative results are given in Sec. \ref{sec:results}. We finally conclude the paper in Sec. \ref{sec:Conc} with parting thoughts on future work. \section{SalientDSO Framework} \label{sec:SalientDSO} SalientDSO's framework is composed of a pre-processing step and a VO backbone. The VO backbone is responsible for initializing and tracking camera pose and optimizing all model parameters. The pre-processing step involves the saliency prediction and scene parsing using deep Convolutional Neural Networks (CNNs) and later using these outputs to select features/points. Fig. \ref{fig:FlowChart} shows the algorithmic overview of SalientDSO, where blue parts of the figure show our contributions (which constitute the pre-processing step). Each component of SalientDSO is discussed in detail next.\\ \begin{figure}[t!] \centering \includegraphics[width=\columnwidth]{Images/FlowChart-eps-converted-to.pdf} \caption{Algorithmic overview of SalientDSO, blue parts show our contributions.} \label{fig:FlowChart} \end{figure} \subsection{Visual Odometry Backbone} We adopt DSO \cite{DSO} as the backbone VO in SalientDSO. In brief, DSO\cite{DSO} proposed a direct sparse model to jointly optimize all parameters (camera intrinsics, camera extrinsics, and inverse-depth values for feature points) and perform windowed bundle adjustment. It contains a front end for frames/points selection and initialization, and a back end for optimization. In the proposed framework, points selection is replaced with our proposed method in Sec.\ref{sec:points}. The front-end and back-end are detailed next.\\ \subsubsection{Front-end} The front-end part of algorithm handles the following: \textbf{Initial Frame Tracking:} A new frame is tracked with respect to the latest KeyFrame (KF) by using the conventional two-frame direct image alignment, a multi-scale image pyramid and a constant motion model. If tracking fails, SalientDSO attempts to recover the motion by trying 27 different small rotations. \textbf{Keyframe Creation:} Similar to ORB-SLAM\cite{ORBSLAM}, SalientDSO initially takes many keyframes (around 5-10 keyframes per second), and then sparsifies them by early marginalization of the redundant KFs. SalientDSO uses the following three rules to decide if a new KF is needed: mean square optical flow $\left({f_t}: = \left( {\tfrac{1}{n}\sum_{i = 1}^n {{{\left\| {p - {p_t}'} \right\|}^2}} } \right)^{0.5}\right)$, mean flow without rotation $\left( f: = \left( {\tfrac{1}{n}\sum_{i = 1}^n {{{\left\| {p - p'} \right\|}^2}} } \right)^{0.5}\right)$ and relative brightness factor $\left( \alpha : = \left| {\log \left( {{e^{{a_j} - {a_i}}}{t_j}t_i^{ - 1}} \right)} \right|\right)$. A new KF is chosen when $ w_f f + w_{f_t} f_t + w_a a > T_{\text{kf}}$. Here the symbols have the same meaning as in \cite{DSO}. \textbf{Candidate point tracking:} Candidate points are selected using the approach described in Sec.\ref{sec:points}. These points are then tracked using discrete search along epipolar line and minimizing the photometric error $E_{\text{photo}}$ given by Eq. \ref{eq:error}. The computed depth and co-variance is used to constrain the search interval for the subsequent frame as described in \cite{LSD_SLAM}. \textbf{Outlier rejection and occlusion detection:} Point observations which have a $E_{\text{photo}}$ above a certain threshold are removed as outliers and excluded for further computation. \textbf{Parameters initialization:} This step provides the initial estimates of all parameters for optimizing the non convex error $E_{\text{photo}}$. The initial camera pose is computed from direct image alignment and the initial point's depth is from candidate point tracking. \textbf{Candidate point activation:} New candidates points replace the old marginalized points. The new points are chosen by projecting onto the current frame and maximizing the distance between projection of any existing active points. \textbf{Marginalization:} This step decides which points and frames should be marginalized. A KF will be marginalized if less than $5\%$ of points are visible in the latest frame. If there are more than $N_{f}$ (fixed at $7$) KFs, a KF which is far from current frame and close to any other KFs will be marginalized.\\ \subsubsection{Back-end} The back end contains a factor graph which performs continuous windowed optimization using the approach given in \cite{windowed_optimization}. It optimizes $E_{\text{photo}}$ using Gaussian-Newton algorithm in a sliding window manner. The error functions are defined as the following: For a single active point $p$, its photometric error on KF $j$ is defined as: \begin{equation} E_{pj} = \sum_{p \in N_{p}} w_{p}\left \| (I_{j}[p'] - b_{j}) - \frac{t_{j}e^{a_{j}}}{t_{i}e^{a_{i}}}(I_{i}([p] - b_{i}) \right \|_{\gamma} \end{equation} where $p'$ is the projection of point $p$ on KF $j$, $\left\{t_{i}, t_{j}\right\}$ are the exposure time for images $\left\{I_{i}, I_{j}\right\}$, $\left \| \right \|_\gamma$ is the Huber norm, $a_{i}, a_{j}, b_{i}, b_{j}$ are brightness transfer function parameters, $N_{p}$ is the residual pattern with eight surrounding neighbors and gradient depending weights $w_{p}$ is given by \begin{equation} w_{p} = \frac{c^{2}}{c^{2} + \left \| \bigtriangledown I_{i}(p) \right \|_{2}^{2}} \end{equation} The full photometric error over all active points and KFs is defined as \begin{equation} E_{\text{photo}} = \sum_{i \in F} \sum_{p \in P_{i}} \sum_{j \in obs(p)} E_{pj} \label{eq:error} \end{equation} where $F$ indicates all active KFs, $P_{i}$ indicates all active points in KF $i$, $obs(p)$ indicates all frames' observation in which point $p$ is visible.\\ \section{Point selection based on visual saliency and scene parsing} \label{sec:PointSel} \subsection{Visual Saliency Prediction} Visual saliency is defined as the amount of attention a human would give to each pixel in an image. This is quantitatively measured as the average time a person's gaze rests on each pixel in the image. Prediction of saliency is a hard problem and data driven approaches have lately excelled at this task. We adopt SalGAN \cite{SalGAN} for saliency prediction in SalientDSO. In brief, SalGAN introduced the use of Generative Adversarial Network (GAN)\cite{GAN} for saliency prediction. It contains a generator and a discriminator. The generator is a deep CNN trained on adversarial loss ($L_{GAN}$ in Eq. \ref{eq:adv_loss}), which includes Binary Cross-Entropy loss ($L_{BCE}$ in Eq. \ref{eq:BCE}) to produce a down-sampled saliency map, and the discriminator is a shallower network as compared to the generator, this is trained to solve binary classification between saliency map produced by generator and the groundtruth. The generator is an encoder-decoder type of network, in which the encoder part is identical to VGG-16\cite{VGG16} and its weights are initialized with the weights trained on the ImageNet dataset\cite{ImageNet}. The discriminator's weights are randomly initialized. The whole network is trained on the SALICON dataset\cite{SALICON}. The adversarial loss is defined as: \begin{equation} L_{GAN} = \alpha \cdot L_{BCE} - logD(I, \hat{S}) \label{eq:adv_loss} \end{equation} where $D(I, \hat{S})$ is the probability of fooling the discriminator. Also, the binary cross-entropy loss between the predicted saliency map $\hat{S}$ and the ground-truth $S$ is defined as: \begin{equation} L_{BCE} = - \frac{1}{N} \sum_{j = 1}^{N} S_{j}log(\hat{S_{j}}) + (1 - S_{j})log(1 - \hat{S_{j}}) \label{eq:BCE} \end{equation} where $S_{j}$ is the probability of pixel $I_{j}$ being fixated. Some sample results are shown in Fig. \ref{fig:Saliency}. One can clearly notice that walls, floors, and ceilings have lower probability of being fixated on, which is the main idea of the proposed framework. \begin{figure}[t!] \centering \includegraphics[width=\columnwidth]{Images/Saliency-eps-converted-to.pdf} \caption{Left column: Input image, Right column: Saliency overlayed on input image.} \label{fig:Saliency} \end{figure} \subsection{Filtering saliency using semantic information} The saliency produced by SalGAN is concentrated around a fixation point inside the object and is fuzzy. Moreover, the saliency map is not very robust to viewpoint and illumination changes as the fixation point does not remain constant. In this subsection, we utilize semantic information to filter the saliency. The idea is to weigh down the saliency of uninformative regions, such as walls, ceilings and floors. To obtain semantic information from a scene, we adopt Pyramid Scene Parsing \cite{PSP} for retrieving semantic labels of every pixel in an image. In brief, Pyramid Scene Parsing (PSPNet) is a deep neural network for pixel-level prediction tasks. PSPNet uses CNN layers to extract features, then a pyramid parsing module is applied to harvest different sub-region representation, followed by up-sampling and concatenation layers to form the final feature representation. The final features are then fed into more CNN layers to obtain a pixel-level prediction. Once the per-pixel semantic information $C$ is obtained, the predicted saliency map $\hat{S}$ is filtered by: \begin{equation} \hat{S}^{\text{weighted}}_{j} = w_{C}(C_{j})\hat{S}_{j} \end{equation} Here, $w_{C}$ are the predefined weights obtained empirically for different classes. To smooth and maintain a consistent saliency map for each class, each pixel is replaced by the median of saliency for its respective class: \begin{equation} \hat{S}^{\text{final}}_{j} = \text{median}\left \{ \hat{S}^{\text{weighted}}_{i}, \forall i \in C_{j} \right \} \end{equation} All steps to generate $\hat{S}^{\text{final}}$ are summarized in Algorithm \ref{alg:saliency}. \begin{algorithm}[t!] \KwData{Input image $I$, Pre-defined weights $w_{C}$} \KwResult{Predicted final saliency $\hat{S}^{\text{final}}$} $\hat{S}$ = SalGAN($I$)\; $C$ = PSPNet($I$)\; \For{ $\forall \left\{ x_j, y_j\right\} \in I$} { $\hat{S}^{\text{weighted}}_{j} = w_{C}(C_{j})\hat{S}_{j}$\; } \For{$\forall \left\{ x_j, y_j\right\} \in I$} { $\hat{S}^{\text{final}}_{j} = \text{median}\left \{ \hat{S}^{\text{weighted}}_{i}, \forall i \in C_{j} \right \}$\; } \caption{Saliency prediction and filtering.} \label{alg:saliency} \end{algorithm} \begin{algorithm}[t!] \KwData{Desired number of points $N_{\text{des}}, s_{\text{smooth}}, \hat{S}^{\text{final}}$} \KwResult{Selected points} Initialize selected point set as $\left\{ \emptyset\right\}$, $N_{\text{sel}} = 0$\; \While{$N_{\text{sel}} < N_{\text{des}}$}{ Randomly select a patch $M$ from distribution $P_{S}$\; Split $M$ into $d \times d$ blocks\; \For{each $4d \times 4d$ block}{ \For{each $2d \times 2d$ block}{ \For{each $d \times d$ block}{ Select a point with the highest gradient which surpass the gradient threshold\; } \If{no selected point in this block}{ Select a point with the highest gradient which surpass the weaker gradient threshold\; } } \If{no selected point in this block}{ Select a point with the highest gradient which surpass the much weaker gradient threshold\; } } $N_{\text{sel}} = N_{\text{sel}}\ +$ the number of selected points\; } \caption{Saliency based points selection.} \label{alg:selection} \end{algorithm} \subsection{Features/Points selection} \label{sec:points} Instead of uniformly selecting candidate points from an image as in DSO, we select points based on saliency. This is very helpful where the scene has a lot of objects or clutter which can be found generally in indoor scenes. First, we split an image into $K \times K$ patches. For a patch $M_{i}$, we not only compute the median of gradient as a region-adaptive threshold, but also compute the median of saliency as a region-adaptive sampling weight $sw_{i}$. Therefore, for each patch, the sampling weight $sw_{i}$ is computed as: \begin{equation} sw_{i} = \text{median}\left \{ \hat{S}^{\text{final}}_{j}, \forall j \in M_{i} \right \} + s_{\text{smooth}} \end{equation} where $s_{\text{smooth}}$ is a laplacian smoothing term used to control the bias on a salient region and the probability of a patch $M_{i}$ being sampled is: \begin{equation} \boldsymbol{P}_{S}(M_{i}) = \frac{sw_{i}}{\sum_{m \in M} sw_{m}} \end{equation} Secondly, once a patch $M_{i}$ has been selected, we further split $M_{i}$ into $d \times d$ blocks. For each block, we select the pixel with the highest gradient only if it surpasses the region-adaptive threshold. With this strategy, we can select points which are well distributed in this salient region. In order to extract information from where no high-gradient pixels are present, we follow the same approach as DSO and run two more passes to select pixels with weaker gradient in a larger sub-region with a lower gradient threshold and an increased $d$. A summary of the whole selection method is given in Algorithm \ref{alg:selection}. Fig. \ref{fig:ICLL0Selection} shows the selected points for some example scenes. We compare our selection based on saliency to the uniform selection adopted by DSO. One can easily notice that texture-less and mostly identical parts, such as walls, floors and ceilings, are down weighted in our pipeline. As demonstrated in Section \ref{sec:results}, this helps us trade the weak features on the floors and ceilings for weak features on objects where the saliency is generally higher - thus, in-turn, making the feature selection more robust and object-centric. \begin{figure}[t!] \centering \includegraphics[width=\columnwidth]{Images/ICLL0Selection-eps-converted-to.pdf} \caption{Point selection using different schemes. Top rows in (a) and (b), left to right: features selected using DSO's scheme, saliency only, saliency+scene parsing. Bottom rows in (a) and (b), left to right: input image, saliency, scene parsing output. Notice how using saliency+scene parsing removed all non-informative features.} \label{fig:ICLL0Selection} \end{figure} \section{Experimental Results and Analysis} \label{sec:results} In this section, we comprehensively evaluate SalientDSO on various datasets. \begin{itemize} \item \textbf{ICL-NUIM dataset}\cite{ICL_NUIM}: This dataset provides two scenes and four different trajectories for each scene which are obtained by running Kintinuous on real image data and finally used in a synthetic framework for obtaining ground-truth. \item \textbf{TUM monoVO dataset}\cite{TUM}: This dataset provides 50 sequences comprising over 100 minutes videos. It ranges from indoor corridors to wide outdoor scenes. In our experiments, we only evaluate all methods on indoor sequences $\left\{\text{sequence\_}(1 - 18, 26, 28, 35 - 38, 40)\right\}$. Only the indoor sequences are chosen because the usage of saliency obtained by human gaze is meaningful only for indoor cluttered scenes. \item \textbf{CVL dataset}: This dataset was collected by the authors of this paper is available at \url{prg.cs.umd.edu/SalientDSO.html}. The data was collected using a Parrot$^\text{\textregistered}$ SLAMDunk \cite{SLAMDunk} sensor suite. The data from the left camera is used in the experiments. \end{itemize} Different parameters used for running the experiments are shown in Table. \ref{table:Parameters}. For ICL-NUIM dataset, photometric correction is not required. To comprehensively evaluate the proposed method, we run each sequence in both forward and backward direction 10 times. \begin{table}[t!] \centering \caption{Parameter settings for different datasets.} \label{table:Parameters} \begin{tabular}{llll} \hline & TUM & ICL-NUIM & CVL \\ \hline Num of active keyframes $N_{f}$ & 7 & 7 & 7 \\ Num of active points $N_{p}$ & 2000 & 2000 & 1200 \\ Global gradient constant $g_{th}$ & 7 & 3 & 7 \\ Patch size $K$ & 8 & 8 & 8 \\ Photometric correction & Yes & Not required & Not available \\ \hline \end{tabular} \end{table} \subsection{Quantitative Evaluation} Fig. \ref{fig:ICL_err} shows the absolute trajectory Root Mean Square Error (RMSE$_{\text{ate}}$) on ICL-NUIM dataset. Using visual saliency driven features, SalientDSO performs better in accuracy as compared to DSO. We also report alignment error $e_{\text{align}}$ on TUM monoVO dataset in Fig. \ref{fig:TUM_err}. We disable the semantic filtering when we evaluate the proposed method on the TUM monoVO dataset, since this dataset provides only grayscale images and outputs from PSPNet are inaccurate and noisy for grayscale images. In Tables \ref{table:ErrICL} and \ref{table:ErrTUM}, we compare our method to DSO and ORB-SLAM on the ICL-NUIM and TUM monoVO datasets. DSO and ORB-SLAM are the current state-of-the-art direct and feature-based monocular VO methods. The results for DSO and ORB-SLAM are taken from \cite{DSO}. ORB-SLAM is a full-fledged SLAM framework with loop closure and global alignment, while DSO and SalientDSO are merely odometry frameworks. To make the comparison fair, loop-closure detection and re-localization have been turned off for ORM-SLAM. The missing values in the table represent tracking failures. We achieve similar or better performance on most sequences. The improvement is not significant on the TUM monoVO dataset because most of the sequences involve a traversal through a hallway where there are no local salient objects or features for saliency prediction to work well. This makes SalientDSO's performance close to that of traditional DSO. \begin{figure}[t!] \centering \includegraphics[width=\columnwidth]{Images/ICLError-eps-converted-to.pdf} \caption{Comparison of evaluation results for ICL-NIUM dataset. Left: DSO, Right: SalientDSO. Each square correspondes to a color coded error. Note that Salient DSO almost always has lower error than it's DSO counterpart.} \label{fig:ICL_err} \end{figure} \begin{figure}[t!] \centering \includegraphics[width=\columnwidth]{Images/TUMErrorNew-eps-converted-to.pdf} \caption{Comparison of evaluation results for TUM dataset. Left: DSO, Right: SalientDSO. Note that Salient DSO almost always has lower error than it's DSO counterpart. Note that, for the TUM dataset scene parsing was turned off as TUM dataset only provoides grayscale images and scene parsing outputs are very noisy for grayscale images.} \label{fig:TUM_err} \end{figure} \begin{table}[] \centering \caption{RMSE$_{\text{ate}}$ on ICL-NIUM dataset in m.} \label{table:ErrICL} \resizebox{\columnwidth}{!}{ \begin{tabular}{lllllll} \toprule & \multicolumn{3}{c}{Forward} & \multicolumn{3}{c}{Backward} \\ Sequence & ORB & DSO & SalientDSO & ORB & DSO & SalientDSO \\ \hline ICL\_l0 & 0.01 & \textbf{0.003} & 0.022 & \textbf{0.01} & - & 0.112 \\ ICL\_l1 & 0.02 & \textbf{0.004} & 0.009 & 0.04 & 0.003 & \textbf{0.003} \\ ICL\_l2 & 0.06 & 0.012 & \textbf{0.004} & 0.19 & 0.010 & \textbf{0.005} \\ ICL\_l3 & 0.03 & 0.006 & \textbf{0.004} & 0.05 & \textbf{0.008} & 0.013 \\ ICL\_o0 & 0.21 & 0.320 & \textbf{0.140} & 0.41 & 0.399 & \textbf{0.336} \\ ICL\_o1 & 0.83 & 0.094 & \textbf{0.055} & 0.68 & \textbf{0.006} & 0.020 \\ ICL\_o2 & 0.37 & 0.012 & \textbf{0.008} & 0.32 & 0.582 & \textbf{0.512} \\ ICL\_o3 & 0.65 & \textbf{0.007} & 0.009 & 0.06 & \textbf{0.006} & 0.008 \\ \hline \textbf{Overall Avg.} & 0.271 & 0.057 & \textbf{0.031} & 0.218 & 0.144$^*$ & \textbf{0.126} \\ \bottomrule \end{tabular}} \\\scriptsize{$^*$ indicates average taken only on sequences which completed.} \end{table} \begin{table}[] \centering \caption{$e_{\text{align}}$ on TUM monoVO dataset in m.} \label{table:ErrTUM} \resizebox{\columnwidth}{!}{ \begin{tabular}{lllllll} \toprule & \multicolumn{3}{c}{Forward} & \multicolumn{3}{c}{Backward} \\ Sequence & ORB & DSO & SalientDSO & ORB & DSO & SalientDSO \\ \hline seq\_01 & 3.02 & \textbf{0.59} & 0.60 & 1.73 & 0.72 & \textbf{0.60} \\ seq\_02 & 16.12 & 0.36 & \textbf{0.33} & 3.23 & \textbf{0.43} & 0.44 \\ seq\_03 & 3.42 & 1.75 & \textbf{1.55} & 1.42 & 0.59 & \textbf{0.50} \\ seq\_04 & 9.95 & 0.98 & \textbf{0.82} & 5.95 & 1.00 & \textbf{0.76} \\ seq\_05 & - & 1.86 & \textbf{1.77} & - & \textbf{1.55} & 1.66 \\ seq\_06 & - & 0.97 & \textbf{0.93} & 1.25 & \textbf{0.73} & 0.81 \\ seq\_07 & 1.69 & \textbf{0.55} & 1.14 & 2.02 & \textbf{0.44} & 0.48 \\ seq\_08 & 436.00 & \textbf{0.36} & 0.44 & 2.63 & \textbf{1.28} & 1.47 \\ seq\_09 & 2.04 & 0.65 & \textbf{0.58} & 0.67 & \textbf{0.52} & 0.53 \\ seq\_10 & 2.52 & 0.35 & \textbf{0.34} & 1.43 & 0.61 & \textbf{0.61} \\ seq\_11 & 7.20 & 0.62 & \textbf{0.58} & 2.99 & \textbf{0.87} & 0.89 \\ seq\_12 & 2.98 & 0.75 & \textbf{0.67} & 3.10 & 1.01 & \textbf{0.84} \\ seq\_13 & 5.13 & 1.54 & \textbf{1.27} & 2.59 & 8.96 & \textbf{0.81} \\ seq\_14 & 13.27 & 2.89 & \textbf{0.71} & 2.10 & \textbf{1.35} & 1.69 \\ seq\_15 & 2.90 & 0.71 & \textbf{0.71} & 1.90 & 0.88 & \textbf{0.81} \\ seq\_16 & 2.40 & 0.47 & \textbf{0.45} & 1.58 & 0.72 & \textbf{0.67} \\ seq\_17 & 12.29 & 2.10 & \textbf{2.10} & \textbf{1.50} & 2.13 & 2.50 \\ seq\_18 & 14.64 & 1.77 & \textbf{1.52} & - & 2.62 & \textbf{2.47} \\ seq\_26 & 28.46 & 3.98 & \textbf{3.60} & 4.62 & \textbf{1.66} & 1.89 \\ seq\_28 & 19.17 & \textbf{1.48} & 1.88 & 3.57 & \textbf{1.47} & 1.65 \\ seq\_35 & 14.09 & 1.10 & \textbf{0.84} & 16.81 & \textbf{5.48} & 9.97 \\ seq\_36 & 1.81 & 4.01 & \textbf{3.25} & 1.69 & \textbf{0.70} & 1.46 \\ seq\_37 & 0.60 & \textbf{0.35} & 0.40 & 1.30 & \textbf{0.37} & 0.46 \\ seq\_38 & - & 0.55 & \textbf{0.50} & 24.77 & 1.10 & \textbf{1.03} \\ seq\_40 & - & \textbf{2.04} & 2.16 & 18.93 & \textbf{0.87} & 1.04 \\ \hline \textbf{Overall Avg.} & 28.55$^*$ & 1.31 & \textbf{1.17} & - & 1.52 & \textbf{1.44} \\ \bottomrule \end{tabular}} \\\scriptsize{$^*$ indicates average taken only on sequences which completed.} \end{table} The claim in the paper is that the usage of visual saliency should result in more robust features than just using image gradient based features as in DSO. The intuition behind this claim is that visual saliency includes high level semantics which inherently make the features more robust. To support this claim, we anticipate that SalientDSO should perform much better than DSO when the number of points is very low (as low as 40 points). To demonstarate this claim, we evaluate on each CVL sequence. We run each sequence in both forward and backward direction 100 times, with an extremely low point density of $N_{p} = 40$. The results are shown in Table. \ref{table:CVL}. We define failure as either an optimization failure or tracking loss. Our proposed method is much more robust and predicts an accurate trajectory, while DSO has a much higher failure rate and its trajectory and projected point cloud shows significant drift in scale and position. An example of trajectory and projected point cloud is shown in Fig. \ref{fig:CVL_N30}. This experiment highlights the robustness of features chosen in SalientDSO for cluttered indoor scenes and how this will be useful for robots with very low computation power due to the less computational and memory requirements when $N_p$ is low. \begin{table}[t!] \centering \caption{Comparison of success rate between DSO and SalientDSO on CVL dataset.} \label{table:CVL} \begin{tabular}{lll} \hline Sequence & DSO & SalientDSO \\ \hline CVL\_01\_Fwd & 53\% & \textbf{65\%} \\ CVL\_01\_Bwd & 59\% & \textbf{92\%} \\ CVL\_02\_Fwd & 73\% & \textbf{96\%} \\ CVL\_02\_Bwd & 71\% & \textbf{91\%} \\\hline \end{tabular} \end{table} \begin{figure}[t!] \centering \includegraphics[width=\columnwidth]{Images/CVLN30-eps-converted-to.pdf} \caption{Comparison of outputs for $N_p=40$ -- very few features. (a) Success case of DSO with a large amount of drift, (b) Success case for SalientDSO, (c) Failure case of DSO where the optimization diverges due to very few features. Notice that SalientDSO can perform very well in these extreme conditions showing the robustness of the features chosen.} \label{fig:CVL_N30} \end{figure} \subsection{Qualitative Evaluation} Examples of the reconstructed scenes of sequences CVL\_01 and TUM $\text{seqence}\_01$ are shown in Figs. \ref{fig:CVL1000Pts} and \ref{fig:TUM} respectively. Although both reconstructed scenes look similar, one could observe that amount of drift in SalientDSO is much less compared to DSO (refer to the zoomed part of Fig. \ref{fig:CVL1000Pts}). One can clearly observe that the checkerboard of different loops align better in our approach. Instead of sampling random high gradient points, sampling salient and important points improves the robustness of VO. Sampling salient points achieves removing outliers and points with unconstrained depth in optimization which improves the prediction of initial estimates and the output of windowed bundle adjustment in optimization. \begin{figure}[t!] \centering \includegraphics[width=\columnwidth]{Images/CVL1000Pts-eps-converted-to.pdf} \caption{Comparison of drift. (a) DSO, (b) SalientDSO. Observe that SalientDSO's output has the checkerboard from different times more closely aligned as compared to DSO. Here $N_p=1000$.} \label{fig:CVL1000Pts} \end{figure} \begin{figure}[t!] \centering \includegraphics[width=\columnwidth]{Images/TUM-eps-converted-to.pdf} \caption{Sample outputs for TUM sequence\_1. (a) DSO, (b) SalientDSO. Here $N_p=1000$.} \label{fig:TUM} \end{figure} \section{Conclusions} \label{sec:Conc} We introduce the philosophy of attention and fixation to visual odometry. Based on this philosophy, we develop Salient Direct Sparse Odometry, which brings the concept of attention and fixation based on visual saliency into Visual Odometry to achieve robust feature selection. We provide thorough quantitative and qualitative evaluations on ICL-NUIM and TUM monoVO dataset to demonstrate that using salient features improves the robustness and accuracy. We also collect and publicly release a new CVL dataset with cluttered scenes for mapping. We show the robustness of our features by very low drift visual odometry with as low as 40 features per frame. Our method takes about a second per frame for computation of saliency and scene parsing on an NVIDIA Titan-Xp GPU and the remaining computations run real-time at 30fps on an Intel$^\text{\textregistered}$ Core i7 6850K 3.6GHz CPU. In the near future, we plan to extend our method to outdoor environment. We also consider to implement our method on hardware to make the complete pipeline real-time. \section*{Acknowledgement} This work was partly funded by the Brin Family Foundation, Northrop Grumman Corporation and National Science Foundation under grant SMA 1540917 and grant CNS 1544797. \bibliographystyle{unsrt
{'timestamp': '2018-03-02T02:04:06', 'yymm': '1803', 'arxiv_id': '1803.00127', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00127'}
arxiv
\section{Introduction} \begin{figure*}[t] \centering \includegraphics[width=0.36\linewidth]{intro_input.pdf} \includegraphics[width=0.63\linewidth]{intro_distance.png} \caption{Illustrating the principle of the dissimilarity-based distribution embedding. We want to discriminate empirical normal distributions in $\mathbb{R}^2$; their discriminative feature being the correlation between the two variables. An example of these normal distributions are given in the left panel. The proposed approach consists in computing a embedding based on the dissimilarity of all these empirical distributions (the blobs) to few of, them that serve as templates. Our theoretical results show that if we take enough templates and there is enough samples in each template then with high-probability, we can learn a linear separator that yields few errors. This is illustrated in the 3 other panels in which we represent each of the original distribution as a point after projection in an discriminant 2D space of the embeddings. From left to right, the dissimilarity embedding respectively considers $10$, $45$ and $90$ templates and we can indeed visualize that using more templates improve separability.} \label{fig:intro} \end{figure*} Most discriminative machine learning algorithms have focused on learning problems where inputs can be represented as feature vectors of fixed dimensions. This is the case of popular algorithms like support vector machines \citep{scholkopf2002learning} or random forest \citep{breiman2001random}. However, there exists several practical situations where it makes more sense to consider input data as set of distributions or empirical distributions instead of a larger collection of single vector. As an example, multiple instance learning \citep{dietterich1997solving} can be seen as learning of a bag of feature vectors and each bag can be interpreted as samples from an underlying unknown distribution. Applications related to political sciences \citep{flaxman2015supported} or astrophysics \cite{ntampaka2015machine} have also considered this learning from distribution point of view for solving some specific machine learning problems. This paper also addresses the problem of learning decision functions that discriminate distributions. Traditional approaches for learning from distributions is to consider reproducing kernel Hilbert spaces (RKHS) and associated kernels on distributions. In this larger context, several kernels on distributions have been proposed in the literature such as the probability product kernel \citep{jebara2004probability}, the Battarachya kernel \citep{bhattacharyya1943measure} or the Hilbertian kernel on probability measures of \citet{hein2005hilbertian}. Another elegant approach for kernel-based distribution learning has been proposedby \citet{muandet2012learning}. It consists in defining an explicit embedding of a distribution as a mean embedding in a RKHS. Interestingly, if the kernel of the RKHS satisfies some mild conditions then all the information about the distribution is preserved by this mean embedding. Then owing to this RKHS embedding, all the machinery associated to kernel machines can be deployed for learning from these (embedded) distributions. By leveraging on the flurry of distances between distributions \citep{sriperumbudur2010non}, it is also possible to build definite positive kernel by considering generalized radial basis function kernels of the form \begin{equation} \label{eq:genrbf} K(\mu,\mu^\prime) = e^{-\sigma d^2(\mu,\mu^\prime)}, \end{equation} where $\mu$ and $\mu^\prime$ are two distributions, $\sigma>0$ a parameter of the kernel and $d(\cdot,\cdot)$ a distance between two distributions satisfying some appropriate properties so as to make $K$ definite positive \citep{haasdonk2004learning}. As we can see, most works in the literature address the question of discriminating distributions by considering either implicit or explicit kernel embeddings. However, is this really necessary? Our observation is that there are many advantages of directly using distances or even dissimilarities between distributions for learning. It would avoid the need for two-stage approaches, computing the distance and then the kernel, as proposed by \citet{poczos2013distribution} for distribution regression or estimating the distribution and computing the kernel as introduced by \citet{sutherland2012kernels}. Using kernels limits the choice of distribution distances as the resulting kernel has to be definite positive. For instance, \citet{poczos2012nonparametric} used Reyni divergences for building generalized RBF kernel that turns out to be non-positive. For the same reason, the celebrated and widely used Kullback-Leibler divergence does not qualify for being used in a kernel. This work aims at showing that learning from distributions with distances or even dissimilarity is indeed possible. Among all available distances on distributions, we focus our analysis on Wasserstein distances which come with several relevant properties, that we will highlight later, compared to other ones (\emph{e.g} Kullback-Leibler divergence). Our contributions, depicted graphically in Figure~\ref{fig:intro}, are the following : (a) We show that by following the underlooked works of \citet{balcan2008theory}, learning to discriminate population distributions with dissimilarity functions comes at no expense. While this might be considered a straightforward extension, we are not aware of any work making this connection. (b) Our key theoretical contribution is to show that Balcan's framework also holds for empirical distributions if the used dissimilarity function is endowed with nice convergence properties of the distance of the empirical distribution to the true ones. (c) While these convergence bounds have already been exhibited for distances such as the Wasserstein distance or MMD, we prove that this is also the case for the Bures-Wasserstein metric.(d) Empirically, we illustrate the benefits of using this Wasserstein-based dissimilarity functions compared to kernel or MMD distances in some simulated and real-world vision problem, including 3D point cloud classification task. \section{Framework} In this section, we introduce the global setting and present the theory of learning with dissimilarity functions of \citet{balcan2008theory}. \subsection{Setting} Define $\mathcal{X}$ as an non-empty subset of $\mathbb{R}^d$ and let $\mathbb{P}$ denotes the set of all probability measures on a measurable space $(\mathcal{X}, \mathcal{A})$, where $\mathcal{A}$ is $\sigma$-algebra of subsets of $\mathcal{X}$. Given a training set $\{\mu_i, y_i \}_{i=1}^n$, where $\mu_i \in \mathbb{P}$ and $y_i \in \{-1,1\}$, drawn \emph{i.i.d} from a probability distribution $P$ on $\mathbb{P} \times \{-1,1\}$, our objective is to learn a decision function $h : \mathbb{P} \mapsto \{-1,1\}$ that predicts the most accurately as possible the label associated to a novel measure $\mu$. In summary, our goal is to learn to classify probability distributions from a supervised setting. While we focus on a binary classification, the framework we consider and analyze can be extended to multi-class classification. \subsection{Dissimilarity function} Most learning algorithms for distributions are based on reproducing kernel Hilbert spaces and leverage on kernel value $k(\mu, \mu^\prime)$ between two distributions where $k(\cdot,\cdot)$ is the kernel of a given RKHS. We depart from this approach and instead, we consider learning algorithms that are built from pairwise dissimilarity measures between distributions. Subsequent definitions and theorems are recalled from \citet{balcan2008theory} and adapted so as to suit our definition of bounded dissimilarity. \begin{defn} A dissimilarity function over $\mathbb{P}$ is any pairwise function $\mathcal{D} : \mathbb{P} \times \mathbb{P} \mapsto [0, M]$. \end{defn} While this definition emcompasses many functions, given two probability distributions $\mu$ and $\mu^\prime$, we expect $\mathcal{D}(\mu,\mu^\prime)$ to be large when the two distributions are ``dissimilar'' and to be equal to $0$ when they are similar. As such any bounded distance over $\mathbb{P}$ fits into our notion of dissimilarity, eventually after rescaling. Note that unbounded distance which is clipped above $M$ also fits this definition of dissimilarity. Now, we introduce the definition that characterizes dissimilarity function that allows one to learn a decision function producing low error for a given learning task. \begin{defn}\cite{balcan2008theory} \label{def:diss} A dissimilarity function $\mathcal{D}$ is a $(\epsilon,\gamma)$-good dissimilarity function for a learning problem $\mathbf{L}$ if there exists a bounded weighting function $w$ over $\mathbb{P}$, with $w(\mu) \in [0,1]$ for all $\mu \in \mathbb{P}$, such that a least $1-\epsilon$ probability mass of distribution examples $\mu$ satisfy : $\mathbf{E}_{\mu^\prime \sim P} [w(\mu^\prime)\mathcal{D}(\mu, \mu^\prime)| \ell(\mu) = \ell(\mu^\prime)] + \gamma \leq \mathbf{E}_{\mu^\prime \sim P} \left[w(\mu^\prime)\mathcal{D}(\mu, \mu^\prime)| \ell(\mu) \neq \ell(\mu^\prime) \right].$ The function $\ell(\mu)$ denotes the true labelling function that maps $\mu$ to its labels $y$. \end{defn} In other words, this definition translates into: a dissimilarity function is ``good'' if with high-probability, the weighted average of the dissimilarity of one distribution to those of the same label is smaller with a margin $\gamma$ to the dissimilarity of distributions from the other class. As stated in a theorem of \citet{balcan2008theory}, such a good dissimilarity function can be used to define an explicit mapping of a distribution into a space. Interestingly, it can be shown that there exists in that space a linear separator that produces low errors. \begin{theorem} \cite{balcan2008theory} if $\mathcal{D}$ is an $(\epsilon,\gamma)$-good dissimilarity function, then if one draws a set $S$ from $\mathbb{P}$ containing $n = (\frac{4M}{\gamma})^2 \log(\frac{2}{\delta})$ positive examples $S^+ = \{\nu_1, \cdots, \nu_n\}$ and $ n$ negative examples $S^- = \{\zeta_1, \cdots, \zeta_n\}$, then with probability $1 - \delta$, the mapping $\rho_S : \mathbb{P} \mapsto \mathbb{R}^{2n}$ defined as $\rho_S(\mu) = (\mathcal{D}(\mu, \nu_1 ), \cdots, \mathcal{D}(\mu, \nu_n), \mathcal{D}(\mu, \zeta_1 ), \cdots, \mathcal{D}(\mu, \zeta_n ) )$ has the property that the induced distribution $\rho_S(\mathbb{P})$ in $\mathbb{R}^{2n}$ has a separator of error at most $\epsilon + \delta$ at margin at least $\gamma/4$. \label{th:main} \end{theorem} The above described framework shows that under some mild conditions on a dissimilarity function and if we consider population distributions, then we can benefit from the mapping $\rho_S$. However, in practice, we do have access only to empirical version of these distributions. Our key theoretical contribution in Section \ref{sec:empirical} proves that if the number of distributions $n$ is large enough and enough samples are obtained from each of these distributions, then this framework is applicable with theoretical guarantees to empirical distributions. \section{Learning with empirical distributions} \label{sec:empirical} In what follows, we formally show under which conditions an $(\epsilon,\gamma)$-good dissimilarity function for some learning problems, applied to empirical distributions also produces a mapping inducing low-error linear separator. Suppose that we have at our disposal a dataset composed of $\{\mu_i, y_i =1\}_{i=1}^{n}$ where each $\mu_i$ is a distribution. However, each $\mu_i$ is not observed directly but instead we observe it empirical version $\hat \mu_i = \frac{1}{N_i}\sum_{j=1}^{N_i} \delta_{\mathbf{x}_{i,j}} $ with $\mathbf{x}_{i,1}, \mathbf{x}_{i,2}, \cdots \mathbf{x}_{i,N_i} \stackrel{i.i.d}{\sim} \mu_i$. For a sake of simplicity, we assume in the sequel that the number of samples for all distributions are equal to $N$. Suppose that we consider a dissimilarity $\mathcal{D}$ and that there exist a function $g_1$ such that $\mathcal{D}$ satisfies a property of the form $\mathbf{P}\Big(\mathcal{D}(\mu,\hat \mu)>\epsilon\Big)\leq g_1(K,N,\epsilon,d)$ then following theorem holds: \begin{theorem} \label{th:main2} For a given learning problem, if the dissimilarity $\mathcal{D}$ is an $(\epsilon,\gamma)$-good dissimilarity function on population distributions, with $w(\mu) =1,\,\,\forall \mu$ and $K$ a parameter depending on this dissimilarity then, for a parameter $\lambda \in (0,1)$, if one draws a set $S$ from $\mathbb{P}$ containing $ n = \frac{32M^2}{\gamma^2} \log(\frac{2}{\delta^2 (1 - \lambda)})$ positive examples $S^+ = \{\nu_1, \cdots, \nu_n\}$ and $ n$ negative examples $S^- = \{\zeta_1, \cdots, \zeta_n\}$, and from each distribution $\nu_i$ or $\zeta_i$, one draws $N$ samples so that $\delta^2 \lambda \geq N g_1(K,N,\frac{\epsilon}{4},d)$ samples so as to build empirical distributions $\{\hat \nu_i\}$ or $\{\hat \zeta_i\}$, then with probability $1 - \delta$, the mapping $ \hat \rho_S : \mathbb{P} \mapsto \mathbb{R}^{2n}$ defined as { $$\hat \rho_S(\hat \mu) = \frac{1}{M} (\mathcal{D}( \hat \mu, \hat \nu_1 ), \cdots, \mathcal{D}(\hat \mu, \hat \nu_n), \mathcal{D}(\hat \mu, \hat \zeta_1 ), \cdots, \mathcal{D}(\hat \mu, \hat \zeta_n ) )$$} has the property that the induced distribution $\rho_S(\mathbb{P})$ in $\mathbb{R}^{2n}$ has a separator of error at most $\epsilon + \delta$ and margin at least $\gamma/4$. \end{theorem} Let us point out some relevant insights from this theorem. At first, due to the use of empirical distributions instead of population one, the sample complexity of the learning problem increases for achieving similar error as in Theorem \ref{th:main}. Secondly, note that $\lambda$ has a trade-off role on the number $n$ of samples $\nu_i$ and $\zeta_i$ and the number of observations per distribution. Hence, for a fixed error $\epsilon + \delta$ at margin $\gamma/4$, having less samples per distribution has to be paid by sampling more observations. The proof of Theorem \ref{th:main} has been postponed to the appendix. It takes advantage of the following key technical result on empirical distributions. \begin{lemma} \label{lem:bound} Let $\mathcal{D}$ be a dissimilarity on $\mathbb{P} \times \mathbb{P}$ such that $\mathcal{D}$ is bounded by a constant $M$. Given a distribution $\mu \in \mathbb{P}$ of class $y$ and a set of independent distributions $\left\{\nu_{j}\right\}_{j=1}^n$, randomly drawn from $\mathbb{P}$, which have the same label $y$ and denote as $\hat \mu$ and $\{\hat \nu_i\}$ their empirical version composed of $N$ observations. Let us assume that there exists a function $g_1$ and a constant $K>0$ so that for any $\mu \in \mathbb{P}$, $ \mathbf{P}\Big(\mathcal{D}(\mu,\hat \mu)>\epsilon\Big)\leq g_1(K,N,\epsilon,d) $, with typically $g_1$ tends towards $0$ as $N$ or $\epsilon$ goes to $\infty$. The following concentration inequality holds for any $\epsilon > 0$ : \begin{align}\nonumber \tiny \mathbf{P}&\left ( \left|\frac{1}{n} \sum_{i=1}^n \mathcal{D}(\hat \mu, \hat \nu_i) - \mathbf{E}_{\nu \sim \mathbb{P}}[\mathcal{D}(\mu, \nu) | \ell(\mu) = \ell(\nu) ] \right| > \epsilon \right) ~\\\nonumber &\leq N g_1(K,N, \frac{\epsilon}{4},d) + 2e^{-n \frac{\epsilon^2}{2M^2}}. \end{align} \end{lemma} {This lemma tells us that, with high probability, the mean average of the dissimilarity between an empirical distribution and some other empirical distribution {\em of the same class} does not differ much from the expectation of this dissimilarity measured on population distributions.} Interestingly, the bound on the probability is composed of two terms : the first one is related to the dissimilarity function between a distribution and its empirical version while the second one is due to the empirical version of the expectation (resulting thus from Hoeffding inequality). The detailed proof of this result is given in the supplementary material. Note that in order for the bound to be informative, we expect $g_1$ to have a negative exponential form in $N$. Another version of this lemma is proven in supplementary where the concentration inequality for the dissimilarity is on $|\mathcal{D}(\hat \mu, \hat \nu) - \mathcal{D}(\mu, \nu)|$. From a theoretical point of view, there is only one reason for choosing one $(\epsilon, \gamma)$-good dissimilarity function on population distributions from another. The rationale would be to consider the dissimilarity function with the fastest rate of convergence of the concentration inequality $\text{Pr}(\mathcal{D}(\mu, \hat \mu) > \epsilon)$, as this rate will impact the upper bound in Theorem \ref{th:main}. From a more practical point of view, several factors may motivate the choice of a dissimilarity function~: computational complexity of computing $\mathcal{D}(\hat \mu_i, \hat \mu_j)$, its empirical performance on a learning problem and adaptivity to different learning problems ( \emph{e.g} without the need for carefully adapting its parameters to a new problem.) \section{($\epsilon-\gamma$) Good dissimilarity for distributions} We are interested now in characterizing convergence properties of some dissimilarities (or distance or divergence) on probability distributions so as to make them fit into the framework. Mostly, we will focus our attention on divergences that can be computed in a non-parametric way. \subsection{Optimal transport distances} Based on the theory of optimal transport, these distances offer means to compare data probability distributions. More formally, assume that $\mathcal{X}$ is endowed with a metric $d_\mathcal{X}$. Let $p\in(0,\infty)$, and let $\mu \in \mathbb{P}$ and $\nu \in \mathbb{P}$ be two distributions with finite moments of order p ({\em i.e.} $\int_\mathcal{X} d_\mathcal{X}(x,x_0)^pd\mu(x) < \infty$ for all $x_0$ in $\mathcal{X}$). then, the p-Wasserstein distance is defined as: \begin{equation} W_p(\mu,\nu) = \left(\inf_{\pi \in \Pi(\mu,\nu)} \iint_{\mathcal{X}\times \mathcal{X}} d_\mathcal{X}(x,y)^pd\pi(x,y)\right)^{\frac{1}{p}}. \label{eq:Wasserstein} \end{equation} Here, $\Pi(\mu,\nu)$ is the set of probabilistic couplings $\pi$ on $(\mu,\nu)$. As such, for every Borel subsets $A \subseteq \mathcal{X}$, we have that $\mu(A)=\pi(\mathcal{X}\times A)$ and $\nu(A)=\pi(A\times \mathcal{X})$. We refer to~\citep[Chaper 6]{Villani09} for a complete and mathematically rigorous introduction on the topic. Note when $p=1$, the resulting distance belongs to the family of integral probability metrics \cite{sriperumbudur2010non}. OT has found numerous applications in machine learning domain such as multi-label classification \citep{Frogner15}, domain adaptation~\citep{courty2017} or generative models~\citep{arjovsky17a}. Its efficiency comes from two major factors: {\em i)} it handles empirical data distributions without resorting first to parametric representations of the distributions {\em ii)} the geometry of the underlying space is leveraged through the embedding of the metric $d_\mathcal{X}$. In some very specific cases the solution of the infimum problem is analytic. For instance, in the case of two Gaussians $\mu \sim \mathcal{N}(\mathbf{m}_1, \Sigma_1)$ and $\nu \sim \mathcal{N}(\mathbf{m}_2, \Sigma_2)$ the Wasserstein distance with $d_\mathcal{X}(x,y)=\|x -y\|_2$ reduces to: \begin{equation} W^2_2(\mu,\nu)=||\mathbf{m}_1-\mathbf{m}_2||_2^2 + \mathcal{B}(\Sigma_1,\Sigma_2)^2 \label{eq:W_Gauss} \end{equation} where $\mathbb{B}(,)$ is the so-called Bures metric~\cite{bures1969extension}: \begin{equation} \mathcal{B}(\Sigma_1,\Sigma_2)^2=\text{trace}(\Sigma_1+\Sigma_2 - 2(\Sigma_1^{1/2}\Sigma_2\Sigma_1^{1/2})^{1/2}). \end{equation} {If we make no assumption on the form of the distributions, and distributions are observed through samples, the Wasserstein distance is estimated by solving a discrete version of Equation \ref{eq:Wasserstein} which is a linear programming problem. } One of the necessary condition for this distance to be relevant in our setting is based on non-asymptotic deviation bound of the empirical distribution to the reference one. For our interest, \citet{fournier2015rate} have shown that for distributions with finite moments, the following concentration inequality holds $$\mathbf{P}(W_p(\mu,\hat \mu) > \epsilon) \leq C \exp{(- K N \epsilon^{d/p})}$$ where $C$ and $K$ are constants that can be computed from moments of $\mu$. This bound shows that the Wasserstein distance suffers the dimensionality and as such a Wasserstein distance embedding for distribution learning is not expected to be efficient especially in high-dimension problems. However, a recent work of \citet{weed2017sharp} has also proved that under some hypothesis related to singularity of $\mu$ better convergence rate can be obtained (some being independent of $d$). Interestingly, we demonstrate in what follows that the estimated Wasserstein distance for Gaussians using Bures metric and plugin estimate of $\mathbf{m}$ and $\Sigma$ has a better bound related to the dimension. \begin{lemma} Let $\mu$ be a $d$-dimensional Gaussian distribution and $\hat \mathbf{m}$ and $\hat \Sigma$ the sample mean and covariance estimator of $\mu$ obtained from $N$ samples. Assume that the true covariance matrix of $\mu$ satisfies $\|\Sigma\|_2 \leq C_\Sigma$the random vectors $\mathbf{v}$ used for computing these estimates are so that $\|\mathbf{v}\|^2 \leq C_\mathbf{v}$ and The squared-Wasserstein distance between the empirical and true distribution satisfies the following deviation inequality: \begin{align}\nonumber \small \mathbf{P}(W_2(\mu,\hat \mu)) > \epsilon) &\leq 2d \exp\Bigg(-\frac{-N \epsilon^2/(8d^4)}{C_\mathbf{v} C_\Sigma + 2C_\mathbf{v} \epsilon/(3d^2)} \Bigg) \\\nonumber &~~+ \exp\Bigg(- \Big(\frac{N^{1/2}}{24\sqrt{C_\mathbf{v}}}\epsilon^2 - 1\Big)^{1/2} \Bigg) \nonumber \end{align} \end{lemma} This novel deviation bound for the Gaussian 2-Wasserstein metric tells us that if the empirical data (approximately) follows a high-dimensional Gaussian distribution then it makes more sense to estimate the mean and covariance of the distribution and then to apply Bures-Wasserstein distance rather to apply directly a Wasserstein distance estimation based on the samples. \subsection{Kullback-Leibler divergence and MMD} Two of the most studied and analyzed divergences/distances on probability distribution are the Kullback-Leibler divergence and Maximum Mean Discrepancy. Several works have proposed non-parametric approaches for estimating these distances and have provided theoretical convergence analyses of these estimators. For instance, \citet{nguyen2010estimating} estimate the KL divergence between two distributions by solving a quadratic programming problem which aims a finding a specific function in a RKHS. They also proved that the convergence rate of such estimator in in $\mathcal{O}(N^\frac{1}{2})$. MMD has originally been introduced by \cite{gretton2007kernel} as a mean for comparing two distributions based on a kernel embedding technique. It has been proved to be easily computed in a RKHS. In addition, its empirical version benefits from nice uniform bound. Indeed, given two distribution $\mu$ and $\nu$ and their empirical version based on $N$ samples $\hat \mu$ and $\hat \nu$, the following inequality holds \citep{gretton2012kernel}: $$ \mathbf{P}\Big( \text{MMD}^2(\hat \mu, \hat \nu) - \text{MMD}^2(\mu,\nu) > \epsilon \Big) \leq \exp{ \Big(-\frac{\epsilon^2 N_2 }{8K^2}\Big)} $$ where $N_2 = \lfloor N/2 \rfloor$, $K$ is a bound on $k(\mathbf{x},\mathbf{x}^\prime), \forall \mathbf{x}, \mathbf{x}^\prime$, and $k(\cdot,\cdot)$ is the reproducing kernel of the RKHS in which distributions have been embedded. We can note that this bound is independent of the underlying dimension of the data. Owing to this property we can expect MMD to provide better estimation of distribution distance for high-dimension problems than WD for instance. Note however that for MMD-based two sample test, \citet{ramdas2015decreasing} has provided contrary empirical evidence and have shown that for Gaussian distributions, as dimension increases $\text{MMD}^2(\mu,\nu)$ goes to $0$ exponentially fast in $d$. Hence, we will postpone our conclusion on the advantage of one measure distance on another to our experimental analysis. \subsection{Discriminating normal distributions with the mean} \label{sec:mean} $(\epsilon, \gamma)$-goodness of a dissimilarity function is a property that depends on the learning problem. As such, it is difficult to characterize whether a dissimilarity will be good for all problems. In the sequel we characterize this property for these three dissimilarities, on a mean-separated Gaussian distribution problem. \citep{muandet2012learning} used the same problem as their numerical toy problem. We show that even in this simple case, MMD suffers high dimensionality more than the two other dissimilarities. Consider a binary distribution classification problem where samples from both classes are defined by Gaussian distributions in $\mathbb{R}^d$. Means of these Gaussian distribution follow another Gaussian distribution which mean depends on the class while covariance are fixed. Hence, we have $\mu_i \sim \mathcal{N}(\mathbf{m}_i, \Sigma)$ with $\mathbf{m}_i \sim \mathcal{N}(\mathbf{m}_{-1}^\star, \Sigma_0)$ if $y_i = -1$ and $\mathbf{m}_i \sim \mathcal{N}(\mathbf{m}_{+1}^\star, \Sigma_0)$ if $y_i = +1$ where $\Sigma$ and $\Sigma_0$ are some definite-positive covariance matrix. We suppose that both classes have same priors. We also denote $ D^\star = \|{\mathbf{m}_{-1}^\star} - \mathbf{m}_{+1}^\star\|_2^2$ which is a key component in the learnability of the problem. Intuitively, assuming that the volume of each $\mu_i$ as defined by the determinant of $\Sigma$ is smaller than the volume of $\Sigma_0$, the larger $D^\star$ is the easier the problem should be. This idea appears formally in what follows. Based on Wasserstein distance between two normal distributions {with same covariance matrix}, we have $W(\mu_i,\mu_j)^2 = \|\mathbf{m}_i - \mathbf{m}_j\|_2^2$. In addition, given a $\mu_i$ with mean $\mathbf{m}_i$, regardless of its class, we have, with $k \in \{-1,+1\}$: $$ \mathbf{E}_{\mu_j: \mathbf{m}_j \sim \mathcal{N}(\mathbf{m}_{k}^\star, \Sigma_0)}[\|\mathbf{m}_i - \mathbf{m}_j\|_2^2] = \|\mathbf{m}_i - \mathbf{m}_k^\star\|_2^2 + \Tr(\Sigma_0) $$ Given $\alpha \in ]0,1]$, we define the subset of $\mathbb{R}^d$, $$\mathcal{E}_{-1} = \{\mathbf{m} : (\mathbf{m} - \mathbf{m}_{-1})^\top (\mathbf{m}_{+1}^\star - \mathbf{m}_{-1}^\star) \leq \frac{1- \alpha}{2} D^\star$$ Informally, $\mathcal{E}_{-1}$ is an half-space containing of $\mathbf{m}_{-1}$ for which all points are nearer to $\mathbf{m}_{-1}$ than $\mathbf{m}_{+1}$ with a margin defined by $\frac{1- \alpha}{2} D^\star$. In the same way, we define $\mathcal{E}_{+1}$ as : $$\mathcal{E}_{+1} = \{\mathbf{m} : (\mathbf{m} - \mathbf{m}_{+1}^\star)^\top (\mathbf{m}_{-1}^\star - \mathbf{m}_{+1}^\star) \leq \frac{1- \alpha}{2} D^\star\}$$ Based on these definition, we can state that $W(\cdot,\cdot)$ is a $(\epsilon,\gamma)$ good dissimilarity function with $\gamma = \alpha D^\star$, $\epsilon = \frac{1}{2}\int_{\mathbb{R}^d \setminus \mathcal{E}_{-1}} d\mathcal{N}(\mathbf{m}_{-1}, \Sigma_0) + \frac{1}{2} \int_{\mathbb{R}^d \setminus \mathcal{E}_{+1}} d\mathcal{N}(\mathbf{m}_{+1}, \Sigma_0)$ and $w(\mu) = 1, \forall \mu$. Indeed, it can be shown that for a given $\mu_i$ with $y_i = -1$, if $\mathbf{m}_i \in \mathcal{E}_{-1}$ then $$ \|\mathbf{m}_i - \mathbf{m}_{-1}^\star\|_2^2 + \underbrace{\alpha \|\mathbf{m}_{-1}^\star - \mathbf{m}_{+1}^\star\|_2^2}_{\gamma} \leq \|\mathbf{m}_i - \mathbf{m}_{+1}^\star\|_2^2 $$ With a similar reasoning, we get an equivalent inequality for $\mu_i$ of positive label. Hence, we have all the conditions given in Definition \ref{def:diss} for the Wasserstein distance to be an $(\epsilon,\gamma)$ good dissimilarity function for this problem. Note that the $\gamma$ and $\epsilon$ naturally depend on the distance between expected means. The larger this distance is, the larger the margin and the smaller $\epsilon$ are. Following the same steps, we can also prove that for this specific problem of discriminating normal distribution, the Kullback-Leibler divergence is also a $(\epsilon,\gamma)$ good dissimilarity function. Indeed, for $\mu_1$ and $\mu_2$ following two Normal distributions with same covariance matrix $\Sigma_0$, we have $KL(\mu_1, \mu_2) = \|\mathbf{m}_2 - \mathbf{m}_1\|_{\Sigma_0^{-1}}^2$. And following exactly the same steps as above, but replacing inner product $\mathbf{m}^\top\mathbf{m}^\prime$ with $\mathbf{m}^\top\Sigma_0^{-1}\mathbf{m}^\prime$ leads to similar margin $\gamma = \alpha \|\mathbf{m}_{-1}^\star - \mathbf{m}_{+1}^\star\|_{\Sigma_0^{-1}}^2$ and similar definition of $\epsilon$. While the above margins $\gamma$ for KL and WD are valid for any $\Sigma_0$, if we assume $\Sigma_0 = \sigma^2 \mathbf{I}$, then according to \cite{ramdas2015decreasing}, the following approximation holds for this problem $$ \text{MMD}^2(\mu_1,\mu_2) \approx \frac{\|\mathbf{m}_1 - \mathbf{m}_2\|_2^2}{\sigma_k^2(1+2\sigma^2/\sigma_k^2)^{d/2+1}} $$ where $\sigma_k$ is the bandwidth of the kernel embedding, leading to a $(\epsilon-\gamma)$ distribution with margin $$\alpha \frac{\|\mathbf{m}_1^\star - \mathbf{m}_2^\star\|_2^2}{\sigma_k^2(1+2\sigma^2/\sigma_k^2)^{d/2+1}} $$ From these margin equations for all the dissimilarities, we can drive similar conclusions to those of \citet{ramdas2015decreasing} on test power. Regardless on the choice of the kernel embedding bandwidth, the margin of MMD is supposed to decrease with respect to the dimensionality either polynomially or exponentially fast. As such, even in this simple setting, MMD is theoretically expected to work worse than KL divergence or WD. In practice, we need to compute these KL, WD or MMD distance from samples obtained $\emph{i.i.d}$ from the unknown distribution $\mu$ and $\nu$. The problem of estimating in a non-parametric way some $\phi$-divergence, especially the Kullback-Leibler divergence have been thoroughly studied by \citet{nguyen2007nonparametric,nguyen2010estimating}. For KL divergence, this estimation is obtained by solving a quadratic programming problem. In a nutshell, compared to Kullback-Leibler divergence, Wasserstein distance benefits from a linear programming problem compared to a quadratic programming problem. In addition, unlike KL-divergence, Wasserstein distance takes into account the properties of $\mathcal{X}$ and as such it does not diverge for distributions that do not share support. \section{Numerical experiments} \begin{figure*}[t] \centering \includegraphics[width=7cm]{toy_lc_1_dim50.pdf} \includegraphics[width=7cm]{toy_dim_n250_m30.pdf}\\ \caption{Comparing performances of Support Measure Machines and Wasserstein distance + classifier. }\label{fig:toy_res} \end{figure*} In this section, we have analyzed and compared the performances of Wasserstein distances based embedding for learning to classify distributions. Several toy problems, similar to those described in Section \ref{sec:mean} have been considered as well as a computer-vision real-world problem. \subsection{Competitors} Before describing the experiments we discuss the algorithms we have compared. We have considered two variants of our approach. The first one embeds the distributions based on $\hat \rho_S$ by using, unless specified, all distributions available in the training set. {The Wasserstein distance is approximated using its entropic regularized version with $\lambda = 0.01$ for all problems.} Then, we learn either a linear SVM or a Gaussian kernel classifier resulting in two methods dubbed in the sequel as \textbf{WD+linear } and \textbf{WD+kernel}. {As discussed in section \ref{sec:empirical}, we can use the closed-form Bures Wassrestein distance when we suppose that the distributions are Gaussian. Assuming that the samples come from a Normal distribution, plugging-in the empirical mean and covariance estimation into the Bures-Wasserstein distance \ref{eq:W_Gauss} gives us a distance that we can use as an embedding. In the experiments, these approaches are named \textbf{Bures+linear} and \textbf{Bures+kernel}. } In the family of integral probability metrics, we used the support measure machines of \citet{muandet2012learning}, denoted as \textbf{SMM}. We have considered its non-linear version which used an Gaussian kernel on top of the MMD kernel. In SMM, we have thus two kernel hyperparameters. {In order to evaluate the choice of the distance, we have also used the MMD distance in addition to the Wasserstein distance in our framework. These approaches are denoted as \textbf{MMD+linear} and \textbf{MMD+kernel}. } Note that we have not reported based on samples-based approaches such as SVM since \citet{muandet2012learning} have already reported that they hardly handle distributions. Kullback-Leibler divergence can replace the Wasserstein distance in our framework. For instance, we have highlighted that for the problem in Section \ref{sec:mean}, KL-divergence is an $(\epsilon,\gamma)$ good dissimilarity function. We have thus implemented the non-parametric estimation of the KL-divergence based on quadratic programming \citep{nguyen2010estimating,nguyen2007nonparametric}. After few experiments on the toy problems, we finally decided to not report performance of the KL-divergence based approach due to its poor computational scalability as illustred in the supplementary material. \subsection{Simulated problem} These problems aim at studying the performances of our models in controlled setting. The toy problem corresponds to the one described in Section \ref{sec:mean} but with $3$ classes. For all classes, mean of a given distribution follows a normal distribution with mean $\mathbf{m}^\star =[1,1]$ and covariance matrix $\sigma \mathbf{I}$ with $\sigma=5$. For class $i$, the covariance matrix of the distribution is defined as $\sigma_i \mathbf{I} + u_i (\mathbf{I}_1 + \mathbf{I}_{-1}$) where $\mathbf{I}_1$ and $\mathbf{I}_{-1}$ are respectively the super and sub diagonal matrices. The $\{\sigma_i\}$ are constant whereas $u_i$ follows a uniform distribution depending on the class. We have kept the number of empirical samples per distribution fixed at $N=30$. For these experiments, we have analyzed the effect of the number of training examples $n$ (which is also the number of templates) and the dimensionality $d$ of the distribution. Approaches are then evaluated on of $2000$ test distributions. $20$ trials have been considered for each $n$ and dimension $d$. We define a trial as follows: we randomly sample the $n$ number of distributions and compute all the embeddings and kernels. For learning, We have performed cross-validation on all parameters of all competitors. This involves all kernel and classifier parameters. Details of all parameters and hyperparameters are given in the appendix. Left plot in Figure \ref{fig:toy_res} represents the averaged classification accuracy with $N=30$ samples per classes and $d = 50$ for increasing number $n$ of empirical training distribution examples. Right plot represents the same but for fixed $n=250$ and increasing dimensionality $d$. From the left panel, we note that MMD-based distance fails in achieving good performances regardless of how they are employed (kernel or distance based classifier). WDMM performs better than MMD especially as the number of training distrubtions increases. For $n=600$, the difference in performance is almost $30\%$ of accuracy when considering distance-based embeddings. We also remark that the Bures-Wasserstein metric naturally fits to this Normal distribution learning problem and achieves perfect performances for $n \geq 200$. Right panel shows the Impact of the dimensionality of the problem on the classification performance. We note that again MMD-based approaches do not perform as good as Wasserstein-based ones. Whereas MMD tops below $70\%$, our non-linear WDMM method achieves about $90\%$ of classification rate across a large range of dimensionality. \subsection{Natural scene categorization} \begin{table}[t] \centering \resizebox{\linewidth}{!}{\begin{tabular}{l|c|c|c}\hline Method & Scenes& 3DPC& 3DPC-CV\\ \hline\hline SMM & 51.58 $\pm$ 2.46 & 92.79 & 92.99 $\pm$ 0.99 \\\hline MMD linear & 24.83 $\pm$ 1.22 & 91.89 & 91.84 $\pm$ 1.13 \\ MMD kernel & 27.02 $\pm$ 4.09 & 90.54 & 92.66 $\pm$ 1.02 \\\hline WD linear & \underline{61.58 $\pm$ 1.34} & \textbf{97.30} &\textbf{95.52 $\pm$ 0.89} \\ WD kernel & \underline{60.70 $\pm$ 2.49} & 96.86 & 94.89 $\pm$ 0.80 \\\hline BW linear & \textbf{62.30 $\pm$ 1.32} & 64.86 &63.52 $\pm$ 5.72 \\ BW kernel & \underline{62.06 $\pm$ 1.34} & 70.72 & 72.20 $\pm$ 1.51 \\\hline \hline \end{tabular}} \caption{Performances of competitors on real-world problems. 3DPC and 3DPC-CV columns report performances on original train/test split and for random splits. Bold denotes best test accuracy and underline show statistically equivalent performance under Wilocoxon signrank test with $p=0.01$. } \label{tab} \vspace{-0.5cm} \end{table} We have also compared the performance the different approaches on a computer vision problem. For this purpose, we have reproduced the experiments carried out by \citet{muandet2012learning}. Their idea is to consider an image of a scene as an histogram of codewords, where the codewords have been obtained by k-means clustering of $128$-dim SIFT vector and thus to use this histogram as a discrete probability distribution for classifying the images. Details of the feature extraction pipeline can be found in the paper \citet{muandet2012learning}. The only difference our experimental set-up is that we have used an enriched version of the dataset\footnote{The dataset is available at \url{http://www-cvr.ai.uiuc.edu/ponce_grp/data/}} they used. Similarly, we have used $100$ images per class for training and the rest for testing. Again, all hyperparameters of all competing methods have been selected by cross-validation. The averaged results over $10$ trials are presented in Table \ref{tab}. Again, the plot illustrates the benefit of Wasserstein-distance based approaches (through fully non-parametric distance estimation or through the estimated Bures-Wasserstein metric) compared to MMD based methods. We believe that the gain in performance for non-parametric methods is due to the ability of the Wasserstein distance to match samples of one distribution to only few samples of the other distribution. By doing so, we believe that it is able to capture in an elegant way complex interaction between samples of distributions. \subsection{3D point cloud classification} 3D point cloud can be considered as samples from a distribution. As such, a natural tool for classifying them is to used metrics or kernels on distributions. In this experiment, we have benchmarked all competitors on a subset of the ModelNet10 dataset \cite{}. Among the 10 classes in that dataset, we have extracted the \emph{night stand}, \emph{desk} and \emph{bathtub} classes which respectively have $400$, $400$ and $212$ training examples and $172$,$172$ and $100$ test examples. Experiments and model selection have been run as in previous experiments. In Table \ref{tab}, we report results based on original train and test sets and results using $50-50$ random splits and resamplings. Again, we highlight the benefit of using the Wasserstein distance as an embedding and contrarily to other experiments, the Bures-Wasserstein metric yields to poor performance as the object point clouds hardly fit a Normal distribution leading thus to model misspecification. \section{Conclusion} This paper introduces a method for learning to discriminate probability distributions based on dissimilarity functions. The algorithm consists in embedding the distributions into a space of dissimilarity to some template distributions and to learn a linear decision function in that space. From a theoretical point of view, when considering population distributions, our framework is an extension of the one of \citet{balcan2008theory}. But we provide a theoretical analysis showing that for embeddings based on empirical distributions, given enough samples, we can still learn a linear decision functions with low error with high-probability with empirical Wasserstein distance. The experimental results illustrate the benefits of using empirical dissimilarity on distributions on toy problems and real-world data. Futur works will be oriented toward analyzing a more general class of regularized optimal transport divergence, such as the Sinkhorn divergence~\cite{Genevay17} in the context of Wasserstein distance measure machines. Also, we will consider extensions of this framework to regression problems, for which a direct application is not immediate.
{'timestamp': '2018-11-16T02:12:48', 'yymm': '1803', 'arxiv_id': '1803.00250', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00250'}
arxiv
\section{Introduction} It is well known that humans have a vast amount of commonsense knowledge acquired from everyday life. For machine reading comprehension, natural language inference and many other NLP tasks, commonsense reasoning is one of the major obstacles to make machines as intelligent as humans. A large portion of previous work focus on commonsense knowledge acquisition with unsupervised learning ~\cite{chambers2008unsupervised,tandon2017webchild} or crowdsourcing approach ~\cite{singh2002open,wanzare2016descript}. \emph{ConceptNet} ~\cite{speer2017conceptnet}, \emph{WebChild} ~\cite{tandon2017webchild} and \emph{DeScript} ~\cite{wanzare2016descript} etc are all publicly available knowledge resources. However, resources based on unsupervised learning tend to be noisy, while crowdsourcing approach has scalability issues. There is also some research on incorporating knowledge into NLP tasks such as reading comprehension ~\cite{lin2017reasoning,yang2017leveraging} neural machine translation ~\cite{zhang2017prior} and text classification ~\cite{zhang2017exploiting} etc. Though experiments show performance gains over baselines, these gains are often quite marginal over the state-of-the-art system without external knowledge. In this paper, we present \textbf{Three}-way \textbf{A}ttentive \textbf{N}etworks(\emph{TriAN}) for multiple-choice commonsense reading comprehension. The given task requires modeling interactions between the passage, question and answers. Different questions need to focus on different parts of the passage, attention mechanism is a natural choice and turns out to be effective for reading comprehension. Due to the relatively small size of training data, \emph{TriAN} use word-level attention and consists of only one layer of LSTM ~\cite{hochreiter1997long}. Deeper models result in serious overfitting and poor generalization empirically. To explicitly model commonsense knowledge, relation embeddings based on ConceptNet~\cite{speer2017conceptnet} are used as additional features. ConceptNet is a large-scale graph of general knowledge from both crowdsourced resources and expert-created resources. It consists of over $21$ million edges and $8$ million nodes. ConceptNet shows state-of-the-art performance on tasks like word analogy and word relatedness. Besides, we also find that pretraining our network on other datasets helps to improve the overall performance. There are some existing multiple-choice English reading comprehension datasets contributed by NLP community such as \emph{MCTest} ~\cite{richardson2013mctest} and \emph{RACE} ~\cite{lai2017race}. Although those datasets don't focus specifically on commonsense comprehension, they provide a convenient way for data augmentation. Augmented data can be used to learn shared regularities of reading comprehension tasks. Combining all of the aforementioned techniques, our system achieves competitive performance on the official test set. \begin{figure*}[ht] \begin{center} \includegraphics[width=.99\linewidth]{image/TriAN.pdf} \caption{\emph{TriAN} Model Architecture.} \label{fig:TriAN} \end{center} \end{figure*} \section{Model} The overall architecture of \emph{TriAN} is shown in Figure ~\ref{fig:TriAN}. It consists of an input layer, an attention layer and an output layer. \noindent \textbf{Input Layer. } A training example consists of a passage $\{P_i\}_{i=1}^{|P|}$, a question $\{Q_i\}_{i=1}^{|Q|}$, an answer $\{A_i\}_{i=1}^{|A|}$ and a label $y^* \in \{0, 1\}$ as input. $P$, $Q$ and $A$ are all sequences of word indices. For a word $P_i$ in the given passage, the input representation of $P_i$ is the concatenation of several vectors: \begin{itemize} \setlength\itemsep{0em} \item \textbf{GloVe embeddings.} Pretrained $300$-dimensional \emph{GloVe} vector $\mathbf{E}_{P_i}^{glove}$. \item \textbf{Part-of-speech and named-entity embeddings.} Randomly initialized $12$-dimensional part-of-speech embedding $\mathbf{E}_{P_i}^{pos}$ and $8$-dimensional named-entity embedding $\mathbf{E}_{P_i}^{ner}$. \item \textbf{Relation embeddings.} Randomly initialized $10$-dimensional relation embedding $\mathbf{E}_{P_i}^{rel}$. The relation is determined by querying ConceptNet whether there is an edge between $P_i$ and any word in question $\{Q_i\}_{i=1}^{|Q|}$ or answer $\{A_i\}_{i=1}^{|A|}$. If there exist multiple different relations, just randomly choose one. \item \textbf{Handcrafted features.} We also add logarithmic term frequency feature and co-occurrence feature $\mathbf{f}_{P_i}$. Term frequency is calculated based on English Wikipedia. Co-occurrence feature is a binary feature which is true if $P_i$ appears in question $\{Q_i\}_{i=1}^{|Q|}$ or answer $\{A_i\}_{i=1}^{|A|}$. \end{itemize} The input representation for $P_i$ is $\mathbf{w}_{P_i}$: \begin{equation} \mathbf{w}_{P_i} = [\mathbf{E}_{P_i}^{glove}; \mathbf{E}_{P_i}^{pos}; \mathbf{E}_{P_i}^{ner}; \mathbf{E}_{P_i}^{rel}; \mathbf{f}_{P_i}] \end{equation} In a similar way, we can get input representation for question $\mathbf{w}_{Q_i}$ and answer $\mathbf{w}_{A_i}$. \noindent \textbf{Attention Layer. } We use word-level attention to model interactions between the given passage $\{P_i\}_{i=1}^{|P|}$, the question $\{Q_i\}_{i=1}^{|Q|}$ and the answer $\{A_i\}_{i=1}^{|A|}$. First, let's define a sequence attention function ~\cite{chen2017reading}: \begin{equation} \begin{aligned} Att_{seq}(\mathbf{u},\ \{\mathbf{v}_i\}_{i=1}^{n}) = \sum_{i=1}^{n}&{\alpha_i \mathbf{v}_i} \\ \alpha_i = \mathrm{softmax}_i(f(\mathbf{W}_1\mathbf{u})^T & f(\mathbf{W}_1\mathbf{v}_i)) \end{aligned} \end{equation} $\mathbf{u}$ and $\mathbf{v}_i$ are vectors and $\mathbf{W}_1$ is a matrix. $f$ is a non-linear activation function and is set to $ReLU$. Question-aware passage representation $\{\mathbf{w}_{P_i}^q\}_{i=1}^{|P|}$ can be calculated as: $\mathbf{w}_{P_i}^q = Att_{seq}(\mathbf{E}_{P_i}^{glove}, \{\mathbf{E}_{Q_i}^{glove}\}_{i=1}^{|Q|})$. Similarly, we can get passage-aware answer representation $\{\mathbf{w}_{A_i}^p\}_{i=1}^{|A|}$ and question-aware answer representation $\{\mathbf{w}_{A_i}^q\}_{i=1}^{|A|}$. Then three BiLSTMs are applied to the concatenation of those vectors to model the temporal dependency: \begin{equation} \begin{aligned} \mathbf{h}^q & = \mathrm{BiLSTM}(\{\mathbf{w}_{Q_i}\}_{i=1}^{|Q|}) \\ \mathbf{h}^p & = \mathrm{BiLSTM}(\{[\mathbf{w}_{P_i}; \mathbf{w}_{P_i}^q]\}_{i=1}^{|P|}) \\ \mathbf{h}^a & = \mathrm{BiLSTM}(\{[\mathbf{w}_{A_i}; \mathbf{w}_{A_i}^p; \mathbf{w}_{A_i}^q]\}_{i=1}^{|A|}) \\ \end{aligned} \end{equation} $\mathbf{h}^p, \mathbf{h}^q, \mathbf{h}^a$ are the new representation vectors that incorporates more context information. \noindent \textbf{Output Layer. } Question sequence and answer sequence representation $\mathbf{h}^q, \mathbf{h}^a$ are summarized into fixed-length vectors with self-attention ~\cite{yang2016hierarchical}. Self-attention function is defined as follows: \begin{equation} \begin{aligned} Att_{self}(\{\mathbf{u}_i\}_{i=1}^n) = \sum_{i=1}^{n}&{\alpha_i \mathbf{u}_i} \\ \alpha_i = \mathrm{softmax}_i(\mathbf{W}_2^T \mathbf{u}_i)& \end{aligned} \end{equation} Then we have question representation $\mathbf{q} = Att_{self}(\{\mathbf{h}_i^q\}_{i=1}^{|Q|})$, answer representation $\mathbf{a} = Att_{self}(\{\mathbf{h}_i^a\}_{i=1}^{|A|})$ and passage representation $\mathbf{p} = Att_{seq}(\mathbf{q}, \{\mathbf{h}_i^p\}_{i=1}^{|P|})$. The final output $y$ is based on their bilinear interactions: \begin{equation} y = \sigma(\mathbf{p}^T\mathbf{W}_3\mathbf{a} + \mathbf{q}^T\mathbf{W}_4\mathbf{a}) \end{equation} \noindent \textbf{Model Learning. } We first pretrain \emph{TriAN} on \emph{RACE} dataset for $10$ epochs. Then our model is fine-tuned on official training data. Standard cross entropy function is used as the loss function to minimize. \section{Experiments} \subsection{Setup} \noindent \textbf{Data. } For data preprocessing, we use \emph{spaCy}~\footnote{\url{https://github.com/explosion/spaCy}} for tokenization, part-of-speech tagging and named-entity recognition. Statistics for official dataset \emph{MCScript} ~\cite{MCScript} are shown in Table ~\ref{table:dataset}. \emph{RACE}~\footnote{\url{http://www.cs.cmu.edu/~glai1/data/race/}} dataset is used for network pretraining. English stop words are ignored when computing handcrafted features. Input word embeddings are initialized with $300$-dimensional \emph{GloVe} ~\cite{pennington2014glove} vectors ~\footnote{\url{http://nlp.stanford.edu/data/glove.840B.300d.zip}}. \begin{table}[ht] \centering \begin{tabular}{c|ccc} \hline & train & dev & test \\ \hline \# of examples & 9731 & 1411 & 2797 \\ \hline \end{tabular} \caption{Official dataset statistics.} \label{table:dataset} \end{table} \noindent \textbf{Hyperparameters. } Our model \emph{TriAN} is implemented based on \emph{PyTorch} ~\footnote{\url{http://pytorch.org/}}. Models are trained on a single GPU(Tesla P40) and each epoch takes about $80$ seconds. Only the word embeddings of top $10$ frequent words are fine-tuned during training. The dimension of both forward and backward LSTM hidden state is set to $96$. Dropout rate is set to $0.4$ for both input embeddings and BiLSTM outputs ~\cite{srivastava2014dropout}. For parameter optimization, we use \emph{Adamax}~\cite{kingma2014adam} with an initial learning rate $2\times10^{-3}$. Learning rate is then halved after $10$ and $15$ training epochs. The model converges after $50$ epochs. Gradients are clipped to have a maximum L2 norm of $10$. Minibatch with batch size $32$ is used. Hyperparameters are optimized by random search strategy~\cite{bergstra2012random}. Our model is quite robust over a wide range of hyperparameter configurations. \subsection{Main Results} The experimental results are shown in Table ~\ref{table:main_results}. Human performance is shared by task organizers. For \emph{TriAN-ensemble}, we average the output probabilities of 9 models trained with the same datasets and network architecture but different random seeds. \emph{TriAN-ensemble} is the model that we used for official submission. \begin{table}[ht] \centering \begin{tabular}{l|ll} \hline \multicolumn{1}{c|}{model} & \multicolumn{1}{c}{dev} & \multicolumn{1}{c}{test} \\ \hline Random & 50.00\% & 50.00\% \\ \hline TriAN-RACE & 64.78\% & 64.28\% \\ \hline TriAN-single & 83.84\% & 81.94\% \\ \hline TriAN-ensemble & \textbf{85.27\%} & \textbf{83.95\%} \\ \hline \hline HFL & \multicolumn{1}{c}{--} & 84.13\% \\ \hline Human & \multicolumn{1}{c}{--} & 98.00\% \\ \hline \end{tabular} \caption{Main results. \emph{TriAN-RACE} only use \emph{RACE} dataset for training; \emph{HFL} is the 1st place team for \emph{SemEval-2018 Task 11}. The evaluation metric is accuracy.} \label{table:main_results} \end{table} From Table \ref{table:main_results}, we can see that even though \emph{RACE} dataset contains nearly $100k$ questions, \emph{TriAN-RACE} achieves quite poor results. The accuracy on development set is only $64.78\%$, which is worse than most participants' systems. However, pretraining acts as a way of implicit knowledge transfer and is beneficial for overall performance, as will be seen in Section ~\ref{section:ablation}. The accuracy of our system \emph{TriAN-ensemble} is very close to the 1st place team \emph{HFL} with $0.18\%$ difference. Yet there is still a large gap between machine learning models and human. We also compared the performances of shallow and deep TriAN models. On datasets such as \emph{SQuAD} ~\cite{rajpurkar2016squad}, deep models typically works better than shallow ones. Notice that the attention layer in our proposed \emph{TriAN} model can be stacked multiple times if we treat the output vectors of BiLSTMs as new input representations. \begin{table}[ht] \centering \begin{tabular}{l|ll} \hline \multicolumn{1}{c|}{model} & \multicolumn{1}{c}{dev} & \multicolumn{1}{c}{test} \\ \hline 1-layer TriAN-single & \textbf{83.84\%} & \textbf{81.94\%} \\ \hline 2-layer TriAN-single & 82.71\% & 80.55\% \\ \hline \end{tabular} \caption{Accuracy comparison of shallow and deep TriAN models.} \label{table:layers} \end{table} Maybe a little bit surprising, Table ~\ref{table:layers} shows that \emph{2-layer TriAN} model performs worse than \emph{1-layer TriAN}. One possible explanation is that the labeled dataset is relatively small and deeper models tend to easily overfit. \subsection{Ablation Study} \label{section:ablation} The input representation consists of several components: part-of-speech embedding, relation embedding and handcrafted features etc. We conduct an ablation study to investigate the effects of each component. The results are in Table ~\ref{table:input_ablation}. \begin{table}[ht] \centering \begin{tabular}{l|ll} \hline \multicolumn{1}{c|}{model} & \multicolumn{1}{c}{dev} & \multicolumn{1}{c}{test} \\ \hline TriAN-single & \textbf{83.84\%} & \textbf{81.94\%} \\ \hline \hline w/o pretraining & 82.71\% & 80.51\% \\ \hline w/o ConceptNet & 82.78\% & 81.08\% \\ \hline w/o POS & 82.84\% & 81.27\% \\ \hline w/o features & 82.92\% & 81.35\% \\ \hline w/o NER & 83.60\% & 81.87\% \\ \hline \end{tabular} \caption{Ablation study for input representation.} \label{table:input_ablation} \end{table} Pretraining on \emph{RACE} dataset turns out to be the most important factor. Without pretraining, the accuracy drops by more than $1\%$ on both development and test set. Relation embeddings based on ConceptNet make approximately $1\%$ difference. Part-of-speech and named-entity embeddings are also helpful. In fact, combining input representations from multiple sources has been a standard practice for reading comprehension tasks. At attention layer, our proposed \emph{TriAN} involves applying several attention functions to model interactions between different text sequences. It would be interesting to examine the importance of each attention function, as shown in Table ~\ref{table:attention_ablation}. \begin{table}[ht] \hskip-0.3cm \centering \scalebox{0.9}{ \begin{tabular}{l|ll} \hline \multicolumn{1}{c|}{model} & \multicolumn{1}{c}{dev} & \multicolumn{1}{c}{test} \\ \hline TriAN-single & \textbf{83.84\%} & 81.94\% \\ \hline \hline w/o passage-question attention & 83.51\% & \textbf{82.20\%} \\ \hline w/o passage-answer attention & 83.07\% & 81.39\% \\ \hline w/o question-answer attention & 83.23\% & 81.84\% \\ \hline w/o attention & 81.93\% & 80.65\% \\ \hline \end{tabular}} \caption{Ablation study for attention. The last one ``\emph{w/o attention}'' removes all word-level attentions.} \label{table:attention_ablation} \end{table} Interestingly, removing any of the three word-level sequence attentions does not seem to hurt the performance much. In fact, removing passage-question attention even results in higher accuracy on test set than \emph{TriAN-single}. However, if we remove all word-level attentions, the performance drastically drops by $1.9\%$ on development set and $1.3\%$ on test set. \subsection{Discussion} Even though our system is built for commonsense reading comprehension, it doesn't have any explicit knowledge reasoning component. Relation embeddings based on ConceptNet only serve as additional input features. Methods like event calculus ~\cite{mueller2014commonsense} are more rigorous mathematically and resemble the way of how human brain works. The problem of event calculus is that it requires large amounts of domain-specific axioms and therefore doesn't scale well. Another limitation is that our system relies on hard-coded commonsense knowledge bases, just like most systems for commonsense reasoning. For humans, commonsense knowledge comes from constant interactions with the real-world environment. From our point of view, it is quite hopeless to enumerate all of them. There are a lot of reading comprehension datasets available. When the size of training data is relatively small like this \emph{SemEval-2018 task}, transfer learning among different datasets is a useful technique. This paper shows that pretraining is a simple and effective method. However, it still remains to be seen whether there is a better alternative approach. \section{Conclusion} In this paper, we present the core ideas and design philosophy for our system \emph{TriAN} at \emph{SemEval-2018 Task 11: Machine Comprehension using Commonsense Knowledge}. We build upon recent progress on neural models for reading comprehension and incorporate commonsense knowledge from ConceptNet. Pretraining and handcrafted features are also proved to be helpful. As a result, our proposed model \emph{TriAN} achieves near state-of-the-art performance. \section*{Acknowledgements} We would like to thank SemEval 2018 task organizers and several anonymous reviewers for their helpful comments.
{'timestamp': '2018-05-16T02:06:27', 'yymm': '1803', 'arxiv_id': '1803.00191', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00191'}
arxiv
\section{Introduction} \subsection{Motivation} Heterogeneous cellular networks (HCNs), consisting of various types of base stations such as macro, pico and femto, are a necessary step in the evolution of cellular networks to meet the explosive demand in mobile data traffic growth and various emerging applications \cite{GhoshHCN12}. For seamless coverage, it is essential to understand the signal-to-interference ratio (SIR) distribution, especially at high deployment densities, which makes the network interference-limited. In the literature, the mathematical analysis for the SIR distribution in conventional single-tier cellular network and HCNs mainly relies on the application of Poisson point process (PPP) theory in stochastic geometry \cite{Haenggi18book, Andrews11, Dhillon12, Mukherjee12, nigam2014, Singh13, Jo12, Keeler13, Blaszczyszyn15, XZhang14}, which has been shown to be a powerful tool in recent years. However, the conventional SIR analysis for the HCNs is restricted to the mean success probability $\ps(\theta)\triangleq\P(\SIR>\theta)$, defined as the complementary cumulative distribution function (CCDF) of the SIR evaluated at the typical link. Such a performance metric is merely a macroscopic quantity by averaging the conditional success probability (link reliability) $\Ps(\theta)\triangleq \P(\SIR>\theta\mid\Phi)$ over the underlying point process $\Phi$, hence it provides no information about the difference between links. In contrast, the network operators' concerns for the real deployment of HCNs are questions such as ``How are the link reliabilities distributed among users in different tiers and/or in the whole network?'', or ``How will the offloading affect the SIR performance of different tiers?'', or ``What is the reliability level that the `5\% user'\footnote[1]{The ``5\% user'' refers to the user whose performance ranks at the 5th-percentile.} can achieve in each tier?'' To obtain such fine-grained information on the SIR performance, the meta distribution concept was introduced in \cite{MHmeta}, which characterizes the distribution of the conditional success probabilities of the individual links given the point process. The lack of study of the meta distribution for HCNs with offloading biasing among different tiers motivates our study in this paper. We shall see that the meta distribution of SIR is a framework that facilitates the analysis for a series of performance metrics including the variances of the link reliability, the mean local delay and the asymptotic gains for HCNs. \subsection{Related Work} For the SIR-related analysis based on stochastic geometry in HCNs, the most commonly used model is the homogeneous independent Poisson (HIP) model, where BSs of each tier follow a homogeneous independent Poisson point process \cite[Def.~2]{Haenggi14wcl}. \cite{Jo12} utilized the HIP model with the (biased) nearest-BS association and considered offloading between different tiers, where offloading was implemented by biasing the transmit power of different tiers. \cite{Singh13} studied an extended heterogeneous network scenario where multiple radio access technologies (RATs) including cellular and Wi-Fi coexist, with each RAT consisting of multiple tiers and modeled by the HIP model, and the biasing association is also considered. The distribution of the SINR at the typical user was derived and applied to the analysis of rate coverage. In \cite{nigam2014}, coordinated multipoint joint transmission (CoMP) in HCN was analyzed and it was shown, as a special case (namely no-CoMP), that the result for a single tier in \cite{Andrews11} also holds for arbitrary tiers. Instead of the (biased) nearest-BS association adopted in the above-mentioned works, there is also the line of work using the maximum instantaneous SINR association, such as \cite{Dhillon12, Mukherjee12, Keeler13, Blaszczyszyn15, XZhang14}. \cite{Dhillon12} studied the coverage (success) probability and the average rate of the HIP model for the SINR thresholds greater than $0$ dB under both open and closed access. \cite{Mukherjee12} utilized the HIP model and determined the coverage probability from the joint CCDF of the SINR at the typical user with the SINR thresholds extended to all regime. \cite{Keeler13} and \cite{Blaszczyszyn15} also extended the SINR threshold to less than 0 dB and established the exact results for the maximum instantaneous SINR association rule with arbitrary shadowing in HCNs by the $K$-coverage probability. As for the fading model, it should be noted that different from \cite{Dhillon12}, where only Rayleigh fading is considered, it has been shown that the same result applies to arbitrary fading in \cite{XZhang14}. As for modeling the HCNs with more general point processes, \cite{Deng15} proposed two models for the two-tier HCN with the inter-tier independence modeled by combining the PPP and the Poisson hole process, and the intra-tier independence taken into account by combining the PPP and Matern cluster process respectively, yielding more accurate results for the outage probability and the area spectral efficiency. In \cite{WeiASAPPP16}, for HCNs consisting of general point processes as each tier with unbiased association, the authors studied the SIR distribution by using the shifted versions of the PPP SIR distributions as approximations. Most of these above-discussed works related to SIR analysis in HCNs only analyze the mean success probability without delving into the SIR performance at the individual link level. To overcome this limitation, we need to develop the meta distribution framework for the HCNs. The meta distribution has been applied to different scenarios since it was formally formulated in \cite{MHmeta}, where the analysis of single-tier Poisson bipolar networks with ALOHA channel access and the downlink of Poisson cellular networks laid the foundation of the concept. It was applied to study D2D communication underlaid with the downlink of Poisson cellular networks \cite{2017mHaenggiTcom}, uplink and downlink Poisson cellular networks with fractional power control \cite{YWmetaPower}, D2D communications with interference cancellation \cite{YWmetaIC}, millimeter-wave D2D networks \cite{Deng17}, the spatial outage capacity \cite{SOCmeta}, and downlink coordinated multi-point transmission/reception (CoMP) in cellular networks \cite{CuiCoMP17}. These studies revealed some interesting new insights that are of significance to the deployment of real networks. \subsection{Contributions} In this paper, we develop an SIR meta distribution analysis framework for the HIP downlink model under Rayleigh fading. We show that this framework enables a comprehensive understanding of a series of key performance metrics and network design problems. Specifically, \begin{itemize} \item We derive exact analytical expressions of the $b$-th moment of the conditional success probability for both the overall typical user and the typical user in each tier under Rayleigh fading. \item We show that the beta distribution is an excellent approximation for the exact meta distribution of both the entire network and each tier. \item We reveal that both the $b$-th moment and the variance of the conditional success probability for each tier can be efficiently approximated by horizontally shifting the mean success probability curve of the single-tier PPP according to the asymptotic SIR gains, whose expressions are given explicitly. \item We rigorously study the effects of the offloading biases on both the entire network and each tier in terms of the first moment and variance of the conditional success probability. \item We extend the model to include random base station activity by ALOHA and derive analytical expressions of the $b$-th moment of the conditional success probability for both the overall typical user and the typical user in each tier. \item We derive lower bounds of the region of ALOHA probabilities so that the mean local delay remains finite under the effect of random base station activity. \end{itemize} \subsection{Organization} The rest of the paper is organized as follows: Section~\ref{sec:SystemModel} introduces the system model and the concept of the SIR meta distribution in HCNs. Section~\ref{sec:MainResults} develops the general framework for the analysis of HCNs using the meta distribution, wherein we derive the exact analytical expressions of the $b$-th moment of the conditional success probability, both for the entire network and for each individual tier, and discuss various key performance metrics and some network design problems related to offloading. Section~\ref{sec:BSactivity} extends the SIR meta distribution to the analysis of random base station activity. Section~\ref{sec:Conclusion} concludes the paper. \section{System Model}\label{sec:SystemModel} \subsection{SIR Model} We consider a general $K$-tier heterogeneous cellular network model, where BSs of each tier follow a homogeneous independent Poisson point process $\Phi_i$ with intensity $\lambda_i$. This is the so-called homogeneous independent Poisson (HIP) model \cite[Def.~2]{Haenggi14wcl}. For the BSs of the $i$-th tier, the transmit power is $P_i$, and the range expansion bias is $B_i$. For BS ${\rm x}\in \Psi=\bigcup\limits_{i\in[K]}\Phi_i$, $\iota({\rm x})\in[K]$, denotes its tier number and $[K]=\{1,2,...K\}$. We assume the standard power-law path loss model with exponent $\alpha>2$, and define $\delta = 2/\alpha$. The downlink association rule is the biased nearest-BS association, \ie, for the typical user at the origin $o$, its serving BS $\nu(o)$ is drawn from all BSs according to \begin{equation}\label{eq:nu_o} \nu(o)= \mathop{\arg\max}\limits_{{\rm x}\in\Psi}\{P_{\iota({\rm x})}B_{\iota({\rm x})}\|{\rm x}\|^{-\alpha}\}, \end{equation} where $\iota({\rm x})$ is the tier index of BS $\rm x$. The power fading coefficient associated with BS ${\rm x}\in\Psi$ is denoted by $h_{\rm x}$, which is exponentially distributed with $\E(h_{\rm x})=1$ (Rayleigh fading). $R_j$ is the distance from the typical user to the nearest BS in $\Phi_j$. First we focus on the fully loaded case on a certain resource block (RB), \ie, all BSs are always active on the RB in consideration. Letting ${\rm x_0} = \nu(o)$, for the typical user at the origin, the received signal-to-interference ratio (SIR) is given by \begin{equation}\label{eq:SIR_typ} \SIR_o = \frac{P_{\iota({\rm x_0})}h_{\rm x_0}\|\rm x_0\|^{-\alpha}}{\sum\limits_{{\rm x}\in\Psi\setminus\{\rm x_0\}}P_{\iota({\rm x})}h_{\rm x}\|{\rm x}\|^{-\alpha}}. \end{equation} \subsection{Meta Distribution for HCNs} The SIR meta distribution for single-tier cellular networks is the two-parameter function defined as \cite{MHmeta} \begin{equation} \bar F(\theta, t) \triangleq \bar F_{\Ps}(t) = \P(\Ps(\theta)>t),\quad \theta\in\R^+,\:t\in [0,1], \label{eq:meta} \end{equation} which is the CCDF of the conditional success probability (link reliability) $\Ps$. The $b$-th moment of the meta distribution is denoted by $M_b(\theta)\triangleq \E(\Ps(\theta)^b)$. We consider two types of SIR meta distributions, one is for the overall network (\ie, the overall typical user) and the other is specific to the $i$-th tier, obtained by conditioning on the typical user connecting to that tier. In the following, we use the label $(i)$ for the quantities related to the $i$-th tier meta distributions. \section{SIR Meta Distribution Framework}\label{sec:MainResults} In this section we derive the general analytical expression for the $b$-th moment of the meta distribution in the HIP model with biasing. \subsection{Moments of the Conditional Success Probability} First, we state a lemma about the conditional and average access probabilities for the typical user connecting to the given $i$-th tier, which is a slight reformulation of \cite[Lemma 1]{Jo12}. Hence the proof is omitted. \allowdisplaybreaks \begin{lemma}[Access probability] \label{lem:AccessProb} Defining $\iota(\rm x_0)\triangleq\iota(\nu(o))$, the conditional access probability for the typical user connecting to the $i$-th tier given $R_i$ is \begin{equation}\label{eq:condi_acc_Prob} \P(\iota({\rm x_0})=i \mid R_i) = \prod_{j\neq i} e^{-\lambda_j \pi ({\hat P_{ij}} {\hat B_{ij}})^{\delta} R_i^2}, \end{equation} and the access probability that the typical user is associated with the $i$-th tier is \begin{equation}\label{eq:AccessProb} p_{\rm a}^{(i)}\triangleq\P(\iota({\rm x_0})=i) = \frac{1}{\sum\limits_{j\in[K]} \hat{\lambda}_{ij}(\hat{P}_{ij}\hat{B}_{ij})^\delta} \end{equation} where $\hat\lambda_{ij} = \lambda_j/\lambda_i$, $\hat P_{ij} = P_j/P_i$ and $\hat B_{ij} = B_j/B_i$. \end{lemma} Next we present the first main result on the moments of the conditional success probability. \begin{theorem}[Moments for the $K$-tier HCNs] \label{thm:Mb_RE} For the overall typical user in the $K$-tier HIP model with range expansion, the $b$-th moment of the conditional success probability is given by \begin{equation} \label{eq:Mb-typ-Bias} M_b = \sum\limits_{i} \frac{1}{\sum\limits_{j}\hat\lambda_{ij} (\hat P_{ij} \hat B_{ij})^\delta~ _2F_1(b,-\delta; 1-\delta; -\theta\hat B_{ij}^{-1})}. \end{equation} where $i,~j\in[K]$, $\hat\lambda_{ij} = \lambda_j/\lambda_i$, $\hat P_{ij} = P_j/P_i$ and $\hat B_{ij} = B_j/B_i$. \end{theorem} \begin{IEEEproof} See Appendix A. \end{IEEEproof} \begin{corollary}[Moments without range expansion] \label{thm:Mb-WO-RE} For the overall typical user, the $b$-th moment $M_b$ with no range expansion in any tier, \ie, $B_i=1$ for $i\in[K]$, is given by \begin{equation}\label{eq:Mb_typ} M_b=\frac{1}{_2F_1(b,-\delta; 1-\delta; -\theta)} ,\quad b\in \mathbb{C}. \end{equation} \end{corollary} \begin{IEEEproof} This can be easily obtained by setting $B_i=1$ for $i\in[K]$ in \eqref{eq:Mb-typ-Bias}. \end{IEEEproof} \begin{remark} The $b$-th moment of the meta distribution of the overall typical user in a HIP-based $K$-tier downlink HCN without range expansion in any tier is the same as that in a single-tier network \cite[Thm.~2]{MHmeta}. Hence the meta distribution is the same. This shows that the multitier architecture does not improve the performance of the 5\% user (or, more generally, the fairness between the users). \end{remark} \begin{corollary}[Moments for the typical user in the $\bm i$-th tier] \label{thm:Mb-ith-tier} Conditioned on the typical user connecting to the $i$-th tier, the $b$-th moment of the meta distribution is given by \begin{equation}\label{eq:Mb-ith-tier} M_{b \mid (i)} = \frac{\sum_{j} \hat{\lambda}_{ij}(\hat{P}_{ij}\hat{B}_{ij})^\delta}{\sum_j \hat{\lambda}_{ij}(\hat{P}_{ij}\hat{B}_{ij})^\delta ~_2F_1(b,-\delta; 1-\delta; -\theta \hat B_{ij}^{-1})}. \end{equation} where $\hat\lambda_{ij} = \lambda_j/\lambda_i$, $\hat P_{ij} = P_j/P_i$ and $\hat B_{ij} = B_j/B_i$. \end{corollary} \begin{IEEEproof} This follows directly from the proof of Thm.~\ref{thm:Mb_RE}. \end{IEEEproof} \begin{corollary}[Mean local delay] For the typical user in the $i$-th tier, the mean local delay is given by \begin{equation}\label{eq:MLD_ith} M_{-1\mid (i)} = \frac{(1-\delta)\sum_j \hat \lambda_{ij} (\hat P_{ij} \hat B_{ij})^\delta}{\sum_j \hat \lambda_{ij} (\hat P_{ij} \hat B_{ij})^\delta (1-\delta-\delta\theta \hat B_{ij}^{-1})}, \end{equation} \end{corollary} \begin{IEEEproof} The mean local delay is the -1-st moment of the conditional success probability in Cor.~\ref{thm:Mb-ith-tier}. Using the identity $_2F_1(-1,b;c;z) \equiv 1-\frac{bz}{c}$, \eqref{eq:MLD_ith} is obtained. \end{IEEEproof} The mean local delay $M_{-1\mid (i)}$ has a phase transition at $\theta_{{\rm c}\mid(i)}$ as given in \eqref{eq:theta_c} when it is seen as a function of the SIR threshold with the other parameters fixed, which means the mean local delay is finite for $\theta < \theta_{{\rm c}\mid(i)}$ and is infinite for $\theta \geq \theta_{{\rm c}\mid(i)}$. \begin{equation}\label{eq:theta_c} \theta_{{\rm c}\mid(i)}=\frac{(1-\delta)\sum_j \hat \lambda_{ij} (\hat P_{ij} \hat B_{ij})^\delta}{\delta \sum_j \hat \lambda_{ij} (\hat P_{ij})^\delta (\hat B_{ij})^{\delta-1}}, \end{equation} \subsection{Approximations of the Meta Distribution} According to the Gil-Pelaez theorem\cite{gil1951note}, for a general variable $X>0$ with characteristic function $\varphi_X(t)\triangleq\E e^{jtX}$, $j\triangleq\sqrt{-1}$, $t\in\R$, the CCDF of $X$ is given by \begin{equation}\label{eq:Gil} \bar F_X(x)=\frac12+\frac1\pi\int_0^\infty \frac{\Im(e^{-jt\log x}\varphi_X(jt))}{t}\dd t, \end{equation} where $\Im(z)$ denotes the imaginary parts of $z\in\mathbb{C}$. Letting $X\triangleq\Ps(\theta)$ (or $X\triangleq P_{s\mid(i)}(\theta)$), we have $\varphi_X(t)=M_{jt}$ (or $\varphi_X(t)=M_{jt\mid(i)}$), setting $b=jt$ in \eqref{thm:Mb_RE} (or \eqref{eq:Mb-ith-tier}). Hence, the meta distribution of the conditional success probability for the whole network (and the specific $i$-th tier) can be calculated. Calculation of the exact meta distribution via the Gil-Pelaez theorem usually involves many calculations of imaginary moments, which prohibits direct insights into the meta distributions and its applications in mapping to other performance metrics like the ergodic data rate \cite{Deng17}, etc. An efficient approximation of the meta distribution is obtained by using the beta distribution through matching their first and second moments, which has been verified in \cite{MHmeta, Deng17, 2017mHaenggiTcom, YWmetaPower, YWmetaIC} for various network scenarios. \subsection{Asymptotic SIR Gains} As shown in \cite{Haenggi14wcl,AGuo15ADG,Ganti16}, the CCDFs $\bar F_{\SIR}(\theta)$ of the SIR at the typical user in different general single-tier nearest-associated networks resemble merely horizontally shifted versions in the SIR threshold $\theta$ (in dB) of each other, as long as they have the same diversity gain. The horizontal gap (or the ``SIR gain'') relative to a reference network model at the target success probability $p_{\rm t}$ is given by \begin{equation}\label{eq:HorizonGap} G_{\rm p}(p_{\rm t}) \triangleq \frac{\bar F_{\SIR}^{-1}(p_{\rm t})}{\bar F_{\SIR_{\rm ref}}^{-1}(p_{\rm t})}, \end{equation} where $\bar F_{\SIR}^{-1}$ is the inverse function of $\bar F_{\SIR}(\theta)$. Usually it is more convenient to write $G_{\rm p}(p_{\rm t})$ as a function of $\theta$ by $G(\theta)=\theta'/\theta$, where $\theta'$ is given by $\bar F_{\SIR}(\theta')=\bar F_{\SIR_{\rm ref}}(\theta)=p_{\rm t}$. The asymptotic SIR gain at the high-reliability regime is defined by \begin{equation}\label{eq:HorizonGap3} G_0 \triangleq \lim_{\theta\to 0}G(\theta). \end{equation} Similarly, the asymptotic SIR gain at the low-reliability regime is defined as \begin{equation}\label{eq:HorizonGapInf} G_\infty \triangleq \lim_{\theta\to \infty}G(\theta). \end{equation} Usually, the most sensible reference network model is the homogeneous PPP. If $G_0$ (or $G_\infty$) exists, then a rather convenient way to estimate $p_{\rm s}(\theta)$ of the network in focus is by using $G_0$ (or $G_\infty$) as the scaling factor $G$ for $\theta$, \ie, \begin{equation}\label{eq:HorizonGap4} p_{\rm s}(\theta) \approx p_{\rm s, PPP}({\theta/G}). \end{equation} $G(\theta)$ in dB quantifies the horizontal gap between $p_{\rm s}(\theta)$ and $p_{\rm s, PPP}(\theta)$ for $\theta$ in dB. Next, we extend the above-mentioned SIR asymptotic gain in single-tier networks to HCNs based on the HIP model. \begin{definition}[Asymptotic SIR gains in HCNs] For the HCN model in this paper, the asymptotic SIR gains of the $b$-th moment of the conditional success probability for each tier, at both the high-reliability and low-reliability regimes, with the standard success probability of the single-tier PPP as the reference, are, respectively, given by \begin{equation}\label{eq:AsymptGainMb} G_{0,b}^{(i)} = \lim_{\theta\to 0}\frac{M_{b\mid(i)}^{-1}(p_{\rm s, PPP}(\theta))}{\theta}, \end{equation} and \begin{equation}\label{eq:AsymptGainMbInf} G_{\infty,b}^{(i)} = \lim_{\theta\to \infty}\frac{M_{b\mid(i)}^{-1}(p_{\rm s, PPP}(\theta))}{\theta}. \end{equation} where $M_{b\mid(i)}^{-1}$ is the inverse function of $M_{b\mid(i)}$ and $p_{\rm s, PPP}(\theta) = M_1$ in \eqref{eq:Mb_typ}. \end{definition} We will show that, remarkably, the horizontal shift is applicable to each tier in the HCN. Before deriving the asymptotic gains, we first state a lemma about the asymptotics of the hypergeometric function $_2F_1$. \begin{lemma}\label{lem:Asymp2F1} For $b\in\mathbb{C}$, \begin{equation}\label{eq:Asymp2F1_0} _2F_1(b,\delta,1-\delta;-z) \sim 1+bz\frac{\delta}{1-\delta}, ~~z\to 0, \end{equation} and \begin{equation}\label{eq:Asymp2F1_Inf} _2F_1(b,\delta,1-\delta;-z) \sim z^\delta T(b), ~~z\to \infty, \end{equation} where $T(b)=\int_0^\infty(1-(1+r^{-\frac{1}{\delta}})^{-b})\dd r$. \end{lemma} \begin{IEEEproof} By Taylor expansion, at $z=0$, \begin{equation}\label{eq:Taylor} \frac{1}{(1+z)^b} \sim 1-bz, \end{equation} hence \begin{align}\label{eq:2F1_asymp} _2F_1(b,\delta,1-\delta;-z) &= 1+ \int_1^\infty \Big(1-\frac{1}{(1+z s^{-1/\delta})^b} \Big)\dd s \nonumber \\ &\sim 1+ \int_1^\infty \Big(1-(1- bz s^{-1/\delta}) \Big)\dd s \nonumber \\ &= 1+bz\frac{\delta}{1-\delta}. \end{align} \allowdisplaybreaks When $z\to \infty$, we have \begin{align} _2F_1(b,-\delta; 1-\delta; -z) &= 1 + 2\int_0^1 \Big(1-\frac{1}{(1+z r^\alpha)^b}\Big) r^{-3} \dd r \nonumber \\ &= 1+ z^\delta 2\int_0^{z^{\frac{1}{\alpha}}} \Big(1-\frac{1}{(1+r^\alpha)^b}\Big) r^{-3} \dd r \nonumber \\ &\sim z^\delta 2\int_0^{\infty} \Big(1-\frac{1}{(1+r^\alpha)^b}\Big) r^{-3} \dd r \nonumber \\ &\sim z^\delta \int_0^{\infty} \Big(1-\frac{1}{(1+r^{-\frac{1}{\delta}})^b}\Big) \dd r. \end{align} where the first step is according to \cite[eq. (23)]{MHmeta}; the second step follows variable substitution $z^{\frac{1}{\alpha}}r\to r$; the third step follows since $z\to \infty$ and the last step follows variable substitution $r\to r^{-\frac{1}{2}}$. \end{IEEEproof} \begin{corollary}[Asymptotic SIR gains relative to PPP] \label{cor:AsymptGain} Conditioned on the typical user connecting to the $i$-th tier, the asymptotic SIR gains of the $b$-th moment of the meta distribution relative to $M_1$ of the single-tier homogeneous PPP are given by \begin{equation}\label{eq:AsymptGain} G_{0,b}^{(i)} = \frac{\sum_{j} \hat{\lambda}_{ij}\hat{P}_{ij}^\delta \hat{B}_{ij}^\delta}{b\sum_j \hat{\lambda}_{ij}\hat{P}_{ij}^\delta \hat{B}_{ij}^{\delta-1}}, \end{equation} and \begin{equation}\label{eq:AsymptGainInf} G_{\infty,b}^{(i)} = \Big(\frac{T(1)}{T(b)}\frac{\sum_{j} \hat{\lambda}_{ij}\hat{P}_{ij}^\delta \hat{B}_{ij}^\delta}{\sum_j \hat{\lambda}_{ij}\hat{P}_{ij}^\delta}\Big)^{\frac{1}{\delta}}, \end{equation} where $b\in\mathbb{C}$, $\hat\lambda_{ij} = \lambda_j/\lambda_i$, $\hat P_{ij} = P_j/P_i$ and $\hat B_{ij} = B_j/B_i$. \end{corollary} \begin{IEEEproof} To determine $G_{0,b}^{(i)}$, we need to evaluate the limit of $M_{b\mid(i)}(\theta)$ at $\theta\to 0$. Applying \eqref{eq:Asymp2F1_0} in \eqref{eq:Mb-ith-tier}, \begin{align}\label{eq:Mb_ith_asymp} M_{b\mid(i)}(\theta) &\sim \frac{\sum_{j} \hat{\lambda}_{ij}\hat{P}_{ij}^\delta \hat{B}_{ij}^\delta}{\sum_{j} \hat{\lambda}_{ij}\hat{P}_{ij}^\delta \hat{B}_{ij}^\delta \Big(1+b\theta\hat{B}_{ij}^{-1} \frac{\delta}{1-\delta} \Big)} \nonumber\\ &=\frac{1}{1+ \frac{\delta}{1-\delta}\frac{\theta}{G_{0,b}^{(i)}}} \nonumber\\ &\sim 1- \frac{\delta}{1-\delta}\frac{\theta}{G_{0,b}^{(i)}}. \end{align} Since for the PPP, \begin{equation}\label{eq:M1_PPP_asymp} M_{1,{\rm PPP}}(\theta) = \frac{1}{_2F_1(1,\delta,1-\delta;-\theta)} \sim 1-\frac{\theta\delta}{1-\delta}, \end{equation} it is clear that $G_{0,b}^{(i)}$ is exactly the asymptotic gain for $\theta\to 0$. To determine $G_{\infty,b}^{(i)}$, applying \eqref{eq:Asymp2F1_Inf} in \eqref{eq:Mb-ith-tier}, we have \begin{equation}\label{eq:Mb_ith_asympinf} M_{b\mid(i)}(\theta) \sim \bigg(\frac{\sum_{j} \hat{\lambda}_{ij}\hat{P}_{ij}^\delta}{\sum_{j} \hat{\lambda}_{ij}\hat{P}_{ij}^\delta \hat{B}_{ij}^\delta}T(b)\theta^\delta\bigg)^{-1}. \end{equation} $G_{\infty,b}^{(i)}$ is then obtained by comparing \eqref{eq:Mb_ith_asympinf} and \eqref{eq:M1_PPP_asymp}. \end{IEEEproof} \begin{remark} In Cor.~\ref{cor:AsymptGain}, the reference model in use is the first moment of the conditional success probability of the single-tier PPP. Another efficient way is to use the $b$-th moment the conditional success probability of the single-tier PPP as the reference model, then the variable $b$ in \eqref{eq:AsymptGain} and \eqref{eq:AsymptGainInf} vanishes and the two asymptotic gains become constants. From this it is easy to be inferred that the variances $V^{(i)}(\theta)$ of each tier are also shifted versions of each other, as shown in \figref{fig:HorizonShiftVar_B2_10} in Sec.~\ref{sec:Apps}. \end{remark} \subsection{Base Station Activity}\label{sec:BSactivity} In this section, we model the random activities of interfering base stations in each tier by the ALOHA model, \ie, the interfering BSs of tier $i$ are active only with probability $p_i$. The activities of different base stations are independent. We first derive the general $b$-th moment for the typical user of each individual tier and the whole network, and then the lower bound of the activity probabilities to keep the mean local delay finite. \begin{theorem} \label{thm:Mb-ith-tier_BSActivity} Given that the typical user connects to the $i$-th tier with the serving BS always being active, and the interfering BSs in tier $j\in[K]$ are active independently with probability $p_j$, the $b$-th moment of the meta distribution can be expressed as \begin{equation}\label{eq:Mb-ith-tier-BSActivity} M_{b \mid (i)}(\bm p) = \frac{\sum_{j} \hat{\lambda}_{ij}(\hat{P}_{ij}\hat{B}_{ij})^\delta}{\sum\limits_j \hat{\lambda}_{ij}(\hat{P}_{ij}\hat{B}_{ij})^\delta \big(1-\sum\limits_{k=1}^{\infty}\binom bk (-p_j \theta \hat B_{ij}^{-1})^k \frac{\delta}{k-\delta} ~_2F_1(k,k-\delta; k-\delta+1; -\theta \hat B_{ij}^{-1})\big)}. \end{equation} where $\bm p=(p_1,p_2,...p_K)$, $\hat\lambda_{ij} = \lambda_j/\lambda_i$, $\hat P_{ij} = P_j/P_i$, and $\hat B_{ij} = B_j/B_i$. \end{theorem} \begin{IEEEproof} See Appendix B. \end{IEEEproof} As expected, letting $K=1$, \eqref{eq:Mb-ith-tier-BSActivity} retrieves the single-tier result in \cite[Thm.~3]{MHmeta}; also, letting $K=2$ and the two tiers share the same parameters, the result of each tier is also the same as the-single tier result. \begin{theorem} \label{thm:Mb-typ_BSActivity} For the overall typical (active) user with the interfering BSs in tier $j\in[K]$ are active independently with probability $p_j$, the $b$-th moment of the meta distribution can be expressed as \begin{equation}\label{eq:Mb-typ-BSActivity} M_{b}(\bm p) = \sum\limits_i \frac{1}{\sum\limits_j \hat{\lambda}_{ij}(\hat{P}_{ij}\hat{B}_{ij})^\delta \big(1-\sum\limits_{k=1}^{\infty}\binom bk (-p_j \theta \hat B_{ij}^{-1})^k \frac{\delta}{k-\delta} ~_2F_1(k,k-\delta; k-\delta+1; -\theta \hat B_{ij}^{-1})\big)}. \end{equation} where $\bm p=(p_1,p_2,...p_K)$, $\hat\lambda_{ij} = \lambda_j/\lambda_i$, $\hat P_{ij} = P_j/P_i$, and $\hat B_{ij} = B_j/B_i$. \end{theorem} From \eqref{eq:Mb-ith-tier-BSActivity}, the mean local delay of the typical user connecting to the $i$-th tier is given by \begin{equation}\label{eq:MLDp} M_{-1\mid(i)}(\bm p) = \frac{1}{D_i(\bm p)},~~{\bm p}\in \mathcal{S}_i, \end{equation}where \begin{align}\label{eq:Di} D_i(\bm p) &= 1-\frac{p_i\theta\delta}{1-\delta}\:_2F_1(1,1-\delta;2-\delta;-\theta(1-p_i)) \nonumber\\ &~~~~+\sum\limits_{j\neq i}\frac{\lambda_j}{\lambda_i}\Big(\frac{P_jB_j}{P_iB_i}\Big)^\delta\Big(1-\frac{p_j\theta\delta}{1-\delta}\:_2F_1(1,1-\delta;2-\delta;-\theta B_iB_j^{-1}(1-p_j))\Big), \end{align} and $\mathcal{S}_i$ is the region for $\bm p$ in which the mean local delay is finite for the $i$-th tier, defined by \begin{equation}\label{eq:FiniteRegion} \mathcal{S}_i\triangleq\{(p_1,p_2,...p_K)\in[0,1]^K:D_i(\bm p)>0\} . \end{equation} The boundary of the region for the finite mean local delay for the $i$-th tier is then defined as \begin{equation}\label{eq:FiniteBoundary} \partial\mathcal{S}_i\triangleq\{(p_1,p_2,...p_K)\in[0,1]^K:D_i(\bm p)=0\} . \end{equation} The region of all tiers is then given by the intersection \begin{equation}\label{eq:FiniteRegionAll} \mathcal{S}\triangleq\bigcap\limits_{i\in[K]}\mathcal{S}_i. \end{equation} A simple but reasonable inference from \eqref{eq:MLDp} and \eqref{eq:Di} is that for small $\bm p$, the mean local delay is finite since the interference is low and most of the users in each tier have a high conditional success probability, as $\bm p$ grows higher, the interference gets severe, and with $\bm p$ increasing to some critical threshold, $D_i(\bm p)$ will go to zero, resulting in the infinite mean local delay. It is hard to exactly characterize $\mathcal{S}_i$, next we provide a lower bound $\partial\mathcal{\check S}_i$ of $\mathcal{S}_i$ to shed light on the effect of the base station activity probabilities $\bm{p}$. By noticing that \begin{align} _2F_1(1,1-\delta;2-\delta;-z) &\eqa (1+z)^{-1} \:_2F_1\Big(1,1;2-\delta;\frac{z}{1+z}\Big) \nonumber\\ &\eqb (1+z)^{-1} \sum\limits_{m=0}^{\infty} \frac{(1)_m (1)_m}{(2-\delta)_m}\frac{u^m}{m!} \nonumber\\ &= (1+z)^{-1} \sum\limits_{m=0}^{\infty} \frac{(1)_m}{(2-\delta)_m} u^m \nonumber\\ &< (1+z)^{-1}\Big(1+ \frac{1}{2-\delta}u +\frac{1}{2-\delta}u^2 + ... \Big) \nonumber\\ &= (1+z)^{-1}\Big(1+\frac{1}{2-\delta}\frac{u}{1-u}\Big) \nonumber\\ &= (1+z)^{-1}\Big(1+\frac{1}{2-\delta}z\Big), \end{align} where (a) is by the Euler's transformation; (b) is by the series form of the Gaussian hypergeometric function $_2F_1$ and $(q)_m\equiv\frac{\Gamma(q+m)}{\Gamma(q)}$ is the Pochhammer function (rising factorial). The boundary is given by \begin{equation}\label{eq:FiniteInnerBound} \partial\mathcal{\check S}_i=\{(p_1,p_2,...p_K)\in[0,1]^K:\check D_i(\bm p)=0\}, \end{equation} where \begin{equation}\label{eq:checkDfun} \check D_i(\bm p) = \sum\limits_j\frac{\lambda_j}{\lambda_i}\bigg(\frac{P_jB_j}{P_iB_i}\Big)^\delta \Big(1-\frac{p_j\theta\delta}{1-\delta}\Big(1+\theta\frac{B_i}{B_j}(1-p_j)\Big)^{-1}\Big(1+\frac{\theta B_i(1-p_j)}{(2-\delta)B_j}\Big)\bigg). \end{equation} \section{Applications in Two-tier HCNs}\label{sec:Apps} In this section, we apply the meta distribution framework developed in Sec.~\ref{sec:MainResults} to the two-tier HIP model and show the corresponding numerical results. Since the performances are affected only by the ratios between the densities, transmit powers and biases of the two tiers, we assume $P_1=\lambda_1=B_1=1$ without loss of generality. \subsection{Moments} Defining $f_b(x)\triangleq \:_2F_1(b,-\delta; 1-\delta; -x)$, we obtain the first moment and variance for each tier from Cor.~\ref{thm:Mb-ith-tier}, \begin{equation}\label{eq:M1tier1} M_{1\mid (1)} = \frac{1+\lambda_2 (P_2 B_2)^\delta}{f_1(\theta)+\lambda_2 (P_2 B_2)^\delta~ f_1(\theta B_2^{-1})}, \end{equation} \begin{equation}\label{eq:M1tier2} M_{1\mid (2)} = \frac{1+\lambda_2^{-1} (P_2 B_2)^{-\delta}}{f_1(\theta)+\lambda_2^{-1} (P_2 B_2)^{-\delta}~ f_1(\theta B_2)}, \end{equation} \begin{equation}\label{eq:V1} V_{(1)} = \frac{1+\lambda_2 (P_2 B_2)^\delta}{f_2(\theta)+\lambda_2 (P_2 B_2)^\delta~ f_2(\theta B_2^{-1})}-\Big(\frac{1+\lambda_2 (P_2 B_2)^\delta}{f_1(\theta)+\lambda_2 (P_2 B_2)^\delta~ f_1(\theta B_2^{-1})}\Big)^2, \end{equation} \begin{equation}\label{eq:V2} V_{(2)} = \frac{1+\lambda_2^{-1} (P_2 B_2)^{-\delta}}{f_2(\theta)+\lambda_2^{-1} (P_2 B_2)^{-\delta}~ f_2(\theta B_2)}-\Big(\frac{1+\lambda_2^{-1} (P_2 B_2)^{-\delta}}{f_1(\theta)+\lambda_2^{-1} (P_2 B_2)^{-\delta}~ f_1(\theta B_2)}\Big)^2. \end{equation} \begin{figure} [!t] \begin{center} \includegraphics[width=0.95\figwidth]{Figs/M1vsTheta.eps} \caption{$M_1$ of the typical user in each tier versus $\theta$ with $\alpha=4$, $P_2=0.2$ and $\lambda_2=5$. In this case, for $B_2=1$, $p_{\rm a}^{(1)}=0.5$ and $p_{\rm a}^{(2)}=0.5$; for $B_2=0.1$, $p_{\rm a}^{(1)}=0.59$ and $p_{\rm a}^{(2)}=0.41$; for $B_2=10$, $p_{\rm a}^{(1)}=0.12$ and $p_{\rm a}^{(2)}=0.88$.} \label{fig:M1vsTheta} \end{center} \end{figure} \begin{figure} [!t] \begin{center} \includegraphics[width=0.95\figwidth]{Figs/VarvsTheta.eps} \caption{$V$ of the typical user in each tier versus $\theta$ with $\alpha=4$, $P_2=0.2$ and $\lambda_2=5$. In this case, for $B_2=1$, $p_{\rm a}^{(1)}=0.5$ and $p_{\rm a}^{(2)}=0.5$; for $B_2=0.1$, $p_{\rm a}^{(1)}=0.59$ and $p_{\rm a}^{(2)}=0.41$; for $B_2=10$, $p_{\rm a}^{(1)}=0.12$ and $p_{\rm a}^{(2)}=0.88$.} \label{fig:VarvsTheta} \end{center} \end{figure} \figref{fig:M1vsTheta} and \figref{fig:VarvsTheta} show $M_1$ and $V$ of each tier in a two-tier HCN. We can see that if there is no bias (\ie, $B_1=B_2=1$), the curves of $M_1$ and $V$ of both tiers coincide, which implies that the two tiers have the same SIR statistics regardless of their different densities and powers. However, the inequality in range expansion bias results in the separation between these two tiers in terms of $M_1$ and $V$. Specifically, since biasing means offloading, we can draw the conclusion that offloading from one tier to the other will always benefit $M_1$ of the former, while harming the latter for any given $\theta$. \subsection{Beta Approximations} In \figref{fig:MetaDistr_theta0dB_B2_10dB}, we see that this approximation is also excellent for HCNs with biases. \begin{figure} [!t] \begin{center} \includegraphics[width=0.95\figwidth]{Figs/MetaDistr_theta0dB_B2_10dB.eps} \caption{The exact meta distribution for the overall network and for each tier of a two-tier HCN with $\theta=0$ dB, $\alpha=4$, $\lambda_1=1$, $\lambda_2=5$, $P_1=1$, $P_2=0.2$, $B_1=1$ and $B_2=10$. The solid lines correspond to the exact results and the dashed lines are the beta approximations.} \label{fig:MetaDistr_theta0dB_B2_10dB} \end{center} \end{figure} \subsection{Horizontal Shifting via Asymptotic SIR Gains} For the two-tier HCN example, the asymptotic SIR gain for $M_1$ of each tier is respectively given by $G_{0,1}^{(1)} = \frac{1+\lambda_2 P_2^\delta B_2^\delta}{1+\lambda_2 P_2^\delta B_2^{\delta-1}}$ and $G_{0,1}^{(2)} = \frac{1+\lambda_2^{-1} P_2^{-\delta} B_2^{-\delta}}{1+\lambda_2^{-1} P_2^{-\delta} B_2^{1-\delta}}$. Numerically, for the case $B_2=10$ dB shown in \figref{fig:M1vsTheta} and \figref{fig:VarvsTheta}, $G_{0,1}^{(1)} = 6.75$ dB, $G_{0,1}^{(2)} = -3.25$ dB, $G_{0,2}^{(1)} = 3.74$ dB, $G_{0,2}^{(2)} = -6.27$ dB, $G_{\infty,1}^{(1)} = 9.94$ dB, $G_{\infty,1}^{(2)} = -2.06$ dB, $G_{\infty,2}^{(1)} = 4.42$ dB and $G_{\infty,2}^{(2)} = -5.58$ dB. \figref{fig:HorizonShift2_B2_10} shows the comparison between the exact $b$-th moment curves and the shifted versions of the $M_1$ of a single-tier PPP as the reference model and \figref{fig:HorizonShiftVar_B2_10} shows the comparison between the exact variance curves and the shifted versions of the variance of a single-tier PPP as the reference model. We can see that the shifted versions by using the asymptotic gain are excellent approximations for the exact results. \begin{figure} [!t] \begin{center} \includegraphics[width=0.95\figwidth]{Figs/HorizonShift2_B2_10.eps} \caption{Illustration for the asymptotic gain of $M_b$ in each tier of a two-tier HCN relative to $M_1$ of a single-tier PPP. In this case, $\alpha=4$, $P_2=0.2$ and $\lambda_2=5$, $B_2=10$ dB. The solid lines correspond to the exact results and the dashed lines are the shifted versions of $M_1$ of the single-tier PPP by $G_{0,b}^{(i)}$ and $G_{\infty,b}^{(i)}$, $i=1,2$, respectively.} \label{fig:HorizonShift2_B2_10} \end{center} \end{figure} \begin{figure} [!t] \begin{center} \includegraphics[width=0.95\figwidth]{Figs/HorizonShiftVar_B2_10.eps} \caption{Illustration for the asymptotic gain of $V^{(i)}(\theta)$ of a two-tier HCN relative to the variance of a single-tier PPP. In this case, $\alpha=4$, $P_2=0.2$ and $\lambda_2=5$, $B_2=10$ dB. The solid lines correspond to the exact results and the dashed lines are the shifted versions of $V(\theta)$ of the single-tier PPP by the asymptotic gains $G_{0,b}^{(i)}$ and $G_{\infty,b}^{(i)}$, $i=1,2$, respectively.} \label{fig:HorizonShiftVar_B2_10} \end{center} \end{figure} \subsection{Effects of Biasing} In this section, we study the effects of range expansion biases on the coverage performance of each individual tier and the whole network. Sometimes, it is convenient and of significance to consider the asymptotic performance of the range expansion biases. \begin{corollary}\label{cor:AsympB2} For $B_2\to \infty$, which means that tier 1 is closed-access, we have \begin{itemize}[\rm (a)] \item[\rm (a)] $\displaystyle M_{1\mid (1)}\sim 1,~ M_{1\mid (2)}\sim \frac{\lambda_2 P_2^\delta \sinc\delta}{F(\delta,\theta)\lambda_2 P_2^\delta \sinc\delta + \theta^\delta}$; further, for $\displaystyle \theta\to\infty,~ M_{1\mid (2)}\sim \frac{\lambda_2 P_2^\delta \sinc\delta}{\theta^\delta(1+\lambda_2 P_2^\delta)}$; \vspace{2pt} \item[\rm (b)] $\displaystyle V_{(1)}\to 0,~ V_{(2)}\sim \frac{1}{F(\delta,\theta)+\frac{3-2\delta}{(2-\delta)\lambda_2 P_2^\delta \sinc\delta}\theta^\delta}-\Big(\frac{\lambda_2 P_2^\delta \sinc\delta}{F(\delta,\theta)\lambda_2 P_2^\delta \sinc\delta + \theta^\delta}\Big)^2$; further, for $\displaystyle \theta\to\infty,~ V_{(2)}\sim \frac{\lambda_2 P_2^\delta \sinc\delta}{\theta^\delta (1+\delta)(1+\lambda_2 P_2^\delta)} - \frac{\lambda_2^2 P_2^{2\delta} \sinc^2\delta}{\theta^{2\delta} (1+\lambda_2 P_2^\delta)^2}$, \end{itemize} where $F(\delta,\theta)=\:_2F_1(1,-\delta; 1-\delta; -\theta)$. \end{corollary} \begin{IEEEproof} These results are easily obtained by using \eqref{eq:Asymp2F1_Inf} in Lem.~\ref{lem:Asymp2F1} by noting that $T(1)=\frac{1}{\sinc\delta}$, $T(2)=\frac{1+\delta}{\sinc\delta}$ and the identity $_2F_1(a, b; c; 0)\equiv 1$. \end{IEEEproof} \begin{corollary}\label{cor:EffectBiasM1} $B_2>1 \Leftrightarrow M_{1\mid (1)}>M_{1\mid (2)}$. \end{corollary} \begin{IEEEproof} Since $f_1(x)$ is monotonically increasing, we have $f_1(\theta B_2)>f_1(\theta)>f_1(\theta B_2^{-1})$ for $B_2>1$. Then from \eqref{eq:M1tier1} and \eqref{eq:M1tier2} we have $M_{1\mid (1)}>\frac{1}{1+f_1(\theta)}$ while $M_{1\mid (2)}<\frac{1}{1+f_1(\theta)}$. \end{IEEEproof} In words, offloading from one tier to the other will harm the average success probability of the latter tier. As for the overall typical user, according to Thm.~\ref{thm:Mb_RE}, its first moment and variance of the conditional success probability are, respectively, given by \begin{equation} M_1(B_2) = \frac{1}{f_1(\theta)+\lambda_2 (P_2 B_2)^\delta f_1(\theta B_2^{-1})} + \frac{1}{f_1(\theta)+\lambda_2^{-1} (P_2 B_2)^{-\delta}f_1(\theta B_2)}, \end{equation} \begin{align} V(B_2) &= \frac{1}{f_2(\theta)+\lambda_2 (P_2 B_2)^\delta f_2(\theta B_2^{-1})} + \frac{1}{f_2(\theta)+\lambda_2^{-1} (P_2 B_2)^{-\delta} f_2(\theta B_2)} \nonumber \\ &~ -\Bigg(\frac{1}{f_1(\theta)+\lambda_2 (P_2 B_2)^\delta f_1(\theta B_2^{-1})} + \frac{1}{f_1(\theta)+\lambda_2^{-1} (P_2 B_2)^{-\delta} f_1(\theta B_2)} \Bigg)^2. \end{align} We can prove that $\frac{\partial M_1}{\partial B_2}\Big |_{B_2=1} = 0$, $\frac{\partial V}{\partial B_2}\Big |_{B_2=1} = 0$, which means $B_2=1$ is an extreme point. Also, $\frac{\partial^2 M_1}{\partial B_2^2}\Big |_{B_2=1} \leq 0$, hence $B_2=1$ is the maximal point of $M_1$ (see that shown in \figref{fig:M1B2} ). For the second derivative of $V$ at $B_2=1$, it is not easy to judge its sign across different values of $B_2$ since it is related to the value of $\theta$. But we can observe this from the analytical curves shown in \figref{fig:VarV2} that $B_2 = 1$ is the local minimum. \begin{figure} [!t] \begin{center} \includegraphics[width=\figwidth]{Figs/M1_B2.eps} \caption{Analytical results for $M_1$ of the typical user of the entire network versus $B_2$ with $\alpha=4$, $P_2=0.2$ and $\lambda_2=4$.} \label{fig:M1B2} \end{center} \end{figure} \begin{figure} [!ht] \begin{center} \includegraphics[width=\figwidth]{Figs/Var_B2.eps} \caption{Analytical results for $V$ of the typical user of the entire network versus $B_2$ with $\alpha=4$, $P_2=0.2$ and $\lambda_2=4$.} \label{fig:VarV2} \end{center} \end{figure} \begin{figure} [!t] \begin{center} \includegraphics[width=0.95\figwidth]{Figs/Asym_V_B2_60dB.eps} \caption{Asymptotic $V$ of the typical user in the pico tier versus $\theta$ with $\alpha=4$, $P_2=0.2$ and $\lambda_2=5$.} \label{fig:Asym_V2} \end{center} \end{figure} \begin{figure*}[!t] \begin{minipage}{0.45\linewidth} \centerline{\includegraphics[width=0.95\figwidth]{Figs/Asym_M1_B2_30dB.eps}} \caption{Asymptotic $M_1$ of the typical user in the pico tier versus $\theta$ with $\alpha=4$, $P_2=0.2$ and $\lambda_2=5$.} \label{fig:Asym_M1_B2_30dB} \end{minipage} \hfill \begin{minipage}{0.45\linewidth} \centerline{\includegraphics[width=0.95\figwidth]{Figs/Asym_V_B2_30dB.eps}} \caption{Asymptotic $V$ of the typical user in the pico tier versus $\theta$ with $\alpha=4$, $P_2=0.2$ and $\lambda_2=5$.} \label{fig:Asym_V_B2_30dB} \end{minipage} \end{figure*} Based on the above analysis, for the $M_1$ of the overall users in a general $K$-tier HCN, we have the following corollary. \begin{corollary} For the $K$-tier HIP model, setting all bias terms $B_i$ to the same value (i.e., no biasing) maximizes $M_1(\theta)$ of the overall typical user for all $\theta>0$. \end{corollary} \begin{IEEEproof} For an arbitrary realization of the point process $\Psi$, determine the local-average SIR, which is equal to \eqref{eq:SIR_typ} but without the fading coefficients (see \cite[Eqn. (11)]{George17}) for all users for $B_i=1, i\in[K]$ (no biasing). This is by definition the best local-average SIR that each user can achieve. Consequently, if for any tier $i$, $B_i\neq 1$, there will be some users whose local-average SIR will decrease since they are no longer associated with the strongest-on-average BS. This implies that $M_1$ decreases. \end{IEEEproof} \begin{remark} For a general $K$-tier HCN with range expansion bias $B_i$ in the $i$-th tier, it is not easy to determine whether $B_i>1$ is harmful to the coverage performance in terms of $M_1$ for the $i$-th tier than the case with $B_i=1$. Since what play the decisive role are the ratios between $B_i$ and the bias values of the other tiers, which, in essence, reflect the offloading relationship among different tiers. In particular, $B_i/B_j < 1$ means offloading from the $i$-th tier to the $j$-th tier and vice versa. Hence, for a two-tier case, if some of the users in the first tier are offloaded to the second tier, then the latter definitely suffers a loss in $M_1$; however, for a three-tier case, if some of the users in the first tier are offloaded to the second tier, but some users belong to the second tier are also offloaded to the third tier, then for the second tier, its $M_1$ may improve. \end{remark} \subsection{Lower Bounds of the Mean Local Delay with Random BS Activity} Specifically, for a two-tier HIP model, we have the following corollary. \begin{corollary}\label{cor:2tierProbBound} For a two-tier HCN, given all the other parameters, \begin{enumerate}[(1)] \item if $B_1=B_2$, then $\mathcal{S}=\mathcal{S}_1 = \mathcal{S}_2$; \item if $B_i>B_j$, then $\mathcal{S}=\mathcal{S}_j$, $i,j\in\{1,2\}$; \item if $\theta < \frac{1-\delta}{\delta}$, then $\mathcal{S}=\mathcal{S}_1 = \mathcal{S}_2=[0,1]^2$. \end{enumerate} \end{corollary} \begin{proof} For a two-tier HCN, we have \begin{align}\label{eq:D_1st} D_1(p_1,p_2) &= \underbrace{1-\frac{p_1\theta\delta}{1-\delta} \:_2F_1(1,1-\delta;2-\delta;-\theta(1-p_1))}_{A_1} \nonumber\\ &~~+ \frac{\lambda_2}{\lambda_1}\Big(\frac{P_2B_2}{P_1B_1}\Big)^\delta \bigg(\underbrace{1-\frac{p_2\theta\delta}{1-\delta} \:_2F_1\Big(1,1-\delta;2-\delta;-\theta(1-p_2)\frac{B_1}{B_2}\Big)}_{G_2}\bigg), \end{align} \begin{align}\label{eq:D_2nd} D_2(p_1,p_2) &= \underbrace{1-\frac{p_2\theta\delta}{1-\delta} \:_2F_1(1,1-\delta;2-\delta;-\theta(1-p_2))}_{G_1} \nonumber\\ &~~+ \frac{\lambda_1}{\lambda_2}\Big(\frac{P_1B_1}{P_2B_2}\Big)^\delta \bigg(\underbrace{1-\frac{p_1\theta\delta}{1-\delta} \:_2F_1\Big(1,1-\delta;2-\delta;-\theta(1-p_1)\frac{B_2}{B_1}\Big)}_{A_2}\bigg). \end{align} \begin{enumerate}[(1)] \item For $B_1=B_2$, let $g(x) = 1-\frac{x\theta\delta}{1-\delta} \:_2F_1(1,1-\delta;2-\delta;-\theta(1-x))$, $c=\frac{\lambda_2}{\lambda_1}\big(\frac{P_2}{P_1}\big)^\delta$, then $D_1(p_1,p_2) = g(p_1) + cg(p_2)$, $D_2(p_1,p_2) = \frac{D_1(p_1,p_2)}{c}$, since $c>0$, it is obvious that $D_1(p_1,p_2)$ and $D_2(p_1,p_2)$ always get negative at the same $(p_1,p_2)$. Hence $\mathcal{S}_1$ and $\mathcal{S}_2$ share the same boundary and thus $\mathcal{S}_1=\mathcal{S}_2$. \item Without loss of generality, we assume $B_2>B_1$. Let $d=\frac{B_2}{B_1}>1$, then $D_1(p_1,p_2) = A_1+cd^\delta G_2$, $D_2(p_1,p_2) = \frac{A_2+cd^\delta G_1}{cd^\delta}$. Since $_2F_1(1,1-\delta;2-\delta;-z)$ is a monotonically decreasing function of $z$ for $z\geq0$, which is easy to be proved by its first-order derivative, for given $p_1, p_2$, we have $A_1<A_2$, $G_1>G_2$, hence as $p_1$ and (or) $p_2$ increase, $D_1(p_1,p_2)$ will decrease to zero first, resulting in $\mathcal{S}_1\subset\mathcal{S}_2$. \item Let $p_1=p_2=1$, then $\check D_i(1,1) = \big(1+\sum_{j\neq i} \frac{\lambda_j}{\lambda_i} \big(\frac{P_j B_j}{P_i B_i}\big)^\delta\big) \big(1-\theta\frac{\delta}{1-\delta}\big)$, $\check D_i(1,1)>0$ requires $\theta<\frac{1-\delta}{\delta}$. \end{enumerate}\vspace{-0.8cm} \end{proof} \begin{figure} [!t] \begin{center} \includegraphics[width=0.95\figwidth]{Figs/InnerBound2.eps} \caption{The exact boundary $\partial\mathcal{S}_1$ and its lower bound $\partial\mathcal{\check S}_1$ of a two-tier HCN with $\alpha=4$, $\lambda_2/\lambda_1=25$, $P_1/P_2=200$ and $B_2/B_1=10$. In this case, $\mathcal{S}=\mathcal{S}_1$.} \label{fig:InnerBound} \end{center} \end{figure} \vspace{0.5cm} In \figref{fig:InnerBound}, the exact boundary $\partial\mathcal{S}_1$ and its lower bound $\partial\mathcal{\check S}_1$ of a two-tier HCN are shown. As we see, the lower bound becomes tighter as $\theta$ decreases. In this case, according to Cor.~\ref{cor:2tierProbBound}(2), $\mathcal{S}=\mathcal{S}_1$. We also observe that as $\theta$ decreases, $\mathcal{S}$ grows towards $[0,1]^2.$ \section{Conclusions}\label{sec:Conclusion} In this paper, we developed the SIR meta distribution framework for the analysis of HIP-based $K$-tier HCNs with offloading biases and Rayleigh fading and performed a systematic study for a series of key performance metrics, revealing fine-grained information on the per-user performance. We first derived the $b$-th moment of the conditional success probability for both the entire network and each single tier. Based on the $b$-th moment, the exact meta distribution as well as a simple yet accurate approximation based on beta distribution is provided. We derived the asymptotic gains and found that for any specific tier, the $b$-th moment as well as the variance of the conditional success probability is approximately a horizontal shifted version of that in a single-tier PPP, and hence horizontal shifted versions of each other. About the effect of the offloading biases, we proved that $M_1$ of the whole network is always harmed by any biasing; for multi-tier (more than $3$) HIP-based HCNs, users of certain tiers will benefit while the others suffer, which depends on the relative ratios of the biases between different tiers. The effect on the per-tier success probability can be quantified using a horizontal shift of the SIR distribution. The $b$-th moment of the conditional success probability under the independent ALOHA-like random base station activities was also addressed. The region of the activity probabilities in which the mean local delay of each tier remains finite is characterized by a lower bound, which was shown to be accurate enough compared to the exact one. Overall, the SIR meta distribution framework offers several new and interesting insights in the performance of HCNs, which helps us understand the HCNs better and hence benefits the real network design and optimization.
{'timestamp': '2018-03-02T02:05:57', 'yymm': '1803', 'arxiv_id': '1803.00182', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00182'}
arxiv
\section{Introduction} The bilateral filter (BF) is probably one of the most fundamental tools in computer vision and graphics applications~\cite{Paris_BOOK_2009}. The concept of BF was first introduced by Aurich~\emph{et al}\onedot~\cite{Aurich_DAGM_1995} under the name ``nonlinear Gaussian filter'' in 1995, and then by Smith~\emph{et al}\onedot~\cite{Smith_IJCV_1997} within the so-called ``SUSAN'' approach in 1997. Later, it was rediscovered by Tomasi~\emph{et al}\onedot~\cite{Tomasi_ICCV_1998} with the current name ``bilateral filter'' in 1998. The basic idea underlying bilateral filtering is to do in the range domain of an image what traditional spatial filters~\cite{Haddad_TSP_1991} do in its spatial domain, because BF considers that two pixels which are close or visually similar to one another have the same perceptual meaning. Unlike traditional spatial filters, the weights of BF take into account both spatial affinity and intensity similarity with respect to the central pixel. Therefore BF can be used to preserve edges while performing smoothing. BF's output at pixel $\bm{x} = (x, y)$ is a weighted average of its neighbors $\mathcal{N}_{\bm{x}}$. The weights assigned to the pixels in $\mathcal{N}_{\bm{x}}$ are inversely proportional to both the distance in the spatial domain $\mathcal{S}$ and the dissimilarity in the range domain $\mathcal{R}$. Let $I$ be a gray-level image, $K_r(x)$ and $K_s(x)$ be decreasing functions on the region $\mathbb{R}^+$ and symmetric functions on the entire definition domain $\mathbb{R}$, BF is specified as follows: \begin{IEEEeqnarray}{C} \hat{I}(\bm{x}) = \frac{\sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| \bm{x} - \bm{y} \|) K_r( I(\bm{x}) - I(\bm{y}) ) I(\bm{y}) }{ \sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s( \| \bm{x} - \bm{y}\| ) K_r(I(\bm{x}) - I(\bm{y})) } \label{eq:BF} \end{IEEEeqnarray} Although the Gaussian function $G_{\sigma}(x) = \exp(-{x^2}/{2\sigma^2})$ is a common choice for the spatial and range kernels, the options are not unique. More candidates can be found in~\cite{Durand_TOG_2002}. As a simple, non-iterative and edge-preserving filtering tool, BF has been found with a wide range of applications such as stereo matching~\cite{Yang_TPAMI_2014}, flash and no-flash images fusion~\cite{Petschnigg_TOG_2004} and contrast enhancement~\cite{Elad_SS_2005}. However, on the flip side of the power, the complexity of its brute-force implementation is $O(|\mathcal{N}_{\bm{x}}||I|)$, where $|I|$ is the number of pixels of the image $I$ and $|\mathcal{N}_{\bm{x}}|$ is the size of the neighborhood $\mathcal{N}_{\bm{x}}$. Since $O(|\mathcal{N}_{\bm{x}}||I|)$ relies on the size of $\mathcal{N}_{\bm{x}}$, the run time increases with the size of $\mathcal{N}_{\bm{x}}$. We thus have to spend several minutes for final results when $\mathcal{N}_{\bm{x}}$ is large. It is unacceptable for time-critical applications, such as stereo matching~\cite{Ansar_3DPVT_2004} and video abstraction~\cite{Winnemoller_TOG_2006}. Considering the importance of BF in practice, we will study and retrofit the acceleration of BF to reduce its computational complexity from $O(|\mathcal{N}_{\bm{x}}||I|)$ down to $O(|I|)$. A typical acceleration approach is first to decompose $\sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s( \|\bm{x} - \bm{y}\|) K_r(I(\bm{x})-I(\bm{y})) I(\bm{y}) $ into a set of linear convolutions $\sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\|\bm{x} - \bm{y}\|) g(\bm{y}) $ and then to speed up the linear convolution, where $g(\bm{x})$ is a scalar function. % % In the literature, a distinction was made between the two operations and therefore different strategies are adopted to accelerate them. Particularly, some fast implementations are limited to accelerate the specific Gaussian kernel. Unlike these approaches, we propose a unified framework to complete the two tasks. At first, we take advantage of the best $N$-term approximation of $K_r(x)$ on truncated trigonometric functions to transform $\sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\|\bm{x} - \bm{y}\|) K_r(I(\bm{x}) - I(\bm{y})) I(\bm{y}) $ into a set of linear convolution $\sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\|\bm{x} - \bm{y}\|) g(\bm{y}) $, then we exploit the best $N$-term approximation of $K_s(x)$ on 2-D Haar functions to decompose $\sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\|\bm{x} - \bm{y}\|) g(\bm{y}) $ into a set of 3-D box filters. More importantly, we disclose that our implementation cannot only be fast computed by the summed area table~\cite{Crow_SIGGRAPH_1984}, but also be used to speed up BF with arbitrary kernels Contributions of this paper are fourfold: $\bm{1)}$, we propose the truncated kernels which are exploited to replace BF's original kernels; $\bm{2)}$, we use the best $N$-term approximation on Haar functions and truncated trigonometric functions to approximate the truncated spatial and range kernels respectively; $\bm{3)}$, we find that the product of the two best $N$-term approximations can be fast computed by 3-D box filters; $\bm{4)}$, compared with other methods, our filtering accuracy can be significantly improved without sacrificing efficiency. In order to clarify our contribution, the rest of this paper is structured as follows. First, existing fast bilateral filtering algorithms are reviewed in section~\ref{sec:related_work}. After that, section~\ref{sec:techniques} lists the background techniques. Sequentially, our proposed method is described in section~\ref{sec:method} and a full comparison is conducted with other acceleration techniques in section~\ref{sec:comparison}. \section{Related work} \label{sec:related_work} Fast implementations of BF can be roughly divided into two categories: the first one is the high-dimensional implementations~\cite{Adams_TOG_2009,Adams_CGF_2010,Yoshizawa_CGF_2010}, the second one is the low-dimensional case. In this paper, we focus on the second one. For a clear description of our method, we briefly introduce the low dimensional acceleration algorithms in two aspects below. \subsection{Speeding up the linear convolution of $K_s(x)$} Acceleration techniques of computing $\sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\|\bm{x} - \bm{y}\|) g(\bm{y})$ have been well studied in the literature. Here, we roughly divided them into three classes: Fast Fourier Transform, Kernel separation and Box filtering. \subsubsection{Fast Fourier Transform (FFT)} Durand~\emph{et al}\onedot~\cite{Durand_TOG_2002} first employed FFT to fast compute $\sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| \bm{x} - \bm{y} \|) g(\bm{y})$ as the linear convolution of $K_s(x)$ can be greatly accelerated using FFT. In mathematics, an $O(|\mathcal{N}_{\bm{x}}||I|)$ convolution with arbitrary $K_s(x)$ in the spatial domain becomes multiplication in the frequency domain with $O(|I|)$ complexity. Although FFT can be used to produce accurate filtering, FFT and its inverse have the cost $O(|I| \log (|I|))$. But, in practice, an algorithm with linear complexity $O(|I|)$ is preferred. \subsubsection{Kernel separation} Kernel separation based methods decompose 2-D filter kernel into two 1-D kernels. Rows of an image are filtered at first. After that, the intermediate result is filtered along the columns~\cite{Pham_ICME_2005}. Yang~\emph{et al}\onedot~\cite{Yang_CVPR_2009} advocated using Deriche's recursive method~\cite{Rachid_TR_1993} to approximate Gaussian filtering. More methods can be found in \cite{Getreuer_ipol_2013}. Compared with FFT, this kind of algorithms is much faster, but they do not perform well in texture regions. \subsubsection{Box filtering} A 2-D box filter $\ddot{B}(\bm{x})$ is a spatial domain linear filter in which each pixel $\bm{x}$ has a value equal to the average of its neighboring pixels $\bm{y} \in \mathcal{N}_{\bm{x}}$ of the input image. Due to the property of equal weights, box filters can be implemented using the summed area table~\cite{Crow_SIGGRAPH_1984} which is significantly faster than using a sliding window algorithm. Note that box filters can be used to approximate the Gaussian filter. In order to decompose the Gaussian spatial kernel into several box functions, Zhang \emph{et al}\onedot~\cite{Zhang_TIP_2012} employed the de Moivre-Laplace theorem, which says that for $k$ in the neighborhood of $np$, $\lim \limits_{n \rightarrow \infty}{n \choose k} p^k (1-p)^{n-k} = \frac{1}{\sqrt{2\pi np(1-p)}} \exp(-\frac{(k-np)^2}{2np(1-p)}) $. The method however is not problem-free because it can only be applied to speed up the Gaussian filter. Gunturk~\cite{Gunturk_TIP_2011} generalized the Gaussian spatial kernel to arbitrary kernels and employed the least squares optimization to find the optimal coefficients $\beta^s_i$ that minimize the approximation error $(K_s(\|\bm{x}\|) - \sum_{i = 1}^{M_s} \beta^s_i \ddot{B}_{\mathcal{N}^i_{\bm{x}}}(\bm{x}))^2$. Unlike Gunturk, Pan~\emph{et al}\onedot~\cite{Pan_MPE_2014} formulated their objective function from the sparsity perspective and exploited the efficient Batch-OMP algorithm~\cite{Ron_TR_2008} to solve the optimal coefficients $\beta^s_i$ as well as the window radius of $\mathcal{N}^i_{\bm{x}}$. \subsection{Speeding up the nonlinear convolution of $K_r(x)$} Unlike the spatial kernel $K_s(x)$, the range kernel $K_r(x)$ introduces nonlinearity to BF as $K_r(I(\bm{x}) - I(\bm{y}))$ is signal-dependent. A common idea shared by algorithm designers to speed up $\sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\|\bm{x} - \bm{y}\|) K_r(I(\bm{x}) - I(\bm{y})) I(\bm{y}) $ is to transform the nonlinear convolution of $K_r(x)$ into a set of linear convolutions of $K_s(x)$. Roughly, there are three kinds of acceleration techniques which are dimension promotion, principle bilateral filtered image component and shiftability property, respectively. \subsubsection{Dimension promotion} This acceleration technique is obtained through representing an image in 3-D space by adding the intensity to the spatial domain of an image as the 2-D nonlinear convolution of $K_r(x)$ becomes linear convolution in 3-D space which is easy to speed up. This idea is similar to the well-known level set method~\cite{Osher_JCP_1988} which considers that the breaking and merging operations are hard to perform in 2-D space, but they can be easily handled in higher dimensional space. Mathematically, let $\delta_z(x)$ be an impulse function at $z$ and $F(\bm{y}, z) = I(\bm{y}) \delta_{I(\bm{y})}(z)$, BF in~\eqref{eq:BF} can be transformed to \begin{IEEEeqnarray}{C} \hat{I}(\bm{x}) = \frac{\sum_z K_r(I(\bm{x}) - z) \sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| \bm{x} - \bm{y}\| ) F(\bm{y}, z) }{ \sum_z K_r(I(\bm{x}) - z)\sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| \bm{x} - \bm{y} \|) } \label{eq:BF_promotion} \end{IEEEeqnarray} where $z$ can be explained as the sample in the range domain. For an 8-bit image, $z \in [0, 255]$. In~\eqref{eq:BF_promotion}, BF is decomposed in the range domain, and the nonlinear relationship between $I(\bm{y})$ and $I(\bm{x})$ in the range kernel is eliminated. Hence the response of BF can be computed by first performing linear convolution on the auxiliary image $I(\bm{y}) \delta_{I(\bm{y})}(z)$ for each fixed $z$ and then calculating the sum weighted by $K_r(I(\bm{y}) - z)$ along $z$. Porikli~\cite{Porikli_CVPR_2008} first employed this technique to speed up BF. Sequentially, Zhang~\emph{et al}\onedot~\cite{Zhang_TIP_2012} applied it to the joint bilateral filtering. Incorporating with different spatial kernel acceleration methods, Gunturk~\cite{Gunturk_TIP_2011} and Pan~\emph{et al}\onedot~\cite{Pan_MPE_2014} designed two different fast BF implementations. The biggest problem of them is that they need to perform 255 times linear filtering as well as 255 addition and multiplication operations along $z$ for each fixed $\bm{y}$. This is not efficient. \subsubsection{Principle bilateral filtered image component (PBFIC)} This method was first proposed by Durand~\emph{et al}\onedot~\cite{Durand_TOG_2002} in 2002. Seven years later, Yang~\emph{et al}\onedot~\cite{Yang_CVPR_2009} generalized this idea for fast bilateral filtering with arbitrary range kernels. At first, Yang transforms BF \eqref{eq:BF} into \eqref{eq:BF_PBFIC1} by letting $I(\bm{x}) = z \in [0, 255]$ for $8$-bit images \begin{IEEEeqnarray}{C} \hat{I}(\bm{x}) = \frac{ \sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| \bm{x} - \bm{y}\| ) K_r(z - I(\bm{y}) ) I(\bm{y}) }{ \sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| \bm{x} - \bm{y} \|) K_r(z - I(\bm{y}) ) } \label{eq:BF_PBFIC1} \end{IEEEeqnarray} then he defines PBFIC $\hat{I}_z(\bm{x})$ as \begin{IEEEeqnarray}{C} \hat{I}_z(\bm{x}) = \frac{ \sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| \bm{x} - \bm{y} \|) J_z(\bm{y}) }{ \sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| \bm{x} - \bm{y} \|) W_z(\bm{y}) } \label{eq:BF_PBFIC} \end{IEEEeqnarray} where $W_z(\bm{y}) = K_r(z - I(\bm{y}))$ and $J_z(\bm{y}) = W_z(\bm{y}) I(\bm{y})$. According to \eqref{eq:BF_PBFIC1} \eqref{eq:BF_PBFIC}, BF is decomposed into a set of linear filter responses $\hat{I}_z(\bm{x})$. So that we have \begin{IEEEeqnarray}{C} \hat{I}(\bm{x}) = \hat{I}_{{I}(\bm{x})}(\bm{x}) \end{IEEEeqnarray} Further, assuming only $N$ out of 256 PBFICs are used ($z \in [L_0, \cdots, L_{N-1}]$), and the intensity $I(\bm{x}) \in [L_z, L_{z+1}]$, the value of BF can be linearly interpolated as follows: \begin{IEEEeqnarray}{C} \hat{I}(\bm{x}) = (L_{z+1} - I(\bm{x})) \hat{I}_{z}(\bm{x}) + (I(\bm{x}) - L_{z}) \hat{I}_{z+1}(\bm{x}) \label{eq:BF_PBFIC_interpolation} \end{IEEEeqnarray} PBFIC has also been used to design the bilateral grid data structure~\cite{Paris_IJCV_2009,Chen_TOG_2007} for fast BF computation. However, the approximation accuracy is usually very low because the linear interpolation is introduced to approximate filtering results. An~\emph{et al}\onedot~\cite{An_SPL_2015} provided a quantitative error analysis for it. \subsubsection{Shiftability property} A range kernel $K_r(x)$ is shiftable if there exists $N$ functions such that, for every translation $\tau$, we have \begin{IEEEeqnarray}{C} K_r( x - \tau ) = \sum_{i = 1}^N c_i(x) K_i(\tau) \end{IEEEeqnarray} Based on this shiftability property, Chaudhury~\cite{Chaudhury_SPL_2011} pointed out that BF with a shiftable range kernel $K_r(x)$ can be computed in linear complexity. This is because we have \begin{IEEEeqnarray}{C} \begin{split} & \sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| {\bm{x} - \bm{y}} \|) K_r(I(\bm{x}) - I(\bm{y})) I(\bm{y}) \\ =& \sum_{i = 1}^N c_i(I(\bm{x})) \sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| {\bm{x} - \bm{y}} \|) K_i(I(\bm{y})) I(\bm{y}) \end{split} \label{eq:shiftable} \end{IEEEeqnarray} which transforms the nonlinear convolution of the range kernel $K_r(x)$ into a set of linear convolutions of the spatial kernel $K_s(x)$ on the auxiliary image $K_i(I(\bm{y})) I(\bm{y})$. Hence, employing different acceleration methods for $K_s(x)$, we can derive different fast implementations for BF under the shiftability based acceleration framework. As for the non-shiftable range kernel, we can exploit a set of shiftable range kernels to approximate it. Following the idea, Chaudhury~\emph{et al}\onedot~\cite{Chaudhury_TIP_2011} took trigonometric functions to approximate the Gaussian range kernel as illustrated in \eqref{eq:approx_tri}. \begin{IEEEeqnarray}{C} \begin{split} & G_{\sigma}(I(\bm{x})-I(\bm{y})) \approx \sum_{n=0}^N 2^{-N} {N \choose n} \cos ( \omega_n I(\bm{x}) ) \cos ( \omega_n I(\bm{y}) ) \\ &+ \sum_{n=0}^N 2^{-N} {N \choose n} \sin ( \omega_n I(\bm{x}) ) \sin ( \omega_n I(\bm{y}) ) \end{split} \label{eq:approx_tri} \end{IEEEeqnarray} where $\omega_n = \frac{2n-N}{\sqrt{N} \sigma}$. Let $H_n(x)$ be an Hermite polynomial with order $n$, Dai~\emph{et al}\onedot~\cite{Dai_EL_2014} employed $H_n(x)$ to approximate the Gaussian range kernel as illustrated in~\eqref{eq:approx_her}. \begin{IEEEeqnarray}{C} \begin{split} & G_{\sigma}(I(\bm{x})-I(\bm{y})) \approx e^{-\frac{I^2(\bm{x})}{\sigma}} \sum_{n=0}^N H_n(\frac{I(\bm{x})}{\sigma}) \frac{I^n(\bm{y})}{n ! \sigma^{\frac{n}{2}} } \end{split} \label{eq:approx_her} \end{IEEEeqnarray} Compared with other range kernel acceleration methods, the two methods are limited to the Gaussian kernel. Another drawback shared by the two methods is reported by Chaudhury~\cite{Chaudhury_TIP_2013} who complained that it is difficult to approximate the Gaussian range kernel using above expansions when $\sigma$ is small. In particular, a great deal of approximation terms are required to get a good approximation of a narrow Gaussian function. This will considerably increase the run time. \section{Background Techniques} \label{sec:techniques} In this section, we will provide a brief introduction for the necessary background knowledge required by our method. \subsection{Best $N$-term approximation} Given a set of orthogonal basis functions $\varphi_k$ of a $L^2$ space $V$ with the 2 norm $\| \cdot \|_2$, a best $N$ term approximation $g_{\Lambda}$ to a function $f \in V$ minimizes \begin{IEEEeqnarray}{C} \begin{split} &\min_{g_{\Lambda}} \| f - g_{\Lambda} \|_2 \\ &\text{s.t.} \quad g_{\Lambda} = \sum_{k \in \Lambda } c_k \varphi_{k} \end{split} \label{eq:N_term} \end{IEEEeqnarray} where $\Lambda$ denotes the index set formed by $N$ functions $\varphi_k$ and the space of $g_{\Lambda}$, in which the approximation is sought, is the nonlinear manifold consisting of all linear combinations of the given bases with at most $N$ terms. Without solving optimization~\eqref{eq:N_term}, the best $N$-term approximation of the function $f$ can be obtained by selecting the first $N$ largest coefficients, because the orthogonal projection $g_{\Lambda}$ of $f$ on the space $V_{\Lambda}$ spanned by $\varphi_k, k \in \Lambda$ is \begin{IEEEeqnarray}{C} g_{\Lambda} = \sum_{k \in \Lambda} \langle f, \varphi_k \rangle \varphi_k \end{IEEEeqnarray} Hence, the approximation error can be rewritten as $\| f - g_{\Lambda} \|^2_2 = \sum_{k \not\in \Lambda} |\langle f, \varphi_k \rangle|^2 = \| f \|^2_2 - \sum_{k \in \Lambda} |\langle f, \varphi_k \rangle|^2$ which indicates our conclusion. Selecting the $N$ largest coefficients provides us a simple way to find the best $N$-term approximation. In the following sections, we use this strategy to find the best $N$-term approximations of the range kernel $K_r(x)$ and the spatial kernel $K_s(x)$ on 1-D truncated trigonometric functions and 2-D Haar functions respectively. \subsection{Truncated trigonometric functions} Truncated trigonometric functions form the basis function of the $L^2$ space on the interval $[-T, T]$. For arbitrary functions $f \in L^2([-T, T])$, we have \begin{IEEEeqnarray}{C} f(x) = \dot{B}(x)(\sum_{j=0}^{\infty} a_j \cos(\frac{\pi j}{T} x) + \sum_{j=1}^{\infty} b_j \sin(\frac{\pi j}{T} x)) \label{eq:1D_truncated_cos} \end{IEEEeqnarray} where $\dot{B}(x)$ denotes a 1-D box function with the support region $[-T, T]$ and \begin{IEEEeqnarray}{ll} a_0 &= \frac{1}{2T} \int_{-T}^{T} f(x) dx \\ a_j &= \frac{1}{T} \int_{-T}^{T} f(x) \cos(\frac{\pi j}{T} x) dx \\ b_j & = \frac{1}{T} \int_{-T}^{T} f(x) \sin(\frac{\pi j}{T} x) dx \end{IEEEeqnarray} Above equations are the Fourier series which is constrained on the interval $[-T, T]$. \eqref{eq:1D_truncated_cos} holds for the reason that Fourier series can decompose a periodic function into the sum of a (possibly infinite) set of simple oscillating functions, namely sines and cosines. If we define $\hat{f}$ as the periodic extension of $f$ and compute its Fourier periodic expansion, we always have $f(x) = \hat{f}(x)= \sum_{j=0}^{\infty} a_j \cos(\frac{\pi j}{T} x) + \sum_{j=1}^{\infty} b_j \sin(\frac{\pi j}{T} x)$ on the interval $[-T, T]$. \subsection{Haar functions} \begin{figure} \begin{subfigure}[b]{0.24\linewidth} \includegraphics[width=\textwidth]{Haar_phi} \caption{$\phi(x)$} \label{fig:Haar_1D:phi} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \includegraphics[width=\textwidth]{Haar_psi00} \caption{$\psi_{0,0}(x)$} \label{fig:Haar_1D:psi00} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \includegraphics[width=\textwidth]{Haar_psi1-1} \caption{$\psi_{1,-1}(x)$} \label{fig:gull} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \includegraphics[width=\textwidth]{Haar_psi1+1} \caption{$\psi_{1,1}(x)$} \label{fig:gull} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \includegraphics[width=\textwidth]{Haar_psi2-3} \caption{$\psi_{2,-2}(x)$} \label{fig:gull} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \includegraphics[width=\textwidth]{Haar_psi2-1} \caption{$\psi_{2,-1}(x)$} \label{fig:gull} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \includegraphics[width=\textwidth]{Haar_psi2+1} \caption{$\psi_{2,1}(x)$} \label{fig:gull} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \includegraphics[width=\textwidth]{Haar_psi2+3} \caption{$\psi_{2,2}(x)$} \label{fig:Haar_1D:psi23} \end{subfigure} \caption{A visual illustration of the Haar functions $\phi(x)$, $\psi_{0,0}(x)$, $\psi_{1,-1}(x)$, $\psi_{1,1}(x)$, $\psi_{2,-2}(x)$, $\psi_{2,-1}(x)$, $\psi_{2,1}(x)$ and $\psi_{2,2}(x)$, where $T = 2$} \label{fig:Haar_1D} \end{figure} Haar functions were proposed by Haar~\cite{Haar_MA_1910} in 1910 to give an example of the orthonormal system of square-integrable functions on the unit interval. In general, Haar functions are a sequence of rescaled ``square-shaped" functions. Specifically, the Haar scaling function $\phi(x)$ is defined as \begin{IEEEeqnarray}{C} \phi(x) = \begin{cases} 1 & \quad -T \leq x \leq T \\ 0& \quad \text{otherwise} \end{cases} \label{eq:Haar_scaling} \end{IEEEeqnarray} and the Haar mother function $\psi_{0,0}(x)$ is described as \begin{IEEEeqnarray}{C} \psi_{0,0}(x) = \begin{cases} 1& \quad -T \leq x < 0 \\ -1& \quad 0 \leq x \leq T \\ 0& \quad \text{otherwise} \end{cases} \label{eq:Haar_mother} \end{IEEEeqnarray} Let $\mathcal{K}_j = \{-2^{j-1}, \cdots ,-1, 1, \cdots , 2^{j-1} \} $ and $j$ be nonnegative integers. For an integer $k \in \mathcal{K}_j $, the Haar function $\psi_{j,k}(x)$ is defined by the formula \begin{IEEEeqnarray}{C} \psi_{j,k}(x) = \psi_{0,0}(2^j x - \sign(k) (2|k| - 1) T ) \label{eq:Haar_set} \end{IEEEeqnarray} So, for example, Fig.~\ref{fig:Haar_1D} illustrates $\phi(x)$ as well as the first few values of $\psi_{j,k}(x)$, where \begin{IEEEeqnarray}{lll} &\psi_{1,-1}(x) = \psi_{0,0}(2x+T) \quad& \psi_{1,1}(x) = \psi_{0,0}(2x-T) \IEEEnonumber\\ &\psi_{2,-1}(x) = \psi_{0,0}(4x+T) \quad& \psi_{2,1}(x) = \psi_{0,0}(4x-T) \IEEEnonumber\\ &\psi_{2,-2}(x) = \psi_{0,0}(4x+3T) \quad& \psi_{2,2}(x) = \psi_{0,0}(4x-3T) \IEEEnonumber \end{IEEEeqnarray} All these functions are called Haar functions and form an orthogonal basis of $L^2([-T, T])$. Then arbitrary functions $f(x) \in L^2([-T, T])$ can be written as a series expansion by \begin{IEEEeqnarray}{C} f(x) = c_0 \phi(x) + \sum_{j=0}^{\infty}\sum_{k \in \mathcal{K}_j} c_{jk} \psi_{j,k}(x) \label{eq:Haar_decomposition} \end{IEEEeqnarray} where $c_0 = \frac{\int_{-T}^T f(x) \phi(x) dx}{2T} $ and $c_{jk} = \frac{2^j \int_{-T}^T f(x) \psi_{j,k}(x) dx}{2T} $. 2-D Haar functions are a natural extension from the single dimension case. For any orthogonal basis $\varphi_k \in L^2([-T, T])$, one can associate a separable orthogonal basis $\varphi_{k_1}(x)\varphi_{k_2}(y)$ of $L^2([-T, T] \times [-T, T])$. Following the strategy, we define 2-D Haar functions as the set of $\{ \phi(x)\phi(y), \phi(x)\psi_{j_2,k_2}(y), \psi_{j_1,k_1}(x)\phi(y), \psi_{j_1,k_1}(x)\psi_{j_2,k_2}(y)\}$. Then for arbitrary functions $f(\bm{x}) \in L^2([-T, T] \times [-T, T])$, we have \begin{IEEEeqnarray}{C} \begin{split} f(\bm{x}) & = c_0 \phi(x)\phi(y) \\ & + \sum_{j_2 =0}^{\infty}\sum_{k_2 \in \mathcal{K}_{j_2}} c_{0, j_2,k_2} \phi(x)\psi_{j_2,k_2}(y) \\ & + \sum_{j_1 =0}^{\infty}\sum_{k_1 \in \mathcal{K}_{j_1}} c_{j_1,k_1,0} \psi_{j_1,k_1}(x) \phi(y) \\ & + \sum_{j_1 =0}^{\infty}\sum_{k_1 \in \mathcal{K}_{j_1}}\sum_{j_2 =0}^{\infty}\sum_{k_2 \in \mathcal{K}_{j_2}} c_{j_1,k_1,j_2,k_2} \psi_{j_1,k_1}(x)\psi_{j_2,k_2}(y) \end{split} \label{eq:Haar_expansion} \end{IEEEeqnarray} where $\bm{x} = (x,y)$ and \begin{IEEEeqnarray}{C} \begin{split} & c_0 = \frac{1}{4T^2}\int_{-T}^T \int_{-T}^T f(x,y) \phi(x)\phi(y) dxdy \\ & c_{0,j_2,k_2} = \frac{2^{j_2}}{4T^2}\int_{-T}^T \int_{-T}^T f(x,y) \phi(x)\psi_{j_2,k_2}(y) dxdy \\ & c_{j_1,k_1,0} = \frac{2^{j_1}}{4T^2}\int_{-T}^T \int_{-T}^T f(x,y) \psi_{j_1,k_1}(x)\phi(y) dxdy \\ & c_{j_1,k_1,j_2,k_2} = \frac{2^{j_1}2^{j_2}}{4T^2}\int_{-T}^T \int_{-T}^T f(x,y) \psi_{j_1,k_1}(x)\psi_{j_2,k_2}(y) dxdy \end{split} \label{eq:Haar_2D_coefficients} \end{IEEEeqnarray} \subsection{The Summed Area Table (SAT)} As a data structure for quickly and efficiently generating the sum of values in a rectangular subset of a grid, the 2-D SAT was first introduced to computer graphics society in 1984 by Crow~\cite{Crow_SIGGRAPH_1984} for texture mapping, but was not properly introduced to the world of computer vision till 2004 by Viola and Jones~\cite{Viola_IJCV_2004} with their landmark face detection algorithm to fast compute the sum of image values $I(x', y')$ on a given rectangle $\mathfrak{R} = (x_0, x_1] \times (y_0, y_1]$. \begin{IEEEeqnarray}{C} S(\mathfrak{R}) = \sum_{x_0 < x' \leq x_1} \sum_{y_0 < y' \leq y_1} I(x', y') \label{eq:sum_region_2D} \end{IEEEeqnarray} The complexity of \eqref{eq:sum_region_2D} is proportional to the size of the rectangle $\mathfrak{R}$. Viola and Jones employ the SAT $\mathbb{S}(x, y)$ in~\eqref{eq:sum_sat_2D} to compute arbitrary $S$ in constant time. \begin{IEEEeqnarray}{C} \mathbb{S}(x, y) = \sum_{0 \leq x' \leq x} \sum_{0 \leq y' \leq y} I(x', y') \label{eq:sum_sat_2D} \end{IEEEeqnarray} First, SAT can be calculated in one pass over the image $I$ by putting $c(x, -1) = \mathbb{S}(-1, y) = 0$ and using the recurrence~\eqref{eq:sum_sat_recurrence_2D} \begin{IEEEeqnarray}{lC} \begin{split} &c(x, y) = c(x, y-1) + I(x, y) \\ &\mathbb{S}(x, y) = \mathbb{S}(x-1, y) + c(x, y) \end{split} \label{eq:sum_sat_recurrence_2D} \end{IEEEeqnarray} After that, $S(\mathfrak{R})$ can be computed in linear complexity over the image $I$ according to \begin{IEEEeqnarray}{lC} S(\mathfrak{R}) = \mathbb{S}(x_1, y_1) - \mathbb{S}(x_1, y_0) - \mathbb{S}(x_0, y_1) + \mathbb{S}(x_0, y_0) \label{eq:sum_sat_sum_region_2D} \end{IEEEeqnarray} which only contains four references to $\mathbb{S}(x, y)$. A special case of the 2-D SAT is the 1-D SAT defined by $\mathbb{S}(x) = \sum_{0 \leq x' \leq x} I(x')$. We can computed it in one pass according to $\mathbb{S}(x) = \mathbb{S}(x-1) + I(x)$. The sum $S((x_0, x_1])$ on the interval $(x_0, x_1]$ thus equals to \begin{IEEEeqnarray}{lC} S((x_0, x_1]) = \mathbb{S}(x_1) - \mathbb{S}(x_0) \label{eq:sat_sum_1D} \end{IEEEeqnarray} The 2-D SAT can also be extended to the high-dimensional case to compute the sum of values in a $N$-D cube. In the literature, Ke~\emph{et al}\onedot~\cite{Ke_ICCV_2005} considered the image sequences as three-dimensional images and defined the integral video (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot the 3-D SAT) to compute volumetric features from the optical flow of videos for the motion and activity detection. Six years later, Tapia~\cite{Tapia_PRL_2011} provided a generalized procedure to compute the sum of values in a $N$ dimensional cube using the $N$-D SAT. Here, instead of directly computing the 3-D SAT, we jointly employ the 1-D SAT and the 2-D SAT to compute the sum $S(\mathfrak{C}) = \sum_{x_0 < x' \leq x_1} \sum_{y_0 < y' \leq y_1} \sum_{z_0 < z' \leq z_1} I(x', y', z')$ of a 3-D image $I(x', y', z')$ on a given cube $\mathfrak{C} = (x_0, x_1] \times (y_0, y_1] \times (z_0, z_1] $. This is because we have \begin{IEEEeqnarray}{rl} \bar{I}(x, y, z) & = \sum_{x_0 < x' \leq x_1} \sum_{y_0 < y' \leq y_1} I(x', y', z) \label{eq:sat_sum_3D_1}\\ S(\mathfrak{C}) & = \sum_{z_0 < z' \leq z_1} \bar{I}(x, y, z') \label{eq:sat_sum_3D_2} \end{IEEEeqnarray} and for each given $z$, we can employ the 2-D SAT in \eqref{eq:sum_sat_sum_region_2D} to fast compute $\bar{I}(x, y, z)$. Similarly, \eqref{eq:sat_sum_3D_2} can be fast calculated by the 1-D SAT in \eqref{eq:sat_sum_1D}. \section{Proposed Method} \label{sec:method} In order to decompose BF into a set of 3-D box filters while keeping high accuracy, our method employs Haar functions and truncated trigonometric functions to compute the best N-term approximation of the truncated spatial and range kernels. Further analysis discloses that our approximation can be computed by the 3-D SAT with complexity $O(|I|)$. \subsection{Truncated spatial kernel $K^T_s(x)$ and range kernel $K^T_r(x)$ } Since $K_s(x)$ and $K_r(x)$ are symmetric on the region $\mathbb{R}$ and decrease their values on the region $\mathbb{R}^+$, a point $x$ with large values $K_s(x)$ or $K_r(x)$ usually locates at a small region around the original point. For instance, the Gaussian kernel $G_{\sigma}(x)$ falls off very fast, and almost vanishes outside the interval $[-3\sigma, 3\sigma]$. Hence, we can simply discard the points outside $[-3\sigma, 3\sigma]$ without introducing significant errors. It is thus reasonable to substitute $K_s(x)$ and $K_r(x)$ with the truncated kernels $K^T_s(x)$ and $K^T_r(x)$ (refer to sections~\ref{sec:comparison_Ks} and \ref{sec:comparison_Kr}). Here $K^T_s(x)$ and $K^T_r(x)$ equal to $K_s(x)$ and $K_r(x)$ on the intervals $[-T_s, T_s]$ and $[-T_r, T_r]$ respectively, otherwise $K^T_s(x) = K^T_r(x) = 0$, where $T_s = K^{-1}_s(\epsilon)$, $T_r = K^{-1}_r(\epsilon)$, and $\epsilon$ is a predefined value. In practice, $0.01$ is a reasonable value. Note that the truncation operation for $K^T_s(x), K^T_r(x)$ does not increase the run time of BF because we can precompute the truncated regions $[-T_s, T_s]$ or $[-T_r, T_r]$. In the sequent sections, we will describe the methods to approximate the truncated kernels. \subsection{Approximation for the linear convolution of $K_s( x )$} \label{sec:Ks} \begin{figure} \centering \begin{subfigure}[b]{0.45\linewidth} \includegraphics[width=\textwidth]{Haar_phi_phi.png} \caption{$\phi(x)\phi(y)$} \label{fig:Haar_1D:phi} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \includegraphics[width=\textwidth]{Haar_xphi_ypsi.png} \caption{$\phi(x)\psi_{0,0}(y)$} \label{fig:Haar_1D:psi00} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \includegraphics[width=\textwidth]{Haar_xpsi_yphi.png} \caption{$\psi_{0,0}(x)\phi(y)$} \label{fig:gull} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \includegraphics[width=\textwidth]{Haar_psi_psi.png} \caption{$\psi_{0,0}(x)\psi_{0,0}(y)$} \label{fig:Haar_1D:psi23} \end{subfigure} \caption{A visual illustration of 2-D Haar functions $\phi(x)\phi(y)$, $\phi(x)\psi_{0,0}(y)$, $\psi_{0,0}(x)\phi(y)$ and $\psi_{0,0}(x)\psi_{0,0}(y)$, where $T = 2$, the red, gray and blue planes denote the values of $1$, $0$ and $-1$, respectively.} \label{fig:Haar_2D} \end{figure} In computer vision and computer graphics~\cite{Crow_SIGGRAPH_1984,Tuzel_ECCV_2009,Li_TPAMI_2014}, the box filter has been used to accelerate many computation-intensive applications as it has the advantage of being fast to compute, but its adoption has been hampered by the fact that it presents serious restrictions to filter construction. To solve the problem, we employ 2-D Haar functions to transform arbitrary spatial kernels to a set of box functions. \begin{figure*}[t] \includegraphics[width=\textwidth]{flowchart} \caption{A compressive illustration for the flowchart of our two steps acceleration algorithm as well as the acceleration techniques used in each step. Through the nonlinear convolution acceleration step containing five techniques and the linear convolution acceleration step assembled by four techniques, our algorithm successfully reduces the computational complexity from $O(|\mathcal{N}_x||I|)$ to $O(|I|)$. } \label{fig:flowchart} \end{figure*} As the truncated substitution $K^T_s(\|\bm{x}\|)$ of $K_s(\|\bm{x}\|)$ is a 2-D function, we can employ \eqref{eq:Haar_expansion} to decompose it into a set of 2-D Haar functions which are defined on the region $[-T_s, T_s] \times [-T_s, T_s]$. After that, we select the first $N$ largest coefficients from the set $\{c_0\} \bigcup \{c_{0,j_2, k_2}\} \bigcup \{ c_{j_1, k_1, 0} \} \bigcup \{ c_{j_1, k_1, j_2, k_2} \}$. Let $\Lambda^s_1$, $\Lambda^s_2$, $\Lambda^s_3$ and $\Lambda^s_4$ denote the selected coefficients from sets $\{c_0\}, \{c_{0,j_2, k_2}\}, \{ c_{j_1, k_1, 0} \}, \{ c_{j_1, k_1, j_2, k_2} \}$, so we have \begin{IEEEeqnarray}{C} \begin{split} & K_s(\|\bm{x}\|) \underset{\text{\ding{192}}}{\approx} K^T_s(\|\bm{x}\|) \underset{\text{\ding{193}}}{\approx} \sum_{c_0 \in \Lambda^s_1} c_0 \phi(x)\phi(y) \\ + & \sum_{c_{0, j_2,k_2} \in \Lambda^s_2} c_{0, j_2,k_2} \phi(x)\psi_{j_2,k_2}(y) \\ + & \sum_{c_{j_1,k_1,0} \in \Lambda^s_3} c_{j_1,k_1,0} \psi_{j_1,k_1}(x) \phi(y) \\ + & \sum_{c_{j_1,k_1,j_2,k_2} \in \Lambda^s_4} c_{j_1,k_1,j_2,k_2} \psi_{j_1,k_1}(x)\psi_{j_2,k_2}(y) \end{split} \label{eq:Haar_N_terms} \end{IEEEeqnarray} The equation can be simplified further as the basis functions $\{\phi(x)\phi(y), \phi(x)\psi_{j_2,k_2}(y), \psi_{j_1,k_1}(x) \phi(y), \psi_{j_1,k_1}(x)\psi_{j_2,k_2}(y) \}$ can be effectively represented by 2-D box functions. Fig.~\ref{fig:Haar_2D} provides us a visual illustration of four 2-D Haar functions $\phi(x)\phi(y)$, $\phi(x)\psi_{0,0}(y)$, $\psi_{0,0}(x)\phi(y)$, $\psi_{0,0}(x)\psi_{0,0}(y)$ which stand for the four sets $\{\phi(x)\phi(y)\}$, $\{\phi(x)\psi_{j_2,k_2}(y)\}$, $\{\psi_{j_1,k_1}(x) \phi(y)\}$, $\{\psi_{j_1,k_1}(x)\psi_{j_2,k_2}(y) \}$ respectively. From the figure, we can verify that $\phi(x)\phi(y)$ is a 2-D box filter with the support region $[-T_s, T_s] \times [-T_s, T_s]$, and $\phi(x)\psi_{0,0}(y)$ can be represented by two 2-D box filters located at $[-T_s, T_s] \times [-T_s, 0]$ and $[-T_s, T_s] \times [0, T_s]$. Similarly, $\psi_{0,0}(x)\phi(y)$ can be reformulated as two 2-D box filters and $\psi_{0,0}(x)\psi_{0,0}(y)$ is equal to four 2-D box filters. In appendix~\ref{sec:box_filter}, we prove that the conclusion can be generalized to the set $\{\phi(x)\phi(y)\}$, $\{\phi(x)\psi_{j_2,k_2}(y)\}$, $\{\psi_{j_1,k_1}(x) \phi(y)\}$, $\{\psi_{j_1,k_1}(x)\psi_{j_2,k_2}(y) \}$. Hence $ K_s(\|\bm{x}\|)$ can be represented by a set of 2-D box filters $\ddot{B}_{\bm{j}}(\bm{x})$: \begin{IEEEeqnarray}{C} K_s(\|\bm{x}\|) \underset{\text{\ding{194}}}{\approx} \sum_{c_{\bm{j}} \in \Lambda^s } c_{\bm{j}} \ddot{B}_{\bm{j}}(\bm{x}) \label{eq:Box_N_terms} \end{IEEEeqnarray} where $c_{\bm{j}}$ denotes coefficient of $\ddot{B}_{\bm{j}}(\bm{x})$, and $\Lambda^s$ stands for the collection of $c_{\bm{j}}$. Further, putting $N^{\bm{j}}_{\bm{x}}$ as the support region of $\ddot{B}_{\bm{j}}(\bm{x})$, we can reformulate the convolution of $ K_s(x) $ as \begin{IEEEeqnarray}{C} \begin{split} & \sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| \bm{x} - \bm{y} \|) g(\bm{y}) \approx \sum_{c_{\bm{j}} \in \Lambda^s } c_{\bm{j}} \ddot{B}_{\bm{j}}(\bm{x} - \bm{y}) g(\bm{y}) \\ & \underset{\text{\ding{195}}}{=} \sum_{c_{\bm{j}} \in \Lambda^s } c_{\bm{j}} \sum_{\bm{y} \in N^{\bm{j}}_{\bm{x}}} g(\bm{y}) \end{split} \label{eq:2D_box_N_terms_s} \end{IEEEeqnarray} As is known to us, the 2-D SAT can be used to compute the box filters in \eqref{eq:2D_box_N_terms_s} in constant time by using \eqref{eq:sum_sat_sum_region_2D}. \subsection{Approximation for the nonlinear convolution of $K_r(x)$} In this section, we employ the best $N$-term approximation on 1-D truncated trigonometric functions to approximate the truncated range kernel $K^T_r(x)$. Let $\Lambda^r$ represent the selected coefficients from the sets $\{ a_k\}$ with $k>0$, we have \begin{IEEEeqnarray}{C} K_r(x) \underset{\text{\ding{196}}}{\approx} K^T_r(x) \underset{\text{\ding{197}}}{\approx} \sum_{a_k \in \Lambda^r} a_k \cos(\frac{\pi k}{T_r} x) \dot{B}(x) \label{eq:trigonometric_N_terms} \end{IEEEeqnarray} Note that $b_k = 0$ for $K^T_r(x)$ due to the symmetry of $K^T_r(x)$. Employing cosine functions's shiftability property, we have \begin{IEEEeqnarray}{C} \begin{split} & \sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| \bm{x} - \bm{y}\|) K_r(I(\bm{x}) - I(\bm{y}) ) I(\bm{y}) \\ \underset{\text{\ding{198}}}{\approx} & g^c_k(\bm{x}) \sum_{a_k \in \Lambda^r} \sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} a_k K_s(\| \bm{x} - \bm{y}\|) \dot{B}( I(\bm{x}) - I(\bm{y}) ) G_k^c(\bm{y}) \\ + & g^s_k(\bm{x}) \sum_{a_k \in \Lambda^r} \sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} a_k K_s(\| \bm{x} - \bm{y}\|) \dot{B}(I(\bm{x}) - I(\bm{y}) ) G_k^s(\bm{y}) \end{split} \label{eq:1D_N_terms} \end{IEEEeqnarray} where $G_k^c(\bm{y}) = g^c_k(\bm{y}) I(\bm{y})$, $G_k^s(\bm{y}) = g^s_k(\bm{y}) I(\bm{y})$, $g^c_k(\bm{x}) = \cos(\frac{\pi k}{T_r} I(\bm{x}))$ and $g^s_k(\bm{x}) = \sin(\frac{\pi k}{T_r} I(\bm{x}))$. The computational complexity of \eqref{eq:1D_N_terms} depends on the size of $\mathcal{N}_{\bm{x}}$. This dependency can be eliminated by the dimension promotion technique. Let $\mathcal{N}_{I(\bm{x})}$ denote the interval $[I(\bm{x})-T_r, I(\bm{x})+T_r]$, $F_c(\bm{y}, z) = G^c_k(\bm{y}) \delta_{I(\bm{y})}(z)$, $F_s(\bm{y}, z) = G^s_k(\bm{y}) \delta_{I(\bm{y})}(z)$, we reformulate \eqref{eq:1D_N_terms} as \begin{IEEEeqnarray}{C} \begin{split} & \sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| \bm{x} - \bm{y} \|) K_r(I(\bm{x}) - I(\bm{y}) ) I(\bm{y}) \\ \underset{\text{\ding{199}}}{\approx} & g^c_k(\bm{x}) \sum_{a_k \in \Lambda^r} a_k \sum_{z \in \mathcal{N}_{I(\bm{x})}} \sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| \bm{x} - \bm{y} \|) F_c(\bm{y}, z) \\ + & g^s_k(\bm{x}) \sum_{a_k \in \Lambda^r} a_k \sum_{z \in \mathcal{N}_{I(\bm{x})}} \sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| \bm{x} - \bm{y} \|) F_s(\bm{y}, z) \end{split} \label{eq:1D_box_N_terms} \end{IEEEeqnarray} which only involves the linear convolution of $K_s(x)$. \subsection{3-D box filter based approximation for BF } \label{sec:3DFBF} Now we are able to decompose the nonlinear convolution of $K_r(x)$ into a set of linear convolutions of $K_s(x)$ \eqref{eq:1D_box_N_terms} as well as to fast compute the linear convolution of $K_s(x)$ \eqref{eq:2D_box_N_terms_s}. Putting \eqref{eq:2D_box_N_terms_s} into \eqref{eq:1D_box_N_terms}, we can further transform the convolution $f(\bm{x}) =\sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\|{\bm{x} - \bm{y}}\|) K_r(I(\bm{x}) - I(\bm{y})) I(\bm{y})$ the numerator of BF to \begin{IEEEeqnarray}{C} \begin{split} & f(\bm{x})\underset{\text{\ding{200}}}{\approx} g^c_k(\bm{x}) \sum_{a_k \in \Lambda^r} \sum_{c_{\bm{j}} \in \Lambda^s } a_k c_{\bm{j}} \sum_{z \in \mathcal{N}_{I(\bm{x})}} \sum_{\bm{y} \in N^{\bm{j}}_{\bm{x}}} F_c(\bm{y}, z) \\ + & g^s_k(\bm{x}) \sum_{a_k \in \Lambda^r} \sum_{c_{\bm{j}} \in \Lambda^s } a_k c_{\bm{j}} \sum_{z \in \mathcal{N}_{I(\bm{x})}} \sum_{\bm{y} \in N^{\bm{j}}_{\bm{x}}} F_s(\bm{y}, z) \end{split} \label{eq:numerator_2D_box_N_terms} \end{IEEEeqnarray} $\sum_{z \in \mathcal{N}_{I(\bm{x})}} \sum_{\bm{y} \in N^{\bm{j}}_{\bm{x}}} F_c(\bm{y}, z)$ and $\sum_{z \in \mathcal{N}_{I(\bm{x})}} \sum_{\bm{y} \in N^{\bm{j}}_{\bm{x}}} F_s(\bm{y}, z)$ can be interpreted as the sum of $F_c(\bm{y}, z)$ and $F_s(\bm{y}, z)$ in the cube $N^{\bm{j}}_{\bm{x}} \times \mathcal{N}_{I(\bm{x})}$. Hence, \eqref{eq:numerator_2D_box_N_terms} denotes a linear combination of 3-D box filters that performed on the auxiliary images $F_c(\bm{y}, z)$, $F_s(\bm{y}, z)$. So, using \eqref{eq:sat_sum_3D_1} \eqref{eq:sat_sum_3D_2} to compute 3-D box filtering results, we can reduce the complexity of $\sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\|{\bm{x} - \bm{y}}\|) K_r(I(\bm{x}) - I(\bm{y})) I(\bm{y})$ down to $O(|I|)$. In addition, similar discussion can be applied to BF's denominator $\sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\|{\bm{x} - \bm{y}}\|) K_r(I(\bm{x}) - I(\bm{y}))$. Therefore, the filtering result $\hat{I}(\bm{x})$ of BF in~\eqref{eq:BF} can be figured out with linear complexity $O(|I|)$. Finally, we plot Fig~\ref{fig:flowchart} to outline the flowchart of our algorithm as well as the acceleration techniques exploited in each step as math symbols stated above may have overshadowed the underlying ideas. Generally speaking, our acceleration algorithm can be divided into two parts (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot the linear/nonlinear convolution acceleration steps) which employ following speeding up techniques: \begin{enumerate \item[\ding{192}] Truncated spatial kernel $K_s^T(\bm{x})$. \item[\ding{193}] Best $N$-term approximation for $K_s^T(\bm{x})$ on Haar functions. \item[\ding{194}] Box filter representation for Haar functions. \item[\ding{195}] 2-D SAT (2-D box filtering). \item[\ding{196}] Truncated range kernel $K_r^T(\bm{x})$. \item[\ding{197}] Best $N$-term approximation for $K_r^T(\bm{x})$ on truncated trigonometric functions \item[\ding{198}] The shiftability property of cosine functions. \item[\ding{199}] Dimension promotion. \item[\ding{200}] 3-D SAT (3-D box filtering). \end{enumerate} Specifically, in the linear convolution acceleration step for the spatial kernel, Eq~\eqref{eq:Haar_N_terms} takes the truncated spatial kernel $K_s^T(\bm{x})$ and best $N$-term approximation for $K_s^T(\bm{x})$ on Haar functions to approximate original spatial kernel $K_s(\bm{x})$ in steps \ding{192} \ding{193}, respectively. Moreover, step \ding{194} in \eqref{eq:Box_N_terms} holds due to the reason that Haar functions can be represented by the linear combination of box filters as Fig~\ref{fig:Haar_2D} indicated. Finally, applying 2-D SAT to step \ding{195}, we can figure out \eqref{eq:2D_box_N_terms_s} in linear computational complexity. Next, we accelerate the nonlinear convolution of the range kernel. Similar to the linear convolution acceleration step, Eq~\eqref{eq:trigonometric_N_terms} of the nonlinear convolution acceleration step adopts the truncated range kernel $K_r^T(\bm{x})$ and best $N$-term approximation for $K_r^T(\bm{x})$ on trigonometric functions to approximate original range kernel $K_r(\bm{x})$ in steps \ding{196} \ding{197}, respectively. Sequentially, the shiftability property of cosine functions is exploited by step \ding{198} to eliminate the nonlinearity in the trigonometric best $N$-term approximation for $K_r^T(\bm{x})$. In addition, the nonlinearity in the box $\dot{B}(I(\bm{x}) - I(\bm{y}))$ is removed by the dimension promotion technique used by step \ding{199} in \eqref{eq:1D_box_N_terms}. At last, putting \eqref{eq:2D_box_N_terms_s} into \eqref{eq:1D_box_N_terms} and employing 3-D SAT, we can compute step \ding{200} in \eqref{eq:numerator_2D_box_N_terms} in linear time. \section{Comparison with previous methods} \label{sec:comparison} Based on best $N$-term approximation, we employ 2-D Haar functions and 1-D truncated trigonometric functions to speed up the convolution of $K_s(x)$ and $K_r(x)$, and we put the two acceleration techniques together to compose our 3-D box filter based acceleration method. In this section, we provide some results on synthetic and natural data as well as a detailed analysis to understand the improvements of our proposal and the differences between our approach and existing methods. \subsection{Comparison with the acceleration techniques of $K_s(x)$ } \label{sec:comparison_Ks} Although FFT~\cite{Durand_TOG_2002} can fast compute $\sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| \bm{x} - \bm{y} \|) g(\bm{y})$, its complexity is not linear. Kernel separation based methods~\cite{Getreuer_ipol_2013} can complete the task in linear complexity. However, they are limited to the Gaussian function. Even worse, the approximation error will significantly degrade the smoothing quality of texture regions. To the best of our knowledge, the 2-D box filtering based algorithms are the first kind of techniques that can reduce the complexity $O(|\mathcal{N}_{\bm{x}}||I|)$ of the linear convolution of arbitrary $K_s(x)$ down to $O(|I|)$. Our Haar based fast computation method~\eqref{eq:2D_box_N_terms_s} also belongs to this kind of techniques. In this section, we will highlight the improvements and advantages of our approach, compared with other methods. \subsubsection{Coefficients and support regions} Employing the linear combination $\sum_{i = 1}^{M_s} \sum_{\bm{y}} \beta^s_i \ddot{B}_i(\bm{x} - \bm{y}) g(\bm{y})$ of box filters to approximate $\sum_{\bm{y} \in \mathcal{N}_{\bm{x}}} K_s(\| \bm{x} - \bm{y} \|) g(\bm{y})$ is the key idea of box filtering based algorithms. In the acceleration literature~\cite{Zhang_TIP_2012, Gunturk_TIP_2011, Pan_MPE_2014}, the optimization approach is utilized to determine the coefficients and support regions of box functions $\ddot{B}_i(\bm{x})$. Compared with previous algorithms, the procedure of our method to determine the two parameters is much simpler. This is because we choose the first $N$ largest coefficients of Haar functions (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot the best $N$-term approximation on Haar functions). Meanwhile, the support regions of box functions are predefined by Haar functions $\{ \phi(x), \psi_{j,k}(x) \}$ with the size of $\frac{T_s}{2^{j-1}}$, where $j \in \{ 0, \ldots, \infty \}$. Table~\ref{tab:time_cs} plots the run time of four methods used to determine the coefficients and support regions of box filters. It can be seen that our method spends the least time for acquiring these parameters. \begin{table}[b] \caption{The time of computing the coefficients and support regions of box filters, where the number of used box filters is 3. Note that although the method of Zhang is comparable with ours, this method can only accelerate the Gaussian function.} \label{tab:time_cs} \centering \begin{tabularx}{\linewidth}{@{}YYYYY@{}} \hline & Zhang~\cite{Zhang_TIP_2012} & Gunturk~\cite{Gunturk_TIP_2011} & Pan~\cite{Pan_MPE_2014} & Ours \\ \hline Time & 0.1s & 2s & 3s & 0.05s \\ \hline \end{tabularx} \end{table} \subsubsection{The computational complexity equivalence between the linear combinations of Haar functions and box filters} \begin{figure}[t] \centering \begin{subfigure}[b]{0.48\linewidth} \includegraphics[width=\textwidth ]{Haar_base_1.png} \caption{$f_1(x,y)$} \label{fig:linear_combinations:1} \end{subfigure} \begin{subfigure}[b]{0.48\linewidth} \includegraphics[width=\textwidth ]{Haar_base_2.png} \caption{$f_2(x,y)$} \label{fig:linear_combinations:2} \end{subfigure} \begin{subfigure}[b]{0.48\linewidth} \includegraphics[width=\textwidth ]{Haar_base_3.png} \caption{$f_3(x,y)$} \label{fig:linear_combinations:3} \end{subfigure} \begin{subfigure}[b]{0.48\linewidth} \includegraphics[width=\textwidth ]{Haar_base_4.png} \caption{$f_4(x,y)$} \label{} \end{subfigure} \caption{Visual illustration for the linear combinations on the 2-D basis functions $\phi(x)\phi(y)$, $\phi(x)\psi_{1,k_2}(y)$, $\psi_{1,k_1}(x) \phi(y)$, $\psi_{1, k_1}(x) \psi_{1, k_2}(y)$. Here, we denote the four linear combinations as $f_1(x,y)$, $f_2(x,y)$, $f_3(x,y)$, $f_4(x,y)$, respectively, and different color implies different basis functions exploited in the linear combinations. } \label{fig:linear_combinations} \end{figure} \begin{figure*}[t] \centering \begin{subfigure}[b]{0.24\linewidth} \includegraphics[width=\textwidth ]{Box_zhang} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \includegraphics[width=\textwidth ]{Box_gunturk} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \includegraphics[width=\textwidth ]{Box_pan} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \includegraphics[width=\textwidth ]{Box_ours} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \includegraphics[width=\textwidth ]{Box_zhang_density} \caption{Zhang~\cite{Zhang_TIP_2012}} \label{fig:box_approxiamtion:zhang} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \includegraphics[width=\textwidth ]{Box_gunturk_density} \caption{Gunturk~\cite{Gunturk_TIP_2011}} \label{fig:box_approxiamtion:gunturk} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \includegraphics[width=\textwidth ]{Box_pan_density} \caption{Pan~\cite{Pan_MPE_2014}} \label{fig:box_approxiamtion:pan} \end{subfigure} \begin{subfigure}[b]{0.24\linewidth} \includegraphics[width=\textwidth ]{Box_ours_density} \caption{Ours} \label{fig:box_approxiamtion:ours} \end{subfigure} \caption{Visual comparison of four different box filter approximations for the Gaussian function $G_1(x)$, where the first row shows the Gaussian function $G_1(x)$ and the four methods' approximations. In order to disclose the difference of the four approximations more clearly, the second row illustrates the density map plots of the four approximations. Note that Zhang~\cite{Zhang_TIP_2012}, Gunturk~\cite{Gunturk_TIP_2011} and Pan~\cite{Pan_MPE_2014} cascade three box filters together, our method compute the linear combination $f_1(x,y)+f_2(x,y)+f_3(x,y)$ which can be synthesized by three box filters. } \label{fig:box_approxiamtion} \end{figure*} To approximate the spatial kernel $K_s(\| \bm{x} - \bm{y} \|)$ centered at pixel $\bm{x}$, all previous methods assume $\ddot{B}_i(\bm{x} - \bm{y}) $ must be centered at the given pixel $\bm{x}$ too. Our Haar functions based method breaks this assumption and jointly uses a set of box functions deviated from the pixel $\bm{x}$ as well as the box functions centered at $\bm{x}$ to approximate the kernel $K_s(\| \bm{x} - \bm{y} \|)$. The major advantage of our approach is that it reuses box filtering results and therefore can employ fewer box filters to obtain more accurate approximation results. For instance, although $\psi_{j_1, k_1}(x) \psi_{j_2, k_2}(y)$ is consisted of four box functions (or four 2-D box filters), the size of the support regions of these box functions is same to $2^{-j_1+1} T_s \times 2^{-j_2+1} T_s $. This can be demonstrated in Fig~\ref{fig:Haar_2D} which implies that for the convolution kernel $\psi_{j_1, k_1}(x) \psi_{j_2, k_2}(y)$, the filtering result of $\bm{x}$ is a linear composition of the box filtering result of four pixels around pixel $\bm{x}$. Hence, the computational complexity of the convolution with the kernel $ \psi_{j_1, k_1}(x) \psi_{j_2, k_2}(y)$ is same to the computational complexity of the box filter with the support region $2^{-j_1+1} T_s \times 2^{-j_2+1} T_s $. Similar discussion can also be applied to the basis functions $\phi(x)\phi(y), \phi(x)\psi_{j_2,k_2}(y), \psi_{j_1,k_1}(x) \phi(y)$ according to the discussion in section~\ref{sec:Ks}. Employing box filters, we can synthesis the linear combinations of 2-D Haar functions. For instance, Fig~\ref{fig:linear_combinations} demonstrates four 2-D Haar functions' linear combinations $f_1(x, y) = c_0 \phi(x)\phi(y)$, $f_2(x, y) = \sum_{k_2 \in \mathcal{K} } c_{0,1,k_2}\phi(x)\psi_{1,k_2}(y)$, $f_3(x, y) = \sum_{k_1 \in \mathcal{K}} c_{1,k_1,0} \psi_{1,k_1}(x) \phi(y)$ and $f_4(x, y) = \sum_{ k_1, k_2 \in \mathcal{K}} c_{1,k_1,1,k_2} \psi_{1, k_1}(x) \psi_{1, k_2}(y)$, where $\mathcal{K} = \{ -1, 1\}$. The coefficients $c_0$, $c_{0,1,k_2}$, $c_{1,k_1,0}$, $c_{1,k_1,1,k_2}$ are computed from \eqref{eq:Haar_2D_coefficients} based on the Gaussian function $G_1(x)$ as illustrated in Fig~\ref{fig:box_approxiamtion}. From Fig~\ref{fig:linear_combinations}, we can find that each linear combination can be decomposed into several box functions with the same support regions. This conclusion can be generalized further. According to appendix~\ref{sec:box_filter}, we could reasonably conclude that given $j_1, j_2$, the linear combinations of $\phi(x)\phi(y)$, $\phi(x)\psi_{j_2,k_2}(y)$, $\psi_{j_1,k_1}(x) \phi(y)$, $\psi_{j_1, k_1}(x) \psi_{j_2, k_2}(y)$ can be synthesized from four box filters with support regions $2 T_s \times 2 T_s $, $2 T_s \times 2^{-j_2+1} T_s $, $2^{-j_1+1} T_s \times 2 T_s $, $2^{-j_1+1} T_s \times 2^{-j_2+1} T_s $, respectively. So it is rational to equally treat the four linear combinations of Haar functions and the four box filters from the computational complexity perspective. Moreover, the computational complexity of the linear combinations $f_1(x, y) + f_2(x, y) + f_3(x, y)$ equals to three box filters. In the next section, we will take it to approximate the spatial Gaussian kernel function. \begin{figure}[t] \begin{subfigure}[c]{0.31\linewidth} \includegraphics[width = \linewidth]{Duck} \end{subfigure} \vspace{0.02cm} \begin{subfigure}[c]{0.31\linewidth} \includegraphics[width = \linewidth]{Duck_1D} \end{subfigure} \vspace{0.02cm} \begin{subfigure}[c]{0.31\linewidth} \includegraphics[width = \linewidth]{Duck_2D} \end{subfigure} \vspace{0.02cm} \begin{subfigure}[c]{0.31\linewidth} \includegraphics[width = \linewidth]{Duck_part} \end{subfigure} \vspace{0.04cm} \begin{subfigure}[c]{0.31\linewidth} \includegraphics[width = \linewidth]{Duck_part_1D} \end{subfigure} \vspace{0.04cm} \begin{subfigure}[c]{0.31\linewidth} \includegraphics[width = \linewidth]{Duck_part_2D} \end{subfigure} \vspace{0.04cm} \begin{subfigure}[c]{0.31\linewidth} \includegraphics[width = \linewidth]{Flower} \end{subfigure} \vspace{0.02cm} \begin{subfigure}[c]{0.31\linewidth} \includegraphics[width = \linewidth]{Flower_1D} \end{subfigure} \vspace{0.02cm} \begin{subfigure}[c]{0.31\linewidth} \includegraphics[width = \linewidth]{Flower_2D} \end{subfigure} \vspace{0.02cm} \begin{subfigure}[c]{0.31\linewidth} \includegraphics[width = \linewidth]{Flower_part} \caption{Input} \end{subfigure} \begin{subfigure}[c]{0.31\linewidth} \includegraphics[width = \linewidth]{Flower_part_1D} \caption{Kernel separation} \end{subfigure} \begin{subfigure}[c]{0.31\linewidth} \includegraphics[width = \linewidth]{Flower_part_2D} \caption{Ours} \end{subfigure} \caption{Comparisons of smoothing result in texture regions. (a) is the input image. (b) is the smoothing result produced by the kernel separation method~\cite{Rachid_TR_1993}. (c) is the smoothing result of ours. We can observe that the kernel separation method tends to over smooth the image along the vertical and horizontal edges due to 1-D handling of spatial domain. } \label{fig:Duck} \end{figure} \renewcommand{\tabcolsep}{0.1cm} \begin{figure*}[t] \begin{tabular}{ccccc} \multirow{2}{*}{ \begin{adjustbox}{valign=m} \begin{subfigure}[c]{0.3\linewidth} \vspace{-0.5cm} \includegraphics[width = \linewidth]{SSIM_sigma_sigma} \caption{SSIM evaluation} \label{fig:shiftable_approxiamtion:SSIM} \end{subfigure} \end{adjustbox} } & \begin{adjustbox}{valign=m} \begin{subfigure}[c]{0.15\linewidth} \includegraphics[width = \linewidth]{Shiftable_Porikli_1} \end{subfigure} \end{adjustbox} & \begin{adjustbox}{valign=m} \begin{subfigure}[c]{0.15\linewidth} \includegraphics[width = \linewidth]{Shiftable_Chaudhury_10} \end{subfigure} \end{adjustbox} & \begin{adjustbox}{valign=m} \begin{subfigure}[c]{0.15\linewidth} \includegraphics[width = \linewidth]{Shiftable_Chaudhury_20} \end{subfigure} \end{adjustbox} & \begin{adjustbox}{valign=m} \begin{subfigure}[c]{0.15\linewidth} \includegraphics[width = \linewidth]{Shiftable_Ours_1} \end{subfigure} \end{adjustbox} \\ & \begin{adjustbox}{valign=m} \begin{subfigure}[c]{0.15\linewidth} \includegraphics[width = \linewidth]{Shiftable_Porikli_2} \caption{Dai~\cite{Dai_EL_2014}} \label{fig:shiftable_approxiamtion:Dai} \end{subfigure} \end{adjustbox} & \begin{adjustbox}{valign=m} \begin{subfigure}[c]{0.15\linewidth} \includegraphics[width = \linewidth]{Shiftable_Chaudhury_11} \caption{Chaudhury~\cite{Chaudhury_TIP_2011}} \label{fig:shiftable_approxiamtion:Chaudhury1} \end{subfigure} \end{adjustbox} & \begin{adjustbox}{valign=m} \begin{subfigure}[c]{0.15\linewidth} \includegraphics[width = \linewidth]{Shiftable_Chaudhury_21} \caption{Chaudhury~\cite{Chaudhury_TIP_2013}} \label{fig:shiftable_approxiamtion:Chaudhury2} \end{subfigure} \end{adjustbox} & \begin{adjustbox}{valign=m} \begin{subfigure}[c]{0.15\linewidth} \includegraphics[width = \linewidth]{Shiftable_Ours_2} \caption{Ours} \label{fig:shiftable_approxiamtion:Ours} \end{subfigure} \end{adjustbox} \end{tabular} \caption{Visual and quantitative approximation comparison for the Gaussian range kernel $G_{10}(x)$. (a) illustrates the approximation error measured by SSIM, where x-axis denotes the bandwidth parameter $\sigma_r$ of the Gaussian range kernel, y-axis stands for the number $N$ of approximation terms and z-axis presents the value of SSIM. From (b) to (c), the first row shows the approximation curves of Dai~\cite{Dai_EL_2014}, Chaudhury~\cite{Chaudhury_TIP_2011}, Chaudhury~\cite{Chaudhury_TIP_2013} and ours with $5$ approximation terms for the Gaussian kernel. In the second rows, we keep the SSIM indices of the four methods as 0.99 to find the smallest approximation number $N$ of each method. The number $N$ of Dai~\cite{Dai_EL_2014}, Chaudhury~\cite{Chaudhury_TIP_2011}, Chaudhury~\cite{Chaudhury_TIP_2013} and ours are 1700, 81, 42 and 5 respectively. } \label{fig:shiftable_approxiamtion} \end{figure*} \subsubsection{Approximation comparison} Fig~\ref{fig:box_approxiamtion} shows the Gaussian approximation result of our method as well as box filters based approximations such as Zhang~\cite{Zhang_TIP_2012}, Gunturk~\cite{Gunturk_TIP_2011}, Pan~\cite{Pan_MPE_2014}. To approximate the Gaussian function, we use five Haar functions illustrated in Figs~\ref{fig:linear_combinations:1}-\ref{fig:linear_combinations:3} whereas Zhang~\cite{Zhang_TIP_2012}, Gunturk~\cite{Gunturk_TIP_2011}, Pan~\cite{Pan_MPE_2014} take three box filters. Unlike the box filters based methods~\cite{Zhang_TIP_2012,Gunturk_TIP_2011,Pan_MPE_2014} employing three box filters to approximate the Gaussian function, our method adopts the linear combination $f_1(x,y)+f_2(x,y)+f_3(x,y)$ which contains five Haar functions to fulfill the same task. Note that the linear combination of five Haar functions can be synthesized by three box filters and therefore the complexity of them are the same. From Fig~\ref{fig:box_approxiamtion:zhang}-\ref{fig:box_approxiamtion:pan}, we can observe that Zhang, Gunturk and Pan simply take three cubes and cascade them together to approximate the Gaussian function. In contrast, our approximation in Fig~\ref{fig:box_approxiamtion:ours} is different from theirs. The approximation surface is more complicated than them and the approximation error is the smallest. Table~\ref{tab:accuracy_box} illustrates the relationship between the approximation quality and the computational complexity. We choose the structural similarity (SSIM) and Peak signal-to-noise ratio (PSNR) to evaluate the approximation error. In addition, the number $N$ of box filters denotes the computational complexity. Note that it is rational to use the number of box filters to indicate the computational complexity because for fixed $j_1, j_2$, the filtering result of the linear combination of Haar functions is a linear combination of the values of box filtering result at different points. Table~\ref{tab:accuracy_box} clearly indicates that our approximation error is the smallest among the four methods and the decay rate of our approximation is the fastest with respect to the number of approximation terms. \begin{table}[t] \caption{Accuracy comparison for box filter based acceleration methods, where the approximation error (or accuracy error) is measured by SSIM and PSNR and $N$ denotes the number of box filters.} \label{tab:accuracy_box} \centering \begin{tabularx}{\linewidth}{@{}|c|c|Y|Y|Y|Y|@{}} \hline \multicolumn{2}{|c|}{} & Zhang~\cite{Zhang_TIP_2012} & Gunturk~\cite{Gunturk_TIP_2011} & Pan~\cite{Pan_MPE_2014} & Ours \\ \hline \multirow{4}{*}{\rotatebox{90}{SSIM}} & $N=1$ & 0.80 & 0.83 & 0.84 & $\bm{0.85}$ \\ \cline{2-6} & $N=2$ & 0.81 & 0.85 & 0.87 & $\bm{0.89}$ \\ \cline{2-6} & $N=3$ & 0.83 & 0.87 & 0.88 & $\bm{0.93}$ \\ \cline{2-6} & $N=4$ & 0.86 & 0.92 & 0.94 & $\bm{0.97}$ \\ \hline \multirow{4}{*}{\rotatebox{90}{PSNR}} & $N=1$ & 23.16 & 24.69 & 25.01 & $\bm{25.33 }$ \\ \cline{2-6} & $N=2$ & 23.31 & 25.32 & 27.01 & $\bm{27.93}$ \\ \cline{2-6} & $N=3$ & 24.68 & 27.03 & 27.23 & $\bm{35.22}$ \\ \cline{2-6} & $N=4$ & 25.91 & 33.12 & 36.76 & $\bm{42.16}$ \\ \hline \end{tabularx} \end{table} Other than box filter based acceleration methods, we also compare our approach with other spatial kernel acceleration algorithms such as Rachid~\cite{Rachid_TR_1993} which belongs to the kernel separation method. However, this kind of methods cannot perform satisfactorily on texture regions. We can observe these artifacts produced by the kernel separation method in Fig~\ref{fig:Duck}. \subsection{Comparison with the acceleration techniques of $K_r(x)$} \label{sec:comparison_Kr} Decomposing the nonlinear convolution of $K_r(x)$ into a set of linear convolutions is the key step to speed up BF. In this section, we compare our acceleration approach with previous techniques. Without loss of generality, we assume $K_s(\|\bm{x}\|)$ is a 2-D box function in the following paragraphs. \begin{table}[b] \caption{Computational complexity and accuracy for comparison between the dimension promotion based method (Porikli) in~\cite{Porikli_CVPR_2008} and our method} \label{tab:promotion_ca} \centering \begin{tabularx}{\linewidth}{@{}|Y|Y|Y|Y|Y|@{}} \hline \multirow{2}{*}{} & \multirow{2}{*}{Porikli} & \multicolumn{3}{c|}{Ours} \\ \cline{3-5} & & 3 & 4 & 5 \\ \hline Add & $256|I|$ & $12T_r|I|$ & $16T_r|I|$ & $20T_r|I|$ \\ \hline Mul & $256|I|$ & $6|I|$ & $8|I|$ & $10|I|$ \\ \hline SSIM & 0.96 & 0.95 & 0.97 & 0.99 \\ \hline PSNR & 40.21 & 38.97 & 40.32 & 44.53 \\ \hline Time & 1.63s & 1.35s & 1.36s & 1.37s \\ \hline \end{tabularx} \end{table} \begin{table*}[t] \caption{Technique Summary for BF accelerating methods.} \label{tab:summary} \centering \begin{tabularx}{\linewidth}{@{}ccYcYcYY@{} \hline & Kernel separation & Box filtering & Dimension promotion & PBFIC & Shiftability property & Best $N$-term & Truncated kernels \\ \hline Porikli~\cite{Porikli_CVPR_2008} & \ding{56} & \ding{52} & \ding{52} & \ding{56} & \ding{56} & \ding{56} & \ding{56}\\ Yang~\cite{Yang_CVPR_2009} & \ding{52} & \ding{56} & \ding{56} & \ding{52} & \ding{56} & \ding{56} & \ding{56}\\ Gunturk~\cite{Gunturk_TIP_2011} & \ding{56} & \ding{52} & \ding{52} & \ding{56} & \ding{56} & \ding{56} & \ding{56}\\ Pan~\cite{Pan_MPE_2014} & \ding{56} & \ding{52} & \ding{52} & \ding{56} & \ding{56} & \ding{56} & \ding{56}\\ Chaudhury~\cite{Chaudhury_TIP_2013} & \ding{56} & \ding{56} & \ding{56} & \ding{56} & \ding{52} & \ding{56} & \ding{56}\\ Ours & \ding{56} & \ding{52} & \ding{52} & \ding{56} & \ding{52} & \ding{52} & \ding{52}\\ \hline \end{tabularx} \end{table*} \subsubsection{Dimension promotion} Both our method and the dimension promotion based algorithm employ the dimension promotion technique to eliminate the dependency between $I(\bm{y})$ and $I(\bm{x})$ in the kernel $K_r(I(\bm{x}) - I(\bm{y}))$ and $\dot{B}(I(\bm{x}) - I(\bm{y}))$ according to \eqref{eq:BF_promotion} \eqref{eq:sat_sum_3D_1}~\eqref{eq:sat_sum_3D_2} \eqref{eq:numerator_2D_box_N_terms}. Here $\dot{B}(\bm{x})$ is a box function with the support region $[-T_r, T_r]$. The response of BF can be computed by first performing box filtering on the auxiliary images $F(\bm{y}, z)$ (or $F_c(\bm{y}, z)$, $F_s(\bm{y}, z)$) for each fixed $z$ and then calculating the sum weighted by $K_r(I(\bm{y}) - z)$ (or $\dot{B}(I(\bm{y}) - z)$) along $z$. The major difference between the dimension promotion based algorithms and ours is the computational complexity of the second step as all these methods perform box filtering at the first step. Specifically, let $g(z)$ be a scalar function. For an 8-bit image, $\sum_{z=0}^{255} K_r(I(\bm{x}) - z) g(z)$ needs $256$ multiplications and $255$ additions. In contrast, employing the 1-D SAT along the $z$ axis, we only require $255$ additions and $1$ subtraction to compute $\sum_{z=0}^{255} \dot{B}(I(\bm{x}) - z) g(z) = \sum_{z \in \mathcal{N}_{I(\bm{x})}} g(z)$. Note that the floating point addition or subtraction requires $6$ clock cycles, multiplication or division require 30-44 clock cycles on the Intel x86 processor. Due to the high running cost for multiplication operation, our method can significantly decrease the run time. Indeed, we can cut down the cost further because for each fixed $\bm{x}$, we only need to compute the box filtering result at $I(\bm{x})$ along the z axis. Hence in this situation the 1-D SAT degrade to the sliding window summation and therefore we can reduce the running cost to $2T_r$ additions. Our approach is not problem-free. The biggest shortcoming is that our method can only give an approximation filtering result. Fortunately, the approximation error is very small and the accuracy will be improved when we take more terms to approximate the range kernel $K_r(x)$. In Table~\ref{tab:promotion_ca}, we list the overall computational cost of filtering an image $I$ as well as the SSIM and PSNR indices that measure the similarity between the filtering image and the ground truth, where $|I|$ represents the pixel number of the image $I$. Note that the multiplications in our method are caused by the multiplication of $a_k$ in \eqref{eq:1D_box_N_terms} and Table~\ref{tab:promotion_ca} does not take into account the complexity of linear convolution of $K_s(x)$ because both our approach and the dimension promotion based algorithm perform 255 linear convolutions. Compared with the dimension promotion based algorithm, the number of multiplications is very small and thus can be neglected. The approximation error almost vanishes when we use three approximation terms. We can verify this from the SSIM and PSNR indices and the approximation error map shown in Fig~\ref{fig:shiftable_approxiamtion}. More importantly, the run time is still smaller than the dimension promotion based algorithm. \renewcommand{\tabcolsep}{0.05cm} \begin{figure}[t] \begin{tabular}{cccc} \multirow{2}{*}{\begin{adjustbox}{valign=m} \begin{subfigure}[c]{0.25\linewidth} \vspace{-0.7cm} \includegraphics[width = \linewidth]{Tree_HDR} \caption{Input} \end{subfigure} \end{adjustbox}} & \multirow{2}{*}{\begin{adjustbox}{valign=m} \begin{subfigure}[c]{0.25\linewidth} \vspace{-0.7cm} \includegraphics[width = \linewidth]{Tree_HDR_1} \caption{PBFIC} \end{subfigure} \end{adjustbox}} & \multirow{2}{*}{\begin{adjustbox}{valign=m} \begin{subfigure}[c]{0.25\linewidth} \vspace{-0.7cm} \includegraphics[width = \linewidth]{Tree_HDR_2} \caption{Ours} \end{subfigure} \end{adjustbox}} & \begin{adjustbox}{valign=m} \begin{subfigure}[c]{0.18\linewidth} \includegraphics[width = \linewidth]{Tree_HDR_1_part} \end{subfigure} \end{adjustbox}\vspace{0.1cm} \\ & & & \begin{adjustbox}{valign=m} \begin{subfigure}[c]{0.18\linewidth} \includegraphics[width = \linewidth]{Tree_HDR_2_part} \caption{Close up} \end{subfigure} \end{adjustbox} \end{tabular} \caption{Quantization artifacts demonstration. (a) Input HDR image (32 bit float, displayed by linear scaling). (b) Compressed image using 32 PBFIC (32 bins). (c) Compressed image using our method. (d) Zoom-in of the square in (b) as the upper image and that in (c) as the lower one.} \label{fig:HDR} \end{figure} \subsubsection{Principle bilateral filtered image component (PBFIC)} This kind of methods is equivalent to the dimension promotion based methods if we compute 256 PBFICs as they do not need to interpolate missing values in this situation. Hence it is reasonable to say that these methods speed up BF by employing downsampling and interpolation operation to reduce the computational burden. The major shortcoming is the large approximation error and it is the origin of stepwise artifacts which degrade the quality of filtering results for HDR image intensively as illustrated in Fig~\ref{fig:HDR}. In contrast, our method does not suffer from the problem. \begin{figure*}[t] \centering \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Porikli_sigmas_1_sigmar_10} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Porikli_sigmas_4_sigmar_23} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Porikli_sigmas_7_sigmar_37} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Porikli_sigmas_10_sigmar_50} \end{subfigure} \rotatebox{90}{\footnotesize \ Porikli~\cite{Porikli_CVPR_2008}} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Yang_sigmas_1_sigmar_10} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Yang_sigmas_4_sigmar_23} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Yang_sigmas_7_sigmar_37} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Yang_sigmas_10_sigmar_50} \end{subfigure} \rotatebox{90}{\footnotesize \ \ \ Yang~\cite{Yang_CVPR_2009}} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_gunturk_sigmas_1_sigmar_10} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_gunturk_sigmas_4_sigmar_23} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_gunturk_sigmas_7_sigmar_37} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_gunturk_sigmas_10_sigmar_50} \end{subfigure} \rotatebox{90}{\footnotesize \ \ \ Gunturk~\cite{Gunturk_TIP_2011}} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Pan_sigmas_1_sigmar_10} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Pan_sigmas_4_sigmar_23} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Pan_sigmas_7_sigmar_37} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Pan_sigmas_10_sigmar_50} \end{subfigure} \rotatebox{90}{\footnotesize \qquad Pan~\cite{Pan_MPE_2014}} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Chaudhury_sigmas_1_sigmar_10} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Chaudhury_sigmas_4_sigmar_23} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Chaudhury_sigmas_7_sigmar_37} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Chaudhury_sigmas_10_sigmar_50} \end{subfigure} \rotatebox{90}{\footnotesize Chaudhury~\cite{Chaudhury_TIP_2013}} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Ours_sigmas_1_sigmar_10} \caption{$\sigma_s = 1, \sigma_r = 10$} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Ours_sigmas_4_sigmar_23} \caption{$\sigma_s = 4, \sigma_r = 23$} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Ours_sigmas_7_sigmar_37} \caption{$\sigma_s = 7, \sigma_r = 37$} \end{subfigure} \begin{subfigure}[b]{0.23\linewidth} \includegraphics[width=\textwidth ]{Lena_Ours_sigmas_10_sigmar_50} \caption{$\sigma_s = 10, \sigma_r = 50$} \end{subfigure} \rotatebox{90}{\footnotesize \qquad \quad \quad Ours} \caption{Lena: a demonstration of the visual quality of the approximation results. From the first row to the sixth row, the results are Porikli~\cite{Porikli_CVPR_2008}, Yang~\cite{Yang_CVPR_2009}, Gunturk~\cite{Gunturk_TIP_2011}, Pan~\cite{Pan_MPE_2014}, Chaudhury~\cite{Chaudhury_TIP_2013} and ours, each column shows the filtering results and approximation errors under different parameter settings, where the gray images are the filtering results procured by these BF acceleration methods and the color-coded absolute error maps denote the filtering error compared with the brute-force implementation of BF. } \label{fig:Lena} \end{figure*} \subsubsection{Shiftability property} Chaudhury~\emph{et al}\onedot~\cite{Chaudhury_TIP_2011} first employed the shiftability property of trigonometric functions to accelerate BF. Using Hermite polynomials, Dai~\emph{et al}\onedot~\cite{Dai_EL_2014} gave another application instance of the shiftability property. Unfortunately, the two methods can only deal with the Gaussian kernel. Even worse, they require a large number of terms to closely approximate a narrow Gaussian on the interval $[-255, 255]$ as illustrated in Fig~\ref{fig:shiftable_approxiamtion}. In~\cite{Chaudhury_TIP_2013}, Chaudhury adopted two measures to solve these problems: 1, shrinking the approximation interval; 2, dropping off the terms with small coefficients in the approximation series. But, his method inevitably increases the running time because shrinking operation happens at filtering. Dropping off small terms is because some $c_i$ in \eqref{eq:shiftable} are extremely small. Hence it is safe to get rid of them to decrease the computational cost without introducing significant errors. The advantage does not come at no cost as the nonnegative assumption of the approximation is broken as Fig~\ref{fig:shiftable_approxiamtion:Chaudhury2} shown. We inherit the idea of Chaudhury~\cite{Chaudhury_TIP_2013}, but take a different implementation. To decrease the size of approximation interval, we find that the larger values of $K_r(x)$ almost concentrate on a small interval $[-T_r, T_r]$. We introduce the truncated trigonometric function to approximate $K_r(x)$ on the precomputed interval $[-T_r, T_r]$. As for other values, we can simply set them as zeros. To verify the performance of our modifications, we plot Fig~\ref{fig:shiftable_approxiamtion:SSIM} to show the approximation error measured by the SSIM index with respect to the number $N$ of approximation terms and the parameter $\sigma_r$ of the Gaussian range kernel. From the figure, we can observe that the approximation error of our approach is almost the smallest on a wide range. Compared with other shiftability property based methods~\cite{Dai_EL_2014}\cite{Chaudhury_TIP_2011}\cite{Chaudhury_TIP_2013}, the number $N$ of approximation terms is nearly irrelevant to $\sigma_r$. In contrast, the number of the approximation terms of~\cite{Dai_EL_2014}\cite{Chaudhury_TIP_2011}\cite{Chaudhury_TIP_2013} are inversely proportional to $\sigma_r$. This is because they need many terms to approximate the long tail of the narrow Gaussian function as shown in Figs.~\ref{fig:shiftable_approxiamtion:Dai}-\ref{fig:shiftable_approxiamtion:Chaudhury2}. (The first row shows the approximation results with 5 terms. In the second row, Dai~\cite{Dai_EL_2014}, Chaudhury~\cite{Chaudhury_TIP_2011}, Chaudhury~\cite{Chaudhury_TIP_2013} and our method take 1700, 81, 42 and 5 terms respectively to obtain approximation curves with the value 0.99 of the SSIM index.) So, the run times of these methods depend on $\sigma_r$. It is not a good behavior for acceleration methods. To reduce the number of approximation terms, we employ the best $N$-term approximation on truncated trigonometric functions to find the best approximation for arbitrary range kernels. Moreover, the best $N$-term approximation strategy also helps us solve the shortcoming of previous methods which can only approximate the Gaussian function. It is also worth noting that the dropping off small coefficients strategy adopted by Chaudhury~\cite{Chaudhury_TIP_2013} to reduce the approximation terms can be interpreted as a special case of best $N$-term approximation. Other than these, our acceleration strategy also has two advantages: First, our approximation is nonnegative as illustrated in Fig~\ref{fig:shiftable_approxiamtion:Ours}. In contrast, some values of the approximation in Figs~\ref{fig:shiftable_approxiamtion:Chaudhury1}~\ref{fig:shiftable_approxiamtion:Chaudhury2} are negative; Second, different from Figs~\ref{fig:shiftable_approxiamtion:Dai}~\ref{fig:shiftable_approxiamtion:Chaudhury1}, our approximation does not suffer from blowing up small coefficients. \subsection{BF comparison} \begin{figure*}[t] \centering \begin{tabular}{ccc|ccc} \multicolumn{3}{c}{ \begin{adjustbox}{valign=m} \begin{subfigure}[b]{0.47\linewidth} \includegraphics[width=\textwidth ]{BF_SSIM_sigma_sigma} \caption{SSIM} \end{subfigure} \end{adjustbox} } & \multicolumn{3}{|c}{ \begin{adjustbox}{valign=m} \begin{subfigure}[b]{0.47\linewidth} \includegraphics[width=\textwidth ]{BF_PSNR_sigma_sigma} \caption{PSNR} \end{subfigure} \end{adjustbox} } \\ \begin{adjustbox}{valign=m} \begin{subfigure}[b]{0.16\linewidth} \includegraphics[width=\textwidth ]{BF_SSIM_porikli} \captionsetup{skip=1pt} \caption{ Porikli~\cite{Porikli_CVPR_2008}} \end{subfigure} \end{adjustbox} & \begin{adjustbox}{valign=m} \begin{subfigure}[b]{0.16\linewidth} \includegraphics[width=\textwidth ]{BF_SSIM_yang} \captionsetup{skip=1pt} \caption{Yang~\cite{Yang_CVPR_2009}} \end{subfigure} \end{adjustbox} & \begin{adjustbox}{valign=m} \begin{subfigure}[b]{0.16\linewidth} \includegraphics[width=\textwidth ]{BF_SSIM_gunturk} \captionsetup{skip=1pt} \caption{Gunturk~\cite{Gunturk_TIP_2011}} \end{subfigure} \end{adjustbox} & \begin{adjustbox}{valign=m} \begin{subfigure}[b]{0.16\linewidth} \includegraphics[width=\textwidth ]{BF_PSNR_porikli} \captionsetup{skip=1pt} \caption{ Porikli~\cite{Porikli_CVPR_2008}} \end{subfigure} \end{adjustbox} & \begin{adjustbox}{valign=m} \begin{subfigure}[b]{0.16\linewidth} \includegraphics[width=\textwidth ]{BF_PSNR_yang} \captionsetup{skip=1pt} \caption{Yang~\cite{Yang_CVPR_2009}} \end{subfigure} \end{adjustbox} & \begin{adjustbox}{valign=m} \begin{subfigure}[b]{0.16\linewidth} \includegraphics[width=\textwidth ]{BF_PSNR_gunturk} \captionsetup{skip=1pt} \caption{Gunturk~\cite{Gunturk_TIP_2011}} \end{subfigure} \end{adjustbox} \\ \begin{adjustbox}{valign=m} \begin{subfigure}[b]{0.16\linewidth} \includegraphics[width=\textwidth ]{BF_SSIM_pan} \captionsetup{skip=1pt} \caption{Pan~\cite{Pan_MPE_2014}} \end{subfigure} \end{adjustbox} & \begin{adjustbox}{valign=m} \begin{subfigure}[b]{0.16\linewidth} \includegraphics[width=\textwidth ]{BF_SSIM_chaudhury} \captionsetup{skip=1pt} \caption{Chaudhury~\cite{Chaudhury_TIP_2013}} \end{subfigure} \end{adjustbox} & \begin{adjustbox}{valign=m} \begin{subfigure}[b]{0.16\linewidth} \includegraphics[width=\textwidth ]{BF_SSIM_ours} \captionsetup{skip=1pt} \caption{Ours} \end{subfigure} \end{adjustbox} & \begin{adjustbox}{valign=m} \begin{subfigure}[b]{0.16\linewidth} \includegraphics[width=\textwidth ]{BF_PSNR_pan} \captionsetup{skip=1pt} \caption{Pan~\cite{Pan_MPE_2014}} \end{subfigure} \end{adjustbox} & \begin{adjustbox}{valign=m} \begin{subfigure}[b]{0.16\linewidth} \includegraphics[width=\textwidth ]{BF_PSNR_chaudhury} \captionsetup{skip=1pt} \caption{Chaudhury~\cite{Chaudhury_TIP_2013}} \end{subfigure} \end{adjustbox} & \begin{adjustbox}{valign=m} \begin{subfigure}[b]{0.16\linewidth} \includegraphics[width=\textwidth ]{BF_PSNR_ours} \captionsetup{skip=1pt} \caption{Ours} \end{subfigure} \end{adjustbox} \end{tabular} \caption{Qualitative evaluation for the filtering results of six methods, where SSIM and PSNR are chosen as the quantitative index to measure the approximation error. (a) (b) illustrate the SSIM and PSNR approximation error surfaces. (c)-(n) plot the the SSIM and PSNR indices of each method, where the left part shows SSIM, and the right part shows PSNR.} \label{fig:BF_SSIM_sigma_sigma} \end{figure*} In this section, we compare our acceleration method with five state-of-the-art methods (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot Porikli~\cite{Porikli_CVPR_2008}, Yang~\cite{Yang_CVPR_2009}, Gunturk~\cite{Gunturk_TIP_2011}, Pan~\cite{Pan_MPE_2014} and Chaudhury~\cite{Chaudhury_TIP_2013}) in terms of qualitative and quantitative aspects. The techniques adopted by the six methods are summarized in Table~\ref{tab:summary}. For a fair comparison, we implement all acceleration methods in C++ without SIMD instructions on a laptop with a 2.0 GHz CPU. Here only experiments on approximating the bilateral filter with Gaussian spatial and range kernels are provided to illustrate the validity and the effectiveness of the proposed method because the shiftability property based acceleration technique~\cite{Chaudhury_TIP_2013} can only speed up the Gaussian range kernel. Moreover, we set the number of bins equal to 32 in our evaluation for the PBFIC based method~\cite{Yang_CVPR_2009} and the box filtering based methods~\cite{Gunturk_TIP_2011,Pan_MPE_2014,Porikli_CVPR_2008}. \subsubsection{Accuracy} We start our experiments from three famous images (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot Lena, Barbara and Boat). The statistical data in the following paragraphs is an average of the three images. First, we perform the visual comparison of the fast bilateral filtering schemes. The filtering results of Lena are illustrated in Fig~\ref{fig:Lena}. The color-coded images represent the absolute error between the filtering image and ground truth. The variances of the spatial kernel and the range kernel are $\sigma_s \in \{1, 4, 7, 10\}, \sigma_r \in \{ 10, 23, 37, 50\}$. The number of boxes used is $3$ as we find that the total run time of three box filters is nearly same to the kernel separation method used by Yang~\cite{Yang_CVPR_2009}, and the number of approximation terms for range kernel is $5$. Absolute error images in Fig~\ref{fig:Lena} show that our method produces smaller error than the other methods. Hence, better accuracy is achieved in approximating BF. Besides the visual comparison, we also offer a convincing and quantitative illustration for the advantages of our method over previous methods. The SSIM index and the peak signal-to-noise ratio (PSNR) are exploited to evaluate the approximation errors of different methods. The statistical data with respect to different bandwidth parameters are plotted in Fig~\ref{fig:BF_SSIM_sigma_sigma}. We can easily verify that our method achieves the lowest approximation error for rather wide parameter variation interval. \subsubsection{Efficiency} \begin{table}[t] \caption{Run time comparison. The size of tested image is chosen as $1024 \times 1024$.} \label{tab:run_time} \centering \begin{tabularx}{\linewidth}{@{}|c|Y|Y|Y|Y|Y|Y|Y|@{} \hline \multirow{2}{*}{} & \multicolumn{7}{c|}{$\sigma_r$, where $\sigma_s= 6$} \\ \cline{2-8} & 15 & 20 & 25 & 30 & 35 & 40 & 45 \\ \hline Porikli~\cite{Porikli_CVPR_2008} & 1.69s & 1.69s & 1.65s & 1.64s & 1.66s & 1.63s & 1.65s \\ \hline Yang~\cite{Yang_CVPR_2009} & 1.59s & 1.62s & 1.60s & 1.61s & 1.59s & 1.63s & 1.62s \\ \hline Gunturk~\cite{Gunturk_TIP_2011} & 1.63s & 1.61s & 1.63s & 1.60s & 1.62s & 1.60s & 1.64s \\ \hline Pan~\cite{Pan_MPE_2014} & 1.61s & 1.63s & 1.60s & 1.62s & 1.61s & 1.63s & 1.60s \\ \hline Chaudhury~\cite{Chaudhury_TIP_2013} & 1.81s & 1.67s & 1.59s & 1.52s & 1.48s & 1.41s & 1.35s \\ \hline Ours & $\bm{1.39}$s & $\bm{1.37}$s & $\bm{1.39}$s & $\bm{1.38}$s & $\bm{1.34}$s & $\bm{1.36}$s & $\bm{1.37}$s \\ \hline \hline \hline \multirow{2}{*}{} & \multicolumn{7}{c|}{$\sigma_s$, where $\sigma_r=30$} \\ \cline{2-8} & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline Porikli~\cite{Porikli_CVPR_2008} & 1.63s & 1.64s & 1.63s & 1.64s & 1.65s & 1.64s & 1.65s \\ \hline Yang~\cite{Yang_CVPR_2009} & 1.61s & 1.63s & 1.60s & 1.61s & 1.62s & 1.63s & 1.62s\\ \hline Gunturk~\cite{Gunturk_TIP_2011} & 1.60s & 1.59s & 1.61s & 1.60s & 1.61s & 1.63s & 1.62s \\ \hline Pan~\cite{Pan_MPE_2014} & 1.61s & 1.61s & 1.60s & 1.62s & 1.63s & 1.62s & 1.64s \\ \hline Chaudhury~\cite{Chaudhury_TIP_2013} & 1.51s & 1.50s & 1.52s & 1.52s & 1.51s & 1.52s & 1.53s \\ \hline Ours & $\bm{1.38}$s & $\bm{1.37}$s & $\bm{1.37}$s & $\bm{1.38}$s & $\bm{1.39}$s & $\bm{1.37}$s & $\bm{1.39}$s \\ \hline \end{tabularx} \end{table} A simple comparison of the run time of BF acceleration schemes is not reasonable because all acceleration methods make a tradeoff between speed and accuracy, and the speed is usually inversely proportional to the accuracy. To conduct a fair comparison, we keep the PSNR indices of filtering results unchanged and measure the speed of each method. Strictly, the PSNR indices cannot be kept the same since they are affected by various reasons. Here, we tweak the parameters of each acceleration method and make the PSNR indices of the filtering results around $32dB$ because these results are visually distinguished from the ground truth. Table~\ref{tab:run_time} plots run times. We can observe that our approach consumes the smallest run time among different $\sigma_s$ and $\sigma_r$. More importantly, unlike the shiftability property based methods, our run time does not depend on the parameter $\sigma_r$. This is because many terms are used to approximate the long tails of the Gaussian function by other methods. In contrast, we only approximate the value on the truncated interval. Note that for large $\sigma_r$, the shiftability properties based methods (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot Chaudhury~\cite{Chaudhury_TIP_2013} and ours) achieve the best performance. Unlike Chaudhury, our method needs to perform 3-D box filtering caused by the dimension promotion technique. Although both our method and the dimension promotion based methods~\cite{Gunturk_TIP_2011,Pan_MPE_2014} exploit the dimension promotion technique, our method is faster than these methods. This is because previous methods need the multiplication operation along $z$ axis and our approach only requires the addition operation. This also proves that the filtering accuracy can be significantly improved without sacrificing efficiency. \subsubsection{Acceleration by pre-computation} Our method can be accelerated further by pre-computation. In this section, we will investigate how to integrate pre-computation with our algorithm with respect to two cases. \textbf{Case 1:} \emph{The input image $I$ is given, but the parameters setting $(\sigma_r, \sigma_s)$ of BF is not determined}. This is a frequently encountered situation in practice. For example, when an image already has been loaded into an image manipulation software such as Adobe Photoshop but the filtering parameters are still not determined by users, we are in this situation. If the image manipulation software can pre-compute something during the time waiting for the filtering parameters, the latency time for final results will be undoubtedly decreased. Badly, authors of existing acceleration methods~\cite{Yang_CVPR_2009,Gunturk_TIP_2011,Pan_MPE_2014,Porikli_CVPR_2008,Chaudhury_TIP_2013} do not propose any method to complete the task because all their acceleration schemes depend on the exact values of $\sigma_r, \sigma_s$. That is to say, existing methods cannot perform any calculation without knowing $(\sigma_r, \sigma_s)$. Unlike them, our method is able to perform pre-computation with little modification. Strictly speaking, our algorithm also cannot determine the exact value of $T_r$ before knowing $\sigma_r$, but we can make a tiny modification for the original algorithm to pre-compute the value of $F_c(\bm{y}, z)$ and $F_s(\bm{y}, z)$ with respect to some predefined values $\{T_{r_i}\}$. The specific reason is that $F_c(\bm{y}, z)$ and $F_s(\bm{y}, z)$ in \eqref{eq:numerator_2D_box_N_terms} only involves an unknown parameter $T_r$ indicating the truncated region of the range kernel $K_r(x)$. Once the exact value of $T_r$ is known, we can always take the minimum $T_{r_i}$ such that $T_{r_i} \geq T_r$ from the predefined set $\{T_{r_i}\}$ to replace $T_r$. In plain English, this is equivalent to extend the truncated region from $[-T_r, T_r]$ to $[-T_{r_i}, T_{r_i}]$ and employ $\cos(\frac{\pi k}{T_{r_i}}x)$ to approximate the values of $K_r(x)$ on the region $[-T_{r_i}, T_{r_i}]$. Since $F_c(\bm{y}, z)$ and $F_s(\bm{y}, z)$ have been figured out during the time loading images, our algorithm only need to perform box filtering which is a fast computation. Hence, without the computational burden for $F_c(\bm{y}, z)$ and $F_s(\bm{y}, z)$, the actually filtering time can be reduced from about $1.37s$ to about $0.69s$ according to our experiment. At last, to describe the pre-computation algorithm more formally, we outline the major computation steps of our pre-computation algorithm in the following: \begin{itemize} \item Pre-computation while loading an image into the manipulation software \begin{enumerate} \item Input image $I$ and predefined values $\{T_{r_i}\}$. \item Calculate a set of $F_c(\bm{y}, z)$ and $F_s(\bm{y}, z)$ according to $I$ and the values in $\{T_{r_i}\}$. \end{enumerate} \item Filtering procedure after specifying the parameter $(\sigma_r, \sigma_s)$ \begin{enumerate} \item Find the minimum $T_{r_i}$ such that $T_{r_i} \geq 3\sigma_r$ from the predefined set $\{T_{r_i}\}$. \item Compute the coefficients $a_k $ of the best $N$-term approximation for the range kernel on the range $[-T_{r_i}, T_{r_i}]$. \item Put the pre-computed $F_c(\bm{y}, z)$ and $F_s(\bm{y}, z)$ corresponding to $T_{r_i}$ as well as $a_k $ into our fast computation formulas listed in Section~\ref{sec:3DFBF} to yield final filtering results. \end{enumerate} \end{itemize} \begin{figure}[t] \centering \begin{subfigure}[b]{0.48\textwidth} \includegraphics[width=\textwidth ]{Time} \end{subfigure} \caption{Run time illustration, where the abscissa axis denotes the radius of box window and the ordinate axis presents the run time of each method. BFT achieves the smallest run time when the radius is small and increases its run time with the radius of box window. In contrast, run times of other acceleration algorithms are constants and therefore are not dependent on window's radius.} \label{fig:time} \end{figure} \textbf{Case 2:} \emph{Both input image $I$ and parameters setting $(\sigma_r, \sigma_s)$ are given}. This situation implies that we need to process input image immediately. Taking a close look at \eqref{eq:BF_promotion} \eqref{eq:BF_PBFIC} \eqref{eq:shiftable}, we can find that all acceleration methods involve exponential function $\exp(x)$ or trigonometric functions $\sin(x), \cos(x)$. As we known, both exponential function and trigonometric function are time-consuming operations. Since the value of input image is discrete, we can pre-compute a look-up table for the value of exponential/trigonometric functions on these discrete points to speed up the computation further. It is also wroth noting that the major reason that slows down the brute-force implementation of BF is also the exponential function used in \eqref{eq:BF}. Taking the look-up table technique, we can accelerate the brute-force implementation too. However, we have to point out that the look-up table technique cannot reduce the computational complexity of the brute-force implementation and thus its run time still depends on the size of box window $\mathcal{N}_x$ of BF. Fig~\ref{fig:time} illustrates the run time of seven methods with respect to different window radii. We can plot this figure because Table~\ref{tab:run_time} implies that the speed of different acceleration methods is rather robust for different parameter settings, thus the run time at arbitrary parameter settings such as $(\sigma_r=40 , \sigma_s=5)$ can stand for the performance of one kind of acceleration method. Here the seven methods include Porikli~\cite{Porikli_CVPR_2008}, Yang~\cite{Yang_CVPR_2009}, Gunturk~\cite{Gunturk_TIP_2011}, Pan~\cite{Pan_MPE_2014}, Chaudhury~\cite{Chaudhury_TIP_2013}, ours as well as the brute-force implementation accelerated by the look-up table (BFT). From Fig~\ref{fig:time}, we can verify that the run time of BFT increases with the radius of the box window $\mathcal{N}_x$. In addition, when the size of window is small, the fastest method is BFT. The reason is that the overall computational cost of BFT is dominated by the size of the window $\mathcal{N}_x$, so smaller window size, lower computational cost and the run time will increase with the window size. Unlike BFT, the run time of all acceleration methods do not change with the window size because their computational complexity is $O(|I|)$. Note that disregarding the small window case, our acceleration algorithm overwhelms other acceleration methods. \begin{table}[t] \caption{Support regions and the sizes of the box filters used to represent 2-D Haar functions.} \label{tab:support_regions} \centering \begin{tabularx}{\linewidth}{@{}YYY@{}} \hline & Support Region & Support Region's Size \\ \hline $\ddot{B}(\bm{x})$ & $A \times A$ & $2T_s \times 2T_s$ \\ $\ddot{B}^1_{0, j_2,k_2}(\bm{x})$ & $A \times A^{j_2,k_2}_1$ & $2T_s \times 2^{-j_2+1}T_s$ \\ $\ddot{B}^2_{0, j_2,k_2}(\bm{x})$ & $A \times A^{j_2,k_2}_2$ & $2T_s \times 2^{-j_2+1}T_s$ \\ $\ddot{B}^1_{j_1,k_1,0}(\bm{x})$ & $A^{j_1,k_1}_1 \times A$ & $ 2^{-j_1+1}T_s \times 2T_s $ \\ $\ddot{B}^2_{j_1,k_1,0}(\bm{x})$ & $A^{j_1,k_1}_2 \times A$ & $2^{-j_1+1}T_s \times 2T_s$ \\ $\ddot{B}^1_{j_1,k_1,j_2,k_2}(\bm{x})$ & $A^{j_1,k_1}_1 \times A^{j_2,k_2}_1$ & $ 2^{-j_1+1}T_s \times 2^{-j_2+1}T_s $ \\ $\ddot{B}^2_{j_1,k_1,j_2,k_2}(\bm{x})$ & $A^{j_1,k_1}_1 \times A^{j_2,k_2}_2$ & $ 2^{-j_1+1}T_s \times 2^{-j_2+1}T_s $\\ $\ddot{B}^3_{j_1,k_1,j_2,k_2}(\bm{x})$ & $A^{j_1,k_1}_2 \times A^{j_2,k_2}_2$ & $ 2^{-j_1+1}T_s \times 2^{-j_2+1}T_s $\\ $\ddot{B}^4_{j_1,k_1,j_2,k_2}(\bm{x})$ & $A^{j_1,k_1}_2 \times A^{j_2,k_2}_1$ & $ 2^{-j_1+1}T_s \times 2^{-j_2+1}T_s $ \\ \hline \end{tabularx} \end{table} \section{Conclusion} In this paper, we propose a unified framework to accelerate BF with arbitrary spatial and range kernels. Unlike previous approaches, our method jointly employs five techniques: truncated spatial and range kernels, the best $N$-term approximation of these kernels as well as three existing acceleration techniques to speed up BF. It thus can inherit the advantage of previous acceleration algorithms while avoiding the problems of previous approaches. Moreover, we first transform 2-D BF into a set of 3-D box filters and disclose that BF can be fast computed by the 3-D SAT. Taking advantage of the expressive orthogonal functions used in the best $N$-term approximation scheme, our approach employs fewer terms which means faster computing speed, while obtaining more gratifying filtering results among a great wide of parameter settings. More importantly, the strength of our method has been verified by several carefully designed experiments. All experiments indicate that our method outperforms other methods. Especially, the filtering accuracy is significantly improved without sacrificing efficiency. \appendices \section{Box filter representation} \label{sec:box_filter} \begin{figure}[t] \begin{subfigure}[b]{0.47\linewidth} \includegraphics[width=\textwidth ]{Best_N_coef_haar} \caption{Haar decomposition} \label{fig:decomposition:Haar} \end{subfigure} \begin{subfigure}[b]{0.47\linewidth} \includegraphics[width=\textwidth ]{Best_N_coef_tri} \caption{Cosine decomposition} \label{fig:decomposition:Cosine} \end{subfigure} \caption{Visual illustration for the amplitude of the decomposition coefficients of the spatial kernel $G_5(x)$ and range kernel $G_{40}(x)$ on the Haar and trigonometric basis.} \label{fig:decomposition} \end{figure} All functions in the four sets $\{\phi(x)\phi(y)\}$, $\{\phi(x)\psi_{j_2,k_2}(y)\}$, $\{\psi_{j_1,k_1}(x) \phi(y)\}$ $\{\psi_{j_1,k_1}(x)\psi_{j_2,k_2}(y) \}$ can be represented by a linear combination of box filters. First, $\phi(x)$ achieves $1$ in the support region $A = [-T_s, T_s]$. Similarly, let $Z_k = \sign(k)(2|k|-1)T_s$, $A^{j,k}_1 = [{2^{-j}}{(Z_k-T_s)}, {2^{-j}}{Z_k}]$ and $A^{j,k}_2 = [{2^{-j}}{Z_k}, {2^{-j}}{(Z_k+T_s)}]$, the support region of $\psi_{j,k}(x)$ can be presented as $A^{j,k}_1 \bigcup A^{j,k}_2$ because $\psi_{j,k}(x) = 1$ for $x \in A^{j,k}_1$ and $\psi_{j,k}(x) = -1$ for $x \in A^{j,k}_2$. Second, $\phi(x)\phi(y)$ represents a 2-D box function $\ddot{B}(\bm{x})$ with the support region $A \times A$ as $\phi(x)$ is constant in the region $A$. Unlike $\phi(x)\phi(y)$, $\phi(x)\psi_{j_2,k_2}(y)$ and $\psi_{j_1,k_1}(x) \phi(y)$ are binary functions equal to 1 in the regions $A \times A^{j_2,k_2}_1$, $A^{j_1,k_1}_1 \times A$ and obtain $-1$ in the regions $A \times A^{j_2,k_2}_2$, $A^{j_1,k_1}_2 \times A$, respectively. Hence putting $\ddot{B}^1_{0, j_2,k_2}(\bm{x})$, $\ddot{B}^2_{0, j_2,k_2}(\bm{x})$, $\ddot{B}^1_{j_1,k_1,0}(\bm{x})$ and $\ddot{B}^2_{j_1,k_1,0}(\bm{x})$ be four 2-D box functions defined on the support regions $A \times A^{j_2,k_2}_1$, $A \times A^{j_2,k_2}_2$, $A^{j_1,k_1}_1 \times A $ and $A^{j_1,k_1}_2 \times A $ respectively, we thus have $\phi(x)\psi_{j_2,k_2}(y) = \ddot{B}^1_{0, j_2,k_2}(\bm{x}) - \ddot{B}^2_{0, j_2,k_2}(\bm{x})$, $\psi_{j_1,k_1}(x) \phi(y) = \ddot{B}^1_{j_1,k_1,0}(\bm{x}) - \ddot{B}^2_{j_1,k_1,0}(\bm{x})$. Similar to $\phi(x)\psi_{j_2,k_2}(y)$ and $\psi_{j_1,k_1}(x) \phi(y)$, $\psi_{j_1,k_1}(x) \psi_{j_2,k_2}(y)$ is also a binary function. Unlike them, $\psi_{j_1,k_1}(x) \psi_{j_2,k_2}(y)$ equals to $1$ on the regions $A^{j_1,k_1}_1 \times A^{j_2,k_2}_1$, $A^{j_1,k_1}_2 \times A^{j_2,k_2}_2$ and obtains -1 on the region $A^{j_1,k_1}_1 \times A^{j_2,k_2}_2$, $A^{j_1,k_1}_2 \times A^{j_2,k_2}_1$. Let $\ddot{B}^1_{j_1,k_1,j_2,k_2}(\bm{x})$, $\ddot{B}^2_{j_1,k_1,j_2,k_2}(\bm{x})$, $\ddot{B}^3_{j_1,k_1,j_2,k_2}(\bm{x})$ and $\ddot{B}^4_{j_1,k_1,j_2,k_2}(\bm{x})$ be four 2-D box functions with the support regions $A^{j_1,k_1}_1 \times A^{j_2,k_2}_1$, $A^{j_1,k_1}_1 \times A^{j_2,k_2}_2$, $A^{j_1,k_1}_2 \times A^{j_2,k_2}_2$ and $A^{j_1,k_1}_2 \times A^{j_2,k_2}_1$, respectively, we can reformulate $\psi_{j_1,k_1}(x)\psi_{j_2,k_2}(y)$ as $\ddot{B}^1_{j_1,k_1,j_2,k_2}(\bm{x}) - \ddot{B}^2_{j_1,k_1,j_2,k_2}(\bm{x}) + \ddot{B}^3_{j_1,k_1,j_2,k_2}(\bm{x}) - \ddot{B}^4_{j_1,k_1,j_2,k_2}(\bm{x}) $. Finally, we list the support regions and the size of the box filters used to represent 2-D Haar functions in Table~\ref{tab:support_regions} for reference. Given all this, we can reexpress $ K_s(\| \bm{x} \|) $ in \eqref{eq:Haar_N_terms} as \begin{IEEEeqnarray}{C} \begin{split} & K_s(\| \bm{x} \|) \approx \sum_{c_0 \in \Lambda^s_1} c_0 B(\bm{x}) \\ + & \sum_{c_{0, j_2,k_2} \in \Lambda^s_2} c_{0, j_2,k_2} \sum_{i=1}^2 (-1)^{i+1} B^i_{0, j_2,k_2}(\bm{x}) \\ + & \sum_{c_{ j_1,k_1,0} \in \Lambda^s_3} c_{j_1,k_1,0} \sum_{i=1}^2 (-1)^{i+1} B^i_{j_1,k_1,0}(\bm{x}) \\ + & \sum_{c_{j_1,k_1,j_2,k_2} \in \Lambda^s_4} c_{j_1,k_1,j_2,k_2} \sum_{i=1}^4 (-1)^{i+1} B^i_{j_1,k_1,j_2,k_2}(\bm{x}) \end{split} \label{eq:2D_box_N_terms} \end{IEEEeqnarray} which is consisted of several box filters. Further, let $\ddot{B}_{\bm{j}}(\bm{x})$ present the 2-D box functions used in \eqref{eq:2D_box_N_terms}, $c_{\bm{j}}$ be the corresponding coefficients of $\ddot{B}_{\bm{j}}(\bm{x})$ and $\Lambda^s$ stands for the collection of $c_{\bm{j}}$, $N^{\bm{j}}_{\bm{x}}$ be the support region of $\ddot{B}_{\bm{j}}(\bm{x})$, we have \eqref{eq:Box_N_terms}. \section{How to compute the best $N$-term approximation?} \label{sec:attenuation} \begin{table}[t] \centering \caption{The corresponding relationship between $N$ and $M$ for spatial kernel $G_5(x)$ and range kernel $G_{40}(x)$.} \label{tab:NM} \begin{tabularx}{\linewidth}{@{}c|Y|Y|Y|Y|Y|Y|Y|Y|Y@{}} \hline \multirow{2}{*}{Spatial kernel} & $N$ & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\ \cline{2-10} & $M$ & 1 & 19 & 19 & 19 & 19 & 19 & 19 & 19 \\ \hline \hline \multirow{2}{*}{Range kernel} & $N$ & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\ \cline{2-10} & $M$ & 2 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\ \hline \end{tabularx} \end{table} Theoretically, finding the best $N$-term approximation of a given function requires us to minimize the objective function~\eqref{eq:N_term}. However, in practice the minimizing is not necessary because the best $N$-term approximation for arbitrary functions can be obtained by selecting the first $N$ largest coefficients and the amplitude of coefficients attenuates very fast. The two points imply that the first $N$ largest coefficients must reside in the first $M$ coefficients, where $M$ is a constant which is equal or greater than $N$. More clearly speaking, to find the best $N$-term approximation, we only need to calculate the first $M$ coefficients and then pick up the first $N$ largest coefficients from the first $M$ coefficients. As an example, Fig~\ref{fig:decomposition} illustrates the coefficients on the Haar basis and trigonometric basis for the Gaussian function respectively, where the abscissa axis denotes the linear order of each basis functions, the ordinate axis represents the amplitude of coefficient of each basis functions. Note that since each Haar function $\psi_{i,j}$ is identified by two indices $i$, $j$, we order each Haar function according to following rules: for two Haar functions $\psi_{i_1,j_1}$, $\psi_{i_2,j_2}$, if $i_1 < i_2$ or $i_1 = i_2$ and $j_2 < j_2$, $\psi_{i_1,j_1}$ is putted before $\psi_{i_2,j_2}$; otherwise, $\psi_{i_1,j_1}$ is located after $\psi_{i_2,j_2}$. As for the trigonometric basis, all coefficients of sine functions are zeros, we thus sort the cosine functions $\cos(k \omega x)$ according the index $k$. From Figs~\ref{fig:decomposition:Haar}~\ref{fig:decomposition:Cosine}, we can observe that both the coefficients of Haar basis functions and the coefficients of trigonometric basis functions decay dramatically. The corresponding relationship between $N$ and $M$ for spatial kernel $G_5(x)$ and range kernel $G_{40}(x)$ is listed in Table~\ref{tab:NM} which tells us the minimal number $M$ of the first $M$ coefficients containing the first $N$ largest coefficients. From this table we can reasonably conclude that finding the best $N$-term approximation only needs to figure out the first $20N$ coefficients and then to select the first $N$ largest coefficients and their corresponding coefficients. \section*{Acknowledgment} This work was supported by National Natural Science Foundation of China with Nos. 61331018, 91338202, 61572405 and 61571046, and by China 863 program with No. 2015AA016402. \ifCLASSOPTIONcaptionsoff \newpage \fi \bibliographystyle{IEEEtran}
{'timestamp': '2018-03-02T02:00:15', 'yymm': '1803', 'arxiv_id': '1803.00004', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00004'}
arxiv
\section{Introduction} A \textit{social dilemma} arises in a situation where individual decisions are at odds with the performance of the collective. As such it represents the epitome for studying the emergence and stability of cooperative behavior in both natural and artificial systems~\cite{capraro2013model,wang2014different,szabo2018social}. Ever since the publication of Darwin's epochal work~\cite{darwin1888descent}, the appearing paradox of cooperation in social dilemmas has been at the focus of the research community. The insight that all major transitions in biological evolution, from simple to complex structures, are characterized by some degree of cooperation and sacrifice~\cite{Smith-1973}, has subsequently led to major advances in the field. However, despite decades of investigation the cooperation paradigm is still regarded as one of the most challenging issues currently faced by scientists~\cite{Pennisi-2005}. A particular setting whose study is of great value to the complex systems community are situations where an individual has repeated encounters within not necessarily the same group or interaction structures. In this context, the concepts of direct reciprocity (``help someone who has helped you before'')~\cite{Trivers-1971} and indirect reciprocity (``help someone who is helpful'')~\cite{nowak2005evolution} have been able to provide solutions for the emergence of cooperation in essentially disparate types of social dilemmas. Although initially structured for encounters resembling a prisoner's dilemma~\cite{Axelrod-1981}, both mechanisms have been extended to account for a disperse class of interaction structures that are ubiquitous in natural systems (see Refs.~\cite{van2012emergence,hauert2006synergy,killingback2002continuous,yoeli2013powering,hilbe2014cooperation,hilbe2015evolutionary,pan2015zero}). While being of significant theoretical value, the extent to which direct and indirect reciprocity are able to explain cooperation in real-life systems has recently been put into question~\cite{vanDoorn-2012,Taborsky-2016}. The reason for this is that the application of the rules is costly (in terms of memory and processing requirements), in the sense that they demand high cognitive abilities such as recognition of the group with which an individual is engaged in reciprocal mechanisms or knowledge about the interaction outcomes. This, for example, limits the emergence of cooperation in systems where there is randomness in the interactions and the individuals do not posses the cognitive prowess to acknowledge with whom they play~\cite{Taborsky-2016}. To tackle this problem, the concept of \textit{generalized reciprocity}, formally defined as the rule of ``help anyone if helped by someone'', has been developed~\cite{pfeiffer2005evolution}. This concept, whose roots lie within ``upstream reciprocity''~\cite{Boyd-1989,Nowak-2005} has been fully explored in Refs.~\cite{vanDoorn-2012,Taborsky-2016}. The intrinsic feature that may favor generalized reciprocity over others is that the proximate mechanism behind it may be explained by the changes of an individuals' physiological condition~\cite{Rutte-2007,Bartlett-2006,isen1987positive}. In other words, the decision of an individual whether to cooperate or not, is based on an \textit{internal cooperative state} which captures its past experience. To shed light on the dynamical process behind state-based generalized reciprocity, we provide an intuitive illustration in Fig.~\ref{fig:gen-rep-explanation}. \begin{figure}[t] \includegraphics[width=7.7cm]{fig1.eps} \caption{The concept of generalized reciprocity explained by the (random) interactions within a group of 5 individuals. Solid directed lines are active relationships, whereas dashed are inactive in the respective round. In each round the individuals are colored according to their willingness for cooperation described by the internal state. As shown, in round $t=1$ individual $I$ exchanges cooperative experiences with $1$, $2$ and $3$. This results in changes in the internal states of the interacting individuals and the level of cooperation that is provided when tasked in $t = 2$. } \label{fig:gen-rep-explanation} \end{figure} This simple behavioral mechanism may apply to a wide range of dynamical interaction structures. Specifically, the internal state may mimic aggregated fitness in biological systems, wealth or well-being in animal and human societies, or energy level in artificial (e.g. communication) systems. These observations are complemented with convincing empirical evidence suggesting the possibility that such a mechanism may have indeed emerged in natural systems by evolution~\cite{Rutte-2007,Leimgruber-2014,Gfrerer-2017,Bartlett-2006,Stanca-2009}. Nevertheless, the development of theoretical models has been lacking and so far only pairwise linear interactions between individuals~\cite{Barta-2011,Utkovski-2017} have been considered. Other ubiquitous scenarios that describe a social dilemma as group interactions~\cite{Perc-2017}, the possibility of nonlinear payoffs~\cite{killingback2002continuous,hauert2006synergy} or even intertwined combinations of them~\cite{milinski2012interaction}, have been eschewed. \subsection{Our contribution} Motivated by the early exploits of Motro~\cite{motro1991co} on public goods, and the insights provided in~\cite{kerr2004altruism,hilbe2014cooperation,hilbe2015evolutionary}, here we revisit the concept of social dilemmas within a society that follows a state-based behavioral mechanism in the spirit of~\cite{Utkovski-2017}. We implement this framework to examine the applicability of the behavioral mechanism in a wide class of payoff structures, and thus study the general setup that is required for state-based generalized reciprocity to promote cooperation. Under this rather general model, the well-studied problems of prisoner's dilemma~\cite{Nowak-2006five}, public goods game~\cite{Perc-2017} and the common-pool resource problem~\cite{ostrom2015governing} arise as special cases (see Appendix~A for simple examples). Moreover, the model can easily accommodate different combinations of interaction structures and/or payoff functions and capture their dynamics. Even though such structures have been widespread in natural systems~\cite{killingback2002continuous}, the role of generalized reciprocity in their cooperation dynamics is yet to be explored. By treating the problem from the perspective of dynamical systems, here we develop a systematic way to investigate the implications created by these structures. Our model reveals that, under some simple assumptions, cooperation through generalized reciprocity emerges as the unique attractor that maximizes the global level of cooperation while at the same time preventing each participating individual from being exploited by the environment. The analysis elucidates the role of the interaction topology, here described via a \textit{complex network}, which covers the standardly studied ``mixed population'' and ``regular lattice'' models as special cases. It turns out that here a critical role plays a specific \textit{network centrality measure} which quantifies the propensity of the network structure to cooperation, by dictating the degree of cooperation displayed both at microscopic and macroscopic level. The structure of this paper is as follows. In Sec.~II we introduce the interaction structure, the state-based social dilemma and the behavioral update rule. In Sec.~III we provide an analytical study of the asymptotic behavior of the cooperation dynamics in a population consisting of both individuals that follow a state-based update rule and unconditional defectors. We examine two phase transitions, extinction of cooperation and unconditional cooperation, which show to critically capture the properties of the behavioral mechanism based on generalized reciprocity. In Sec.~IV we address in detail a practical example by considering an interaction structure that couples a donation process with a public goods game played on random graphs. The last section summarizes our findings. Further examples of social dilemmas with some additional analysis and theoretical background are provided in Appendices~A-C. \section{Model} \subsection{Interaction structure} We consider a class of dynamical models constituted of a finite population $\mathcal{N}$ of $N$ individuals. The models run in discrete time and explain the evolution of the $N$ dimensional vector $\mathbf{p}(t) \in \left[ 0,1 \right]^N$, where the $i$-th entry, $\mathrm{p}_i(t)$, describes the internal state of individual $i$ in round $t$. According to our representation the individual payoff generated in each time step, is a function of the population state vector, \begin{align} \mathrm{y}_{i,\mathcal{G}} \left( t \right) &= b_{i,\mathcal{G}} \left( \mathbf{p}(t) \right) - c_{i,\mathcal{G}} \left( \mathrm{p}_i(t) \right), \label{eq:payoff-general} \end{align} where $b_{i,\mathcal{G}}$ and $c_{i,\mathcal{G}}$ are respectively the benefit and cost function of individual $i$, both parametrized by a connected graph $\mathcal{G} \left( \mathcal{N}, \mathcal{E} \right)$. The graph is defined by a set of vertices $\mathcal{N}$, corresponding to the set of individuals, and $\mathcal{E} \subseteq \mathcal{N} \times \mathcal{N}$ is the set of edges which determines the pairwise relationships between individuals. The generality of the model is captured by the freedom in the choice of the benefit function $b_{i,\mathcal{G}}$ and the cost function $c_{i,\mathcal{G}}$. The only constraint that we thereby make is that we restrict both functions to be sufficiently smooth and adhere to several simple assumptions that define a social dilemma. In particular, we assume that the benefit function is non-decreasing with respect to each coordinate-wise projection that is not $i$, with the note that it is strictly increasing for some projections that are defined through the network topology and the rules of interaction. This implies that $i$ gains with the increase in the willingness for cooperation of a particular group of other individuals. We name this group the $l$-neighborhood of $i$ and represent it as $\mathcal{N}^{(l)}_i$. Moreover, we restrict the cost function to be an increasing function of $\mathrm{p}_i(t)$ in order to capture the social setting of paying a higher cost for the increments in the benefits of others. Finally, both functions should satisfy $b_{i,\mathcal{G}} \left( \mathbf{0} \right) = c_{i,\mathcal{G}} \left( 0 \right) = 0$ so as indicating that nothing happens when everyone defects unconditionally. In one possible physical interpretation, the model~(\ref{eq:payoff-general}) describes the payoff of a continuous game with deterministic (i.e fixed) interactions between the individuals at each time step and where each individual has a continuum of behavioral strategies to choose from. This is, for example, the case with the continuous iterative prisoner's dilemma. In another interpretation, (\ref{eq:payoff-general}) provides a deterministic approximation for the steady state of stochastic interactions among the individuals, with random payoffs generated by the individual internal states. In this context, $b_{i,\mathcal{G}}$ and $c_{i,\mathcal{G}}$ are affine maps with respect to the random variables. The second interpretation, that we will closely follow, is aligned to the concept of generalized reciprocity, in the sense that it describes the individual payoffs as a function of the benefit they obtain through random interactions with individuals from their neighborhood, without explicit records to the contributions during these interactions. \subsection{The social dilemma} The definitions of the benefit and cost functions offer a realistic representation for a plethora of real-life situations. However, they alone do not describe the social dilemma. To set the stage for this phenomena, we must define two additional conditions that have to be present within the payoff structure. First, for every individual there should exist a point beyond which cooperation is costly, i.e. beyond this point the individual is better-off by not increasing the willingness to cooperate, while expecting cooperation from others. This implies that, full cooperation by all individuals does not belong to the set of Nash equilibria, defined as the set of points that maximize the individuals' payoff given the set of available actions of all other individuals. Formally, we define this condition as the point $\mathbf{p} \in \left[ 0,1 \right]^N $, such that for every other point $\mathbf{\hat{p}}$ satisfying $\mathrm{proj}_j \left(\mathbf{\hat{p}} \right) \geq \mathrm{proj}_j \left(\mathbf{p} \right)$ for all $j \in \mathcal{N}^{(l)}_i$, where $\mathrm{proj}_j \left(\mathbf{\hat{p}} \right)$ is the $j$-th coordinate-wise projection of $\mathbf{\hat{p}}$ , the rate at which the benefit of individual $i$ changes is lower than the change in the cost when only its internal state is slightly perturbed while everything else is kept constant. In other words, for all those $\mathbf{\hat{p}}$, \begin{align} \pdv{b_{i,\mathcal{G}} (\mathbf{\hat{p}})}{\mathrm{p}_i} < \dv{c_{i,\mathcal{G}}(\mathrm{\hat{p_i}})}{\mathrm{p}_i}. \label{eq:dilemma_condition_1} \end{align} Second, for all $\mathbf{\hat{p}} \in \left[ 0,1 \right]^N $, the sum over the changes in benefits of all $j \in \mathcal{N}$ must be greater than or equal to the change in cost provided by $i$, \begin{align} \sum_j \pdv{b_{j,\mathcal{G}} (\mathbf{\hat{p}})}{\mathrm{p}_i} \geq \dv{c_{i,\mathcal{G}} (\mathrm{\hat{p_i}})}{\mathrm{p}_i}, \label{eq:dilemma_condition_2} \end{align} with the strict inequality holding when $\mathbf{\hat{p}} = \mathbf{0}$. Condition~(\ref{eq:dilemma_condition_2}) together with the definitions of the benefit and cost functions, $b_{i,\mathcal{G}}$ and $c_{i,\mathcal{G}}$, reveals that full cooperation by all individuals, $\mathrm{p}_i(t) = 1$, for all $i$ and $t$, is an efficient solution, i.e. it is a solution that maximizes the overall population payoff. Considered together these two conditions build a structure under which egoistic behavior leads to depletion of the performance of the overall system, which is exactly the social dilemma metaphor. A typical example for an interaction mechanism that is easily captured by this representation is the snowdrift game, where cooperation is a favorable trait for an individual as long as the number of cooperative neighbors is low~\cite{Santos-2005}. Another group of mechanisms that are modeled when condition (\ref{eq:dilemma_condition_1}) holds for all $\mathbf{\hat{p}} \in \left[ 0,1 \right]^N$ and condition (\ref{eq:dilemma_condition_2}) is a strict inequality for every $\mathbf{\hat{p}}$ are the prisoner's dilemma~\cite{Santos-2005}, the common pool resource problem~\cite{ostrom2015governing}, the public goods game~\cite{Perc-2017}, as well as extensions and combinations of these three interactions structures that constrain the cost of an individual to be a function only of its own state are covered (see for example~\cite{milinski2012interaction,motro1991co,hilbe2014cooperation,hilbe2015evolutionary,Doebeli-2005,archetti2012game,battiston2017determinants}). In Appendix~A we provide a short overview for state-based social dilemmas that can be described through the first three interaction structures, while a comprehensive example for the public goods game will be analyzed in Sec.~IV. \subsection{Behavioral update mechanism} In our scenario, the individuals follow the state-based behavioral update introduced in~\cite{Utkovski-2017}, apart for a fraction of the population (a set $\mathcal{D}$) of unconditional defectors (with $\mathrm{p}_i (t) = 0$, $i\in \mathcal{D}$, for all $t$). The behavioral update rule describes the cooperative state of individual $i$ at time $t+1$ as a function of its' accumulated payoff $\mathrm{Y}_{i,\mathcal{G}}(t)$ by time~$t$ \begin{align} \mathrm{p}_i(t+1)=f_i \left(\mathrm{Y}_{i,\mathcal{G}}(t)\right), \label{eq:update} \end{align} where $\mathrm{Y}_{i,\mathcal{G}}(t)=\mathrm{Y}_{i,\mathcal{G}}(t-1)+\mathrm{y}_{i,\mathcal{G}}(t)$, with $\mathrm{Y}_{i,\mathcal{G}}(0)$ being the initial condition and $\mathrm{y}_{i,\mathcal{G}}(0)=0$. We assume that the function $f_i :\mathbb{R} \to \left(0, 1 \right)$, which maps the payoff $\mathrm{Y}$ to the willingness for cooperation $\mathrm{p}_i$, is continuous on the interval $\left(0, 1 \right)$ and has a continuous inverse (i.e. is a homeomorphism). Additionally, it is monotonically increasing with $\lim_{\mathrm{Y}\to -\infty} f_i(\mathrm{Y}) = 0$ and $\lim_{\mathrm{Y}\to \infty} f_i(\mathrm{Y}) = 1$. An example of a function with the above properties (which, for example, is often used for modeling in biology and ecology) is the logistic function $f_i(\mathrm{Y})=\left[1+e^{-\kappa_i(\mathrm{Y}-\omega_i)}\right]^{-1}$, where the parameters $\kappa_i$ and $\omega_i$ define the steepness, respectively the midpoint of the function. This rule provides a simple description for the cooperative behavior in a wide range of dynamical interaction structures. Specifically, the internal state may mimic aggregated fitness in biological systems, wealth or well-being in animal and human societies, or energy level in artificial systems~\cite{Utkovski-2017}. Its advantage lies in its simplicity since (\ref{eq:update}) can easily be described as a Markovian process where an individual only has to know its present state and payoff in order to determine the next action. This is significantly different from other reciprocal update rules. For instance, in certain interaction structures direct reciprocity requires extensive memory requirements to record own and opponents' actions in order for cooperation to thrive~\cite{hilbe2017memory}. \section{Results} \subsection{Cooperation dynamics} We begin the analysis by studying the properties of the steady state solution $\mathbf{p}^*$. We will thereby assume that the interaction structure is non-degenerate, which, in our terms, means that the Jacobian of the individual payoff functions accounting only for the individuals that follow the generalized reciprocity update rule, $\mathbf{J_y}^{\setminus\mathcal{D}}(\mathbf{p})$, at the point $\mathbf{0}$ is nonsingular. In fact, it is easy to notice that as a consequence of~(\ref{eq:dilemma_condition_2}), this assumption always holds when the whole population follows~(\ref{eq:update}). Now, in steady state, for the individuals adhering to (\ref{eq:update}), i.e. the non-defectors, it holds \begin{align} \mathrm{p}^*_i&=f_i\left(f_i^{-1}(\mathrm{p}^*_i)+b_{i,\mathcal{G}} \left( \mathbf{p}^* \right) - c_{i,\mathcal{G}} ( \mathrm{p}^*_i)\right) \label{eq:iterative_steady_state}. \end{align} By applying the inverse map, we obtain \begin{align} f_i^{-1}\left(\mathrm{p}_i^*\right)&=f_i^{-1}\left(\mathrm{p}_i^*\right)+b_{i,\mathcal{G}} \left( \mathbf{p}^* \right) - c_{i,\mathcal{G}} \left( \mathrm{p}^*_i \right). \label{eq:steady_state_individual_inverse} \end{align} For the above equation to hold, it is required that 1)~$\mathrm{y}^*_{i,\mathcal{G}}\doteq b_{i,\mathcal{G}} \left( \mathbf{p}^* \right) - c_{i,\mathcal{G}} \left( \mathrm{p}^*_i \right)=0$, unless either 2)~$\mathrm{p}_i^*=1$ (i.e. $\mathbf{\mathrm{Y}}_{i,\mathcal{G}}^*=\infty$), or 3)~$\mathrm{p}_i^*=0$ (i.e.$\mathbf{\mathrm{Y}}_{i,\mathcal{G}}^*=-\infty$). It is easy to verify that condition 3) is a special case of condition 1) when $\mathrm{p}^*_j=0$ for all $j \in \mathcal{N}^{(l)}_i$. Indeed, when $\mathrm{p}^*_i=0$, it must be that $y^*_{i,\mathcal{G}}\leq 0$. By the definition of (\ref{eq:update}), the condition $y^*_{i,\mathcal{G}} < 0$ implies $\mathrm{p}^*_i=0$ which, on the other hand implies $y^*_{i,\mathcal{G}} \geq 0$, leading to a contradiction. Therefore, whenever $\mathrm{p}^*_i=0$ it must hold that $ y^*_{i,\mathcal{G}} = 0$, which is true if and only if $\mathrm{p}^*_j=0$ for all $j \in \mathcal{N}^{(l)}_i$. These conditions, together with the (strict) monotonicity of the function $f_i$ and the assumption that the interactions are non-degenerate, reveal that each individual $i$ conforming to (\ref{eq:update}) will increase, respectively decrease, its willingness for cooperation (based on its environment, i.e. on the state dynamics of other individuals), until the system reaches a steady state where it is either satisfied $\mathrm{y}^*_{i,\mathcal{G}} = 0$ or $\mathrm{p}^*_{i} = 1$, for all $i \not\in \mathcal{D}$. In other words, each individual following the generalized reciprocity rule will cooperate with the maximal willingness, given its environment, so as it is not exploited. In this context, the steady state $\mathbf{p}^*$ may be interpreted as a solution of the constrained optimization problem of maximizing the global level of cooperation, subject to all individuals that follow the rule receiving a non-negative payoff while the unconditional defectors have $\mathrm{p}^*_i = 0$, \begin{equation} \begin{aligned} \mathbf{p}^* &= \underset{\mathbf{p} \ \in \ \left[0,1 \right]^N}{\text{arg max}}\left \{ \sum_{i\not\in\mathcal{D}} \mathrm{p}_i; \; \mathrm{y}_{i,\mathcal{G}} \left( \mathbf{p}\right) \geq 0 \; \forall i \ \texttt{and} \ \mathrm{p}_i = 0 \; \forall i \in \mathcal{D} \right \}. \end{aligned} \label{eq:optimization-solution} \end{equation} In Appendix~B we provide further reasoning behind this representation. Moreover, there we also discuss that the solution to equation (\ref{eq:optimization-solution}) is unique, i.e. the corresponding dynamical system has a unique attractor. This implies that local cooperative behavior diffuses as a flux of energy over the network, eventually saturating at a point where cooperation is maximized under the constraint that no single individual is exploited. \subsection{Phase transitions} Next, we turn our attention to the phase transitions of the system. There are two such points which are of particular interest to us. The first transition corresponds to the situation when the behavioral rule (\ref{eq:update}) is not able to support cooperation, i.e. below this point the steady state solution is described by $\mathbf{p}^* = \mathbf{0}$. The contrapositive of this condition represents a weak requirement for cooperation, in the sense that it represents a necessary condition for individuals with positive willingness for cooperation to exist. The second transition point that we investigate quantifies a stronger condition for cooperation, corresponding to the situation where above this point all individuals (aside the unconditional defectors) are unconditional cooperators, i.e. the steady-state solution reads $\mathrm{p}^*_i = 1$ for all $i \not\in\mathcal{D}$. We study both transitions by using a differential equation representation of the update rule (see Appendix~C for more details regarding the conditions under which the representation is valid) \begin{align} \dot{\mathrm{p}}_i =\dv{f_i \left( f_i^{-1} ( \mathrm{p}_i)\right)}{Y} \left[ b_{i,\mathcal{G}} \left( \mathbf{p} \right) - c_{i,\mathcal{G}} \left( \mathrm{p}_i\right) \right]. \label{eq:differential} \end{align} In the following we provide a description of the conditions that are required for extinction and full unconditional cooperation to happen. The detailed proofs are provided in Appendix~C. In particular, by analyzing the asymptotic stability of the system at the fixed point $\mathbf{p}^* = 0$ we show that the sufficient condition for extinction of cooperation can be approximated as \begin{align} \lambda_{\max} \left( \mathbf{J^{\setminus\mathcal{D}}_y}(\mathbf{0}) \right) < 0. \label{eq:coop_extinciton_threshold} \end{align} where $\lambda_{\max}(\mathbf{J^{\setminus\mathcal{D}}_y}(\mathbf{p}))$ is the largest eigenvalue of~$\mathbf{J^{\setminus\mathcal{D}}_y}(\mathbf{p})$. In fact, a similar result can be reached by studying the optimization problem~(\ref{eq:optimization-solution}). Altogether, this indicates that when every eigenvalue of the reduced Jacobian $ \mathbf{J^{\setminus\mathcal{D}}_y}(\mathbf{0})$ is negative, the system becomes dissipative and there is a continuous shrinkage in the displayed level of cooperation. Similarly, by examining the stability of the linearized system at the point $\mathbf{1}_{\setminus\mathcal{D}}$ (the $N$ dimensional vector with entries $1$ for all $i \not\in \mathcal{D}$ and $0$ otherwise), we get that unconditional cooperation is asymptotically stable if \begin{align} \min_{i \not\in \mathcal{D}} \left( v^{\setminus\mathcal{D}}_{i,\mathcal{G}} \right) > 1, \label{eq:full_coop_threshold} \end{align} where $v^{\setminus\mathcal{D}}_{i,\mathcal{G}}$ is \begin{align} v^{\setminus\mathcal{D}}_{i,\mathcal{G}} = \frac{b_{i,\mathcal{G}} (\mathbf{1}_{\setminus\mathcal{D}})}{ c_{i,\mathcal{G}}(1)}. \end{align} We note that the strict inequality in the approximation of the condition might be relaxed, as suggested by the sufficient and necessary conditions for unconditional cooperation. Indeed, on the one hand, from the properties of the update rule we have that $v^{\setminus\mathcal{D}}_{i,\mathcal{G}} > 1$ for all $i \not\in \mathcal{D}$ implies $\mathrm{y}^*_{i,\mathcal{G}} > 0$, and hence $\mathrm{p}_i^* = 1$ for all $i \not\in \mathcal{D}$. On the other hand, in the necessary part the weak inequality $v^{\setminus\mathcal{D}}_{i,\mathcal{G}} \geq 1$ holds, which follows by directly substituting $\mathrm{p}_i^* = 1$ in (\ref{eq:payoff-general}) and repeating the same argument for all $i \not\in \mathcal{D}$. This further implies that individuals for which the inequality is not satisfied will never cooperate unconditionally. In this sense, the quantity $v^{\setminus\mathcal{D}}_{i,\mathcal{G}}$ arises as an index that quantifies the burden of each individual when cooperating, thus ultimately determining the degree of cooperation both at microscopic and macroscopic level. \section{Discussion} \subsection{Public goods example} As a constructive example for the applicative power of our framework, we consider an interaction mechanism which couples the iterated public goods game with a simple donation activity. In particular, we assume that in each time step nature randomly conditions whether the state of the global system is in provision of public goods or in donation. When in public goods state, each individual $i$ acts as a factor in $d_i$ processes of production represented by its nearest neighbors $\mathcal{N}^1_i$, with $d_i =|\mathcal{N}^1_i|$ being the degree of the individual. Its input in each round $t$ is proportional to the internal cooperative state $\mathrm{p}_i(t)$, whereas its productivity is inversely related with the degree $d_i$, thus leading to equal aggregate productivity of each individual. For concreteness, we consider a linear production function, \begin{align*} \mathrm{q}_j(t) &= \alpha \sum_k \frac{A_{kj}}{d_k} \mathrm{p}_k , \end{align*} where $\alpha$ is a parameter that describes the efficiency among the producers and $A_{kj} \in \{0,1\}$ is the $(k,j)$-th entry of the adjacency matrix $\mathbf{A}$ of the graph. In order to follow standard practice, we always fix $A_{ii} = 1$, thus each individual has one production process represented by its own vertex. To make the provision of public good related with generalized reciprocity we assume that after production takes place, $\mathrm{q}_j(t)$ is distributed to a randomly (on uniform) chosen individual from the nearest neighbors of $j$. On the other hand, when the system is in a donation state, each individual $i$ chooses a nearest neighbor at random and decides whether to donate him an amount $\alpha$ with probability proportional to its internal state $\mathrm{p}_i(t)$. The resulting public goods interaction is a randomized version of the model introduced in~\cite{santos2008social}, which has been extensively studied from the perspective of network reciprocity (a comprehensive review is provided in~\cite{perc2013evolutionary}). In addition, when combined with the donation activity, it resembles the famous ``carrot'' mechanism in a generalized reciprocity system~\cite{milinski2012interaction}. One round of this interaction structure is depicted in Fig.~\ref{fig:gen-rep-example}. \subsection{Properties} In this structure, the random payoff of individual $i$ in round $t$ is defined as \begin{align*} \mathrm{y}_i(t)&= \mathrm{e}(t) \mathrm{y}_{1i}(t) + (1 - \mathrm{e}(t)) \mathrm{y}_{2i}(t), \end{align*} where $\mathrm{e}(t)$ is a Bernoulli random variable with parameter $\varepsilon$ that describes the global state, and, \begin{align} \begin{split} \mathrm{y}_{1i}(t) &= \sum_{j} \mathrm{m}_{1ji}(t) \mathrm{q}_j(t) - \mathrm{p}_i(t), \\ \mathrm{y}_{2i}(t) &= \alpha \sum_{j\neq i} \mathrm{m}_{2ji}(t) \mathrm{x}_j(t) - \mathrm{x}_i(t), \end{split} \label{eq:carrot-payoffs} \end{align} are the payoffs of the public goods game and the donation process. In equation (\ref{eq:carrot-payoffs}), $\mathrm{m}_{1ji}(t)$, $\mathrm{m}_{2ji}(t)$ and $\mathrm{x}_j(t)$ are, respectively, Bernoulli random variables with parameters $A_{ji} / d_j$, $A_{ji} / (d_j-1)$ and $\mathrm{p}_j(t)$. In this example, the benefit and cost functions represent affine maps with respect to the random variables. Therefore, we can approximate the analysis of the steady state with the following deterministic payoff \begin{widetext} \begin{eqnarray} \mathrm{y}_i(t) = \varepsilon \alpha \sum_j \frac{A_{ji}}{d_j} \sum_k \frac{A_{kj}}{d_k} \mathrm{p}_k(t) + (1- \varepsilon) \alpha \sum_{k\neq i} \frac{A_{ki}}{d_k-1} \mathrm{p}_k(t) - \mathrm{p}_i(t). \label{eq:carrot-deterministic} \end{eqnarray} \end{widetext} \begin{figure}[t!] \includegraphics[width=7.1cm]{fig2.eps} \caption{Scheme for the studied example. Top row shows one round of interactions for two production processes $I$ and $J$ in the network example that we examine. Solid directed edges indicate the contributions by individuals $i \in \{ 1,2,3,4 \}$, whereas the bended dashed edges are the randomly distributed outputs $q_j$, with $j \in \{ I,J \}$. The bottom row describes the donation activity for the same individuals. } \label{fig:gen-rep-example} \end{figure} From (\ref{eq:carrot-deterministic}) one can easily deduce that for each particular individual $i$, conditions (\ref{eq:dilemma_condition_1}) and (\ref{eq:dilemma_condition_2}) are satisfied whenever $\alpha \in \left( 1, \frac{d_i}{z_{i}} \frac{1}{\varepsilon}\right)$, where $z_{i} = \sum_j A_{ji}/d_j$ is a centrality measure which quantifies the expected number of times that individual $i$ is selected to be at the receiving end of a production process or a donation. The effect of the distribution of $z_{i}$ (also referred to as neighborhood importance index) on the network propensity for cooperation has been discussed in \cite{Utkovski-2017}. A refined version of this index, which is proportional to the maximal average benefit of individual $i$, can be defined as \begin{align} s^{\setminus\mathcal{D}}_{i} = \varepsilon \sum_j \frac{A_{ji}}{d_j} \sum_{k\not\in\mathcal{D}} \frac{A_{kj}}{d_k} + (1 - \varepsilon) \sum_{k\not\in\mathcal{D}\cup i} \frac{A_{ki}}{d_k-1}. \label{eq:pgodds-index} \end{align} Its relation with the efficiency parameter $\alpha$ directly determines the level of cooperation of the system because the cooperation index $v^{\setminus\mathcal{D}}_{i,\mathcal{G}}$ can be written as \begin{align*} v^{\setminus\mathcal{D}}_{i,\mathcal{G}} &= \alpha s^{\setminus\mathcal{D}}_{i}. \end{align*} This implies that full cooperation will exist whenever \begin{align} \alpha > \frac{1}{s^{\setminus\mathcal{D}}_{\min}}, \label{eq:full-coop-pgoods} \end{align} where $s^{\setminus\mathcal{D}}_{\min}$ is the minimum among the $s^{\setminus\mathcal{D}}$ indices. Finally, the matrix $\mathbf{J^{\setminus\mathcal{D}}_y}(\mathbf{0})$ whose largest eigenvalue determines whether cooperation will die out or not is \begin{align*} \mathbf{J^{\setminus\mathcal{D}}_y} (\mathbf{0}) &= \alpha \left[\varepsilon \mathbf{M_1^{\setminus\mathcal{D}}} + (1 - \varepsilon)\mathbf{M_2^{\setminus\mathcal{D}}} \right] - \mathbf{I}, \end{align*} where the $(i,j)$-th entries of $\mathbf{M_1^{\setminus\mathcal{D}}}$ and $\mathbf{M_2^{\setminus\mathcal{D}}}$ are $M^{\setminus\mathcal{D}}_{1ij} = \sum_k \frac{A_{ki}}{d_k} \frac{A_{jk}}{d_j}$ and $M^{\setminus\mathcal{D}}_{2ij} = \frac{A_{ji}}{d_j-1}$ ( $M^{\setminus\mathcal{D}}_{2ii} = 0$), and $\mathbf{I}$ is the identity matrix. This implies that the condition for extinction of cooperation reads \begin{align} \alpha < \frac{1}{\lambda_{\max}\left(\varepsilon\mathbf{M_1^{\setminus\mathcal{D}}} + (1 - \varepsilon)\mathbf{M_2^{\setminus\mathcal{D}}}\right)}. \label{eq:extinction-coop-pgoods} \end{align} In the special case when every individual follows the update (\ref{eq:update}), $\mathbf{M_1^{\setminus\mathcal{D}}}$ and $\mathbf{M_2^{\setminus\mathcal{D}}}$ represent left stochastic matrices, in which case $\lambda_{\max}\left(\varepsilon\mathbf{M_1^{\setminus\mathcal{D}}} + (1 - \varepsilon)\mathbf{M_2^{\setminus\mathcal{D}}}\right) = 1$. Since $\alpha > 1$ is prerequisite for a social dilemma, this condition will never hold in a population consisting exclusively of individuals that follow the state-based rule (i.e. without defectors). \subsection{Implications} We test these analytical findings on three different types of random graph models, the Random Regular (RR) graph, the Erdos-Renyi (ER) random graph and the Barabasi-Albert (BA) scale-free network. Throughout the analysis, as a measure for the global level of cooperation we consider the fraction of unconditional cooperators $\langle \mathrm{p}^* \rangle$ out of the individuals that follow the state-based update rule. In the top row of Fig.~\ref{fig:initial_results} we study the evolution of this variable as a function of the efficiency parameter $\alpha$ when $\mathcal{D} = \emptyset$ and by considering three cases of $\varepsilon$. Namely, we examine the situations when there is only a donation process~($\varepsilon = 0$), when there is equal probability for happening of both processes~($\varepsilon = 0.5$) and when only public goods are present in the system~($\varepsilon = 1$). \begin{figure*}[t!] \begin{adjustwidth}{-0.2in}{0in} \includegraphics[width=17cm]{fig3.eps} \caption{Results for the public goods example. Top row shows the fraction of unconditional cooperators $\langle \mathrm{p}^* \rangle$ as a function of $\alpha$, while the bottom row gives the estimated probability density function of the index $s$. The columns correspond to different values of the parameter $\epsilon$. The results are averaged over 100 realizations with each graph having $N = 100$ and average degree $5$. \label{fig:initial_results}} \end{adjustwidth} \end{figure*} The condition for extinction of cooperation is plotted in the figure as a square point. As suggested by the analytical findings, cooperation in each graph and interaction structure exists as long as $\alpha$ satisfies the condition for a social dilemma. However, the dependency of $\langle \mathrm{p}^* \rangle$ on $\alpha$ is generally disparate across the three interaction structures we explore, with the only similarity arising in the RR graph. In that case, it can be seen that full unconditional cooperation happens always independently of the interaction structure. For the ER and BA graphs, we discover that in each interaction structure the former graph acts as a better promoter of cooperation for low values of $\alpha$. While this persists when donation is the sole mechanism, whenever provisioning of public goods enters the system, a critical point appears beyond which the BA graph performs better in terms of the number of unconditional cooperators (see the inset plots). To interpret these observations, in the bottom row of Fig.~\ref{fig:initial_results} we display the probability density function of the index $s^{\setminus\mathcal{D}}$, when there are no defectors (here simply denoted as $s$). The figure shows that the distribution of this variable in the RR graph resembles a Dirac delta function with the mass centered on $1$. This implies that the condition for asymptotic stability of unconditional cooperation is satisfied for every plausible $\alpha$, which in turn implies the full unconditional cooperation observed at $\alpha = 1$. For the ER and BA random graphs we notice that the distribution of $s$ is positively skewed with the BA graph exhibiting by far larger skewness. A direct consequence of this is the remark for the evolution of $\langle \mathrm{p}^* \rangle$ in the two graphs. More precisely, the right tail of the distribution determines the degree of cooperation provided when the level of efficiency is low. In this regard the lower slope in the ER graph indicates that for low $\alpha$, there will be more individuals for which the necessary condition for unconditional cooperation is satisfied. Similarly, the left tail explains why the BA graph converges to full unconditional cooperation faster than the ER graph in the case of public goods. In particular, as $\varepsilon$ increases the kurtosis in the distribution of $s$ also increases for both ER and BA graphs, implying that the individuals tend to become more similar in regard to this index. The increment is larger for the BA graph, and therefore the lower thresholds for unconditional cooperation in the case of public goods. In order to quantify the effect of defectors, in Fig.~\ref{fig:results_defectors} we display contour plots for the fraction of unconditional cooperators as a function of both the efficiency parameter and the fraction of individuals that are unconditional defectors for each of the studied random graphs. In the figure, above the green (light gray) lines is the region where cooperation ceases to exist, whereas below the red (dark gray) lines is the region where all individuals outside the defector set cooperate unconditionally. In the region in-between, unconditional cooperators coexist with partial cooperators (those with $0 < \mathrm{p}^*_i < 1$) and unconditional defectors. As defectors we always set the $D$ individuals with the highest values of $d/z$. This is the group of individuals for which the social dilemma requires a larger $\alpha$ as a means to disappear, if there is a positive probability for reaching a public goods state. \begin{figure*}[t!] \begin{adjustwidth}{-0.1in}{0in} \includegraphics[width=17cm]{fig4.eps} \caption{Contour plots for the transition points. The green (light gray) curves are contour plots for the transition points to extinction of cooperation while the red (dark gray) curves are the transition points to full unconditional cooperation, with the dashed lines indicating the estimated thresholds from equations (\ref{eq:coop_extinciton_threshold}) and (\ref{eq:full_coop_threshold}). With the black vertical line we denote the minimum of $d/z$. The rows represent different types of random graphs (RR, ER and BA) while the columns correspond to different values of $\epsilon$. The results are averaged across 100 graph realizations consisting of 100 individuals with each graph having an average degree of $5$.} \label{fig:results_defectors} \end{adjustwidth} \end{figure*} We find that, among the random graph models, the ER graph model requires the lowest efficiency (benefit to cost ratio) for the cooperation to persist (i.e. not to be extinct), followed by the RR graph. The BA graph presents itself as the topology where extinction of cooperation is more probable (compared with ER and RR graphs), for the same average graph degree. We remark that this observation is independent on the choice for $\varepsilon$. In contrast, it can be noticed that there is quite a colorful discrepancy with respect to the threshold above which full (i.e. unconditional) cooperation begins. In this aspect, when donation is the only natural process, the RR graph is the most supportive to cooperation, followed by the ER and the BA graph. However, when public goods is included in the possible natural states, it seems that when around half of the population is constituted by defectors the BA graph performs better in promoting unconditional cooperation, while the ER graph is the best promoter of unconditional cooperation when the majority of the population are defectors. Similarly to the scenario without defectors, in the case with defectors the findings can also be attributed to the distribution of the index $s$. Concretely, the inclusion of defectors can be described as an internal force which ultimately decreases the value of $s$. From this point of view, the extinction of cooperation is related to the right tail of the distribution since then one faces instances where the necessary condition for existence of cooperation is not fulfilled. As discussed previously, the ER graph has the largest tail for the distribution of the index $s$ among the studied random graphs, and therefore is most robust to extinction of cooperation when defectors are included. On the other hand, it seems considerably more delicate to precisely quantify the differences between the random graph models with respect to the existence of full unconditional cooperation as function of the distribution of the index $s$, as the results depend on the specific choice of the individuals which are selected as defectors. Nonetheless, one can notice that, as the number of defectors increases the distribution of $s$ is driven towards lower values and thus the threshold for full cooperation increases. Evidently this has lowest effect on the RR graph since the distribution of $s$ in that case concentrates around one value, i.e. there are no tails. Hence the observed lower thresholds for full unconditional cooperation in the sole donation case. We note that, in general, this explanation does not hold when provision of public goods is a possible state in the global system since then, as shown previously, for each individual a critical point exists after which cooperation is no longer a social dilemma. For instance, the value of this critical point in the RR graph is independent of the selected individual (its minimum for each graph and structure in the figure is denoted as a black vertical line). From the figure, it appears that the ER graph requires the lowest efficiency in order to have a nonempty set of individuals for which the social dilemma disappears, followed by the BA graph. A direct corollary of this is the observed lower threshold for full unconditional cooperation in these two graphs, compared to the RR graph, when a large fraction of the population behaves as defectors. \section{Conclusion} In this paper we developed a unifying framework for studying the role of a state-based behavioral mechanism centered on generalized reciprocity, on the cooperation dynamics in complex networks. Such mechanisms have been recently discovered in natural systems which involve low-level interactions among network agents with limited processing/cognitive abilities. Interestingly, they have also been attested at the more intelligent level of human interactions~\cite{Bartlett-2006,Stanca-2009}. While there is significant empirical evidence for the presence of these mechanisms in a plethora of real-life systems, the role of the network structure on the cooperation dynamics under general interaction models has only recently start to shape the research in various fields. In this context, we believe that the here introduced framework provides a systematic way to study the various aspects of cooperation in complex networks. In particular, the generality of the addressed framework allows for incorporation of a wide range of social dilemmas and interaction structures in the model. Besides its theoretical value, we believe that the framework may also be used to quantify the cooperation dynamics in real-life systems governed by similar behavioral mechanisms. We refer to a recent experimental study which suggests that the pay-it-forward principle of generalized reciprocity is a better promoter of long-term cooperation among humans than indirect reciprocity simply because it is cognitively less demanding~\cite{baker2014paying}. In this context, our (and similar) models may provide the theoretical background for the observed long-term behavior. Indeed, the above observation may be addressed from the dynamical systems perspective, under which the application of a behavioral mechanism based on generalized reciprocity yields a unique attractor where the overall level of cooperation is maximized, while at the same time the involved individuals are prevented from exploitation. As a final remark, we point out that the presented framework may apply beyond the studied structures and can easily be coupled with other mutual processes found in social and natural systems~\cite{nicosia2017collective,antonioni2017coevolution}. As such it acts as a building block for investigating the role of state-based generalized reciprocity in the dynamics of intertwining phenomena of different nature. This represents an interesting direction for future work. \section*{Acknowledgement} This research was supported in part by DFG through grant ``Random search processes, L\'evy flights, and random walks on complex networks''. \subsection*{Appendix A: Social dilemma examples} \setcounter{equation}{0} \setcounter{figure}{0} \setcounter{table}{0} \setcounter{theorem}{0} \makeatletter \renewcommand{\theequation}{A\arabic{equation}} \renewcommand{\thetable}{A\arabic{table}} \renewcommand{\thefigure}{A\arabic{figure}} \renewcommand{\thetheorem}{A\arabic{theorem}} \renewcommand{\theproposition}{A\arabic{proposition}} \textbf{The Prisoner's Dilemma:} This is the most famous example for a social dilemma where the interactions are pairwise. In the simplest case, in a prisoner's dilemma a cooperator pays a cost $\gamma$ for the other individual to receive a benefit $\beta$ \cite{Nowak-2006five}. In the original case, $\beta > \gamma$ is a prerequisite in order for a social dilemma to exist. When extended to a network structure, each individual meets with its nearest neighbors $\mathcal{N}^{1}_i$ and experiences the same interactions. Therefore, the payoff of individual $i$ in a prisoner's dilemma played on a network where the strategies are formed by a state-based update can be written as \begin{align} \mathrm{y}_i(t) &= \beta \sum_j A_{ij} \mathrm{p}_j(t) - \gamma d_i \mathrm{p}_i(t). \label{eq:pris-dilemma} \end{align} To exist a dilemma, equation (\ref{eq:dilemma_condition_1}) needs to hold for all $\mathbf{\hat{p}}$ and equation (\ref{eq:dilemma_condition_1}) has to be a strict inequality for all $\mathbf{\hat{p}}$. It is obvious that this will happen if $\beta > \gamma$, as in the original interaction structure. The prisoner's dilemma can be easily extended to account for random interactions, and thus to resemble more closely interactions where generalized reciprocity can happen. For example, this is done in references~\cite{Barta-2011,Utkovski-2017}. \textbf{Snowdrift Game:} The snowdrift game is the simplest form of a nonlinear interaction structure where cooperation by an individual is an advantageous strategy whenever the state of the neighboring individuals is defective. The payoff in a pairwise snowdrift game defined on a network, can be written in a similar way as in the prisoner's dilemma. In particular, the payoff of individual $i$ in round $t$ is \begin{widetext} \begin{align} \mathrm{y}_i(t) &= \sum_j A_{ij} \left[ \beta \mathrm{p}_j(t) + \beta \mathrm{p}_i(t) + \mathrm{p}_i(t)(\frac{\gamma}{2} - \beta)\mathrm{p}_j(t) \right] - \gamma d_i \mathrm{p}_i(t). \label{eq:snowdrift-pairwise} \end{align} \end{widetext} In this interaction structure, condition (\ref{eq:dilemma_condition_1}) implies that cooperation by $i$ will be a favorable threat as long as the average level of cooperation by the neighbors satisfies the following inequality \begin{align*} \sum_j \frac{A_{ij}}{d_i} \mathrm{p}_j < \frac{\beta - \gamma}{\beta - \gamma/2 }. \end{align*} On the other hand, condition (\ref{eq:dilemma_condition_2}) will be satisfied whenever $\beta > \gamma/2$. Interestingly, one may find out that, by applying the rules for extinction and full cooperation that we described, a state-based generalized reciprocity update rule always leads to full cooperation by the individuals that follow it as long as $\beta > \gamma$. This result is independent of the structure of unconditional defectors. \textbf{Common-pool Resource problem:} Common-pool resource problem is a situation that best depicts the ``tragedy of the commons''~\cite{Hardin-2009}. Formally, a tragedy of commons is a situation where there is shared renewable resource that will continue to produce benefits if the population does not over harvest it but in which any single individual profits from harvesting as much as possible~\cite{Brechner-1977}. As a typical example for this situation we consider a model where a mixed population (represented by a fully connected network) at each round $t$ are harvesting a resource $R(t)$ with an amount that is inversely proportional to their internal state. The payoff of each individual $i$ is given as \begin{align} \mathrm{y}_i(t) &= (1 - \delta \mathrm{p}_i(t))(R(t) - 1) - \gamma \mathrm{p}_i(t), \label{eq:cpr} \end{align} where $\delta$ is a parameter which regulates the optimal consumption by the group (optimally each individual would consume $(1-\delta)$ fraction of the resource, and $\gamma$ is the opportunity cost. Different dynamics can be used for the evolution of $R(t+1)$. For simplicity we assume that in each round the resource grows by one unit and depletes by the average amount of the consumption by all individuals (for other representations see~\cite{sugiarto2017social}). Mathematically, this is written as \begin{align} R(t+1) &= R(t) + 1 - \frac{R}{N} \sum_j \left(1 - \delta \mathrm{p}_j(t) \right). \label{eq:cpr-resource} \end{align} To estimate $\mathbf{p}^*$, one first needs to estimate the equilibrium resource $R^*$ from equation (\ref{eq:cpr-resource}) and substitute the result in equation (\ref{eq:cpr}). Then, the conditions (\ref{eq:dilemma_condition_1}) and (\ref{eq:dilemma_condition_2}) for social dilemma are given as $0 < \gamma < \delta < 1$ and $\delta < \gamma N$. \subsection*{Appendix B: Steady state analysis} \setcounter{equation}{0} \setcounter{figure}{0} \setcounter{table}{0} \setcounter{theorem}{0} \makeatletter \renewcommand{\theequation}{B\arabic{equation}} \renewcommand{\thetable}{B\arabic{table}} \renewcommand{\thefigure}{B\arabic{figure}} \renewcommand{\thetheorem}{B\arabic{theorem}} \renewcommand{\theproposition}{B\arabic{proposition}} In the main text, we pointed out two assumptions on which our analysis is built. First, in every case we consider a fraction of individuals that behave as unconditional defectors, i.e. $\mathrm{p}_i(t) = 0$ for all $t$. This indicates that we can reduce the examination of the model to the properties of the payoff functions of each $i \not\in \mathcal{D}$ defined on the set ~$\mathcal{P}^N_\mathcal{D}~= ~\left\{ \mathbf{p}_{\mathcal{D}} \in \left[ 0,1 \right]^N : \forall i \in \mathcal{D}, \ \mathrm{proj}_i (\mathbf{p}_{\mathcal{D}}) = 0 \right\}$. Moreover, we assumed that the interaction structure is non-degenerate, i.e. $\mathbf{J_y}^{\setminus\mathcal{D}}(\mathbf{0})$, where $\mathrm{J_y}^{\setminus\mathcal{D}}_{ij}(\mathbf{0}) = \pdv{\mathrm{y}_{i,\mathcal{G}}(\mathbf{0})}{\mathrm{p}_j}$ for all $i,j \not\in\mathcal{D}$, is a nonsingular matrix. As we will see, the second assumption ensures that the system will never be stuck in a saddle point. Against this background, we can derive the described proposition for the steady state solution. \begin{proposition} -- \textbf{Steady State Solution:} If a fraction of the individuals base their state update $\mathrm{p}_i(t)$ on the rule \begin{align*} \mathrm{p}_i(t+1)=f_i \left(\mathrm{Y}_{i,\mathcal{G}}(t)\right), \end{align*} where $\mathrm{Y}_{i,\mathcal{G}}(t)=\mathrm{Y}_{i,\mathcal{G}}(t-1)+\mathrm{y}_{i,\mathcal{G}}(t)$, with $\mathrm{Y}_{i,\mathcal{G}}(0)$ being the initial condition and $\mathrm{y}_{i,\mathcal{G}}(0)=0$, and $f_i :\mathbb{R} \to \left(0, 1 \right)$, is a strictly monotonic homeomorphism that satisfies $\lim_{\mathrm{Y}\to -\infty} f_i(\mathrm{Y}) = 0$ and $\lim_{\mathrm{Y}\to \infty} f_i(\mathrm{Y}) = 1$, then the stable steady state solution $\mathbf{p}^*$ is unique and can be found as the solution to the constrained optimization problem of maximizing the overall level of cooperation such that every individual has a nonnegative payoff,~i.e., \begin{equation} \begin{aligned} \mathbf{p}^* &= \underset{\mathbf{p} \ \in \ \mathcal{P}^N_\mathcal{D}}{\text{arg max}}\left \{ \sum_{i\not\in\mathcal{D}} \mathrm{p}_i; \; \mathrm{y}_{i,\mathcal{G}} \left( \mathbf{p}\right) \geq 0 \; \forall i\right \}. \end{aligned} \label{eq:optimization-solution-supplementary} \end{equation} \end{proposition} \textit{Sketch of proof:} For all $i \not\in \mathcal{D}$, fix $\mathrm{Y}_{i,\mathcal{G}}(0)$ to some arbitrary real number. By construction, $\mathrm{p}_i(1)~\in~\left(0,1\right)$. Moreover, the reduced individual payoff vector $\mathbf{y}_{\setminus\mathcal{D}}(t)$ that accounts for the payoffs of all those $i$ can be approximated as \begin{align*} \mathbf{y}_{\setminus\mathcal{D}}(1) &\approx \mathbf{J^{\setminus\mathcal{D}}_y}(\mathbf{0}) \cdot \mathbf{p}_{\setminus\mathcal{D}}(1), \end{align*} where $\mathbf{p}_{\setminus\mathcal{D}}(1)$ is the corresponding state vector in $t = 1$. Since $\mathbf{J^{\setminus\mathcal{D}}_y}(\mathbf{0})$ is nonsingular, there exists some $i$ in the set of individuals that follow the rule such that $\mathrm{y}_i(1) \neq 0$. Without loss of generality, let us assume that for all those $i$ $\mathrm{y}_{i,\mathcal{G}}(1) > 0$ (similar arguments hold when there exist individuals with $\mathrm{y}_{i,\mathcal{G}}(1) < 0$). The strict monotonicity implies that these individuals will increase their cooperative state in the following period. By iterating the same procedure for a finite amount of times we can easily deduce that similar dynamics will appear in every period $t$ (the set of individuals with positive payoffs may change). In the limit as $t \to \infty$, the individuals with positive payoffs will be able to increase their states until $\mathrm{p}^*_i = 1$ or some $\mathrm{p}^*_i$ that satisfies $\mathrm{y}_{i,\mathcal{G}}(\mathbf{p}^*) = 0$. The second possibility is again a result of the strict monotonicity of $f$ (a negative payoff implies that the individual will decrease its cooperative state until the condition is reached). Therefore, in the steady state each individual conforming to (\ref{eq:update}) will cooperate with the maximal willingness, based on its environment, so as it is not exploited, indicating that the steady state internal cooperative state vector $\mathbf{p}^*$ can be found as a solution to~(\ref{eq:optimization-solution-supplementary}). Notice that a steady state solution can still be found as a solution to (\ref{eq:optimization-solution-supplementary}) even if $\mathbf{J_y}(\mathbf{0})$. However, then due to the singularity of $\mathbf{J_y}(\mathbf{0})$ multiple steady states may appear that behave as saddle points. Now let us turn to the uniqueness part. It is known that a constrained optimization problem will have a unique maximum if the objective function (in this case $\sum_i \mathrm{p}_i$ ) is strictly quasiconcave and all constraints are quasiconcave ($\mathrm{y}_i(\mathbf{p})$). Formally, a continuously differentiable function $\mathrm{f}$ is quasiconcave in a convex set $\mathcal{X}$, if for any two points $\mathrm{x}_1$ and $\mathrm{x}_2$ in the set such that $\mathrm{f}(\mathbf{x}_1) \geq \mathrm{f}(\mathbf{x}_2)$ we have that \begin{align} \mathbf{J}_\mathrm{f} \left( \mathbf{x}_2 \right) \left( \mathbf{x}_1 - \mathbf{x}_2 \right) \geq 0, \label{eq:concavity} \end{align} where $\mathbf{J}_\mathrm{f} \left( \cdot \right)$ is the Jacobian of the function $\mathrm{f}$, with the strict inequality whenever implying that the function is strictly quasiconcave. Further information about the properties of (strictly) quasiconcave functions and their role in constrained optimization can be found in \cite{de2000mathematical}. For simpler notation, let $\mathrm{p}_{\Sigma}(\mathbf{p}) \doteq \sum_{i\not\in\mathcal{D}} \mathrm{p}_i$. Since $\mathrm{p}_{\Sigma}(\mathbf{p})$ is linear with respect to each projection, it is easy to show that for every $\mathbf{p}_1$ and $\mathbf{p}_2$ such that $\mathrm{p}_{\Sigma}(\mathbf{p}_1) > \mathrm{p}_{\Sigma}(\mathbf{p}_2)$, the strict inequality in (\ref{eq:concavity}) will hold. In addition, by Taylor expanding $\mathrm{y}_i (\mathbf{p})$ for all $i$, at a point $\mathbf{p}_2$ it follows that the constraints are quasiconcave for all $\mathbf{p}_1$ such that $\mathrm{y}_i (\mathbf{p}_1) \geq \mathrm{y}_i (\mathbf{p}_2)$. \hfill $\blacksquare$ \subsection*{Appendix C: Phase transition analysis} \setcounter{equation}{0} \setcounter{figure}{0} \setcounter{table}{0} \setcounter{theorem}{0} \makeatletter \renewcommand{\theequation}{C\arabic{equation}} \renewcommand{\thetable}{C\arabic{table}} \renewcommand{\thefigure}{C\arabic{figure}} \renewcommand{\thetheorem}{C\arabic{theorem}} \renewcommand{\theproposition}{C\arabic{proposition}} The analysis for the phase transitions of the system relies heavily on the differential equation form (\ref{eq:differential}). Therefore, before we analyze them we rewrite the discrete system in the continuous form presented in the main text. Concretely, the update rule can be described with the following recurrence relation \begin{widetext} \begin{align} \mathrm{p}_i(t+1) &= f_i\big(f_i^{-1} \left( \mathrm{p}_i(t)\right)+b_{i,\mathcal{G}} \left( \mathbf{p}(t) \right) - c_{i,\mathcal{G}} \left( \mathrm{p}_i(t) \right)\big). \label{eq:iterative_formulation} \end{align} \end{widetext} Note that from this representation the steady state equation (\ref{eq:iterative_steady_state}) is derived. By expanding equation (\ref{eq:iterative_formulation}) point-wise through Taylor series at the point $ f_i^{-1} \left( \mathrm{p}_i(t)\right)$ we can approximate $\mathrm{p}_i(t+1)$ as \begin{widetext} \begin{align*} \mathrm{p}_i(t+1) \approx \mathrm{p}_i(t) + \dv{f_i \left( f_i^{-1} ( \mathrm{p}_i(t))\right) }{Y} \left[ b_{i,\mathcal{G}} \left( \mathbf{p}(t) \right) - c_{i,\mathcal{G}} \left( \mathrm{p}_i(t) \right) \right], \end{align*} \end{widetext} which can be written in the differential form given in equation (\ref{eq:differential}), i.e., \begin{align*} \dot{\mathrm{p}_i} = \dv{f_i \left( f_i^{-1} ( \mathrm{p}_i)\right)}{Y} \left[ b_{i,\mathcal{G}} \left( \mathbf{p} \right) - c_{i,\mathcal{G}} \left( \mathrm{p}_i\right) \right], \end{align*} for all $i \not\in \mathcal{D}$. Moreover, as can be seen from equation (\ref{eq:differential}) the study of the system is dependent on the properties of the (higher order) derivatives of $f_i$. Since we do not have a specific form for the update rule, they may be difficult to attain. Nevertheless, we can use a simple trick based on the smoothness of the update rule to discover the properties. In particular, notice that the famous Logistic function, defined as \begin{align*} g(\mathrm{Y})=\left[1+e^{-\kappa(\mathrm{Y}-\omega)}\right]^{-1}, \end{align*} where the parameters $\kappa$ and $\omega$ define the steepness, respectively the midpoint of the function, is a specific function that satisfies our definition for being a generalized reciprocity update rule. More importantly, this function has well-defined derivatives. For example the first derivative is $\dv{g\left(\mathrm{\hat{Y}} \right)}{\mathrm{Y}} = g(\mathrm{\hat{Y}}) \left( 1 - g(\mathrm{\hat{Y}}) \right)$ and the second is $\dv[2]{g\left(\mathrm{\hat{Y}} \right)}{\mathrm{Y}} = g(\mathrm{\hat{Y}}) \left( 1 - g(\mathrm{\hat{Y}}) \right) \left( 1 - 2 g(\mathrm{\hat{Y}}) \right)$. Hence, we can define a continuously differentiable and monotonically increasing function $h_i:\mathbb{R} \to \mathbb{R}$ that acts as a monotonic transformation of the accumulated payoff and which satisfies \begin{align} f_i(\mathrm{Y}) &= g(h_i(\mathrm{Y})). \label{eq:update_chain_rule} \end{align} Besides this, the function $h_i$ also satisfies $\lim_{p_i \to 1} h_i ( f_i^{-1}(p_i)) = f_i^{-1}(p_i)$ and ~$\lim_{p_i \to 0} h_i ( f_i^{-1}(p_i)) = f_i^{-1}(p_i)$. An illustrative example for this transformation is given in Fig.~\ref{fig:monotonic_transformation}. Now, studying the derivatives of $f_i$ is a simpler task since we can implement the chain rule and use the properties of the derivatives of the Logistic function. \begin{figure}[t!] \includegraphics[width=8.6cm]{fig5.eps} \caption{An example for monotonic transformation of $f$. Here, the accumulated payoffs $\mathbf{Y}_j$ for $j \in \{1,2 \}$ are mapped to $h(\mathbf{Y}_j)$ so as $g \left(h(\mathbf{Y}_j)\right) = f(\mathbf{Y}_j)$.} \label{fig:monotonic_transformation} \end{figure} \vspace{1cm} \begin{proposition} -- \textbf{Extinction of cooperation:} If \begin{align} \lambda_{\max} ( \mathbf{J^{\setminus\mathcal{D}}_y}(\mathbf{0})) & < 0, \end{align} where $\lambda_{\max}(\mathbf{J^{\setminus\mathcal{D}}_y}(\mathbf{0}))$ is the largest eigenvalue of the matrix $\mathbf{J^{\setminus\mathcal{D}}_y}(\mathbf{0})$ with entries defined as $\mathrm{J_y}_{ij}(\mathbf{0}) = \pdv{\mathrm{y}_i(\mathbf{0})}{\mathrm{p}_j}$ for all $i,j \not\in\mathcal{D}$, then $\mathbf{p}^* = 0$ is an asymptotically stable steady state. \end{proposition} \textit{Proof:} To prove this proposition we implement Lyapunov's direct method for stability. First, we define the function $L(\mathbf{p}) = \sum_{i\not\in\mathcal{D}} \mathrm{p}_i$. It is clear that this function is a candidate for being a Lyapunov function since $L(\mathbf{0}) = 0$ and $L(\mathbf{\hat{p}}) > 0$ for all $\mathbf{\hat{p}} \neq \mathbf{0}$. The time derivative of $L(\mathbf{p})$ is \begin{widetext} \begin{align} \dot{L}(\mathbf{p}) &= \sum_{i \not\in \mathcal{D}} \mathrm{p}_i \left(1 - \mathrm{p}_i \right) \dv{h_i\left( f_i^{-1} ( \mathrm{p}_i)\right)}{Y} \left[ b_{i,\mathcal{G}} \left( \mathbf{p} \right) - c_{i,\mathcal{G}} \left( \mathrm{p}_i\right) \right], \label{eq:lyapunov-ineq} \end{align} \end{widetext} which in a neighborhood around $\mathbf{p} = 0$ can be approximated as \begin{align} \dot{L}(\mathbf{p}) &\approx \sum_{i \not\in \mathcal{D}} \mathrm{p}_i \left[ \sum_{j \not\in \mathcal{D}} \pdv{b_{i,\mathcal{G}} (\mathbf{0})}{\mathrm{p}_j} \mathrm{p}_j - \dv{c_{i,\mathcal{G}} (0)}{\mathrm{p}_i} \mathrm{p}_i\right], \\ &= \mathbf{p_{\setminus\mathcal{D}}}^T\mathbf{J^{\setminus\mathcal{D}}_y}(\mathbf{0})\mathbf{p_{\setminus\mathcal{D}}}, \label{eq:taylor-lyapunov-ineq} \end{align} where $T$ is the transpose operator. For the system to be asymptotically stable at $\mathbf{p}^* = \mathbf{0}$, expression (\ref{eq:taylor-lyapunov-ineq}) has to be negative for all $\mathbf{p} \neq \mathbf{0}$. Clearly, (\ref{eq:taylor-lyapunov-ineq}) is a quadratic form, therefore this will happen only if $\mathbf{J^{\setminus\mathcal{D}}_y}(\mathbf{0})$ is negative definite, i.e. if $\lambda_{\max} (\mathbf{J^{\setminus\mathcal{D}}_y}(\mathbf{0})) < 0$. \hfill $\blacksquare$ \begin{proposition} -- \textbf{Unconditional cooperation:} Unconditional cooperation, defined as $\mathbf{p}^* = \mathbf{1}_{\setminus\mathcal{D}}$, where $\mathbf{1}_{\setminus\mathcal{D}}$ is an $N \times 1$ dimensional vector with entries $1$ for all $i \not\in \mathcal{D}$ and $0$ otherwise, is an asymptotically stable steady state if \begin{align*} \min_{i \not\in \mathcal{D}} \left( v^{\setminus\mathcal{D}}_{i,\mathcal{G}} \right) > 1, \end{align*} \end{proposition} where $v^{\setminus\mathcal{D}}_{i,\mathcal{G}} = \frac{b_{i,\mathcal{G}} (\mathbf{1}_{\setminus\mathcal{D}})}{ c_{i,\mathcal{G}}(1)}$. \textit{Proof:} To analyze the asymptotic stability of the $N - D$ dimensional system of differential equations (\ref{eq:differential}) at the point $\mathbf{p}^* = \mathbf{1}_{\setminus\mathcal{D}}$ we apply the Hartman-Grobman theorem and study the corresponding linear system \cite{arrowsmith1990introduction}. The linearization asserts that a steady state of the system of differential equations will be locally asymptotically stable when all eigenvalues of its Jacobian $\mathbf{J^{\setminus\mathcal{D}}}(\mathbf{p}^*)$ have negative real parts. To find when this is satisfied, we define $\mathbf{J}^{\setminus\mathcal{D}}_i (\mathbf{p}) = \dot{\mathrm{p}_i}$. Then, the $ij$-th entry of $\mathbf{J}^{\setminus\mathcal{D}}(\mathbf{\hat{p}})$, where $i,j \not\in \mathcal{D}$, at an arbitrary point $\mathbf{\hat{p}}$ of this system can be calculated as \begin{widetext} \begin{equation*} J^{\setminus\mathcal{D}}_{ij} = \pdv{\mathbf{J}_i}{\mathrm{p}_j} (\mathbf{\hat{p}}) = \begin{cases} \frac{\dv[2]{f_i\left( f_i^{-1} ( \mathrm{\hat{p}}_i)\right)}{Y} }{\dv{f_i\left( f_i^{-1} ( \mathrm{\hat{p}}_i)\right)}{Y} } \left[ b_{i,\mathcal{G}}\left( \mathbf{\hat{p}} \right) - c_{i,\mathcal{G}} \left( \mathrm{\hat{p}}_i \right) \right] + \dv{\left( f_i^{-1}f_i( \mathrm{\hat{p}}_i)\right)}{Y} \left[ \pdv{b_{i,\mathcal{G}} (\mathbf{\hat{p}})}{\mathrm{p}_i} + \dv{c_{i,\mathcal{G}}(\mathrm{\hat{p}}_i)}{\mathrm{p}_i} ) \right] ,& \text{if}\ i=j, \\\ \dv{f_i\left( f_i^{-1} ( \mathrm{\hat{p}}_i)\right) }{Y} \pdv{b_{i,\mathcal{G}} (\mathbf{\hat{p}})}{\mathrm{p}_j} , & \text{otherwise}. \end{cases} \end{equation*} \end{widetext} Let $\mathbf{p}^* \to \mathbf{1}_{\setminus\mathcal{D}}$. Since the update rule $f_i$ is monotonically increasing with $\lim_{\mathrm{Y}\to \infty} f_i(\mathrm{Y}) = 1$, we have that $ \lim_{\mathrm{p}_i\to 1} \dv{f_i\left(f_i^{-1} ( \mathrm{\hat{p}}_i)\right)}{Y} = 0$. Therefore, \begin{widetext} \begin{equation} \lim_{\mathbf{p}^* \to \mathbf{1}_{\setminus\mathcal{D}}} J^{\setminus\mathcal{D}}_{ij} = \begin{cases} \lim_{\mathbf{p}^* \to \mathbf{1}_{\setminus\mathcal{D}}} \frac{\dv[2]{f_i\left( f_i^{-1} ( \mathrm{p}^*_i)\right)}{Y}}{\dv{f_i\left( f_i^{-1} ( \mathrm{p}^*_i)\right)}{Y} } \left[ b_{i,\mathcal{G}}\left( \mathbf{p}^* \right) - c_{i,\mathcal{G}} \left( \mathrm{p}^*_i \right) \right] ,& \text{if}\ i=j, \\\ 0, & \text{otherwise}. \end{cases} \label{eq:jacobian} \end{equation} \end{widetext} This expression simplifies the analysis because we are left with a diagonal matrix, and it is known that in that case the diagonal entries correspond to the eigenvalues of the matrix. Next, by applying the properties of $f_i$ defined with the monotonic transformation $h_i$, i.e. equation (\ref{eq:update_chain_rule}), we find that \begin{widetext} \begin{align} \lim_{\mathbf{p}^* \to \mathbf{1}_{\setminus\mathcal{D}}} J^{\setminus\mathcal{D}}_{ii} &= - \dv{h \left( f^{-1} ( 1 )\right) }{\mathrm{Y}} \left[ b_{i,\mathcal{G}}\left( \mathbf{1}_{\setminus\mathcal{D}} \right) - c_{i,\mathcal{G}} \left( 1 \right) \right]. \label{eq:eigenvalues} \end{align} \end{widetext} Since $\dv{h_i\left( f_i^{-1} ( 1 )\right)}{\mathrm{Y}} = 1$, this expression will be negative if and only if $b_{i,\mathcal{G}} (\mathbf{1}_{\setminus\mathcal{D}}) - c_{i,\mathcal{G}}(1) > 0$, i.e. $v^{\setminus\mathcal{D}}_{i,\mathcal{G}} > 1$. Moreover, because for asymptotic stability (\ref{eq:eigenvalues}) needs to hold for all $i \not\in \mathcal{D}$, we get expression (\ref{eq:full_coop_threshold}). \hfill $\blacksquare$
{'timestamp': '2019-03-01T02:17:40', 'yymm': '1803', 'arxiv_id': '1803.00112', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00112'}
arxiv
\section{Introduction} Markov decision processes (MDPs) model sequential decision-making problems in stochastic dynamic environments \cite{puterman2014markov}. MDP formulations typically focus on the \emph{risk-neutral} expected cost or reward model. On the other hand, MDPs with \emph{risk-sensitive} measures, such as exponential utility \cite{howard1972risk}, percentile risk criteria \cite{filar1995percentile} and conditional value at risk \cite{chow2015risk,chow2014algorithms,tamar2015optimizing} have been studied in the literature have also found applications in portfolio management \cite{bielecki1999risk}, robotics \cite{ono2015chance}, stochastic shortest-path problems \cite{bertsekas1991analysis}, optimal control \cite{hernandez1996risk} and operations research \cite{borkar2002q,howard1972risk}. These measures capture the variability in the cost due to stochastic transitions in an MDP, and aim to minimize the effect of the outcomes with high cost. We focus on a particular risk-sensitive measure that comes from \emph{cumulative prospect theory} (CPT) \cite{tversky1992advances}. This measure is widely used in psychology and economics to build models that explain the risk-sensitive behavior of humans in decision-making. Empirical evidence suggest CPT characterizes human preferences in decision-making \cite{lopes1999role,tversky1992advances}. The key elements of this theory are a value function that is concave for gains, convex for losses, and steeper for losses than for gains, and a \emph{nonlinear} transformation of the probability range, which inflates small probabilities and deflates high probabilities. It is also a generalization of other risk-sensitive measures like VaR or CVaR \cite{prashanth2016cumulative}. Additionally, with different nonlinear weighting functions, CPT-based measures can represent risk-taking measures as well as risk-averse measures. We investigate \emph{model checking} with respect to \emph{temporal logic specifications}. \emph{Formal verification} of temporal logic specifications has been extensively studied for MDPs with risk-neutral measures \cite{BK08}, and mature tools exist for efficient verification with such risk-neutral measures \cite{KNP11}. Probabilistic model checking verifies reachability properties such as β€œthe probability of reaching a set of unsafe states is less than $5 \% $” and expected costs properties such as β€œthe expected cost of reaching a goal state is less than $10 \% $”. A rich set of properties, specified by temporal logic specifications, can be reduced to \emph{reachability} properties, which can then be verified automatically \cite{katoen2016probabilistic}. To the best of our knowledge, formal quantitative verification with respect to risk-sensitive measures has not been considered in the literature. Dynamic programming equations for MDPs with CPT-based measures for finite-horizon MDPs in \cite{lin2013dynamic} and for infinite-horizon MDPs in \cite{lin2013stochastic} exist. However, computing an optimal policy requires optimizing integrals of nonlinear functions over continuous variables, which can be computationally impractical. CPT-based measures have been used in reinforcement learning \cite{prashanth2016cumulative}, where it was shown that the policy gradient approach converges to the optimal CPT value asymptotically. The main challenge in computing policies with CPT-based measures is the nonlinear transformation of the probability range and utilities. This transformation yields a nonlinear programming problem. For efficient verification of MDPs with CPT-based measures, we approximate the nonlinear CPT weighting function by a \emph{difference of convex} function to utilize \emph{convex-concave procedure} \cite{lipp2016variations}, which efficiently computes locally optimal solutions for optimization problems with difference of convex functions. We propose methods to approximate the CPT weighting function, and discuss the trade-offs between different approximations. Experimental results show the applicability of our approach in numerical experiments. \section{Preliminaries} \begin{definition}[Distribution] A \emph{probability distribution} over a finite or countably infinite set $X$ is a function $\mu\colonX\rightarrow\Ireal$ with $\sum_{x\inX}\mu(x)=1$. The set of all distributions on $X$ is denoted by $\mathit{Distr}(X)$. \end{definition} \begin{definition}[Monomials, Posynomials]\label{def:posy} Let $V=\{x_1,\ldots,x_n\}$ be a finite set of strictly positive real-valued \emph{variables}. A \emph{monomial} over $V$ is an expression of the form \vspace{-0.1cm} \begin{align*} \ensuremath{g}=c\cdot x_{1}^{a_{1}}\cdots x_{n}^{a_{n}}\ , \end{align*} \vspace{-0.6cm} \noindent where $c\in \mathbb{R} $ is a real coefficient, and $a_i\in\mathbb{R}$ are exponents for $1\leq i\leq n$. A \emph{posynomial} over $V$ is a sum of one or more monomials: \vspace{-0.6cm} \begin{align} \ensuremath{f}=\sum_{k=1}^K c_k\cdot x_1^{a_{1k}}\cdots x_n^{a_{nk}} \ .\label{eq:signomial} \end{align} \end{definition} \vspace{0.05cm} \begin{definition}[Markov decision process]\label{def:mdp} A \emph{Markov decision process (MDP)} is a tuple $\pMdpInit$ with a finite set $S$ of states, an initial state $\sinit \in S$, a finite set $\ensuremath{\mathit{Act}}$ of actions, and a transition function $\mathcal{P} \colon S \times \ensuremath{\mathit{Act}} \times S \rightarrow \mathit{Distr}(S)$ satisfying for all $s\in S\colon \ensuremath{\mathit{Act}}(s) \neq \emptyset$, where $\ensuremath{\mathit{Act}}(s) = \{\ensuremath{\alpha} \in \ensuremath{\mathit{Act}} \mid \exists s'\in S.\,\mathcal{P}(s,\,\ensuremath{\alpha},\,s') \neq 0\}$. For given a state $s$, we denote the set of \emph{successor} states by $S(s)$. A state $s'$ is in $S(s)$ if there exists an $\ensuremath{\alpha} \in \ensuremath{\mathit{Act}}$ such that $\mathcal{P}(s,\,\ensuremath{\alpha},\,s')>0$. If for all $s\in S$ it holds that $|\ensuremath{\mathit{Act}}(s)| = 1$, $\mathcal{M}$ is called a \emph{discrete-time Markov chain (MC)}. \end{definition} $\ensuremath{\mathit{Act}}(s)$ is the set of \emph{enabled} actions at state $s$; as $\ensuremath{\mathit{Act}}(s) \neq \emptyset$, there are no deadlock states. \emph{Costs} are defined using a state--action \emph{cost function} $\mathit{C_t} \colon S \times \ensuremath{\mathit{Act}} \times T \rightarrow \mathbb{R}_+$. \emph{Rewards} are defined similarly. \begin{definition}[Policy]\label{def:scheduler} Given a finite horizon $T$, a (randomized) \emph{policy} for an MDP $\mathcal{M}$ is a function $\ensuremath{\sigma}\colon S \times T\rightarrow\mathit{Distr}(\ensuremath{\mathit{Act}})$ such that $\sigma(s_t,\alpha) > 0$ implies $\alpha \in \ensuremath{\mathit{Act}}(s_t)$ at time $t$. The set of memoryless policies over $\mathcal{M}$ at time $t$ is denoted by $\ensuremath{\mathit{Pol}}_t^\mathcal{M}$, which only depends on the current state. \end{definition} \begin{definition}[Induced Markov chain]\label{def:induced_dtmc} For MDP $\MdpInit$ and policy $\ensuremath{\sigma}\in\ensuremath{\mathit{Pol}}^\mathcal{M}$, the \emph{Markov chain induced by $\mathcal{M}$ and $\ensuremath{\sigma}$} is $\mathcal{M}^\ensuremath{\sigma}=(S,\sinit,\ensuremath{\mathit{Act}},\ensuremath{\mathcal{P}}^\ensuremath{\sigma})$ where for all $s,s'\in S$, \vspace{-0.1cm} \begin{align*} \ensuremath{\mathcal{P}}^\ensuremath{\sigma}(s,s')=\sum_{\alpha\in\ensuremath{\mathit{Act}}(s)} \ensuremath{\sigma}(s)(\ensuremath{\alpha})\cdot\ensuremath{\mathcal{P}}(s,\alpha,s'). \end{align*} \end{definition} \vspace{0.10cm} We consider \emph{reachability properties}. For Markov chain $\mathcal{D}$ with states $S$, let $\reachPrs{\mathcal{D}}{s}{T}$ denote the probability of reaching a set $T \subseteq S$ of \emph{target states} from state $s\in S$; simply, $\reachPrT[\mathcal{D}]$ denotes the probability for initial state $\sinit$. We use the standard probability measure as in~\cite{BK08}. The interest of this paper is a \emph{synthesis problem}, where the objective is to find a policy in $\ensuremath{\mathit{Pol}}_t^\mathcal{M}$ such that the probability $\reachPrT[\mathcal{D}]$ of satisfying the reachability property is maximized or minimized. The classical risk-neutral MDP problem is \cite{puterman2014markov} \vspace{-0.4cm} \begin{align} \inf_{\pi \in \ensuremath{\mathit{Pol}}^\mathcal{M}}\mathbb{E}\left[\sum_{t=0}^{T}C_t(s_t,a_t)\right]. \label{eq:risk_neutral} \end{align} \vspace{-0.2cm} The problem in \eqref{eq:risk_neutral} can be solved with value iteration, policy iteration or linear programming, and the optimal policy will be a deterministic memoryless policy. The optimal policy for problem \eqref{eq:risk_neutral} will maximize the probability of satisfying the reachability property or minimize the expected cost, therefore it is a risk-neutral solution. Following from \cite{ruszczynski2010risk}, we consider the risk-sensitive value function starting at $s_0$, with a policy $Pol^\mathcal{M}$, and the resulting trajectory ($s_0,\ensuremath{\mathit{Pol}}_0^\mathcal{M},s_1,\ensuremath{\mathit{Pol}}_1^\mathcal{M},...,s_T$), which is given by $C_T(\ensuremath{\mathit{Pol}}^\mathcal{M},s_0)= \rho_0(c(s_0,\ensuremath{\mathit{Pol}}_0^\mathcal{M})+\rho_1(c(s_1,\ensuremath{\mathit{Pol}}_1^\mathcal{M})+...+ \rho_{T-1}(c(s_{T-1},\ensuremath{\mathit{Pol}}_{T-1}^\mathcal{M})+C_T(s_T))...)),$ where $\rho_t$ is a one-step conditional risk measure at time $t$. Then, we consider the following optimization problem where $\rho$ is replaced by a CPT-based measure: \vspace{-0.5cm} \begin{align} \inf_{\pi \in \ensuremath{\mathit{Pol}}^\mathcal{M}}C_T(\ensuremath{\mathit{Pol}}^\mathcal{M},\sinit). \label{eq:risk_CPT} \end{align} \vspace{-0.3cm} A dynamic programming equation exists for the problem in \eqref{eq:risk_CPT}, and the optimal policies are memoryless \cite{ruszczynski2010risk}. Any CPT-based measure is a one-step conditional risk measure, therefore the problem \eqref{eq:risk_CPT} can be solved by solving the dynamic programming equations \cite{lin2013dynamic}. \section{Cumulative Prospect Theory (CPT)} For a random variable $X$, the CPT \emph{value} is a generalization of the expected value of $X$ with a utility function that is concave on gains and convex on losses, and a probability weighting function that transforms the probability measure such that it inflates small probabilities and reduces larger probabilities. \begin{definition}[CPT value] For a random variable $X$, the CPT value is defined as \vspace{-0.5cm} \begin{align} C(X)= \int_0^{\infty} & w_{+}\left(\mathbb{P}\left(u_{+}\left(X\right)>z\right)\right) dz \nonumber \\ &-\int_0^{\infty} w_{-}\left(\mathbb{P}\left(u_{-}\left(X\right)>z\right)\right) dz, \end{align} \vspace{-0.35cm} \noindent where $w_{+}$ and $w_{-}$ $:$ $\left[0,1 \right]$ $\rightarrow$ $\left[0,1 \right]$ are two continuous non-decreasing functions with $w_{+}(0)=w_{-}(0)=0$ and $w_{+}(1)=w_{-}(1)=1$, $u_{+}$ and $u_{-}$ : $\mathbb{R}$ $\rightarrow$ $\mathbb{R}_+$ are two utility functions. \end{definition} \begin{remark} CPT value generalizes the expected value of a random variable, i.e, $C(X) = \mathbb{E}\left[X\right]= \int_0^{\infty} \left(\mathbb{P}\left( X>z\right)\right) dz-\int_0^{\infty} \left(\mathbb{P}\left( -X>z\right)\right) dz$, when $u_{+}(x)=u_{-}(x)=x$, and $w_{+}(x)=w_{-}(x)=x$. \end{remark} The functions $w_{+}$ and $w_{-}$ are the weighting functions that capture the concept of humans deflating high probabilities and inflating low probabilities when they make decisions under uncertainty. For instance, consider a scenario where one can earn \$100 with probability 1/100 and nothing otherwise, or can earn \$1 with probability 1. It is shown that the humans tend to choose the former option \cite{tversky1992advances,barberis2013thirty}, showing that the value of a decision by a human is nonlinear with respect to the transition probabilities. Reference \cite{prelec1998probability} suggests the weighting function $w(k)=\exp(-0.5(-\ln k)^\eta)$, with $0 < \eta < 1$ and \cite{tversky1992advances} suggests \vspace{-0.35cm} \begin{align*} w(k)=\dfrac{k^\eta}{\left(k^\eta+(1-k)^\eta\right)^{1 / \eta}}. \end{align*} \vspace{-0.35cm} Both of the functions have a similar inverted-S shape and they are concave for small values of $p$, and convex for large values of $p$. The utility functions $u_{+}$ and $u_{-}$ represent how humans value gains $(X\geq 0)$ and losses $(X \leq 0)$ separately. For example, if we change the scenario in the above paragraph into losses, i.e, one will lose \$100 with probability 1/100 and nothing otherwise, or will lose \$1 with probability 1, then the humans tend to choose the latter option, showing that there is a difference between evaluating the gains and losses, and the CPT-based measures can handle losses and gains separately. A suggestion for the utility function is given in \cite{tversky1992advances}, which is $u_{+}(x)=\vert x \vert^{m}$, and $u_{-}(x)=-2.25\vert x\vert^{m}$, with $m=0.88$. Note that, $u_{+}$ is a concave function for $x>0$, and $u_{-}$ is a convex function for $x<0$. \begin{remark}[\cite{prashanth2016cumulative}] CPT-based measures generalize other risk-sensitive measures. For example, it is possible to represent value at risk or conditional value at risk by proper choice of weighting and utility functions. \end{remark} \section{MDPs with CPT-based measures} Reference \cite{lin2013dynamic} shows the existence of a dynamic programming equation in an MDP with CPT-based measures, and the optimal policy that comes from the dynamic programming equation is a memoryless randomized policy. Dynamic programming equations can be solved as a nonlinear programming problem. Specifically, the objective is a nonlinear function and the objective is minimized or maximized over randomized policies for a given state and time. However, solving optimization problems with a nonlinear objective function is generally impractical \cite{lin2013dynamic}. To come up with a scalable procedure, we approximate the weighting function by a function that is the difference of two convex functions, which will reformulate the nonlinear programming problem to a difference of convex problem. Methods such as branch and bound methods \cite{lawler1966branch} or cutting plane methods \cite{androulakis1995alphabb} can find the globally optimal solution for a difference of convex problem, but these methods can be slow in practice. Instead of seeking a global solution, a locally optimal (approximate) solution can be found by utilizing the techniques of general nonlinear optimization \cite{nocedal2006sequential}. \begin{definition}[Difference of convex problem] Difference of convex (DC) problems have the following form \end{definition} \vspace{-0.15cm} \begin{align*} &\text{minimize } \quad f_{0}(x)-g_{0}(x)\\ &\text{subject to}\quad f_{i}(x)-g_{i}(x)\leq 0, \quad i=1,2,...,m, \\ \end{align*} \vspace{-0.65cm} \noindent where $x \in \mathbb{R}^n$ is the variable vector, and the functions $f_i, g_i : \mathbb{R}^n \rightarrow \mathbb{R}$ for $i=0,1,...,m$ are convex. The convex-concave procedure (CCP) \cite{lipp2016variations,shen2016disciplined} is a heuristic algorithm for finding a locally optimal solution to a DC problem. As a first step, we replace concave functions with a convex upper bound. We then solve the approximate convex problem, and the optimal value of the approximate problem will be an upper bound of the original problem at each iteration. The CCP algorithm to solve DC problems is described in Algorithm 1. \vspace{-0.4cm} \begin{algorithm}[htb!] \DontPrintSemicolon \textbf{given} an initial feasible point $x_0$ and convex functions $f_i$, $g_i$.\; k=0\; \textbf{repeat}\; \qquad 1. \textit{Convexify.} $\hat{g}_i(x)=g_i(x_k)+\nabla g_i(x_k)^T (x-x_k)$ for i=0,1,...,m\; \qquad 2. \textit{Solve.} Set the value of $x_{k+1}$ to the solution of the convex problem\; \qquad \qquad minimize $f_0(x)-\hat{g}_0(x)$\; \qquad \qquad subject to $f_i(x)-\hat{g}_i(x)\leq 0$, \quad for i=1,2,...,m.\; \qquad 3. \textit{Update iteration.} $k=k+1$,\; \textbf{until} stopping criterion is satisfied.\; \caption{CCP algorithm\label{IR}} \end{algorithm} \vspace{-0.3cm} Given an initial feasible point for a DC problem, (e.g. any policy from $\mathit{Distr}(\ensuremath{\mathit{Act}})$), all of the successive iterates in Algorithm 1 will be feasible. The procedure given by Algorithm 1 is a descent algorithm, i.e, the objective will monotonically decrease over the iterations for a minimization problem or it will increase for a maximization problem, and it will converge to a local optimum \cite{lipp2016variations}. Therefore, the above algorithm can be used to compute locally optimal solutions by solving a sequence of convex optimization problems, which is efficiently solvable by well-studied methods \cite{boyd_convex_optimization}. \subsection{Approximating the weighting function with a DC function} In general, CPT weighting functions are nonlinear functions, and we can not use the weighting functions directly in convex-concave programming. Therefore, we approximate the weighting functions by a DC function to utilize convex-concave programming. A possible way to approximate the weighting function is least-squares polynomial approximation~\cite{de1978practical} or Chebyshev polynomial approximation~\cite{mason2002chebyshev}, but these methods can be inaccurate, as the CPT weighting functions that are frequently used in the literature are not Lipschitz continuous around zero probability. See Figure 1 for an example where the Chebyshev approximation method fails to approximate a weighting function. \vspace{-0.2cm} \begin{figure}[ht] \centering \input{myfile1.tex} \caption{An example of a CPT weighting function (red) and approximation of the CPT weighting function (blue) by a 25th degree Chebyshev polynomial with error tolerance $\epsilon=10^{-4}$. As the CPT weighting function is not Lipschitz, the approximation with a Chebyshev basis diverges with smaller $\epsilon$ with larger values of $p$.} \end{figure} \vspace{-0.1cm} Since the Chebyshev and least-squares polynomial methods perform poorly, we modify the least-squares polynomial approximation method by extending the polynomial basis functions with monomial basis functions to accurately approximate the CPT weighting function. For example, we approximate the function $\exp(-0.5(-\ln(k))^{0.9})$, which is used in \cite{lin2013dynamic}, by a posynomial function, $0.00231k^{0.05}+0.00128k^{0.1}+0.19578k^{0.35}+0.59897k^{0.4}+0.15968k^{0.95}+0.03318k^3+0.00847k^{23}.$ Figure 2 shows the posynomial function and the CPT weighting function. \begin{figure}[ht] \centering \begin{tikzpicture} \begin{axis}[xmin=0,xmax=1,ymin=0,ymax=1,mark=none,width=8.5cm,height=4.0cm, xlabel={Probability $k$}, ylabel={$w(k)$}, x label style={font=\normalsize}, y label style={font=\normalsize}, ] \node[] at (40,90) {$\exp(-0.5(-\ln(k))^{0.9})$}; \draw [->](38,81) -- (48,70); \addplot [domain=0:1, red, samples=1000,mark=none]{0.00231642258521069*x^0.05+0.00128356642708694*x^0.1+0.195783466331253*x^0.35+0.598977890286512*x^0.4+0.159689481206954*x^0.95+0.0331820175871778*x^3+0.00847475103416698*x^23}; \addplot [domain=0:1, blue,samples=1000,mark=none]{e^(-0.5*(-ln(x))^0.9)}; \addplot [domain=0:1, green,samples=10,mark=none]{x}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[xmin=0,xmax=1,mark=none,width=8.5cm,height=4.0cm, xlabel={Probability $k$}, ylabel={Approximation error}, x label style={font=\normalsize}, y label style={font=\normalsize}, ] \addplot [domain=0:1, red, samples=1000,mark=none]{0.00231642258521069*x^0.05+0.00128356642708694*x^0.1+0.195783466331253*x^0.35+0.598977890286512*x^0.4+0.159689481206954*x^0.95+0.0331820175871778*x^3+0.00847475103416698*x^23-e^(-0.5*(-ln(x))^0.9)}; \end{axis} \end{tikzpicture} \caption{Top: An example of a CPT weighting function (blue) versus a regular transition function (green) and approximation of the CPT weighting function (red) by a DC posynomial function. Note that curve of the approximation is not visible, which shows that the approximation is accurate. Bottom: The error of the approximation of the CPT weighting function by a DC posynomial function.} \end{figure} \vspace{-0.30cm} \subsection{Computing locally optimal policies} When the weighting functions are given as $w_{+}(x)=w_{-}(x)=x$ and similarly for utility functions $u_{+}(x)=u_{-}(x)=x$, the dynamic programming equation to find the policy that maximizes the probability of satisfying the reachability property is \vspace{-0.05cm} \begin{align} &p_t(s)=\max_{\alpha \in Act}\sum_{s' \in S}\mathcal{P}(s,\ensuremath{\alpha},s') \cdot p_{t+1}(s')\nonumber, \\ &p_T(s)=1, \quad \forall s \in Q, \quad t=1,...,T, \label{eq:CPT_eq_reach} \end{align} where $p_t(s)$ denotes the probability of satisfying the reachability property at state $s$ and time $t$. Equivalently, we can write the dynamic programming equation in following for a given state $s$ and time $t$: \vspace{-0.1cm} \begin{align} &\maximize\limits_{\ensuremath{\sigma}(s,a), a \in \ensuremath{\mathit{Act}}} \sum_{\ensuremath{\alpha}\in\ensuremath{\mathit{Act}}(s)}\sum_{s' \in S}\ensuremath{\sigma}(s,\ensuremath{\alpha})\cdot \mathcal{P}(s,\ensuremath{\alpha},s') \cdot p_{t+1}(s') \nonumber \\ &\enskip\text{subject to}\nonumber\\ &\sum_{\ensuremath{\alpha}\in\ensuremath{\mathit{Act}}(s)}\ensuremath{\sigma}(s,\ensuremath{\alpha})=1, \quad \forall\ensuremath{\alpha}\in\ensuremath{\mathit{Act}}(s), \quad \ensuremath{\sigma}(s,\ensuremath{\alpha}) \geq 0.\label{eq:CPT_eq_reach1} \end{align} The optimization problem in \eqref{eq:CPT_eq_reach1} maximizes the expected value of the probability for satisfying the reachability property, therefore it is a risk-neutral solution. Note that we can compute the expected value by solving the following problem: \vspace{-0.07cm} \begin{align} &\maximize\limits_{\ensuremath{\sigma}(s,a), a \in \ensuremath{\mathit{Act}}} \sum_{s'_{q=1} \in S(s)}^{s'_{|S(s)|}\in S(s)}\bigg(\Phi_{q}\cdot \Big(p_{t+1}(s'_{q})-p_{t+1}(s'_{q-1})\Big)\bigg)\nonumber\\ &\enskip\text{subject to}\nonumber\\ &\sum_{\ensuremath{\alpha}\in\ensuremath{\mathit{Act}}(s)}\ensuremath{\sigma}(s,\ensuremath{\alpha})=1,\quad\forall\ensuremath{\alpha}\in\ensuremath{\mathit{Act}}(s), \quad\ensuremath{\sigma}(s,\ensuremath{\alpha}) \geq 0,\nonumber\\ &\Phi_{q} =\sum_{\ensuremath{\alpha}\in\ensuremath{\mathit{Act}}(s)}\sum_{s'_{m=q} \in S(s)}^{s'_{|S(s)|} \in {S(s)}}\ensuremath{\sigma}(s,\ensuremath{\alpha})\cdot\mathcal{P}(s,\ensuremath{\alpha},s'_{m}), \label{eq:CPT_eq_reach2} \end{align} where $q=1,2,\ldots,|S(s)|$ gives the index of the state in $S(s)$ after it is sorted with increasing probability of satisfying the property at time $t+1$, i.e, they are sorted with the values $p_{t+1}(s'_q)$, and $p_{t+1}(s'_0)=0$. The sum of the objective in \eqref{eq:CPT_eq_reach2} is over the successor states. The first sum in $\Phi_{q}$ is over the actions, and the second sum in $\Phi_{q}$ computes the probability of transitioning the successor state with at least probability $p_{t+1}(s'_{q-1})$ as a function the policy. The problem in \eqref{eq:CPT_eq_reach2} can be viewed as maximizing the Riemann integral of the expected value, and the problem in \eqref{eq:CPT_eq_reach1} maximizes the Lebesgue integral. See the Figure 3 as an example from the MDP in Figure 4 with $\sigma(1,a)=0.3$ and $\sigma(1,a)=0.7$. Both problems will maximize the expected value, i.e, the area under the curve in Figure 3. Note that the probability of satisfying the specification up to $0.2$ probability is 1, regardless of the policy we choose, as $0.2$ is the lowest probability of the successor states. Then, the probability of transitioning a state with at least $0.5$ probability of satisfying the property can be obtained by the sum of the probabilities of transitioning the state $3$ and state $4$, which is given by $\sigma(s,a)+0.4\cdot\sigma(s,b)$ in the MDP in Example 1. Similarly, the probability of transitioning to state $4$ is $0.4\cdot\sigma(s,b)$, which gives the probability of satisfying the specification with $0.9$ probability. When $w_{+}(x)=w_{-}(x)=x$ and $u_{+}(x)=u_{-}(x)=x$, both problems in \eqref{eq:CPT_eq_reach1} and \eqref{eq:CPT_eq_reach2} can be used to maximize the expected value of satisfying the property. However, with general weighting and utility functions, we cannot use the formulation in \eqref{eq:CPT_eq_reach1}, as $w(x+y)\neq w(x)+w(y)$ in general. Therefore, with a CPT weighting and utility function, we use a modified version of \eqref{eq:CPT_eq_reach2}, because we can approximate the weighting function accurately. \begin{figure}[h] \begin{tikzpicture} \begin{axis}[ymin=0,ymax=1.1,xmin=0,xmax=1,enlargelimits=false, xlabel={Probability $z$ of satisfying the property}, ylabel={$p(z)$}, x label style={font=\normalsize}, y label style={font=\normalsize},width=8.5cm,height=4.0cm] \addplot [ const plot, fill=blue, fill opacity=0.2, draw=black, ] coordinates { (0,1) (0.2,0.58) (0.5,0.28) (0.9,0) } \closedcycle ; \end{axis} \end{tikzpicture} \caption{The graph of the random variable with respect to the probability of satisfying the property versus probability of obtaining that value in Example 1.} \end{figure} \begin{example} Consider the MDP in Figure 4 with 4 states at time $t$ with $p_{t+1}(2)=0.2$, $p_{t+1}(3)=0.5$, $p_{t+1}(4)=0.9$. The linear program that computes the maximum probability of satisfying the specification is: \vspace{-0.1cm} \begin{align} &\maximize\limits_{\ensuremath{\sigma}(s,a),\ensuremath{\sigma}(s,b)}\quad \Big(\big(\sigma(s,a)+\sigma(s,b)\big)\cdot\big(0.2\big)+\nonumber \\ &\qquad \qquad \big(\sigma(s,a)+0.4\cdot\sigma(s,b)\big)\cdot\big(0.5-0.2\big)+\nonumber\\ &\qquad\qquad \qquad \big(0.4\cdot\sigma(s,b)\big)\cdot\big(0.9-0.5\big)\Big)\nonumber\\ &\enskip \text{subject to}\quad \sigma(s,a)+\sigma(s,b)=1, \sigma(s,a)\geq 0, \sigma(s,b)\geq 0. \nonumber \end{align} \vspace{-0.6cm} \begin{figure}[htb!] \centering \begin{minipage}[t]{0.4\textwidth} \centering \begin{tikzpicture}[->,shorten >=1pt,auto,node distance=2.0cm, semithick] \tikzstyle{every state}=[fill=none,draw=black,text=black] \node[initial,state] (1) at (0, 0) {$1$}; \node[state] (2) at (3, 0) {$3$}; \node[state] (3) at (3, -1) {$4$}; \node[state] (4) at (3, 1) {$2$}; \pi (1) edge node {$a : 1$} (2) (1)edge node { } (3) (1)edge node {$b : 0.6$} (4) ; \node[] at (1.6,-1) {$b : 0.4$}; \end{tikzpicture} \label{fig:sub21} \end{minipage} \caption{An MDP with 4 states. The label $a : \gamma$ on the transitions represents that the transition happens with probability $\gamma$, when the $a$ action is taken.} \end{figure} \end{example} For general CPT weighting and utility functions, we approximate the CPT weighting function by a posynomial. Then, for a given state $s$ and horizon $t$ and the approximation function $f(p)$ with $K$ monomials, we compute a locally optimal policy by solving the following problem: \vspace{-0.4cm} \begin{align} &\maximize\limits_{\ensuremath{\sigma}(s,a), a \in \ensuremath{\mathit{Act}}} \nonumber\\ \nonumber &\sum_{s'_{q=1} \in S(s)}^{s'_{|S(s)|}\in S(s)}\bigg(\Phi'_{q}\cdot\Big(u_+(p_{t+1}(s'_{q}))-u_+(p_{t+1}(s'_{q-1}))\Big)\bigg)\\ \nonumber &\enskip\text{subject to} \nonumber\\ &\sum_{\ensuremath{\alpha}\in\ensuremath{\mathit{Act}}(s)}\ensuremath{\sigma}(s,\ensuremath{\alpha})=1,\quad \forall\ensuremath{\alpha}\in\ensuremath{\mathit{Act}}(s), \quad \ensuremath{\sigma}(s,\ensuremath{\alpha}) \geq 0,\nonumber\\ &\Phi'_{q} = \sum_{k=1}^K c_k\cdot\Big(\sum_{\ensuremath{\alpha}\in\ensuremath{\mathit{Act}}(s)}\sum_{s'_{m=q} \in S(s)}^{s'_{|S(s)|} \in {S(s)}}\ensuremath{\sigma}(s,\ensuremath{\alpha})\cdot\mathcal{P}(s,\ensuremath{\alpha},s'_{m})\Big)^{a_k}. \label{eq:CPT_eq_reach3} \end{align} \vspace{-0.2cm} We highlight the differences between the optimization problems in \eqref{eq:CPT_eq_reach2} and \eqref{eq:CPT_eq_reach3}. First difference is, we replace $\Phi_{q}$ in \eqref{eq:CPT_eq_reach2} to $\Phi'_{q}$ in \eqref{eq:CPT_eq_reach3}. $\Phi_{q}$ computes the expected value of the probability of transitioning to another state with he successor state with at least probability $p_{t+1}(s'_{q-1})$ as a function the policy, and it is used in the risk-neutral measure. On the other hand, $\Phi'_{q}$ approximately computes the expected value of the probability with respect to the CPT weighting function in a CPT-based measure by approximating the CPT weighting function with $f(p)$. The second difference is, $u_+(x)=x$ in the problem \eqref{eq:CPT_eq_reach2}. Therefore, we replace $p_{t+1}(s'_{q})$ to $u_+(p_{t+1}(s'_{q}))$. Note that the probability of satisfying the property is always between $0$ and $1$, therefore we use $u_+$ in the objective in problem \eqref{eq:CPT_eq_reach3}. Let $\beta \in \mathbb{R}^+$ and $g: \mathbb{R}^+ \rightarrow \mathbb{R}^+$. The function $g(y)=y^\beta$ is concave for $0 \leq \beta \leq 1$, and convex for $\beta \geq 1$ \cite{boyd_convex_optimization}. Therefore the problem in \eqref{eq:CPT_eq_reach3} is a DC problem, and Algorithm 1 computes a locally optimal policy. \begin{remark} For rational $p$, the function $y^p$ can be represented by linear matrix inequalities (LMIs) \cite{alizadeh2003second}. For instance, the constraints $y^3\leq x$ and $y\geq 0$ are equivalent to \begin{align} \begin{bmatrix} z & y \\ y & 1 \end{bmatrix}\geq 0 \enskip \text{and} \begin{bmatrix} x & z \\ z & y \end{bmatrix}\geq 0. \end{align} \vspace{0.15cm} In \cite{alizadeh2003second}, it is shown that for $p=p_n/p_d>1$, we have $k(p_n,p_d)\leq \log_2{p_n}+\alpha(p_n)$, where $k(p_n,p_d)$ is the number of LMI constraints that are generated to represent $x^3\leq y$, and $\alpha(p_n)$ is a term that grows slowly compared to $\log_2$ term. Therefore, it is beneficial to use as few basis functions as possible to efficiently compute the solutions of the DC problems because we need extra variables and constraints to represent the functions $y^p$. Therefore, Chebyshev polynomials become a rather inefficient choice, as they tend to be dense polynomials with high degrees, which is required for accurate approximation. Recall that, Figure 1 shows the Chebyshev approximation diverges, when the error tolerance is set to be small. \end{remark} \begin{example} Consider the MDP in Figure 4. The DC problem that computes the maximum probability of satisfying the specification, given a posynomial with $K$ basis functions, \vspace{-0.7cm} \begin{align} & \maximize\limits_{\ensuremath{\sigma}(s,a),\ensuremath{\sigma}(s,b)} \quad \sum_{k=1}^K \Bigg( c_k\cdot\bigg(\Big(\sigma(s,a)+\sigma(s,b)\Big)^{a_k}\cdot\Big(u_+(0.2)\Big)\nonumber\\ &\quad +\Big(\sigma(s,a)+0.4\cdot\sigma(s,b)\Big)^{a_k}\cdot\Big(u_+(0.5)-u_+(0.2)\Big)+\nonumber \\ &\qquad \Big(0.4\cdot\sigma(s,b)\Big)^{a_k}\cdot\Big(u_+(0.9)-u_+(0.5)\Big)\bigg)\Bigg)\nonumber\\ & \enskip\text{subject to} \quad \sigma(s,a)+\sigma(s,b)=1, \sigma(s,a)\geq 0, \sigma(s,b)\geq 0. \nonumber \end{align} We note that the objective in the above problem is a sum of DC functions and the functions in the constraints are affine functions, the above problem is a DC optimization problem and a locally optimal solution of the problem can be computed using Algorithm 1. \end{example} So far, we considered formal quantitative verification of the systems, and these problems do not include cost or reward function. If we want to include cost or reward functions in a MDP to minimize the expected cost or maximize the expected reward with CPT-based measures, then objective of the optimization problem in \eqref{eq:CPT_eq_reach2} will be replaced by the following: \vspace{-0.5cm} \begin{align} &\maximize\limits_{\ensuremath{\sigma}(s,a), a \in \ensuremath{\mathit{Act}}} \nonumber\sum_{s'_{q=1} \in S(s)}^{s'_{|S(s)| }\in S(s)}\bigg(\Phi'_{q}\cdot \Big(u_+(\gamma_{s}+v_{t+1}(s'_{q}))\qquad\qquad\\ &\qquad\qquad \qquad \qquad-u_+(\gamma_{s}+p_{t+1}(v'_{q-1}))\Big)\bigg)\nonumber\\ &\gamma_{s}=\displaystyle\sum_{k=1}^K c_k \cdot\Big(\sum_{\ensuremath{\alpha}\in\ensuremath{\mathit{Act}}(s)}\ensuremath{\sigma}(s,\ensuremath{\alpha})^{a_k}\cdot R_t(s,\ensuremath{\alpha})\Big), \label{eq:CPT_eq_reach5} \end{align} where $v_{t}(s'_{q})$ denotes the value of a state with index $q$ at time $t$. Note that, the term $u_+(\gamma_{s}+v_{t+1}(s'_{q}))$ is a composition two convex or concave functions, which is not convex or concave in general, also that term is multiplied with a DC function $\Phi_q$. To the best of our knowledge, no general method exists to solve problems with this type of objective. But for two special cases, we can efficiently compute locally optimal solutions using CCP. If the cost or reward function is a function of state instead of state and action, then we can modify the objective function in \eqref{eq:CPT_eq_reach3} as: \vspace{-0.6cm} \begin{align} &\maximize\limits_{\ensuremath{\sigma}(s,a), a \in \ensuremath{\mathit{Act}}}\sum_{s'_{q=1} \in S(s)}^{s'_{|S(s)|}\in S(s)}\Bigg(\Phi'_q\cdot\bigg(u_+\Big(C(s)+v_{t+1}(s'_{q})\Big)\nonumber\\ &\qquad \qquad \qquad \qquad -u_+\Big(C(s)+v_{t+1}(s'_{q-1})\Big)\bigg)\Bigg). \label{eq:CPT_eq_reach6} \end{align} \vspace{-0.2cm} As the cost is a constant, the objective in \eqref{eq:CPT_eq_reach6} is a sum of DC functions, therefore we can compute the locally optimal solution for the case when the cost or reward function is function of a state. The second special case we consider is when the utility functions are $u_-(x)=u_+(x)=x$. Then, adding $\gamma_s$ to the objective term in \eqref{eq:CPT_eq_reach3} will result in a formulation that computes the optimal policy for this special case. \section{Numerical Results} We demonstrate the proposed approach on three domains: (1) A robot in a gridworld, (2) a consensus protocol, and (3) a ride sharing example. The simulations were performed on a computer with an Intel Core i5-7200u 2.50 GHz processor and 8 GB of RAM with MOSEK \cite{andersen2012mosek} as solver and using the CVX \cite{cvx} interface. \subsection{Grid world} Consider a grid world, where states are defined as grid points on a map. An agent starts in an initial state and the objective of the agent is to reach to a given state with minimial cost. The agent can move in four directions by selecting actions (north, south, east, and west). The probability of arriving at the intended cell is $\delta$, and with probability $1-\delta$, the agent moves to a random neighboring state. The cost in each move until reaching the destination is 1 for each state. The grid world has a number of static obstacles and the agent has to avoid these obstacles as hitting an obstacle has a high cost of $M =50$. Therefore, the objective is to compute a safe (i.e., not hitting to obstacles) path that is cost efficient. In our experiments, we choose a 50 $\times$ 50 grid-world, and the gridworld MDP has 2,500 states with horizon $T=100$, $\delta=0.2$ and 300 states consisting of obstacles that the agent tries to evade. We use the weighting function $\exp(-0.5(-\ln(p))^{0.9})$ and the utility function $x^{0.88}$. After obtaining the policies using Algorithm 1, we evaluate the policies on 500 simulation runs. The risk-neutral policy finds a shorter route (with average cost equal to 38.137 on successful runs), yet it crashes into obstacles in 41 runs. In contrast, the risk-averse policy chooses longer routes (with average cost equal to 57.638 on successful runs), but it crashes into obstacles only in 6 runs. \subsection{Consensus Protocol} This case study deals with modeling and verifying the shared coin protocol of the randomized consensus algorithm of Aspnes and Herlihy \cite{aspnes1990fast}. The shared coin protocol returns a preference 1 or 2, with a certain probability, whenever requested by a process at some point in the execution of the consensus algorithm. It implements a collective random walk parameterized by the number of processes $N$ and the constant $K > 1$ (independent of $N$). The first property that we want to compute is the minimal probability of finishing the process and all processes being $1$, which can be expressed as maximizing the probability states, where the execution is finished, and all coins will have the value $1$, after the process. For each benchmark instance, Figure 5 gives the number of states (\#{}states), the computation time for CPT-based measures, the minimum probability of satisfying the specification with CPT-based measure (CPT $\ensuremath{\mathbb{P}}$) and the actual minimum probability of satisfying the specification $\ensuremath{\mathbb{P}}$ in the model. We use the same weighting and utility function as in the previous example. \vspace{0.1cm} \begin{figure}[ht] \centering \begin{tabular}[b]{@{}crrlrlrr@{}} \toprule Parameters & \#{}states & Time (s) & CPT $\ensuremath{\mathbb{P}}$ & $ \ensuremath{\mathbb{P}}$ \\ \midrule $K=2$ & $272$ & $34.49$ & $0.615$ & $0.383$ \\ $K=16$ & $2064$ & $384.93$ & $0.722$ & $0.484$ \\ $K=64$ & $8208$ & $1961.34$ & $0.673$ & $0.498$ \\ \bottomrule \end{tabular} \caption{Results for consensus benchmark with the property of all coins having the same value.} \end{figure} We considered the verification of another property, where we want to compute the maximum probability of finishing the process and all coins not having the same value. Figure 6 shows the results for each instance. \begin{figure}[ht] \centering \begin{tabular}[b]{@{}crrlrlrr@{}} \toprule Parameters & \#{}states & Time (s) & CPT $\ensuremath{\mathbb{P}}$ & $ \ensuremath{\mathbb{P}}$ \\ \midrule $K=2$ & $272$ & $41.68$ & $0.315$ & $0.108$ \\ $K=16$ & $2064$ & $472.19$ & $0.212$ & $0.016$ \\ $K=64$ & $8208$ & $2953.75$ & $0.163$ & $0.002$ \\ \bottomrule\end{tabular} \caption{Results for consensus benchmark the property of all coins not having the same value.} \end{figure} Both examples in consensus protocol shows, the CPT-based measure tends to inflate the probability of satisfying the properties. The weighting function overestimates the small probabilities of the transition probabilities in MDPs and the utility function that we choose inflates the reachability probabilities. \subsection{Ride Sharing} We consider a ride sharing example, inspired by \cite{ratliff2017risk}. This case study concerns modeling the behavior of a passenger in a sequential decision-making scenario. Many ride-sharing companies set prices on their rides based on both supply of drivers and demand of passengers. Therefore, the price of a ride may fluctuate. The passengers account for the price fluctuation, which influences their behavior. We model the ride-sharing MDP with $S=\lbrace 0,1,2,3,4\rbrace$, where states $0,...,3$ denote the cases where the passenger did not take a ride and state $4$ represents the case when the passenger takes a ride. The price multipliers for states $0,1,2$ and $3$ are $1.0, 1.4, 1.8$ and $2.2$ respectively. $\ensuremath{\mathit{Act}}=\lbrace 0, 1\rbrace$ where action $0$ is waiting, and action $1$ is taking a ride. We consider a horizon length $T=5$, and the transition matrix for action $0$ is \vspace{-0.25cm} \begin{align*} \mathcal{P}=\begin{bmatrix} 0.876 & 0.099 & 0.017 & 0.008\\ 0.347 & 0.412 & 0.167 & 0.074\\ 0.106 & 0.353 & 0.259 & 0.282\\ 0.086 & 0.219 & 0.143 & 0.552 \end{bmatrix}. \end{align*} If action $1$ is taken, the passenger transitions to state $4$ with probability 1, which implies that a ride has been taken. We define the reward function as \vspace{-0.4cm} \begin{align*} R(s_t,a_t)=\begin{cases} \hat{R} \quad &a_t=0,\\ S_t - x_t(p_{base}+p_{mile}D+p_{min}T)\quad &a_t=1, \end{cases} \end{align*}\vspace{-0.1cm} \noindent where $\hat{R}$ is a constant, $D$ is the distance in miles, $T$ is time in minutes, $S_t$ is a constant that decreases linearly in time, $x_t$ is the price multiplier, and $p_{base}$, $p_{mile}$, and $p_{min}$ are the base, per mile, and per min prices, respectively. We choose the prices based on Uber's Washington, DC operation\footnote{\tt\small http://uberestimate.com/prices/Washington-DC/}, and we use the same weighting function as in the previous examples and utility function $u_{+}(x)=x$. Table $1$ shows the probabilities of taking a ride at a price multiplier and time. \vspace{0.11cm} \begin{table}[h] \centering \caption{Probabilities of taking a ride with respect to the price multiplier and time.} \label{my-label} \begin{tabular}{|c|c|c|c|c|} \hline Price multiplier & \multirow{2}{*}{1} & \multirow{2}{*}{1.4} & \multirow{2}{*}{1.8} & \multirow{2}{*}{2.2} \\ \cline{1-1} \multicolumn{1}{|c|}{{Time}} & & & & \\ \hline 1 & 0.88 & 0.25 & 0.17 & 0.13 \\ \hline 2 & 0.94 & 0.89 & 0.56 & 0.45 \\ \hline 3 & 0.97 & 0.83 & 0.82 & 0.78 \\ \hline 4 & 0.99 & 0.95 & 0.95 & 0.86 \\ \hline 5 & 0.99 & 0.99 & 0.98 & 0.98 \\ \hline \end{tabular} \end{table} \vspace{-0.0cm} We note that our passenger model is relatively risk-averse, i.e, the probability of taking a ride is very high when the price multiplier is 1, and the probability decreases with increasing price multipliers. The passengers tend to take a ride with increasing time to avoid taking any further risks in case of an increase in price multiplier in the future. \section{Conclusions} We proposed a computational method for verification of temporal logic specifications in Markov decision processes (MDPs) with measures from cumulative prospect theory (CPT). CPT-based measures are empirically known to faithfully capture the asymmetry in the risk-averseness and risk-taking behavior of humans in decision-making. Computation of optimal policies is impractical with CPT-based measures due to the nonlinear weighting and utility functions. The proposed method approximates the nonlinear weighting function with a difference of convex (DC) function, then computes a locally optimal policy by solving a DC problem. On the other hand, computing a policy with a CPT-based measure takes more time than computing a policy with expected-value measure, as we need to represent the DC functions as a series of linear matrix inequalities. We demonstrate the practical applicability of our approach on several scenarios. For future work, we are interested in establishing error bounds between the globally optimal CPT-value and the CPT-value that is obtained from our method in MDPs. \bibliographystyle{abbrv}
{'timestamp': '2018-03-02T02:03:03', 'yymm': '1803', 'arxiv_id': '1803.00091', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00091'}
arxiv
\section{Introduction} Vector quantization modifies vectors/matrices to produce new ones with shared values and acceptable difference from the originals. By reducing the number of values in a vector/matrix, quantization could compress information and therefore reduce the processing and storage cost. Quantization has been found great usefulness in areas like image processing\cite{QuantizationImageProcessing}, speech recognition\cite{QuantizationSpeechRecognition}, and Machine Learning techniques\cite{QuantizationNearestNeighbour}. And recently, with the growing research interests in deploying neural networks on resource-scarce edge devices, vector quantization techniques have grasped considerable attention because of its ability in reducing network storage size\cite{SoftWeightSharing2011}\cite{SongHan2015NetworkCompression}\cite{EfficientProcessingDL_Tutorial}. The original idea of this research also comes from the explorations in the quantization of embedded neural networks, although the proposed algorithms could be utilized for general purpose.\par Conventional vector quantization methods usually utilize hand-coding domain rules and/or clustering-based methods to quantize the values\cite{EfficientProcessingDL_Tutorial}. Common approaches include uniform quantization, logarithm quantization and k-means clustering quantization. While these approaches are straightforward and convenient to use, they frequently suffer from the several problems: 1. inadequately-reliable performance. Domain quantization usually produce low-quality outcomes, and it will lead to significant information loss; k-means quantization could usually produce high-quality results for the overall results, but it could include empty clusters or irrational values (say, out-of-range values) because of bad random initialization; 2. inexact results. The results of domain quantization depend on the choice of domain, and k-means clustering is a heuristic method that cannot guarantee the optimal solution and the results are subject to random initialization; and 3. high time-consumption. While K-means clustering method could usually lead to solution with preferable information loss, the time consumption of this method is significant, especially when the amount of post-quantization values is large. Also, to get the optimal solution of K-means, one would be needing to run the algorithm for several times to pick the optimum, which further enhances the time complexity.\par In this paper, the quantization algorithms are examined from another perspective: sparse least square optimization. We consider the sparse-inducing properties of $l_0$ and $l_1$ norm-regularization terms and designed algorithms to minimize the difference between the original and the sparsely-constructed vectors. To optimize the performance based on its computational properties, an alternative version with both $l_1$ and $l_2$ norm-regularization is also explored and implemented. Furthermore, to design a least square quantization method that could produce results by indicating certain amounts of quantization amounts (instead of the value of penalization coefficient $\lambda$), two additional algorithms are designed: the first one is introduced by following the idea of iterative $l_1$ least square optimization, and the second one is accomplished by combining k-means clustering with least square optimization. Interestingly, the second approach could also be interpreted as an improvement of the conventional k-means clustering quantization method. Experimental results illustrate that the performance of the proposed algorithms are competitive. For the $l_1$-based algorithms, they are especially favorable in terms of running-time complexity, which makes them particularly useful when the required quantization amounts is not in a trivial scale. Moreover, the results provided by the proposed $l_1$ methods are more exact and relatively independent from random seed. \par Notice that our algorithms are very similar to sparse compression in signal processing\cite{SparseCompressionTypical}, but there are clear distinctions between them: in quantization problem the constructed vector should have shared values, while in sparse signal processing it only demands the sparse vector to be able to produce a vector close to the original signal. \par The rest of the paper is arranged as follows: section 2 will be introducing related work in the field, including research outcomes from quantization algorithms and sparse coding processing; section 3 will be introducing our designed algorithms mathematically and analyze their optimization schemes and computational properties; the experimental results of the algorithms are shown, compared and analyzed in section 4; and finally, a conclusion is drawn in section 5 and future research topics related to this paper is discussed. \section{Related Work} The goal of vector quantization is relatively straightforward to achieve in usual situations, thus there are not many complicated methods to address this task. \cite{EfficientProcessingDL_Tutorial} provides a brief survey for basic methods of vector quantization, which includes domain-based uniform and logarithm quantizations and clustering-based techniques such like K-means quantization. The idea of quantizing vectors with clustering methods provides us an open skeleton, in which we could plug novel clustering techniques to produce new quantization algorithms\cite{EmbeddedDeepLearningThesis}. \cite{1992weightsharing} offers an alternative technique to use Mixture of Gaussian method to perform quantization specifically for neural networks, and a recent paper \cite{2017_compression_1992idea} re-examined this idea and formally designed it to be used for neural network compression and provided a mathematical justification for it. Other techniques to perform vector quantization include \cite{DivergenceQuantization}, which utilized divergence instead of distance metric as the measurement and derived an algorithms based on it; \cite{UseNeuralNetworkToQuantize}, which designed a neural network to perform vector quantization; and \cite{PairwiseSimilarityQuantization}, which considered pairwise dis-similarity as the metric for quantization. To the best of our knowledge, hitherto there has not been publications discussing quantization algorithms as sparse least square optimization, thus our paper should be the pioneering work in the area. \par There are plenty of academic publication discussing the applications of vector quantization, and recently, academic projects lying in this area have been growingly connected to neural networks, as the ability of quantization in compressing model size is being exploited in implementing edge-device neural networks. \cite{SongHan2015NetworkCompression} proposed a general pipeline to reduce model storage, and an important part of it is quantization. And similar with \cite{2017_compression_1992idea} mentioned above, \cite{FixedPointQuantizationNetwork} specifically designed a quantization method for neural networks. \cite{VecQuantizationNNcompressing} directly utilized existed vector quantization techniques in network compressing and illustrated that the technique could be ideal for modifying neural network precisions. As mentioned in the introductory section, the origin of the algorithms was also the task to solve neural network weight-sharing problem, and a set of neural network weight parameters is one of the test data-sets in the experimental section. \par The algorithm proposed in this work has significant similarity with compressive sensing (sparse signal processing) in terms of regularization idea and optimization target functions \cite{SparseCompressionTypical}\cite{SparseCompressionTypical2}\cite{SparseCompressionTypical3}. Typical approaches to induce sparsity in compressive sensing algorithms are to introduce $l_0$ norm\cite{l0SignalProcessing}, $l_1$ norm \cite{LassoRetirevePaper}\cite{LassoCompressiveSensing} and/or $l_{2,1}$ norm \cite{l21CompressiveSensing} to the target optimization functions. And similarly, our algorithms also utilize these techniques to perform sparsity. Meanwhile, since $l_1$ norm is not everywhere differentiable and $l_0$ norm is not even convex, there also exist plenties of algorithms devoted to efficiently solve the optimization problems \cite{l1OptimizationAlgorithm}\cite{l0OptimizationAlgorithm}\cite{CoordinateDescentPaper}. In this paper, we use coordinate descent method for $l_1$ optimization, and the newly-proposed Fast Best Subset Selection \cite{l0Learn2018Hazimeh} (will be called '$l_0$ learn' in this paper) to optimize $l_0$ target functions. \section{Quantization Algorithms} \subsection{Problem Setting} The vector quantization task could be described as follows: suppose we have a vector $\boldsymbol{w}$ that has $m$ distinct values. Now we intend to find a vector $\boldsymbol{w}^{*}$ with $p$ distinct values, where $p \leq m$. In some case, it could also be set as a more strict condition $p \leq l$, which $l$ is a given value we require less than $m$. Then by denoting the difference between the original vector and the constructed one with $l_2$ norm, our original target function could be formed as:\\ \begin{equation} \label{originalOptTargetFunc} \begin{aligned} & \underset{\boldsymbol{w}^{*}}{\text{minimize}} & & ||\boldsymbol{w}-\boldsymbol{w}^{*}||_{2}^{2} \\ & \text{subject to} & & \boldsymbol{o}(\boldsymbol{w}^{*}) \leq l \\ \end{aligned} \end{equation} Where $\boldsymbol{o(\cdot)}$ means the distinct values of a vector. And notice that here we only consider $\boldsymbol{w}$ in 1-dimension vector form. If the data is coded in a matrix, such like neural network parameters and images, then we could simply 'flatten' the matrix into a vector to perform quantization, and then turn it back to the original shape. \subsection{Original Algorithm with $l_1$ Norm Regularization} To begin with, we firstly change $\boldsymbol{w}$ into $\boldsymbol{\hat{w}}=\boldsymbol{o}(\boldsymbol{w})$, which we directly operate on distinct values and recover the full vector by indexing later. And to fulfill the purpose of quantization, we will be needing to construct a new vector with length $m$ and $p$ distinct values. We could assume there exist a 'base' vector $\boldsymbol{v}$ with shape $[k \times 1]$, where $k$ is a given number, and the $\boldsymbol{\hat{w}}$ is generated by $\boldsymbol{v}$ through linear transformation. Notice that there should be $k \geq m$, as it will otherwise be unreasonable to project vection in $R^{k}$ to $R^{m}$ with linear transformation. Then suppose the linear transformation matrix is $\boldsymbol{\Psi}$ (with shape $[m \times k]$), the relationship between$\boldsymbol{\hat{w}}$, $\boldsymbol{\Psi}$, and $\boldsymbol{v}$ will be:\\ $$ \boldsymbol{\hat{w}} = \boldsymbol{\Psi}\boldsymbol{v} $$ And combining this expression with equation \ref{originalOptTargetFunc}, we could get the new optimzation target:\\ \begin{equation} \label{PsiOptTargetFunc} \underset{\boldsymbol{\Psi},\boldsymbol{v}}{\text{minimize}}||\boldsymbol{\hat{w}}-\boldsymbol{\Psi}\boldsymbol{v}||_{2}^{2} \end{equation} However, optimizing \ref{PsiOptTargetFunc} could not bring the property of sparsity/value-sharing. Moreover, with two targets matrices, the optimization will be difficult to perform. To tackle the problem, here we introduce another matrix $\boldsymbol{A}$, with $\boldsymbol{\Psi}^{*} = \boldsymbol{A}\boldsymbol{\Psi}$, and each entry of $\boldsymbol{\Psi}^{*} $ should be:\\ \begin{equation}\label{PsiEntry} \boldsymbol{\Psi}^{*}_{i,j} = \sum_{c=0}^{i}\alpha_c \boldsymbol{\Psi}_{c,j} \end{equation} By designing the matrix with this addition form, we could be able to achieve 'same values' when there exist $\alpha_c = 0$. Equation \ref{PsiEntry} could be achieved by designing matrix $\boldsymbol{A}$ as a lower-triangular matrix (with main diagonal on):\\ $$ \boldsymbol{A} = \begin{bmatrix} \alpha_1 & 0 & 0 & \cdots & 0\\ \alpha_1 & \alpha_2 & 0 & \cdots & 0\\ \alpha_1 & \alpha_2 & \alpha_3 & \cdots & 0\\ \cdots & \cdots & \cdots & \cdots & \cdots \\ \alpha_1 & \alpha_2 & \alpha_3 & \cdots & \alpha_n \end{bmatrix} $$ And now we have two matrices, $\boldsymbol{A}$ and $\boldsymbol{\Psi}$, to control the constructed vector. Intuitively, if we add $l_1$ and/or $l_0$ norm regularization on the target function, it will be possible for us to produce vector with shared values. Here we consider $l_1$ in the first place because it is continuous and convex. Our optimization target would become:\\ \begin{equation}\label{AlphaPsiOptimisation} \begin{aligned} &\min_{\boldsymbol{\alpha},\boldsymbol{\psi}} ||\boldsymbol{\hat{w}}-\boldsymbol{w}^{*}||_{2}^{2} + \lambda ||\boldsymbol{\alpha}||_{1}\\ =&\min_{\boldsymbol{\alpha},\boldsymbol{\psi}} ||\boldsymbol{\hat{w}}-\boldsymbol{A}\boldsymbol{\Psi}\boldsymbol{v}||_{2}^{2} + \lambda ||\boldsymbol{\alpha}||_{1} \end{aligned} \end{equation} Now the property of sparsity would be able to introduced if \ref{AlphaPsiOptimisation} is optimized. However, the there are still two target matrices in the target function, which makes the optimization problem non-trivial. To determine the system in a convenient way, we will be needing some approximations. Here, we will fix $\boldsymbol{\Psi}$ and only optimize $\boldsymbol{\alpha}$. Now suppose $k=m$, we could pose the matrix as follows:\\ $$ \boldsymbol{\Psi} = \begin{bmatrix} 1 & 0 & 0 & \cdots & 0 & 0\\ -1 & 1 & 0 & \cdots & 0 & 0\\ 0 & -1 & 1 & \cdots & 0 & 0\\ \cdots & \cdots & \cdots & \cdots & \cdots & \cdots \\ 0 & 0 & 0 & \cdots & -1 & 1 \end{bmatrix} $$ And we will get a $[m \times 1]$ vector $\boldsymbol{v}^{*}$, in the following fomat:\\ $$ \boldsymbol{v}^{*} = \begin{bmatrix} v_{1}\\ v_{2}-v_{1}\\ v_{3}-v_{2}\\ \cdots\\ v_{k} - v_{k-1} \end{bmatrix} $$ One might doubt whether the optimization would still be accurate if we fix $\boldsymbol{\Psi}$ and only optimize $\boldsymbol{\alpha}$. However, we could see that \textbf{with transformation matrix $\boldsymbol{\Psi}$ been set to full rank, the linear space $R^{k}$ is not changed}. This implies with proper optimization, we could still reach the optimal solution. Notice that the above transformation matrix is given under the assumption of $k=m$, and with $k>m$ scenario, we could leave some of the rows of $\boldsymbol{\Psi}$ as $0$ and keep the rank as $m$. Then, with the above derivation, the problem is transferred into a sparse least-square problem, without losing its correctness and rationality. And now, our optimization target becomes:\\ \begin{equation} \min_{\boldsymbol{\alpha}} ||\boldsymbol{\hat{w}}-\boldsymbol{A}\boldsymbol{v}^{*}||_{2}^{2} + \lambda ||\boldsymbol{\alpha}||_{1} \end{equation} And this is equivalent to form a vector of $\boldsymbol{\alpha}$ and a lower-triangular matrix $\boldsymbol{N_{p}}$:\\ $$ \boldsymbol{N_{p}} = \begin{bmatrix} v_{1} & 0 & 0 & \cdots & 0\\ v_{1} & v_{2}-v_{1} & 0 & \cdots & 0 \\ v_{1} & v_{2}-v_{1} & v_{3}-v_{2} & \cdots & 0\\ \cdots & \cdots & \cdots & \cdots & \cdots \\ v_{1} & v_{2}-v_{1} & v_{3}-v_{2} & \cdots & v_{m}-v_{m-1} \end{bmatrix} $$ And in practice, we could simply use the value of original unique-value vector $\boldsymbol{\hat{w}}$ to fill the value of $\boldsymbol{v}^{*}$. This scheme could provide a convenient method to first starting values; meanwhile, from the perspective of numerical computation, it also offers a warm start for the optimization algorithm. The final optimization target with $l_1$ regularization will be as follows:\\ \begin{equation}\label{l1normReguliriseOpt} \min_{\boldsymbol{\alpha}} ||\boldsymbol{\hat{w}} -\boldsymbol{N_{p}}\boldsymbol{\alpha}||_{2}^{2} + \lambda ||\boldsymbol{\alpha}||_{1} \end{equation} Equation \ref{l1normReguliriseOpt} is very similar to the optimization target in compressive sensing. Nevertheless, there are two significant differences: firstly, the root of the target function and the derivations are different from those in compressive sensing; and secondly, the produced vector $\boldsymbol{w}^{*}$ will be a quantized vector instead of simply a sparse vector close to the original as in compressive sensing. The optimization of this formula is not very hard: the target function is a typical LASSO problem, and it is solved by \textbf{Coordinate Descent} with LASSO solvers in SK-learn in our program \cite{scikit-learn}. \par It is noticeable that the 'raw result' of equation \ref{l1normReguliriseOpt} could still be improved. As the optimization should satisfy both sparsity and $l_2$ loss, the values in the solved $\boldsymbol{\alpha}$ vector might not optimally reduce the difference between $\boldsymbol{\hat{w}}$ and the constructed vector. Thus, we consider to \textbf{solve the least square with positions that $\alpha \neq 0$} to further improve the result. Mathematically, it could be denoted as to use matrix $\boldsymbol{N_{p}}^{*}$ to perform the least square optimization, where the $\boldsymbol{N_{p}}^{*}$ matrix should be:\\ \begin{equation} \label{NpStarRetrievalMethod} \boldsymbol{N_{p}}^{*}_{\cdot,j} = \boldsymbol{N_{p}}_{\cdot,h_{j}},\text{ } \forall \text{ } h_{j} \text{ such that } \alpha_{h_{j}} \neq 0 \end{equation} Which means, the $\boldsymbol{N_{p}}^{*}$ will pick the columns with corresponding non-zeros indexes in $\boldsymbol{\alpha}$. The optimization target will therefore be:\\ \begin{equation} \label{LeastSqaurePostLassoOptimization} \min_{\boldsymbol{\hat{\alpha}}} ||\boldsymbol{\hat{w}} -\boldsymbol{N_{p}}^{*}\boldsymbol{\hat{\alpha}}||_{2}^{2} \end{equation} The target function \ref{LeastSqaurePostLassoOptimization} is in a everywhere-differentiable least-square form, thus it could be direct solved analytically:\\ \begin{equation} \label{PostLassoLeastSquareSolution} \boldsymbol{\hat{\alpha}}^{*} = ({\boldsymbol{N_{p}}^{*}}^{T}{\boldsymbol{N_{p}}^{*}})^{-1}{\boldsymbol{N_{p}}^{*}}^{T}\boldsymbol{\hat{w}} \end{equation} Where $\boldsymbol{\hat{\alpha}}^{*}$ would be $[h \times 1]$ vector, where $h$ is the number of distinct values. The values of could be put back into the $\boldsymbol{\alpha}$ vector to get the final result $\boldsymbol{\alpha}^{*}$:\\ \begin{equation} \label{FinalAlphaComputation} \boldsymbol{\alpha}^{*}_{i} = \begin{cases} \boldsymbol{\alpha}^{*}_{i} = \boldsymbol{\hat{\alpha}}^{*}_{h_{i}}, \boldsymbol{\alpha}_{i} \neq 0 \\ 0, \text{ else} \end{cases} \end{equation} And finally, the quantized vector could be constructed by multiplying the $\boldsymbol{\alpha}^{*}$ vector with the 'based transformation' matrix $\boldsymbol{N_{p}}$:\\ \begin{equation} \label{QuantizedVectorComputing} \boldsymbol{w}^{*} = \boldsymbol{N_{p}}\boldsymbol{\alpha}^{*} \end{equation} The overall quantization method with $l_1$ regularization could be denoted as algorithm \ref{alg:l1Quantization}. In the experiment section, the results of $l_1$-based algorithms with and without least square to optimize $\boldsymbol{\hat{\alpha}}^{*}$ will be shown separately. \begin{algorithm} \caption{Quantization with $l_1$ Least Square}\label{alg:l1Quantization} \hspace*{\algorithmicindent} \textbf{Input: }\text{Original vector $\boldsymbol{w}$} \\ \hspace*{\algorithmicindent} \textbf{Output: }\text{Quantized vector $\boldsymbol{w}^{*}$} \begin{algorithmic}[1] \State $\boldsymbol{\hat{w}} \gets \boldsymbol{o}(\boldsymbol{w})$ \State Optimize target function \ref{l1normReguliriseOpt} with Coordinate Descent, get $\boldsymbol{\alpha}$ \State Retrieve $\boldsymbol{N_{p}}^{*}$ with equation \ref{NpStarRetrievalMethod} \State Compute $\boldsymbol{\hat{\alpha}}^{*}$ with equation \ref{PostLassoLeastSquareSolution} \State Compute $\boldsymbol{\alpha}^{*}$ vector with equation \ref{FinalAlphaComputation} \State Compute the desired $\boldsymbol{w}^{*}$ vector with equation \ref{QuantizedVectorComputing} \end{algorithmic} \end{algorithm} \subsection{$l_1+l_2$ Regularization Algorithm and $l_0$ Regularization Algorithm} One possible improvement of algorithm \ref{alg:l1Quantization} will be to add a \textbf{negative $l_2$ penalization term} to the original. The optimization target could be denoted with the following formula: \begin{equation}\label{l1l2normReguliriseOpt} \min_{\boldsymbol{\alpha}} ||\boldsymbol{\hat{w}} -\boldsymbol{N_{p}}\boldsymbol{\alpha}||_{2}^{2} + \lambda_1 ||\boldsymbol{\alpha}||_{1} - \lambda_2 ||\boldsymbol{\alpha}||_{2}^{2} \end{equation} Equation \ref{l1l2normReguliriseOpt} is similar with Elastic Net\cite{zou2005ElasticNet}, but with a negative $l_2$ coefficient. The intuition behind this scheme is that $l_1$ optimization often leads to $\alpha$ values with small quantities before it could reach $0$. Thus, adding the 'negative $l_2$ norm' could be regarded as a relaxation for the original $l_1$ least square to find sparse index while keep the non-zero values on their original level. More formally, if we inspect the mathematical expressions under coordinate descent with shrinkage model, the LASSO optimization could be expressed as:\\ \begin{equation} \label{LassoCoordinateDescent} \alpha_{k}^{t+1} = S_{\frac{\lambda_{1}}{\boldsymbol{N_{p}}_{\cdot,k}^{T}\boldsymbol{N_{p}}_{\cdot,k}}}(\frac{\boldsymbol{N_{p}}_{\cdot,k}^{T}\boldsymbol{\hat{w}}-\boldsymbol{N_{p}}_{\cdot,k}^{T}\boldsymbol{N_{p}}_{\cdot,/k}\boldsymbol{\alpha}_{/k}^{t}}{\boldsymbol{N_{p}}_{\cdot,k}^{T}\boldsymbol{N_{p}}_{\cdot,k}}) \end{equation} Where $k$ denotes the coordinate to be optimized and $S_{a}(x)$ means the shrinkage operator generally used in $l_1$ optimization. In comparison, the Coordinate Descent for negative $l_2$ penalization will be:\\ \begin{equation} \label{l1l2CoordinateDescent} \alpha_{k}^{t+1} = S_{\frac{\lambda_{1}}{\boldsymbol{N_{p}}_{\cdot,k}^{T}\boldsymbol{N_{p}}_{\cdot,k}-2\lambda_2}}(\frac{\boldsymbol{N_{p}}_{\cdot,k}^{T}\boldsymbol{\hat{w}}-\boldsymbol{N_{p}}_{\cdot,k}^{T}\boldsymbol{N_{p}}_{\cdot,/k}\boldsymbol{\alpha}_{/k}^{t}}{\boldsymbol{N_{p}}_{\cdot,k}^{T}\boldsymbol{N_{p}}_{\cdot,k}-2\lambda_2}) \end{equation} Which means, for the $l_1 + l_2$ combined optimization, the proximal been projected will be larger as the denominator of will be subtracting a positive value. Also, the absolute value of the threshold to be shrinkaged as $0$ is higher, making the vector easier to achieve sparsity. There are rare, if any, integrated Lasso optimization packages that permits the parameter setting like equation \ref{l1l2normReguliriseOpt}. Thus, this algorithm is optimized by the coordinate descent method implemented by the authors. \par Another variation of the algorithm based on \ref{l1normReguliriseOpt} could be to replace the $l_1$ norm with $l_0$ norm. In the $l_0$ algorithm, instead of directly add a penalization term, we explicitly set limitations of the number of distinct values: \begin{equation}\label{l0normReguliriseOpt} \begin{aligned} & \underset{\boldsymbol{w}^{*}}{\text{min}} & & ||\boldsymbol{\hat{w}} -\delta\boldsymbol{N_{p}^{*}}\boldsymbol{\alpha}||_{2}^{2} \\ & \text{subject to} & & ||\boldsymbol{\alpha}||_{0} \leq l \\ \end{aligned} \end{equation} Where $l$ is a number that we manually set, which indicate the upper bound of the amount of distinct values. The optimization of $l_0$ norm is NP-hard \cite{L0NPhardPaper}, thus we could only be solve by heuristic-based algorithms up to now. In this paper we utilize the recent-proposed 'L0Learn' as mentioned above \cite{l0Learn2018Hazimeh}, and support the number of $l$ up to 100. However, one should notice that the $l_0$ optimization method is not universal, which means, it could not reach arbitrary required number of values under our settings. This is also the reason $l$ could only serve as a 'upper bound' of the quantization amounts. \subsection{Iterative Quantization with $l_1$ Regularization} One major drawback of algorithm \ref{alg:l1Quantization} and the improved $l_1 + l_2$-based algorithm is that they could not explicitly indicate the number of demanded distinct values (quantization amounts). To obtain an algorithm capable to explicitly specify amount of distinct values, an iterative method is designed. The paradigm of the algorithm is straightforward: it starts with a small $\lambda_1$ value and gradually improve the quantities of it, until the amount of non-zero values of the optimized $\boldsymbol{\alpha}$ could satisfy the conditions. Specifically, at each iteration, the algorithm will firstly follow the procedure of algorithm \ref{alg:l1Quantization} with current $\lambda_1$. After obtaining the optimized $\boldsymbol{\alpha}^{*}_{t}$ of the $t$-th iteration, it will be put back to the target function and the $\boldsymbol{\alpha}^{*}_{t+1}$ will be obtained with the algorithm \ref{alg:l1Quantization} at the $t+1$-th iteration.\par The iterative quantization method could be decribed as algorithm \ref{alg:l1QuantizationIterative}. \begin{algorithm} \caption{Quantization with Iterative $l_1$ Optimization}\label{alg:l1QuantizationIterative} \hspace*{\algorithmicindent} \textbf{Input: }\text{Original vector $\boldsymbol{w}$, Desired number of distinct value $l$} \\ \hspace*{\algorithmicindent} \textbf{Output: }\text{Quantized vector $\boldsymbol{w}^{*}$} \begin{algorithmic}[1] \State $\boldsymbol{\hat{w}} \gets \boldsymbol{o}(\boldsymbol{w})$ \State $\lambda_1^{0}$ with a small number \State $\Delta\lambda \gets \lambda_1^{0}$ \While{$||\boldsymbol{\alpha}||_{0}>l$} \State $\lambda_1^{t} = \lambda_1^{0} + (t-1)\Delta\lambda$ \State Optimize target function \ref{l1normReguliriseOpt} with Coordinate Descent, with $\lambda_1 \gets \lambda_1^{t}$, $\boldsymbol{\alpha}^{0}_{t} \gets \boldsymbol{\alpha}^{*}_{t-1}$ \State Retrieve $\boldsymbol{N_{p}}^{*}_{t}$ with equation \ref{NpStarRetrievalMethod} \State Compute $\boldsymbol{\hat{\alpha}}^{*}_{t}$ with equation \ref{PostLassoLeastSquareSolution} \State Compute $\boldsymbol{\alpha}^{*}_{t}$ vector with equation \ref{FinalAlphaComputation} \EndWhile \State Compute the desired $\boldsymbol{w}^{*}$ vector with equation \ref{QuantizedVectorComputing} and final $\boldsymbol{\alpha}^{*}_{T}$ \end{algorithmic} \end{algorithm} \subsection{Clustering-based Least Square Sparse Optimization} Algorithm \ref{alg:l1QuantizationIterative} could provide quantization results with given amount of distinct values $l$. However, since the algorithm could be sensitive to the change of $\lambda_1$, in practice it might fail to optimize to exact $l$ values but provide $\hat{l}<l$ values instead. Similarly, for the algorithm with equation \ref{l0normReguliriseOpt}, we could only set the upper bound of the amount of distinct values and there are no guarantees for how many distinct values will finally be produced. To further improve the capacity of quantization algorithm, here we discuss a general target that could produce definite amount of values with least square form, and design a basic method based on the combination of K-means clustering and least square optimization.\par Suppose we want to construct a vector with $l$ distinct values now, and here we directly set the parameter vector $\boldsymbol{\alpha}$ to a vector with $l$ entries ($[l \times 1]$ shape). And now we need to use a transformation matrix to transform the $l$-value vector into a $[m \times 1]$ vector while maintaining the values constructed. One possible scheme could be to use a $m \times p$ transformation matrix $\boldsymbol{E}$ with one-hot encoded at each row. Under this scheme, the optimization target will be as following: \begin{equation}\label{directOptmizationTarget} \begin{aligned} & \underset{\boldsymbol{E},\boldsymbol{\alpha}}{\text{min}} & & ||\boldsymbol{\hat{w}} -\boldsymbol{E}\boldsymbol{N_{p}^{*}}\boldsymbol{\alpha}||_{2}^{2} \\ & \text{subject to} & & ||\boldsymbol{E}_{i}||_0 = 1, \forall i = 1,2,...,m\\ &&& ||\boldsymbol{E}_{i}||_1= 1, \forall i = 1,2,...,m\\ \end{aligned} \end{equation} The constraint of $\boldsymbol{E}$ in equation \ref{directOptmizationTarget} means that for each row in the matrix, it will be 1 if we want the corresponding value to be belonging to this cluster; otherwise, it will 0. An alternative expression of the matrix will be:\\ \begin{equation} \label{EMatforCluster} \boldsymbol{E}_{ij} = \begin{cases} 1, & I(\boldsymbol{\hat{w}_{*}}) = j \\ 0, & \text{else} \end{cases} \end{equation} here $I(\hat{W}_i)$ means the group(cluster) which the $i$th value belongs to. The optimization would be difficult to perform with two optimization variables changing simultaneously. Here, we propose one simple method to deal with this problem: once could first use clustering methods (e.g. K-means) to obtain $I(\boldsymbol{\hat{w}}) = K(\boldsymbol{\hat{w}})$, and then we could get matrix $\boldsymbol{E}$. Then the target function could be further transferred into the following expression:\\ \begin{equation}\label{directOptmizationTargetCluster} \begin{aligned} &\min_{\boldsymbol{\alpha}} ||\boldsymbol{\hat{w}}-\boldsymbol{E}\boldsymbol{N_{p}^{*}}\boldsymbol{\alpha}||_{2}^{2}\\ =&\min_{\boldsymbol{\alpha}} ||\boldsymbol{\hat{w}}-\boldsymbol{\hat{N_{p}^{*}}}\boldsymbol{\alpha}||_{2}^{2} \end{aligned} \end{equation} And notice that since the 'index of non-zeros' of the algorithm is obtained through clustering, the rank of the $\boldsymbol{\hat{N_{p}^{*}}}$ is no longer a problem of concern. Hence, one could simply compute the value $v=\text{mean}(\boldsymbol{\hat{w}})$ to fill all of the non-zero entries. Based on the above settings, the matrix $\boldsymbol{\hat{N_{p}^{*}}}$ would be the follows:\\ $$ \boldsymbol{\hat{N_{p}^{*}}} = \begin{bmatrix} v & 0 & 0 & \cdots & 0\\ v & 0 & 0 & \cdots & 0\\ \cdots & \cdots & \cdots & \cdots & \cdots \\ v & 0 & 0 & \cdots & 0\\ v & v & 0 & \cdots & 0\\ \cdots & \cdots & \cdots & \cdots & \cdots \\ v & v & v & \cdots & v \end{bmatrix} $$ The optimization of equation \ref{directOptmizationTargetCluster} is a typical linear regression problem and could be solved in closed form with $O(l^{2}m+l^{3})$ time complexity or even faster with approximations \cite{dhillon2013LeastSquareApproximation}. By taking derivatives and set it to 0, we could obtain the solution:\\ \begin{equation}\label{clusteringExactQuantizationSolution} \boldsymbol{\alpha} = (\boldsymbol{\hat{N_{p}^{*}}}^{T}\boldsymbol{\hat{N_{p}^{*}}})^{-1}\boldsymbol{\hat{N_{p}^{*}}}^{T}\boldsymbol{\hat{w}_{*}} \end{equation} The algorithm of the clustering-based least square method could be given as algorithm \ref{alg:EaxctQuantizationLS}.One interesting point is, from the perspective of clustering methods, algorithm \ref{alg:EaxctQuantizationLS} could be viewed as an improvement of K-means clustering quantization. In conventional clustering-based quantization algorithm, the representation of a certain cluster of values is simply given as the mean of the cluster. In contrast, for the proposed algorithm, it alternatively compute the value of the cluster that produce the smallest least square distance from the original.\par Notice that there should exist multiple schemes to solve the optimization problem proposed by equation \ref{directOptmizationTarget}, and the method proposed here is only a basic solution. The exploration of solving this task could be our future research concentrations. \begin{algorithm} \caption{Quantization with K-means Based Least Square}\label{alg:EaxctQuantizationLS} \hspace*{\algorithmicindent} \textbf{Input: }\text{Original vector $\boldsymbol{w}$, Desired number of distinct value $l$} \\ \hspace*{\algorithmicindent} \textbf{Output: }\text{Quantized vector $\boldsymbol{w}^{*}$} \begin{algorithmic}[1] \State $\boldsymbol{\hat{w}} \gets \boldsymbol{o}(\boldsymbol{w})$ \State Perform K-means with $l$ clusters, get model $\boldsymbol{K^{*}(\cdot)}$ \State Apply $\boldsymbol{K^{*}(\boldsymbol{o}(\boldsymbol{w}))}$ to get the prediction of each data \State Fill the corresponding columns with 1 for matrix $\boldsymbol{E}$ according to equation \ref{EMatforCluster} \State Optimize $\boldsymbol{\alpha}$ according to equation \ref{directOptmizationTargetCluster}. The base value of $v$ could be $v = \text{mean}(\boldsymbol{\hat{w}})$ \State Compute the desired $\boldsymbol{w}^{*}$ vector with equation $\boldsymbol{w}^{*} = \boldsymbol{\hat{N_{p}^{*}}}\boldsymbol{\alpha}^{*}$ \end{algorithmic} \end{algorithm} \subsection{Time Complexity Analysis} As it has been mentioned above, the proposed algorithm might not outperform K means-based quantization method in some cases. However, the algorithm could provide exact and interpretable solutions without out-of-range values; furthermore, the computational time of the proposed method could be favorable. With block coordinate descent, the time complexity of convex $l_{1}$ Lasso regression would be $O(tmn)$, where $m$ and $n$ are the magnitude and number of dimensions of data, respectively, and $t$ is the number of iterations. Under the setting of algorithm \ref{alg:l1Quantization}, the complexity will be $O(tm^{2})$, where $t$ is the number of iterations and $m$ is the length of $\boldsymbol{\hat{w}}$. \cite{hong2017ConvergenceCoordinate} argues that the iteration of convergence could be sub-linear with $t \in O(1/\epsilon)$ for strongly convex situations, where $\epsilon$ is the error of the result. In practice, for the optimization of the proposed algorithm, optimum could usually be found in acceptable iterations.\par In contrast, the time complexity of K-mean algorithm would be $O(tkm^{2})$, where $t$ is the number of iterations; $k$ is the number of cluster centroids, which is also the desired number of distinct values; and $m$ is the length of $\boldsymbol{\hat{w}}$. The complexity growth linearly with respect to $k$, and this time complexity could be problematic for quantization of moderate to large number of distinct values. For instance, the requirement could be to quantize the bit-width to the nearest $2^k$ to reduce memory cost yet preserve most of the information. Consequently, in such cases, the proposed algorithm will be much favorable than existed K-means ones. \section{Experimental Results} To verify the rationality and effectiveness of the proposed methods, three types of data, namely neural network fully-connected layer weight matrix, MNIST image, and artificially generated data sampled from different distributions, are employed to obtain experimental results for illustrations and analysis. The performances are evaluated mostly based on quantization information loss and time-consumption. The information loss is denoted by $l_2$ loss between the original vector and the quantized vector for MNIST image and artificially-generated data, and by post-quantization recognition accuracy for the neural network test. Notice that in some certain scenarios, a high $l_2$ loss may not necessarily mean a deficient performance. For example, in image quantization, the $l_2$ loss could be dominated by few values far away from the original, and the image with higher $l_2$ loss might actually possess an overall more favorable quality. Thus, for the quantization of MNIST images, the post-quantization results are plotted as images in figure \ref{fig:MNISTcomparison} to assistant one to evaluate the performances from a human intuition. \par Another point to notice is that in the experiments of MNIST and artificially-generated data, the post-quantization outputs are processed by a 'hard-Sigmoid' function before they are utilized to compute the $l_2$ information loss. The 'hard-Sigmoid' function is denoted as follows: \begin{equation} H(x,a,b) = \begin{cases} a, & x\leq a\\ x, & a<x<b\\ b, & x\geq b \end{cases} \end{equation} Where $a$ and $b$ are the 'floor' and 'ceiling' of the range of values. The reason for this function to be implemented is that in many situations, the quantization results must lie in a certain range. For example, MNIST quantization values must be in $[0,1]$, otherwise it will not be recognized in practical image storage/displaying systems. Applying the function could avoid out-of-range values that might reduce the $l_2$ loss in a prohibited way. \par Major experiments in this section includes the comparison between k-means method, the proposed $l_1$ quantization method (equation \ref{l1normReguliriseOpt}), $l_1$ with least square method (algorithm \ref{alg:l1Quantization}), and clustering-based least square method (algorithm \ref{alg:EaxctQuantizationLS}). The performance comparison between sole $l_1$-based and $l_1 + l_2$-based quantization is examined with a different optimization program implemented by the authors. Furthermore, the performances of $l_0$-based optimization method (equation \ref{l0normReguliriseOpt}) is implemented and tested separately with the previously-mentioned $l_0$ optimization software\cite{l0Learn2018Hazimeh} written in R. The $l_1$ optimization and k-means-based methods are accomplished via Lasso and K-means in SK-learn\cite{scikit-learn}, respectively, and the codes are both optimized to the possible extent as far as the authors concern. Notice that since the iterative $l_1$ least square method in algorithm \ref{alg:l1QuantizationIterative} will in general provide results no difference with algorithm \ref{alg:l1Quantization} for the same number of quantization amounts, the performance of this algorithm is not tested in the experiment.\par Experimental results shows that in general, 1. The $l_1$-based quantization method will lead to a higher $l_2$ information loss comparing to k-means clustering, but the running time could be considerably reduced for medium-size data; 2. After applying least square to $l_1$-based sparse quantization method, the performance could be much more competitive and the information loss will be in the same level of k-means, while the running time is still significantly quicker than k-means; 3. The clustering-based least square method could perform slightly better than k-means, and it does not take significant longer running time; 4. the combined $l_1+\text{(negative) }l_2$ optimization could induce fewer distinct values(quantization amounts) with the same $\lambda_1$ of sole $l_1$ method, but the algorithm is sensitive with the value of $\lambda_2$; and finally, 5. $l_0$-based quantization method (under the optimization algorithm provided in \cite{l0Learn2018Hazimeh}) could provide good performance within acceptable running time, but it could not universally produce quantization results (some amounts of quantization amounts are irretrievable) and the optimization could fail under some circumstances (especially when the demanded quantization amount is large). \subsection{Neural Network Weight Matrix} To test the effectiveness of our methods on neural network quantization (which is also the original problem inspired this paper), a 5-layer $784-256-128-64-10$ fully-connected network for MNIST image recognition is introduced. The network is trained with stochastic gradient descent and the original accuracy on training and testing data are $98.86\%$ and $97.53\%$, respectively. In the experiments, the last layer ($64-10$) matrix is processed by the quantization method and the weights are replaced by the post-quantization matrix. Figure \ref{fig:NNAccuracyHolistic} illustrates the change of accuracy on training and testing data with respect to different number of quantization values (cluster numbers) for $l_1$, $l_1$ least square, k-means and cluster-based least square methods. In addition, the running time of each method is demonstrated in the figure. And since the accuracy of MNIST recognition is fairly robust against quantization, figure \ref{fig:NNAccuracyZoomingIn} further provides a figure zooming in the area that the accuracy starts to drop with a higher resolution of quantization amounts. \\ \begin{figure} \centering \includegraphics[width=0.9\textwidth]{NeuralNetworkQuantization.png} \caption{Post-quantization accuracy on training and testing data with respect to quantization amounts, and their running time. The x-axis for the plots stands for quantization amounts(number of quantization), and the y-axis stands for accuracy for the first two plots and time in seconds for the third plot.} \label{fig:NNAccuracyHolistic} \end{figure} \begin{figure} \centering \includegraphics[width=0.8\textwidth]{NeuralNetworkDecreaseComparison.png} \caption{Post-quantization accuracy on training and testing data with respect to quantization amounts, focusing on the area where accuracy drops significantly. The x-axis stands for number of clusters, the y-axis stands for accuracy.} \label{fig:NNAccuracyZoomingIn} \end{figure} From the figures it could be found out that the proposed sparse regression-based methods could provide competitive competitive performances for the last-layer quantization of the neural network. The pure $l_1$ sparse regression provides a slightly more deficient performance than others, but in most cases the deficiency is negligible. Also, comparing to the time-consuming k-means based methods, $l_1$ method could provide an alternative solution with much quicker running time. In addition, if the least square method is applied to optimize the $\boldsymbol{\alpha}$ of $l_1$ as algorithm \ref{alg:l1Quantization} does, the algorithm will be able to provide accuracy no less competitive than K-means method, while the running time will be remaining a low level. The clustering-based least square exact method could provide the overall optimal performance, especially in the area approaching to accuracy decrements. And the additional time consumed by the least square method is also negligible.\par Figure \ref{fig:NNQuantizationAlphaComparison} shows the $\boldsymbol{\alpha}$ values of the neural network last-layer quantization with different level of sparsity (quantization amounts). The full-column plot on the left is the weights solved by least square. It could be found that even for the least square solution without any additional regularization term, some of the values of $\boldsymbol{\alpha}$ could still hit the values around or equal to 0. The plots of the rest three columns represent the $\boldsymbol{\alpha}$ values of $l_1$ without least square, $l_1$ with least square and k-means based exact value methods, respectively. One would question why the clustering-based least square method, which is designed to possess dense $\boldsymbol{\alpha}$ vectors, could be plotted as sparse ones. The trick behind this plot is that the values of the dense vector could be assign to the starting point of each 'batch' of same-values, which will be equivalent to the effects of sparse $\boldsymbol{\alpha}$ in the sparse regression-based algorithms. From the figures, it could be observed that the $l_1$-based algorithms would mostly produce positive $\alpha_{i}$ values for quantization, while the clustering-based ones would have positive and negative ones in similar amounts. In addition, despite the differences between values of vectors, the 'zero area' produced by $l_1$-based and clustering-based methods are almost the same. \par \begin{figure} \centering \includegraphics[width=1.0\textwidth]{AlphaValuePlotNN.png} \caption{The distribution of $\boldsymbol{\alpha}$ weights for neural network last-layer quantization} \label{fig:NNQuantizationAlphaComparison} \end{figure} Moreover, to illustrate the effects of replacing $l_1$ with $l_1 + \text{(negative) }l_2$ optimization, the performance of $l_1$ and $l_1 + l_2$ optimization on the last-layer neural network data is illustrated in figure \ref{fig:NNQuantizationl1l2Comparison} with a coordinate descent optimization method implemented separately. Neither of the $\boldsymbol{\alpha}$ weights in the illustrated plots is optimized with least square. From the figure it could be observed that the $l_1+l_2$ method could in general lead to fewer quantization amounts for the same $\lambda_1$ value, while produce a smaller $l_2$ loss comparing to the original. The experimental result also verifies the argument in section 3.3. However, despite the favorable performance, the algorithm could be sensitive to the value of $\lambda_2$, and it could be numerically very unstable if the value of $\lambda_2$ is too large or too small. To improve the tolerance of $\lambda_2$ in this algorithm could be a point of exploration in the future. \par \begin{figure} \centering \includegraphics[width=0.8\textwidth]{l1l2QuantizationComparison.png} \caption{The accuracy with respect to $\lambda_1$ values for sole $l_1$ and $l_1+l_2$ optimization, respectively. The value of $\lambda_2$ is set to $\lambda_2 = -4*10^{-3}*\lambda_1$.} \label{fig:NNQuantizationl1l2Comparison} \end{figure} And finally, as for the $l_0$ quantization method, it could not find an non-trivial solution under the optimization method of \cite{l0Learn2018Hazimeh}, which indicated the drawbacks of numerical unreliability of $l_0$-based method. \subsection{MNIST Image Quantization} Vector quantization could be used in image processing to reduce the number of values and save storage cost. In this paper, a MNIST-digit image is chosen as an example to show the performance of image quantization of the proposed methods. The performances of two types of $l_1$-based algorithms and two kinds of clustering-based methods are illustrated and compared in figure \ref{fig:MNISTcomparison}. From the figure we could find out that K-means and the clustering-based least square optimization could provide best performances in general, and there is no significant differences in execution time. $l_1$ with least square optimization of $\boldsymbol{\alpha}$ values could provide less norm difference loss than using $l_1$ solely. Meanwhile, in terms of running time, the $l_1$-based optimization approaches could provide significant advantages over k-means-based methods. Another remark of the MNIST quantization is that the k--means methods sometime provide out-of-range values (not in the interval $[0,1]$) when the number of clusters are large, and the reason could be attributed to bad initialization. However, for the least-square optimization methods, this problem does not happen at least in the MNIST circumstance.\par \begin{figure} \centering \includegraphics[width=0.9\textwidth]{MNIST_comparison.png} \caption{MNIST quantization comparison for $l_1$ method, $l_2$ and least square method, K-means method, K-means-based least square method} \label{fig:MNISTcomparison} \end{figure} \begin{figure}[t] \centering \includegraphics[width=0.8\textwidth]{MNIST_comparison_l0.png} \caption{MNIST quantization results for $l_0$} \label{fig:MNISTL0Result} \end{figure} The quantization result of $l_0$ method is shown separately in figure \ref{fig:MNISTL0Result}. It could be observed from the figure that the qualities of images are in general high and the $l_2$ loss is competitive. However, the problem of 'not universal' is also very significant from the figures: in many cases, the algorithm could only find the largest possible quantization amounts smaller than the given value. In addition, the algorithm often fail to find solution when the required quantization amount is large. \subsection{Artificially-Generated Data} To test the performance of the proposed algorithms on data of different distributions, three types of distributions, namely Mixture of Gaussian, Uniform and Single Gaussian, are employed to generate 500 samples from each of them. The samples are constrained in the range of $[0,100]$, and the distributions of the data we used could be shown as figure \ref{fig:ArtificialDataIllustration}. In practice, these three types of quantization could include most cases of data distribution.\\ \begin{figure} \centering \includegraphics[width=0.8\textwidth]{DistributionOfGeneratedData.png} \caption{The distribution of the 3 types of artificially-generated data} \label{fig:ArtificialDataIllustration} \end{figure} The experimental results for different quantization methods based on the above 3 types of data is shown in figure \ref{fig:PerformanceartificalGeneratedData}. From the figure, it could be observed that the information loss deficiency of $l_1$ without least square is more significant comparing to those for neural network and MNIST image. However, considering the running time reduced by the algorithm, the overall performance could still be regarded as merited. Also, if least square is employed to optimize the values of the vector, the information loss of $l_1$ approach will be only slightly higher than k-means based methods optimization, while the run-time will be still of great advantage comparing to the k-means branch of methods.\\ \begin{figure} \centering \includegraphics[width=1.0\textwidth]{Artifically_generated_data_results.jpg} \caption{Quantization results of artificially-generated data. For each subplot, the left is the norm loss figure, and the right one is the running time. The x-axis stands for clusters, and the y-axis stands for l2 loss for the left figures, and for time in seconds for the right ones.} \label{fig:PerformanceartificalGeneratedData} \end{figure} And finally, for the $l_0$ quantization method, again in the experiments it could not provide meaningful results for the quantization of the artificially-generated data. This problem further demonstrates the issue of using $l_0$ optimization despite its favourable information loss: the optimization of $l_0$ is NP-hard and with approximation algorithms, there could be a risk of failure in getting the results. \section{Conclusion} This paper proposed several least square form-based algorithms to better accomplish the task of vector quantization. The characteristics and computational properties of the proposed algorithms are examined, and the advantages, drawbacks, and the advantageous scenarios of each of them are analyzed. The algorithms are implemented and tested under the scenarios of neural network weight, MNIST image and artificially-generated data respectively, and the results are demonstrated and analyzed. Experimental results shows that the proposed algorithms have competitive performances in terms of information loss/preservation, and the favourable properties in running time could make the $l_1$-based algorithms especially useful when processing large batch of medium-size data and the number of post-quantization values are not in a micro scale. \par The paper made following major contributions: Firstly, it proposed several novel quantization methods with competitive information preservation ability and much more favorable time complexity, and the results provided by the $l_1$-based algorithms are more exact comparing to those of k-means; Secondly, the paper innovated the pioneering work of using least square optimization to solve quantization, and it could bring huge research potentials in the area; And thirdly, the algorithms proposed in the paper could provide better options in practice, especially when the requirement is to perform quantization to restrict the number of distinct values to a certain level, which usually could be large. \par In the future, the authors intend to continue to explore quantization algorithms with the idea demonstrated in the paper. We intend to research on finding better optimization methods, revisions of target functions and extend the quantization method into high-dimensional situations. \section{Acknowledgement} The authors would like to thank Mr. Feng Chen and Mr. Shixiong Wang from Northwestern Polytechnical University, China. Mr. Chen and Mr. Wang provided the authors many useful comments for the algorithms and programs of the research. \section{Declaration of interest} The authors declare no conflicts of interest. \clearpage \bibliographystyle{model1-num-names}
{'timestamp': '2018-09-25T02:25:12', 'yymm': '1803', 'arxiv_id': '1803.00204', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00204'}
arxiv
\section{Introduction}\label{intro} An $n$-dimensional hypercube ($n$-cube), denoted by $Q_n$, is an undirected graph with $2^n$ vertices each labeled with a distinct binary string of length $n$. We shall identify the vertices of $Q_n$ with integers in $\{0,\dots, 2^n-1\}$ in the usual way, see Fig.~\ref{figC4}. \begin{figure}[htb] \centering \includegraphics{figC4.eps} \caption{The hypercube $Q_3$ with a Hamiltonian cycle.} \label{figC4} \end{figure} Two vertices are connected by an edge if and only if their labels differ in one bit. The hypercube is one of the most popular interconnecting networks. It has several excellent properties such as: recursive structure, symmetry, small diameter, low degree and easy routing algorithm, which are important when designing parallel or distributed systems. The hypercube $Q_n$ is bipartite, the set of nodes is the union of two sets: nodes of parity 0 (the number of ones in their labels is even), and nodes of parity 1 (the number of ones is odd), and each edge connects nodes of different parity. The hypercube is Hamiltonian, i.e. it contains a cycle which visits each node in the cube exactly once, see Fig.~\ref{figC4}. An important property of the hypercube is its fault tolerance. It contains Hamiltonian cycles even if some edges or vertices are faulty. In this paper we consider Hamiltonian cycles in hypercube $Q_n$ with faulty edges (we shall denote the set of faulty edges by $F$). For $n\le 2$, the problem is trivial, so in the sequel we assume that $n\ge3$. It is obvious that if the cube with the set of faulty edges $F$ is not Hamiltonian, then also the cube with the set of faulty edges $G$ is not Hamiltonian, if $F\subset G$. We say that the set $F$ is minimal if no proper subset of $F$ precludes Hamiltonian cycles; and the cube with a set of faulty edges $F$ is minimal if $F$ is minimal. Tsai et al.~\cite{3} showed that if there are no more than $n-2$ faulty edges in the hypercube $Q_n$, then it contains a Hamiltonian cycle. The hypercube $Q_n$ is $n$-regular, so it is not Hamiltonian if it contains a vertex with incident $n-1$ faulty edges. We shall call such a set of faulty edges a local trap. In \cite{4} Xu et al. proposed, so called, conditional fault model, where each vertex is incident with at least two healthy edges. Under this model, they showed that with $n-1$ faulty edges the cube is still Hamiltonian. Chan and Lee~\cite{1} showed that also with $|F|\le 2n-5$ faulty edges $Q_n$ is Hamiltonian. Shih et al.~\cite{2} observed that the bound $2n-5$ is optimal, because with $2n-4$ faulty edges it is possible to build another kind of local trap, namely a (healthy) cycle $(u,v,w,x)$, where all edges going out of the cycle from $u$ and $w$ are faulty. This kind of trap is called $f_4$-cycle in~\cite{Li}. Szepietowski~\cite{Sz} observed that these two kinds of traps are examples of a more general scheme, namely subgraphs disconnected halfway. \begin{df}\label{defdhw} A proper subgraph $T\subset Q_n$ is disconnected halfway if either (1) at least half of the nodes of $T$ have parity 0 and the edges joining all nodes of parity 0 in $T$ with nodes outside $T$, are faulty, or (2) at least half of the nodes of $T$ have parity 1 and the edges joining all nodes of parity 1 in $T$ with nodes outside $T$, are faulty. \end{df} There is a different definition of a set disconnected halfway in \cite{Sz}, where exactly half of the nodes have parity 0. In Section~\ref{dhw} we shall show that if the trap is minimal then half of the nodes in $T$ have parity 0. Since we are mainly interested in minimal traps, these definitions are equivalent. We identify a set $T$ of vertices with the subgraph induced by the set. We shall say that two sets $T_1$ and $T_2$ are isomorphic if there is an automorphism of $Q_n$ which maps $T_1$ onto $T_2$. Similarly, we shall say that two sets of faulty edges $F_1$ and $F_2$ are isomorphic if there is an automorphism of $Q_n$ which maps $F_1$ onto $F_2$. \begin{lem}\label{lem2}[see \cite{Sz}] The cube $Q_n$ is not Hamiltonian if it has a trap disconnected halfway. \end{lem} \noindent{\bf Proof.} Any cycle which does not visit any node twice, when visiting $T$ enters and leaves it in nodes of parity 1, so during one visit it goes through $i$ nodes of parity 0 and $i+1$ nodes of parity 1, for some $i$. Hence, the cycle cannot visit all nodes.\hfill $\Box$ Observe that one node with $n-1$ faulty incident edges forms with its neighbor a subcube of dimension 1 disconnected halfway. We shall call it the cube $Q_1$ disconnected halfway, and denote by $Q_1$-DHW. If $T$ is the cycle $C_4=(u,v,w,x)$ (subcube of dimension 2), then we obtain the trap described in \cite{2} and mentioned above. We shall call it the cube $Q_2$ disconnected halfway, and denote by $Q_2$-DHW. Similarly, with $4(n-3)$ faulty edges we can disconnect halfway the 3-dimensional subcube $Q_3$ and with $8(n-4)$ faulty edges the 4-dimensional subcube $Q_4$. We shall denote these traps by $Q_3$-DHW and $Q_4$-DHW respectively. Table~\ref{tab2} contains the numbers of faulty edges $|F|$ needed to build in $Q_n$ traps based on sets disconnected halfway $T$, for $|T|\le 6$, and $3\le n\le 7$. Szepietowski~\cite{Sz} proved that the cube $Q_n$ with $n\ge5$ and with $2n-4$ faulty edges is not Hamiltonian only if it contains a $Q_1$-DHW or $Q_2$-DHW trap. Liu and Wang \cite{Liu} showed that the same is true for hypercubes with $3n-8$ faulty edges. The bound $3n-8$ is sharp, because with $3n-7$ faulty edges it is possible to build another kind of local trap, namely a (healthy) cycle $(u,v,w,x,y,z)$, where all edges going out of the cycle from $u$, $w$, and $y$ are faulty, see \cite{Li,Liu,Sz}. We shall call this trap a $C_6$-DHW trap. Recently Li et al.~\cite{Li} proved that with $n\ge 6$ and with $3n-7$ faulty edges $Q_n$ is not Hamiltonian only if it contains a $Q_1$-DHW, $Q_2$-DHW, or $C_6$-DHW trap. In \cite{Sz}, another kind of trap was described which is not a set disconnected halfway. Consider the cube $Q_3$ with three faulty edges as shown in Fig.~\ref{figCLtrap}. \begin{figure}[htb] \centering \includegraphics{figCLtrap.eps} \caption{The CL trap in $Q_3$.} \label{figCLtrap} \end{figure} The node $u$ has three neighbors $v$, $w$ and $x$, each of degree 2, i.e. with only two healthy incident edges. The cube is not Hamiltonian. Otherwise the Hamiltonian cycle going through $v$, $w$ and $x$ must use edges $(u,v)$, $(u,w)$ and $(u,x)$ which is impossible. Similar traps we can build for $n\ge5$. We only need three healthy edges $(u,v)$, $(u,w)$ and $(u,x)$, where $v$, $w$, and $x$ are of degree 2 in $Q_n-F$. In this way we obtain traps with $3(n-2)=3n-6$ faulty edges. We shall call them CL (claw) traps. Table~\ref{tab1} presents the upper bounds mentioned above, for n-cubes with $3\le n\le7$, and information about Hamiltonian cycles. \begin{table} \centering \begin{threeparttable} \begin{tabular}{c||p{1cm}|p{1cm}|p{1cm}|p{1cm}|p{2cm}||c} $|F|$ & \multicolumn{5}{c||}{dimension} & ref\\ & $3$ & $4$ & $5$ & $6$ & $7$ & \\ \hline \hline $\leq n-2$ & $1$ & $2$ & $3$ & $4$ & $5$ & \cite{3}\\ & \multicolumn{5}{p{8.71cm}||}{\cellcolor{gray!25} \centering cube is Hamiltonian} & \\ \hline $\leq 2n-5$ & $1$ & $3$ & $5$ & $7$ & $9$ & \cite{1}\\ & \tnote{*} & \multicolumn{4}{p{7.27cm}||}{\cellcolor{gray!25} \centering cube is Hamiltonian provided it contains no $Q_1$-DHW} & \\ \hline $\leq 3n-8$ & $1$ & $4$ & $7$ & $10$ & $13$ & \cite{Liu}\\ & \tnote{*} & \tnote{**} & \multicolumn{3}{p{5.84cm}||}{\cellcolor{gray!25} \centering cube is Hamiltonian provided it contains neither $Q_1-$DHW, nor $Q_2$-DHW} & \\ \hline $= 3n-7$ & $2$ & $5$ & $8$ & $11$ & $14$ & \cite{Li}\\ & \tnote{***} & \tnote{****} & \tnote{*****} & \multicolumn{2}{p{4.4cm}||}{\cellcolor{gray!25} \centering cube is Hamiltonian provided it contains neither $Q_1-$DHW, nor $Q_2$-DHW, nor $C_6$-DHW} & \\ \end{tabular} \begin{tablenotes} \item[*] $Q_3$ with $|F|\leq 1$ faulty edges is Hamiltonian \item[**] $Q_4$ with $|F|\leq 4$ is Hamiltonian provided it contains neither $Q_1$-DHW, nor $Q_2$-DHW, nor $Q_3$-DHW \item[***] $Q_3$ with $|F|\leq 2$ is Hamiltonian provided it contains no $Q_1$-DHW \item[****] $Q_4$ with $|F|\leq 5$ is Hamiltonian provided it contains neither $Q_1$-DHW, nor $Q_2$-DHW, nor $Q_3$-DHW, nor $C_6^1$-DHW. See Section~\ref{Q4}. \item[*****] $Q_5$ with $|F|\leq 8$ is Hamiltonian provided it contains neither $Q_1$-DHW, nor $Q_2$-DHW, nor $Q_3$-DHW, nor $Q_4$-DHW, nor $C_6^1$-DHW. See Section~\ref{Q5}. \end{tablenotes} \caption{The upper bounds described in~\cite{3,1,Liu,Li}, on the number of faulty edges, for $3\leq n \leq 7$} \label{tab1} \end{threeparttable} \end{table} Each of the trap mentioned above consists of small collection of faulty edges which is easy to detect. In this paper we consider other traps of this kind. In Sections~\ref{dhw}--\ref{C8} we concentrate on small sets disconnected halfway. In Section~\ref{dhw} we show that if $|T|\le 8$ then we can consider only subcubes $Q_1$, $Q_2$, $Q_3$ and cycles of length 6 and 8, because if $T$ is minimal and $|T|\le8$ then it is $Q_1$ or contains a cycle $C_4$, $C_6$, $C_8$, or contains a CL-trap. In Section~\ref{SecC6} we consider traps disconnected halfway where the subgraph $T$ is a cycle of length six. We show that two nonisomorphic traps can be build in this way. We shall denote them by $C_6^1$-DHW and $C_6^2$-DHW. As we have already mentioned, $C_6^1$-DHW is described in \cite{Li,Liu,Sz}. In Section~\ref{C8} we consider traps disconnected halfway where the subgraph $T$ is a cycle of length eight. There are seven nonisomorphic cycles of length 8 and nine nonisomorphic traps can be build by cutting off their vertices. We shall denote them by $C_8$-DHW traps. Tables~\ref{tab2} and ~\ref{tab3} present all traps disconnected halfway with $|T|\le8$ \begin{table} \centering \begin{threeparttable} \begin{tabular}{c||c||c|c|c|c|c||c} trap & $|F|$ & \multicolumn{5}{|c||}{dimension} & figure\\ & & $3$ & $4$ & $5$ & $6$ & $7$ & \\ \hline \hline $Q_1$-DHW & $n-1$ & $2$ & $3$ & $4$ & $5$ & $6$ & \\ $Q_2$-DHW & $2n-4$ & $2$ & $4$ & $6$ & $8$ & $10$ & \\ $Q_3$-DHW & $4n-12$ & --- & $4$ & $8$ & $12$ & $16$ & \\ $Q_4$-DHW & $8n-32$ & --- & --- & $8$ & $16$ & $24$ & \\ \hline $C_6^1$-DHW & $3n-7$ & {\tiny not minimal} & $5$ & $8$ & $11$ & $14$ & Fig.~\ref{figC6c1trap}\\ $C_6^2$-DHW & $3n-6$ & {\tiny not minimal} & {\tiny not minimal} & $9$ & $12$ & $15$ & Fig.~\ref{figC6c2trap}\\ $CL$ & $3n-6$ & 3 & $6$ & $9$ & $12$ & $15$ & Fig.~\ref{figCLtrap}\\ \end{tabular} \caption{The numbers of faulty edges $|F|$ needed to build in $Q_n$ traps based on sets disconnected halfway $T$, for $|T|\le 6$, and $3\le n\le 7$. In all these cases, except CL trap, two traps: one obtained by cuting off vertices with parity 0, and the other obtained by cuting off vertices with parity 1 are isomorphic. } \label{tab2} \end{threeparttable} \end{table} \begin{table} \centering \begin{threeparttable} \begin{tabular}{p{2cm}||c||c|c|c|c||c} trap & $|F|$ & \multicolumn{4}{|c||}{dimension} & figure\\ & & $4$ & $5$ & $6$ & $7$ & \\ \hline \hline $C_8^1$-DHW \tnote{****} & $4n-12$ & $4$ & $8$ & $12$ & $16$ & \\ $C_8^2$-DHW \tnote{***} & $4n-9$ & {\tiny not minimal} & $11$ & $15$ & $19$ & Fig.~\ref{figC8c2trap}\\ $C_8^3$-DHW \tnote{***} & $4n-10$ & $6$ & $10$ & $14$ & $18$ & Fig.~\ref{figC8c3trap} \\ $C_8^4$-DHW \tnote{***} & $4n-10$ & $6$ & $10$ & $14$ & $18$ & Fig.~\ref{figC8c4trap}\\ $C_8^5$-DHW \tnote{***} & $4n-8$ & $8$ & $12$ & $16$ & $20$ & Fig.~\ref{figC8c5trap}\\ $C_8^6$-DHW \tnote{*} & $4n-8$ & {\tiny not minimal} & $12$ & $16$ & $20$ & Fig.~\ref{figC8c6trap}\\ $C_8^6$-DHW \tnote{**} & $4n-8$ & {\tiny not minimal} & $12$ & $16$ & $20$ & \\ $C_8^7$-DHW \tnote{*} & $4n-8$ & {\tiny not minimal} & {\tiny not minimal} & $16$ & $20$ & Fig.~\ref{figC8c7trap}\\ $C_8^7$-DHW \tnote{**} & $4n-8$ & {\tiny not minimal} & $12$ & $16$ & $20$ & \\ \end{tabular} \begin{tablenotes} \item[*] we cut off vertices with parity 0, \item[**] we cut off vertices with parity 1, \item[***] Two traps: one obtained by cutting off vertices with parity 0, and the other obtained by cutting off vertices with parity 1 are isomorphic, \item[****] The cycle $C_8^1$ is the subcube $Q_3$. Hence $C_8^1$-DHW is $Q_3$-DHW. \end{tablenotes} \caption{The numbers of faulty edges $|F|$ needed to build in $Q_n$ traps based on cycles of length 8 disconnected halfway, for $4\le n\le 7$.} \label{tab3} \end{threeparttable} \end{table} In Section~\ref{H} we discuss the problem whether there exist small sets of faulty edges which preclude Hamiltonian cycles and are not based on sets disconnected halfway. First examples of such traps are CL traps, where we have three vertices of degree 2 with a common neighbour. In Section~\ref{H} we describe heuristic which detects sets of faulty edges which preclude Hamiltonian cycle. The heuristic is not perfect. There are $Q_4$ cubes with 8 or more faulty edges that are not Hamiltonian, do not contain any traps of the kinds described above, and cannot be detected by the heuristic. In the second part of the paper we concentrate on nonhamiltonian cubes $Q_n$ with $n\le5$. In $Q_3$ there is, up to isomorphism, only one Hamiltonian cycle, see Fig.~\ref{figC4}. It is easy to check that $Q_3$ is not Hamiltonian only if it contains a $Q_1$-DHW, $Q_2$-DHW, or CL trap, see \cite{Sz}. In Section~\ref{Q4} we describe all nonhamiltonian $Q_4$ cubes. Nonhamiltonian $Q_4$ cubes with no more than four faulty edges are described in ~\cite{3,4,Sz}. Using computer we found that: the cube $Q_4$ with 5 faulty edges is not Hamiltonian only if it contains a $Q_1$-DHW, $Q_2$-DHW, $Q_3$-DHW, or $C_6^1$-DHW trap, and with 6 faulty edges $Q_4$ is not Hamiltonian only if it contains a $CL$, $Q_1$-DHW, $Q_2$-DHW, $Q_3$-DHW, $C_6^1$-DHW, $C_8^3$-DHW, or $C_8^4$-DHW trap. There are 25 nonisomorphic $Q_4$ cubes with 7 faulty edges that are not Hamiltonian and do not contain any traps of the kinds described above. All these cubes can be recognized by the heuristic described in Section~\ref{H}. There are $Q_4$ cubes with 8 or more faulty edges that are neither Hamiltonian, nor contain any traps of the kinds described above, nor can be detected by the heuristic. We present them in Appendix. In Section~\ref{Q5} we describe nonhamiltonian $Q_5$ cubes. Nonhamiltonian $Q_5$ cubes with no more than seven faulty edges are described in ~\cite{3,4,Sz,Liu}. Using computer we found that: \begin{itemize} \item with 8 faulty edges $Q_5$ is not Hamiltonian only if it contains a $Q_1$-DHW, $Q_2$-DHW, $Q_3$-DHW, $Q_4$-DHW, or $C_6$-DHW trap, \item with 9 faulty edges $Q_4$ is not Hamiltonian only if it contains a $Q_1$-DHW, $Q_2$-DHW, $Q_3$-DHW, $Q_4$-DHW, $C_6^1$-DHW, $C_6^2$-DHW, or $CL$ trap. \end{itemize} We are not able to give full description of the $Q_5$ cubes with ten faulty edges that are not Hamiltonian. With ten faulty edges we can build a trap disconnected halfway with a cycle of length 8. At the end of Section~\ref{Q5} we show that with ten faulty edges we can build in $Q_5$ three other types of traps disconnected halfway. \section{Preliminaries}\label{pre} An $n$-dimensional hypercube (cube), denoted by $Q_n$, is an undirected graph with $2^n$ nodes, each labeled with a distinct binary string $b_{n-1}\dots b_1b_0$, where $b_i\in\{0,1\}$. A vertex $x=b_{n-1}\dots b_i\dots b_0$ and the vertex $x^{(i)}=b_{n-1}\dots \bar{b_i}\dots b_0$ are connected by an edge along dimension $i$, where $\bar{b_i}$ is the negation of $b_i$. The hypercube $Q_n$ is bipartite, the set of nodes is the union of two sets: nodes of parity 0 (the number of ones in their labels is even), and nodes of parity 1 (the number of ones is odd), and each edge connects nodes of different parity. There are two kinds of symmetries in $Q_n$. Firstly, for each vertex $v=v_{n-1}\dots v_0$, there is an automorphism $h_v$ of $Q_n$ defined by $h_v(x)= x\, \oplus \, v$ more precisely, $h_v(x_{n-1}\dots x_0)=w_{n-1}\dots w_0$, where $w_i=x_i+v_i\bmod 2$, for every $i$ satisfying: $0\le i\le n-1$. The second kind of automorphism permutes dimensions. More precisely, for every permutation $\pi$ acting on $\{0,\dots,n-1\}$, there is an automorphism $g_{\pi}$ of $Q_n$ defined by the rule $g_{\pi}(x_{n-1}\dots x_0)=x_{\pi(n-1)}\dots x_{\pi(0)}$. Each automorphism of $Q_n$ is a composition of two automorphisms of the kinds described above~\cite{Chen}. For $i\in\{0,\dots ,n-1\}$, the $i$-partition of $Q_n$ (or partition along the $i$-th dimension) is the partition into two disjoint $(n-1)$-subcubes $Q^L_{n-1}=\{x\in Q_n\mid x_i=0\}$ and $Q^R_{n-1}=\{x\in Q_n\mid x_i=1\}$. We shall also write that the cube $Q_n$ is decomposed into two subcubes $Q^L_{n-1}$ and $Q^R_{n-1}$ along the $i$-th dimension, or simply into $Q^L$ and $Q^R$. Let $D_i$ denote the set of edges of dimension $i$. These are edges between $Q^L$ and $Q^R$ and they are called crossing edges. We shall say that a crossing edge $(u,u^{(i)})$, with $u\in Q^L$ is even if the vertex $u$ is of parity 0, and is odd, if $u$ is of parity 1. \begin{lem}\label{cycle} Consider a cycle $C= (v_0,\dots, v_{2k-1})$ of length $2k$ in $Q_n$. Let $(e_1, \dots, e_{2k})$ be the sequence of edges in $C$, where $e_j=(v_{j-1},v_j)$, for every $1\le j \le 2k-1$, and $e_{2k}=(v_{2k-1}, v_0)$. Let $(d_1, \dots, d_{2k})$ be the sequence of dimensions of the edges in $C$, with $d_j$ being the dimension of $e_j$. Then: (1) No two incident edges go in the same dimension. (2) Each dimension $i\in \{0,\dots ,n-1\}$ appears in $C$ an even number of times. Hence, there are at most $k$ different dimensions in $C$. (3) The cycle $C$ is a subset of a subcube of dimension $k$. More precisely, there is an automorphism of $Q_n$ mapping the cycle into the subcube $\{x\mid 0\le x<2^k\}$. (5) If $C$ has no edges in dimension $i$, then $C$ is contained either in $Q^L_{n-1}$ or in $Q^R_{n-1}$, where $Q^L_{n-1}$ and $Q^R_{n-1}$ are formed after partition of $Q_n$ along the $i$-th dimension. \end{lem} Note that two cycles with the same sequence of dimensions are isomorphic, i.e. there is an automorphism of $Q_n$ that maps the first cycle onto the other. \begin{lem}\label{cycle2} Suppose that we have a Hamiltonian cycle $C$ and partition of $Q_n$ along dimension $i$, and let $e_1$, $e_2$, ... ,$e_s$ are all crossing edges that belong to $C$. Then: $s$ is even, $s>0$, and the set of edges is balanced, i.e. half of these edges are even and the other half are odd. \end{lem} \noindent{\bf Proof:} From Lemma~\ref{cycle} it follows that $s$ is even and positive. Suppose that, for each $i$, $1\le i\le s$, we have $e_i=(u_i,v_i)$ with $u_i\in Q^L$. Vertices $u_1$, $u_2$, ... ,$u_s$ are connected in $Q^L$ by fragments of $C$. We may assume that, there are paths $P_1$, $P_3$, ... ,$P_{s\over2}$, such that $P_i$ connects $u_{2i-1}$ with $u_{2i}$, for each $i$, such that $1\le i \le {s\over2}$. These paths are disjoint and they cover the whole $Q^L$. Hence, by \cite{caha}, their ends are balanced, half of them have parity one and the other half parity zero. \hfill $\Box$ \section{Traps disconnected halfway}\label{dhw} Suppose that $T$ is a proper subset of the set of vertices in $Q_n$. We identify the set with the subgraph induced by $T$. Let $|T|_0$ denote the number of nodes with parity 0 in $T$ and $|T|_1$ denote the number of nodes with parity 1 in $T$. The set $T$ is balanced if $|T|_0=|T|_1$ . By Definition~\ref{defdhw}, the set $T$ is disconnected halfway if either (1) $|T|_0\ge|T|_1$ and the edges joining all nodes of parity 0 in $T$ with nodes outside $T$, are faulty, or (2) $|T|_0\le|T|_1$ and the edges joining all nodes of parity 1 in $T$ with nodes outside $T$, are faulty. By Lemma~\ref{lem2}, the cube $Q_n$, is not Hamiltonian if it contains a trap $T$ disconnected halfway. In this section we only consider the first kind of traps. By symmetry, all considerations will apply to the second kind of traps. Let $F$ be the set of faulty edges in $Q_n$ and $T$ be a set disconnected halfway, with $|T|_0 \ge|T|_1$. If $|T|=1$, then the trap is not minimal. If $|T|=2$ and $T$ is connected and balanced, then we have $Q_1$-DHW, otherwise the trap is not minimal. In the rest of this section we shall only consider traps with $|T|\ge3$. \begin{lem}\label{L1} Let $F$ be a set of faulty edges in $Q_n$ and $T$ be a set disconnected halfway, where $|T|\ge3$, the edges joining all nodes of parity 0 in $T$ with nodes outside $T$, are faulty, and $|T|_0 \ge|T|_1$. \begin{enumerate} \item If there are two vertices $u,v\in T$ such that $(u,v)\in F$, then $F$ is not minimal. \item If $|T|_0 >|T|_1$, then $F$ is not minimal. \item If $T$ is not connected then $F$ is not minimal. \item If $T$ has a pendant vertex $v$ (of degree 1), then $F$ is not minimal or there is a proper subset $T'\subset T$ which is disconnected halfway with the same set of faulty edges $F$. \item Suppose that there is a partition of $T$ into two connected and balanced subsets $T_1$ and $T_2$ and two vertices $v_1\in T_1$ and $v_2\in T_2$, such that $(v_1,v_2)$ is an edge, and every path in $T$ going from $v_1$ to $v_2$ contains the edge $(v_1,v_2)$. Then $F$ is not minimal. In such a case we shall say that $(v_1,v_2)$ is a bridge between two balanced subsets. \end{enumerate} \end{lem} \noindent{\bf Proof.} (1) $T$ is DHW with the set of faulty edges $F-\{(u,v)\}$. In the rest of the proof we assume that there are no faulty edges between two nodes in $T$. (2) Let $x\in T$ be of parity 0 with incident faulty edges. Remove from $F$ all edges incident to $x$. Now, $T-\{x\}$ is DHW. In the rest of the proof we assume that $|T|_0=|T|_1$. (3) One of the component is a trap DHW. (4) Let $v_0\in T$ be a neighbor of $v$. If $v$ is of parity 0, then $v$ and $v_0$ form a $Q_1$-DHW. If $v$ is of parity 1 ($v_0$ is of parity 0), then add the edge $(v_0,v)$ to $F$. Now $T-\{v\}$ is a trap DHW. By the proof of (2), we can remove $v_0$ from $T$ and all faulty edges incident to $v_0$ from $F$. Note that at the end the edge $(v_0,v)$ is not in $F$ . (5) We may assume that neither $v_1$ nor $v_2$ is pendant. One of the two vertices, say $v_2$, is of parity 1, and the edge $(v_1,v_2)$ is the only edge between $T_1$ and $T_2$. These mean that $T_2$ is DHW. \hfill $\Box$ \bigbreak In the sequel we will only consider minimal cubes. Hence, we can assume that the set $T$ is connected, balanced (so with $|T|$ even), without pendant vertices and bridges between balanced subsets. \begin{lem} Let $Q_n$ be a minimal cube with a set $T$ disconnected halfway, and no proper subset of $T$ is disconnected halfway with the same set of faulty edges. Then \begin{enumerate} \item For $|T|=4$, we have a trap $Q_2$.-DHW. \item For $|T|=6$, the set $T$ contains a cycle $C_6$. \item For $|T|=8$, the set contains a cycle $C_8$, or $Q_n$ has a CL trap. \end{enumerate} \end{lem} \noindent{\bf Proof.} $T$ does not have pendant vertices, hence it contains a cycle. If it contains a cycle $C_4$, say $(a,b,c,d)$, then by Lemma~\ref{cycle}, the cycle is a subcube $Q_2$. Thus, we have proved (1). (2) For $|T|=6$, the set $T=\{a,b,c,d,e,f\}$ contains a cycle $C_6$ or a subcube $Q_2$, say $(a,b,c,d)$. In the later case both vertices $e$ and $f$ have only one neighbor in the subcube each. Since $e$ and $f$ are not pendant, they form the edge $(e,f)$ which is connected with an edge in the subcube. More precisely, there is and edge $(u,v)$ in $(a,b,c,d)$ such that $(u,e)$ and $(v,f)$ are healthy edges. Hence, we have a cycle $C_6$. (3) For $|T|=8$, first we show that $T$ contains a cycle $C_8$ or $C_6$. The set $T$ contains a cycle $C_8$, or $C_6$, or a subcube $Q_2$, say $(a,b,c,d)$. In the later case, since $T$ does not have a bridge between balanced subsets, there is a path joining two vertices in the subcube and going outside the subcube. It is not possible that the path has the length 2, so it is longer than 2 and forms with vertices in $(a,b,c,d)$ a cycle of length 6 or 8. Suppose now that $(a,b,c,d,e,f)$ is a cycle in $T$. By Lemma~\ref{cycle}, the cycle is contained in a subcube $Q_3$, and in the next section we show that there are only two kinds of $C_6$, see Fig.~\ref{figC6c1trap} and Fig~\ref{figC6c2trap}. If the vertices $g$ and $h$ are also in the subcube, then we have $Q_3$-DHW. If we exclude pendant vertices, then $g$ and $h$ form the edge $(g,h)$ and this edge is connected with one of the edges in $\{a,b,c,d,e,f\}$. There are two cases: Case 1. The edge $(g,h)$ is connected with an edge of the cycle, and we have a cycle of length 8, see Fig.~\ref{figC8c2trap}, \ref{figC8c3trap}, \ref{figC8c4trap}. Case 2. The edge $(g,h)$ is connected with a diagonal. This is possible if the cycle is $C_6^1$ depicted on Fig.~\ref{figC6c1trap} and the diagonal is $(0,2)$. Now $T$ contains neither a pendant vertex nor a bridge, but if we cut off vertices of parity 0 (or 1) we obtain the CL-trap in $Q_4$ and a trap which is not minimal if $n\ge5$ (it contains CL trap as a subgraph). \hfill $\Box$ \section{Cycles $C_6$ disconnected halfway}\label{SecC6} In this section we consider traps disconnected halfway where the subgraph $T$ is a cycle $C=(v_0,v_1, v_2,v_3,v_4,v_5)$ of length $6$ in $Q_n$, with $n\ge 3$. Let $(d_1, d_2,d_3,d_4,d_5, d_6)$ be the sequence of dimensions of edges in $C$. By Lemma~\ref{cycle}, the cycle $C$ is contained in some 3-dimensional subcube, say $\{x\in Q_n\mid x<8\}$. Moreover, $C$ is not contained in any 2- dimensional cube. Hence, for each $i\in\{0,1,2\}$, it has a pair of edges in $i$ dimension. We have two cases: Case 1. There are two edges of the same dimension separated by one edge. Up to the isomorphism we have one possible sequence of dimensions $(0,1,0,2,1,2)$ and one cycle $C_6^1=(0,1,3,2,6,4)$, see Fig.~\ref{figC6c1trap}. If we cut off vertices $0,3,6$ (or $1,2,4$) from the vertices outside the cycle, then we obtain the $f_6$-cycle described in \cite{Li} or $C_6$-DHW trap from \cite{Sz}. We need $3n-7$ faulty edges to do this. Note that the vertex $7$ is of degree one in $Q_3$. But if we embed the trap in $Q_n$ with $n\ge 4$, then $7$ has degree at least two, see Table~\ref{tab2}. \begin{figure}[htb] \centering \includegraphics{figC6c1trap.eps} \caption{The cycle $C_6^1$.} \label{figC6c1trap} \end{figure} Case 2. Each pair of two edges of the same dimension is separated by two other edges, Up to the isomorphism, we have one possible sequence of dimensions $(0,1,2,0,1,2)$ and one cycle $C_6^2=(0,1,3,7,6,4)$, see Fig.~\ref{figC6c2trap}. In this case we need $3n-6$ faulty edges to cut off vertices $0,3,6$ from the vertices outside the cycle. Note that the vertex $2$ is of degree zero in $Q_3$. But if we embed the trap in $Q_n$ with $n\ge 5$, then $2$ has degree at least two. We get an isomorphic trap, if we cut off the vertices $1,7,4$, see Table~\ref{tab2}. \begin{figure}[htb] \centering \includegraphics{figC6c2trap.eps} \caption{The cycle $C_6^2$.} \label{figC6c2trap} \end{figure} \section{Cycles $C_8$ disconnected halfway}\label{C8} In this section we consider traps disconnected halfway where the subgraph $T$ is a cycle $C=(v_0,v_1, \dots, v_7)$ of length $8$ in $Q_n$. For $n=3$, $T$ is not a propers subset of $Q_3$, so we assume that $n\ge 4$. Let $(d_1, \dots, d_8)$ be the sequence of dimensions of edges in $C$. By Lemma~\ref{cycle}, the cycle $C$ is contained in some 4-dimensional subcube, say $\{x\in Q_n\mid x<16\}$. If $C$ is contained in some 3-dimensional subcube $Q_3$, then it forms the Hamiltonian cycle in $Q_3$ (there is only one nonisomorphic Hamiltonian cycle in $Q_3$). If we cut off every second vertex of the cycle from the vertices outside the cycle, then we get a $Q_3$-DHW trap. Assume now that $C$ is not contained in any 3-dimensional subcube. Then, by Lemma~\ref{cycle}, it has a pair of edges in each of the four dimensions $\{0,1,2,3\}$. We have three cases. Case 1. There is a pair of edges of the same dimension separated by one edge. We may assume that $d_1=d_3=0$ and $d_2=1$. Then there is an edge between $v_0$ and $v_3$, and $(v_0,v_3, v_4,v_5,v_6,v_7)$ is a 3-dim cycle of length 6. From the discussion in Section~\ref{SecC6} we can deduce that there are tree possible sequences of dimensions of $C$: $(0,1,0,2,3,1,2,3)$, $(0,1,0,2,3,1,3,2)$, or $(0,1,0,2,1,3,2,3)$. We can assume that the cycles start at 0 and we obtain three cycles: $C_8^2=(0,1,3,2,6,14,12,8)$, $C_8^3=(0,1,3,2,6,14,12,4)$, and $C_8^4=(0,1,3,2,6,4,12,8)$, see Fig.~\ref{figC8c2trap},~\ref{figC8c3trap},~\ref{figC8c4trap}. \begin{figure}[htb] \centering \includegraphics{figC8c2trap.eps} \caption{The cycle $C_8^2$. The vertices of parity 0 are cut off. If we cut off the vertices with parity 1, then we obtain the isomorphic trap.} \label{figC8c2trap} \end{figure} \begin{figure}[htb] \centering \includegraphics{figC8c3trap.eps} \caption{The cycle $C_8^3$. The vertices of parity 0 are cut off. If we cut off the vertices with parity 1, then we obtain the isomorphic trap.} \label{figC8c3trap} \end{figure} \begin{figure}[htb] \centering \includegraphics{figC8c4trap.eps} \caption{The cycle $C_8^4$. The vertices of parity 0 are cut off. If we cut off the vertices with parity 1, then we obtain the isomorphic trap.} \label{figC8c4trap} \end{figure} Case 2. There are no pairs separated by a single edge, but there is a pair separated by three edges. We may assume that the first five dimensions are $0,1,2,3,0$, and we have three possible sequences of dimensions in $C$, namely: $(0,1,2,3,0,1,2,3)$, $(0,1,2,3,0,1,3,2)$, or $(0,1,2,3,0,2,1,3)$, where the second and the third sequences are isomorphic. If we start these cycles at 0, we get two new nonisomorphic cycles of length 8: $C_8^5=(0,1,3,7,15,14,12,8)$, and $C_8^6=(0,1,3,7,15,14,12,4)$, see Fig.~\ref{figC8c5trap},~\ref{figC8c6trap}. \begin{figure}[htb] \centering \includegraphics{figC8c5trap.eps} \caption{The cycle $C_8^5$. The vertices of parity 0 are cut off. If we cut off the vertices with parity 1, then we obtain the isomorphic trap.} \label{figC8c5trap} \end{figure} \begin{figure}[htb] \centering \includegraphics{figC8c6trap.eps} \caption{The cycle $C_8^6$. The vertices of parity 0 are cut off. If we cut off the vertices with parity 1, then we obtain the trap which is not isomorphic.} \label{figC8c6trap} \end{figure} Case 3. For each $i\in\{0,1,2,3\}$, the pair of edges of dimension $i$ is separated by two (or four) other edges. We have only one possible sequence of dimensions $(0,1,2,0,3,2,1,3)$ and one nonisomorphic cycle $C_8^7=(0,1,3,7,6,14,10,8)$, see Fig.~\ref{figC8c7trap}. \begin{figure}[htb] \centering \includegraphics{figC8c7trap.eps} \caption{The cycle $C_8^7$. The vertices of parity 0 are cut off. If we cut off the vertices with parity 1, then we obtain the trap which is not isomorphic.} \label{figC8c7trap} \end{figure} Thus, we have seven nonisomorphic cycles of length 8 in $Q_4$: \begin{itemize} \item $C_8^1=(0,1,3,2,6,7,5,4)$ which is a Hamiltonian cycle in 3- dimensional subcube $Q_3$ and we have a $Q_3$-DHW trap. \item $C_8^2=(0,1,3,2,6,14,12,8)$, see Fig~\ref{figC8c2trap}. We need $4n-9$ faulty edges to cut off the vertices 0, 3, 6, and 12 from the vertices outside the cycle. Note that the vertex 4 is of degree one in $Q_4$. But if we embed the trap in $Q_n$ with $n\ge 5$, then $4$ has degree at least two. We get an isomorphic trap, if we cut off the vertices 1, 2, 14, and 8. \item $C_8^3=(0,1,3,2,6,14,12,4)$, see Fig~\ref{figC8c3trap}. We need $4n-10$ faulty edges to cut off the vertices 0, 3, 6, and 12 from the vertices outside the cycle. We get an isomorphic trap, if we cut off the vertices 1, 2, 14, and 4. \item $C_8^4=(0,1,3,2,6,4,12,8)$, see Fig~\ref{figC8c4trap}. We need $4n-10$ faulty edges to cut off the vertices 0, 3, 6, and 12. Similarly, we need $4n-10$ faulty edges to cut off the vertices 1, 2, 4, and 8. These two traps are not isomorphic. \item $C_8^5=(0,1,3,7,15,14,12,8)$, see Fig~\ref{figC8c5trap}. We need $4n-8$ faulty edges to cut off the vertices 0, 3, 15, and 12. We get an isomorphic trap, if we cut off the vertices 1, 7, 14, and 8. \item $C_8^6=(0,1,3,7,15,14,12,4)$, see Fig~\ref{figC8c6trap}. We need $4n-8$ faulty edges to cut off the vertices 0, 3, 15, and 12. In $Q_4$ we have 8 faulty edges that form a cycle of length 8 and this is not a minimal trap because the graph is not Hamiltonian even if we change any one of these faulty edges into a healthy edge. If we embed the trap in $Q_n$ with $n\ge 5$, and add faulty edges in dimensions $i$, $i\ge 5$ to cut off vertices 0, 3, 15 and 12, then the trap is minimal. We need $4n-8$ faulty edges to cut off the vertices 1, 7, 14, and 4. In this case the vertices 5 and 6 are of degree 1 in $Q_4$. Hence, this trap is not minimal in $Q_4$, but is minimal, for $n\ge5$. These two traps are not isomorphic. \item $C_8^7=(0,1,3,7,6,14,10,8)$, see Fig~\ref{figC8c7trap}. We need $4n-8$ faulty edges to cut off the vertices 0, 3, 6, and 10. In $Q_4$ the vertex 2 is of degree 0. Hence, this trap is not minimal in $Q_4$ and $Q_5$, but is minimal, for $n\ge6$. We need $4n-8$ faulty edges to cut off the vertices 1, 7, 14, and 8. In $Q_4$ these eight faulty edges form a cycle. Note that in $Q_4$ a set of four of these edges cut off the vertices 9 and 15 from the vertices outside the cycle $(9,11,15,13)$. Similarly, another set of four of these edges cut off the vertices 5 and 12 from the vertices outside the cycle $(4,5,13,12)$. Hence, this trap is not minimal in $Q_4$, but is minimal, for $n\ge5$. These two traps are not isomorphic. \end{itemize} \section{Heuristic}\label{H} In this section we present a heuristic that recognizes some non-Hamiltonian cubes. It is not perfect and does not detect all nonhamiltonian cubes. The heuristic colors in blue some of the edges in $Q_n$ and removes (adds to the set $F$) some other edges. An edge $e$ is colored in blue, if the heuristic detects that each Hamiltonian cycle in $Q_n$ contains $e$, and an edge $e$ is removed, if it is detected that no Hamiltonian cycle contains $e$. The heuristic is based on a few observations. First observation is about vertices of degree two, i.e. vertices with only two neighbors. We shall say that a vertex $v$ is a neighbor of a vertex $u$ only if $u$ and $v$ are neighbors in $Q_n$ and the edge $(u,v)\notin F$ is healthy. Consider a vertex $u$ with only two neighbors $v$ and $w$. Then the edges $(u,v)$ and $(u,w)$ are in any Hamiltonian cycle in the cube and we color these edges in blue. Furthermore, if two blue edges meet in one vertex $x$, then all other edges adjacent to $x$ can be removed, because they do not belong to any Hamiltonian cycle. If three or more blue edges meet in one vertex, then no Hamiltonian cycle is possible. The second observation is about crossing edges given by partition of $Q_n$ along some dimension $i$. There are $2^{n-1}$ crossing edges: half of them are even (their ends in $Q^L$ are of parity zero) and the other half are odd (their ends in $Q^L$ are of parity one). Let $f_i^e$ denote the number of even faulty crossing edges, $f_i^o$ denote the number of odd faulty crossing edges, $b_i^e$ denote the number of blue even crossing edges, and $b_i^e$ denote the number of blue odd crossing edges. \begin{lem}\label{partition} \begin{enumerate} \item If $f_i^e=2^{n-2}$ (or $f_i^o=2^{n-2}$), then there is no Hamiltonian cycle \item If $f_i^e+b_i^o>2^{n-2}$ or $f_i^o+b_i^e>2^{n-2}$, then there is no Hamiltonian cycle \item If $f_i^e+b_i^o=2^{n-2}$, then we can color in blue all even edges that are not in $F$ and remove all odd edges that are not blue. \item If $f_i^o+b_i^e=2^{n-2}$, then we can color in blue all odd edges that are not in $F$ and remove all even edges that are not blue. \item If $f_i^e=2^{n-2}-1$ (or $f_i^o=2^{n-2}-1$), then we can color in blue the only even (or odd, respectively) edge that is not faulty. \end{enumerate} \end{lem} \noindent{\bf Proof:} In the case (1) the subcube $Q^L$ is a trap disconnected halfway. Case (2). Suppose for a contradiction that there is a Hamiltonian cycle $C$. By Lemma~\ref{cycle2}, the set of crossing edges that are in $C$ must be balanced. Hence, it must contain at least $b^o$ even edges. This is not possible, because there are only $2^{n-2}-f_i^e<b^o$ healthy even edges. Case (3). Suppose that $C$ be an arbitrary Hamiltonian cycle, and let $B_i^e$ denote the set of even crossing edges that belong to $C$. On the one hand, we have $|B_i^e|\le 2^{n-2}- f_i^e$, because $B_i^e\cap F=\emptyset$. On the other hand, $|B_i^e|\ge b_i^o$, because the set of crossing edges in $C$ is balanced. Thus, $|B_i^e|=2^{n-2}-f_i^e$ and all healthy even crossing edges must belong to $C$. Furthermore, let $B_i^o$ denote the set of odd crossing edges that belong to $C$. Because the set of crossing edges in $C$ is balanced, we have $|B_i^o|=|B_i^e|=2^{n-2}-f_i^e=b_i^o$. Hence, all edges in $B_i^o$ are already colored in blue. Thus, we have proved that all healthy even crossing edges belong to every Hamiltonian cycle (and can be colored in blue) and that only odd edges which are colored in blue can be in any Hamiltonian cycle (so the odd edges that are not blue can be removed). The proof of case (4) is symmetric to the proof of (3). Case (5) Every Hamiltonian cycle must have at least one even and one odd edge in each dimension. \hfill$\Box$ \bigbreak The third observation is about blue cycles. If we get a blue cycle which is shorter than $2^n$, then there are no Hamiltonian cycle in $Q_n$. Similarly, we can remove the edge $e$ if after coloring $e$ in blue, we get a blue cycle shorter than $2^n$. \\ \renewcommand{\algorithmicrequire}{\textbf{Input:}} \renewcommand{\algorithmicensure}{\textbf{Output:}} \begin{algorithm}[h!t] \begin{algorithmic}[1] \Require a cube $Q_n$ and a set of faulty edges $F$. \Ensure the answer ``no HC'', if heuristic detects that there are no HC in $Q_n$ or the answer ``?'' (``do not know''), if heuristic does not find a proof that $Q_n$ is not Hamiltonian \Repeat \For{each vertex $v$ of degree 2} \State \parbox[t]{\dimexpr\linewidth-\algorithmicindent-\algorithmicindent}{color in blue the two healthy edges adjacent to $v$,\strut} \EndFor \For{each vertex $v$ with adjacent two blue edges} \State{remove all other edges adjacent to $v$} \EndFor \For{each non blue edge $e$} \If{there is a nonhamiltonian cycle containing edge $e$ and blue edges,} \State{remove edge $e$} \EndIf \EndFor \If{there is a vertex with three or more adjacent blue edges, } \State{\Return "no HC"} \EndIf \If{there is a partition satisfying the condition (1) or (2) in Lemma~\ref{partition},} \State{\Return "no HC"} \EndIf \If{there is a partition satisfying the condition (3), (4) or (5) in Lemma~\ref{partition},} \State{color or remove edges according to the lemma.} \EndIf \Until{there are no edges to color or remove} \If{there is a trap of the kinds described in the previous sections,} \State{\Return "no HC"} \EndIf \State{\Return "?"} \end{algorithmic} \label{alg:test} \end{algorithm} Note that the heuristic detects traps of the kinds described in the previous sections. The heuristic is not perfect, as we shall see later there are nonhamiltonian 4-cubes that are not detected by the heuristic. \section{Hamiltonian cycles in $Q_4$}\label{Q4} In $Q_4$ we can build the following traps of the kinds mentioned in the previous sections, see Table~\ref{tab2} and~\ref{tab3}: \begin{itemize} \item with 3 faulty edges, the $Q_1$-DHW trap (vertex of degree one), \item with 4 faults, the $Q_2$-DHW, or $Q_3$-DHW trap, \item with 5 faults, the $C_6^1$-DHW trap, \item with 6 faults, the $CL$ trap, $C_8^3$-DHW, or $C_8^4$-DHW. We can also build the $C_6^2$-DHW but this trap is not minimal, because it contains a $Q_1$-DHW trap, see Section~\ref{SecC6}, \item with 7 faults the $C_8^2$-DHW but this trap is not minimal, it contains $Q_1$-DHW trap, \item with 8 faults, the $C_8^5$-DHW, $C_8^6$-DHW, or $C_8^7$-DHW trap. In the second or the third case we obtain traps which are not minimal, see Section~\ref{C8}. \end{itemize} From the results of ~\cite{3,4,Sz} it follows that $Q_4$ is Hamiltonian, if (see Table~\ref{tab1}): \begin{itemize} \item it does not contain more than $2$ faulty edges, \item it has $3$ faulty edges and all its vertices are of degree at least 2, or \item it has $4$ faulty edges and contains neither $Q_1$-DHW, $Q_2$-DHW, nor $Q_3$-DHW trap. \end{itemize} We performed computer experiments and found out that: \begin{itemize} \item with 5 faulty edges $Q_4$ is not Hamiltonian only if it contains a $Q_1$-DHW, $Q_2$-DHW, $Q_3$-DHW, or $C_6^1$-DHW trap, \item with 6 faulty edges $Q_4$ is not Hamiltonian only if it contains a $Q_1$-DHW, $Q_2$-DHW, $Q_3$-DHW, $C_6^1$-DHW, $C_8^3$-DHW, $C_8^4$-DHW, or $CL$ trap. \end{itemize} There are 25 nonisomorphic $Q_4$ cubes with 7 faulty edges that are not Hamiltonian and do not contain any traps of the kinds described above. All these cubes can be recognized by the heuristic described in the previous section. There are nonhamiltonian 4-cubes that are not detected by the heuristic. More precisely: \begin{itemize} \item there are five such minimal cubes with 8 faulty edges, see Appendix, \item there are eight such minimal cubes with 9 faulty edges, see Appendix, \item there are four such minimal cubes with 10 faulty edges, see Appendix, \item there are no such minimal cubes with eleven or more faulty edges. \end{itemize} \section{Hamiltonian cycles in $Q_5$}\label{Q5} In $Q_5$ we can build the following traps of the kinds mentioned above: \begin{itemize} \item with 4 faulty edges, the $Q_1$-DHW trap (vertex of degree one), \item with 6 faults, the $Q_2$-DHW trap, \item with 8 faults, the $Q_3$-DHW, $Q_4$-DHW, or $C_6^1$-DHW trap, \item with 9 faults, the $CL$, or $C_6^2$-DHW trap, \item with 10 faults, the $C_8^3$-DHW, or $C_8^4$-DHW trap, \item with 11 faults the $C_8^2$-DHW trap, \item with 12 faults, the $C_8^5$-DHW, $C_8^6$-DHW, $C_8^7$-DHW trap. \end{itemize} From~\cite{3,4,Sz,Liu} it follows that $Q_5$ is Hamiltonian, if (see Table~\ref{tab1}): \begin{itemize} \item it does not contain more than $3$ faulty edges, \item it has $4$ or $5$ faulty edges and all of its vertices are of degree at least 2, \item it has $6$ or $7$ faulty edges and contains neither $Q_1$-DHW, nor $Q_2$-DHW trap. \end{itemize} We performed computer experiments and found that: \begin{itemize} \item with 8 faulty edges $Q_5$ is not Hamiltonian only if it contains a $Q_1$-DHW, $Q_2$-DHW, $Q_3$-DHW, $Q_4$-DHW, or $C_6^1$-DHW trap, \item with 9 faulty edges $Q_4$ is not Hamiltonian only if it contains $Q_1$-DHW, $Q_2$-DHW, $Q_3$-DHW, $Q_4$-DHW, $C_6^1$-DHW, $C_6^2$-DHW, or a $CL$ trap. \end{itemize} We are not able to give a full description of the $Q_5$ cubes with ten faulty edges that are not Hamiltonian. As we mentioned above, with ten faulty edges we can build a trap disconnected halfway with a cycle of length 8. Moreover with ten faulty edges we can build in $Q_5$ three other types of traps disconnected halfway. Consider partition of $Q_5$ along dimension 4 into two 4-dimensional subcubes $Q^L=\{x\mid 0\le x\le 15\}$ and $Q^R=\{x\mid 16\le x\le 31\}$. In $Q^L$ we have 1-dimensional subcube $Q_1=\{0,1\}$ and with three faulty edges: $(0,2)$, $(0,4)$, and $(0,8)$ we can cut off the vertex 0 (the only vertex in $Q_1$ with parity 0) from the set $T=Q^L-Q_1=\{x\in Q_5\mid 2\le x\le15\}$, see Fig.~\ref{figTtrap}. \begin{figure}[htb] \centering \includegraphics{figTtrap.eps} \caption{The set $T$ disconnected halfway. The vertices of parity zero are depicted by squares, the vertices of parity one are depicted by cycles. The vertices in $T$ of parity one belong to $T^1$.} \label{figTtrap} \end{figure} Note that the same three faulty edges cut off the set of vertices in $T$ of parity one, denoted by $T^1$, from the vertices in $Q_1$. Hence, the three edges cause that both $Q_1$ and $T$ are disconnected halfway in $Q^L$. Moreover, with seven faulty edges $(2,18)$, $(4,20)$, $(7,23)$, $(8,24)$, $(11,27)$, $(13,29)$, $(14,30)$ we can cut off $T^1$ from $Q^R$. Hence, with ten faulty edges $(0,2)$, $(0,4)$, $(0,8)$, $(2,18)$, $(4,20)$, $(7,23)$, $(8,24)$, $(11,27)$, $(13,29)$, $(14,30)$ we can cut off $T^1$ from the set $Q_5-T$. Thus, $T$ is disconnected halfway and $Q_5$ is not Hamiltonian. Note that the vertices of $T$ can be arranged in a cycle of length 14. Similarly, consider the 2-dimensional subcube $Q_2=\{0,1,2,3\}$. With four faulty edges: $(0,4)$, $(0,8)$, $(3,7)$, $(3,11)$ we can cut off the vertices 0 and 3 (the vertices in $Q_2$ with parity 0) from the set $S=Q^L-Q_2=\{x\in Q_5\mid 4\le x\le 15\}$, see Fig.~\ref{figStrap}. \begin{figure}[htb] \centering \includegraphics{figStrap.eps} \caption{The set $S$ disconnected halfway. The vertices of parity zero are depicted by squares, the vertices of parity one are depicted by cycles. The vertices in $S$ of parity one belong to $S^1$.} \label{figStrap} \end{figure} The same four faulty edges cut off the set of vertices in $S$ of parity one, denoted by $S^1$, from the vertices in $Q_2$. Hence, the four edges cause that both $Q_2$ and $S$ are disconnected halfway in $Q^L$. Moreover, with six faulty edges $(4,20)$, $(7,23)$, $(8,24)$, $(11,27)$, $(13,29)$, $(14,30)$ we can cut off $S^1$ from $Q^R$. Hence, with ten faulty edges $(0,4)$, $(0,8)$, $(3,7)$, $(3,11)$, $(4,20)$, $(7,23)$, $(8,24)$, $(11,27)$, $(13,29)$, $(14,30)$ we can cut off $S^1$ from the set $Q_5-S$. Thus, $S$ is disconnected halfway in $Q_5$. The vertices of $S$ can be arranged in a cycle of length 12. In order to obtain the third trap with ten faulty edges let us consider the cycle $C_6^1=\{0,1,3,7,5,4\}$. With five faulty edges $(0,2)$, $(2,3)$, $(5,13)$, $(3,11)$, $(0,8)$ we can cut off the vertices $\{0,3,5\}$ (the vertices in $C_6^1$ of parity zero) from the set $R=Q^L-C_6^1=\{x\in Q_5\mid 7<x<16\}\cup \{2,6\}$, see Fig.~\ref{figRtrap}. \begin{figure}[htb] \centering \includegraphics{figRtrap.eps} \caption{The set $R$ disconnected halfway. The vertices of parity zero are depicted by squares, the vertices of parity one are depicted by cycles. The vertices in $R$ of parity one belong to $R^1$.} \label{figRtrap} \end{figure} The same five faulty edges cut off the set of vertices in $R$ of parity one, denoted by $R^1$, from the vertices in $C_6^1$. With seven more faulty edges $(3,11)$, $(0,8)$, $(2,18)$, $(8,24)$, $(11,27)$, $(13,29)$, $(14,30)$ we can cut off $R^1$ from $Q^R$. Hence, with ten faulty edges $(0,2)$, $(2,3)$, $(5,13)$, $(3,11)$, $(0,8)$, $(2,18)$, $(8,24)$, $(11,27)$, $(13,29)$, $(14,30)$ we can cut off $R^1$ from the set $Q_5-R$. Thus, $R$ is disconnected halfway in $Q_5$. The vertices of $R$ can be arranged in a cycle of length 10. \section{Remarks and open problems}\label{open} We applied the ideas used in the heuristic, described in Section 6, to speed up the simple backtracking algorithm which looks for Hamiltonian cycle in $Q_n$. We used the new algorithm to detect all nonhamiltonian 4- dimensional cubes and all nonhamiltonian 5- dimensional cubes with 8 or 9 faulty edges. It worked much quicker than the simple backtracking algorithm. We conjecture that each cube $Q_n$ with $n\ge 6$ and with $3n-6$ faulty edges is not Hamiltonian only if it contains a $Q_1$-DHW, $Q_2$-DHW, $C_6$-DHW, or $CL$ trap.
{'timestamp': '2018-03-02T02:02:09', 'yymm': '1803', 'arxiv_id': '1803.00064', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00064'}
arxiv
\section{Introduction} Sequence alignment (see Figure \ref{fig:alig}) is a prevalent problem that finds diverse applications in molecular biology \cite{Loytynoja2005}, natural language processing \cite{barzilay2003learning}, historic linguistics \cite{prokic2009multiple}, and computer vision \cite{caspi2000step}. In this paper, we focus on aligning heterogeneous sequences with complex correspondences. Heterogeneity refers to the lack of an obvious surface matching (a literal similarity metric between elements of the sequences). A prime example is the alignment between visual and textual content. Such alignment requires sophisticated extraction of comparable feature representations in each modality, often performed by a deep neural network. \begin{figure}[t] \centering \includegraphics[width=0.8\columnwidth]{./images/diff-align.pdf} \caption{Types of sequence correspondence. Matching blocks in two sequences have identical colors and numbers. (a) A one-to-one matching where the white blocks do not match anything. (b) A one-to-many matching where one block on the bottom sequence matches multiple blocks on the top. (c) A non-monotonic situation where the matching does not always proceed strictly from left to right due to the red-1 block after the yellow-2 on top. } \label{fig:alig} \vspace{-12pt} \end{figure} A common solution to the alignment problem consists of two stages that are performed separately: (1) the learning of a similarity metric between elements in the sequences and (2) finding the optimal alignment between the sequences. Alignment techniques based on dynamic programming, such as Dynamic Time Warping (DTW)~\cite{berndt1994using} and Canonical Time Warping (CTW)~\cite{ZhouD16}, are widely popular. In a simple form, DTW can be understood as finding the shortest path where the edge costs are computed with the similarity metric, so the decision is Markov. Variations of DTW \cite{tapaswi2015book2movie,zhu2015aligning} accommodate some degrees of non-monotonicity (see Figure \ref{fig:alig} (c)). In all cases, these approaches are disadvantaged by the separation of the two stages. Conceptually, learning a metric that directly helps to optimize alignment should be beneficial. Further, methods with first-order Markov assumptions take only limited local context into account, but contextual information conducive to alignment may be scattered over the entire sequence. For example, knowledge of the narrative structure of a movie may help to align shots to their sentence descriptions. \begin{figure*} \vspace{-7pt} \centering \includegraphics[width=\textwidth]{./images/lotr_4.pdf} \label{fig:lotr} \vspace{-15pt} \caption{An example alignment between clip sequence and text sequence (from the dataset HM-2 in Section \ref{subsec:data}). } \label{fig:lotr} \vspace{-12pt} \end{figure*} To address these limitations, we propose an end-to-end differentiable neural architecture for heterogeneous sequence alignment, which we call NeuMATCH. The NeuMATCH architecture represents the current state of the workspace using four Long Short-term Memory (LSTM) chains: two for the partially aligned sequences, one for the matched content, and one for historical alignment decisions. The four recurrent LSTM networks collectively capture the decision context, which is then classified into one of the available alignment actions. Compared to the traditional two-stage solution, the network can be optimized end-to-end. In addition, the previously matched content and the decision history inform future alignment decisions in a non-Markov manner. For example, if we match a person's face with the name Frodo at the beginning of a movie, we should be able to identify the same person again later (Figure \ref{fig:lotr}). Alternatively, if the input sequences are sampled at different rates (e.g., every third video clip is matched to text), the decision history can help to discover and exploit such regularities. Although the proposed framework can be applied to different types of sequential data, in this paper, we focus on the alignment of video and textual sequences, especially those containing narrative content like movies. This task is an important link in joint understanding of multimodal content \cite{fang2015captions} and is closely related to activity recognition \cite{deng2016structure,wang2011action}, dense caption generation \cite{krishna2017dense}, and multimedia content retrieval \cite{kiros2014unifying,vendrov2015order}. The reason for choosing narrative content is that it is among the most challenging for computational understanding due to a multitude of causal and temporal interactions between events~\cite{sheinfeld2016video}. Disambiguation is difficult with needed contextual information positioned far apart. Thus, narrative contents make an ideal application and testbed for alignment algorithms. \vspace{0.1in} \noindent {\bf Contributions. } The contributions of this paper are two-fold. First, we propose a novel end-to-end neural framework for heterogeneous multi-sequence alignment. Unlike prior methods, our architecture is able to take into account rich context when making alignment decisions. Extensive experiments illustrate that the framework {\em significantly} outperforms traditional baselines in accuracy. Second, we annotate a new dataset\footnote{https://github.com/pelindogan/NeuMATCH} containing movie summary videos and share it with the research community. \section{Related Work} \iffalse \begin{table*} \centering \small \begin{tabular}{lcp{6em}p{8em}p{8em}p{6em}} \toprule & \textbf{Method} & \textbf{End-to-end} & \textbf{Historic Context} & \textbf{Supports} & \textbf{Visual-textual} \\ & \textbf{} & \textbf{Training} & \textbf{Context} & \textbf{Non-monotonicity} & \textbf{Granularity} \\ \midrule Sankar et al. \cite{sankar2009subtitle} & DTW & No & none & No & fine \\ Zhu et al. \cite{zhu2015aligning} & CRF & No & $1^{st}$-order Markov & Yes & medium \\ Tapaswi et al. \cite{tapaswi2015book2movie} & DTW & No & none & Yes & coarse \\ Tapaswi et al. \cite{tapaswi2014story} & DTW & No & none & No & fine \\ Bojanowski et al. \cite{bojanowski2015weakly} & CQP & No & global & No & fine \\ {\bf NeuMATCH} & Neural & Yes & high order & Yes* & fine \\ \bottomrule \end{tabular} \vspace{-5pt} \caption{{\bf Comparison of existing video-text alignment approaches.} Prior methods are based on DTW, CRF and Convex Quadratic Programming (CQP). *Non-monotonicity requires extensions in Appendix~\ref{sec:extensions}.} \label{tab:related} \vspace{-7pt} \end{table*} \fi \begin{table*} \vspace{-7pt} \centering \small \begin{tabular}{lcx{3cm}cccc} \toprule & \cite{sankar2009subtitle} & \cite{zhu2015aligning} & \cite{tapaswi2015book2movie} & \cite{tapaswi2014story} & \cite{bojanowski2015weakly} & {\bf NeuMATCH} \\ \midrule \textbf{Method} & DTW & CRF Chain & DP & DP & QIP & Neural \\ \textbf{End-to-end Training} & No & No & No & No & No & Yes \\ \textbf{Historic Context} & Markov & Markov + Convolution on Similarity & Markov & Markov & global & high order \\ \textbf{Supports Non-monotonicity} & No & Yes & Yes & No & No & Yes* \\ \textbf{Visual/Textual Granularity} & fine & medium & coarse & fine & fine & fine \\ \bottomrule \end{tabular} \vspace{-5pt} \caption{ Comparison of existing video-text alignment approaches. Prior method are based on DTW/Dynamic Programming (DP), Conditional Random Field (CRF) and Convex Quadratic Programming (CQP). *Non-monotonicity requires extensions in Appendix~\ref{sec:extensions}.} \label{tab:related} \vspace{-10pt} \end{table*} Our goal of video-text alignment is related to multiple topics. We briefly review the most relevant literature below. \PAR{Unimodal Representations.} It has been observed that deep convolutional neural networks (CNNs), such as VGG~\cite{simonyan2014very}, ResNet~\cite{he2016deep}, GoogLeNet~\cite{szegedy2015going}, and even automatically learned architectures~\cite{zoph2017}, can learn image features that are transferable to many different vision tasks \cite{Donahue2014,Yosinski:2014}. Generic representations for video and text have received comparatively less attention. Common encoding techniques for video include pooling~\cite{venugopalan2014translating} and attention \cite{xu2015show,yao2015describing} over frame features, neural recurrence between frames~\cite{donahue2015long, ranzato2014video,venugopalan2015sequence}, and spatiotemporal 3D convolution~\cite{tran2015learning}. On the language side, distributed word representations \cite{mikolov2013efficient,pennington2014glove} are often used in recurrent architectures in order to model sentential semantics. When coupled with carefully designed training objectives, such as Skip-Thought~\cite{kiros2015skip} or textual entailment~\cite{Bowman2015,conneau2017}, they yield effective representations that generalize well to other tasks. \PAR{Joint Reasoning of Video and Text.} Popular research topics in joint reasoning and understanding of visual and textual information include image captioning \cite{karpathy2015deep, mao2014deep, vinyals2015show, xu2015show}, retrieval of visual content~\cite{lin2014visual}, and visual question answering \cite{antol2015vqa, sadeghi2015viske, xu2016ask}. Most approaches along these lines can be classified as belonging to either (i) joint language-visual embeddings or (ii) encoder-decoder architectures. The joint {\em vision-language embeddings} facilitate image/video or caption/sentence retrieval by learning to embed images/videos and sentences into the same space \cite{pan2016jointly, torabi2016learning, Xu2017Emotion, xu2015jointly}. For example, \cite{hodosh2013framing} uses simple kernel CCA and in \cite{farhadi2010every} both images and sentences are mapped into a common semantic {\em meaning} space defined by object-action-scene triplets. More recent methods directly minimize a pairwise ranking function between positive image-caption pairs and contrastive (non-descriptive) negative pairs; various ranking objective functions have been proposed including max-margin \cite{kiros2014unifying} and order-preserving losses \cite{vendrov2015order}. The {\em encoder-decoder} architectures \cite{torabi2016learning} are similar, but instead attempt to encode images into the embedding space from which a sentence can be decoded. Applications of these approaches for video captioning and dense video captioning (multiple sentences) were explored in \cite{pan2016jointly} and \cite{yu2016video} respectively, for video retrieval in \cite{donahue2015long}, and for visual question answering in \cite{Anderson2017}. In this work, we jointly encode the video and textual input as part of the decision context. Instead of decoding alignment decisions one by one with RNNs, we gather the most relevant contexts for every alignment decision and directly predict the decision from those. \PAR{Video-text alignment.} Under the dynamic time warping framework, early works on video/image-text alignment adopted a feature-rich approach, utilizing features from dialogs and subtitles~\cite{cour2008movie, everingham2006hello, tapaswi2014story}, location, face and speech recognition~\cite{sankar2009subtitle}, as well as nouns and pronouns between text and objects in the scenes~\cite{dogan2016label, kong2014you, lin2014visual, malmaud2015s}. Tapaswi \emph{et al.} \cite{tapaswi2014story} present an approach to align plot synopses with the corresponding shots with the guidance of subtitles and facial features from characters. They extend the DTW algorithm to allow one-to-many matching. In~\cite{tapaswi2015book2movie}, Tapaswi \etal present another extension to allow non-monotonic matching in the alignment of book chapters and video scenes. The above formulations make use of the Markov property, which enables efficient solutions with dynamic programming (DP). At the same time, the historic context being considered is limited. \cite{zhu2015aligning} develops neural approach for the computation of similarities between videos and book chapters, using Skip-Thought vectors \cite{kiros2015skip}. In order to capture historic context, they use a convolutional network over a similarity tensor. The alignment is formulated as a linear-chain Conditional Random Field (CRF), which again yields efficient solution from DP. Although this method considers historic context, the alignment and similarity are still computed separately. Bojanowski \etal~\cite{bojanowski2015weakly} formulate alignment as quadratic integer programming (QIP) and solve the relaxed problem. Weak supervision can be introduced as optimization constraints. This method considers the global context, but relates the video and text features by a linear transformation and does not consider non-monotonic alignment. Table \ref{tab:related} compares key aspects of these methods. In summary, existing approaches perform the alignment in two separate stages: (1) extracting visual and textual features in such a way as to have a well defined metric, and (2) performing the alignment using this similarity (and possibly additional side information). We propose an end-to-end differentiable neural architecture that considers more than the local similarities. Inspired by LSTM-powered shift-reduce language parsers~\cite{dyer2015transition,honnibal2015improved}, we augment LSTM networks with stack operations, such as pop and push. The advantage of this setup is that the most relevant video clips, sentences, and historic records are always positioned closest to the prediction. \section{Approach} \begin{figure*}[t] \centering \includegraphics[width=2\columnwidth]{./images/architecture-long.png} \vspace{-5pt} \caption{The proposed NeuMATCH neural architecture. The current state as described by the four LSTM chains is classified into one of the alignment decisions. Parameterized actions are explained and illustrated in Appendix~\ref{sec:extensions} and Table~\ref{tab:multi-seq-actions}.} \label{fig:stackArchitecture} \vspace{-4pt} \end{figure*} We now present NeuMATCH, a neural architecture for temporal alignment of heterogeneous sequences. While the network is general, for this paper we focus specifically on the video and textual sequence alignment. The video sequence consists of a number of consecutive video clips $\mathcal{V} = \left\{V_i\right\}_{i=1\ldots N}$. The textual sequence consists a number of consecutive sentences $\mathcal{S} = \left\{S_i\right\}_{i=1\ldots M}$. Our task is to align these two sequences by, for example, finding a function $\pi$ that maps an index of the video segment to the corresponding sentence: $\langle V_i, S_{\pi(i)} \rangle$. An example input for our algorithm can be a movie segmented into individual shots and the accompanying movie script describing the scenes and actions, which are broken down into sentences (Figure \ref{fig:lotr}). The video segmentation could be achieved using any shot boundary detection algorithm; NeuMATCH can handle one-to-many matching caused by over-segmentation. We observe that the most difficult sequence alignment problems exhibit the following characteristics. First, heterogeneous surface forms, such as video and text, can conceal the true similarity structure, which suggests a satisfactory understanding of the entire content may be necessary for alignment. Second, difficult problems contain complex correspondence like many-to-one matching and unmatched content, which the framework should accommodate. Third, contextual information that are needed for learning the similarity metric are scattered over the entire sequence. Thus, it is important to consider the history and the future when making the alignment decision and to create an end-to-end network where gradient from alignment decisions can inform content understanding and similarity metric learning. The NeuMATCH framework copes with these challenges by explicitly representing the state of the entire workspace, including the partially matched input sequences and historic alignment decisions. The representation employs four LSTM recurrent networks, including the input video sequence (Video Stack), the input textual sequence (Text Stack), previous alignment actions (Action Stack) as well as previous alignments themselves (Matched Stack). Figure \ref{fig:stackArchitecture} shows the NeuMATCH architecture. We learn a function that maps the state of workspace $\Psi_t$ to an alignment action $A_t$ at every time step $t$. The action $A_t$ manipulates the content of the LSTM networks, resulting in a new state $\Psi_{t+1}$. Executing a complete sequence of actions produces an alignment of the input. The reader may recognize the similarity with policy gradient methods~\cite{Sutton2017}. As the correct action sequence is unique in most cases and can be easily inferred from the ground-truth labels, in this paper, we adopt a supervised learning approach. The alignment actions may be seen as stack operations because they either remove or insert an element at the first position of the LSTM network (except for non-monotonic matching discussed in Appendix~\ref{sec:extensions}). For example, elements at the first position can be removed ({\em popped}) or {\em matched}. When two elements are matched, they are removed from the input stacks and stored in the Matched Stack. \subsection{Language and Visual Encoders} \label{subsec:encoder} We first create encoders for each video clip and each sentence. After that, we perform an optional pre-training step to jointly embed the encoded video clips and sentences into the same space. While the pre-training step produces a good initialization, the entire framework is trained end-to-end, which allows the similarity metric to be specifically optimized for the alignment task. \PAR{Video Encoder.} We extract features using the activation of the first fully connected layer in the VGG-16 network \cite{simonyan2014very}, which produces a 4096-dim vector per frame. As each clip is relatively short and homogeneous, we perform mean pooling over all frames in the video, yielding a feature vector for the entire clip. This vector is transformed with three fully connected layers using the ReLU activation function, resulting in encoded video vector $v_i$ for the $i^{\text{th}}$ clip. \PAR{Sentence Encoder.} The input text is parsed into sentences $S_1 \ldots S_M$, each of which contains a sequence of words. We transform each unique word into an embedding vector pre-trained using GloVe \cite{pennington2014glove}. The entire sentence is then encoded using a 2-layer LSTM recurrent network, where the hidden state of the first layer, $h^{(1)}_t$, is fed to the second layer: \begin{subequations} \begin{align} h^{(1)}_t, c^{(1)}_t &= \text{LSTM}(x_t, h^{(1)}_{t-1}, c^{(1)}_{t-1}) \\ h^{(2)}_t, c^{(2)}_t &= \text{LSTM}(h^{(1)}_t, h^{(2)}_{t-1}, c^{(2)}_{t-1}) \enspace , \end{align} \end{subequations} where $c^{(1)}_t$ and $c^{(2)}_t$ are the memory cells for the two layers, respectively; $x_t$ is the word embedding for time step $t$. The sentence is represented as the vector obtained by the transformation of the last hidden state $h^{(2)}_t$ by three fully connected layers using ReLU activation function. \iffalse An LSTM unit takes word embedding as input $x_t$ at every time step $t$. LSTM contains trainable parameters $W_{cx}, W_{ch}, W_{i}, W_{f}, W_{o}, b_i, b_f$ and $b_o$. There are three gates in an LSTM unit, the input gate $i_t$, the forget gate $f_t$ and the output gate $o_t$. Formally, the recurrence between the hidden states $h_t$ and the memory cells $c_t$ can be written as \begin{subequations} \begin{align} \begin{bmatrix} i_t \\ f_t \\ o_t \\ \end{bmatrix} & = \sigma \left( \begin{bmatrix} W_{i} \\ W_{f} \\ W_{o} \\ \end{bmatrix} \begin{bmatrix} x_t \\ h_{t-1} \\ \end{bmatrix} + \begin{bmatrix} b_i \\ b_f \\ b_o \\ \end{bmatrix} \right) \\ \tilde{c}_t & = \text{tanh}\left(W_{cx}x_t + W_{ch}h_{t-1} + b_c\right) \\ c_t & = f_t \odot c_{t-1} + i_t \odot \tilde{c}_t \\ h_t & = o_t \odot \text{tanh}(c_t), \end{align} \end{subequations} where $\sigma$ is the component-wise logistic sigmoid function, $\odot$ the component-wise product, and \textit{tanh} the component-wise hyperbolic tangent. As a shorthand, we write the above as $h_t, c_t = \text{LSTM}(x_t, h_{t-1}, c_{t-1})$. \fi \PAR{Encoding Alignment and Pre-training.} Due to the complexity of the video and textual encoders, we opt for pre-training that produces a good initialization for subsequent end-to-end training. For a ground-truth pair $(V_i, S_i)$, we adopt an asymmetric similarity proposed by \cite{vendrov2015order} \begin{equation} \label{eq:similarity} F(v_i,s_i) = - ||\max(0, v_i-s_i)||^2 \enspace . \end{equation} This similarity function takes the maximum value 0, when $s_i$ is positioned to the upper right of $v_i$ in the vector space. That is, $\forall j, s_{i,j} \ge v_{i,j}$. When that condition is not satisfied, the similarity decreases. In \cite{vendrov2015order}, this relative spatial position defines an entailment relation where $v_i$ entails $s_i$. Here the intuition is that the video typically contains more information than being described in the text, so we may consider the text as entailed by the video. We adopt the following ranking loss objective by randomly sampling a contrastive video clip $V^\prime$ and a contrastive sentence $S^\prime$ for every ground truth pair. Minimizing the loss function maintains that the similarity of the contrastive pair is below true pair by at least the margin $\alpha$. \begin{dmath} \label{eq:pairwiseLoss} \mathcal{L} = \sum_{i}\left(\mathbb{E}_{v^\prime \neq v_i} \max \left\{0, \alpha-F(v_i, s_i)+F(v^\prime, s_i)\right\} \\ + \mathbb{E}_{s^\prime \neq s_i} \max\left\{0, \alpha-F(v_i, s_i)+F(v_i, s^\prime)\right\} \right) \end{dmath} Note the expectations are approximated by sampling. \subsection{The NeuMATCH Alignment Network} \label{subsec:mach} With the similarity metric between video and text acquired by pre-training, a naive approach for alignment is to maximize the collective similarity over the matched video clips and sentences. However, doing so ignores the temporal structures of the two sequences and can lead to degraded performance. NeuMATCH considers the history and the future by encoding input sequences and decision history with LSTM networks. \PAR{LSTM Stacks.} At time step $t$, the first stack contains the sequence of video clips yet to be processed $V_t, V_{t+1}, \ldots, V_{N}$. The direction of the LSTM goes from $V_N$ to $V_t$, which allows the information to flow from the future clips to the current clip. We refer to this LSTM network as the video stack and denote its hidden state as $h^V_t$. Similarly, the text stack contains the sentence sequence yet to be processed: $S_t, S_{t+1}, \ldots, S_{M}$. Its hidden state is $h^S_t$. The third stack is the action stack, which stores all alignment actions performed in the past. The actions are denoted as $A_{t-1}, \ldots, A_1$ and are encoded as one-hot vectors $a_{t-1}, \ldots, a_1$. The reason for including this stack is to capture patterns in the historic actions. Different from the first two stacks, the information flows from the first action to the immediate past with the last hidden state being $h^A_{t-1}$. The fourth stack is the matched stack, which contains only the texts and clips that are matched previously and places the last matched content at the top of the stack. We denote this sequence as $R_1, \ldots, R_L$. Similar to the action stack, the information flows from the past to the present. In this paper, we consider the case where one sentence $s_i$ can match with multiple video clips $v_1, \ldots, v_K$. Since the matched video clips are probably similar in content, we perform mean pooling over the video features $v_i = \sum_j^K v_j / K$. The input to the LSTM unit is hence the concatenation of the two modalities $r_i = [s_i, v_i]$. The last hidden state of the matched stack is $h^M_{t-1}$. \PAR{Alignment Action Prediction.} At every time step, the state of the four stacks is $\Psi_t = (V_{t^+}, S_{t^+}, A_{(t-1)^-}, R_{1^+})$, where we use the shorthand $X_{t^+}$ for the sequence $X_t, X_{t+1}, \ldots$ and similarly for $X_{t^-}$. $\Psi_t$ can be approximately represented by the LSTM hidden states. Thus, the conditional probability of alignment action $A_t$ at time $t$ is \begin{equation} P(A_t | \Psi_t ) = P(A_t | h^V_t , h^S_t, h^A_{t-1}, h^M_{t-1}) \end{equation} The above computation is implemented as a softmax operation after two fully connected layers with ReLU activation on top of the concatenated state $\psi_t = [h^V_t, h^S_t, h^A_{t-1}, h^M_{t-1}]$. In order to compute the alignment of entire sequences, we apply the chain rule. \begin{equation} P(A_1, \ldots, A_N | \mathcal{V}, \mathcal{S} ) = \prod_{t=1}^N P(A_t | A_{(t-1)^-}, \Psi_t ) \end{equation} The probability can be optimized greedily by always choosing the most probable action or using beam search. The classification is trained in a supervised manner. From a ground truth alignment of two sequences, we can easily derive a correct sequence of actions, which are used in training. In the infrequent case when more than one correct action sequence exist, one is randomly picked. The training objective is to minimize the cross-entropy loss at every time step. \PAR{Alignment Actions.} We propose five basic alignment actions that together handle the alignment of two sequences with unmatched elements and one-to-many matching. The actions include \emph{Pop Clip} (PC), \emph{Pop Sentence} (PS), \emph{Match} (M), \emph{Match-Retain Clip} (MRC), and \emph{Match-Retain Sentence} (MRS). Table \ref{tab:actions} provides a summary of their effects. \begin{table}[t] \centering \small \begin{tabular}{lp{3.1em}p{3em}p{3.7em}p{3.2em}} \toprule & \textbf{Video Stack} & \textbf{Text Stack} & \textbf{Matched Stack} & \textbf{Action Stack} \\ \midrule \textbf{Initial} & \textcircled{a}\circled{b}\textcircled{c} & \circled{1}\circled{2}\circled{3} & & \\ \midrule Pop Clip & \circled{b}\textcircled{c} & \circled{1}\circled{2}\circled{3} & & PC \\ Pop Sent & \textcircled{a}\circled{b}\textcircled{c} & \circled{2}\circled{3} & & PS \\ Match & \circled{b}\textcircled{c} & \circled{2}\circled{3} & [\textcircled{a}\circled{1}] & M \\ \midrule Match-Retain-C & \textcircled{a}\circled{b}\textcircled{c} & \circled{2}\circled{3} & [\textcircled{a}\circled{1}] & MRC \\ Match-Retain-S & \circled{b}\textcircled{c} & \circled{1}\circled{2}\circled{3} & [\textcircled{a}\circled{1}] & MRS \\ \bottomrule \end{tabular} \vspace{-5pt} \caption{The basic action inventory and their effects on the stacks. Square brackets indicate matched elements.} \label{tab:actions} \vspace{-7pt} \end{table} The Pop Clip action removes the top element, $V_t$, from the video stack. This is desirable when $V_t$ does not match any element in the text stack. Analogously, the \textit{Pop Sentence} action removes the top element in the text stack, $S_t$. The Match action removes both $V_t$ and $S_t$, matches them, and pushes them to the matched stack. The actions Match-Retain Clip and Match-Retain Sentence are only used for one-to-many correspondence. When many sentences can be matched with one video clip, the Match-Retain Clip action pops $S_t$, matches it with $V_t$ and pushes the pair to the matched stack, but $V_t$ stays on the video stack for the next possible sentence. To pop $V_t$, the Pop Clip action must be used. The Match-Retain Sentence action is similarly defined. In this formulation, matching is always between elements at the top of the stacks. It is worth noting that the five actions do not have to be used together. A subset can be picked based on knowledge about the sequences being matched. For example, for one-to-one matching, if we know some clips may not match any sentences, but every sentence have at least one matching clip, we only need Pop Clip and Match. Alternatively, consider a one-to-many scenario where (1) one sentence can match multiple video clips, (2) some clips are unmatched, and (3) every sentence has at least one matching clip. We need only the subset Pop Clip, Pop Sentence, and Match-Retain Sentence. It is desirable to choose as few actions as possible, because it simplifies training and reduces the branching factor during inference. \PAR{Discussion.} The utility of the action stack becomes apparent in the one-to-many setting. As discussed earlier, to encode an element $R_i$ in the matched stack, features from different video clips are mean-pooled. As a result, if the algorithm needs to learn a constraint on how many clips can be merged together, features from the matched stack may not be effective, but features from action stack would carry the necessary information. The alignment actions discussed in the above section allow monotonic matching for two sequences, which is the focus of this paper and experiments. We discuss extensions that allow multi-sequence matching as well as non-monotonic matching in Appendix~\ref{sec:extensions}. \section{Experimental Evaluation} We evaluate NeuMATCH on semi-synthetic and real datasets, including a newly annotated, real-world YouTube Movie Summaries (YMS) dataset. Table~\ref{tab:statistics} shows the statistics of the datasets used. \subsection{Datasets} \label{subsec:data} We create the datasets HM-1 and HM-2 based on the LSMDC data~\cite{rohrbach2015dataset}, which contain matched clip-sentence pairs. The LSMDC data contain movie clips and very accurate textual descriptions, which are originally intended for the visually impaired. We generate video and textual sequences in the following way: First, video clips and their descriptions in the same movie are collected sequentially, creating the initial video and text sequences. For HM-1, we randomly insert video clips from other movies into each video sequence. In order to increase the difficulty of alignment and to make the dataset more realistic, we select confounding clips that are similar to the neighboring clips. After randomly choosing an insertion position, we sample 10 video clips and select the most similar to its neighboring clips, using the pre-trained similarity metric (Section \ref{subsec:encoder}). An insertion position can be 0-3 clips away from the last insertion. For HM-2, we randomly delete sentences from the collected text sequences. A deletion position is 0-3 sentences from the last deletion. At this point, HM-1 and HM-2 does not require one-to-many matching, which is used to test the 2-action NeuMATCH model. To allow one-to-many matching, we further randomly split every video clip into 1-5 smaller clips. \PAR{YMS dataset.} We create the YMS dataset from the YouTube channels \textit{Movie Spoiler Alert} and \textit{Movies in Minutes}, where a narrator orally summarizes movies alongside clips from the actual movie. Two annotators transcribed the audio and aligned the narration text with video clips. The YMS dataset is the most challenging for several reasons: (1) The sequences are long. On average, a video sequence contains 161.5 clips and a textual sequence contains 58.2 sentences. (2) A sentence can match a long sequence of (up to 45) video clips. (3) Unlike LSMDC, YMS contains rich textual descriptions that are intended for storytelling; they are not always faithful descriptions of the video, which makes YMS a challenging benchmark. \begin{table} \centering \small \begin{tabular}{lrrrr} \toprule & \textbf{HM-1} & \textbf{HM-2} & \textbf{YMS} \\ \midrule \# words & 4,196,633 & 4,198,021 & 54,326 \\ \# sent. & 458,557 & 458,830 & 5,470 \\ \# avg. words/sent. & 9.2 & 9.1 & 9.5 \\ \midrule \# clips & 1,788,056 & 1,788,056 & 15,183 \\ \# video & 22,945 & 22,931 & 94 \\ \# avg clips/video & 77.9 & 77.9 & 161.5 \\ \midrule \# avg sent./video & 20.0 & 20.0 & 58.2\\ \# clip/sent. (mean(var)) & 2.0(0.33) & 2.0(0.33) & 2.6(8.8) \\ \bottomrule \end{tabular} \vspace{-4pt} \caption{Summary statistics of the datasets.} \label{tab:statistics} \vspace{-7pt} \end{table} \subsection{Performance Metrics} For one-to-one matching, we measure the matching accuracy, or the percentage of sentences and video clips that are correctly matched or correctly assigned to {\em null}. For one-to-many matching, where one sentence can match multiple clips, we cannot use the same accuracy for sentences. Instead, we turn to the Jaccard Index, which measures the overlap between the predicted range and the ground truth of video clips using the intersection over union (IoU). \begin{table} \centering \resizebox{\columnwidth}{!}{ \begin{tabular}{lrrrrrrrr} \toprule & \multicolumn{4}{c}{\textbf{HM-1}} &\multicolumn{4}{c}{\textbf{HM-2}} \\ \cmidrule(lr){2-5} \cmidrule(lr){6-9} & \textit{MD} & \textit{CTW} & \textit{DTW} & \textit{\textbf{Ours}} & \textit{MD} & \textit{CTW} & \textit{DTW} & \textit{\textbf{Ours}} \\ \midrule \textbf{clips} & 6.4 & 13.4 & 13.3 & \textbf{69.7} & 2.5 & 12.9 & 13.0 & \textbf{40.6} \\ \textbf{sents.} & 15.8 & 21.3 & 41.7 & \textbf{58.6} & 15.6 & 25.1 & 34.2 & \textbf{43.7} \\ \bottomrule \bottomrule \end{tabular} } \vspace{-3pt} \caption{Accuracy of clips and sentences for the 2-action model. Datasets require the detection of {\em null} clips.} \label{tab:results_action2} \vspace{-7pt} \end{table} \subsection{Baselines} We create three baselines, Minimum Distance (MD), Dynamic Time Warping (DTW), and Canonical Time Warping (CTW). All baselines use the same jointly trained language-visual neural network encoders (Section~\ref{subsec:encoder}), which are carefully trained and exhibit strong performance. Due to space constraints, we discuss implementation details in the supplementary material. \begin{table*} \vspace{-5pt} \centering \resizebox{\textwidth}{!}{ \begin{tabular}{lcccc@{\hspace{10pt}}cccc@{\hspace{10pt}}cccc@{\hspace{10pt}}cccc} \toprule & \multicolumn{4}{c}{\textbf{HM-0}} & \multicolumn{4}{c}{\textbf{HM-1}} & \multicolumn{4}{c}{\textbf{HM-2}} & \multicolumn{4}{c}{\textbf{YMS}} \\ \cmidrule(lr){2-5} \cmidrule(lr){6-9} \cmidrule(lr){10-13} \cmidrule(lr){14-17} & \textit{MD} & \textit{CTW} & \textit{DTW} & \textit{\textbf{Ours}} & \textit{MD} & \textit{CTW} & \textit{DTW} & \textit{\textbf{Ours}} & \textit{MD} & \textit{CTW} & \textit{DTW} & \textit{\textbf{Ours}} & \textit{MD} & \textit{CTW} & \textit{DTW} & \textit{\textbf{Ours}} \\ \midrule \textbf{clips} & 20.7 & 26.3 & 50.6 & \textbf{63.1} & 10.5 & 6.8 & 17.6 & \textbf{65.0} & 10.6 & 6.9 & 18.0 & \textbf{37.7} & 4.0 & 5.0 & 10.3 & \textbf{12.0} \\ \textbf{sents IoU} & 23.0 & 25.4 & 42.8 & \textbf{55.3} & 5.7 & 7.3 & 18.4 & \textbf{44.1} & 9.0 & 7.6 & 18.9 & \textbf{20.0} & 2.4 & 3.6 & 7.5 & \textbf{10.4}\\ \bottomrule \bottomrule \end{tabular} } \vspace{-5pt} \caption{Alignment performance for 3-action model given in percentage (\%) over all data. Datasets HM-1, HM-2, and YMS require the detection of null clips and one-to-many matchings of the sentences. HM-0 only requires one-to-many matching of sentences.} \label{tab:results_action3} \vspace{-7pt} \end{table*} \begin{figure*} \centering \includegraphics[width=\textwidth]{./images/res_with_caps.pdf} \label{fig:different-alignments} \vspace{-15pt} \caption{An alignment problem from HM-2 and the results. The vertical and horizontal axes represent the text sequence (sentences) and video sequence (clips) respectively. Green, red and yellow respectively represent the ground-truth alignment, the predicted alignment, and the intersection of two.} \label{fig:res_paths} \vspace{-12pt} \end{figure*} The MD method matches the most similar clip-sentence pairs which have the smallest distance compared to the others. We artificially boost this baseline using specific optimization for the two accuracy measures. For evaluation on video clips, we match every clip with the most similar sentence, but if the distance is greater than the threshold $0.7$, we consider the clip to be unmatched (i.e., a {\em null clip}). For sentence accuracy, we match every sentence with the most similar clip and do not assign {\em null} sentences. DTW computes the optimal path on the distance matrix. It uses the fact that the first sentence is always matched with the first clip, and the last sentence is always matched to the last clip, so the shortest path is between the upper left corner and lower right corner of the distance matrix. Note this is a constraint that NeuMATCH is not aware of. In order to handle null clips, we make use of the threshold again. In the case that one sentence is matched with several clips, the clips whose distances with the sentence are above the threshold will be assigned to null. We manually tuned the threshold to maximize the performance of all baselines. For CTW, we adopt source code provided in~\cite{ZhouD16} with the same assignment method as DTW. \subsection{Results and Discussion} Tables \ref{tab:results_action2} and \ref{tab:results_action3} show the performance under one-to-one and one-to-many scenarios, respectively. On the one-to-one versions of the datasets HM-1 and HM-2, NeuMATCH demonstrates considerable improvements over the best baselines. It improves clip accuracy by 56.3 and 27.6 percentage points and improves sentence accuracy by 16.9 and 9.5 points. Unlike CTW and DTW, NeuMATCH does not have a major gap between clip and sentence performance. On the one-to-many versions of HM-1 and HM-2, as well as the YMS dataset, NeuMATCH again shows superior performance over the baselines. The advantage over the best baselines is 47.4, 19.7, and 1.7 points for clip accuracy, and 25.7, 1.1, and 2.9 for sentence IoU. Interestingly, NeuMATCH performs better on HM-1 than HM-2, but the other baselines are largely indifferent between the two datasets. This is likely due to NeuMATCH's ability to extract information from the matched stack. Since HM-1 is created by inserting random clips into the video sequence, the features of the inserted video clip match surrounding clips, but other aspects such as cinematography style may not match. This makes HM-1 easier for NeuMATCH because it can compare the inserted clip with those in the matched stack and detect style differences. It is worth noting that different cinematographic styles are commonly used to indicate memories, illusions, or imaginations. Being able to recognize such styles can be advantageous for understanding complex narrative content. To further investigate NeuMATCH's performance without null clips, we additionally create a one-to-many dataset, HM-0, by randomly dividing every video clip into 1-to-5 smaller clips. Although NeuMATCH's advantage is reduced on HM-0, it's still substantial (12.5 points on both measures), showing that the performance gains are not solely due to the presence of null clips. As we expect, the real-world YMS dataset is more difficult than HM-1 and HM-2. Still, we have a relative improvement of $17\%$ on clip accuracy and $39\%$ on sentence IoU over the closest DTW baseline. We find that NeuMATCH consistently surpasses conventional baselines across all experimental conditions. This clearly demonstrates NeuMATCH's ability to identify alignment from heterogenous video-text inputs that are challenging to understand computationally. As a qualitative evaluation, Figure \ref{fig:res_paths} shows an alignment example. The ground alignment goes from the top left (the first sentence and the first clip) to the bottom right (the last sentence and the last clip). Dots in green, red, and yellow represent the ground truth alignment, the predicted alignment, and the intersection of the two, respectively. In the ground truth path (e), some columns does not have any dots because those clips are not matched to anything. As shown in (a), the distance matrix does not exhibit any clear alignment path. Therefore, MD, which uses only the distance matrix, performs poorly. The time warping baselines in (c) and (d) also notably deviate from the correct path, whereas NeuMATCH is able to recover most of the ground-truth alignment. For more alignment examples, we refer interested readers to the supplementary material. \subsection{Ablation Study} In order to understand the benefits of the individual components of NeuMATCH, we perform an ablated study where we remove one or two LSTM stacks from the architecture. The model \textit{No Act\&Hist} lacks both the action stack and the matched stack in the alignment network. That is, it only has the text and the video stacks. The second model \textit{No Action} and the third model \textit{No History} removes the action stack and the matched stack, respectively. In the last model \textit{No Input LSTM}, we directly feed features of the video clip and the sentence at the tops of the respective stacks into the alignment network. That is, we do not consider the influence of future input elements. Table~\ref{tab:ablations} shows the performance of four ablated models in the one-to-many setting. The four ablated models perform substantially worse than the complete model. This confirms our intuition that both the history and the future play important roles in sequence alignment. We conclude that all four LSTM stacks contribute to NeuMATCH's superior performance. \begin{table} \centering \renewcommand{\arraystretch}{0.8} \begin{tabular}{lcccc} \toprule & \multicolumn{2}{c}{\textbf{HM-1}} & \multicolumn{2}{c}{\textbf{HM-2}} \\ \cmidrule(lr){2-3} \cmidrule(lr){4-5} & \textbf{clips} & \textbf{sent. IoU} & \textbf{clips} & \textbf{sent. IoU} \\ \midrule No Act\&Hist & 47.3 & 21.8 & 11.8 & 1.6 \\ No Action & 49.9 & 23.0 & 29.6 & 16.1 \\ No History & 57.6 & 33.4 & 28.3 & 17.0 \\ No Input LSTMs & 54.8 & 24.6 & 27.9 & 8.3 \\ \midrule \textbf{NeuMATCH} & \textbf{65.0} & \textbf{44.1} & \textbf{37.7} & \textbf{20.0} \\ \bottomrule \end{tabular} \vspace{-5pt} \caption{Performance of ablated models in the one-to-many setting (3-action model).} \label{tab:ablations} \vspace{-10pt} \end{table} \section{Conclusions} In this paper, we propose NeuMATCH, an end-to-end neural architecture aimed at heterogeneous multi-sequence alignment, focusing on alignment of video and textural data. Alignment actions are implemented in our network as data moving operations between LSTM stacks. We show that this flexible architecture supports a variety of alignment tasks. Results on semi-synthetic and real-world datasets and multiple different settings illustrate superiority of this model over popular traditional approaches based on time warping. An ablation study demonstrates the benefits of using rich context when making alignment decisions. \PAR{Acknowledgement.}Pelin Dogan was partially funded by the SNF grant 200021\textunderscore153307/1.
{'timestamp': '2018-04-11T02:02:34', 'yymm': '1803', 'arxiv_id': '1803.00057', 'language': 'en', 'url': 'https://arxiv.org/abs/1803.00057'}
arxiv
\section{Introduction} The chemical master equation (CME) is the well accepted mesoscopic description of chemical systems in well-mixed and dilute conditions \cite{Gillespie2007}. However, for most systems, analytic solutions are unknown. The stochastic simulation algorithm (SSA \cite{Gillespie1977}) is a popular Monte Carlo method for sampling from the probability distribution of the CME, but the SSA is computationally expensive and is tractable only for chemical reaction systems with a small number of reactions and for parameters such that the number of molecules is not too large. For chemical systems solely composed of unimolecular reactions, the problems of the SSA are immaterial since the equations for the moments derived from the CME can be solved exactly \cite{McQuarrie1967}. However this is not the case for chemical systems with at least one bimolecular reaction which are the norm rather than the exception in nature. In this case the equations for the moments of the CME constitute an infinite hierarchy of coupled equations and hence they cannot generally be solved exactly. The roughest approximation to the problem involves solving the deterministic rate equations for the chemical system which leads to accurate estimates for the mean concentrations in the limit of large molecule numbers \cite{Kurtz1972}. Such a formalism is however inadequate when one is interested in estimating the size of the fluctuations, i.e., the variance in the fluctuations about the mean concentrations or when the goal consists in obtaining an approximate closed form solution for the probability distribution of the CME. These estimates are particularly important when the dynamics are strongly affected by the inherent stochasticity in the timing of chemical reaction events (intrinsic noise) such as the case when one or more chemical species are present in low abundances. Over the past few decades, several methods have been developed which provide a more accurate and complete picture than that obtained from deterministic rate equations. These methods involve solving a set of deterministic ordinary differential equations whose solution provides an approximation to the moments of the probability distribution of the CME. Two popular methods of this type are the linear-noise approximation \cite{vanKampen1961,ElfEhrenberg2003} and moment-closure approximations (MAs) \cite{GrimaJCP2012,Ferm2008,Ullah2009,Verghese2007,Ale2013}. The linear-noise approximation corresponds to the leading order term of the system-size expansion of the CME and hence the accuracy of its predictions and the range of its applicability has been deduced by considering the next to leading order terms of the expansion \cite{Grima2010,Thomas2012,Thomas2013}. In contrast MAs follow from an ad-hoc truncation of the infinite hierarchy of coupled moment equations of the CME and hence little is known about their range of validity and the accuracy of the moment estimates that they provide. Error estimates for the moments of the distribution of the CME of monostable chemical systems in the limit of large molecule numbers have been derived by Grima \cite{GrimaJCP2012}. A more fundamental question which has not been studied to-date is: when can we trust MAs to lead to physically meaningful estimates? i.e., positive real mean concentrations and positive real even central moments of the fluctuations in molecule numbers (note that by the latter we mean all moments of the type $\langle \prod_i (x_i - \langle x_i \rangle)^{k_i} \rangle$ such that $k_i$ is even for all $i$; this convention will be used throughout the paper). In this paper we report on a numerical study of a class of MAs which seeks to answer the aforementioned question. The paper is organised as follows. In Section II we provide an introduction to the mathematical framework of MAs, specify the class of MA methods which we will be concerned with and define a set of criteria which guarantee physical admissibility of the solution of the MA equations. In Section III, we numerically investigate the properties of the MA equations for four chemical reaction systems which are representative of deterministically monostable, bistable and oscillatory systems; we show that the MA equations lead to physically meaningful solutions only above a certain critical molecule number for deterministic monostable systems and only in a finite range of molecule numbers for deterministic bistable and oscillatory systems. We conclude in Section IV. \section{Moment closure approximations: definitions and criteria for physical validity}\label{sec_ma} \subsection{Background} Consider a chemical system involving species $X_i$ ($i=1,\ldots, N$) interacting via $R$ chemical reactions: \begin{align} \label{eq1} \sum_{i=1}^N s_{ij} X_i \xrightarrow{\quad c_j \quad} \sum_{i=1}^N r_{ij} X_i, \quad j = 1, \ldots, R. \end{align} Here, $c_j$ is the rate constant of reaction $j$. The stochiometric matrix is defined as $S_{ij} = r_{ij} - s_{ij}$. Under well-mixed and dilute conditions the system can be described by the joint probability distribution at time $t$, $P(\mathbf{n},t)$, where $\mathbf{n}=(n_1, \ldots, n_N)$ is the state vector of the system and $n_i$ is the number of molecules of species $X_i$. Its time evolution is governed by the CME \cite{Gillespie2007}: \begin{align}\label{cme} \partial_t P(\mathbf{n},t) & = \sum_{r=1}^R f_r (\mathbf{n} - \mathbf{S}_r) P(\mathbf{n} - \mathbf{S}_r, t) - \sum_{r=1}^R f_r (\mathbf{n}) P(\mathbf{n}, t), \end{align} where $\mathbf{S}_r$ is the $r$th column vector of $S$ and $f_r(\mathbf{n})$ is the propensity function of reaction $r$ defined as \cite{vanKampen}: \begin{equation} f_r(\mathbf{n}) = c_r \Omega \prod_{k=1}^N \frac{n_k!}{(n_k - s_{kj})! \Omega^{s_{kj}}}, \end{equation} and $\Omega$ is the volume of the system. To obtain the time evolution equation for the moment $\langle n_i \ldots n_l \rangle$ we multiply Eq.~\eqref{cme} by $n_i \ldots n_l$ and sum over all molecule numbers: \begin{align} \partial_t \langle n_i \ldots n_l \rangle & = \sum_{n_1, \ldots, n_N =0}^{\infty} n_i \ldots n_l \Bigg[ \sum_{r=1}^R f_r (\mathbf{n} - \mathbf{S}_r) P(\mathbf{n} - \mathbf{S}_r, t) - \sum_{r=1}^R f_r (\mathbf{n}) P(\mathbf{n}, t) \Bigg], \\ & = \sum_{r=1}^R \langle (n_i+S_{ir})\ldots(n_l+S_{lr}) f_r (\mathbf{n}) \rangle - \sum_{r=1}^R \langle n_i \ldots n_l f_r (\mathbf{n}) \rangle. \end{align} For the first two moments one obtains: \begin{align} \partial_t \langle n_i \rangle & = \sum_{r=1}^R S_{ir} \langle f_r(\mathbf{n}) \rangle, \\ \partial_t \langle n_i n_j \rangle & = \sum_{r=1}^R \big[ S_{jr} \langle n_i f_r(\mathbf{n}) \rangle + S_{ir} \langle f_r(\mathbf{n}) n_j \rangle + S_{ir} S_{jr} \langle f_r(\mathbf{n}) \rangle \big]. \end{align} For chemical systems composed of only unimolecular reactions, the moment equations are closed and can be solved explicitly. However for systems with at least one bimolecular reaction, this is not the case: the equation for a certain moment will depend on higher-order moments thus leading to an infinite hierarchy of equations which cannot be solved. The idea behind moment closure approximation involves the artificial truncation of this hierarchy at a certain order to obtain a finite set of equations that can be solved numerically. The truncation involves replacing all moments above a certain order by a function of the lower order moments. The latter function is ad-hoc and hence the accuracy of such approximations is not clear. A popular means of imposing the truncation involves setting the ($N+1$)th and higher-order cumulants to zero which leads to a closed set of equations for the first $N$ moments (see for example \cite{Ferm2008,Ullah2009,Verghese2007,Ale2013}). We will refer to this method as the $N$-moment approximation ($N$-MA) and exclusively focus on this class of moment closure approximations for the rest of this article. The conventional deterministic rate equations correspond to the 1MA, i.e, setting the variance to zero, and ignoring any factors of the form $\Omega^{-\alpha}$. \subsection{Criteria for physical admissibility of the MA equations} Here we formulate a set of criteria which guarantee physically meaningful predictions of MA approximations and which we will repeatedly use through the rest of this article. Given deterministic initial conditions, i.e., variance and all higher-order central moments are initially equal to zero, and provided the CME has a stationary solution for the probability distribution function, the MA equations should converge to a single steady-state in the limit of long time, and the trajectories should preserve a positive mean and even central moments in the molecule numbers for all times and for all initial conditions. Note that a \emph{unique steady-state solution of the MA equations} is generally expected for all systems independent of whether they are deterministically monostable, bistable or oscillatory. What we here mean by ``unique" (and throughout the rest of this article) is that given a fixed set of parameters, the time-dependent solution of the MA equations should converge in the limit of long times to the same fixed point for all possible initial conditions. Clearly this has to be the case since the stationary probability distribution of the CME is independent of initial conditions and hence the same steady-state moments must be reachable from all initial conditions. Note also that the \emph{long time solution of the MA equations should not show sustained oscillations for systems with time-independent rate constants}. This is since the moments of the CME in the limit of long time are always non-oscillatory (though the approach to the steady-state can be oscillatory) independent of whether the deterministic rate equations exhibit sustained oscillations or not. The explanation behind this phenomenon is that even if single trajectories of the SSA display sustained oscillations, independent trajectories get out of phase as time progresses and hence the ensemble-average over all the trajectories can only lead to non-oscillatory moments in the limit of long time. \section{Numerical analysis of the MA equations} In this section, we show that the criteria set forth in Section II are not met by the MA equations for a number of chemical systems including some which are of biological relevance. We consider three types of systems: those whose rate equations have a single steady-state (deterministic monostable systems), those whose rate equations have two steady-states (deterministic bistable systems) and those whose are rate equations predict sustained oscillations (deterministic oscillatory systems). The chosen systems were selected since they are simple enough to study in depth while at the same time their behavior is representative of a large class of systems encountered in chemistry and biochemistry. Stochastic simulations for all systems except that in Section IIIA.1 where done using the software package iNA \cite{Thomas2012}. \subsection{Deterministic monostable systems}\label{sec_mono} \subsubsection{Bursty gene expression with no feedback}\label{subsec_dimerization} We consider a model of bursty gene expression followed by a post-translational protein dimerisation reaction: \begin{align}\label{gene_reactions} \varnothing \xrightarrow{\quad c_1 q_m \quad} m P, \quad m \in \mathbb{N}\, \backslash \{0 \}, \quad P + P \xrightarrow{\quad c_2 \quad} \varnothing, \end{align} where $P$ is the protein species, $c_2$ is the dimerisation rate constant, and $m$ is the burst size. Experimental \cite{Cai2006} and theoretical \cite{Thattai2001, Shahrezaei2008} evidence indicates a geometric distribution $q_m=p(1-p)^{m-1}$ with constant parameter $p$ ($p < 1$) as an appropriate model for bursting; $c_1 q_m$ are then the rates at which bursts of size $m$ are created. The production step can be viewed as either an infinite number of input reactions, or equivalently as a single input reaction with input size $m$ being a random variable. Note that $1/p$ is equal to the mean burst size. Note also that in the limit of $p \approx 1$, the expression is non-bursty and the set of protein production reactions in (\ref{gene_reactions}) reduces to the single reaction $ \varnothing \xrightarrow{\quad c_1 \quad} P$. We rescale time as $\tau=t c_2/ \Omega$ and define the dimensionless constant $k= \Omega^2 c_1/c_2$, where $\Omega$ is the volume of the system. It is easy to show that the rate equations for this system have a unique positive fixed point which is globally attractive for all $k$; exact stochastic simulations using the stochastic simulation algorithm (SSA \cite{Gillespie2007}) also show that the CME has a stationary solution for all values of $k$. Starting from the CME for reaction scheme (\ref{gene_reactions}), we can derive the time evolution equations for the first moment $\langle n \rangle$ and the second moment $\langle n^2 \rangle$ as described in Section \ref{sec_ma}: \begin{figure*}[] \centering \includegraphics[scale=0.5]{./gene_stability_2ma.pdf} \caption{Stability of the 2MA equations describing bursty gene expression (reaction scheme \eqref{gene_reactions}). The three plots in the upper panel show the real and imaginary parts of the mean protein number $\mu$ and the variance $\Sigma$ in protein number fluctuations of the three fixed points $S_i$ for the 2MA Eqs. \eqref{2ma_eq1}-\eqref{2ma_eq2} as a function of $k$ for a mean burst size of 20 (i.e., $p=1/20$). The three plots in the lower panel show the associated real and imaginary parts of the eigenvalues of the Jacobian, $\lambda_1$ and $\lambda_2$, respectively. We find that $S_2$ and $S_3$ are always unstable, while $S_1$ is stable and the mean and variance are positive, if and only if $k > k_1$.} \label{figure_2ma_fixed_points} \end{figure*} \begin{align} \partial_{\tau} \langle n \rangle & = -2 \langle n^2 \rangle + 2 \langle n \rangle + k \langle m \rangle, \\ \partial_{\tau} \langle n^2 \rangle & = - 4 \langle n^3\rangle + 8 \langle n^2\rangle - 4 \langle n \rangle + 2 \langle n \rangle k \langle m \rangle + k \langle m^2 \rangle, \end{align} where $\langle m \rangle = 1/p$ and $\langle m^2 \rangle = (2-p)/p^2$ (these follow from the definition of $q_m$). These equations are then closed by using the 2MA (setting the third cumulant of $n$ to zero), leading to: \begin{align}\label{2ma_eq1} \partial_{\tau} \mu & = \langle m \rangle k + 2 \mu - 2 \mu^2 - 2 \Sigma, \\ \label{2ma_eq2} \partial_{\tau} \Sigma & = \langle m^2 \rangle k + 4 \mu(\mu-1) + 8 (1-\mu)\Sigma, \end{align} where $\mu = \langle n \rangle$ and $\Sigma = \langle n^2\rangle - \langle n\rangle^2$ are the mean and variance in protein numbers. Setting the left hand side of Eqs.~(\ref{2ma_eq1})-(\ref{2ma_eq2}) to zero, and solving simultaneously, one finds that there are three possible solutions which we call $S_i=(\mu_i, \Sigma_i), i=1,\ldots,3$. Figure \ref{figure_2ma_fixed_points} shows the real and imaginary parts of the mean and variance of these three fixed points, as well as the real and imaginary parts of the associated eigenvalues of the Jacobian of Eqs.~(\ref{2ma_eq1})-(\ref{2ma_eq2}) for the case $p=1/20$ (this corresponds to a mean burst size of $20$ which has been measured experimentally for gene expression \cite{Cai2006}). By inspection of Figure \ref{figure_2ma_fixed_points}, we see that of the three possible steady-state solutions only $S_1$ is physically admissable; this is since it is the only steady-state solution which displays a positive mean and variance of molecule numbers and which is locally stable (negative real part of the eigenvalues of the Jacobian). However note that these properties only manifest for $k$ larger than a certain critical value $k=k_1 \approx 70$. This would lead one to surmise that the CME has a stationary solution only for $k$ greater than this critical value. However, as noted earlier this is not the case: the CME has a stationary solution for all values of $k$. These results taken together imply that \emph{the 2MA does not give a physically meaningful steady-state solution for all values of $k$}. Next we study the time-evolution leading to the steady-state. Figure \ref{figure_2ma_trajectories} shows the numerically integrated time trajectories for several initial conditions for three different $k$ values and for $p = 1/20$. We find that for $k < k_2 \approx 1.2 k_1 \approx 85$, \emph{some of the trajectories diverge as time goes to infinity} which is unphysical since the CME has a stable fixed point. This instability manifests for all deterministic initial conditions for $k < k_1$ and for initial conditions characterised by a small initial mean number of protein molecules for $k_1 \le k < k_2$. For $k \ge k_2$, however, the trajectories converge to the stable fixed point and are non-negative at all times. We verified this numerically for initial conditions up to $\mu(\tau=0)=10^6$. \emph{Hence in coincidence with the steady-state analysis above, we find that the 2MA only gives physically admissible solutions for a certain range of $k$.} Note that the requirement that the time trajectories of the moments are physically admissible at all times is harder to satisfy than the requirement that there exists a single physically admissible steady-state; this is since the critical value of $k$ above which the former is satisfied ($k_2$) is larger than the critical value of $k$ above which the steady-state criteria are satisfied ($k_1$). For the rest of this article we shall refer to the first requirement noted above as the time-dependent criterion and the second requirement as the steady-state criterion. \begin{figure}[t] \centering \includegraphics[scale=0.24]{./gene_tj_CME_2MA.pdf} \caption{Time trajectories of the 2MA equations and of the ensemble-averaged SSA in the $\mu$ - $\Sigma$ plane for different values of $k$ characterising bursty gene expression (reaction scheme \eqref{gene_reactions}). The initial conditions are deterministic. The blue and magenta dots show the stable and unstable fixed points (FPs) of the 2MA equations, respectively. While for $k=65$ there is no fixed point in the positive orthant and the time trajectories diverge for all initial conditions, for $k=75$ most initial conditions lead to trajectories converging to a unique stable fixed point. However, a small initial mean number of molecules still leads to divergence. Finally, for $k=85$ all initial conditions lead to trajectories converging to a unique fixed point with positive mean and variance. In contrast as SSA simulations show, the CME has a stationary solution for all values of $k$. The mean burst size is 20 ($p = 1/20$) as in Figure 1.} \label{figure_2ma_trajectories} \end{figure} The analysis described above was specifically for the case of $p = 1/20$. Qualitatively similar results for the 2MA equations are found for all values of $p$, i.e, there exist a critical $p$-dependent values $k_1$ and $k_2$ such that for $k > k_1$ the steady-state criterion is satisfied and for $k > k_2$ the time-dependent criterion is satisfied; $k_2 \ge k_1$ such that the time-dependent criterion is generally the more difficult of the two criteria to satisfy. Figure \ref{figure_2ma_p_dependence} shows the p-dependence of the critical value $k_2$ as well as the p-dependence of the corresponding mean particle number $\langle n \rangle_{\text{CME}}$. Note that both $k_2$ and $\langle n \rangle_{\text{CME}}$ increase with $1/p$ implying that the larger the burstiness in protein expression, the larger is the critical molecule number above which the 2MA gives physically meaningful results. In particular for the case $p = 1/20$, we had earlier found that $k_2 = 85$ which corresponds to a mean steady-state protein number of $\langle n \rangle_{CME} \approx 25$, i.e., \emph{the 2MA equations for a mean protein burst size of 20 give physically meaningful results for the time-evolution of the system only when the number of protein molecules in steady-state exceeds 25}. It is well known that protein numbers per cell can be very small, even of the order of a few molecules and hence our results show that one must be careful in the use of the moment-closure approximation to understand cell level phenomena. \begin{figure}[t] \centering \includegraphics[scale=0.3]{./gene_kcrit_ncrit_2ma.pdf} \caption{Critical values ($k_2$, $\langle n \rangle_{\text{CME}}$) of the 2MA as a function of mean burst size $1/p$ for reaction scheme \eqref{gene_reactions}. Both curves are monotonically increasing with increasing $1/p$ implying that the critical molecule number above which the 2MA equations lead to physically meaningful results (both criteria in Section II B are satisfied) increases with burstiness in protein expression.} \label{figure_2ma_p_dependence} \end{figure} \begin{figure}[t] \centering \includegraphics[scale=0.24]{./gene_tj_CME_3MA.pdf} \caption{Time trajectories of the 3MA equations and the ensemble-averaged SSA in the $\mu$ - $\Sigma$ plane for different values of $k$ characterising bursty gene expression (reaction scheme \eqref{gene_reactions}). For $k=20$ there is an unphysical stable fixed point of the MA equations with negative variance. For $k=60$ the stable fixed point has positive mean and variance but the variance becomes negative as the fixed point is approached. Finally, for $k=150$ all trajectories converge to a physically admissible steady-state and are physically meaningful (positive mean and variance at all times). In contrast the CME has a stationary solution for all values of $k$. The mean burst size is $20$ ($p = 1/20$). } \label{figure_3ma_p_trajectories} \end{figure} \begin{figure}[t] \centering \includegraphics[scale=0.55]{./gene_kcrit.pdf} \caption{Critical values $k_1$ and $k_2$ as a function of the mean burst size $1/p$ for the 2-5 MA equations describing bursty gene expression (reaction scheme \eqref{gene_reactions}). In panel (a) we show that $k_2 > k_1$ for all orders of the MA and for all $p$; hence the time-evolution criterion is satisfied over a smaller range of $k$ than the steady-state criterion. In panel (b) we show that $k_2$ increases monotonically with burstiness ($1/p$) and with the order of the MA. Hence the higher the order of the MA, and the larger the noise in gene expression, the smaller is the range of $k$ over which the MA equations give physically meaningful results for the time-evolution of the system.} \label{figure_mas_p_dependence} \end{figure} Similar results to the ones found for the 2MA are found for the higher-order moment closure approximations. In Figure \ref{figure_3ma_p_trajectories} we show the 3MA analog of the 2MA time-evolution analysis shown in Figure \ref{figure_2ma_trajectories}. The qualitative similarity between the two figures is evident: the time-evolution criteria are only satisfied for $k$ greater than a certain critical value ($\approx 100$) since for smaller values of $k$, we have a non-positive variance of molecule numbers as the steady-state is approached. We have also verified the same qualitative behaviour for the 4MA and 5MA (in addition to the mean and variance, we require the fourth central moment to be positive for these MA equations) which suggests that this behaviour exists for any order of the MA method. Adopting the terminology that $k_1$ and $k_2$ are the values of $k$ above which the MA equations of any order satisfy the steady-state and time-dependent criteria, we show in Figure \ref{figure_mas_p_dependence} the dependence of these two values of $k$ on the mean burst size $1/p$ for all four MAs. Two observations can be made: (i) for all orders of the MA, $k_2 > k_1$ implying that the time-dependent criteria are the more difficult of the two to satisfy; this also implies that the mean molecule number associated with $k_2$ is the critical molecule number above which the MA equations give physically meaningful results. (ii) for a given $1/p$, the value of $k_2$ is monotonically increasing with increasing order of the MA, i.e., the range of molecule numbers over which one observes physically meaningful results decreases with increasing order of the MA. For $1/p = 20$, for example, we obtain the values $k_2 = 85, 116, 420, 643$ for the 2-5 MA equations respectively. Simulating the system using the SSA we find that these values correspond to mean protein numbers of $26, 31, 61$ and $75$, respectively. Finally in Figure \ref{accuracy_ma} we show a plot of the relative error in the mean number of molecules predicted by the MA as a function of $k$ and of the order of the MA; as expected accuracy increases with the order but the range of $k$ over which the approximation is valid decreases with increasing order. \begin{figure}[t] \centering \includegraphics[scale=0.35]{./gene_accuracy_plot.pdf} \caption{Relative error in the mean number of molecules of the MA ($\Delta \mu$) as a function of the non-dimensional parameter $k$ and of the order of the MA. The error is computed as the absolute difference between the steady-state prediction of the first moment of the MA equations and the ensemble averaged SSA result for the mean number of molecules divided by the latter. The parameter $p$ is fixed to $1/20$. The accuracy of the MA increases with the order of the approximation while the range of validity of the MA equations decreases with the order (since the minimum value of $k$ at which the MA gives a physically meaningful result increases with order). } \label{accuracy_ma} \end{figure} Summarising our analysis in this section shows that moment closure approximations for a gene circuit involving a bimolecular reaction give physically meaningful results (satisfy both criteria set forth in Section II B) only when the protein molecule numbers are above a certain critical threshold. This threshold increases with the mean burst size and closure order. \subsubsection{Gene expression with negative feedback} We next consider the following gene regulatory network: \begin{equation}\label{feedback_reactions} \begin{split} D_u & \xrightarrow{\quad c_1 \quad } D_u + X, \quad D_u + X \xrightleftharpoons[\quad c_3 \quad]{\quad c_2 \quad } D_b, \quad X \xrightarrow{\quad c_4 \quad } \varnothing. \end{split} \end{equation} A single gene in the unbound state $D_u$ expresses a protein $X$ which subsequently binds to the same gene and forms a non-expressive complex $D_b$. This is a negative feedback loop since the protein suppresses its own expression. Note that the mRNA is here not modelled explicitly for simplicity. It has been analytically shown that the rate equations possess a single steady-state solution and the CME has a stationary solution for the probability distribution function for all parameter values \cite{GrimaNewman2012}. Hence as for the previous example, we can check if the steady-state and time-dependent criteria are satisfied by the MA equations for this circuit. Note that this example unlike the previous one is two dimensional. We fix the rate constants to $c_1/c_4 = 10, c_2/c_4 = 1, c_3/c_4 = 0.5$ and study the nature of the solutions of the MA equations as a function of the cell volume $\Omega$. Solving the 2-5MA equations in steady-state we find that they possess a unique stable fixed point with positive means and even central moments only above a certain critical volume $\Omega = \Omega_1$; in particular we find the values $\Omega_1 = 5.8, 16, 28, 39$, for the 2-5MA, respectively. Solving the 2-5MA equations as a function of time we find that for volumes less than the critical volumes stated above, the trajectories of the moments either diverge or converge to an unphysical fixed point characterised by a negative mean. In contrast for volumes larger than the critical volumes $\Omega_1$ all initial conditions tested give rise to convergent and physically meaningful time trajectories. These results imply that for this set of constants, the critical volumes above which the time-dependent criterion is satisfied are the same as the critical volumes above which the steady-state criterion is satisfied. From the exact solution of the CME for this circuit \cite{GrimaNewman2012}, we find that the mean protein numbers corresponding to the critical volumes of the 2-5MA are $3.3, 5.2, 6.3$ and $6.9$, respectively. Hence as for the previous example of bursty gene expression with no feedback, (i) the MA equations possess physically admissible solutions only when the steady-state molecule numbers predicted by the CME are above a certain minimum; (ii) these critical molecule numbers increase with the order of the MA equations. \subsection{A deterministic bistable system} Next, we consider a bistable reaction system that has been extensively studied in the literature, the Schl\"ogl system \cite{Schlogl1972} \begin{align}\label{schoegl_reactions} 2X \xrightleftharpoons[c_2]{\quad c_1 \quad} 3X, \quad \varnothing \xrightleftharpoons[c_4]{\quad c_3 \quad} X. \end{align} The deterministic rate equations of the system \eqref{schoegl_reactions} have two steady-state solutions (bistability) in certain parameter regimes and one steady-state solution (monostability) in the rest of parameter space \cite{Matheson1975}. The CME can also be solved exactly in steady state since the system is in detailed balance \cite{Matheson1975,Ebeling1979}. In what follows, we study the nature of the solutions of the MA equations for a parameter set in which the system is deterministically bistable and a parameter set for which it is monostable. First, we consider the set of rate constants $c_1/c_4 = 2.6, c_2/c_4 = 1.7, c_3/c_4 = 0.1$ which we shall refer to as ``S1". The deterministic rate equations have two positive stable fixed points for approximate concentrations, $0.16$ and $1.0$, respectively. In what follows we study the nature of the solutions of the MA equations for S1 as a function of the volume $\Omega$. Solving the time-dependent MA equations, we find that the requirement of convergent and physically meaningful time trajectories is only fulfilled above a critical volume. We find that the value of this critical volume increases with increasing closure order, ranging from $0.32$ for the 2MA to $5.6$ for the 5MA which corresponds to a range of mean molecule numbers (as calculated from the CME) equal to $\langle n \rangle \approx 0.02 - 1$. Hence as for the monostable circuits studied earlier, it is clear that the MA equations give valid meaningful results only above a certain critical molecule number. \begin{figure}[t] \centering \includegraphics[scale=0.6]{./schloegl_arrows_bistable.pdf} \caption{Monostable and bistable regimes of the MA solution as a function of the volume $\Omega$ for the Schl\"ogl reaction scheme in \eqref{schoegl_reactions} with parameter set S1. The crosses denote the critical volumes above which all time trajectories for the mean and the even central moments are positive and convergent to a stable steady-state.} \label{figure_schloegl_arrow_bistable} \end{figure} \begin{figure}[t] \centering \includegraphics[scale=0.38]{./schloegl_tj.pdf} \caption{Time trajectories of the SSA and 2-4MA equations for the Schl\"ogl reaction scheme in \eqref{schoegl_reactions} with parameter set S1 and volume $\Omega=235$. The inset for the 2MA shows how the time trajectories for small initial mean molecule numbers converge to one of two stable fixed points; time trajectories for large initial mean molecule numbers converge to the other stable fixed point. This bistable behaviour evident in the solution of the 2MA is ``washed away" as the order of the MA is increased and the time trajectories become similar to those of the SSA. This shows that the bistability in the 2MA solution at this volume should be considered as an artifact of the moment-closure approximation method.} \label{figure_schloegl_time} \end{figure} However there is a major difference between the solution of the MA equations for this system and the MA equations for the previous two monostable systems: the time-dependent MA equations converge to either one or two physically admissible steady-state values of the moments, depending on the volume. This bifurcation behaviour together with the critical molecule numbers described above are schematically summarised in Figure \ref{figure_schloegl_arrow_bistable}; the time-evolution of the 2-4MA equations are compared to the SSA in Figure \ref{figure_schloegl_time}. The non-uniqueness of a steady-state with positive mean and even central moments breaks the physical admissibility criteria set forth in Section II B since the moments of any probability distribution (independent of whether the probability distribution of the CME is unimodal or multimodal) should be single-valued. Hence on this basis one would conclude that the MA equations give physically admissible results only for volumes above the critical one and for which all trajectories converge to a single-valued solution. An inspection of Figure \ref{figure_schloegl_arrow_bistable} shows that this criterion implies that the 2-5MA equations lead to physically admissible solutions in the volume ranges $3.3-147$, $2.1 - 346$, $2.8 - 530$ and $5.6 - 707$ respectively. \emph{Thus for this deterministically bistable system, there are two critical volumes and not one as for monostable systems}. It is also the case that the size of the volume range increases with the order of the MA, this being mostly due to the fact that ceiling of this range (the volume at which the MA equations switch from one to two physically admissible steady-state solutions) increases with the order of the MA. The above results have also been verified for 8 other parameter sets for which the deterministic rate equations of the Schl\"ogl model are bistable (see Table I). Note that in a single case (first parameter set in Table I), there is no regime where the steady-state solution of the 2MA equations is physically meaningful since the solution is bistable for all volumes. The fact that the upper critical volume increases rapidly with the order of the MA is indeed an indirect verification that the regime in which there are two physically admissible steady-state MA solutions is an artifact of the approximation. The origin of the unphysical bifurcation is currently unclear although we have confirmed (see Appendix A) that it is not related to a sudden breakdown of the cumulant neglect assumption at the heart of the MA equations. \begin{table} \begin{center} \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|} \hline \multicolumn{3}{|c} {parameters} & \multicolumn{2}{|c} {2MA} & \multicolumn{2}{|c} {3MA} & \multicolumn{2}{|c} {4MA} & \multicolumn{2}{|c|} {5MA} \\ \hline $c_1/c_4$ & $c_2/c_4$ & $c_3/c_4$ & $\Omega_1$ & $\Omega_2$ & $~\Omega_1~$ & $\Omega_2$ & $~\Omega_1~$ & $\Omega_2$ & $~\Omega_1~$ & $\Omega_2$ \\ \hline \hline $ 1 $ & $ \frac{1}{8} $ & $ \frac{1}{8} $ & $ 0.0094 $ & $ 0 $ & $ 1.1 $ & $ 8.7 $ & $ 1.5 $ & $ 17. $ & $ 1.4 $ & $ 29000 $ \\ \hline$ 1 $ & $ \frac{1}{8} $ & $ \frac{1}{4} $ & $ 1.4 $ & $ 180 $ & $ 0.83 $ & $ 410 $ & $ 1.1 $ & $ 610 $ & $ 1.1 $ & $ 19000 $ \\ \hline $ 1 $ & $ \frac{1}{4} $ & $ \frac{1}{8} $ & $ 39. $ & $ 76. $ & $ 1.1 $ & $ 140 $ & $ 1.5 $ & $ 190 $ & $ 1.6 $ & $ 1.4\times 10^6 $ \\ \hline $ 1 $ & $ \frac{1}{4} $ & $ \frac{1}{4} $ & $ 1.4 $ & $ 37. $ & $ 0.8 $ & $ 91. $ & $ 1.1 $ & $ 140 $ & $ 1.6 $ & $ 190 $ \\ \hline $ 2 $ & $ \frac{1}{8} $ & $ \frac{1}{8} $ & $ 2.6 $ & $ 4300 $ & $ 1.7 $ & $ 8600 $ & $ 2.1 $ & $ 72000 $ & $ 1.9 $ & $ 44000 $ \\ \hline $ 2 $ & $ \frac{1}{4} $ & $ \frac{1}{8} $ & $ 2.6 $ & $ 1300 $ & $ 1.7 $ & $ 2800 $ & $ 2.1 $ & $ 4100 $ & $ 2.5 $ & $ 23000 $ \\ \hline $ 2 $ & $ \frac{1}{2} $ & $ \frac{1}{8} $ & $ 2.6 $ & $ 370 $ & $ 1.7 $ & $ 810 $ & $ 2.1 $ & $ 1200 $ & $ 2.2 $ & $ 38000 $ \\ \hline $ 2 $ & $ 1 $ & $ \frac{1}{8} $ & $ 2.8 $ & $ 74. $ & $ 1.6 $ & $ 180 $ & $ 2.1 $ & $ 280 $ & $ 3.3 $ & $ 370 $ \\ \hline \end{tabular} \caption{The table shows the two volumes ($\Omega_1$ and $\Omega_2$) between which the MA equations have a physically meaningful solution for the Schl\"ogl reaction scheme in Eq.~\eqref{schoegl_reactions}. The data is generated for 8 distinct parameter sets. In the volume range $\Omega_1-\Omega_2$ the time trajectories of the MA are convergent to a unique steady-state and exhibit physically meaningful moments at all times (positive mean and even central moments). Above $\Omega_2$, the moments are not unique and below $\Omega_1$ the time trajectories do not converge or else there exist negative mean and even central moments at a point in time. We consider all combinations for the parameters $c_1/c_4$, $c_2/c_4$ and $c_3/c_4$ drawn from the set $\{ 2^{-3}, 2^{-2}, \ldots, 2^3\}$ for which the rate equations are bistable.} \label{table_schloegl} \end{center} \end{table} We note that another interpretation of the phenomenon may at first appear possible. When the deterministic rate equations possess two steady-state solutions the probability distribution of the CME for large volumes is expected to be bimodal; similarly when the rate equations possess one steady-state then the distribution is unimodal for large volumes. Now if one sees the MA equations as a refinement of the conventional rate equations, in the sense that they are valid not only for large volumes but over a wider range of volumes, then one may postulate that the number of physically admissible steady-state solutions of the MA equations reflects the number of maxima of the probability distribution of the CME. As we now show this interpretation is not valid for the Schl\"ogl model. For the parameter set $S1$, the probability distribution of the CME is unimodal for volumes below $\Omega = 30$ and bimodal for larger volumes. In contrast the 2MA equations show two transitions from bimodal at low volumes to unimodal at intermediate volumes to bimodal at large volumes (see Figure (\ref{figure_schloegl_arrow_bistable})); furthermore the volumes at which the transition from unimodal to bimodal occurs ($\Omega = 147, 346, 530, 707$ for the 2-5MA respectively) bear no relationship to the actual transition volume $\Omega = 30$ obtained from the CME. Hence we arrive to the conclusion as before, namely that generally the bifurcations in the solutions of the MA equations are artificial in the sense that they are not indicative of any real transition in the number of maxima of the probability distribution of the CME. Preliminary analysis (see Appendix B) does however suggest that the two steady-state solutions of the MA equations contain information (position and width) on the two peaks of the bimodal distribution of the CME but not on the height of the two peaks; this information is partial in the sense that it cannot be used to reconstruct the probability distribution or to calculate any of its moments and furthermore the information about the individual peaks is only valid over a subset of the volumes over which the probability distribution of the CME is bimodal. \emph{Hence in line with our previous analysis, it can be concluded that it is only safe to trust information from the MA equations when the time-evolution of the trajectories is physically meaningful (positive mean and even central moments) and when they converge to a single steady-state.} Next, we consider the set of rate constants $c_1/c_4 = 10, c_2/c_4 = 0.1, c_3/c_4 = 0.1$ which we shall refer to as ``S2". The deterministic rate equations have now one positive stable fixed point and the probability distribution of the CME is unimodal for all volumes that we checked. As for the monostable circuits studied in Section III A, the MA equations only give physically meaningful results (time-dependent criterion is satisfied) above a certain critical volume. These together with the number of steady-state solutions of the MA equations are summarised in Fig. \ref{figure_schloegl_arrow_uni}. The critical volumes range from $\Omega \approx 3.3$ for the 2MA to $\Omega \approx 5$ for the 5MA and the associated mean molecule numbers (calculated from the CME) range from $\langle n \rangle \approx 330$ to $\langle n \rangle \approx 510$. The bifurcation from single to two steady-states in the MA equations is completely unphysical since (i) moments can only be single-valued, (ii) there is no corresponding transition in the number of maxima of the probability distribution of the CME, and (iii) the two solutions of the MA equations do not provide any meaningful local information on the individual modes of the distribution since the distribution is unimodal (unlike the case for bistable parameter set S1). \begin{figure}[t] \centering \includegraphics[scale=0.6]{./schloegl_arrows_monostable.pdf} \caption{Monostable and bistable regimes of the MA solution as a function of the volume $\Omega$ for the Schl\"ogl reaction scheme in \eqref{schoegl_reactions} with parameter set S2. The crosses denote the critical volumes above which all time trajectories for the mean and the even central moments are positive and convergent to a stable steady-state.} \label{figure_schloegl_arrow_uni} \end{figure} \subsection{A deterministic oscillatory system} Consider next the Brusselator, a well known oscillating chemical system \cite{Prigogine1968,Lefever1988} \begin{align}\label{brusselator_reactions} 2 X + Y \xrightarrow{\quad c_1 \quad} 3X, \quad X \xrightarrow{\quad c_2 \quad} Y, \quad \varnothing \xrightleftharpoons[c_4]{\quad c_3 \quad} X. \end{align} The deterministic rate equations predict sustained oscillations in certain parameter regimes, and damped or no oscillations in other regimes. In contrast, stochastic simulations show that the mean molecule numbers either exhibit damped oscillations or no oscillations \cite{Toner2013}; sustained oscillations are only seen in individual trajectories of the SSA but due to dephasing between independent trajectories, the mean molecule numbers (calculated over an ensemble of trajectories) only show damped oscillations. We now study the MA predictions for this system. We fix the rate constants to $c_1 / c_4 = 1, c_2 / c_4 = 3, c_3 / c_4 = 1$ and study the MA equation properties as a function of the volume $\Omega$. The deterministic rate equations exhibit sustained oscillations while the mean molecule numbers computed from the SSA show damped oscillations (for all tested volumes) before settling to a non-oscillatory steady-state (see top panel of four graphs in Figure \ref{figure_brusselator_time}). In the same figure, we show the solutions of the 2-5MA as a function of the volume. Note that the MA solutions show a transition from sustained oscillations to damped oscillations at a certain critical volume; the MA solution is an approximation for the moments, i.e., ensemble-averaged behaviour of the CME, however no such transition is seen in the CME solution and hence the sustained oscillation solution of the MA equations is to be treated as an artifact. A further proof of the artifactual nature of the transition is that the critical volume at which it occurs increases rapidly with the order of the MA; these critical volumes are $\Omega = 22, 89, 320, 4900$ for the 2-5MA equations (denoted collectively as $\Omega_2$). This picture is consistent with the critical volume going to infinity in the limit of infinite order of the MA which would imply agreement with the ensemble-average results of the CME in this limit. As for the unphysical bifurcation in the Schl\"ogl system, the origin of the artificial transition from sustained to damped oscillations is unclear since it does not appear to be related to a sudden breakdown of the cumulant neglect assumption at the heart of the MA equations. \begin{figure}[t] \centering \includegraphics[scale=0.47]{./brusselator_tj.pdf} \caption{Comparison of the time evolution of the mean molecule numbers according to the CME and to the MA equations for the Brusselator system \eqref{brusselator_reactions} as a function of the volume $\Omega$. The rate parameters are $c_1 / c_4 = 1, c_2 / c_4 = 3, c_3 / c_4 = 1$. Blue and red lines denote the solutions for species $X$ and $Y$ respectively. Note that the MA equations predict a transition from sustained to damped oscillations as the volume decreases but the CME predicts no such transition; the transition is thus artifactual also since the critical volume at which it occurs increases with the order of the MA.} \label{figure_brusselator_time} \end{figure} As for previous systems, another critical volume is found below which the trajectories of the MA equations do not converge or lead to unphysical moments. These critical volumes are found to be $\Omega = 1.4, 0.41, 0.57$ and $0.79$ for the 2-5MAs (denoted collectively as $\Omega_1$). These correspond to a range of mean molecule numbers of species $X$ between $0.4$ and $1.4$ and for species $Y$ between $8$ to $9$. A schematic summary of our numerical analysis, including the transition behaviour earlier discussed, is shown in Fig. \ref{figure_brusselator_arrows}. The time trajectory and transition analysis put together lead us to the conclusion that the MA equations for the Brusselator lead to physically meaningful predictions only in the finite range of volumes $(\Omega_1,\Omega_2)$ (and the associated finite range of molecule numbers); this conclusion is similar to that for the bistable parameter set S1 of the Schl\"ogl system in Section III B. The analysis here was specifically done for the rate constants $c_1 / c_4 = 1, c_2 / c_4 = 3, c_3 / c_4 = 1$; we have verified that the same picture and conclusions emerge from studying twelve other sets of rate constants (see Table II). Note that in 8 cases, there is no regime where the steady-state solution of the 2MA equations is physically meaningful since the solution is oscillatory for all volumes; in contrast there is just one case where the 3MA suffers a similar problem and no such cases are found using the 4 and 5MA. These results suggests that our analysis broadly holds for all parameters such that the deterministic rate equations predict sustained oscillations. \begin{figure}[t] \centering \includegraphics[scale=0.6]{./brusselator_arrows.pdf} \caption{Damped and sustained oscillation regimes of the MA solution as a function of the volume $\Omega$ for the Brusselator reaction scheme \eqref{brusselator_reactions} with rate constants $c_1 / c_4 = 1, c_2 / c_4 = 3, c_3 / c_4 = 1$. The crosses denote the critical volumes above which all time trajectories for the mean and even central moments are positive and convergent to a steady-state.} \label{figure_brusselator_arrows} \end{figure} \begin{table} \begin{center} \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|} \hline \multicolumn{3}{|c} {parameters} & \multicolumn{2}{|c} {2MA} & \multicolumn{2}{|c} {3MA} & \multicolumn{2}{|c} {4MA} & \multicolumn{2}{|c|} {5MA} \\ \hline $c_1/c_4$ & $c_2/c_4$ & $c_3/c_4$ & $~\Omega_1~$ & $~\Omega_2~$ & $~\Omega_1~$ & $~\Omega_2~$ & $~\Omega_1~$ & $~\Omega_2~$ & $~\Omega_1~$ & $~\Omega_2~$ \\ \hline \hline $ \frac{1}{2} $ & $ 2 $ & $ \frac{1}{2} $ & $ 1.8 $ & $ 1.8 $ & $ 0.67 $ & $ 5.7 $ & $ 0.52 $ & $ 17 $ & $ 0.52 $ & $ 44 $ \\ \hline $ \frac{1}{2} $ & $ 2 $ & $ 1 $ & $ 0.9 $ & $ 14 $ & $ 0.37 $ & $ 350 $ & $ 0.44 $ & $ 4900 $ & $ 0.67 $ & $ ~> 10^6 $ \\ \hline $ \frac{1}{2} $ & $ 4 $ & $ \frac{1}{2} $ & $ 3 $ & $ 3 $ & $ 1.1 $ & $ 1.1 $ & $ 0.4 $ & $ 4.6 $ & $ 0.38 $ & $ 8 $ \\ \hline $ \frac{1}{2} $ & $ 4 $ & $ 1 $ & $ 1.5 $ & $ 1.5 $ & $ 0.56 $ & $ 5.9 $ & $ 0.4 $ & $ 12 $ & $ 0.61 $ & $ 21 $ \\ \hline $ \frac{1}{2} $ & $ 4 $ & $ 2 $ & $ 0.77 $ & $ 28 $ & $ 0.23 $ & $ 88 $ & $ 0.34 $ & $ 210 $ & $ 0.38 $ & $ 410 $ \\ \hline $ 1 $ & $ 2 $ & $ \frac{1}{2} $ & $ 1.8 $ & $ 1.8 $ & $ 0.67 $ & $ 23 $ & $ 0.67 $ & $ 103 $ & $ 0.65 $ & $ ~> 10^6 $ \\ \hline $ 1 $ & $ 4 $ & $ \frac{1}{2} $ & $ 1.8 $ & $ 1.8 $ & $ 1.1 $ & $ 3.9 $ & $ 0.57 $ & $ 10 $ & $ 0.9 $ & $ 17 $ \\ \hline $ 1 $ & $ 4 $ & $ 1 $ & $ 1.5 $ & $ 1.5 $ & $ 0.56 $ & $ 20 $ & $ 0.52 $ & $ 40 $ & $ 0.79 $ & $ ~> 10^6 $ \\ \hline $ 2 $ & $ 2 $ & $ \frac{1}{2} $ & $ 1.8 $ & $ 27 $ & $ 0.72 $ & $ 710 $ & $ 0.88 $ & $ 9700 $ & $ 1.3 $ & $ ~> 10^6 $ \\ \hline $ 2 $ & $ 4 $ & $ \frac{1}{2} $ & $ 1.5 $ & $ 1.5 $ & $ 1.1 $ & $ 11 $ & $ 0.79 $ & $ 25 $ & $ 1.2 $ & $ 42 $ \\ \hline $ 2 $ & $ 4 $ & $ 1 $ & $ 1.5 $ & $ 56 $ & $ 0.59 $ & $ 170 $ & $ 0.54 $ & $ 420 $ & $ 0.77 $ & $ 830 $ \\ \hline $ 4 $ & $ 4 $ & $ \frac{1}{2} $ & $ 3 $ & $ 3 $ & $ 1.1 $ & $ 41 $ & $ 1 $ & $ 80 $ & $ 1.6 $ & $ 130 $ \\ \hline \end{tabular} \caption{The table shows the two volumes ($\Omega_1$ and $\Omega_2$) between which the MA equations have a physically meaningful solution for the Brusselator reaction scheme in Eq.~\eqref{brusselator_reactions}. The data is generated for 12 distinct parameter sets. In the volume range $\Omega_1-\Omega_2$ the time trajectories of the MA are convergent to a unique steady-state and exhibit physically meaningful moments at all times (positive mean and even central moments). Above $\Omega_2$, the moment solutions of the MA exhibit artificial sustained oscillations (the SSA always has damped oscillations) and below $\Omega_1$ the time trajectories do not converge or else there exist negative mean and even central moments at a point in time. We consider all combinations for the parameters $c_1/c_4$, $c_2/c_4$ and $c_3/c_4$ drawn from the set $\{ 1/2,1, 2, 4\}$ for which the deterministic rate equations predict sustained oscillations. The initial condition is zero mean and higher-order moments.} \label{table_brusselator} \end{center} \end{table} \section{Summary and conclusion}\label{sec_conclusion} In this paper we have elucidated, by means of several exemplary reaction systems, the range of validity of a popular class of MA equations. In particular our numerical results suggest that the solutions of these equations are only physically meaningful when the steady-state mean molecule numbers obtained from the CME are above a certain threshold for deterministic monostable systems and when these molecule numbers fall within a certain finite range of mean molecule numbers for deterministic bistable and oscillatory systems. Our results have important implications for the use of MA approaches to either predict the stochastic dynamics of chemical systems \cite{Ullah2009,Verghese2007} or for parameter inference \cite{Milner2013,Zechner2012}. By physically meaningful solutions we specifically mean that (i) the mean molecule numbers and the even central moments of the fluctuations in molecule numbers predicted by the MA equations are positive real numbers at all times and they converge to steady-state values whenever the CME has a stationary solution, (ii) the moments are unique in the sense that the same steady-state moments can be reached from all initial conditions, and (iii) the moments do not exhibit sustained oscillations in the limit of long times. The first two properties are self-evident while the third may not be immediately obvious -- this stems from the fact that though individual trajectories of the SSA can exhibit sustained oscillations, all these noisy trajectories are not in phase since they are independent (provided the rate constants are time independent) and hence an ensemble average leads to damped oscillations through destructive interference between the trajectories. We found that deterministic monostable systems suffer from a breakdown of property (i) for mean molecule numbers below a certain value, deterministic bistable systems suffer from the same and as well from a breakdown of property (ii) for mean molecule numbers above a certain value, while deterministic oscillatory systems have the same property as monostable systems and as well suffer from a breakdown of property (iii) for mean molecule numbers above a certain value. We have shown that the transition in the number of steady-state solutions (from 1 to 2) which lead to a breakdown of property (ii) and the transition from damped to oscillatory long time behaviour which lead to the breakdown of property (iii) occur at increasing higher mean molecule numbers as the order of the MA equations is increased -- this strongly suggests that these transitions are unphysical. This conclusion was further supported by showing that the transitions are uncorrelated with sudden changes in the number of maxima of the probability distribution of the CME or in the moment dynamics of the CME. We note that above the mean molecule numbers for which properties (ii) and (iii) breakdown, the solution of the moment equations closely resembles that of the deterministic rate equations rather than the moments of the probability distribution of the CME. However as noted above, the range of mean molecule numbers for which all three properties are satisfied is found to increase rapidly as the order of the MA equations is increased -- this means that the solution of the MA resembles less the deterministic rate equations and more the CME as the order is increased. This result is consistent with the fact that the first-order MA is either the same or approximately equal to the deterministic rate equations (since the 1MA involves setting the variance of fluctuations to zero) while the infinite order MA is equivalent to the exact moments of the CME. We emphasise that the results here reported are specifically for bursty gene expression and a genetic negative feedback loop (monostable systems), the Schl\"ogl model (a bistable system) and the Brusselator (an oscillatory system); it remains to be seen whether the conclusions obtained herein are common to all deterministic monostable, bistable and oscillatory systems, albeit its unlikely that the latter can be conclusively proved since the MA framework is typically only amenable to numerical analysis. In conclusion, we have here elucidated the conditions necessary for the validity of the solution of the MA equations. Our results suggest that though this approach presents an efficient computational means of obtaining approximate solutions to the moments of the CME, there are several pitfalls in the interpretation of the results particularly for deterministic bistable and oscillatory systems; these difficulties can be only be overcome through the systematic comparison of the solutions of the MA equations of a certain order with those of higher orders. \section*{Acknowledgments} G.S. acknowledges support from the European Research Council under grant MLCS 306999.
{'timestamp': '2015-05-14T02:09:52', 'yymm': '1407', 'arxiv_id': '1407.8316', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8316'}
arxiv
\section{Introduction}\label{sec1} The PROmotion of Breastfeeding Intervention Trial (PROBIT) [Kramer et al. (\citeyear{Kramer:001,Kramer:002})] was undertaken in order to obtain randomized control trial evidence of the health effects of longer breastfeeding. This was done by cluster randomizing a breastfeeding support intervention which encouraged exclusivity and duration. The effect of the PROBIT intervention on gastrointestinal tract infection in the newborns was originally evaluated using a stratified intention-to-treat analysis. The results indicated a significant reduction in infection incidence for infants whose mothers had been assigned to the intervention group [\citet{Kramer:001}]. The intervention was presumably effective because it successfully encouraged breastfeeding, which subsequently improved infant health. However, because breastfeeding itself was not randomized, the estimated effect obtained in the study can at best be considered a biased assessment of the effect of breastfeeding on infection. Due to the ethical and practical impossibility of randomizing breastfeeding, estimation of the causal effect of breastfeeding must be obtained through statistical methods. Our goal is therefore to estimate the causal effect of breastfeeding duration on the number of infections a newborn is expected to experience in their first year. One of the challenges involved in analyzing this effect is the confounding presence of intermediate infections (occurring at any time during the year). The presence of an infection affects both the continuation of breastfeeding and the outcome (since it deterministically increases the outcome by one). Therefore, intermediate infection is a \textit{time-dependent confounder}. Since infection is also hypothesized to be affected by previous breastfeeding status, standard regression methods (including or excluding the time-dependent confounder) may produce a biased estimate of the causal parameter [\citet{Robins:002}]. Causal methods are therefore required to isolate the desired effect. Additional confounding also occurs due to baseline differences in the study group and by informative participant dropout. Many longitudinal methods have been developed that correctly take into account time-dependent confounders predicted by past exposure. One such method is inverse probability of treatment weighting (IPTW) for marginal structural models [\citet{Hernan:001,Robins:001}]. However, IPTW is not semiparametric efficient\break [\citet{Robins:005}] and has poor performance under certain common scenarios~[\citet{Petersen:002}]. The shortcomings of simple weighting methods have since spurred the development of new estimators with better properties. Efficient estimating equation methodology [\citet{Robins:005,vdl:005,Bang:001}] produces estimators that are double robust (consistent under partial model misspecification) and efficient when correctly specified. Targeted maximum likelihood estimation (TMLE) [\citet{vdl:001}] shares these properties, but because it is a substitution estimator, it can be made to be stable and produce estimates bounded within the parameter space in some situations where IPTW performs poorly~[\citet {Gruber:001}]. In addition, TMLE is often implemented fully nonparametrically, which avoids modeling errors caused by incorrect parametric assumptions. \citet{vdl:002} established a TMLE procedure for longitudinal data based on a binary decomposition of the intermediate variables (the time-dependent confounders). This method has been described and implemented by~\citet{Rosenblum:002} and \citet{Schnitzer:001} for two time points, and~\citet{Stitelman:001} for a survival outcome. However, the implementation of this method for large numbers of time points results in heavy computational requirements and a restriction on the form of the data (specifically, requiring discretized intermediate covariates). More recently, \citet{vdl:004} developed a simpler and more flexible implementation of TMLE for longitudinal data based on the ideas of~\citet{Bang:001}. An initial causal analysis of the PROBIT study using different double-robust causal methods was performed by~\citet{Schnitzer:001} but was limited to two time points. In this paper, after giving more details about the PROBIT study and the scientific question of interest (Section~\ref{sec2}), we describe several options for potentially unbiased estimation of the effect of breastfeeding on infection: (a)~G-computation~[\citet{Robins:002}], (b) a variant of G-computation that we call sequential G-computation~[\citet{Bang:001}], and (c) a longitudinal TMLE based on sequential G-computation~[\citet{vdl:004}] (Section~\ref{sec3}). The subsection on the longitudinal TMLE demonstrates a 6 time-point implementation for estimation of the effect of breastfeeding duration on gastrointestinal tract infection, with modified variance estimation reflecting the clustered design of the PROBIT. In Section~\ref{sec4} we present the results of analyzing the PROBIT data with each of these methods in addition to IPTW. Finally, we compare this TMLE approach to the other causal techniques for longitudinal data in a simulation study designed to imitate the analysis of the PROBIT data. \section{The PROBIT data}\label{sec2} The PROBIT study paired participating maternal hospitals according to (1) geographic region in Belarus, (2) urban or rural status, (3)~number of deliveries per year and (4) breastfeeding rates upon discharge. One hospital of each pair was then assigned to receive a breastfeeding support intervention that involved retraining all midwives, nurses and physicians involved in labor, delivery and the postpartum hospital stay. The control hospitals were assigned to continue their current practice. Thirty-four hospitals were initially randomized, but three were dropped from the study due to eventual refusal to follow the assignment or falsification of data. The PROBIT study enrolled healthy, full-term, singleton infants of mothers who intended to breastfeed, weighing at least 2500~g, soon after birth. Follow-up visits were scheduled at 1, 2, 3, 6, 9 and 12 months of age to record various measures of health and size, including number of gastrointestinal infections over each time interval. At each follow-up visit, it was established whether the mother continued to breastfeed. Within the 31 hospitals, 17,046 mother/infant pairs were recruited into the trial. Of these, ten were missing necessary baseline information and were removed from the analysis. The remaining 17,036 subject pairs were used in the analysis. Characteristics of the complete data set (including missing data summaries) are presented in Table~\ref{characteristics2}. Within the hospitals, the number of recruited patients varied between 232 and 1180 with median 471. \begin{table} \caption{Characteristics at baseline of the 17,046 mother-infant pairs in the PROBIT data set}\label{characteristics2} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccc@{}} \hline \textbf{Characteristic} & \multicolumn{2}{c}{\textbf{Summary}}&\textbf{N.~missing}\\ \hline \emph{Numeric variables}&Median&IQR\tabnoteref[a]{ttl1}&\\ Age of mother (years)& 23 & $(21,27)$& \\ N. previous children&0&$(0,1)$&\\ Gestational age (months)& 40 & $(39,40)$&\\ Infant weight (kg)& 3.4&$(3.2,3.7)$&\\ Infant height (cm)&52.00&$(50.00,53.00)$&\\ Apgar score\tabnoteref[b]{ttl2}& 9 &$(8,9)$&5\\ Head circumference (cm)&35&$(34,36)$&3\\[3pt] \emph{Binary variables}&N.&$\%$&\\ Smoked during pregnancy& 389&2.28&\\ History of allergy&750&4.40&\\ Male child&8827&52& \\ Cesarean&1974&12&\\ Mother's education&&&2\\ \quad Some high school&663&4&\\ \quad High school&5497&32&\\ \quad Some university&8568&50&\\ \quad University&2316&14&\\ Geographic region&&&\\ \quad East Belarus, urban&5615&33&\\ \quad East Belarus, rural&2706&16&\\ \quad West Belarus, urban&4380&26&\\ \quad West Belarus, rural&4343&25&\\ \hline \end{tabular*} \tabnotetext[a]{ttl1}{IQR: inter-quartile range.} \tabnotetext[b]{ttl2}{The Apgar score is an assessment of newborn health (range 1--10) where 8$+$ is vigorous, 5--7 is mildly depressed and 4$-$ is severely depressed~[\citet{Finster:001}]. A range of 5--10 was observed in PROBIT due to entry restrictions on weight and health at baseline.} \end{table} Measured baseline potential confounders of the effect of breastfeeding on infection (and predictors of outcome) were chosen to be mother's education, mother's smoking status during pregnancy, mother's age, family history of allergy, number of previous children, whether the birth was by cesarean section, gender of child, gestational age, Apgar score for health of the newborn, geographic region, and the weight, height, head circumference at birth, and hospital. The hospital (or cluster) was included in the set of potential confounders because the conditions of the hospital frequented by a patient can affect both their infant's health outcome and their decision to continue breastfeeding. In addition, since similar patients may be clustered within a hospital, hospital may act as a proxy for unmeasured baseline characteristics. The hypothetical intervention of interest for this analysis was breastfeeding up until a given time. The binary intermediate variable at a given time was whether or not gastrointestinal infection occurred in the interval immediately preceding the time point. The outcome is the total number of infections occurring up until 12 months of age. A subject was defined as censored at the first visit where information required in the analysis was missing. The number of censored subjects at each time point is described in Table~\ref{counts2}. Absenteeism or study drop-out are often dependent on subject-specific characteristics and current health, which is why adjustment for censoring was considered necessary. \begin{table} \caption{Censoring, number of infections and mothers still breastfeeding by time point}\label{counts2} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccccc@{}} \hline Time point& 1 & 2 & 3 & 4 & 5 & 6\\ Month&1&2&3&6&9&12\\[3pt] N.~censored & 284 & 500 & 326 & 491 & 717& 139\\ Cumulative N. & 284 & 784 & 1110 & 1601 & 2318 & 2457\\ Cumulative \% & 1.66 & 4.60 & 6.52 &9.40&13.61&14.42\\[3pt] N. with infections & 171 & 232 & 230 & 443 & 518& 408\\ N. of infections&173&235&236&472&544&439\\ N. breastfeeding & 15,392 &13,128 & 10,765 &6893&4717&--\\ \hline \end{tabular*} \end{table} At each visit, the number of gastrointestinal infections since the last visit were counted. In addition, breastfeeding status at that time was obtained. There is therefore uncertainty about exact time-ordering of each infection and breastfeeding cessation within a time interval. By defining the exposure as breastfeeding status at time-point $t$, we can consider that this intervention point occurs after infection counts measured over the previous interval. With six visits, and the outcome assessed at the sixth visit, this means that only the first five exposure nodes are considered in the analysis. However, we observe six censoring times (occurring before each of the six follow-up times). Figure~\ref{figure21} gives a graphic display of the time-ordering of the observed data. \begin{figure} \includegraphics{727f01.eps} \caption{Time-ordering of the variables in the PROBIT study. Data were collected at baseline and six follow-up times. At each follow-up time point, breastfeeding status ($A_t$) and presence of infection over the past interval ($L_t$) were noted. Censoring occurring at time $t$ ($C_t=1$) indicates that later breastfeeding and infection status were not observed.}\label{figure21} \end{figure} Intermediate infections were considered to be an important time-varying confounder because mothers were less likely to continue breastfeeding when their infant became ill. Therefore, even if breastfeeding has absolutely no effect on infection, ignoring this confounding effect would make it seem like infants who experienced infections were also breastfed for shorter periods of time. Table~\ref{counts2} also shows a summary of the infection counts at each time point. Few children experienced more than one infection during a given time interval, so the time-dependent confounder was summarized as a binary indicator of infection. However, we used the true number of infection counts for the outcome. \section{Estimation for longitudinal data}\label{sec3} As in the PROBIT study, suppose we observe longitudinal information from $n$ individuals of the form $O=(W,C_1,L_1,A_1,C_2,L_2,\ldots,L_{K-1},A_{K-1},C_{K},Y)$. Let $K$ be the total number of follow-up visits, and the subscripts on each variable indicate the visit at which that variable was measured. The variable $W$ is the collection of potentially confounding variables at baseline. The variables $C_t,t=1,\ldots,K$, indicate whether a subject has been censored before the $t$th time point. Intermediate infection was represented by $L_t,t=1,\ldots,K-1$, indicating whether the infant had any gastrointestinal infections between time-points $t-1$ and $t$. If a subject has been censored, define their missing $L_t$ and $Y$ values to be zero. The variables $A_t,t=1,\ldots,K-1$, denote breastfeeding status at time-point $t$ ($A_t=1$ means continued breastfeeding). The outcome $Y$ is the total number of infections accrued up until and including visit $K$. For any time-dependent variable $X$, we will use $\bar {X}_t=(X_1,\ldots,X_t)$ to denote the history of $X$ up to and including $X_t$. Let $\bar{a}=(a_1,a_2,\ldots,a_{K-1})$ denote a fixed breastfeeding regimen. For instance, breastfeeding past the first time period, then stopping before the second would be written as $(1,0,0,\ldots,0)$. Because breastfeeding is approximately monotone, the regimens of interest are equivalent to a corresponding duration of breastfeeding. Following the Neyman--Rubin model [\citet{Rubin:001}], define the counterfactual variable $L^{\bar{a}}_t$ as the observation $L_t$ that an individual would have had if they had followed the breastfeeding regimen $\bar{a}$ and remained uncensored. Similarly, $Y^{\bar{a}}$~is the counterfactual number of infections that would have been observed under breastfeeding regimen $\bar{a}$. The target of inference is the marginal mean counterfactual outcome, denoted $\psi_{\bar{a}}=E(Y^{\bar{a}})$. The standard causal missing data problem arises from observing each individual under only one breastfeeding regimen. \subsection{The G-computation method}\label{Gcomp2} G-computation~[\citet{Robins:002,Snowden:001}] is a likelihood-based approach to estimating a causal parameter. It is often described as a substitution estimator because it takes a fit of the likelihood and substitutes it into a function to get an estimate of the parameter of interest. Suppose our observed data $O$ consist of $n$ independently and identically distributed draws from a true underlying distribution $f(O)$. This density may be decomposed corresponding to the time-dependent structure of the data as \begin{eqnarray*} f(O)&=& \underbrace{Q_{Y}(Y\mid\bar{C}_K, \bar{A}_{K-1},\bar {L}_{K_1})\prod_{t=1}^{K-1} Q_{L_t}(L_t \mid \bar{C}_t,\bar {A}_{t-1},\bar{L}_{t-1},W)Q_{W}(W)}_{Q} \\ &&{}\times \underbrace{\prod_{t=1}^{K-1} g_{A_t}( A_t \mid\bar{L}_t, \bar{C}_{t},\bar{A}_{t-1},W) \prod _{t=1}^{K} g_{C_t}(C_t \mid \bar{A}_{t-1},\bar{L}_{t-1},\bar {C}_{t-1},W)}_{g}, \end{eqnarray*} where $Q$ is the joint conditional distribution of the $Y$, $L_t$ and $W$ variables that can be decomposed into conditional distributions $Q_{Y}$, $Q_{L_t},t=1,\ldots,K$, and $Q_{W}$. Similarly, $g$ is the conditional distribution of the exposure and censoring variables that can be decomposed into $g_{A_t},t=1,\ldots,K-1$, and $g_{C_t},t=1,\ldots,K$. Given a fixed breastfeeding regimen, $\bar{a}$, we can define the distribution $Q^{\bar{a}}$ of the corresponding counterfactual variables $Y^{\bar{a}}, \bar{L}^{\bar{a}}_K, W$ (under the causal assumptions of consistency and sequential ignorability discussed in Section~\ref{causalassumptions}) as \begin{eqnarray*} Q^{\bar{a}}\bigl(Y^{\bar{a}}, \bar{L}^{\bar{a}}_K, W \bigr) &=& Q_Y(Y\mid\bar {C}_{K}=0, \bar{A}_{K-1}= \bar{a}_{K-1}, \bar{L}_{K-1},W) \\ &&{}\times\prod_{t=1}^{K-1} Q_{L_t}(L_t \mid \bar{C}_{t}=0, \bar{A}_{t-1}=\bar {a}_{t-1}, \bar{L}_{t-1},W)Q_{W}(W), \end{eqnarray*} where $\bar{a}_t=(a_1,\ldots,a_t)$ is the component of the fixed regime up until time-point~$t$. The targeted parameter of interest, specifically the marginal mean under a fixed breastfeeding regimen $\bar{a}$, can then be described as $\hat{\psi}_{\bar{a}}=E_{Q} Y^{\bar{a}}$ where the expectation is taken under $Q^{\bar{a}}$. Because the intermediate variables $L_t, 1\leq t \leq K-1$, are binary, the expression for $\psi_{\bar{a}}=E_{Q} Y^{\bar{a}}$ simplifies to \begin{eqnarray}\label{Gcompform} \psi_{\bar{a}}&=&\int_{W} \sum _{l_1=\{0,1\}}\cdots\sum_{l_{K-1}=\{0,1\} } E(Y \mid C_K=0, \bar{A}_{K-1}=\bar{a}, \bar{L}_{K-1}=\bar {l}_{K-1},W)\nonumber\\[-1pt] &&\hspace*{102pt}{}\times \operatorname{Pr}(L_{K-1}=l_{K-1} \mid\bar{C}_{K-1}=0, \nonumber \\[-10pt] \\[-10pt] \nonumber &&\hspace*{130pt}{}\bar{A}_{K-2}=\bar {a}_{K-2},\bar{L}_{K-2}= \bar{l}_{K-2},W)\cdots \\[-1pt] &&\hspace*{102pt}{}\times \operatorname{Pr}(L_1=l_1 \mid C_1=0,W)Q_{W}(W)\,dW. \nonumber \end{eqnarray} Each component of the above expression can be estimated from the observed data. Only the conditional mean of $Y$ and the conditional probabilities for $L_t, 1\leq t \leq K$, must be fit to produce a G-computation estimate. The mean and the conditional probabilities can be estimated using any parametric method as desired. To obtain an estimate of the parameter using G-computation, first get a prediction of each conditional expectation and probability in equation (\ref{Gcompform}) for each subject, $i$. The $Q_{W}$ can be estimated using the empirical density so that $Q_{W}(w_i)=1/n$ for each subject (with baseline variables $w_i$). Then, the predicted values for the conditional expectation and probabilities are combined according to equation~(\ref{Gcompform}), where the integral is replaced by summation over all subjects, $i$. G-computation does not rely on the full specification of the density $Q$. However, it requires correct specification of the conditional models for the mean and each of the probabilities in order to obtain unbiased estimation of the parameter $\psi_{\bar{a}}$. No closed form or asymptotic result is available for the G-computation standard error, so using a nonparametric bootstrap is often suggested~[\citet {Snowden:001}]. To properly assess the variance in the clustered design, the analyst might use the pairs clustered bootstrap~[\citet {Cameron:001}] by resampling clusters instead of individuals. \subsection{Sequential G-computation formulation}\label{altG} As suggested by Bang and Robins (\citeyear{Bang:001}) and used by~\citet{vdl:004}, an alternative decomposition of the parameter of interest, and therefore an alternative to the standard likelihood G-computation, can be constructed by taking sequential expectations of the outcome. Their result is an application of the property of iterated expectations. Under the causal assumptions of sequential exchangeability and consistency, the marginal mean under breastfeeding regime $\bar{a}$ and no censoring can be reexpressed as \begin{eqnarray} \psi_{\bar{a}}&=&E\bigl(Y^{\bar{a}}\bigr) \nonumber \\[-1pt] &=&E\bigl\{ E( Y \mid C_K=0,\bar{A}_{K-1}= \bar{a}_{K-1},\bar{L}_{K-1},W ) \bigr\} \nonumber \\[-10pt] \\[-10pt] \nonumber &=&E\bigl[ E\bigl\{ E( Y \mid C_K=0,\bar{A}_{K-1}= \bar{a}_{K-1},\bar{L}_{K-1},W ) \mid\\[-1pt] &&\hspace*{62pt}{} C_K=0, \bar{A}_{K-2}=\bar{a}_{K-2},\bar{L}_{K-2},W \bigr\} \bigr] \nonumber \end{eqnarray} by sequentially breaking up the expectations into nested conditional expectations. This decomposition of the expectations is continued until the outermost\vadjust{\goodbreak} expectation is only conditional on $W$. In order to obtain an estimate of the parameter using this decomposition, a~model must be fit for each level of conditioning, beginning with the innermost expectation. To more easily refer to each model fit, \citet{vdl:004} described the conditional models of the counterfactuals iteratively. Let \[ \bar{Q}_{K}=E( Y \mid C_K=0,\bar{A}_{K-1}= \bar{a}_{K-1},\bar{L}_{K-1},W ) \] be the outcome expectation conditional on the full history, for those who followed the regime $\bar{a}$ and were fully observed. The fit $\bar {Q}_{K}$ is obtained using a conditional modeling method. Then, recursively define \begin{eqnarray*} \bar{Q}_{t}&=&E( \bar{Q}_{t+1} \mid C_{t}=0, \bar{A}_{t-1}=\bar {a}_{t-1},\bar{L}_{t-1},W ), \qquad t=K-1, \ldots,2, \\ \bar{Q}_1&=&E( \bar{Q}_2 | W) \end{eqnarray*} for each successive nested expectation. The overbar in $\bar{Q}_t$ denotes a mean. This alternative decomposition of the parameter can be used to compute an estimate of the parameter of interest using the following algorithm. It is done by producing model fits for each of the $\bar{Q}_t$'s, obtaining predictions for each individual, and then taking a mean of $\bar{Q}_1$ over all participants. Specifically, the estimation algorithm proceeds as follows: \begin{longlist}[1.] \item[1.] First, model the outcome $Y$ given all of the covariate history, for only those completely uncensored subjects with observed breastfeeding regime $\bar{A}_{K-1}=\bar{a}_{K-1}$. This can be done using logistic regression or any appropriate prediction method. (Alternatively, a general conditional expectation conditional on $\bar {A}_{K-1}$ can be fit using all uncensored subjects and then evaluated at $\bar{a}_{K-1}$ in order to smooth over all observations.) \item[2.] Then, using the model produced in (1), predict the conditional outcome for all subjects (including those censored), resulting in the fit $\bar{Q}_{K,n}$. Then, iteratively for $t=K,\ldots,2$, \item[3.] Fit a model for $\bar{Q}_{t,n}$ from the previous step conditional on covariates $\bar{L}_{t-1}$ using only subjects uncensored up until time $t-1$ (i.e., subjects with $C_{t-1}=0$) with observed breastfeeding status $\bar{A}_{t-2}=\bar{a}_{t-2}$. (Again, this model can be alternatively fit using all uncensored subjects, conditioning on $\bar {A}_{t-2}$, and then evaluating at $\bar{a}_{t-2}$.) \item[4.] For all subjects, predict a new conditional outcome from this last model, producing the fit $\bar{Q}_{t-1,n}$. \end{longlist} Repeat steps 3 and 4 for each time point (going backward in time) until predictions $\bar{Q}_{1,n}$ are obtained for the outcome conditional on only the baseline covariates, $W$. The parameter estimate is then obtained by taking a mean of $\bar{Q}_{1,n}$ over all observations. As in the previous G-computation method, variance estimates are computed using bootstrap cluster resampling. Note that the above procedure does not depend on the type or dimension of the variables $L_t$ and $W$, and fits one model per time point (where there is an intervention or censoring).\vadjust{\goodbreak} \subsection{Efficient estimation for longitudinal data} Both G-computation algorithms described here require correct specification of different decompositions of the underlying data generating form. Alternatively, efficient semiparametric estimation allows for root-$n$ consistent estimation with the added benefit of double robustness [\citet{vdl:005,Tsiatis}]. Briefly, influence curves are weighted score functions that contain all of the information about the asymptotic variance of the related estimator. The \emph{efficient influence curve} for a given parameter is the influence curve that reaches the minimal variance bound. One possible way of obtaining efficient semiparametric inference is to estimate the components of the efficient influence curve and then use it as an estimating equation by setting it equal to zero and solving for the target parameter. Corresponding to the original G-computation factorization of the likelihood, \citet{vdl:002} derived a representation of the efficient influence curve for a longitudinal form with binary intermediate variables. Similarly, \citet{Stitelman:001} modified the corresponding theory for survival data. The alternative formulation for the efficient influence curve was developed by \citet{Bang:001} and used by \citet {vdl:004}, allowing for a general longitudinal form and much easier estimation procedures for higher-dimensional or more complex longitudinal data. Let $\bar{g}_{t}, t=2,\ldots,K$, be the probability associated with obtaining a given history of breastfeeding $\bar{a}$ up until time $t-1$ and no censoring up until time-point $t$, conditional on the observed history $\bar{L}_{t-1}$ and $W$. Specifically, let \begin{eqnarray}\label{propensity} &&\bar{g}_{t}(\bar{L}_{t-1},W)\nonumber\\ &&\qquad=\operatorname{Pr}(C_1=0 \mid W ) \nonumber \\[-8pt] \\[-8pt] \nonumber &&\qquad\quad{}\times\prod_{k=2}^{t} \bigl\{ \operatorname{Pr}(C_k = 0 \mid\bar{A}_{k-1} = \bar{a}_{k-1}, C_{k-1} = 0, \bar{L}_{k-1},W)\\ &&\hspace*{32pt}\qquad\quad{}\times\operatorname{Pr}(A_{k-1}=a_{k-1} \mid\bar{A}_{k-2}= \bar{a}_{k-2}, C_{k-1}=0, \bar{L}_{k-1},W) \bigr\}\nonumber \end{eqnarray} for $t=2,\ldots,K$, and where $A_0$ and $a_0$ are null sets. Further, let $\bar{g}_{1}(W)=\operatorname{Pr}(C_1=0 \mid W )$ be the probability of being uncensored at the first time point, conditional on baseline covariates, $W$. These probabilities can be estimated using logistic regression, for instance. As derived and explained for a general longitudinal structure in~\citet{vdl:004}, the efficient influence curve $D(O)$ for a fixed $\bar{a}$ can then be written recursively for the PROBIT data as the sum of the components \begin{eqnarray}\label{EIF} D_{t}&=&\frac{I(\bar{A}_{t-1}=\bar{a}_{t-1},C_{t}=0)}{\bar{g}_{t}}(\bar {Q}_{t+1}- \bar{Q}_{t}) \qquad\mbox{for } t=K,\ldots,2,\nonumber \\ D_{1}&=&\frac{I(C_1=0)}{\bar{g}_{1}}(\bar{Q}_2-\bar{Q}_1)\quad \mbox{and} \\ D_0&=&(\bar{Q}_1-\psi_{\bar{a}}), \nonumber \end{eqnarray} where $\bar{Q}_{K+1}=Y$ is defined for notational convenience (and the dependencies of some components repressed). $I(\cdot)$ is an indicator function. With each of the $\bar{g}_t$ and $\bar{Q}_t$ components estimated using any given prediction method, the parameter $\psi_{\bar{a}}$ can be estimated by setting the sum of the $K+1$ components equal to zero and solving for $\hat{\psi}_{\bar{a}}$. In addition to being efficient, such an estimator is double robust: it is consistent if either the models for $\bar{Q}_t,t=1,\ldots,K$, or the models for $\bar {g}_{t},t=1,\ldots,K$, contain the truth. \subsection{TMLE using the alternative G-computation formulation} The sequential G-computation method described in Section~\ref{altG} is a substitution estimator because it is a function of a component of the likelihood, specifically the nested conditional expectations, $\bar {Q}_t$. The general TMLE procedure begins with some choice of substitution estimator, but modifies this estimator by updating the fits of the conditional expectations in order to produce a parameter estimate that satisfies the equation of the efficient influence curve set equal to zero. This parameter estimate is efficient and double robust. The general TMLE procedure has been described previously, for example, by \citet{vdl:001,Gruber:001,Rosenblum:001}. Details regarding the construction of the sequential longitudinal estimator are given by~\citet{vdl:004}. The first step in the TMLE procedure is to fit the conditional densities $\{\bar{Q}_t,t=1,\ldots,K\}$ using a method of choice. For the update step, the logistic loss function is chosen even for our case of an integer-valued outcome (which is reduced to proportions by shifting and scaling the vector to $[0,1]$) due to the boundedness properties of the inverse of its canonical link function. The logistic loss becomes particularly valuable when there is sparsity at certain levels of the covariates or exposure [\citet{Gruber:001}]. The next step is to fluctuate each of the initial density estimates $\{ \bar{Q}_{t,n},t=K,\ldots,1\}$, starting at $t=K$, with respect to a new parameter, $\varepsilon_t$. A subscript $n$ will be used to denote a fitted value. The fluctuation function for each $\bar{Q}_{t}(\varepsilon _t)$ can be described as \begin{equation} \operatorname{logit}\bar{Q}^1_{t}(\varepsilon_t)= \operatorname{logit}\bar {Q}_{t}+\varepsilon_t G_t,\qquad t=1,\ldots,K, \label{flux2} \end{equation} for some expression $G_t$. Again letting $\bar{Q}_{K+1}=Y$, the estimate for $\varepsilon_t$ is found by minimizing the empirical mean of the logistic loss function \begin{equation} \label{loss2}\mathcal{L}\bigl\{\bar{Q}^{1}_{t}( \varepsilon_t)\bigr\}=-\bigl[\bar {Q}_{t+1}\log\bigl\{ \bar{Q}^{1}_{t}(\varepsilon_t)\bigr\}+(1- \bar{Q}_{t+1})\log\bigl\{ 1-\bar{Q}^{1}_{t}( \varepsilon_t)\bigr\}\bigr], \end{equation} which is equivalent to solving the empirical mean score (or derivative of the loss function) at zero. This requires that the function $G_t$ be defined and estimated. According to the general TMLE procedure, the above fluctuation function in equation~(\ref{flux2}) is required to satisfy two conditions: (1) the fluctuation function must reduce to the original density when $\varepsilon_t=0$, and (2) the derivative with respect to $\varepsilon_t$ of the loss function at $\varepsilon_t=0$ must linearly span the efficient influence curve. The first condition is clearly satisfied when $\varepsilon_t=0$. Taking the derivative of the loss function in equation~(\ref{loss2}) with respect to $\varepsilon_t$ gives \[ \frac{d \mathcal{L}(\bar{Q}^{1}_{t,n}(\varepsilon_t))}{d\varepsilon_t} \bigg\vert_{\varepsilon_t=0}=G_t\times( \bar{Q}_{t+1}-\bar{Q}_{t}),\qquad t=1,\ldots,K. \] Therefore, the score spans the efficient influence curve when $G_t$ is defined as \[ G_t(C_t,\bar{A}_{t-1},\bar{L}_{t-1},W)= \frac{I(C_t=0,\bar{A}_{t-1}=\bar {a}_{t-1})}{\bar{g}_{t}}. \] The covariate $G_t$ is often described as ``clever'' because it allows the score to span the efficient influence curve. The update step is carried out by minimizing the empirical mean of the loss function, $\mathcal{L}\{\bar{Q}^{1}_{t,n}(\varepsilon_t)\}$, with respect to $\varepsilon_t$. This is equivalent to running the logistic regression in equation~(\ref{flux2}): no intercept, with offset logit$(\bar{Q}_{t,n})$ and unique covariate $G_t(C_t,\bar{A}_{t-1},\bar {L}_{t-1},W)$. Let $\hat\varepsilon_t$ be the estimate of the coefficient for $G_t$, which is the maximum likelihood estimate (or, equivalently, the minimum loss-based estimate) for $\varepsilon_t$. Once all of the densities have been updated to give $\{\bar {Q}^{1}_{t,n},t=K,\ldots,1\}$, the parameter $\psi_{\bar{a}}$ is estimated as the mean of $\bar{Q}^{1}_{1,n}$ over all subjects, that is, $\hat {\psi}_{\bar{a}}=\frac{1}{n}\sum_i \bar{Q}^{1}_{1,n}(W=w_i)$ (where $w_i$ is the observed baseline vector for subject $i$). This TMLE is double robust: it is consistent if either the models for $\bar{Q}_t,t=1,\ldots,K$, or the models for $\bar{g}_{t},t=1,\ldots,K$, contain the truth. In addition, because of the usage of the logistic loss function and the corresponding fluctuation function in equation~(\ref{flux2}), the parameter estimates are bounded, regardless of the size of the weights, $\bar{g}_{t}^{-1}$. This makes TMLE robust to certain kinds of data sparsity that cause large weights. A comparison of the fundamental qualities of the G-computation estimators, TMLE and IPTW, can be found in Table~\ref{compare}. \begin{table} \caption{Comparison of methods}\label{compare} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccc@{}} \hline & \textbf{Required for} & \textbf{Robust to} & \textbf{Variance} & \textbf{Respects parameter}\\ \textbf{Method}& \textbf{consistency} & \textbf{data sparsity} & \textbf{estimate}& \textbf{boundaries}\\ \hline G-comp.& CE & $\checkmark$ & BS & $\checkmark$ \\ G-comp. seq.& NE & $\checkmark$ & BS & $\checkmark$ \\ IPTW & propensity & $\times^*$ & EIC/BS & $\times$\\ TMLE & propensity or NE & $\checkmark$ & EIC & $\checkmark$ \\ \hline \end{tabular*} \tabnotetext[]{}{CE: conditional expectations; NE: nested expectations; BS: bootstrap; EIF: efficient influence curve; propensity: the conditional probabilities of intervention (e.g., breastfeeding) and censoring. *Improvement under weight stabilization.} \end{table} \subsubsection{TMLE procedure for the PROBIT data}\label{PROBITproc} We observed the following procedure in our estimation of the parameter $\psi_{\bar{a}}$, for a given breastfeeding regimen $\bar{a}$. As described above, our interpretation of the structure of the PROBIT data set is $O=(W,C_1,L_1,A_1,C_2,L_2,\ldots,A_{5},C_{6},Y)$. There are six intervention nodes: censoring can occur at any of them and breastfeeding status is assessed at $t=1,\ldots,5$. All subjects are initially breastfeeding, so breastfeeding regimen is equivalent to the total duration of breastfeeding. If a subject has been censored, impute their missing $L_t$ and $Y$ variables with zero values: \begin{enumerate}[1.] \item[1.] Fit models predicting breastfeeding and censoring (resp.) at each time point, conditional on all previous history. For each model, compute a predicted probability for each subject conditional on $\bar{A}_t=\bar{a}_t$ and $C_t=0$. \begin{itemize} \item Given the monotone nature of breastfeeding, if $\bar {a}=(1,0,0,0,0)$, for instance, the predicted probability of \emph{not} breastfeeding at time 3 will be one for all participants, since it is conditional on stopping before time 2. \end{itemize} \item[2.] Using the predictions from step 1, calculate the propensity score $\bar{g}_{t,n}$ from equation~(\ref{propensity}) for each subject. \item[3.] Set $\bar{Q}_{7,n}=Y$, where $Y$ is rescaled to $[0,1]$. Then, for $t=6,\ldots,1$, \begin{itemize} \item For the subset of subjects with $\bar{A}_{t-1}=\bar{a}_{t-1}$ and $C_t=0$, fit a model for $E(\bar{Q}_{t+1,n} \mid\bar{L}_{t-1})$. Using this model, predict the conditional outcome for all subjects and let this vector be denoted $\bar{Q}_{t,n}$. \item Construct the ``clever covariate'' $G_t(C_t,\bar{A}_{t-1},\bar {L}_{t-1},W)=I( C_t=0,\break \bar{A}_{t-1}=\bar{a}_{t-1})/\bar{g}_{t,n}$. \item Update the expectation by running a no-intercept logistic regression with outcome $\bar{Q}_{t+1,n}$, the fit $\operatorname{logit}(\bar {Q}_{t,n})$ as an offset and clever covariate $G_t$ as the unique covariate. Let $\hat\varepsilon_t$ be the estimated coefficient of $G_t$. \item Update the fit of $\bar{Q}_t$ by setting \[ \bar{Q}^{1}_{t,n}=\operatorname{expit}\bigl\{\operatorname{logit}( \bar{Q}_{t,n})+\hat\varepsilon _tG_t( \bar{A}_{t-1}=\bar{a}_{t-1},C_t=0, \bar{L}_{t-1})\bigr\} \] and then obtain a predicted value of $\bar{Q}^{1}_{t,n}$ for all subjects.\\ Note that the model for $\bar{Q}_1$ is modeled using only subjects with $C_1=0$. The resulting fit $\bar{Q}_{1,n}$ is only conditional on $W$ and is estimated for all subjects. \end{itemize} \item[4.] Having fit $\bar{Q}^{1}_{1,n}$ for each subject, take the mean. Rescale the mean (do the inverse of the original scaling of $Y$). This is the TMLE for $\psi_{\bar{a}}$. \end{enumerate} The standard errors can be calculated using a sandwich estimator, which uses the influence curve to approximate the asymptotic variance. First, the value of the influence curve $D(O)$ is estimated for each subject. The clusters $Z_m$ are indexed by $m=1,\ldots,M$. Let $\rho _m=E(D_iD_j)$ for two elements in the cluster $Z_m$ and let $\sigma ^2_m=\operatorname{Var}(D_i)=E(D_i^2)$ be the common variance for subjects in cluster $Z_m$. Assuming independence between the clusters and common variance for elements in a cluster, the large sample variance of the estimator is approximated using \begin{eqnarray*} \sigma^2&=&1/n^2E \Biggl(\sum_{i=1}^n D_i \Biggr)^2 = \frac {1}{n^2} \sum _{m=1}^M\sum_{i,j\in Z_m} E(D_iD_j)I(i\neq j) + E\bigl(D_i^2 \bigr)I(i=j) \\ &=&\frac{1}{n^2} \sum_{m=1}^M n_m(n_m-1) \rho_m + n_m \sigma_m^2, \end{eqnarray*} where $n_m$ is the size of cluster $Z_m$. The supplemental article~\citet {Sup:SeqTMLE} contains details about the form of the influence curve under clustering. The expectations can be estimated by taking the empirical covariance and variance within each of the clusters. Confidence intervals are calculated assuming Normality of the estimator, using the estimate plus and minus 1.96 times the estimated standard error. \section{Analysis of the PROBIT}\label{sec4} The PROBIT data were analyzed by both G-computation methods; TMLE with parametric modeling of the sequential conditional means and conditional probabilities of breastfeeding and censoring (logistic main terms regression for binary breastfeeding status and censoring, and for the outcome shifted and scaled to $[0,1]$); TMLE with Super Learner to model the conditional expectations and probabilities; and a stabilized IPTW estimator. All models were implemented directly in R Statistical Software [\citet{R}] with the exception of Super Learner which we fit using the R library \texttt{SuperLearner} [\citet{SL}]. Super Learner calculates predictions using each method in a library, and then estimates the ideal combination of these results based on the $k$-fold cross-validated error. The library we chose included main terms logistic regression, generalized additive modeling [\citet{gam}], the mean estimate, a nearest neighbor algorithm [\citet{Ipred}], multivariate adaptive regression spline models [\citet{Earth}] and a stepwise AIC procedure [\texttt{stepAIC} from \citet{MASS}]. A stabilized IPTW estimator was computed by obtaining the solution of the empirical mean of \[ \bigl(Y-\hat{\psi}_{\bar{a}}^{\mathrm{IPTW}}\bigr)\frac{I(\bar{A}_{5}=\bar{a},C_6=0)({1}/{n})\sum\bar{g}_{6,n} }{\bar{g}_{6,n}} \] set equal to zero. To be consistent, IPTW relies on correct modeling of the breastfeeding and censoring probabilities in $\bar{g}_6$. IPTW was implemented using logistic regressions to fit each of these conditional probabilities. \begin{table} \caption{Differences in marginal expected number of infections under different breastfeeding durations}\label{results2} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ld{2.3}d{1.3}c@{}} \hline \textbf{Method} & \multicolumn{1}{c}{\textbf{Estimate}} & \multicolumn{1}{c}{\textbf{S.E.}}& \textbf{95$\%$ C.I.}\\ \hline \multicolumn{4}{c}{\emph{3--6 months vs 1--2 months}}\\ G-comp. (likelihood)& -0.032& 0.008& $(-0.046,-0.019)$\\ G-comp. (sequential)& -0.039& 0.013& $(-0.062,-0.016)$\\ IPTW& -0.021 & 0.011 & $(-0.042,0.000)$\\ Parametric TMLE& -0.027 & 0.010 & $(-0.045,-0.008)$\\ TMLE with SL& -0.039 & 0.010 & $(-0.058,-0.020)$\\[3pt] \multicolumn{4}{c}{\emph{9$+$ months vs 3--6 months}}\\ G-comp. (likelihood)& -0.013& 0.004& $(-0.020,-0.005)$\\ G-comp. (sequential)& -0.014& 0.013& $(-0.027,0.004)$\\ IPTW& -0.013 & 0.010 & $(-0.032,0.007)$\\ Parametric TMLE& -0.021 & 0.013 & $(-0.047,0.004)$\\ TMLE with SL& -0.024 & 0.007 & $(-0.038,-0.010)$\\[3pt] \multicolumn{4}{c}{\emph{9$+$ months vs 1--2 months}}\\ G-comp. (likelihood)& -0.045& 0.010& $(-0.065,-0.027)$\\ G-comp. (sequential)& -0.053& 0.018& $(-0.084,-0.020)$\\ IPTW& -0.034 & 0.014 & $(-0.061,-0.007)$\\ Parametric TMLE& -0.048 & 0.018 & $(-0.084,-0.012)$\\ TMLE with SL& -0.063 & 0.013 & $(-0.088,-0.038)$\\ \hline \end{tabular*} \tabnotetext[]{}{G-comp.: G-computation, using both methods described in the text, likelihood in Section~\ref{Gcomp2} and sequential in Section~\ref{altG}; TMLE: targeted maximum likelihood estimation; SL: Super Learner; IPTW: inverse probability of treatment weighting (stabilized).} \end{table} The standard errors for all methods except the G-computations were calculated using the sandwich estimator, adjusting for clustering as described in Section~\ref{PROBITproc}. The standard errors for the G-computation methods were estimated using pairs cluster bootstrap~[\citet{Cameron:001}] by resampling the 31 clusters with replacement, repeating 200 times, recalculating the estimates, and taking the standard error of the estimates. Confidence intervals were calculated by taking the 2.5th and 97.5th quantiles of the resampled estimates. Both G-computations were found to be sensitive to modeling choices when fitting the conditional expectations. In particular, we implemented both G-computations with Poisson regressions and with logistic regressions using a rescaled outcome. For the standard G-computation, both parametric specifications produced very similar point estimates, but the Poisson model was found to be highly unstable through the cluster bootstrapping while the logistic model was more stable. For the sequential G-computation, the Poisson model produced uninterpretable point estimates that deviated substantially from the other models, while the point estimates of the logistic model conformed more or less to the other results. Only the logistic results are therefore presented in the table. The estimates of three comparisons of interest are presented in Table~\ref{results2}. The first parameter of interest is the difference between the marginal expected number of infections (in the first year or life) for infants who were breastfed for between 3 and 6 months compared to infants who were breastfed for between 1 and 2 months. The second parameter compares infants who were breastfed for greater than 9 months to those breastfed for 3 to 6 months. The third parameter compares greater than 9 months to between 1 and 2. The table presents the estimates, standard errors and 95\% confidence intervals for each parameter of interest as calculated by each method.\looseness=1 All of the methods estimated a negative parameter value for the difference, corresponding with the interpretation that longer durations of breastfeeding reduce the expected number of gastrointestinal infections. TMLE with Super Learner and likelihood G-computation found a statistically significant difference for each comparison. Only IPTW found an insignificant estimate for the first comparison. Sequential G-computation, IPTW and parametric TMLE found an insignificant estimate for the second comparison. All methods determined that there is a true difference between the marginal mean infection counts for breastfeeding for over nine months versus between one and two months. The estimates of the difference parameters varies substantially between methods. In two of the comparisons, TMLE with Super Learner produced higher estimates than all of the other methods (almost twice the size of the smallest estimates). IPTW gave the smallest estimates of the differences. Likelihood G-computation consistently produced the smallest standard errors and TMLE with Super Learner produced the second smallest. \subsection{The validity of a causal interpretation}\label{causalassumptions} A causal interpretation of the analysis of the PROBIT data requires several important but untestable assumptions, including the sequential randomization assumption. In other words, all confounders are assumed to have been measured and included in $W$, including all prognostic factors of infection that also predict censoring. The complexities of the substantive matter make it challenging to believe that we identified all the common causes of breastfeeding cessation and infections [\citet{Kramer:003}]. However, we argue that by controlling for cluster as a baseline variable, much of this confounding effect may have been alleviated (this is investigated in Section~\ref{simstudy}). In addition, we must assume no interference between study units (mother/\break infant pairs) and that only one version of the treatment (i.e., breastfeeding) is applied to all units [together referred to as the stable unit treatment variable assumption, or SUTVA; \citet{Rubin:002}]. The assumption of no interference requires that the breastfeeding status of one mother does not influence the outcome of another's child. We believe this to be very plausible because mothers spent short periods of time in the hospital which limited their interaction. For the second assumption, due to the discretization of the study design, different durations of breastfeeding are grouped together. We must assume that it does not matter when a mother ceases to breastfeed within an interval. \section{Simulation study}\label{simstudy} A simulation study was performed where data were generated as a simplified version of the PROBIT data set. Five hundred subjects were generated in each of 31 clusters. The baseline covariates $W$ and $U$ were generated as Gaussian variables with cluster-specific means drawn from separate Gaussian distributions. The time-dependent variables $(C_1,L_1,A_1,C_2,L_2,A_2,C_3, L_3)$ were generated independently for each subject conditional on the subject's history, including baseline variables $W$ and $U$ (and not otherwise clustered). Binary variables $A_t, t=1,2$, indicate continued breastfeeding, $C_t, t=1,2,3$, are censoring indicators, and $L_t, t=1,2,3$, indicate the presence of infections. The outcome $Y=\sum_{t=1}^3 L_t$ is a count variable. Breastfeeding status was generated as conditional on the baseline variables and immediate preceding covariates at every time point. In particular, breastfeeding was specifically made to be less likely to continue when infection was indicated at the current time point. Breastfeeding (like censoring) is a monotone process, and so $A_2=1$ is only possible if $A_1=1$. The probability of censoring was conditional on baseline covariates and most recent infection status; censoring was less likely if breastfeeding continued at the previous time point and more likely if an infection occurred at the previous time point. Infections were generated conditional on baseline variables and breastfeeding for the past two visits, so that longer duration of breastfeeding decreased the probability of infection. The strengths of the associations between exposure/censoring and intermediate infections were designed to reflect the true PROBIT results. Details of the data generation can be found in the supplemental article~\citet{Sup:SeqTMLE}. The parameter $\psi_{\bar{a}}=E(Y_{\bar{a}})$ was estimated for $\bar {a}=(0,0)$ and $\bar{a}=(1,1)$. The parameter of interest, reflecting the first parameter of interest in the PROBIT study, was $\delta=\psi _{(1,1)} - \psi_{(0,0)}$. A concern we had during the planning of the PROBIT study was that we may be missing some important confounders of the effect of breastfeeding on infection. Therefore, we attempt to explore this issue in the simulation study by omitting the variable $U$ from the modeling. In a second modeling scenario, we illustrate how adjusting for the cluster like a baseline confounder can successfully adjust for unmeasured confounding that is characterized by the cluster itself. In addition, we test the scenario where $U$ is included in the modeling so that the results could be compared. Finally, we test a scenario where we suppose that the analyst is given transformed versions of $W$ and~$U$ [using two of the transformations in~\citet{Kang:001}] and the models are run using these transformed variables. \begin{table} \caption{Difference between marginal expected outcomes, by scenario. True value${} = -0.030$}\label{simresults2} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ld{2.3}d{4.0}ccd{3.0}@{}} \hline \textbf{Method} & \multicolumn{1}{c}{$\bolds{\hat\delta}$} & \multicolumn{1}{c}{\textbf{\% bias}} & \multicolumn{1}{c}{$\bolds{\operatorname{SE}(\hat\delta)}$} & \multicolumn{1}{c}{$\bolds{\operatorname{rMSE}(\hat\delta)}$} & \multicolumn{1}{c@{}}{\textbf{Coverage}$^\mathbf{a}$}\\ \hline &\multicolumn{5}{c}{\emph{Unmeasured confounder}}\\ G-comp. (likelihood)& -0.060&-99&0.017&0.035&49\\ G-comp. (sequential)& -0.062&-105&0.018&0.037&44\\ IPTW& -0.054&-77&0.021&0.023&100\\ Parametric TMLE& -0.058&-90&0.017&0.027&63\\ SL TMLE&-0.054&-79&0.019&0.024&78\\[3pt] &\multicolumn{5}{c}{\emph{Unmeasured confounder, adjusting for cluster}}\\ G-comp. (likelihood)&-0.033 &-11&0.008&0.009&92\\ G-comp. (sequential)& -0.035&-16&0.009&0.011&94\\ IPTW& -0.032&-6&0.010&0.009&94\\ Parametric TMLE& -0.032&-7&0.009&0.009&94\\ SL TMLE& -0.030&1&0.008&0.009&90\\[3pt] &\multicolumn{5}{c}{\emph{Adjusting for all confounders}}\\ G-comp. (likelihood)& -0.032&-4&0.008&0.009&91\\ G-comp. (sequential)& -0.034&-12&0.018&0.010&43\\ IPTW& -0.031&-1&0.010&0.009&93\\ Parametric TMLE& -0.031&-1&0.009&0.009&92\\ SL TMLE& -0.029&5&0.009&0.010&88\\[3pt] &\multicolumn{5}{c}{\emph{Transformed confounders}}\\ G-comp. (likelihood)& -0.068& -125&0.017 &0.042 &29\\ G-comp. (sequential)& -0.075& -147& 0.023&0.050 &20\\ IPTW& -0.062& -106&0.109 &0.125 &55\\ Parametric TMLE&-0.067 &-121 &0.041 &0.045 &36\\ SL TMLE&-0.033&-9&0.032&0.013&95\\ \hline \end{tabular*} \tabnotetext[]{}{SE($\delta$): the average standard error is the square-root of the mean of the variances, with each variance calculated using the influence curve for TMLE and IPTW and the nonparametric boostrap$^\mathrm{b}$ for G-comp. (likelihood) and G-comp. (sequential); rMSE: root mean squared error calculated over the simulated data sets; Coverage: mean coverage; TMLE: targeted maximum likelihood estimator; G-comp.: G-computation; IPTW: (stabilized) inverse probability of treatment weighting. $^\mathrm{a}$The estimated coverage is the $\%$ of data sets where the true value falls between (i) the estimate plus and minus 1.96 times the standard error of the estimate for TMLE and IPTW or (ii) the 2.5th and 97.5th bootstrap percentiles for the G-computation methods; $^\mathrm{b}$The bootstrap standard error was computed using 200 resamples from the data set of size $n=15\mbox{,}500$. \end{table} One thousand data sets of $500\times31=15\mbox{,}500$ observations were generated. Under each of the four modeling scenarios (unmeasured $U$, adjusting for cluster, adjusting for $U$ and transformed confounders), the performance of the TMLE was compared to G-computation, the sequential formulation of the G-computation formula and a stabilized IPTW estimator. TMLE was implemented in two ways: with main terms logistic regressions to estimate all probabilities and with Super Leaner, using only main terms logistic regression and a nearest neighbors algorithm in its library (a small subset of the library used in the PROBIT analysis). Standard errors were computed using influence curve inference where available and nonparametric bootstrap resampling otherwise (details in the footnote of Table~\ref{simresults2}). Due to the way the data were generated, the sequential G-computation was always incorrectly specified (in the model form), as were the outcome models for the TMLE. As a small departure from the real data, the simulated data allowed only one infection at each time interval (as opposed to more than one event). The G-computation used the information that the outcome was a sum of the first two binary infection variables and the additional binary variable, $L_3$, measured at time $t=3$. Thus, $Y=\sum_{t=1}^2 L_t + L_3$, so that the G-computation simplified to the empirical mean of \begin{eqnarray*} && \sum_{l_1=\{0,1\}}\cdots\sum_{l_K=\{0,1\}} \Biggl[ \Biggl\{\sum_{t=1}^2 L_t + E(L_3\mid C_3=0,\bar{A}_2= \bar{a}_2,\bar{L}_2=\bar{l}_2,W) \Biggr\}\\ &&\hspace*{60pt}\qquad{}\times \bigl\{p(L_2=l_2\mid C_2=0, \bar{A}_{1}=\bar{a}_{1}, \bar {L}_{1}= \bar{l}_{1},W) \bigr\}\\ &&\hspace*{190pt}{}\times p(L_1=l_1|C_1=0,W) \Biggr]. \end{eqnarray*} Note that using the information regarding the number of infections at each time interval for the PROBIT data analysis would have required fitting multinomial models in the likelihood G-computation. With so few subjects having more than one infection at any given time, we did not feel that substantial information could be added by increasing the complexity of the model for the applied example using a similar approach. \subsection{Simulation results} The results of each of the models under each modeling scenario are displayed in Table~\ref{simresults2}. With an unmeasured confounder related to cluster, both G-computation models performed the most poorly in terms of bias, root mean-squared error (rMSE) and coverage. TMLE produced an improvement in these measures, and adding Super Learner improved all measures of performance except for the standard error. IPTW had the lowest bias, but higher standard errors, resulting in overcoverage. When cluster was used as a surrogate for the unmeasured confounder, all of the methods produced results with much lower bias and standard errors. When all confounders were measured and adjusted for, G-computation, parametric TMLE and IPTW all had a reduction in bias compared to the previous scenario and performed ideally, despite parametric TMLE being model-misspecified in the outcome models. TMLE with Super Learner produced slight undercoverage. The sequential G-computation was model-misspecified and produced high bias and standard error, leading to poor coverage (since it is not double robust). When the confounders were transformed, all of the parametric models were incorrectly specified, leading to high bias and low coverage. Among the parametric models, IPTW had the lowest bias and the highest root mean-squared error. TMLE with Super Learner (using only one data adaptive algorithm in its library) was essentially unbiased with ideal coverage. \section{Discussion}\label{sec6} In this article we applied five different causal methods to the PROBIT data to obtain estimates of the differences in the marginal expected number of infection counts for different breastfeeding durations. All methods agreed that extending the duration of breastfeeding significantly lowers the expected number of gastrointestinal infections. TMLE with Super Learner produced much larger effect estimates, for example, its estimate was almost double the IPTW estimate for the comparison between 1--2 and 9$+$ months of breastfeeding. This represents a clinically important difference in the estimated effect. Super Learner also reduced the higher standard error of the TMLE procedure to a level comparable to that of the G-computation (which is an efficient parametric estimator). Using the mean estimate from TMLE with Super Learner, altering the breastfeeding durations of 16 mothers from between one and two months to over nine months will avoid one infant infection (i.e., the Number Needed to Treat or NNT) on average in this population. This can roughly be compared with the intention-to-treat result in the original PROBIT study [\citet{Kramer:001}], where they obtained a NNT of 24 for the presence of \emph{any} gastrointestinal infection over the first year when contrasting subjects who did and did not receive the breastfeeding intervention. We have therefore shown that breastfeeding itself might have a larger impact on childhood infections than suggested by the original PROBIT analysis. In the simulation study we generated baseline confounders from a distribution with a cluster-specific mean. The simulation results demonstrated that bias (and inflated standard error) incurred by cluster-specific unmeasured confounders can be adjusted for using the cluster indicators themselves as baseline covariates. We also showed that under the plausible scenario of being given transformed versions of the confounders, only TMLE with Super Learner was able to unbiasedly estimate the parameter of interest. TMLE is a double-robust method, as it only requires correct specification of the conditional probabilities of the intervention (here, breastfeeding and censoring) or of the nested conditional expectations of the outcome (the $\bar{Q}_t$'s) to be consistent. Contrastingly, IPTW relies on correct specification of the probabilities of the intervention, and the G-computations rely on correct specification of the outcome models. When the probabilities of intervention are modeled in the same way for IPTW and TMLE, in absence of data sparsity, and when the outcome models are incorrectly specified, these two methods are expected to perform similarly (as seen in the simulation study and possibly in the PROBIT results). In many other contexts, advantages of longitudinal TMLE over IPTW and G-computation have been established through simulation study in \citet {vdl:004}, \citet{Petersen:001}, \citet{Stitelman:001}, and \citet {Schnitzer:001}. It is important to note that for longitudinal data with time-dependent confounding, there may not exist a data generating distribution that corresponds to the way the outcome is modeled in the TMLE (i.e., in the sequential G-computation). Therefore, we recommend that data adaptive methods like Super Learner always be used with TMLE in the longitudinal setting. Because TMLE with Super Learner is arguably the most reliable estimator (assessed through theory and simulation studies), we have reason to believe that the magnitude of the effect of breastfeeding is actually larger than suggested by the methods that use parametric modeling and larger than the effect reported in the original PROBIT analysis. \section*{Acknowledgments} The authors acknowledge the usage of Consortium Laval, Universit\'e du Qu\'ebec, McGill and Eastern Qu\'ebec computing resources. In addition, the authors would like to thank Michael Kramer for unrestricted access to the PROBIT data set. The PROBIT was supported by grants from the Thrasher Research Fund, the National Health Research and Development Program (Health Canada), UNICEF, the European Regional Office of WHO and the CIHR. \begin{supplement}[id=suppA] \stitle{The efficient influence curve for clustered data and data generation for the simulation study} \slink[doi]{10.1214/14-AOAS727SUPP} \sdatatype{.pdf} \sfilename{aoas727\_supp.pdf} \sdescription{Derivation of the efficient influence curve used in the TMLE analysis. Full description (with R code) of the data generation used in the simulation study.} \end{supplement}
{'timestamp': '2014-08-01T02:08:46', 'yymm': '1407', 'arxiv_id': '1407.8371', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8371'}
arxiv
\section{Introduction}\label{sec1} Alzheimer's disease (AD) is the most frequent cause of dementia in our increasingly aging societies, representing a significant impact on the US population with 10\% prevalence in individuals aged above 70 years old [\citet{plassman07}]. Despite the prevalence, this disease remains quite a mystery; there is neither a cure nor a definite treatment to arrest its course and, currently, the only definite way to diagnose AD is to examine the brain tissue after death. According to recent studies [\citet{Leifer03}], early diagnosis of AD is of great value since new drug therapies can be used to potentially delay the progression of the disease. To this end, much progress has been made in assisting the early diagnosis of AD with neuroimaging techniques. One such widely used neuroimaging technique is positron emission tomography (PET) imaging, which is one of the most promising tools for the early diagnosis of AD, and it is of great scientific interest in understanding the association between PET images and cognitive impairment. In particular, the fluorodeoxyglucose (FDG) PET has been used to measure the cerebral glucose metabolic activity for over 20 years. FDG PET scans used in the preparation of this article were obtained from a large multi-center follow-up study on Alzheimer's disease and early dementia, the Alzheimer's Disease Neuroimaing Initiative (ADNI). A total of 403 FDG PET scans were acquired for this application, including 102 normal control (NC) subjects, 206 subjects with mild cognitive impairment (MCI) and 95 subjects diagnosed with AD. In this study, we consider the baseline FDG PET scans with a standard $160\times 160\times96$ voxel image grid as the predictor to the cognitive performance as measured by the mini-mental state exam (MMSE), which is a questionnaire test that is used to screen for cognitive impairment [\citet{Cockrelletal88}]. The maximum MMSE score is 30 and, on average, MMSE scores decline as the disease progresses. The goal of our study is to identify brain subregions that are most closely related to the prediction of MMSE scores. Many methods have been developed for the analysis of brain image data in order to identify disease-related brain subregions. Most of these methods focus on region of interest (ROI) and voxel-based univariate analysis; see, for example, \citet{Luoetal03}, \citet {Grimmeretal09} and \citet{Shinetal10}, among many others. For AD in particular, several studies have shown that reduced metabolic activity in some regions of the brain, such as the posterior cingulate and the temporal and parietal cortices, are associated with the progression of cognitive impairment [\citet{Fosteretal84}, \citeauthor{Minoshimaetal95} (\citeyear{Minoshimaetal95,Minoshimaetal97})]. These methods are intended to provide statistics by doing a separate analysis for each ROI or voxel and then to draw inferences at the region- or voxel-level. As a result of testing millions of hypotheses, appropriate adjustments for multiple comparisons have to be considered. In the neuroimaging literature, a distinction is often drawn between such univariat analyses and an alternative, multiple covariate regression models that treat every voxel as a covariate. Since the number of voxels is much larger than the number of scans, the ordinary least squares for linear regression cannot be implemented without applying, for example, some dimension reduction techniques. Such analysis, however, may lead to difficulties in interpretations and practical implications. Both the traditional univariate and multiple covariate approaches (if applicable) have one major limitation in common: they are developed without considering the spatial information of the brain, possibly resulting in some loss of information. There is an emerging awareness of the importance of taking such information into account. For example, multiple covariate analysis can be conducted with a focus on extracting principal components from the images [\citet {Fetal96}, \citet{Kerroucheetal06}]. More recently, a variety of Bayesian spatial modeling approaches have been proposed to model the correlation between neighboring voxels, which need to carefully specify the prior distributions; see, for example, \citet{Bowmanetal08}, \citet{Kangetal11}. Our way of addressing this issue is to treat the entire 3D image as a single functional input, which allows retaining all the information from the original image without modeling the spatial correlation between voxels explicitly. Specifically, in this article, we treat PET image data as the 3D functional observations, and propose a novel Haar wavelet-based regularized approach to analyze PET image data in the framework of functional data analysis. Functional regression models are known as one of the standard techniques in functional data analysis. It is noted that the models can be defined as functional in one or both of two ways: the response variable is functional; at least one of the covariates is functional. In this article, we focus on the functional linear regression model with a scalar response variable and a single functional predictor. Using the 1D case as an illustration, the functional linear regression model relates a scalar response variable $Y$ to a functional predictor $X(t)$ as follows: \begin{equation} \label{1dmodel} Y_{i} =\beta_{0}+ \int_{0}^{T} X_{i}(t)\beta(t) \,dt+\varepsilon_{i}, \qquad i=1,\ldots,n, \end{equation} where $\beta(t)$ is the regression coefficient function and $t$ refers to time or location. For the 3D case we consider later, $t$ is replaced by the coordinate $(u,v,w)$. Regularization methods, such as the roughness penalty approach or using restricted basis functions [\citet{ram97}], can be implemented to produce an estimator of $\beta(t)$ that is meaningful in interpretation and useful in prediction. For the functional linear regression model (\ref{1dmodel}), \citet {Jamesetal2009} proposed a regularized approach that focuses on producing sparse and highly interpretable estimates of the coefficient function $\beta(t)$. This approach involves first dividing the domain into a fine grid of points, and then using appropriate variable selection methods to determine whether the $d$th derivative of $\beta (t)$ is zero or not at each of the grid points, that is, $\beta ^{(d)}(t)=0$ for one or more values of $d \in\{0,1,2,\ldots\}$. They proposed the Dantzig selector [\citet{Candes07}] and a Lasso-type approach for the estimation of $\beta(t)$ using piecewise constant basis, where the Dantzig selector seems to be more natural. Empirical results show that their methods perform well when $p$, the number of basis functions, is not too large. When functional data are measured over a very fine grid such as brain image data, the Dantzig selector faces the challenge of solving a huge linear programming problem and the Lasso-type algorithm can be\vadjust{\goodbreak} extremely slow; note that for the latter the fast coordinate descent algorithm [\citet{Fu98}, \citet{Daub04}, \citet {Friedmanetal07}, \citet{Wu08}] does not apply due to the penalty on derivatives. Without imposing sparsity, \citet{ReissOgden2010} considered the functional principal component regression for image data.\looseness=-1 In this article, we choose the Haar wavelet basis instead of the piecewise constant basis for analyzing 3D image data and show that the Haar wavelet-based approach presents a number of advantages. First, it yields regional sparseness without imposing constraints on derivatives, which is needed in \citet{Jamesetal2009}. In other words, by shrinking corresponding wavelet coefficients to zero, the estimator of the regression coefficient function can be exactly zero over regions where no relationship to the response variable is present. Second, the Haar wavelet transform offers a way to overcome the issue of high multicollinearity caused by high neighboring spatial correlations. Third, our approach is flexible enough to allow the coefficient function to be estimated at different levels of smoothness through choosing different levels of the Haar wavelet decomposition. Fourth, the Haar wavelet transform can be applied as a dimension reduction technique prior to model fitting for high-dimensional image data by setting a common set of close to zero wavelet coefficients of PET images to zero, which is an effective way of removing voxels outside the brain or in the ventricles. It should be noted that a recent article by \citet{zhaoetal12} considered a general wavelet-based Lasso approach in functional linear regression, but only concerned 1D $\beta(t)$. The Haar wavelet transform is a useful tool for image and signal analysis and has many other applications. For example, \citet{Sauxetal12} and \citet{Lovejoyetal12} discussed the use of Haar wavelet transforms in geophysics and climate research. The rest of this article is organized as follows. In Section~\ref{sec2} we review some background on wavelet decomposition and properties of Haar wavelet basis functions using a 1D functional linear regression model as an illustration and then propose the $\ell_1$ regularized shrinkage estimation for general functional data, including both 1D and 3D cases. To evaluate the numerical performance of our approach, we conduct extensive simulations in Section~\ref{sec3}. We present the analysis of ADNI 3D PET image data in Section~\ref{sec4} and make some concluding remarks in Section~\ref{sec5}. We also show that the proposed method achieves the desirable nonasymptotic error bounds for prediction and estimation, the so-called oracle inequalities, meaning that the method performs equally well (up to a constant) as if the true subregions with nonzero regression coefficient were given. The theoretical results are provided in the online supplementary material [\citet{Wangetal2014}]. \section{Regularized Haar wavelets method}\label{sec2} For ease of presentation, we describe the proposed methodology starting with the 1D case given in (\ref{1dmodel}), then extend it to the 3D case using a tensor product of three 1D wavelet expansions. \subsection{Choice of basis}\label{sec2.1} Basis expansions are commonly used in analyzing functional data. Among a variety of choices of basis expansions, wavelets have the important ability to allow simultaneous time (or space in this article) and frequency localization. Unlike many other commonly used basis systems, wavelet transforms are highly adaptable to different levels of smoothness and more capable of capturing edges, spikes and other types of discontinuities, especially for wavelet transforms with relatively small support such as the Haar wavelets. Wavelet transforms also provide a powerful tool to compress the data. A compressed approximation of the signal can be achieved by penalizing the wavelet coefficients [\citet{Wandetal11}], which involves shrinking small coefficients to zero and possibly shrinking the large ones without affecting the main features of the data. Hence, it is advantageous to use wavelet transforms to decompose images as well as the regression coefficient function for estimation. In many applications, it is often the case that the association between $X(t)$ and $Y$ in model (\ref{1dmodel}) is sparse and potentially discontinuous at the boundaries of subregions. In particular, only few brain subregions in the aforementioned PET images are believed to be related to cognitive impairment. To better identify such patterns, we choose to use Haar wavelets. The Haar wavelet transform is easily calculated and affected less by discontinuities. In addition, sparsity of $\beta(t)$ can be recovered by shrinking its wavelet coefficients to zero. The scaling function (also called a father wavelet) $\phi$ and the mother wavelet $\psi$ of Haar wavelets defined on $[0,1)$ are given below: \begin{eqnarray*} \phi(t) &=& \cases{ 1, &\quad if $0 \leq t < 1$; \vspace*{3pt}\cr 0, &\quad otherwise;} \\ \psi(t) &=& \cases{ 1, &\quad if $0 \leq t <1/2$; \vspace*{3pt}\cr -1, &\quad if $1/2 \leq t <1$; \vspace*{3pt}\cr 0, &\quad otherwise.} \end{eqnarray*} The Haar wavelet bases are then generated in the form of translations and dilations of the above father and mother wavelet functions as \begin{eqnarray*} \phi_{j,k}(t)&=&\sqrt{2^{j}}\phi\bigl(2^{j}t-k \bigr), \\ \psi_{j,k}(t)&=&\sqrt{2^{j}}\psi\bigl(2^{j}t-k \bigr), \end{eqnarray*} where $j=0,1,\ldots$ and $k=0,1, \ldots,2^{j}-1$. The index $j$ refers to dilations and $k$ refers to translations and $\sqrt{2^j}$ is the normalizing factor. It is noted that the basis functions are orthonormal. Therefore, for a sufficiently fine resolution $J$, the coefficient function $\beta(t)$ in (\ref{1dmodel}) defined on $[0, 1)$ can be expanded in a Haar wavelet series: \begin{equation} \label{beta-wavelet} \beta(t)=\sum_{k=0}^{2^{j_{0}}-1} a_{j_{0},k}\phi_{j_{0},k}(t)+ \sum_{j=j_{0}}^{J} \sum_{k=0}^{2^{j}-1}d_{j,k} \psi_{j,k}(t)+e(t), \end{equation} where\vspace*{1pt} $a_{j_{0},k}=\int_{0}^{1} \beta(t)\phi_{j_{0},k}(t) \,dt$ are the approximation coefficients at the coarsest resolution $j_{0}$, $d_{j,k}=\int_{0}^{1} \beta(t)\psi_{j,k}(t) \,dt$ are the detail coefficients that characterize the finer structures of $\beta(t)$ as $j$ grows, and $e(t)$ is the approximation error that goes to zero as $J$ goes to infinity. The Haar wavelet representation of a signal thus consists of approximations together with details that can provide the desirable frequencies. See, for example, \citet{Walker08} for more details about Haar wavelets. \subsection{Model estimation}\label{sec2.2} Rewrite $\beta(t)$ in (\ref{beta-wavelet}) by \begin{equation} \label{beta} \beta(t)=B(t)^T \eta+e(t), \end{equation} where $B(t)$ denotes the collection of all $\phi_{j,k}(t)$ and $\psi _{j,k}(t)$ in the above Haar wavelet expansion, and $\eta$ is the corresponding wavelet coefficient vector of length~$p$. Plugging (\ref{beta}) into (\ref{1dmodel}), we obtain \begin{equation} \label{linear-model} \qquad\quad Y_{i} =\beta_{0}+ \int_{0}^{1} X_{i}(t)B(t)^T \eta \,dt+\varepsilon_{i}^{*}= \beta_{0}+C_{i}^T\eta+\varepsilon_{i}^{*}, \qquad i=1,\ldots,n, \end{equation} where $C_{i}=\int_{0}^{1}X_{i}(t)B(t) \,dt $ and $\varepsilon_{i}^{*} = \varepsilon_i + \int_0^1 X_i(t)e(t) \,dt$. It should be noted that $C_{i}$ is the wavelet coefficient vector of $X_i(t)$ when we decompose $X_{i}(t)$ using the same set of Haar wavelet basis functions as those in (\ref{beta}). Model (\ref{linear-model}) can then be rewritten as follows: \begin{equation} \label{model} Y=\beta_{0}+C\eta+\varepsilon^{*}, \end{equation} where $C={}[ C_{1},C_{2},\ldots,C_{n}] ^T$ is an ${n\times p}$ design matrix in linear model (\ref{model}). Once an estimator $\hat\eta$ is obtained from (\ref{model}), $\beta(t)$ can then be estimated by $B(t)^T\hat\eta$. In practice, $X(t)$ is observed on only a finite set of grid points $\{ t_{1},\ldots,t_{p}\}$, which also determines the highest and yet practically meaningful level of decomposition for $\beta(t)$. For the discrete wavelet transform, $p$ is required to be a power of 2. Using the usual terminology for Haar wavelets [see, e.g., \citet {Walker08} and that used in the MATLAB Wavelet Toolbox (2011b)], we define the level 1 Haar wavelet decomposition by computing the average and the difference on each consecutive pair of values, and the maximum level is $\log_{2}p$. The level number is directly determined by the integer $j_0$ in (\ref{beta-wavelet}). For any level of Haar wavelet decomposition, the total number of basis functions $\phi_{j,k}$ and $\psi_{j,k}$ is always $p$, and the collection of $\phi_{j,k}$ and $\psi _{j,k}$ then forms a set of $p$-dimensional orthonormal basis functions. A key advantage of using Haar wavelets is as follows. When $\beta(t)=0$ in large regions of $t\in[0,1)$ (in the ADNI brain image analysis where $t$ is 3D, this would correspond to that large regions in the brain are not associated with the cognitive performance measured by MMSE), the coefficient vector $\eta$ in (\ref{beta}) should be sparse with $e(t)=0$ for those regions, that is, $\beta(t)$ can be well approximated by an economical wavelet expansion with few nonzero coefficients. We consider the Lasso approach [\citet{tib96}] and implement the method with the fast coordinate descent algorithm to obtain a desirable sparse solution for the wavelet coefficients. For a given $j_0$, which corresponds to a specific level of Haar wavelet expansion, the Lasso estimator for $\eta$ is given by \begin{equation} \label{lasso} \hat{\eta}=\mathop{\arg\min}_{\eta} \biggl\{ \frac{1}{n}\|Y-\beta_{0}-C\eta\|_{2}^{2}+2 \lambda\|\eta\|_{1} \biggr\}, \end{equation} where $\|\cdot\|_{1}$ and $\|\cdot\|_{2}$ denote the $\ell_{1}$ and $\ell_{2}$ norms, respectively, and $\lambda\geq0$ is a tuning parameter. In our estimating procedure, $j_0$ is also a tuning parameter. It should be noted that in general the Haar wavelet coefficients with large magnitudes are related to salient features. The magnitudes of detail coefficients should be proportional to the differences between every pair of values, that is, larger magnitudes indicate sharper changes at corresponding locations and zero magnitudes indicate no change. If both detail and approximation coefficients of the Haar wavelet transform are close to zero, then $\beta(t)$ is close to zero. Thus, we are able to obtain a sparse solution of $\beta(t)$ by shrinking its small wavelet coefficients to zero. \subsection{Selection of tuning parameters}\label{sec2.3} In addition to the Lasso tuning parameter $\lambda$ in (\ref{lasso}), we also need to take into account the level of the Haar wavelet decomposition. There should exist an optimal level of decomposition for $\beta(t)$ in terms of certain criterion, such as AIC, BIC or cross-validation. If the length of observed $X_{i}(t)$ is $p$, then the maximum possible level of the discrete Haar wavelet transform is $\log _{2}p$, which is relatively small. Moreover, lower levels are usually considered in real applications. Therefore, including two tuning parameters does not increase computational burden by much. \subsection{3D case}\label{sec2.4} The ADNI's FDG PET brain images are 3D. A 3D function can be decomposed using a tensor product of three 1D Haar wavelets. In particular, the 3D Haar wavelet transform can be considered as averaging and differencing operations [\citet{Muraki92}]. The averaging operation is constructed by the 3D scaling function below: \[ \label{3dphi} \phi_{j,\{k,l,m\}}(u,v,w)=\phi_{j,k}(u) \phi_{j,l}(v)\phi_{j,m}(w). \] The differencing operation is taken in seven directions constructed by the 3D wavelet functions as follows: \begin{eqnarray*} \label{3dpsi} \psi_{j,\{k,l,m\}}^{1}(u,v,w)&=&\phi_{j,k}(u) \phi_{j,l}(v)\psi_{j,m}(w), \nonumber \\ \psi_{j,\{k,l,m\}}^{2}(u,v,w)&=&\phi_{j,k}(u) \psi_{j,l}(v)\phi_{j,m}(w), \nonumber \\ \psi_{j,\{k,l,m\}}^{3}(u,v,w)&=&\phi_{j,k}(u) \psi_{j,l}(v)\psi_{j,m}(w), \nonumber \\ \psi_{j,\{k,l,m\}}^{4}(u,v,w)&=&\psi_{j,k}(u) \phi_{j,l}(v)\phi_{j,m}(w), \nonumber \\ \psi_{j,\{k,l,m\}}^{5}(u,v,w)&=&\psi_{j,k}(u) \phi_{j,l}(v)\psi_{j,m}(w), \nonumber \\ \psi_{j,\{k,l,m\}}^{6}(u,v,w)&=&\psi_{j,k}(u) \psi_{j,l}(v)\phi_{j,m}(w), \nonumber \\ \psi_{j,\{k,l,m\}}^{7}(u,v,w)&=&\psi_{j,k}(u) \psi_{j,l}(v)\psi_{j,m}(w). \end{eqnarray*} Let the image $X_{i}(u,v,w)$ be a 3D functional predictor and $Y_{i}$ be a scalar response variable (MMSE, e.g.) for subject $i$, $i=1,\dots, n$. The 3D functional linear regression model can be written as \begin{equation} \label{3dmodel} Y_{i} =\beta_{0}+ \int_{0}^{T_{1}}\! \int_{0}^{T_{2}}\!\int_{0}^{T_{3}} X_{i}(u,v,w)\beta(u,v,w) \,du\,dv\,dw+\varepsilon_{i}. \end{equation} For a sufficiently fine resolution $J$, the 3D coefficient function $\beta(u,v,w)$ can be approximated by \begin{eqnarray} \label{3dbeta} && \sum_{k,l,m=0}^{2^{j_{0}}-1} a_{j_{0},\{k,l,m\}}\phi_{j_{0},\{k,l,m\}}(u,v,w) \nonumber\\[-8pt]\\[-8pt] &&\qquad{}+ \sum_{j=j_{0}}^{J}\sum _{k,l,m=0}^{2^{j}-1}\sum _{q=1}^{7}d_{j,\{k,l,m\}}^{q} \psi_{j,\{k,l,m\}}^{q}(u,v,w). \nonumber \end{eqnarray} Denote the set of all basis functions $\phi_{j,\{k,l,m\}}$ and $\psi _{j,\{k,l,m\}}^{q}$ in (\ref{3dbeta}) by $B(u,v,w)$ and the wavelet coefficients in (\ref{3dbeta}) by $\eta$, then $\beta(u,v,w)$ can be written as \begin{equation} \label{3dbetasim} \beta(u,v,w)=B(u,v,w)^{T}\eta+e(u,v,w). \end{equation} Plugging (\ref{3dbetasim}) into model (\ref{3dmodel}), we obtain \begin{eqnarray} \label{3dmodelsim} Y_{i} &=& \beta_{0}+ \int _{0}^{T_{1}}\!\int_{0}^{T_{2}}\! \int_{0}^{T_{3}} X_{i}(u,v,w)B(u,v,w)^{T} \eta \,du\,dv\,dw+\varepsilon_{i}^{*} \nonumber\\[-8pt]\\[-8pt] &=& \beta_{0}+C_{i}^T\eta+ \varepsilon_{i}^{*}, \nonumber \end{eqnarray} where $C_{i}=\int_{0}^{T_{1}}\!\int_{0}^{T_{2}}\!\int_{0}^{T_{3}} X_{i}(u,v,w)B(u,v,w) \,du\,dv\,dw$, which is equivalent to the wavelet coefficient vector when we apply the 3D wavelet transform to $X_{i}(u,v,w)$, and $\varepsilon_i^* = \varepsilon_i + \int_{0}^{T_{1}}\!\int _{0}^{T_{2}}\!\int_{0}^{T_{3}} X_{i}(u,v,w)e(u,v,w) \,du\,dv\,dw$. Then the methodology proposed in the previous subsections for the 1D case can be applied directly. Following the calculations of \citet{Bickeletal09}, we can show that our proposed method also enjoys the nonasymptotic oracle inequalities similar to the linear model with high-dimensional covariates. All the theoretical results are provided in the online supplementary material [\citet{Wangetal2014}].\vadjust{\goodbreak} It should be noted that the results are derived using the 1D notation for the estimator $\hat{\beta}(t)$ for simplicity, but they hold exactly for the 3D case of $\hat{\beta}(u,v,w)$. \section{Simulation studies}\label{sec3} To investigate the performance of the proposed Haar wavelet-based approach, we have conducted extensive simulations for both 1D~and~3D functional data. The results for 1D cases can be easily visualized, whereas the 3D case mimics the brain images more naturally. \subsection{1D simulation}\label{sec3.1} We consider a variety of settings of $X(t)$ and $\beta(t)$. For $X(t) = X^{*}(t) + {\mathcal E}(t)$ defined on $0\leq t \leq1$, where ${\mathcal E}(t)\sim N(0,\sigma_{\mathcal E}^2)$ is the noise term independent of time $t$, we consider the following two scenarios: \begin{itemize} \item[--] Fourier: $X^{*}(t)=a_{0}+a_{1}\sin(2\pi t)+a_{2}\cos(2\pi t)+a_{3}\sin(4\pi t)+a_{4}\cos(4\pi t)$. \item[--] $B$-splines: $X^{*}(t)$ is a linear combination of cubic $B$-splines with interior knots at $1/7,\ldots, 6/7$ and coefficients $a_i$, that is, $X^*(t)=\sum a_{i}\phi_{i}(t)$, where $\phi_{i}(t)$ are the $B$-spline basis functions. \end{itemize} In both scenarios, the coefficients $a_{i} \sim N(0,1)$. To assess the performance of the proposed approach in identifying continuous and discontinuous signals, we consider two cases of the regression coefficient function $\beta(t)$: \begin{itemize} \item[--] \textit{Case} 1: $\beta(t)$ is a smooth function, \[ \beta(t) = \cases{ 0.5 \bigl(\sin(20t-\pi)+1 \bigr), &\quad if $\pi/8 \leq t < 9 \pi/40$, \vspace*{3pt}\cr 0, &\quad otherwise.} \] \item[--] \textit{Case} 2: $\beta(t)$ is piecewise constant, \[ \beta(t) = \cases{ 1, &\quad if $0.2 \leq t < 0.3$, \vspace*{3pt}\cr 0.5, &\quad if $0.5 \leq t < 0.7$, \vspace*{3pt}\cr 0, &\quad otherwise.} \] \end{itemize} For each curve $X^{*}(t)$, we record $p=128$ equally spaced measurements for convenience. The variance of the noise term ${\mathcal E}(t)$ is set to be $\sigma_{\mathcal E}^2 = \frac{1}{p-1}\sum _{j=1}^{p}(X^{*}(t_{j})-\widebar{X}^{*}(t_j))^2$, where $\widebar{X}^{*}(t_j)$ is the mean of $X^{*}(t_{j})$. The error\vspace*{1pt} term $\varepsilon$ in model (\ref {1dmodel}) also follows a normal distribution $N(0,\sigma^2)$. The value of $\sigma^2$ is determined by the signal-to-noise ratio \begin{equation} \mbox{SNR}=\frac{\sigma_{g}^2}{\sigma^2}, \end{equation} where $\sigma_{g}^2$ is the sample variance of $g(X_i) = \int X_{i}(t)\beta(t) \,dt$. The simulation results presented in this article are under $\mbox{SNR}=9$, which is also considered in Example~4 of \citet{tib96}. For the Lasso method, \citet{Zou06} observed that smaller SNR usually yields smaller relative prediction error. For each of the settings, we use $n=100$ training observations to fit the model. The optimal tuning parameter is selected by using one of the following methods: (i)~validating by a separate validation (SV) data set of the same size; (ii) 5-fold cross-validation (CV); (iii) AIC and (iv) BIC [\citet{Zou07}] given below: \begin{eqnarray} \mbox{AIC} &=& \frac{\|Y-\hat{g}(X)\|^2}{n\hat{\sigma}^2}+\frac{2}{n}\hat{d}f, \\ \mbox{BIC} &=& \frac{\|Y-\hat{g}(X)\|^2}{n\hat{\sigma}^2}+\frac {\log(n)}{n}\hat{d}f, \end{eqnarray} where $\hat{d}f$ is the number of nonzero elements of $\hat{\eta}$ in model (\ref{model}). We estimate $\sigma^2$ by the refitted cross-validation method introduced in \citet{Fanetal2012}. We then generate $n={}$10,000 test observations to calculate the mean squared errors (MSEs) of the corresponding selected models. The procedure is repeated 100 times and the average MSEs and their standard errors (SE) for each of the models are presented in Table~\ref{tab1}. We also report the percentages of correctly identified zero regions and nonzero regions in Table~\ref{tab1}. We can see that all four methods perform reasonably well, while the nonpractical SV method performs the best. The CV method seems to have a nice trade-off between sparsity and prediction accuracy. Averages of the estimates of $\beta(t)$ using the CV method over 100 replications are shown in Figure~\ref{fig1}. \begin{table \tabcolsep=4pt \caption{Average MSEs with standard errors (SE, in parentheses) and average percentage of correctly identified nonzero and zero elements over 100 replications for 1D cases}\label{tab1} \begin{tabular*}{\tablewidth}{@{\extracolsep{\fill}}@{}lc cc cccc@{}} \hline & & &&\multicolumn{4}{c@{}}{\textbf{Average percentage (\%)}}\\[-6pt] & & & &\multicolumn{4}{c@{}}{\hrulefill} \\ & & \multicolumn{2}{c}{\textbf{Average MSE (SE) ($\bolds{\times10^{-3}}$)}} & \multicolumn{2}{c}{\textbf{Case 1}} &\multicolumn{2}{c@{}}{\textbf{Case 2}}\\[-6pt] & & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c}{\hrulefill} &\multicolumn{2}{c@{}}{\hrulefill} \\ \textbf{Type} & \textbf{Method}&\multicolumn{1}{c}{\textbf{Case 1}} &\multicolumn{1}{c}{\textbf{Case 2}} & \textbf{Nonzero} & \textbf{Zero} & \textbf{Nonzero} & \textbf{Zero}\\ \hline $B$-spline &SV& 0.11 (0.05) & 0.19 (0.08) & 84.30 & 69.20 & 96.00 & 57.26\\ &CV& 0.15 (0.11) & 0.23 (0.11) & 82.95 & 69.68 & 95.03 & 58.90\\ &BIC& 0.60 (1.96) & 1.63 (3.10) & 72.70 & 96.14 & 83.26 & 79.36\\ &AIC& 0.56 (1.96) & 1.56 (3.12) & 75.80 & 93.80 & 82.51 & 82.27 \\[3pt] Fourier &SV& 0.65 (0.30) & 1.20 (0.49) &84.00 & 70.59 &95.87 & 58.93\\ &CV& 0.92 (0.56) & 1.46 (0.63) & 82.30 & 71.39 & 95.56 & 55.76\\ &BIC& 1.12 (0.86) & 10.62 (20.69) &72.75 & 96.59 & 84.03 & 67.07\\ &AIC& 1.05 (1.28) & 10.29 (20.82) &75.80 & 93.64& 83.85 & 69.01\\ \hline \end{tabular*} \end{table} \begin{figure} \includegraphics{736f01.eps} \caption{Average of $\hat{\beta}(t)$ estimated using 5-fold cross-validation with 100 replications (solid line). The dashed line is the true $\beta(t)$. The top panel is for case~1, and the bottom panel is for case~2.}\label{fig1} \end{figure} We also conduct permutation tests to assess the significance of the regularized estimates of $\beta(t)$. For each of the training data sets, we generate 200 permutation data sets by randomly shuffling the response values. Using the same model selection technique for each of the 200 permutation data sets, 200 sets of $\hat{\beta}_{\mathrm{perm}}(t)$ are obtained. At each $t_{j}$, $j=1,\ldots,p$, the two-sided critical values are set to be the 2.5th and 97.5th percentiles of $\hat{\beta }_{\mathrm{perm}}(t_{j})$ for the significance level of 0.05. Supposing the null hypothesis is $\beta(t_{j})=0$ at each $t_{j}$, we will reject the null hypothesis if $\hat{\beta}(t_{j})$ is within the critical region. Repeating this permutation process 100 times, we can compute the percentages that we reject the null hypothesis at each $t_{j}$. The results of the permutation tests using the CV method are presented in Figure~\ref{fig2}, which shows high rejection frequency in the regions where $\beta(t)$ is nonzero. \begin{figure} \includegraphics{736f02.eps} \caption{Frequency of rejecting the null hypothesis $\beta(t)=0$ using 5-fold cross-validation based on 100 permutation repetitions. The thick solid horizontal segments indicate the true nonzero regions. The top panel is for case~1, and the bottom panel is for case~2.} \label{fig2} \end{figure} \subsection{3D simulation}\label{sec3.2} For the 3D case, we generate the following type of images $ X(u,v,w) = X^{*}(u,v,w) + {\mathcal E}(u,v,w)$ with \begin{eqnarray*} && X^{*}(u,v,w) \\ &&\qquad = a_{0}+a_{1}\sin(2\pi u)+a_{2}\cos(2\pi u)+a_{3}\sin(2\pi v) \\ &&\quad\qquad{}+a_{4}\cos(2\pi v)+a_{5}\sin(2\pi w)+a_{6} \cos(2\pi w),\qquad 0\leq u,v,w\leq1, \end{eqnarray*} where $a_{i}\sim N(0,1)$ and ${\mathcal E}(u,v,w)\sim N(0,\sigma _{\mathcal E}^2)$ with $\sigma_{\mathcal E}^2$ similarly defined as in the 1D case. For simplicity, we record $32\times32\times32$ equally spaced measurements in the unit cube. We define the coefficient function $\beta(u,v,w)$ as follows: \begin{eqnarray*} && \beta(u,v,w) \\ &&\qquad = \cases{ a \bigl(\sin(bu+c)+1 \bigr) \bigl(\sin(bv+c)+1 \bigr) \bigl( \sin(bw+c)+1 \bigr), \vspace*{3pt}\cr \hspace*{11pt}\qquad \mbox{if }(u-7\pi/40)^2+(v-7 \pi/40)^2+(w-7 \pi/40)^2 \leq(3\pi/40)^2; \vspace*{3pt}\cr 0,\qquad \mbox{otherwise},} \end{eqnarray*} where $a=1/8$, $b=40/3$ and $c=\pi/6$. Note that $\beta(u,v,w)$ is zero outside a ball that is located in the center of the unit cube. The error term $\varepsilon$ in model~(\ref{3dmodel}) also follows a normal distribution $N(0,\sigma^2)$ with $\mbox{SNR} = 9$. We generate 400 training images and apply the 3D Haar wavelet transform to decompose each image and obtain the wavelet coefficient matrix. Optimal tuning parameters are selected using the same procedures as for the 1D case. The results are summarized in Table~\ref{tab2}. Figure~\ref{fig3} illustrates the comparison of the true $\beta(u,v,w)$ and the mean estimates of $\beta(u,v,w)$ over 100 replications at five different slices, which shows that our approach performs reasonably well in detecting signals based on visual inspection and on the high percentage of correctly identified nonzeros and zeros reported in Table~\ref{tab2}. \begin{table}[b] \tabcolsep=2.6pt \tablewidth=260pt \caption{Average MSEs with standard errors (SE, in parentheses), and average percentages of correctly identified nonzero and zero elements over 100 replications for 3D case}\label{tab2} \begin{tabular*}{\tablewidth}{@{\extracolsep{\fill}}@{}lcccc @{}} \hline & & \multicolumn{2}{c@{}}{\textbf{Average percentage (\%)}}\\[-6pt] & & \multicolumn{2}{c@{}}{\hrulefill}\\ \textbf{Method} &\textbf{Average MSE (SE) ($\bolds{\times10^{-4}}$)} & \textbf{Nonzero} & \textbf{Zero}\\ \hline SV & 0.97 (0.29)& 77.15 & 61.97\\ CV & 1.21 (0.51)& 74.25 & 57.04\\ BIC & 4.78 (1.52)& 39.48 & 99.42\\ AIC & 4.11 (2.13)& 41.86 & 98.74\\ \hline \end{tabular*} \end{table} \begin{figure} \includegraphics{736f03.eps} \caption{The left panel is true $\beta(u,v,w)$ at five selected slices and the right panel is the average of $\hat{\beta}(u,v,w)$ estimated using 5-fold cross-validation over 100 replications at the same five slices.} \label{fig3} \end{figure} \section{ADNI PET analysis}\label{sec4} The FDG PET data used in the preparation of this article were obtained from the ADNI database (\href{http://adni.loni.ucla.edu}{adni.loni.ucla.edu}). The ADNI was launched in 2003 by NIA, NIBIB, FDA, private pharmaceutical companies and nonprofit organizations, as a \$60 million, 5-year public-private partnership. The primary goal of ADNI has been to test whether serial magnetic resonance imaging (MRI), PET, other biological markers, and clinical and neuropsychological assessment can be combined to measure the progression of MCI and early AD. Determination of sensitive and specific markers of very early AD progression is intended to aid researchers and clinicians in developing new treatments, monitoring treatment effectiveness, and lessening the time and cost of clinical trials. The Principal Investigator of this initiative is Michael W. Weiner, MD, VA Medical Center and University of California, San Francisco. ADNI is the result of efforts of many co-investigators from a broad range of academic institutions and private corporations, and subjects have been recruited from over 50 sites across the U.S. and Canada. The initial goal of ADNI was to recruit 800 adults, ages 55 to 90, to participate in the research, approximately 200 cognitively normal older individuals to be followed for 3 years, 400 people with MCI to be followed for 3 years and 200 people with early AD to be followed for 2 years. For up-to-date information, see \href{http://www.adni-info.org}{www.adni-info.org}. \begin{table} \tabcolsep=0pt \caption{Demographics of ADNI participants ($n=403$)}\label{tab3} \begin{tabular*}{\tablewidth}{@{\extracolsep{\fill}}lccc@{}} \hline \textbf{Category} &\textbf{Sex (\% male)} & \textbf{Age (SD)}& \textbf{MMSE (SD)}\\ \hline NC ($n=102$)&$60.8\%$&80.9 (4.7)&28.9 (1.1)\\ MCI ($n=206$)&$67.0\%$&79.7 (7.3)&27.2 (1.7)\\ AD ($n=95$)&$58.9\%$&80.4 (7.5)&23.4 (2.1)\\ \hline \end{tabular*} \end{table} In the ADNI's FDG PET study, the injected dose of FDG was \mbox{$5.0\pm0.5$} mCi, and subjects were scanned from 30 to 60 minutes post-injection acquiring 6 five-minute frames. The scans were preprocessed by the following steps: each frame was co-registered to the first frame of the raw image file; six co-registered frames were averaged to create a single 30-minute PET image; each subject's co-registered, averaged PET image from the baseline PET scan was reoriented into a standard $160\times160\times96$ voxel image grid with 1.5 mm cubic voxels and the anterior-posterior axis of the subject is parallel to a line connecting the anterior and posterior commissures (the AC--PC line). It should be noted that the number of voxels in each image is over 2.4 million, so the approach via linear programming, as in \citet {Jamesetal2009}, is too computationally expensive for this application. The data set consists of 403 scans, including 102 NCs, 206 subjects with MCI and 95 subjects diagnosed with AD. The demographic characteristics of the 403 subjects are described in Table~\ref{tab3}. The goal of our analysis is to identify brain subregions that are most closely related to MMSE scores; we therefore choose not to adjust for age and other demographic variables. The summary of MMSE scores among the three groups of participants is given in Figure~\ref{fig4}. We treat each PET image as a realization of the 3D functional predictor and then fit the 3D functional linear regression model (\ref{3dmodel}). The voxel values outside the brain are set to zero prior to implementing the 3D Haar wavelet transform. We further reduce the computational cost by excluding those columns of the wavelet coefficient matrix where all the elements are zero. \begin{figure \includegraphics{736f04.eps} \caption{Box plots of MMSE scores among AD, MCI and NC.} \label{fig4} \end{figure} In terms of applying the 3D Haar wavelet transforms to each subject's PET image data, we consider all the possible levels of the Haar wavelet decompositions. Two tuning parameters are therefore included in the model selection procedure: the level of the 3D Haar wavelet decomposition and the lasso regularization parameter. First, we employ a 10-fold cross-validation to evaluate the predictive power of the proposed method. Specifically, for each set of 10\% observations, we leave them out as a test set, use the remaining data as the training data to fit a model (including selecting the tuning parameters via 5-fold cross-validation) and compute the prediction error on the data points that have been left out. We aggregate these quantities by using the predictive R-square given by $1 - \sum(y_i - \hat{y}_{i,-i})^2 / \sum(y_i - \bar{y})^2$, where $ \hat{y}_{i,-i}$ denotes the predicted value of $y_i$ calculated by using the estimator obtained from the training data generated from the cross-validation. The result is 0.26 for the ADNI data set, whereas the standard R-square is 0.51, suggesting a moderate predictive power of the model. \begin{figure \includegraphics{736f05.eps} \caption{Clusters of voxels identified using our approach for the ADNI data.} \label{fig5} \end{figure} \begin{figure \includegraphics{736f06.eps} \caption{Bootstrap inclusion frequencies of the voxels over 100 bootstrap samples.} \label{fig6} \end{figure} \begin{figure}[b] \includegraphics{736f07.eps} \caption{Locations of the frequently selected voxels in the 3D sagittal view.} \label{fig7} \end{figure} Second, we investigate the voxels that are selected by our method. We use 5-fold cross-validation to the full data set to choose the optimal set of tuning parameters. The identified clusters of voxels [$\hat{\beta }(u,v,w)\ne0$] are shown on selected axial slices in Figure~\ref {fig5}, which are presented from the bottom of the brain to the top. The clusters of voxels with hot colors show a positive association to prediction of MMSE scores, whereas those with cold colors show a negative association. Each small square represents a small cluster of voxels. To assess the significance of the selected voxels, similar to what we have done in simulation studies, we permute the response variable MMSE score 200 times. It turns out that 95.3\% of the selected voxels are significant at the 5\% level. In addition to this pointwise testing, we also consider the global test described by \citet{Nicholsetal01}, which provides a way to control the family-wise error rate by comparing $\hat{\beta}(t_{j})$ to a ``maximal statistic.'' It turns out that only 15.6\% of the selected voxels are significant at the 5\% level, which is more conservative than the pointwise testing procedure. To further evaluate the stability of the selection, we generate 100 bootstrap samples and for each bootstrap sample, we apply our method including the tuning parameter selection via 5-fold cross-validation. Similar approaches also have been employed by other researchers, such as \citet{Sauerbrei92}, \citet{Royston08} and \citet {Meinshausen10}. To summarize the results, we count the number of times that each voxel is selected over 100 bootstrap samples and denote it as the bootstrap inclusion frequency (BIF). The voxel BIFs are presented in Figure~\ref {fig6}. The locations of these more frequently selected voxels are also presented in the 3D sagittal view in Figure~\ref{fig7} for ease of understanding. It can be seen that the highly selected brain regions agree well with the results in Figure~\ref{fig5}. We note that the clusters of voxels identified in our analysis shown in Figures~\ref{fig5} and \ref{fig6} reveal high associations of the expected anatomical regions with cognitive deficits. For example, the orange ones on slices ``$+$12'' and ``$+$18'' in Figure~\ref{fig5} and the big cluster on the same slices in Figure~\ref{fig6} indicate that the posterior cingulate/precuneus cortex is significantly related to cognitive impairment; the blue ones on slices ``$-$60,'' ``$-$54'' and ``$-$48'' in Figure~\ref{fig5} and the clusters on the same slices in Figure~\ref{fig6} suggest that the medial temporal/hippocampal cortex is also closely involved; the red ones on slices ``$-$42,'' ``$-$36'' and ``$-$30'' in Figure~\ref{fig5} and the corresponding clusters on the same slices in Figure~\ref{fig6} correspond to the lateral temporal cortex. Many studies have demonstrated that the most prominent metabolic abnormalities are found in these regions; see, for example, \citet {Fosteretal84}, \citeauthor{Minoshimaetal95} (\citeyear{Minoshimaetal95,Minoshimaetal97}), \citet{Muelleretal05}. In our study, we have particularly found the most predictive voxels of the cognitive impairment in these regions. Other involved regions include the superior lateral parietal cortex and the frontal cortex, which are all known to be related to the progression of Alzheimer's disease. \section{Discussion}\label{sec5} In this article we propose a highly effective Haar wavelet-based regularization approach that can be easily applied to analyzing multidimensional functional data. Analysis of the PET image data demonstrates that our \mbox{approach} is useful in finding brain subregions that are most responsible for cognitive impairment in elderly people. It has great potential to efficiently assist the diagnosis of disease in neuroimaging studies, yielding easily interpretable results. Our approach is also computationally fast because of the implementation of the coordinate descent algorithm with the MATLAB glmnet package. For example, the real data analysis of 403 subjects' PET image data can be finished in less than two hours on a 64-bit Intel Xeon 3.33~GHz server with about 35~GB of RAM, including the selection of tuning parameters. We should note that another practical advantage of our approach is that the wavelet transform itself can reduce the dimensionality of the large volume of brain image data. As a result, we can then apply the proposed approach on reduced data sets. In such situations, although the resolution of the original PET images is decreased, the results remain largely the same since the related subregions are usually not comprised of a single voxel but of a cluster of voxels. \section*{Acknowledgments} Data used in preparation of this article were obtained from the Alzheimer's Disease Neuroimaging Initiative (ADNI) database\break (\href{http://adni.loni.ucla.edu}{adni.loni.ucla.edu}). As such, the investigators within the ADNI contributed to the design and implementation of ADNI and/or provided data but did not participate in analysis or writing of this report. A complete listing of ADNI investigators can be found at \url{http://adni.loni.usc.edu/wp-content/uploads/how\_to\_apply/ADNI\_Acknowledgement\_List.pdf}. Data collection and sharing for this project were funded by the Alzheimer's Disease Neuroimaging Initiative (ADNI) (National Institutes of Health Grant U01 AG024904). ADNI is funded by the National Institute on Aging, the National Institute of Biomedical Imaging and Bioengineering, and through generous contributions from the following: Abbott; Alzheimer's Association; Alzheimer's Drug Discovery Foundation; Amorfix Life Sciences Ltd.; AstraZeneca; Bayer HealthCare; BioClinica, Inc.; Biogen Idec Inc.; Bristol-Myers Squibb Company; Eisai Inc.; Elan Pharmaceuticals Inc.; Eli Lilly and Company; F. Hoffmann-La Roche Ltd and its affiliated company Genentech, Inc.; GE Healthcare; Innogenetics, N.V.; IXICO Ltd.; Janssen Alzheimer Immunotherapy Research \& Development, LLC.; Johnson \& Johnson Pharmaceutical Research \& Development LLC.; Medpace, Inc.; Merck \& Co., Inc.; Meso Scale Diagnostics, LLC.; Novartis Pharmaceuticals Corporation; Pfizer Inc.; Servier; Synarc Inc.; and Takeda Pharmaceutical Company. The Canadian Institutes of Health Research is providing funds to support ADNI clinical sites in Canada. Private sector contributions are facilitated by the Foundation for the National Institutes of Health (\href{http://www.fnih.org}{www.fnih.org}). The grantee organization is the Northern California Institute for Research and Education, and the study is coordinated by the Alzheimer's Disease Cooperative Study at the University of California, San Diego. ADNI data are disseminated by the Laboratory for Neuro Imaging at the University of California, Los Angeles. The authors would like to thank Professor Karen Kafadar, the Associate Editor and two referees for their helpful and constructive comments. \begin{supplement}[id=suppA] \stitle{Appendix} \slink[doi]{10.1214/14-AOAS736SUPP} \sdatatype{.pdf} \sfilename{aoas736\_supp.pdf} \sdescription{The online supplementary material contains the technical appendix showing the theoretical results of the proposed approach and an illustrative example showing the desirable feature of Haar wavelets.} \end{supplement}
{'timestamp': '2014-08-11T02:04:58', 'yymm': '1407', 'arxiv_id': '1407.8401', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8401'}
arxiv
\section{Introduction} Supervised learning is one of the most fundamental data mining tasks. Conventional approaches on supervised learning usually assume, explicitly or implicitly, that data instances are represented as feature vectors. However, in many real-world applications, data instances are more naturally represented as second-order (matrices) or higher-order tensors, where the order of a tensor corresponds to the number of modes or ways. For example, in computer vision, a grey-level image is inherently a 2-D object, which can be represented as a second-order tensor with the column and row modes \cite{YXYZTZ07}; in medical neuroimaging, an MRI (Magnetic Resonance Imaging) image is naturally a third-order tensor consisting of 3-D voxels \cite{A13}. Supervised learning on this type of data is called supervised tensor learning, where each instance in the input space is represented as a tensor. With the rapid proliferation of tensor data, supervised tensor learning has drawn significant attention in recent years in the machine learning and data mining communities. A straightforward solution to supervised tensor learning is to convert the input tensors into feature vectors, and feed the feature vectors to a conventional supervised learning algorithm. However, tensor objects are commonly specified in high-dimensional space. For example, a typical MRI image of size $256\times 256\times 256$ voxels contains $16,777,216$ features \cite{ZLZ12}. This makes traditional methods prone to overfitting, especially for small sample size problems \cite{DD08}. On the other hand, tensorial representations retain the information about the structure of the high-dimensional space the data lie in, such as about the spatial arrangement of the voxel-based features in a 3-D image. When converting tensors into vectors, such important structural information will be lost. In particular, the entries of a tensor object are often highly correlated with surrounding entries. For example, in MRI image data, adjacent voxels usually exhibit similar patterns, which means that the source images contain redundant information at this voxel. It is believed by many researchers that potentially more compact and useful representations can be extracted from the original tensor data and thus result in more accurate and interpretable models. Therefore, supervised learning algorithms operating directly on tensors rather than their vectorized versions are much desired. Formally, a major difficulty in supervised tensor learning is how to build predictive models that can leverage the naturally available structure of tensor data to facilitate the learning process. In the literature, several solutions have been proposed. Previous work on supervised tensor learning mainly focuses on linear models \cite{CHH06,GKP12,HHCY13,TLWH07,ZLZ12}, which assume, explicitly or implicitly, that data are linearly separable in the input space. However, in practice this assumption is often violated and the linear decision boundaries do not adequately separate the classes. Recently, several approaches try to exploit the tensor structure with nonlinear kernel models \cite{SLS11,SOLS12,ZZAZC13}, which first unfold the tensor along each of its modes, and then use these unfolded matrices to construct nonlinear kernels for supervised tensor learning as shown in Figure~\ref{fig1_matrix_b}. However, these methods can only capture the relationships within each single mode of the tensor data, because the structural information about inter-mode relationships of tensor data is lost in the unfolding procedures. \begin{figure}[t] \centering \subfigure[Vector-based kernels] { \label{fig1_vector_a} \begin{minipage}{.8\columnwidth} \centering \includegraphics[width=6.0cm]{fig1_vector.pdf} \end{minipage} } \subfigure[Conventional tensor kernels] { \label{fig1_matrix_b} \begin{minipage}{.7\columnwidth} \centering \includegraphics[width=7.0cm]{fig1_matrix.pdf} \end{minipage} } \subfigure[Our {\ours}] { \label{fig1_tensor_c} \begin{minipage}{.8\columnwidth} \centering \includegraphics[width=6.0cm]{fig1_tensor.pdf} \end{minipage} }\vspace{-8pt} \caption{Schematic view of the key difference among three kernel learning schemes. Standard kernel (a) works on the vectorized representation and conventional tensor-based kernel (b) applies tensor-to-matrix alignment first, which may lead to loss of structural information. Our method (c) works on the tensor representation directly.} \label{fig_example1} \vspace{-10pt} \end{figure} In this paper, we study the problem of supervised tensor learning with nonlinear kernels which can adequately preserve and utilize the structure of the tensor data. The major research challenges of supervised tensor learning with structure-preserving kernels can be summarized as follows: \noindent\textbullet \ \textbf{High-dimensional tensors}: One fundamental problem in supervised tensor learning lies in the intrinsic high dimensionality of tensor objects. Traditional supervised learning algorithms assume that the instances are represented as vectors. However, in the context of tensors, each data object is usually not represented as a vector but a high-dimensional multi-mode (also known as multi-way) array. If we reshape the tensor into a vector, the number of features is extremely high. Both computability and theoretical guarantee of the traditional models are compromised by this ultra-high dimensionality.\\ \noindent\textbullet \ \textbf{Complex tensor structure}: Another fundamental problem in supervised tensor learning lies in complex structure of tensors. Conventional tensor-based kernel approaches focus on unfolding tensor data into matrices \cite{SLS11,SOLS12,ZZAZC13} which can only preserve the one-way relationships within the tensor data. However, in many real-world applications, the tensor data have multi-way structures. Such prior knowledge about multi-way relationships among features should be incorporated to build more accurate and interpretable models, especially in the case of high dimensional tensor data with small sample size.\\ \noindent\textbullet \ \textbf{Nonlinear separability}: In real-world applications, the data is usually not linearly separable in the input space. Conventional supervised tensor learning methods which can preserve tensor structures are often based upon linear models. Thus these methods cannot efficiently solve nonlinear learning problems on tensor data. In this paper, we propose a novel approach to supervised tensor learning, called {\ours} (Dual Structure-preserving Kernels). Our framework is illustrated in Figure~\ref{fig1_tensor_c}. Different from conventional methods, our approach is based upon kernel methods and tensor factorization techniques that can fully capture the multi-way structures of tensor data. We first extract a more compact and informative representation from the original data using a tensor factorization method, {\ie}, CANDECOMP/PARAFAC (CP) \cite{KB09}. Then we define a structure-preserving feature mapping to derive the {\ours} kernels in the tensor product feature space, used in conjunction with kernel machines to solve the supervised tensor learning problems. Empirical studies on real-world tasks (classifying fMRI images of different brain diseases, {\ie}, Alzheimer's disease, ADHD and HIV) demonstrate that the proposed approach can significantly boost the classification performances on tensor datasets. \section{PRELIMINARIES} \label{sec_formulation} Before presenting our approach, we introduce some related concepts and notation of tensors. Table~\ref{tab_notation} lists some basic symbols defined in this study. We first give a formal mathematical definition of the tensor, which provides an intuitive understanding of the algebraic structure of the tensor that tensor object has the tensor product structure. \begin{defn}[Tensor] An $N$th-order tensor is an element of the tensor product of $N$ vector spaces, each of which has its own coordinate system. \end{defn} We use $\mathcal{A}=\left(a_{i_1,i_2,\ldots,i_N}\right) \in \mathbb{R}^{I_{1} \times I_{2} \times \cdots \times I_{N}}$ to denote a tensor $\mathcal{A}$ of $N$ order. For $n=1, 2, \cdots, N$, $I_{n}$ is the dimension of $\mathcal{A}$ along the $n$-th mode. Based on the above definition, we define inner product, tensor norm, tensor product, and rank of a tensor and give CP model as follows: \begin{defn}[Inner product] The inner product of two same-sized tensors $\mathcal{A}, \mathcal{B} \in \mathbb{R}^{I_{1} \times I_{2} \times \cdots \times I_{N}}$ is defined as the sum of the products of their entries: \begin{equation}\label{eq1} \left\langle \mathcal {A}, \mathcal {B}\right\rangle=\sum_{i_{1}=1}^{I_1}\sum_{i_{2}=1}^{I_2}\cdots\sum_{i_{N}=1}^{I_N}a_{i_1,i_2,\ldots,i_N}b_{i_1,i_2,\ldots,i_N}. \end{equation} \end{defn} \begin{defn}[Tensor norm] The norm of a tensor $\mathcal {A}$ is defined to be the square root of the sum of all entries of the tensor squared, {\ie}, \begin{equation}\label{eq2} \left\|\mathcal {A}\right\|_{F}=\sqrt{\left\langle \mathcal {A}, \mathcal {A}\right\rangle}=\sqrt{\sum_{i_1=1}^{I_1}\sum_{i_2=1}^{I_2}\cdots\sum_{i_N=1}^{I_N}a_{i_1,i_2,\ldots,i_N}^{2}}. \end{equation} \end{defn} As we see the norm of a tensor is a straightforward generalization of the usual Frobenius norm for matrices and of the $l_{2}$ norm for vectors. \begin{table}[t] \centering {\scriptsize \caption{List of symbols}\label{tab_notation} \begin{tabular}{ll} \toprule Symbol & Definition and Description\\ \midrule $s$ & each lower-case represents a scale\\ $\mathbf{v}$ & each boldface lowercase letter represents a vector\\ $\mathbf{M}$ & each boldface capital letter represents a matrix\\ $\mathcal{T}$ & each calligraphic letter represents a tensor\\ $\mathfrak{G}$ & each gothic letter represent a general set or space\\ $\otimes$ & denotes tensor product\\ $\left\langle . ,. \right\rangle$ & denotes the inner product in some feature space\\ $R=$\textit{Rank}($\mathcal{A}$) & is the rank of tensor $\mathcal{A}$\\ $\phi(.)$ & denotes the feature mapping\\ $\kappa(.,.)$ & represents a kernel function\\ \bottomrule \end{tabular} }\vspace{-10pt} \end{table} \begin{defn}[Tensor product] The tensor product $\mathcal {A} \otimes \mathcal {B}$ of tensors $\mathcal{A} \in \mathbb{R}^{I_{1} \times I_{2} \times \cdots \times I_{N}}$ and $\mathcal{B}\in \mathbb{R}^{I_{1}' \times I_{2}' \times \cdots \times I_{M}'}$ is defined by \begin{equation}\label{eq3} \left(\mathcal {A} \otimes \mathcal {B}\right)_{i_1,i_2,\ldots,i_N, i_1',i_2',\ldots,i_M'}\ =\ a_{i_1,i_2,\cdots,i_N} b_{i_1',i_2',\cdots,i_M'} \end{equation} for all values of the indices. \end{defn} It is worth mentioning that a rank-one tensor, is still analogously to the matrix case, a tensor that is a tensor product of vectors ($N$th-order tensor requires $N$ vectors). Additionally, notice that for rank-one tensors $\mathcal{A}=\mathbf{a}^{(1)} \otimes \mathbf{a}^{(2)} \otimes \cdots \otimes \mathbf{a}^{(N)}$ and $\mathcal{B}=\mathbf{b}^{(1)} \otimes \mathbf{b}^{(2)} \otimes \cdots \otimes \mathbf{b}^{(N)}$, it holds that \begin{equation}\label{eq4} \left\langle \mathcal {A}, \mathcal {B}\right\rangle=\left\langle \mathbf{a}^{(1)}, \mathbf{b}^{(1)}\right\rangle \left\langle \mathbf{a}^{(2)}, \mathbf{b}^{(2)}\right\rangle \cdots \left\langle \mathbf{a}^{(N)}, \mathbf{b}^{(N)}\right\rangle. \end{equation} \begin{defn}[Tensor rank] The rank of a tensor $\mathcal{A}$ is the minimum number of rank-one tensor to fit $\mathcal{A}$ exactly. \end{defn} \begin{defn}[CP factorization] Given a tensor $\mathcal{A}\in \mathbb{R}^{I_{1} \times I_{2} \times \cdots \times I_{N}}$ and an integer $R$, if it can be expressed as \begin{equation}\label{eq5} \mathcal{A}= \sum_{r=1}^{R}\mathbf{a}_{r}^{(1)}\otimes\mathbf{a}_{r}^{(2)}\otimes \cdots \otimes \mathbf{a}_{r}^{(N)}, \end{equation} we call it CP factorization (see Figure \ref{fig-2} for graphical representations). For convenience, in the following we write $\prod_{n=1}^{N}\otimes \mathbf{a}^{(n)}$ for $\mathbf{a}^{(1)} \otimes \mathbf{a}^{(2)} \otimes \cdots \otimes \mathbf{a}^{(N)}$. \end{defn} \section{APPROACH}\label{sec_method} In this section, we first formulate the problem of tensor-based kernel learning and then elaborate on our {\ours}. For the sake of brevity, hereafter we restrict our discussion to classification problems. \subsection{Problem statement} Considering a training set of $M$ pairs of samples $\{\mathcal{X}_i,y_i\}_{i=1}^{M}$ for binary tensor classification problem, where $\mathcal{X}_{i} \in \mathbb{R}^{I_{1} \times I_{2} \times \cdots \times I_{N}}$ are the input of the sample and $y_i \in \{-1,+1\}$ are the corresponding class labels of $\mathcal{X}_i$. In \cite{HHCY13}, it was noted that the problem of tensor classification can be stated as a convex quadratic optimization problem in the framework of the standard linear SVM. Based on this result, we show how it can be modeled as a kernel learning problem. Suppose we are given the optimization problem of linear tensor classification as \begin{align} \min_{\mathcal{W},b,\xi} & \frac{1}{2}\left\|\mathcal {W}\right\|_{F}^{2}+C \sum_{i=1}^{M} \xi_{i},\label{eq6}\\ \text{s.t. } & y_{i} \left( \langle \mathcal{W},\mathcal{X}_{i} \rangle + b \right) \geq 1 - \xi_{i},\label{eq7}\\ & \xi_{i} \geq 0, \forall i=1,\cdots,M.\label{eq8} \end{align} Where $\mathcal{W}$ is the weight tensor of the separating hyperplane, $b$ is the bias, $\xi_{i}$ is the error of the $i$th training sample, and $C$ is the trade-off between the classification margin and misclassification error. Obviously, the optimization problem in (\ref{eq6})-(\ref{eq8}) is the generalization of the problem of the standard linear SVM to tensor patterns in tensor space. When the input samples $\mathcal{X}_i$ are vectors, it degenerates into the standard linear SVM. As such, based on the kernel method for the extension of linear SVM to the nonlinear case$-$by introducing a nonlinear feature mapping $\phi: \mathbf{x} \rightarrow \phi \left(\mathbf{x}\right)\in \mathfrak{H} \subset \mathbb{R}^{H}$, we develop a nonlinear extension of (\ref{eq6})-(\ref{eq8}) in the following, which is critical for the derivation of the model for tensor-based kernel learning. \begin{figure}[t] \centering \label{fig_2} \begin{minipage}{1\columnwidth} \centering \includegraphics[width=8.0cm]{fig2_CP.pdf} \end{minipage} \caption{ CP factorization of a third-order tensor} \label{fig-2}\vspace{-10pt} \end{figure} \indent Given a tensor $\mathcal{X} \in \mathbb{R}^{I_{1} \times I_{2} \times \cdots \times I_{N}}$, we assume it is mapped into the Hilbert space $\mathfrak{H}$ by \begin{equation}\label{eq9} \phi: \mathcal{X} \rightarrow \phi \left(\mathcal{X}\right) \in \mathbb{R}^{H_{1} \times H_{2} \times \cdots \times H_{P}}. \end{equation} \noindent Note that the project tensor $\phi\left(\mathcal{X}\right)$ in space $\mathfrak{H}$ may have different order with $\mathcal{X}$, and each mode dimension is higher even an infinite dimension depending on the feature mapping function $\phi(.)$. Such a Hilbert space is called the high-dimensional tensor feature space or simply a tensor feature space. According to the same principle as the construction of linear classification model in the original tensor space, we construct the following model in this space: \begin{align} \min_{\mathcal{W},b,\xi} & \frac{1}{2}\left\|\mathcal {W}\right\|_{F}^{2}+C \sum_{i=1}^{M} \xi_{i},\label{eq10}\\ \text{s.t. } & y_{i} \left( \langle \mathcal{W}, \phi\left(\mathcal{X}_{i}\right) \rangle + b \right) \geq 1 - \xi_{i},\label{eq11}\\ & \xi_{i} \geq 0, \forall i=1,\cdots,M.\label{eq12} \end{align} \noindent From the viewpoint of high-dimensional tensor feature space, this model is a linear model. However, from the viewpoint of the original tensor space, it is a nonlinear model. When the input samples $\mathcal{X}_{i}$ are vectors, it degenerates into the standard nonlinear SVM. When the feature mapping function $\phi(.)$ is an identical function, {\ie}, $\phi(\mathcal{X})=\mathcal{X}$, it is the same as that in (\ref{eq6})-(\ref{eq8}). Thus, we say that the optimization model (\ref{eq10})-(\ref{eq12}) is the nonlinear counterpart of (\ref{eq6})-(\ref{eq8}). Let us now show how this model can be exploited to obtain tensor-based kernel optimization model. Using Lagrangian relaxation method \cite{ES01}, it is easy to check that the dual problem of (\ref{eq10})-(\ref{eq12}) is \begin{align} \max_{\alpha_1, \alpha_2, \cdots, \alpha_M} & \sum_{i=1}^{M}\alpha_i - \frac{1}{2}\sum_{i, j=1}^{M}\alpha_i\alpha_j y_i y_j \langle \phi\left(\mathcal{X}_{i}\right), \phi\left(\mathcal{X}_{j}\right) \rangle \label{eq13}\\ \text{s.t.} & \sum_{i=1}^M \alpha_i y_i=0, \label{eq14}\\ & 0\leq\alpha_i\leq C, \forall i=1,\cdots,M. \label{eq15} \end{align} Where $\alpha_i$ are the Lagrangian multipliers and $\langle \phi\left(\mathcal{X}_{i}\right), \phi\left(\mathcal{X}_{j}\right) \rangle$ are the inner product between the mapped tensors of $\mathcal{X}_i$ and $\mathcal{X}_j$ in the tensor feature space. The advantage of formulation (\ref{eq13})-(\ref{eq15}) over (\ref{eq10})-(\ref{eq12}) is that the training data only appear in the form of inner products. Based on the fundamental principle of kernel method, by substituting the inner product $\langle \phi\left(\mathcal{X}_{i}\right), \phi\left(\mathcal{X}_{j}\right) \rangle$ with a suitable tensor kernel function $\kappa\left(\mathcal{X}_i,\mathcal{X}_j\right)$, we thus get the tensor-based kernel model. The resulting decision function is \begin{equation} \label{eq19} f \left (\mathcal{X}\right)=sign\left(\sum_{i=1}^{M}\alpha_i y_i \kappa\left(\mathcal{X}_i,\mathcal{X}\right) +b\right). \end{equation} \subsection{{\ours}} From the above statement, we can see that tensor-based kernel learning degenerates into the study of kernel function, and the success of kernel methods depends strongly on the data representation encoded into the kernel function. Now we propose the {\ours}. Our target is to leverage the naturally available structure of the tensor to facilitate kernel learning. Tensors provide a natural and efficient representation for multi-way data, but there is no guarantee that such representation will be good for kernel learning. Since learning will only be successful if the regularities that underlie the data can be discerned by the kernel. As with the previous analysis for the characteristics of tensor object, we know that the essential information in the tensor is embedded in its multi-way structure. Thus, one important aspect of kernel learning for such complex objects is to represent them by sets of key structural features easier to manipulate, and design kernels on such sets. According to the mathematical definition of tensor, we can gain a further understanding of the structure of the tensor that tensor object has the tensor product structure. In previous work, it was found that CP factorization is particularly effective for extracting this structure. Motivated by these observations, we investigate how to exploit the benefits of CP factorization to learn a structure-preserving kernel in the tensor product feature space. More specifically, we will represent each tensor object as a sum of rank-one tensors in the original space and map them into the tensor product feature space for our kernel learning. In the following, we illustrate how to design the feature mapping. We start by defining the following mapping on a rank-one tensor $\prod_{n=1}^{N}\otimes \mathbf{x}^{(n)} \in \mathbb{R}^{I_{1} \times I_{2} \times \cdots \times I_{N}}$. \begin{equation}\label{eq20} \phi: \prod_{n=1}^{N}\otimes \mathbf{x}^{(n)} \rightarrow \prod_{n=1}^{N}\otimes \phi \left( \mathbf{x}^{(n)} \right) \in \mathbb{R}^{H_{1} \times H_{2} \times \cdots \times H_{N}}. \end{equation} \begin{figure}[t] \centering \centering \includegraphics[width=8 cm]{fig3_dual-map.pdf}\vspace{-8pt} \caption{ Dual-tensorial mapping} \label{fig3}\vspace{-10pt} \end{figure} \noindent Let the CP factorization of $\mathcal{X}, \mathcal{Y} \in \mathbb{R}^{I_{1} \times I_{2} \times \cdots \times I_{N}}$ be $\mathcal{X}= \sum_{r=1}^{R} \prod_{n=1}^{N}\otimes \mathbf{x}_{r}^{(n)}$ and $\mathcal{Y}= \sum_{r=1}^{R} \prod_{n=1}^{N}\otimes \mathbf{y}_{r}^{(n)}$ respectively. By using the concept of the kernel function, we see that the kernel can be defined directly with inner product in the feature space. Thus, when $R=1$, based on the above mapping and Eq.~\ref{eq4}, we can directly derive the naive tensor product kernels, {\ie}, \begin{align} & \kappa\left(\mathcal{X},\mathcal{Y}\right) =\prod_{n=1}^{N}\kappa \left(\mathbf{x}^{(n)},\mathbf{y}^{(n)}\right).\label{eq21} \end{align} Despite this, many authors has demonstrated that a simple rank-one tensor cannot provide compact and informative presentation for original data \cite{ZHL12}. The key point is how to design feature mapping when the value of $R$ is more than one. Based on the definition of the kernel function, it is easy to find that the feature space is a high-dimensional space of the original space, equipped with the same operations. Thus, we can factorize tensor data directly in the feature space the same as original space. This is formally equivalent to performing the following mapping: \begin{equation}\label{eq22} \phi: \sum_{r=1}^{R}\prod_{n=1}^{N}\otimes \mathbf{x}_{r}^{(n)} \rightarrow \sum_{r=1}^{R} \prod_{n=1}^{N}\otimes \phi \left( \mathbf{x}_{r}^{(n)} \right). \end{equation} \noindent In this sense, it corresponds to mapping tensors into high-dimensional tensors that retain the original structure. More precisely, it can be regarded as mapping the original data into tensor feature space and then conducting the CP factorization in the feature space. We call it the dual-tensorial mapping function (see Figure~\ref{fig3}). After mapping the CP factorization of the data into the tensor product feature space, the kernel itself is just the standard inner product of tensors in that feature space. Thus, we derive our {\ours}: \begin{equation} \label{eq23} \begin{split} \kappa \left( \sum_{r=1}^{R} \prod_{n=1}^{N} \otimes \mathbf{x}_{r}^{(n)}\ , \ \sum_{r=1}^{R} \prod_{n=1}^{N} \otimes \mathbf{y}_{r}^{(n)} \right) \\ = \sum_{i=1}^{R} \sum_{j=1}^{R} \prod_{n=1}^{N} \kappa \left( \mathbf{x}_{i}^{(n)},\mathbf{y}_{j}^{(n)}\right) \end{split} \end{equation} \noindent From its derivation, we know such a kernel can take the multi-way structure flexibility into account. In general, the {\ours} is an extension of the conventional kernels in the vector space to tensor space, and each vector kernel can be used in this framework for supervised tensor learning in conjunction with kernel machines. \subsection{Efficiency} We consider the case of Gaussian RBF kernel in our framework, which is one of the most popular kernels that have been proven successful in many different contexts. Assume that a set of tensor data $\left\{(\mathcal{X}_i ,\ y_i)\right\}_{i=1}^{M}$ is given, where $\mathcal{X}_i\in \mathbb{R}^{I_{1} \times I_{2} \times \cdots \times I_{N}}$. The time complexity of computing a Gaussian RBF kernel matrix is $O\left(M^2\prod_{n=1}^{N}I_n\right)$ and our method {\ours} is thus $O\left(M^2R^2\sum_{n=1}^{N}I_n\right)$. A typical characteristic associated with tensor data is very high dimensional while $R$ is often very small, which indicates our proposed method is significantly more efficient than its vector counterpart. It is also worth mentioning that our method depends on CP factorization technique, but it is backed with rapid implementation \cite{LL08}. The storage complexity is reduced from $O\left(M\prod_{n=1}^{N}I_n\right)$ to $O\left(M\sum_{n=1}^{N}I_n\right)$, where the data is compressed without quality loss and can be recovered quickly. Furthermore, since the constituent kernels are Gaussian RBF kernels, we can thus reformulate Eq.~\ref{eq23} to \begin{equation} \label{eq24} \begin{split} \kappa\left(\mathcal{X},\mathcal{Y}\right)=\sum_{i=1}^{R}\sum_{j=1}^{R}\prod_{n=1}^{N}\kappa\left(\mathbf{x}_{i}^{(n)},\mathbf{y}_{j}^{(n)}\right)\\ = \ \sum_{i=1}^{R}\sum_{j=1}^{R}\exp\left(-\sigma\sum_{n=1}^{N}\|\mathbf{x}_{i}^{(n)}-\mathbf{y}_{j}^{(n)}\|^2\right) \end{split} \end{equation} where $\sigma$ is used to set an appropriate bandwidth. We denote this kernel as {\ourmethod}. \section{Experiment Evaluation} \label{sec_exp} In this study, we validate the effectiveness of the {\ourmethod} kernel within standard SVM framework for tensor classification, which we refer to as {\ourmethod}. As an application we consider an example of neuroimaging mining. \subsection{Data collection} We use three real-world fMRI datasets in our experimental evaluation as follows. \begin{figure}[t] \centering \subfigure[] { \label{fig_example1_a} \begin{minipage}{.4\columnwidth} \centering \includegraphics[width=4.0cm]{fig4_reconstruction.pdf} \end{minipage} } \subfigure[] { \label{fig_example1_b} \begin{minipage}{.4\columnwidth} \centering \includegraphics[width=2cm]{fig4_original.pdf} \end{minipage} }\vspace{-8pt} \caption{(a) An illustration of a three-order tensor (fMRI image), (b) An visualization of fMRI image.} \label{fig4}\vspace{-10pt} \end{figure} \noindent\textbullet \ \emph{Alzheimer's Disease (ADNI)}: The first dataset is collected from the Alzheimer's Disease Neuroimaging Initiative\footnote{\url{http://adni.loni.usc.edu/}}. The dataset consists of records of patients with Alzheimer's Disease (AD) and Mild Cognitive Impairment (MCI). We downloaded all records of resting-state fMRI images and apply SPM8 toolbox\footnote{\url{http://www.fil.ion.ucl.ac.uk/spm/software/spm8/}} to preprocess the data. We deleted the first ten volumes for each individual, and functional images were realigned to the first volume, slice timing corrected, and normalized to the MNI template and spatially smoothed with an 8-mm FWHM Gaussian kernel. Resting-State fMRI Data Analysis Toolkit (REST\footnote{\url{http://resting-fmri.sourceforge.net}}) was then used to remove the linear trend of time series and temporally band-pass filtering ($0.01-0.08$ Hz). The average value of each subject over time series was calculated within each of those boxes, thereby resulting in 33 samples and a sum total of $61\times73\times61=271633$ voxels (or features). We treat the normal brains as negative class, and AD+MCI as the positive class. Each individual is linearly rescaled to $[0, 1]$. Feature normalization is an important procedure, since the brain of every individual is different.\\ \noindent\textbullet \ \emph{Attention Deficit Hyperactivity Disorder (ADHD)}: The second dataset is collected from ADHD-200 global competition dataset\footnote{\url{http://neurobureau.projects.nitrc.org/ADHD200/}}. The dataset contains records of resting-state fMRI images for $776$ subjects with $58\times49\times47=133574$ voxels, which are labeled as real patients (positive) and normal controls (negative). The original dataset is unbalanced, we randomly sampled $100$ ADHD patients and $100$ normal controls from the dataset for performance evaluation and the average over time series is conducted. Such dataset are quite special, all algorithms perform bad with normalization, we use non-normalized dataset.\\ \noindent\textbullet \ \emph{Human Immunodeficiency Virus Infection (HIV)}: The third dataset is collected from the Department of Radiology in Northwestern University \cite{WF11}. The dataset contains fMRI brain images of patients with early HIV infection (positive) as well as normal controls (negative). The same preprocessing steps as in ADNI dataset were given. This contains $83$ samples with $61\times73\times61=271633$ voxels. \subsection{Baselines and Metrics} In order to establish a comparative study, we use seven state-of-the-art methods as baselines, each representing a different strategy. We here focus on SVM classifier, since it has been proven successful in many applications. \begin{table*}[t] {\tiny \centering \caption{Average classification accuracy comparison: mean (standard deviation).}\label{tb_2} \begin{tabular}{|l|c|c|c|c|c|c|c|c|} \hline \textbf{Dataset} & \textbf{\ourmethod} & \textbf{Gaussian RBF} & \textbf{Factor kernel} & \textbf{K$_{3rd}$ kernel} & \textbf{linear SHTM} & \textbf{linear SVM} & \textbf{PCA+SVM} & \textbf{MPCA+SVM}\\ \hline ADNI & \textbf{0.75 (0.18)} & 0.49 (0.23) & 0.51 (0.21) & 0.55 (0.14) & 0.52 (0.31) & 0.42 (0.27) & 0.50 (0.02) & 0.51 (0.02)\\ ADHD & \textbf{0.65(0.01)} & 0.58 (0.00) & 0.50 (0.00) & 0.55 (0.00) & 0.51 (0.03) & 0.51 (0.01) & 0.63 (0.01) & 0.64 (0.01)\\ HIV & \textbf{0.74 (0.00)} & 0.70 (0.00) & 0.70 (0.01) & \textbf{0.75 (0.02)} & 0.70 (0.01) & 0.74 (0.01) & 0.73 (0.25) & 0.72 (0.02)\\ \hline \end{tabular} }\vspace{-10pt} \end{table*} \begin{figure*}[t] \centering \subfigure[ADNI] { \label{fig_5_a} \begin{minipage}{.4\columnwidth} \centering \includegraphics[width=\textwidth]{fig5_ADNI.pdf} \end{minipage} } \subfigure[ADHD] { \label{fig_5_b} \begin{minipage}{.4\columnwidth} \centering \includegraphics[width=\textwidth]{fig5_ADHD.pdf} \end{minipage} } \subfigure[HIV] { \label{fig_5_c} \begin{minipage}{.4\columnwidth} \centering \includegraphics[width=\textwidth]{fig5_HIV.pdf} \end{minipage} }\vspace{-8pt} \caption{Test accuracy vs. $R$ on (a) ADNI, (b) ADHD, and (c) HIV, where the red triangles indicate the peak positions.} \label{fig-5}\vspace{-10pt} \end{figure*} \noindent\textbullet \ Gaussian-RBF: a Gaussian-RBF kernel-based SVM, which is now the most widely used vector-based method for classification. In the following methods, if not stated explicitly, we use SVM with Gaussian RBF kernel as the classifier.\\ \noindent\textbullet \ Factor kernel: a matrix unfolding based tensor kernel, which is recently proposed in \cite{SLS11} and the constituent kernels belong to a class of Gaussian RBF kernels.\\ \noindent\textbullet \ K$_{3rd}$ kernel: a class of vector-based tensor kernels, aiming at representing the tensor in each vector space to capture structural information and have been applied to analyze fMRI images in conjunction with Gaussian RBF kernel \cite{S11}. \\ \noindent\textbullet \ Linear SHTM: a linear support higher-order tensor machine \cite{HHCY13}, which is one of the most effective methods for tensor classification that generalizes linear SVM to tensor pattern using CP factorization and can be regarded as a special case of {\ours}, namely the constituent kernels are linear kernels. This baseline is used to test the ability of our proposed method to cope with complex (possibly nonlinear) structured data. \\ \noindent\textbullet \ Linear kernel: linear SVM has also been increasingly used to handle fMRI data. In some cases, it outperforms SVM using nonlinear kernels. \\ \noindent\textbullet \ PCA+SVM: Principal component analysis (PCA) is a vector-based subspace learning algorithms, which are commonly used for dealing with high-dimensional data, in particular fMRI data. \\ \noindent\textbullet \ MPCA+SVM: Multilinear principal component analysis (MPCA) \cite{LPV08} is a natural extension of PCA to tensors, which are used to handle high-dimensional tensor data. The first three baselines are used to show the improvement of our proposed method over current kernel approaches to tensor classification. The last two baselines are used to test the effectiveness of our proposed method compared to unsupervised methods for tensor classification. The effectiveness of an algorithm is always evaluated by test accuracy, we utilize it as metrics in the experiments. For our proposed method and linear SHTM, we choose the most popular and widely used enhanced linear search method \cite{LL08} as its CP factorization strategy. All of the related methods select the optimal trade-off parameter from $C\in \{2^{-5}, 2^{-4}, \cdots,2^{9}\}$ and kernel width parameter from $\sigma\in \{2^{-4}, 2^{-3}, \cdots, 2^{9}\}$. Considering the fact that there is no known closed-form solution to determine the rank $R$ of a tensor a priori \cite{KM11}, and rank determination of a tensor is still an open problem \cite{SL08}, in our method and linear SHTM, we use grid search to determine the optimal rank and the optimal trade-off parameter together, where the rank $R\in \{1, 2, \cdots, 12\}$. The influence of different rank parameters on the classification performance of our method is also given. All the experiments are conducted on a computer with Intel Core2\texttrademark 1.8GHz processor and 3.5GB RAM memory running Microsoft Windows XP. \subsection{Classification Performance} In our experiments, we first randomly sample 80\% of the whole data as the training set, and the remaining samples as the test set. This random sampling experiment was repeated 50 times for all methods. The average performances of each method are reported. Table~\ref{tb_2} shows the average classification accuracy and standard deviation of seven algorithms on three datasets, where the best result is highlighted in bold type. From the experimental results in Table~\ref{tb_2}, we can observe that the classification accuracy of each method on different dataset can be quite different. However, the best method that outperforms other methods in all datasets is {\ourmethod}, especially for ADNI dataset. It is worth noting that in neuroimaging task it is very hard for classification algorithms to achieve even moderate classification accuracy on ADNI dataset since this data is extremely high dimensional but with small sample size. While we can observe an 20\% gain over comparison methods. Based on this result, we can conclude that operation on tensors is much more effective than on matrices and vectors for high-dimensional tensor data analysis. So far we have demonstrated that our proposed method is effective for tensor classification. However, it is still interesting to show how the data structure for tensor is actually used in our method. We focus on ADNI dataset to conduct an analysis. Figure~\ref{fig-6} shows the visualization of original ADNI object and reconstruction result from our chosen CP factorization. As illustrated, CP factorization can fully capture the multi-way structure of the data, thus our method take it into account in the learning process. \subsection{Parameter Sensitivity} Although the optimal rank parameter $R$ , the optimal trade-off parameter $C$ and kernel width parameter $\sigma$ are found by a grid search in {\ourmethod}, it is still important to see the sensitivity of {\ourmethod} to the rank parameter $R$. For this purpose, we demonstrate a sensitivity study over different $R\in\{1, 2, \cdots, 12\}$ in this section, where the optimal trade-off parameter and kernel width parameter are still selected from $C\in \{2^{-5}, 2^{-4}, \cdots,2^{9}\}$ and $\sigma\in \{2^{-4}, 2^{-3}, \cdots, 2^{9}\}$ respectively. According to the aforementioned analysis, we know that the efficiency of {\ourmethod} is reduced when $R$ is increased because a higher value of $R$ implies that more items are included into kernel computations. Thus, we only demonstrate the variation in test accuracy over different $R$ on three datasets. As shown in Figure~\ref{fig-5}, we can observe that the rank parameter $R$ has a significant effect on the test accuracy and the optimal value of $R$ depends on the data, while the optimal value of $R$ lies in the range $2 \leq R\leq 5$, which may provide a good guidance for selection of the $R$ in advance. In summary, the parameter sensitivity study indicates that the classification performance of {\ourmethod}+SVM relies on parameter $R$ and it is difficult to specify an optimal value for $R$ in advance. However, in most cases the optimal value of $R$ lies in a small range of values as demonstrated in \cite{HHCY13} and it is not time-consuming to find it using the grid search strategy in practical applications. \begin{figure}[t] \centering \subfigure[original data] { \label{fig6a} \begin{minipage}{.35\columnwidth} \centering \includegraphics[width=\textwidth]{fig6a_original.pdf} \end{minipage} } \subfigure[reconstruction] { \label{fig6b} \begin{minipage}{.35\columnwidth} \centering \includegraphics[width=\textwidth]{fig6b_CP-reconstruction.pdf} \end{minipage} }\vspace{-8pt} \caption{(a) is visualization of original ADNI object (a cross section is shown on the left and a 3D plot on the right) and (b) is reconstruction result from our chosen CP factorization.} \label{fig-6}\vspace{-10pt} \end{figure} \section{Related Work}\label{sec_related} From the conceptual perspective, two topics can be seen as closely related to our {\ours} approach: supervised tensor learning and tensor factorization. This section gives a short overview of these areas and distinguishes {\ours} from other existing solutions. \textbf{Tensor factorizations}: Tensor factorizations are higher-order extensions of matrix factorization that elicit intrinsic multi-way structures and capture the underlying patterns in tensor data. These techniques have been widely used in diverse disciplines to analyze and process tensor data. A thorough survey of these techniques and applications can be found in \cite{KB09}. The two most commonly factorizations are CP and Tucker. CP is a special case of Tucker decomposition which forces the core array to a (super)diagonal form. It is thus more condensed than that of Tucker. In the supervised tensor learning setting, CP is more frequently applied to explore tensor data because of its properties of uniqueness and simplicity \cite{HHCY13, AIA13,TLWH07,ZLZ12}. However, in these applications, CP factorization is used either for exploratory analysis or to deal with linear tensor-based models. In this study, we employ the CP factorization to foster the use of kernel methods for supervised tensor learning. \textbf{Supervised tensor learning}: Supervised tensor learning has been extensively studied in recent years \cite{CHH06,GKP12,KP11,TLWH07,ZLZ12}. Most of previous work has concentrated on learning linear tensor-based models, whereas the problem of how to build nonlinear models directly on tensor data has not been well studied. A first attempt in this direction focused on second-order tensors and led to a non-convex optimization problem \cite{SLS10}. Subsequently, the authors claimed that it can be extended to deal with higher-order tensors at the cost of a higher computational complexity, and proposed a factor kernel for tensors of arbitrary order except for square matrices based upon matrix unfoldings \cite{SLS11}. In the context of this proposal, Signorette et al. \cite{SOLS12} introduced a cumulant-based kernel approach for classification of multichannel signals. Zhao et al. \cite{ZZAZC13} presented a kernel tensor partial least squares for regression of lamb movements. A drawback of the approaches in \cite{SLS11,SOLS12,ZZAZC13} is that they can only capture the one-way relationships within the tensor data, because the tensors are unfolded into matrices. The multi-way structures within tensor data are already lost before the kernel construction process. Different from these methods, we aim to directly exploit the algebraic structure of the tensor to study structure-preserving kernels. Another recent work by Hardoon et al. \cite{HS10}, although not directly performs supervised tensor learning, is worth mentioning in this context. They introduced the so-called tensor kernels to analyze neuroimaging data from multiple sources, which demonstrated that the tensor product feature space is useful for modeling interactions between feature sets in different domains. In this study, we make use of the tensor product feature space to derive our kernels in vivo the incorporation of CP model. The tensor kernels can be cast as a special case of our framework. \section{Conclusion and Future work} \label{sec_conclusion} In this paper we have introduced a new tensor-based kernel methodology and first operate directly on tensors. We have applied our method on the problem of fMRI classification. The results indicate that the prior structural information can indeed improve the classification performance, particularly with small-sample size. As previous work limited on learning with matrices and vectors, this paper provides a new insight into the understanding of the principles and ideas underlying the concept of tensor. In the future, we will investigate the reconstruction techniques of tensor data, so that our method can handle high-dimensional vector data more effectively. Another interesting topic would be to design some special method to address the parameter problem. Further study on this topic will also include many applications of DuSK kernels in real-world unsupervised learning with tensor representations. \vspace{-8pt} \section*{Acknowledgements} {\scriptsize This work is supported in part by NSF through grants CNS-1115234, DBI-0960443, and OISE-1129076, NIH through grant MH080636, US Department of Army through grant W911NF-12-1-0066, Huawei Grant, National Science Foundation of China ($61273295$, $61070033$), National Social Science Foundation of China ($11$\&ZD$156$), Science and Technology Plan Project of Guangzhou City($12C42111607$, $201200000031$), Science and Technology Plan Project of Panyu District Guangzhou ($2012$-Z-$03$-$67$), Specialized Research Fund for the Doctoral Program of Higher Education ($20134420110010$). Discipline Construction and Quality Engineering of Higher Education in Guangdong Province(PT$2011$JSJ) and China Scholarship Council. } \vspace{-8pt} \balance \bibliographystyle{abbrv} {\tiny
{'timestamp': '2014-08-06T02:06:49', 'yymm': '1407', 'arxiv_id': '1407.8289', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8289'}
arxiv
\section{Introduction} Collective behaviors are ubiquitous in nature. They can be observed in diverse systems such as animal flocking, microbial colony formation, traffic jamming, synchronization of genetically engineered bacteria and social segregation in human populations \cite{Ballerini2008,Ben-Jacob2000,Flynn2009,Danino2010,Schelling1971}. A striking aspect of many of these systems is that they span a hierarchy of scales and complexity. A common property of such complex systems is that the collective behavior at larger scales can often be understood without a knowledge of many details at smaller scales. This important feature allows one to study the system on multiple distinct spatiotemporal scales and use the information obtained in each scale to develop a more coarse-grained model at a larger scale. This approach has been termed multi-scale modeling and provides a framework for the study of complex systems \cite{Meier-Schellersheim,Qutub2009,Noble2008}. Compared to a fully detailed modeling approach, multi-scale models are more amenable to computer simulations, contain fewer ad hoc parameters and are easier to interpret. As a result these models can be very useful in developing theoretical understanding of complex systems. For example, great success has been achieved in study of pattern formation in microbial colonies by modeling them as a continuum of cells with simple rules such as growth and diffusion \cite{Ben-Jacob2000}. One interesting system that exhibits different behaviors on different spatiotemporal scales is the social amoeba {\it Dictyostelium discoideum} \cite{Mehta2010}. {\it Dictyostelium} has a fascinating lifecycle. It starts as a population of unicellular organisms that can separately grow and divide. However, when starved, these cells enter a developmental program where individual cells aggregate, form multicellular structures, and eventually, fruiting bodies and spores. Upon starvation, cells produce the small signaling molecule cAMP, and excrete it into the environment in periodic bursts. Each cell responds to an increase in the concentration of extracellular cAMP by secreting more cAMP, resulting in pulses that propagate through the environment as spiral waves. Cells eventually aggregate at the center of these spiral waves and search for food collectively \cite{McMains2008}. In addition to its fascinating life cycle, {\it Dictyostelium} is also an important model organism for eukaryotic chemotaxis. The {\it Dictyostelium} chemotaxis network is highly conserved among eukaryotes \cite{Swaney2010}, and is thought to be a good model for many medically relevant phenomena ranging from neutrophil chemotaxis and cancer metastasis to cell migration during animal morphogenesis \cite{Parent2004, Zernicka-Goetz2006}. There has been extensive work on modeling the {\it Dictyostelium} signaling network, starting with the pioneering work by Martiel {\it et al.} \cite{Martiel1987}. These authors suggested that oscillations and spiral waves emerge from negative feedback based on desensitization and adaptation of the cAMP receptor. More recent models extend on this work by incorporating additional proteins known to play a significant role in the {\it Dictyostelium} signaling network \cite{Laub1998}. Although very successful at producing oscillations and spiral patterns, these models are inconsistent with recent quantitative experiments that show cells oscillate even in the presence of saturating levels of extracellular cAMP \cite{Gregor2010}. Other models have focused on reproducing the eukaryotic chemotaxis network, which shares many molecular components with the signaling network responsible for collective behavior \cite{Takeda2012,Wang2012}. These models explore how cells respond to an externally applied pulse of cAMP but do not attempt to model oscillations or spiral waves. Combinations of such models with oscillatory networks represent a possible route for multiscale modeling \cite{Xiong2010} but have not been extensively studied. Other models have focused on reproducing spiral waves in {\it Dictyostelium} populations using reaction diffusion equations and cellular automata \cite{Aranson1996,Kessler1993}. While these models tend to be very successful at producing population level behaviors, it is hard to relate these models to the behavior of single cells. This highlights the need for new mathematical models that can bridge length and complexity scales. Recently, there have been tremendous experimental advances in the study of {\it Dictyostelium}. Using microfluidics and single-cell microscopy, it is now possible to produce high-resolution time-course data of how single {\it Dictyostelium} cells respond to complex temporal cAMP inputs \cite{Gregor2010,Xiong2010,Wang2012,Cai2011,Song2006,Sawai2007,Cai2010,Masaki2013}. By combining such quantitative data with ideas from dynamical systems theory and the theory of stochastic processes, we recently \cite{Sgro2014} proposed a new universal model for the {\it Dictyostelium} signaling network, based on an excitable signaling network coupled to a logarithmic ``pre-processing" signaling module (see Figure \ref{fig:Schematic}). To make a phenomenological model for single and multicellular behavior we exploited the observation that the {\it Dictyostelium} signaling network is poised near a bifurcation to oscillation. Each {\it Dictyostelium} cell was treated as an excitable FitzHugh-Nagumo model that was coupled to other cells through the concentration of the extracellular cAMP. A central finding of this model was that intracellular noise is a driving force for multicellular synchronization. Inspired by these results, in this paper we analyze a family of models for cells communicating via an external signal such as cAMP. The external signal is detected by the cell, transduced through a preprocessing module which can be linear, logarithmic, or Michaelis-Menten, and then fed into an excitable signaling network. Using these models, we explore the rich population-level behaviors that emerge in coupled oscillator systems from the interplay of stochasticity, excitability, and the dynamics of the external medium. We also extend our models to include space and show that spiral waves naturally emerge in the limit of large population densities. In contrast to earlier models for spiral waves, we can explicitly include the dynamics of extracellular cAMP and treat it distinctly from the dynamics of signaling networks. Our model naturally overlaps with, and complements, the extensive literature of coupled oscillatory and excitable systems. Coupled oscillators have been observed in many different biological systems such as neuronal networks, circadian rhythm, Min system and synthetic biological oscillators \cite{Traub1989,Enright1980,Mirollo1990,Meinhardt2001,Danino2010}. Most theoretical models focus on directly coupled oscillators and relatively little work has been done on noisy oscillators coupled through a dynamical external medium such as cAMP \cite{Schwab2012a,Schwab2012}. Furthermore, an important aspect of our model is the role played by stochasticity. It is well-known that noisy systems are not easily amenable to traditional methods in dynamical systems theory \cite{Tanabe2001,Lindner2004} and concepts such as bifurcation point are ill-defined in this context. For this reason, the {\it Dictyostelium} signaling network provides a rich, experimentally tractable system for exploring the physics of noisy oscillators coupled through an external medium. The paper is organized as follows. We start by introducing our family of models. We then construct phase diagrams describing the behavior of spatially-homogenous populations, focusing on the regime where extracellular signaling molecules are degraded quickly compared to the period of oscillations. We then analyze the opposite regime where signaling dynamics is slow and show that this gives rise to novel new behaviors such as dynamic death. Finally, we extend the model to spatially inhomogeneous populations and study how spiral waves naturally arise in these models. We then discuss the biological implications of our results, as well as, the implications of our model for furthering our understanding of coupled oscillators. \section{ Modeling \emph{Dictyostelium} Populations} \label{sec:Model} New experimental advances allow for the direct measurement and manipulation of the small signaling molecule cAMP used by {\it Dictyostelium} cells to coordinate behavior in cellular populations. In such experimental systems, a few hundred {\it Dictyostelium} cells are confined in a microfluidic device. The levels of intracellular cAMP within cells can be measured quantitatively using a F\"{o}rster Resonance Energy Transfer (FRET)-based sensor \cite{Gregor2010,Sgro2014}. This allows for precise, quantitative measurements of the response of the {\it Dictyostelium} signaling networks to complex temporal signals of extracellular cAMP. Cells are placed in a microfluidic device at a density $\rho$. The microfluidic device allows for rapid mixing and exchange of extracellular buffer, which ensures that cells experience a uniform and controlled environment. The flow rate of buffer can be experimentally manipulated. Large flows wash away the extracellular cAMP produced by cells, resulting in a larger effective degradation rate, $J$, for extracellular cAMP. It is also possible to add cAMP to the buffer at some rate $\alpha_f$. This experimental set-up is summarized in Figure \ref{fig:Schematic}. We start by building models for spatially unstructured populations where the extracellular cAMP concentration is assumed to be uniform. In this case, all cells in the chamber sense the same extracellular cAMP concentrations and we can ignore all spatial effects. To model individual cells, we build upon our recent work \cite{Sgro2014} where we showed that the dynamics of the {\it Dictyostelium} signaling network can be modeled using a simple, universal, excitable circuit: the noisy Fitzhugh-Nagumo (FHN) model. To realistically model the {\it Dictyostelium} signaling circuit, it is necessary to augment the FHN with an additional ``pre-processing'' module that models the signal transduction of extra-cellular cAMP levels upstream of this core excitable circuit (Figure \ref{fig:Schematic}B). In the full signaling circuit, extracellular cAMP is detected by receptors on cell membrane. The resulting signal is funneled through several signal transduction modules, ultimately resulting in the production of cAMP. To model this complicated signal transduction process, we use a family of preprocessing modules, whose output serves as an input into the universal excitable circuit. Inspired by the {\it Dictyostelium} circuit, we assume that the dynamics of the preprocessing module are fast compared to the excitable dynamics of cAMP signaling circuit. For example, the typical time scale associated with the early signaling protein Ras is of order 30 seconds whereas cAMP oscillations have periods of order 300 seconds \cite{Takeda2012,Gregor2010}. This allows us to model the preprocessing modules using a monotonically increasing function, $I(S)$, that relates the output of the preprocessing module to the extracellular cAMP concentration, $S$. In this work, we will consider three different biologically inspired pre-processing modules: (1) a linear module $I(S)=S$ where the extracellular cAMP signal does not undergo any preprocessing; (2) a Michaelis-Menten module, \begin{equation} I(S)=\frac{\beta S}{S+K_D}, \end{equation} where the output is a saturating function of the extracellular cAMP; and (3) the logarithmic module that senses fold changes \begin{equation} I(S)=a\log{\left(1+S/K\right)}. \end{equation} The output of these modules is fed into a universal, excitable circuit modeled by the FHN. The FHN model consists a set of inter-locking positive and negative feedback loops consisting of an activator, $A$, that quickly activates itself through positive feedback, and on a slower time scale, activates a repressor $R$, that degrades the activator $A$. The FHN model is the prototypical example of an excitable system, and can spike or oscillate depending on the external input. To incorporate the biology of cAMP secretion by {\it Dictyostelium} cells in response to external inputs, we assume that when a cell spikes, it releases cAMP into the environment. To determine when a cell spikes, we threshold the activator variable $A$ using a Heaviside function $\Theta(A)$, where $\Theta(x)=1$ if $x>0$ and $\Theta(x)=0$ if $x=0$. Finally, we assume that cells produce and secrete cAMP at a spike-independent basal rate, $\alpha_0$. This can be summarized by the equations \begin{align} \label{eqn:Model} \frac {dA_i}{ dt} &= A_i-\frac{1}{ 3}{A_i}^3-R_i+I(S)+\eta_i(t) , \qquad i = \{1,2,...,N\}\\\nonumber \frac{dR_i}{dt}&= \epsilon (A_i - \gamma R_i+C) \\\nonumber \frac{dS}{dt}&= \alpha_f + \rho \alpha_0 + \rho D\frac{1}{N}\sum_{i=1}^N \Theta(A_i)-JS, \end{align} where $i$ is the index of cells changing from 1 to the total number of cells, $N$. The variable $A_i$ and $R_i$ are the internal states of the $i$'th cell and correspond to activator and repressor, respectively. $S$ is the concentration of extracellular cAMP and $I(S)$ is the preprocessing module, $\rho$ is the density of cells, $D$ measures the amount of cAMP released into the environment when a cell spikes, and $J$ is the total degradation rate of the extracellular cAMP. Finally, we have incorporated stochasticity using a Langevin term, $\eta_i(t)$. In particular, $\eta_i(t)$ is an additive Gaussian white noise term with mean and correlation defined as: \begin{align} \left<\eta(t)\right>&=0\\\nonumber \left<\eta_i(t)\eta_j(t')\right> &=\sigma^2\delta_{ij}\delta(t-t') \end{align} The model and corresponding parameters are summarized in figures \ref{fig:Schematic}A and \ref{fig:Schematic}B. Using this model, we can explore a series of questions about how the architecture of the {\it Dictyostelium} signaling circuit within cells affects population-level behaviors. Recent experimental data suggests that the behavior of {\it Dictyostelium} circuit is well described by the logarithmic preprocessing module and responds to fold changes in extracellular cAMP \cite{Sgro2014}. This leads to natural questions about the consequences of pre-processing in the {\it Dictyostelium} signaling circuit. In particular, using our model we will examine how {\it Dictyostelium} exploits the interplay between stochasticity, excitability, and signal processing to control population-level behavior. \section{Behavior for large degradation rates of extracellular cAMP} \label{sec:LargeDegradationRate} \subsection{The quasi-steady-state limit} In general, the dynamics described by the family of models described by Eq. \eqref{eqn:Model} are quite complex. For this reason, it is worth considering various limits in which the dynamics simplifies. One such limit that can be realized experimentally is the limit where the extracellular cAMP is degraded quickly compared to the dynamics of the {\it Dictyostelium} circuit. This limit can be realized experimentally by changing the flow rate of buffer into the microfluidic device (see Fig. \ref{fig:Schematic}). In this limit, there exists a separation of time-scales between external medium and individual oscillators and we can treat the extra-cellular cAMP as a fast variable that is always in a quasi-steady state and set $dS/dt=0$ in \eqref{eqn:Model}. In this limit, one has \begin{align} S\approx{\alpha_f+\rho\alpha_0\over J} + {\rho D\over J}\frac{1}{N}\sum_{i=1}^N \Theta(A_i). \label{eq:SLargeJ} \end{align} For the remainder of this section, we will work within this quasi steady-state approximation. A formal definition of what constitutes large $J$ will be discussed in section \ref{sec:SmallDegradationRate} where we will give numerical evidence showing that there exist a minimum value $J_m$ above which this approximation is valid. In this limit, it is helpful to divide the extracellular cAMP into two terms that reflect the two mechanisms by which extracellular cAMP is produced (see Fig. \ref{fig:Schematic}). First, cells can secrete cAMP at a basal rate $\alpha_0$. We denote the extracellular cAMP produced by this basal leakage, $S_0$, and in the quasi steady-state approximation this is given by \begin{align} S_0&\equiv{\alpha_f+\rho\alpha_0\over J}. \label{eqn:Axes1} \end{align} where the experimental input flow, $\alpha_f$ is also incorporated into the definition. The second mechanism by which extracellular cAMP is produced is through the release of cAMP into the environment when cells spike. We can parameterize the extracellular cAMP produced by this latter mechanism by \begin{eqnarray} \Delta S &\equiv& {\rho D\over J }, \label{eqn:Axes2} \end{eqnarray} with the total extracellular cAMP produced by spiking given by the expression, \begin{align} \Delta S \left<\Theta(A)\right> \equiv \Delta S\frac{1}{N}\sum_{i=1}^N \Theta(A_i) \label{squarewave} \end{align} To better understand the quantities $S_0$ and $\Delta S$, it is useful to consider an ideal situation where all the cells in a population are perfectly synchronized. In this case, $\left<\Theta(A)\right>$ will periodically switch between $0$ and $1$. Hence $S$ will behave like a square wave with baseline $S_0$ and amplitude $\Delta S$ (see figure \ref{fig:Schematic}C). Thus, $S_0$ corresponds to the cAMP levels in the troughs and $S_0+\Delta S$ the levels at peaks. These two quantities provide us with a succinct way to represent our model and in the following section and we will use them to produce phase diagrams in the large $J$ regime. Finally, we note that the square wave form of $S$ is merely a result of our choice of Heaviside function in dynamics of the external medium. Nonetheless, the basic separation of time scales discussed above holds even when the Heaviside function is replaced by a more realistic smooth function. \subsection{Phase diagrams for population level oscillations} \label{sec:PhaseDiagram} Populations of {\it Dictyostelium} cells can exhibit several qualitatively distinct behaviors depending on the parameters of our model. Cells in a population can oscillate in phase with each other resulting in synchronized, population-level oscillations. We will call this behavior synchronized oscillations (SO). Alternatively, individual cells may oscillate, but the oscillations of the cells are out of phase. In this case, the phase differences between cells prevent the formation of coherent population level oscillations and we call these incoherent oscillations (IO). Finally, even individual cells may not spike. We will label this behavior No Oscillations (NO). To distinguish between these behaviors, it is useful to define three order parameters: the coherence, the single-cell firing rate, and population firing rate. Coherence measures how synchronized cells are within a population and is $1$ for a completely synchronized population and $0$ for a fully incoherent one (see Appendix \ref{app:Coherence} for a formal definition). To determine the rate at which a cell $i$ spikes, we count how often the activator variable $A_i$ becomes positive over some averaging time. We then average the firing rate of individual cells over the population. Finally, we normalize the rate so that the single cell firing rate is $1$ for fast oscillations and is $0$ in the absence of spiking (see Appendix \ref{app:FiringRate} for a formal definition). The population firing rate is defined as the firing rate of the average of activator across all cells in the population, $\left< A_i \right>$ and is also normalized to be between 0 and 1. Note that when we calculate the population firing rate we are measuring whether the average activator over all cells exhibits a spike. If cells are unsynchronized, this average activator $\left< A_i \right>$ will not exhibit any spikes. Thus, population firing rate is a measure of spike counts in a population that fires synchronously. Using these order parameters, we constructed phase diagrams characterizing the population level behavior for large degradation rates as a function of $S_0$ and $\Delta S$ (see equations \eqref{eqn:Axes1},\eqref{eqn:Axes2}). We calculated the coherence, single cell firing rate and population firing rate for equation \eqref{eqn:Model} for our three preprocessing modules as a function of $S_0$ and $\Delta S$ (see Figure \ref{fig:PhaseDiagrams}). Each data point on these phase diagrams corresponds to one simulation of equation \eqref{eqn:Model} for a fixed simulation time (see Appendix \ref{app:ForwardIntegration}) where $J$, $\alpha_0$, and $\rho$ are kept the same for the whole phase diagram and $\alpha_f$ and $D$ are chosen such that the desired $S_0$ and $\Delta S$ are achieved. Finally, we checked that phase diagram was insensitive to a ten fold increase in the degradation rate $J$ confirming our assumption that the dynamics depend on the parameters only through $\Delta S$ and $S_0$ (see figure \ref{fig:Alpha0DPhaseDiagJ100}). This phase diagram contains three qualitatively different regions. We have labeled these different regions with NO for No Oscillation, CO for Coherent Oscillation and IO for Incoherent Oscillation. The crossover between these regions, which will be explained below, is shown by dashed lines and is labeled as CC for Coherent Crossover, IC for Incoherent Crossover and SC for Sensitivity Crossover. Note that the boundaries between different regions is approximate and has been achieved simply by a rough thresholding. In reality there is no sharp transition from one `region' to another but instead due to noise this `transition' happens in a continuous way. This is a general feature of noisy bifurcating systems and in practice, depending on the problem under study, a reasonable threshold has to be chosen to separate different qualitative behaviors. As a result the schematic phase diagrams drawn in figure \ref{fig:PhaseDiagrams} are just rough sketches of the qualitative behavior of the system. In the NO region, single cells are silent and oscillations do not occur. As a result, both coherence and single cell firing rate are zero. In this region, the basal level of cAMP, $S_0$, is so small that the cells cannot be excited into oscillation. Note that at all points in the NO region, the parameters are such that individual cells are below the bifurcation to oscillations in the FHN model. However, even below the bifurcation cells occasionally spike due to stochasticity. In the CO region, cells oscillate coherently. This can be seen by noting that single cell firing rate is nonzero and coherence is close to one. By studying multiple time-courses we found that cell populations with coherence values approximately above 0.6 can be considered coherent (see figure \ref{fig:SamplesForCoherence}). In the IO region, single cells oscillate but are unsynchronized. On the phase diagrams these are regions with large values of single cell firing rate (close to $1$) and small values of coherence (approximately less than 0.6). In this region individual cells oscillate and, in each firing, secrete cAMP into the environment. However this change in extracellular cAMP is not enough to excite the cells to synchronize. To understand the reason behind this, we need to look at changes in the input, $I(S)$, that the excitable systems receive. For a population of cells that is oscillating coherently, $S(t)$ can be thought of as a square wave oscillating between $S_0$ and $S_0+\Delta S$ (see Figure \ref{fig:Schematic}C). Then the input of each excitable module within cells can be visualized as a square wave oscillating between $I_0$ and $I_0+\Delta I$ with: \begin{align} \label{eqn:DeltaI} I_0&=I(S_0)\\\nonumber \Delta I &= I(S_0+\Delta S)-I_0 \end{align} If changes in $\Delta I$, are smaller than the FHN's sensitivity for signal detection, single cells will instead experience a constant input with no discernable fluctuations and cannot be coherent. For a preprocessor with a monotonically increasing convex functional form, $I(S)$ (with $I(0)=0$) such loss of coherence may happen due to very small $\Delta S$ or very large $S_0$. Our phase diagrams exhibit a number of crossovers between the three qualitative behaviors outlined above. The Incoherent Crossover (IC) separates regions with no oscillations from those where cells oscillate incoherently. This transition occurs when $\Delta S$ is not large enough to produce any discernible changes in the external medium. As a result each individual cell goes through this crossover as if it was alone and not communicating with other cells. For these uncoupled cells, as $S_0$ is increased the system gets closer to bifurcation and fires more often. Figure \ref{fig:SingleCellFreq} shows this increase in firing rate for a single cell corresponding to $\Delta S=0$. There is also a crossover from the no oscillation region to coherent population level oscillations. We have labeled this the Coherent Crossover (CC). Here, as $S_0$ is increased, individual cells become more likely to spontaneously spike. These spontaneous spikes happen because, given a monotonically increasing function $I(S)$, for larger $S_0$ the excitable system's input will be closer to bifurcation point, causing the system to become more excitable. As a result, noise can more often kick the system out of its stable fixed point, leading to a spike commonly referred to as an accommodation spike \cite{Izhikevich2007}. If $\Delta S$ is large enough, a single (or few) cell's spike will be enough to cause a change in the external medium that can be sensed by other cells. The other cells will then get excited with a small delay, creating the effect of a synchronized spike. Because FHN has a refractory period, for sometime no cell will spike, until the effect is repeated again. The overall behavior in this way seems similar to coherent oscillations, but is in reality periodic synchronized noise-driven spikes that are happening way below the system's bifurcation point. To show that this effect is noise-dependent we decreased noise by an order of magnitude for the system with logarithmic preprocessor and plotted the results (inset of \ref{fig:PhaseDiagrams}C). We observed that CC shifted to the same value of $S_0$ as IC, indicating that the `knee' shaped region (intersection of CC and SC) emerges due to noise. Finally, Sensitivity Crossover (SC) separates regions with coherent oscillation from those with incoherent or no oscillations. As one crosses the SC line, cells lose their ability to detect the changes in the external medium. Each excitable system has a response threshold and cannot respond to abrupt changes in its input if they are below this threshold. In our model this can occur either because $\Delta S$ is very small or due to the nonlinear form of preprocessor. The former case is a manifestation of the fact that for very small changes in the external medium, cells do not have any means of communication. However the latter case requires some further explanation. For two of the preprocessors used in our simulations (i.e. Michaelis-Menten and logarithmic) the function $I(S)$ was chosen to be concave and monotonically increasing. This means that, for a fixed $\Delta S$, as $S_0$ is increased $\Delta I$ in equation \eqref{eqn:DeltaI} decreases. Once $\Delta I$ goes below the detection sensitivity of excitable modules, coherence will be lost. Note that since increasing $S_0$ and/or decreasing $\Delta S$ lead to decrease of $\Delta I$, for larger values of $\Delta S$ a larger value of $S_0$ is required to take the system from coherence to incoherence (assuming that sensitivity of excitable system is roughly independent of baseline $I_0$). This is why in figure \ref{fig:Schematic}B,C the slope of SC is positive. An interesting observation is that the preprocessing module into the excitable system can dramatically change the phase diagram of the cellular population. This suggests that it is possible to have different population level behaviors from the same underlying excitable system by changing the upstream components of a network. We now briefly discuss the differences in phase diagrams arising from the choice of pre-processing modules. The first row in figure \ref{fig:PhaseDiagrams}A shows the phase diagrams for a linear preprocessor. As can be seen in the schematic (last column), the curve for SC is almost flat (with a slight downward slope), a signature that single cell's sensitivity to changes in the external medium is almost independent of the baseline $S_0$. However inclusion of a preprocessing module completely changes this effect. Figure \ref{fig:PhaseDiagrams}B and figure \ref{fig:PhaseDiagrams}C show the results for a Michaelis-Menten and logarithmic preprocessor respectively. Note that in both cases SC has a dramatic positive slope. This is due to the concave monotonically increasing nature of the preprocessors chosen. It is interesting to note that for the logarithmic preprocessor there is an extra `knee' (where CC and SC intersect) that does not exist when Michaelis-Menten is used. A behavior reminiscent of this subregion has been observed experimentally \cite{Sgro2014} where increasing $S_0$ (by changing input flow) for a synchronously oscillating population destroys the oscillations, whereas further increase leads to incoherent oscillations. This suggests that the system is tuned to this corner. Interestingly, in this region of phase diagram $S_0$ and $\Delta S$ take the smallest possible values that can lead to coherent oscillations. Since $S_0$ and $\Delta S$ both correspond to production of cAMP by the cell, it seems reasonable from an evolutionary point of view if the system is fine-tuned to minimize its cAMP production while achieving the coherent oscillations. Experimentally, it is possible to move horizontally along this phase diagram by changing $\alpha_f$ and move laterally by changing $\rho$ and $J$. One interesting prediction of this phase diagrammatic approach is that for a coherently oscillating population of cells with a certain cell density increasing degradation rate, $J$ should decrease the minimum cAMP flow ($\alpha_f$) required to destroy the oscillations, an observation that has been confirmed experimentally \cite{Sgro2014}. Experimentally it is possible to change both $\rho$ and $J$. Gregor {\it et al} \cite{Gregor2010} measured population firing rate for different values of $\rho$ and $J$. They showed that there is a data collapse of the population firing rate as a function of $\rho/J$. To understand this behavior, we made phase diagrams as a function of $\rho$ and $J$ (Figure \ref{fig:rhoJHeatMap}). The insets show that for large degradation rates, this data collapse occurs for all choices of pre-processing modules. The underlying reason for this is that, as discussed above, in this limit the population dynamics depends on the external medium only through $S_0$ and $\Delta S$. Both these quantities depend on $\rho$ and $J$ through the combination ${\rho \over J}$ (see Eq \ref{eqn:Axes1} and Eq. \ref{eqn:Axes2}). \subsection{Frequency increase as a function of density} \label{sec:FrequencyIncrease} Our model also suggests a mechanism for cell populations to tune their frequency in response to steps of cAMP. An example of a time-course simulation of this behavior is shown in figure \ref{fig:FrequencyIncrease}A. In this figure a step of external cAMP is flowed into a population of coherently oscillating cells, leading to an increase in the frequency of oscillations. This frequency increase suggests that populations can tune their frequency by modulating the cAMP secretion and excretion rates. To explain the underlying reason for the frequency increase, it is useful to consider the extreme case of a perfectly synchronized oscillating population. For this case the extracellular cAMP concentration, $S(t)$, will be a square wave that oscillates between $S_0$ and $S_0+\Delta S$ (see figure \ref{fig:Schematic}C). As a result, the input to the FHN module will be a square wave oscillating between $I_0$ and $I_0+\Delta I$ (see equation \eqref{eqn:DeltaI}). Thus, the dynamics of individual cells can be thought of as an FHN that periodically switches between two cubic nullclines, corresponding to the inputs $I_0$ and $I_0+ \Delta I$. A schematic of the phase portrait of this system is shown in figure \ref{fig:FrequencyIncrease}B for two different values of $\Delta I$. As can be seen from this figure, a decrease in $\Delta I$ decreases the distance between the two cubic nullclines and leads to a shorter trajectory, hence larger frequency. So any mechanism that can decrease $\Delta I$ can lead to an increase in frequency. One such mechanism is by exploiting the nonlinearity of the preprocessing module. Note that in our example $\alpha_f$ is being increased while other parameters of the system are kept constant. This is equivalent to increasing $S_0$ while keeping $\Delta S$ constant. Since $I(S)$ is a monotonically increasing concave function, given a constant value of $\Delta S$ an increase in $S_0$ will lead to a decrease in $\Delta I$ (see figure \ref{fig:FrequencyIncrease}). And this, in turn, leads to an increase in frequency. In practice, there are two other mechanisms that also contribute to frequency increase. However, they are not multicellular effects and happen independent of preprocessing module. The interested reader can refer to Appendix \ref{app:FrequencyIncrease} for a detailed description. Note that to observe this behavior we have tuned the parameters of the system to a different point (black dots in figure \ref{fig:PhaseDiagrams}C) than what has been used in the rest of the paper. This change of parameters was necessary to ensure that initially the cells were not oscillating at maximum frequency and yet would stay synchronized as $\alpha_f$ was increased. As a result it may not be possible to observe this behavior in wildtype {\it Dictyostelium} cells. However, it is of interest as a theoretical mechanism for frequency tuning and has the potential to be observed in {\it Dictyostelium} mutants or be implemented in synthetic biological networks of other organisms. \section{Small Degradation Rate and Bistability} \label{sec:SmallDegradationRate} Thus far, we have studied the behavior of our model in the large $J$ regime. In this section, we will instead focus on the regime where this parameter is small. For small values of $J$, the dynamics of the external medium becomes too slow to follow the oscillations of single cells. As a result, cells become unsynchronized. A behavior somewhat similar has been termed `dynamic death' by Schwab {\it et al.} \cite{Schwab2012}. These authors studied a population of oscillators coupled to an external medium and observed incoherence due to inability of external signal to follow individual oscillators. In their system, the cause of incoherence was slow response of the external medium to inputs rather than slow degradation. However, in both cases, the underlying reason for the loss of coherence is the slow dynamics of external signal. We can numerically define a minimum degradation rate, $J_m$, below which the dynamics of the external medium are too slow to sustain population level oscillations. To do so, we identified the boundary separating the region of coherence from incoherence by thresholding the coherence at approximately $0.6$. This boundary is indicated by the black curves in the coherence plots in the first column of Fig. \ref{fig:rhoJHeatMap}. We call the smallest value of $J$ on this curve the minimum degradation rate, $J_m$. Figure \ref{fig:SmallJ}A shows a raster plot of the oscillations for $J=2 J_m$ and $J=0.5 J_m$, with all other parameters fixed. Notice that decreasing $J$ below $J_m$ completely destroys the ability to have synchronized population-level oscillations. Finally, it is worth emphasizing that due to the stochastic nature of our system, there is no sharp transition from coherence to incoherence at $J_m$. Rather, $J_m$ serves as a crude, but effective scale, for understanding external medium dynamics. To better understand $J_m$, we asked how it scaled with the cell period in the underlying FHN model. Since $J_m$ is a measure of when the external signaling dynamics are slow compared to the signaling dynamics of individual cells, we hypothesized that $J_m$ would scale with the frequency of oscillations in the underlying FHN model. To test this hypothesis, we changed single cell frequencies by changing $\epsilon$ in equation \ref{eqn:Model}. We then determined $J_m$ in each case by finding the boundary between coherence and incoherence (see figure \ref{fig:Boundaries}). The results are shown in figure \ref{fig:SmallJ}B. As postulated, we find that increasing single cell firing rate leads to a higher value of $J_m$. These results numerically confirm our basic intuition that $J_m$ is a measure of when the external signal response is much slower than the time scale on which individual cells respond to stimuli. In section \ref{sec:PhaseDiagram} we studied the system in the $J\gg J_m$ regime. Here, we re-examine the phase diagrams changes in the opposite limit when $J$ is decreased below $J_m$. To this end, we produced a set of phase diagrams with different values of $J$. Figure \ref{fig:BistabilityAll} shows three representative phase diagrams showing this crossover. Notice that the phase diagram above $J_m$ at $J=3.2J_m$ is very similar to \ref{fig:PhaseDiagrams}C; however, decreasing $J$ below $J_m$ to $J_m=0.32J_m$ creates a completely incoherent population in which single cells can oscillate in regions that previously contained no oscillations (NO). This is likely due to the fact that once a cell fires, the secreted cAMP takes a very long time to be degraded. During this time, other cells can spontaneously fire. These spiking events are incoherent but still give rise to elevated levels of external cAMP. More interestingly the transition from the behavior at large degradation rates ($J > J_m$) to small degradation rates ($J<J_m$) happens through an intermediate state with many peculiar data points (the middle row in figure \ref{fig:BistabilityAll}A). To ensure that these peculiarities are not simulation artifacts we looked at some of them in more detail. Figure \ref{fig:BistabilityAll}B is a time-course of the whole population for the point corresponding to the white circle on \ref{fig:BistabilityAll}A. Note that the time-course is exhibiting a burst-like behavior. The system is in a low frequency state for some period of time, then stochastically switches to a high frequency state and after a few cycles switches back to original state. Interestingly, it remains coherent during the whole process. At this point we do not have a conclusive theory as to why this bistability happens. However, a similar behavior had been reported by Schwab {\it et al.} \cite{Schwab2012a} where a population of phase oscillators coupled to an external medium exhibited bistability as mean oscillator frequency was increased. We suspect that a similar mechanism is also in effect here. \section{Spatial Extension of model produces spiral waves} \label{sec:SpatialModel} As a final step in our modeling approach, we extended equation \ref{eqn:Model} to model dense population of {\it Dictyostelium} cells. Here, we restrict ourselves to discussing the biologically realistic case of a logarithmic preprocessing module $I(S)={a \ln\left( 1+{S\over K}\right)}$, though similar results were obtained for other pre-processing modules. To model dense populations, we treat the activator, $A(x,y)$, repressor, $R(x,y)$, and extracellular cAMP, $S(x,y)$ as a function of the spatial coordinates $x,y$. Furthermore, we explicitly model the diffusion of the extracellular cAMP. This gives rise to a set of reaction-diffusion equations of the form: \begin{align} \label{eqn:SpatialModel} \frac {dA}{ dt} &= A-\frac{1}{ 3}{A}^3-R+I(S) ,\\\nonumber \frac{dR}{dt}&= \epsilon \left(A - \gamma R+C\right) \\\nonumber \frac{dS}{dt}&=\rho \alpha_0 + \rho D\Theta(A)-JS+\nabla^2S \end{align} For simplicity we have not included the noise term, $\eta$, and the input cAMP flow, $\alpha_f$. Furthermore, diffusion coefficient has been set to 1 by absorbing it into the spatial coordinate. We simulated these equations using no-flow boundary conditions and random initial conditions. Figure \ref{fig:Spatial} shows a snapshot of activator, $A$, over the whole space. The left column shows the results with initial conditions chosen such that at most one spiral forms (see Appendix \ref{app:ReactionDiffusion}). Note that a spiral wave is clearly formed at large values of degradation rate ($J=10$). However, decreasing this parameter while keeping $\rho/J$ constant leads to complete disappearance of the spiral pattern. The right column in figure \ref{fig:Spatial} shows the same results with initial conditions that lead to multiple spirals (see Appendix \ref{app:ReactionDiffusion}). In this case, a similar disappearance of spiral waves is observed as degradation rate of cAMP is decreased. Disappearance of spiral waves has been observed in {\it RegA} mutants\cite{Sawai2005}. Since {\it RegA} intracellularly degrades cAMP, it can be thought of as one contributing factor to degradation rate $J$ in our simplified model. As a result, knocking out this gene could decrease $J$ and have an adverse effect on spiral formation. In this regard, this simple extension of our model is compatible with experiments. Besides models of {\it Dictyostelium discoideum}, spiral patterns in excitable media have been observed in many other contexts such as cardiac arrhythmia, neural networks and BZ reactions. In this regard, emergence of spiral patterns in a diffusive excitable medium is not new. However, in the context of {\it Dictyostelium discoideum}, a key difference between our model and previous models such as the one proposed by Aranson {\it et al} \cite{Aranson1996} is that in our model only the external medium $S$ can diffuse. Previous models made the biologically unrealistic assumption that the intracellular variables could diffuse and the external medium did not. \section{Discussion} During starvation, {\it Dictyostelium discoideum} cells secrete periodic spikes of cAMP in response to extracellular cAMP levels and communicate by propagating waves of cAMP across space. We modeled this behavior using a multi-scale modeling approach. We constructed a family of dynamical models that increased in complexity. We started by modeling isolated cells. We then extended to the model to understand spatially-homogenous multicellular populations. Finally, we included the effects of space and diffusion. In our approach, we treated individual cells as noisy excitable systems that receive their input from a preprocessing module which responds to external cAMP concentrations. We coupled these cells through an external medium and studied their oscillations and coherence through phase diagrams. These phase diagrams provided us with a succinct, interpretable representation of our model. Using these diagrams, we found that the complex interplay of multicellularity, stochasticity and signal processing gives rise to a diverse range of phenomena that have been observed experimentally. By including space into this model we were able to produce spiral patterns and study them in different regimes. Using phase diagrams, we showed that the crossover from silence to coherent oscillations is noise-driven. In this process, some cells randomly fire, leading to the sudden secretion of cAMP and an increase in the external cAMP levels. This change in extracellular cAMP levels induces other cells in the population to spike, resulting in synchronized oscillations across the population. This behavior emerges from the complex interplay of cellular communication and stochasticity. In this process, each population-level spike consists of early spikers and late spikers, where the former drives the latter. This behavior is reminiscent of 'pacemaker' cells which are hypothesized as driving forces for synchronization and pattern formation. But unlike traditional models, in our model no cell is intrinsically a pacemaker. Instead, early spikers are picked at random. Thus, noise is crucial to the observed dynamical behavior of cellular populations. To explore the effect of preprocessor we studied a family of models with different preprocessing modules. We found that the choice of a nonlinear function as the preprocessor leads to a new crossover from coherent oscillations to incoherent oscillations that is non-existent if a linear preprocessor was used. Furthermore, we find that the choice of preprocessors can lead to different responses to noise, with distinct signatures that can be inferred from experimental multicellular data. This allows us to confirm that {\it Dictyostelium} cells use a logarithmic preprocessor, a claim that has been suggested based on independent single cell experiments \cite{Sgro2014}. We encountered several interesting behaviors in our model that have implications for other coupled oscillator systems. For example, we found that the nonlinearities in the preprocessor can lead to a mechanism for populations of oscillators to change their frequency. Furthermore we found that slowing the dynamics of the external medium leads to incoherent oscillations. This behavior has been termed `dynamic death' for coupled oscillators \cite{Schwab2012,Schwab2012a}, and we find that it occurs through a bistable state. Furthermore, in the spatial extension of our model, we observe a similar loss of spiral patterns due to slow dynamics of the medium. This suggests that the concept of dynamic death can be extended to spatially heterogeneous populations. Synchronization and formation of spiral waves provides a spatial cue for {\it Dictyostelium} cells, which guides them toward a common aggregation center. As a result, dynamic death can be undesirable for a population's survival. It is well known that in wildtype cells phosphodiesterases (PDE) are constantly secreted intra- and extracellularly to degrade cAMP. We suspect that this mechanism may have evolved to avoid incoherence due to dynamic death. Despite the descriptive and predictive success of our simple model \cite{Sgro2014} it misses several points that could be the subject of future works. For example, we have treated the preprocessor as a static module. However, a more complete model that describes adaptation needs to include the dynamics of this module. Models that contain a feedforward network \cite{Takeda2012, Wang2012, Xiong2010} seem to be good candidates for this purpose. Furthermore, we have ignored the effect of noise in our spatially extended model. It would be interesting to find how noise can affect the random formation of spiral patterns and their stability and explore to what extent a spatially extended model is amenable to the phase-diagrammatic approach proposed here. Finally, it would be interesting to study our model through analytical approaches such as Fokker-Planck equations \cite{Acebron2004,Lindner2004} and explore the possibility of new phases of behavior that have been neglected in our study. \section{Acknowledgement} We would like to thank Charles Fisher and Alex Lang for useful comments. PM and JN were supported by NIH Grants K25GM086909 (to P.M.). DJS were supported by NIH K25 GM098875-02 and NSF PHY-0957573. The authors were partially supported by NIH Grant K25 GM098875. This work was supported by NIH Grants P50 GM071508 and R01 GM098407, by NSF-DMR 0819860, by an NIH NRSA fellowship (AES), and by Searle Scholar Award 10-SSP-274 (TG).
{'timestamp': '2014-09-16T02:00:55', 'yymm': '1407', 'arxiv_id': '1407.8210', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8210'}
arxiv
\section{Introduction}\label{sec1} The use of nonsteroidal anti-inflammatory drugs\break (NSAIDs) is widespread in the treatment of various rheumatic conditions [\citet{nasonov2006}]. Gastrointestinal symptoms are the most common adverse events associated with the NSAID therapy [\citet{garcia2001}]. \citet{holodov2012} suggested oral administration of a procaine (novocaine) solution in low concentration (0.25 to 1\%) to reduce the risk of upper gastrointestinal ulcer bleeding associated with NSAIDs. To validate the effectiveness of the proposed therapy, an experiment was conducted to study the effect of novocaine on the resistance of the red blood cells (erythrocytes) to hemolysis by hydrochloric acid as well as efficacy of novocaine dosage. Hydrochloric acid is a major component of gastric juice and a lower rate of erythrocyte hemolysis should indicate a protective effect of novocaine. Hemolytic stability of erythrocytes for the control and for three different dosages of novocaine ($4.9\times10^{-6}$ mol/L, $1.0\times 10^{-5}$mol/L, and $2.01\times10^{-5}$mol/L) was measured as a percentage of hemolyzed cells. The data for the analysis were curves of hemolysis (erythrograms) that were measured as functions of time. Figure~\ref{example} illustrates a sample of percent hemolysis curves. The goal of the statistical analysis was to summarize the associated evidence across time of the novocaine effect including performing pairwise comparisons of novocaine dosages. \begin{figure} \includegraphics{723f01.eps} \caption{Twenty hemolysis curves (erythrograms) of mice erythrocytes by hydrochloric acid with superimposed estimated mean functions.} \label{example} \end{figure} Most current approaches essentially evaluate differences among groups of curves point-wise. These approaches treat data that are inherently functional (e.g., hemolysis is a smooth function of time) as a finite vector of observations over time. A typical point-wise approach is to perform a one-way analysis of variance (ANOVA) test at each time point. However, when testing is performed at a large number of points simultaneously, the type I error rate is going to be inflated. \citet {cox2008} carefully investigated this issue and proposed a method that utilizes a point-wise ANOVA approach, while properly controlling the type I error rate. Alternatively, function-valued methods can be employed. A key advantage of the functional approach over its close counterpart---the multivariate approach---is that the former retains information of the ordering and spacing of observations over time. By assuming that there is a true underlying functional response for each subject, function-valued methods explicitly incorporate information over time. Thus, a~method is ``functional'' if it approximates a finite vector of observations by a function (a nonparametric function is a typical choice) and then builds a test statistic based on these functional estimates. The functional analysis of variance (FANOVA) can be employed to perform testing among $k$ groups of curves. The overall functional testing methods, such as the functional $\mathcal{F}$ of \citet{shen2004} or the functional $V_n$ of \citet{cuevas2004}, can be utilized to test for associated evidence across the entire functional domain (across all time). \citet{vsevolozhskaya2013} developed a method for inferences in a FANOVA situation on subregions of the initial functional domain. However, none of these methods [including the point-wise method of \citet {cox2008}] allows for pairwise comparisons of functional means. Thus, the challenge for the current analysis was to determine differences among novocaine dosages within specific intervals of time, where significant differences among hemolysis curves are present [these time intervals can be identified based on the methods in \citet{vsevolozhskaya2013}]. In this paper, we introduce a new function-valued two-step procedure: first, to detect regions in time of significant differences among mean curves, and, second, to perform a pairwise comparison of treatment levels within those regions. The approach utilizes two ideas: (i) combining methods to map a test statistic of the individual hypotheses, $H_1, \ldots, H_m$, to the global one, $\bigcap_{i=1}^mH_i$, and (ii) the closure principle of \citet{marcus1976} to control the family-wise error rate (FWER), the probability of at least one false rejection. The rest of the article is organized in the following manner. We give an overview of the FANOVA problem and the existing methods for investigating the functional domain for regions where significant differences occur. We discuss the proposed procedure for investigating regions of time for significant differences and detail a computational shortcut that allows isolation of individual significance even for a large number of tests. We extend the proposed procedure to perform pairwise comparisons of the treatment levels within identified functional regions of statistical significance. The protective effect of novocaine is demonstrated based on the different patterns between groups detected in certain regions of time. \section{Methods}\label{sec2} Functional analysis of variance involves testing for some difference among $k$ functional means. In functional data analysis, $t$ is used to denote a real-valued variable (usually of time) and $y(t)$ denotes a continuous outcome, which is a function of $t$. Then, the FANOVA model is written as \begin{equation} \label{eq:1} y_{ij}(t)=\mu_{i}(t) + \varepsilon_{ij}(t), \end{equation} where $\mu_i(t)$ is the mean function of group $i$ at time $t$, $i=1,\ldots,k$, $j$ indexes a functional response within a group, $j=1,\ldots, n_i$, and $\varepsilon_{ij}(t)$ is the residual function. Each $\varepsilon_{ij}(t)$ is assumed to be a mean zero and independent Gaussian stochastic process. The FANOVA hypotheses are written as \begin{eqnarray*} &&H_0\dvtx \quad\mu_1(t)=\mu_2(t)=\cdots= \mu_k(t), \\ && H_a\dvtx\quad \mu_i(t) \neq\mu_{i'}(t)\qquad \mbox{for at least one $t$ and } i \neq i'. \end{eqnarray*} The alternative hypothesis considers any difference anywhere in $t$ among $k$ population means of $y_{ij}(t)$. In recent years two different general approaches have emerged to perform the FANOVA test. In \citet{shen2004}, as well as many other papers [see \citet{cuevas2004}, \citet{ramsay2009} and \citet {cuesta2010}], a global test statistic has been developed to perform the FANOVA test. The statistic is ``global'' because it is used to detect differences anywhere in the entire functional domain (anywhere in $t$). An alternative approach [\citet{ramsay2005} and \citet{cox2008}] is to use a point-wise (or individual) test statistic to perform inference across $t$, that is, identify specific regions of $t$ with significant difference among functional means. \subsection{``Global'' approach}\label{sec2.1} Suppose the domain $ [a, b ]$ of functional responses can be split into $m$ prespecified mutually exclusive and exhaustive intervals such that $ [ a, b ]=\bigcup_{i=1}^m [ a_i,b_i ]$. For instance, in the novocaine experiment the researchers were interested in the effect of novocaine during specific time intervals associated with hemolysis of different erythrocyte populations: hemolysis of the least stable population ($ [a_2,b_2 ] = 61\mbox{--}165$ sec), general population ($ [a_3,b_3 ] = 166\mbox{--}240$ sec), and most stable ($ [a_4,b_4 ] = {}$over 240 sec). For each interval $ [a_i, b_i ]$, $i=1, \ldots, m$, an individual functional statistic of \citet{shen2004}, $\mathcal{F}_i, i=1, \ldots, m$, can be calculated as \begin{equation} \label{eq:Fsf} \mathcal{F}_i = \frac{ \int_{ [a_i, b_i ]}\sum_{j=1}^k n_j(\hat{\mu}_j(t)-\hat{\mu}(t))^2\,dt/(k-1)}{ \int_{ [a_i, b_i ]}\sum_{j=1}^k\sum_{s=1}^n(y_{js}(t)-\hat{\mu}_j(t))^2\,dt/(n-k)}, \end{equation} where $n$ is the total number of functional responses and $k$ is the number of groups. The numerator of the $\mathcal{F}$ statistic accounts for ``external'' variability among functional responses and the denominator for the ``internal'' variability. \citet{cuevas2004} argue that the null hypothesis should be rejected based on the measure of the differences among groups, that is, the ``external'' variability. Hence, \citet{cuevas2004} proposed a statistic $V_n$ based on the numerator of $\mathcal{F}$: \begin{equation} \label{eq:Vn} V_n=\sum_{i<j}^k n_i\bigl\Vert \hat{\mu}_i(t)-\hat{\mu}_j(t) \bigr\Vert ^2, \end{equation} where $\Vert \cdot\Vert $ is the $L_2$ norm calculated over the $ [a_i, b_i ]$ interval. \citet{gower1999} also argue that in a permutation setting a test can be based just on the numerator of the test statistic. That is, if only the numerator of the functional $\mathcal {F}$ is used, the changes to the test statistic are monotonic across all permutations and, thus, probabilities obtained are identical to the ones obtained from the original $\mathcal{F}$. \citet{delicado2007} points out that for a balanced design, the numerator of the functional $\mathcal{F}$ and $V_n$ differ by only a multiplicative constant, reinforcing how they provide the same results in a permutation setting. \citet{vsevolozhskaya2013} fully extended this testing approach by allowing identification of the time interval, $ [a_i, b_i ]$, $i=1, \ldots, m$, within the time domain, $ [a, b ]$, while having proper control of at least one false rejection. \subsection{Point-wise approach}\label{sec2.2} Suppose that a set of smooth functional responses is evaluated on a dense grid of points, $t_1, \ldots, t_m$. For instance, the percentage of hemolyzed cells can be evaluated every second. \citet{cox2008} propose a test for differences in the mean curves from several populations, that is, perform functional analysis of variance, based on these discretized functional responses. First, at each of the $m$ evaluation points, the regular one-way analysis of variance test statistic, $F_i, i=1, \ldots, m$, is computed. For each test the $p$-value is calculated based on the parametric $F$-distribution and then the Westfall--Young randomization method [\citet{westfall1993}] is applied to correct the $p$-values for multiplicity. The implementation of the method can be found in the \texttt{multtest} [\citet{multtest}] R package [\citet{R}]. Certain criticisms may be raised for both the \textit{``global''} and the \textit{point-wise} approaches. First, the \textit{point-wise} approach can determine regions of the functional domain with a difference in the means, but there is no clear way to extend this approach to determine which pairs of populations are different. Second, for the \citet{cox2008} procedure, the $p$-value for the global test cannot be obtained, which is an undesirable property since the method might be incoherent between the global and point-wise inference. The \textit{global} approach does not provide the time-specific detail that the point-wise methods provide and the subregion inferences in \citet {vsevolozhskaya2013} require specification of the subregions which may be arbitrarily defined in some applications. We suggest a procedure that overcomes the majority of these issues. By using a combining function along with the closure principle of \citet{marcus1976}, we are able to obtain the $p$-value for the overall test as well as adjust the individual $p$-values for multiplicity. Additionally, the proposed procedure allows us to perform a pairwise comparison of the group's functional means and therefore determine which populations show evidence of differences in each time region. However, the proposed procedure still requires prespecification of these time regions, which in some applications can be vague. \subsection{Proposed methodology}\label{sec2.3} Once again, suppose the domain $ [a, b ]$ is split into $m$ prespecified mutually exclusive and exhaustive intervals. We propose to use the numerator of the functional $\mathcal{F}$ as the test statistic $T_i$, $i=1,\ldots, m$, for each $ [a_i,b_i ]$, and then utilize a combining function to obtain the test statistic for the entire $ [a,b ]$. Typical combining functions have the same general form: the global statistic is defined as a weighted sum, $T=\sum w_iT_i$, of the individual statistics with some $w_i$ weights [see \citet{pesarin1992} and \citet{basso2009}]. A $p$-value for the overall null hypothesis (that all individual null hypotheses are true) is based either on the distribution of the resulting global statistic $T$ or on a permutation approximation. If the unweighted sum combining function is applied to the proposed~$T_i$, then \begin{eqnarray*} T&=&\int_{ [a, b ]}\sum_{j=1}^k n_j\bigl(\hat{\mu}_j(t)-\hat{\mu }(t) \bigr)^2\,dt/(k-1) \\ &=&\sum_{i=1}^m\int _{ [a_i, b_i ]}\sum_{j=1}^k n_j\bigl(\hat{\mu }_j(t)-\hat{\mu}(t) \bigr)^2\,dt/(k-1)\\ &=&\sum_{i=1}^mT_i. \end{eqnarray*} The closure procedure is then applied to perform the overall test based on these combining functions as well as to adjust the individual $p$-values for multiplicity. The closure method is based on testing all nonempty intersections of the set of $m$ individual hypotheses, which together form a closure set. The procedure rejects a given hypothesis if all intersections of hypotheses that contain it as a component are rejected. \citet{hochberg1987} show that the closure procedure controls the family-wise error rate (FWER) at a strong level, meaning that the type I error is controlled under any partial configuration of true and false null hypotheses. When the number of individual tests $m$ is relatively large, the use of the closure method becomes computationally challenging. For example, setting $m=15$ results in $2^{15}-1=32\mbox{,}767$ intersections of hypotheses. \citet{hochberg1987} described a shortcut for the $T=\max\{ T_i\}$ combining function, where $T_i$ stands for the $i$th test statistic for $i$ in the set of $H_i$ pertinent to a particular intersection hypothesis. For this combining function they showed that the significance for any given hypothesis in the closure set can be determined using only $m$ individual tests. \citet{zaykin2002} described a shortcut for the closure principle in the application of their truncated $p$-value method (TPM) that uses an unweighted sum combining function. In the next section we exploit the shortcut described by \citet {zaykin2002} and show that for the $T=\sum T_i$ combining function the required number of evaluations is $m(m+1)/2$. \subsubsection{The shortcut version of the closure procedure}\label{sec2.3.1} The shortcut version of the closure method for the unweighted sum combining function should be implemented\vadjust{\goodbreak} as follows. First, order the individual test statistics from minimum to maximum as $T_{(1)} \leq T_{(2)} \leq\cdots\leq T_{(m)}$, where \begin{equation} \label{eq:Ti} T_i=\int_{ [a_i, b_i ]}\sum _{j=1}^k n_j\bigl(\hat{ \mu}_j(t)-\hat {\mu}(t)\bigr)^2\,dt/(k-1). \end{equation} Let $H_{(1)}, H_{(2)}, \ldots, H_{(m)}$ be the corresponding ordered individual hypotheses of no difference among functional means on the interval $ [a_{(i)}, b_{(i)} ]$, $i=1, \ldots, m$. Now, among intersection hypotheses of size two, \begin{eqnarray*} &T_{(1)}+T_{(2)}\leq T_{(1)}+T_{(3)}\leq \cdots\leq T_{(1)}+T_{(m)},& \\ &T_{(2)}+T_{(3)}\leq T_{(2)}+T_{(4)} \leq \cdots\leq T_{(2)}+T_{(m)},& \\ &\cdots& \end{eqnarray*} Here, the statistic $T_{(i)}+T_{(j)}$ corresponds to intersection hypotheses $H_{(ij)}$ of no significant difference on both intervals $ [a_{(i)}, b_{(i)} ] \cup [ a_{(j)}, b_{(j)} ]$. Among intersections of size three, \begin{eqnarray*} &T_{(1)}+T_{(2)}+T_{(3)} \leq T_{(1)}+T_{(2)}+T_{(4)} \leq\cdots\leq T_{(1)}+T_{(2)}+T_{(m)},& \\ &T_{(2)}+T_{(3)}+T_{(4)} \leq T_{(2)}+T_{(3)}+T_{(5)} \leq\cdots\leq T_{(2)}+T_{(3)}+T_{(m)},& \\ &\cdots& \end{eqnarray*} Thus, significance for the hypothesis $H_{(m)}$ can be determined by looking for the largest $p$-value among $m$ tests, \[ T_{(m)}, T_{(m)}+T_{(1)}, \ldots, \sum _{i=1}^mT_{(i)}. \] For the hypothesis $H_{(m-1)}$, the significance can be determined by investigating the $p$-values corresponding to $(m-1)$ tests \[ T_{(m-1)}, T_{(m-1)}+T_{(1)}, \ldots, \sum _{i=1}^{m-1}T_{(i)}, \] along with the $p$-value for the test $\sum_{i=1}^mT_{(i)}$ which is already found. Finally, for the first ordered hypothesis $H_{(1)}$, the significance can be determined by evaluating a single test $T_{(1)}$ and then looking for the largest $p$-value among it and the $p$-values of the hypotheses $H_{(12)}$, $H_{(123)}, \ldots, H_{(12\cdots m)}$, which are already evaluated. Thus, significance of any individual hypothesis $H_{(i)}$ is determined using $m$ $p$-values, but the number of unique evaluations to consider is $m+(m-1)+\cdots+1=m(m+1)/2$. The described shortcut assumes that all distributions corresponding to the test statistics are the same and the magnitude of the test statistic has a monotonic relationship with its $p$-value. If the $p$-values for the individual tests are determined from permutational distributions (as in our situation), a bias will be introduced. The bias is caused by a mismatch between the minimum value of the test statistics and the maximum $p$-value. That is, the minimum statistic is not guaranteed to correspond to the maximum $p$-value. The procedure becomes liberal since the individual $p$-values are not always adjusted adequately. To reduce and possibly eliminate the bias, we made the following adjustment to the shortcut. First, we adjusted the individual $p$-values according to the shortcut protocol described above and obtained a set of adjusted individual $p$-values, $p_1,p_2, \ldots, p_m$. Then, we ordered the individual test statistics based on the ordering of the unadjusted individual $p$-values. That is, we order the unadjusted $p$-values from maximum to minimum and get a corresponding ordering of the test statistics\vspace*{1pt} $T_{(1)}^*,T_{(2)}^* ,\ldots, T_{(m)}^*$. Now the inequality $T^*_{(1)} \leq T_{(2)}^* \leq\cdots\leq T_{(m)}^*$ will not necessarily hold. We applied the shortcut based on this new ordering and obtained another set of adjusted individual $p$-values, $p_1^*, p_2^*, \ldots, p_m^*$. Finally, the adjusted individual $p$-values were computed as $\max\{p_i, p_i^*\}, i=1, \ldots, m$. This correction to the shortcut increases the number of the required computations by a factor of two but still is of the order $m^2$ instead of $2^m$. A small simulation study was used to check whether this version of the correction provides results comparable to adjustments generated by the entire set of intersection hypotheses. For the four multiplicity adjustment schemes: (i) correction based on the ordered test statistics shortcut, (ii) correction based on the ordered unadjusted $p$-values shortcut, (iii)\vadjust{\goodbreak} correction based on $\max\{p_i, p_i^*\}$ [combination of both corrections (i) and (ii)], and (iv) the full closure method, we obtained $p$-values under the global null based on 1000 permutations, $m=5$, and conducted 1000 simulations, providing 5000 corrected $p$-values. First, we were interested in how many times the $p$-values adjusted by various shortcuts were ``underestimated'' (not corrected enough) relative to the full closure method. The $p$-values adjusted by a shortcut based on the ordered test statistics, $p_1, p_2, \ldots, p_m$, were underestimated 554 out of 5000 times. The $p$-values adjusted by a shortcut based on the ordered unadjusted $p$-values, $p^*_1, p^*_2, \ldots, p^*_m$, were underestimated 60 out of 5000 times. The $p$-values adjusted using both corrections, $\max\{ p_i,p^*_i \}$, $i=1,\ldots, m$, were underestimated 38 out of 5000 times. Second, we compared type I error rates under the $\max\{ p_i,p^*_i \}$ shortcut and the full closure method and found that they were \textit{exactly} the same. The above results allowed us to conclude that the multiplicity adjustment based on the $\max\{ p_i,p^*_i \}$ shortcut is adequate. \begin{figure} \includegraphics{723f02.eps} \caption{Example of the closure set for the pairwise comparison of four groups.} \label{fig:diag} \end{figure} \subsubsection{Proposed methodology for pairwise comparison of functional means} Above, we provided details on how to implement the proposed methodology to isolate regions of the functional domain with statistically significant differences and showed that with a computational shortcut the closed testing scheme is computable even for a large number of individual tests $m$. Now, we show how to further use the proposed methodology to find pairs of functional means that are different within the regions where statistical significance was identified. The procedure is implemented as follows: \begin{longlist}[(iii)] \item[(i)] Within an interval $ [ a_i, b_i ]$ with a statistically significant difference among functional means, set the $p$-value for the ``global'' null of no difference among functional means to the adjusted individual $p$-value corresponding to that interval. \item[(ii)] Compute the pairwise statistic as well as statistics for the intersection hypotheses as in (\ref{eq:Ti}). \item[(iii)] Find the $p$-values based on the permutation algorithm and adjust them using the closure principle. \end{longlist} Figure~\ref{fig:diag} illustrates the closure set for pairwise comparison of four populations. The $p$-value of the top node hypothesis, $H_{ABCD}$, of no significant difference among the four population means would be set equal to the adjusted $p$-value of the interval level individual hypothesis of interest $H_i$, $i=1, \ldots, m$. The bottom node individual hypotheses, $H_{AB}, \ldots, H_{CD}$, correspond to no significant pairwise difference between groups $AB$, $AC,\ldots,CD$ in this interval. Note that now the indexing of the hypotheses corresponds to \textit{population means} instead of \textit {intervals in the functional domain}. The closure principle is used to adjust the individual $p$-values. Certain issues may arise with a test of pairwise comparisons conducted by global randomization. \citet{petrondas1983} noted that for the overall equality hypothesis all permutations are assumed to be equally probable, that is, the exchangeability among all treatment groups is assumed. However, for the hypothesis of equality of a particular subset of treatments, the global permutation distribution cannot be used because differences in variability among the treatment groups can cause bias in the statistical tests. The results of the simulation study, presented in the next section, did not reveal any noticeable bias in the permutation test. In the case of the pairwise comparison, our method maintained good control of the type I error rate as well as had enough power to correctly identify groups of unequal treatments. The minimal bias observed might be due to a relatively small (three) number of treatments that we chose to consider in our simulation study. \citet {petrondas1983} and \citet{troendle2011} provide ways to perform permutation tests correctly in the case of the pairwise comparison. We leave implementation of these solutions for future research. \section{Simulations}\label{s:sim} Before proceeding to the description of our simulation study, we would like to note that all functional data methods, including the one proposed in this article, are affected by how well the estimated functions approximate data. A failure to adequately approximate data with smooth functions may result in a loss of statistical power. An ``adequate'' approximation is a subjective decision, however, below we outline some choices that are intended to aid fitting particular data at hand. \subsection{Estimation of functional responses}\label{s:est} Use of functional data methods requires a ``guess'' of a function, $\mu (t)$, underlying each response. Since this function is generally unknown, nonparametric methods are used to approximate it. Nonparametric methods represent a function as a linear combination of $K$ ``basis functions.'' A potential shortcoming of all testing procedures based on nonparametric methods is ambiguity in the choice of basis functions (e.g., splines, Fourier series, Legendre polynomials, etc.) and the number of basis functions, $K$. An incautious choice might lead to over- or under-fit and the resulting loss of statistical power. The current consensus regarding the choice of basis functions, supported, among others, by \citet{horvath2012}, \citet{storey2005}, \citet {ramsay2005}, is that a good choice should mimic the general features of the data. Specifically, the Fourier basis is recommended for periodic, or nearly periodic, data and the $B$-spline basis for nonperiodic locally smooth data. Since it is known that hemolytic responses have a smooth ``S'' shape, the $B$-spline basis was a natural choice in our application. \citet{rice2001} and \citet{griswold2008} investigated the impact of the number of basis functions, $K$, on the quality of fit to the data. More specifically, \citet{rice2001} showed that the result of a functional fit is rather insensitive to the specification of the number of basis functions for the $B$-spline basis. \citet{griswold2008} provided general recommendations for the number of basis functions with an arbitrary basis. They showed that if the data result from (i) an erratically changing stochastic process or (ii) a smoothly varying process with a small measurement error, the recommended number of basis terms required to fit the data is close to the number of observations per subject. We chose the number of basis functions to be close to the number of observations which coincides with the recommendations provided by \citet {griswold2008}. During the course of the novocaine experiment the percent of hemolysis was obtained by converting the spectrophotometric readings. These readings---the measurements of the spectral transmittance---were made with a spectrophotometer PE-5400 VI, which has a low measurement error of $\pm0.5\%$ (details of the registration certificate are at \url {http://www.promecolab.ru/images/stories/Spektr/5400b-5400UF.pdf}). Thus, we had an underlying process that is smooth with a small measurement error so a higher number of basis functions was an appropriate choice. \subsection{Simulations setup} Now, we describe a simulation study that we carried out in order to evaluate the performance of our approach. A nonparametric fit to the data was achieved by employing the $B$-spline basis functions with a ``knot'' at each observation over $t$. The number of basis functions, $K$, is equal to the number of knots plus two. The simulations scenarios were inspired by a Monte Carlo study in \citet{cuesta2010}. We considered \begin{longlist}[(M1)] \item[(M1)] $f_i(t)=30(1-t)t-3\beta|\sin(16\pi t)|I_{\{0.325<t<0.3575 \} }+\varepsilon_i(t)$, \item[(M2)] $f_i(t)=30(1-t)t-\beta|\sin(\pi t/4)|+\varepsilon_i(t)$, \end{longlist} where $t_1=0, \ldots, t_{101}=1$, $\beta\in\{0.000, 0.045, 0.091, 0.136, 0.182, 0.227, 0.273,\break 0.318, 0.364, 0.409, 0.455, 0.500\}$, and random errors $\varepsilon_i(t)$ are independently normally distributed with mean zero and variance 0.3. Case M1 (illustrated in Figure~\ref{fig:M1}) corresponds to a situation where a small set of observations was generated under $H_A$ to create a spike. In M2 (illustrated in Figure~\ref{fig:M2}), a large number of observations were generated under $H_A$ but the differences are less apparent [a deviation along the entire range of $t$ that gradually increases from $\min(t)$ to $\max(t)$]. The parameter $\beta$ controls the strength of the deviation from the global null. The reason for considering these two cases was to check the performance of our method for different ranges of false null hypotheses. \begin{figure} \includegraphics{723f03.eps} \caption{Plot of the data for one simulation replicate under the M1 case and 12 different values of $\beta$. The functions that have the mean value, $\mu_3(t)$, deviating from the overall mean ($\mu_1(t)=\mu_2(t)\equiv\mu(t)$) are highlighted in a color.} \label{fig:M1}\vspace*{-1pt} \end{figure} \begin{figure}[b]\vspace*{-1pt} \includegraphics{723f04.eps} \caption{Plot of the data for one simulation replicate under the M2 case and 12 different values of~$\beta$. The functions that have the mean value deviating from the overall mean are highlighted in a color.} \label{fig:M2} \end{figure} In each case (M1 and M2), we generated three samples of functional data with 5 observations from each group. The first two samples had the same mean ($\beta=0$) and the third sample's mean was deviating ($\beta\neq 0$). Once the functional data were generated for different values of $\beta\neq0$, we split the functional domain into different numbers of equal-length intervals ($m=5$ and $m=10$) and evaluated the power of rejecting the null hypotheses $H_0\dvtx \mu_1(t)=\mu_2(t)=\mu_3(t)$ at the 5\% level. We used 1000 simulations to obtain a set of power values for each combination of $\beta$ and $m$ values. We used a permutation test\vadjust{\goodbreak} to obtain the $p$-values. This was achieved by randomly permuting the original observations for each $t$ across groups 1000 times, and for each new grouping, refitting the functional means and recalculating the value of the test statistic. The $p$-value was found as the proportion of 1000 recalculated test statistics greater than the observed statistic. \subsection{Simulation results} Figure~\ref{fig:5spike} presents results of power evaluation for model M1 and five intervals ($m=5$). Under this model, a set of observations generated under $H_A$ fell into the second interval. That is, the functional mean of the third sample had a spike deviation from the functional mean of the first two samples over the second interval. The magnitude of the spike increased monotonically as a function of $\beta $. The plot shows that the proportion of rejections reveals a peak over the region of the true deviation, while being conservative over the locations with no deviations. Thus, we conclude that the proposed methodology provides satisfactory power over the region with true differences, while being conservative over the regions where the null hypothesis is true. \begin{figure} \includegraphics{723f05.eps} \caption{The probability of rejecting the null hypothesis $H_0\dvtx \mu _1(t)=\mu_2(t)=\mu_3(t)$ for $m=5$ intervals.} \label{fig:5spike} \end{figure} Once we identified the region of the functional domain with differences in means (i.e., the second interval), we used the extension of the proposed methodology to perform a pairwise comparison and determine which populations are different. Figure~\ref{fig:5spikepair} provides the results of power evaluation of the pairwise comparisons at the 5\% significance level. In the case of $H_{AB}$ (where the null $\mu_1=\mu _2$ is true), the simulation output tells us that the procedure is a bit conservative, maintaining the type I error rate right below the 5\% level for the higher values of $\beta$. In the case of $H_{AC}$ and $H_{BC}$ (where the null is false), it can be seen that the power of the pairwise comparison is satisfactory. \begin{figure} \includegraphics{723f06.eps} \caption{The probability of rejecting individual pairwise hypotheses $H_{AB}\dvtx \mu_1(t)=\mu_2(t)$, $H_{AC}\dvtx \mu_1(t)=\mu_3(t)$, and $H_{BC}\dvtx \mu _2(t)=\mu_3(t)$.} \label{fig:5spikepair} \end{figure} \begin{table}[b] \caption{Power of the pairwise comparison assuming common means $\mu_1$ and $\mu_2$ over the 1st interval} \label{t:5gradpair1} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccc@{}} \hline $\bolds{\beta}$ & $\bolds{H_{AB}\dvtx \mu_1=\mu_2}$ & $\bolds{H_{AC}\dvtx \mu_1=\mu_3}$ & \multicolumn{1}{c@{}}{$\bolds{H_{BC}\dvtx \mu _2=\mu_3}$} \\ \hline 0.318 & 0.027 & 0.021 & 0.026 \\ 0.364 & 0.029 & 0.024 & 0.028 \\ 0.409 & 0.031 & 0.034 & 0.038 \\ 0.455 & 0.036 & 0.041 & 0.047 \\ 0.500 & 0.036 & 0.049 & 0.054 \\ \hline \end{tabular*} \end{table} \begin{table}[b] \caption{Power of the pairwise comparison assuming common means $\mu_1$ and $\mu_2$ over the 2nd interval} \label{t:5gradpair2} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccc@{}} \hline $\bolds{\beta}$ & $\bolds{H_{AB}\dvtx \mu_1=\mu_2}$ & $\bolds{H_{AC}\dvtx \mu_1=\mu_3}$ & $\bolds{H_{BC}\dvtx \mu _2=\mu_3}$ \\ \hline 0.273 & 0.018 & 0.049 & 0.057 \\ 0.318 & 0.025 & 0.074 & 0.086 \\ 0.364 & 0.031 & 0.104 & 0.116 \\ 0.409 & 0.037 & 0.145 & 0.164 \\ 0.455 & 0.041 & 0.214 & 0.224 \\ 0.500 & 0.045 & 0.298 & 0.323 \\ \hline \end{tabular*} \end{table} The results for the M2 case, where the number of true effects is large and the magnitude of the effect gradually increases from $\min(t)$ to $\max(t)$, are provided in Tables~\ref{t:5gradpair1}--\ref{t:5gradpair5} and Figure~\ref{fig:5grad}. The plot shows that for a fixed value $\beta $, the proportion of rejections of the hypothesis $H_0\dvtx \mu_1(t)=\mu _2(t)=\mu_3(t)$ gradually increases with the magnitude of the effect. Across different values of $\beta$, power values are also increasing, attaining the value of 1 for the fifth interval and $\beta=0.5$. The results of the pairwise comparisons are provided in Tables~\ref{t:5gradpair1}--\ref{t:5gradpair5}. Power is the highest for the highest value of $\beta$ (0.5), but overall the method does a good job of picking out the differences between $\mu_1$ and $\mu_3$, and $\mu_2$ and $\mu_3$, while maintaining control of spurious rejections for $\mu _1$ and $\mu_2$. \begin{table}[t!] \caption{Power of the pairwise comparison assuming common means $\mu_1$ and $\mu_2$ over the 3rd interval} \label{t:5gradpair3} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccc@{}} \hline $\bolds{\beta}$ & $\bolds{H_{AB}\dvtx \mu_1=\mu_2}$ & $\bolds{H_{AC}\dvtx \mu_1=\mu_3}$ & $\bolds{H_{BC}\dvtx \mu _2=\mu_3}$ \\ \hline 0.182 & 0.015 & 0.038 & 0.040 \\ 0.227 & 0.021 & 0.077 & 0.084 \\ 0.273 & 0.027 & 0.160 & 0.155 \\ 0.318 & 0.037 & 0.289 & 0.275 \\ 0.364 & 0.041 & 0.437 & 0.434 \\ 0.409 & 0.048 & 0.610 & 0.600 \\ 0.455 & 0.048 & 0.731 & 0.735 \\ 0.500 & 0.049 & 0.839 & 0.835 \\ \hline \end{tabular*} \end{table} \begin{table}[t!] \caption{Power of the pairwise comparison assuming common means $\mu_1$ and $\mu_2$ over the 4th interval} \label{t:5gradpair4} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccc@{}} \hline $\bolds{\beta}$ & $\bolds{H_{AB}\dvtx \mu_1=\mu_2}$ & $\bolds{H_{AC}\dvtx \mu_1=\mu_3}$ & \multicolumn{1}{c@{}}{$\bolds{H_{BC}\dvtx \mu _2=\mu_3}$} \\ \hline 0.182 & 0.017 & 0.082 & 0.080 \\ 0.227 & 0.023 & 0.207 & 0.196 \\ 0.273& 0.030 & 0.375 & 0.365 \\ 0.318 & 0.036 & 0.618 & 0.611 \\ 0.364 & 0.039 & 0.817 & 0.807 \\ 0.409 & 0.041 & 0.920 & 0.915 \\ 0.455 & 0.041 & 0.971 & 0.971 \\ 0.500 & 0.041 & 0.993 & 0.993 \\ \hline \end{tabular*} \end{table} \begin{table}[t!] \caption{Power of the pairwise comparison assuming common means $\mu_1$ and $\mu_2$ over the 5th interval} \label{t:5gradpair5} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccc@{}} \hline $\bolds{\beta}$ & $\bolds{H_{AB}\dvtx \mu_1=\mu_2}$ & $\bolds{H_{AC}\dvtx \mu_1=\mu_3}$ & $\bolds{H_{BC}\dvtx \mu _2=\mu_3}$ \\ \hline 0.136 & 0.012 & 0.044 & 0.042 \\ 0.182 & 0.020 & 0.164 & 0.160 \\ 0.227 & 0.030 & 0.380 & 0.383 \\ 0.273 & 0.038 & 0.640 & 0.645 \\ 0.318 & 0.041 & 0.858 & 0.859 \\ 0.364 & 0.042 & 0.955 & 0.957 \\ 0.409 & 0.042 & 0.986 & 0.988 \\ 0.455 & 0.042 & 0.997 & 1.000 \\ 0.500 & 0.042 & 1.000 & 1.000 \\ \hline \end{tabular*} \vspace*{12pt} \end{table} Results based on $m=10$ intervals are similar to those based on $m=5$ intervals and can be found in the supplementary material [Vsevolozhskaya, Greenwood and Holodov (\citeyear{vsevolozhskaya2014})]. A careful consideration of these results, however, reveals that the procedure tends to lose power as the number of intervals increases but gains power as the number of curves per group increases.\looseness=-1 \begin{figure} \includegraphics{723f07.eps} \caption{The probability of rejecting the null hypothesis $H_0\dvtx \mu _1(t)=\mu_2(t)=\mu_3(t)$ in the case of the M2 model and 5 intervals.} \label{fig:5grad}\vspace*{-3pt} \end{figure} \section{Analysis of hemolysis curves} In this section we illustrate the proposed methodology by applying it to a study of the effect of novocaine conducted by \citet {holodov2012}. The motivation behind the study was to investigate pharmaceutical means of preventing the formation of stomach erosive and ulcerative lesions caused by a long-term use of nonsteroidal anti-inflammatory drugs (NSAIDs). Internal use of a novocaine solution was proposed as a preventative treatment for NSAID-dependent complications. During the course of the experiment, blood was drawn from male rats to obtain an erythrocyte suspension. Then, four different treatments were applied: control, low ($4.9\times10^{-6}$ mol/L), medium ($1.0 \times 10^{-5}$ mol/L), and high ($2.01\times10^{-5}$ mol/L) dosages of procaine. After treatment application, the erythrocyte suspension was incubated for 0, 15, 30, 60, 120 or 240 minutes. At the end of each incubation period, hemolysis was initiated by adding 0.1 M of hydrochloric acid to the erythrocyte suspension. The percent of hemolysis or the percent of red blood cells that had broken down was measured every 15 seconds for 12 minutes. The experiment was repeated 5 times for each dosage/incubation combination using different rats. Therefore, the data set consists of 120 separate runs with 49 discretized observations per run and involves four experimental conditions with six incubation times, replicated 5 times for each treatment/incubation combination. For more details see \citet{holodov2012}.\vadjust{\goodbreak} \begin{figure} \includegraphics{723f08.eps} \caption{Erythrogram means for the control group and the treatment groups for 15 (top graph) and~30 (bottom graph) minute incubation times.} \label{fig:means} \end{figure} We fit the data with smoothing cubic $B$-splines with 49 equally spaced knots at times $t_1=0,\ldots,t_{49}=720$ seconds to generate the functional data. The reasoning behind these choices is provided in Section~\ref{s:est}. A smoothing parameter was selected by generalized cross-validation (GCV) for each functional observation with an increased penalty for each effective degree of freedom in the GCV, as recommended in \citet{mgcv}. To keep the analysis as simple as possible, each incubation data set was analyzed for treatment effects separately. Our initial test was to check for a significant difference in mean erythrograms (mean hemolysis curves) anywhere in time among novocaine dosages. A Bonferroni correction was applied to these initial $p$-values to adjust for multiplicity at this level. The results indicated strong evidence of differences for the 15 and 30 minute incubation times ($p$-value$_{\mathrm{Bonf}}=0.006$ and $p$-value$_{\mathrm{Bonf}}=0.018$, resp.). Figure~\ref{fig:means} illustrates the results for these incubation times. For the rest of the incubation times, we found no evidence against the null hypothesis that the four erythrogram means coincided, so no further analysis was conducted. Next, we examined the 15 and 30 minute incubation results in more detail to asses the nature of the differences. For both incubation times, four time intervals of interest were prespecified: (i) the latent period (0--60 sec), (ii)~hemolysis of the population of the least stable red blood cells (61--165 sec), (iii) hemolysis of the general red blood cell population (166--240 sec), and (iv) the plateau (over 240 sec). The latent period is associated with erythrocytes spherulation and occurs between addition of the hemolytic agent and initiation of hemolysis. The names of the next two periods are self-explanatory. The plateau period is associated with deterioration of the population of the most stable erythrocytes. We applied our method to determine if statistical significance is present in each of the four time intervals. In the application of our method, we set the $p$-values for the global hypotheses $H_{1234}$ of no significant difference on all four intervals to the Bonferroni adjusted $p$-values obtained on the previous step. For the 15 minute incubation time, no statistical significance was found during the latent period ($p$-value${}=0.806$), and statistically significant results were found during hemolysis of the least stable red blood cell population ($p$-value${}=0.022$), general red blood cell population (marginal significance with the $p$-value${}=0.060$) and plateau ($p$-value${}=0.006$). The same results were obtained from the 30 minute incubation, that is, no statistical significance during the latent period ($p$-value${}=0.892$) and statistical significance for the rest of the time intervals with $p$-values of 0.018, 0.029 and 0.018 for the periods of hemolysis of the least stable population, general population and plateau, respectively. Finally, we were interested in pairwise comparison of treatment levels within the time intervals of statistical significance. Once again, similar results were found for both incubation times, although the $p$-values were often larger for the 15 minute incubation time. During the hemolysis of the least stable red blood cell population, at least some evidence was found of a difference between low dosage and control ($p$-value$_{15}=0.020$, $p$-value$_{30}=0.018$), medium dosage and control ($p$-value$_{15}=0.060$, $p$-value$_{30}=0.039$), and low dosage and high dosage ($p$-value$_{15}=0.057$, $p$-value$_{30}=0.030$). During the hemolysis of the general population, at least some evidence of a significant difference was found between the low dose and control ($p$-value$_{15}=0.060$, $p$-value$_{30}=0.029$). During the plateau interval, there was a significant difference between low dose and control ($p$-value$_{15}=0.001$, $p$-value$_{30}=0.018$), medium dose and control ($p$-value$_{15}=0.016$, $p$-value$_{30}=0.029$), and high dose and control ($p$-value$_{15}=0.030$, $p$-value$_{30}=0.029$). The results of the analysis can be summarized as follows. The rate of hemolysis increases with the dosage of novocaine. That is, the structural and functional modifications in the erythrocyte's membrane induced by novocaine are dosage dependent. The results also indicate the distribution of erythrocytes into subpopulations with low, medium and high resistance to hemolysis. These populations modified by novocaine react differently with the hemolytic agent. After 15 and 30 minutes of incubation, the ``old'' erythrocytes (least stable) modified by low ($4.9\times10^{-6}$ mol/L) and medium ($1.0 \times10^{-5}$ mol/L) doses of procaine react faster to the hemolytic agent than those under the control or the high ($2.01\times10^{-5}$ mol/L) dose. However, reaction of the general and ``young'' (most stable) erythrocyte population modified by the same (low and medium) dosages is characterized by higher stability of the membrane and thus have higher resistance to the hemolytic agent. Thus, novocaine in low and medium doses has a protective effect on the general and ``young'' erythrocyte populations. However, an increase in procaine dosage does not lead to an increase of erythrocyte resistance to the hemolytic agent. The effect of the high dose of novocaine ($2.01\times10^{-5}$ mol/L) does not differ significantly from the control and thus is destructive rather than protective. Conclusions of our statistical analysis confirm certain findings reported in a patent by \citet{holodov2012}. Specifically, our analysis confirms that novocaine in low dosages tends to have a protective effect. However, \citet{holodov2012} reported a significant difference among erythrograms for all incubation times but zero minutes. This inconsistency is due to a failure to properly adjust the number of tests performed in the original analysis. The findings reported in the current paper have a higher assurance that a replication experiment will be able to detect the same differences reported here. \section{Discussion} We have suggested a procedure which allows researchers to find regions of significant difference in the domain of functional responses as well as to determine which populations are different over these regions. To the best of our knowledge, there are no existing competing procedures to the proposed methodology. Thus, our numerical results reported in Section~\ref{s:sim} do not include a comparison of the proposed method to other alternatives. Nevertheless, the simulations revealed that our procedure has satisfactory power and does a good job of picking out the differences between population means. Also, in our simulation study, a relatively small number of regions ($m=5$ and $m=10$) were considered. A higher number of individual tests (intervals) can be easily implemented with the described shortcut to the closure principle. The relative efficiency of all nonparametric functional approaches depends on the ``adequate'' representation of data by smooth functions. In Section~\ref{s:est} we provided some general recommendations that should help a reader to choose an effective basis and a number of basis functions for a particular application. A valid point raised by one of the reviewers was that if power of any function-valued statistical procedure depends on the accuracy of the estimates of individual curves, they, in turn, might depend on the number of observed time points per subject. \citet{griswold2008} studied this issue and showed that as the number of measurements per subject increased from 10 to 20, the power of a functional approach remained relatively constant or improved.\vadjust{\goodbreak} \citet{berk2011} used as little as 10 observations per subject to estimate the functional responses. Thus, we expect statistical power to be rather insensitive to the number of time points at hand as long as researchers have at least 10 observations and are producing reasonable functional estimates. Another important issue is that the nonparametric approaches based on the $B$-spline basis might suffer from a phenomenon termed ``edge effect''---a bias in the estimation at the endpoints. Thus, power of the procedure to detect differences among functional responses might be affected at the intervals near the edges if the estimated smooth functions have boundary artifacts (e.g., unexpected behavior). This was not the case in our simulation study nor in our application. If a researcher encounters functional boundary artifacts while fitting particular data of interest, s/he might consider correcting for this effect [e.g., see \citet{masri2004}]. We also note that for the procedure presented in this article, the regions of interest in the functional domain should be prespecified prior to the analysis. However, in our experience researchers have never had a problem with {a priori} region identification. From previous research, expected results as well as specific regions of interest are typically known. We also mention that in the application of our method the intervals should be mutually exclusive and exhaustive. If researchers are interested in a test over overlapping intervals, the solution is to split the functional domain into smaller mutually exclusive intervals for individual tests (terminal nodes of the hypotheses tree). The decision for the overlapping region would be provided by a test of an intersection hypothesis (``higher'' node in the hypotheses tree). We also expect the intervals to be exhaustive since it would be unexpected for researchers to collect data over time periods that they have no interest in. Finally, if for some reason distinct regions cannot be prespecified, a large number of equal sized intervals can easily be employed, however, this might result in loss of power. The present work has two open issues that suggest a direction for future research. First, the method is conservative and so a more powerful approach may be possible. Second, the permutation strategy for the pairwise comparison test may lead to biased inference. Solutions to the latter problem were suggested both by \citet{petrondas1983} and \citet {troendle2011}. We leave implementation of these solutions for future research, as this seems to be a minor issue with a small number of treatment groups as are most often encountered in FANOVA applications. \begin{supplement}[id=suppA] \stitle{Additional simulation results} \slink[doi]{10.1214/14-AOAS723SUPP} \sdatatype{.pdf} \sfilename{aoas723\_supp.pdf} \sdescription{Additional simulation results for the two models (M1 or M2), two different number of intervals ($m=5$ or $m=10$), and either 5 or 20 subjects per group are summarized in the tables below. Overall, these results indicate that the procedure tends to lose power as the number of intervals increases but gains power as the number of subjects per group increases.} \end{supplement}
{'timestamp': '2014-08-01T02:09:10', 'yymm': '1407', 'arxiv_id': '1407.8388', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8388'}
arxiv
\section{Introduction} Imagine an election where the voters are the candidates and each voter is allowed to vote for as many of the other candidates as she wishes. Now suppose each voter cares only about winning. The goal of the mechanism is to elect the candidate with the maximum support. To achieve this, we desire that the election mechanism be strategy-proof. Thus, we want an {\em impartial mechanism}, where voting truthfully cannot affect an agent's own chances of election. This problem, called the {\em impartial selection problem}, was introduced independently by Holzman and Moulin~\cite{HM13} and Alon et al.~\cite{AFP11}. In addition to elections, they were motivated by nomination mechanisms for prestigious prizes and committees, hyperlink formations, and reputation systems in social networks. Fisher and Klimm \cite{FK14} also proposed the use of such mechanisms for peer review evaluation processes. The impartial selection problem can be formalized via a directed graph $G=(V,A)$. There is a vertex $v\in V$ for each voter (candidate) $v$, and there is an arc $(u, v)\in A$ if $u$ votes for $v$. The aim is to maximize the in-degree of the selected vertex, and we say that an impartial mechanism is $\alpha$-optimal, for $\alpha\le 1$, if the in-degree of the vertex it selects is always at least $\alpha$ times the in-degree of the most popular vertex. Unfortunately, Moulin~\cite{HM13} and Alon et al.~\cite{AFP11} observed that a {\em deterministic} impartial mechanisms must have an arbitrarily poor approximation guarantee $\alpha$. Specifically, a deterministic mechanism may have to select a vertex with zero in-degree even when other vertices receive votes; it may even be forced to select a vertex with in-degree one whilst another vertex receives $n-1$ votes! This negative result motivated Alon et al.~\cite{AFP11} to study {\em randomized} impartial mechanisms. In particular, they examined a simple mechanism dubbed the {\em 2-partition mechanism}. This mechanism independently assigns each vertex to one of two groups $\{V_1, V_2\}$. Then, only the arcs from vertices in $V_1$ to vertices in $V_2$ are counted as votes. The vertex with the maximum number of {\em counted} votes in $V_2$ is selected (breaking ties arbitrarily). It is straight-forward to verify that this mechanism is impartial and is $\frac14$-optimal. They further conjectured the existence of an $\frac12$-optimal impartial randomized mechanism. This conjecture was recently proven by Fisher and Klimm \cite{FK14}. Specifically, they proved that the {\em permutation mechanism} is impartial and $\frac12$-optimal. This election mechanism examines the vertices in a random order, and can only count the votes of a vertex that go to vertices behind it in the ordering. (See Section \ref{sec:rand} for a detailed description of the mechanism and a short proof of Fisher and Klimm's result.) Interestingly, the factor $\frac12$-approximation guarantee is tight. Consider an $n$-vertex graph containing only a single arc $(u,v)$. Then, unless $u$ is before $v$ in the random permutation the mechanism will select a vertex with in-degree zero. Thus the expected in-degree of the victor is at most one half. Observe that this tight example is rather unsatisfactory. It is extremely unnatural and relies on the fact that every vertex bar one abstains from voting. Indeed, Fisher and Klimm \cite{FK14} showed that without abstentions the permutation mechanism is at least $\frac{7}{12}$-optimal. They leave open the possibility that the permutation mechanism actually proffers a better approximation guarantee than $\frac{7}{12}$. They do prove, however, that without abstentions the permutation mechanism can be no better than $\frac{2}{3}$-optimal. Moreover, Fisher and Klimm \cite{FK14} provide an even stronger inapproximation bound: {\bf no} impartial mechanism can be better than $\frac{3}{4}$-optimal, even without abstentions. This appears to severely limit the potential for progress. But, again, the lower bounds are somewhat unsatisfactory. The issue now is not low out-degrees (that is, abstentions) but rather low in-degrees. The lower bounds are all based on instances with extremely small maximum in-degree $\Delta^-$. Specifically, the factor $\frac12$ optimal example~\cite{AFP11} for the permutation mechanism with abstentions has $\Delta^-=1$; the factor $\frac{2}{3}$ optimal example \cite{FK14} for the permutation mechanism without abstentions has $\Delta^-=3$; the factor $\frac{3}{4}$ optimal example \cite{FK14} for any randomized mechanism without abstentions has $\Delta^-=2$. Of course, in applications with a large number $n$ of voters, we would anticipate that the most popular agent receives a moderate number of votes. Do these inapproximability bounds still apply for these more realistic settings? Interestingly, the answer is no, even for cases where the most popular agent receives only a (large enough) constant number of votes. Specifically, we first prove that the the permutation mechanism is nearly $\frac34$-optimal in such instances. \begin{theorem}\label{thm:permutation} For any $\epsilon>0$, there is a constant $N_{\epsilon}$ such that if $\Delta^- \ge N_{\epsilon}$ then the permutation mechanism is $(\frac34-\epsilon)$-optimal. \end{theorem} This result is tight. We show that the permutation mechanism cannot produce a guarantee better than $\frac34$ regardless of the magnitude of $\Delta^-$. This result suggests that it may be possible to find a mechanism that beats the $\frac{3}{4}$-inapproximability bound of \cite{FK14}, even for constant maximum in-degree. This is indeed the case and spectacularly so. There is an impartial mechanism, which we call the {\em slicing mechanism}, that produces a near optimal approximation guarantee. \begin{theorem}\label{thm:slice} For any $\epsilon>0$, there is a constant $M_{\epsilon}$ such that if $\Delta^- \ge M_{\epsilon}$ then the slicing mechanism is $(1-\epsilon)$-optimal. \end{theorem} The slicing mechanism differs from previous mechanisms in that it adds an initial sampling phase. In this first phase, it samples a small fraction of the vertices. It then uses the votes of these vertices to build a non-random ordering of the other vertices. This specific ordering is exploited in the second phase to elect a vertex with very high expected in-degree. These results, as in previous works \cite{AFP11,FK14,HM13}, relate to single-winner elections. Some of the motivating applications, however, involve multiple-winner elections. We remark that our main result can be generalized to multiple-winner elections via small modifications to the mechanism. \section{The Model}\label{sec:model} We begin by formalizing the impartial selection problem and introducing some necessary notation. An election is represented via a directed graph $G=(V, A)$. The number of vertices of $G$ is denoted by $n$, and each vertex represents an agent (voter/candidate). An agent can make multiple votes, but cannot vote for herself nor vote more than once for any other agent. Thus, the graph $G$ is loopless and contains no multiple arcs. A vertex $u$ is an \emph{in-neighbor of $v$} if there is an arc $uv\in A$. In this case, we say that $u$ votes for $v$. Given a subset $Y \subseteq V$ and $v \in V$, the \emph{in-degree of $v$ in $Y$}, denoted by $d^-_Y(v)$, is the number of in-neighbors of $v$ in $Y$. For simplicity, we denote $d^-_V(v)$, the \emph{in-degree of $v$}, by $d^-(v)$. The maximum in-degree of any vertex in $G$ is denoted in by $\Delta^-(G)$, or simply by $\Delta$ when there is no ambiguity. A mechanism is \emph{impartial} if, for every vertex $v$, the probability of selecting $v$ is not modified when the out-neighborhood of $v$ is modified. That is, if $v$ changes its votes then this does not affect the probability of $v$ being elected. More formally, take any pair of graphs $G$ and $G'$ on the same vertex set $V$. Let $v$ be a vertex. Then we require that the probability that $v$ is elected in $G$ is equal to the probability that $v$ is elected in $G'$, whenever $N^+_G(u)=N^+_{G'}(u)$ for every $u \neq v$. Given $1\ge \alpha \ge 0$, an impartial mechanism is \emph{$\alpha$-optimal} if for any graph $G$, the expected degree of the winner differs from the maximum degree by a factor of at most $\alpha$, that is, \[ \frac{\sum_{v \in V} d^-(v) \cdot \brm{Pr}(v\textrm{ is the winner})}{\Delta} \geq \alpha\] Finally, given an integer $k$, the set $\{1,2,\ldots,k\}$ is denoted by $[k]$. \section{The Permutation Mechanism}\label{sec:rand} In this section, we analyze the permutation mechanism of Fisher and Klimm \cite{FK14}. This election mechanism examines the vertices in a random order $\{\pi_1, \pi_2,\dots, \pi_n\}$. At time $t$, the mechanism selects a {\em provisional leader} $y_t$ from the amongst the set $\Pi_t=\{\pi_1,\dots \pi_t\}$. At time $t+1$ the mechanism then examines $\pi_{t+1}$. If $\pi_{t+1}$ receives at least as many votes as $y_t$ from $\Pi_t\setminus y_t$ then $\pi_{t+1}$ is declared the provisional leader $y_{t+1}$. Otherwise $y_{t+1}:=y_t$. The winner of the election is $y_n$. A formal description of the permutation mechanism is given in Procedure \ref{alg:perm-mech}. \begin{algorithm} \caption{The Permutation Mechanism} \label{alg:perm-mech} \begin{algorithmic}[PERF] \STATE {\bf Input:} A directed graph $G=(V,A)$. \STATE Let $\pi$ be a random permutation of $V=[n]$. \STATE $y_1\gets \pi_1$; \FOR{$i=1$ to $n-1$} \IF{$d^-_{\Pi_i\setminus \{y_i\}}(\pi_{i+1}) \ge d^-_{\Pi_i\setminus \{y_i\}}(y_{i})$} \STATE $y_{i+1} \gets \pi_{i+1}$ \ELSE \STATE $y_{i+1} \gets y_{i}$ \ENDIF \ENDFOR \STATE {\bf output} $y_n$ \end{algorithmic} \end{algorithm} Observe that the permutation mechanism is impartial because it has the following property: the votes of a vertex are only considered after it has been eliminated. Specifically, the votes of $\pi_t$ are considered at time $\tau > t$ only if $\pi_t$ is not the provisional leader at time $\tau-1$. But, if $\pi_t$ is not the provisional leader at time $\tau >t$ then it cannot be elected. This ensures that eliminated agents have no interest to lie, \emph{i.e.} the mechanism is impartial. Fisher and Klimm \cite{FK14} proved this mechanism is $\frac12$-optimal using an intricate analysis based upon viewing the permutation mechanism as a generalization of the $2$-partition mechanism. First, we present a simpler proof of their result. \begin{theorem}\cite{FK14}\label{thm:rand-half} The permutation mechanism is $\frac12$-optimal. \end{theorem} \begin{proof} Let $v$ be a vertex with maximum in-degree $\Delta$. Now suppose exactly $j$ of its neighbors appear before $v$ in the random ordering $\pi$. In this case, at the time $v$ is considered it has received at least $j-1$ valid votes (one of the $j$ votes may not be counted if it comes from the provisional leader). Suppose $v$ is now declared the provisional leader. Then all $j$ of these votes become valid. (Indeed, if one of the in-neighbors of $v$ was the provisional leader, this is no longer the case.) On the other-hand, suppose $v$ is now declared a loser. Then, because ties are broken in favor of newly examined vertices, the provisional leader must already be receiving at least $j$ valid votes. Thus in either case, the final winner $y_n$ must also receive at least $j$ valid votes (the in-degree of the provisional leader is non-decreasing). Now with probability $\frac{1}{\Delta+1}$, exactly $j$ of its neighbors appear before $v$, for any $0\le j\le \Delta$. Thus, in expectation, the winner receives at least $\frac{1}{\Delta+1}\cdot \sum_{j=0}^{\Delta} j = \frac12 \Delta$ votes. \qed \end{proof} As discussed in the introduction, the factor $\frac12$-approximation guarantee in Theorem \ref{thm:rand-half} is tight. This tightness is slightly misleading, though. Recall that the tight example was a graph with just a single arc. In general the permutation mechanism is $\frac34$-optimal. Specifically, \restatethm{\ref{thm:permutation}}{For any $\epsilon>0$, there is a constant $N_{\epsilon}$ such that if $\Delta^- \ge N_{\epsilon}$ then the permutation mechanism is $(\frac34-\epsilon)$-optimal.} The $\frac34$ bound in Theorem \ref{thm:permutation} is tight in a very strong sense. There are tight examples for any choice of $\Delta$, no matter how large; see Theorem \ref{thm:tight}. The proof of Theorem \ref{thm:permutation} has two basic components. The first is the basic observation, used above in the proof of Theorem \ref{thm:rand-half}, that the mechanism will perform well if the vertex $v$ of highest in-degree has many neighbors before it in the random permutation. The second is the observation that if the mechanism does well when $v$ does not participate then it will do at least as well when $v$ does participate. In order to be able to apply these two observations simultaneously, however, we must show random permutations are "well-behaved". Specifically, we say that a permutation $\pi$ of $[n]$ is \emph{$(\Delta,\epsilon)$-balanced} if, for every $0 \leq k \leq n$, $$|[\Delta] \cap \Pi_{k}| \geq \left( \frac k n -\epsilon \right)\cdot \Delta$$ and we want to show that a random permutation is typically balanced. To do this, we need the following result, which provides a large deviation bound for the size of intersection of two sets of fixed cardinalities. \begin{lemma}\label{lem:prob} For every $\epsilon_1>0$, there exists $N_1$ such that for all positive integers $N_1<\Delta \leq n$ and $k \leq n$ the following holds. If $X \subseteq [n]$ are chosen uniformly at random subject to $|X|=\Delta$, then \begin{equation}\label{eq:prob1} \brm{Pr}\left[\left||X \cap [k]| - \frac{k\Delta}{n}\right| \geq \epsilon_1\cdot \Delta \right] <\epsilon_1 \end{equation} \end{lemma} \begin{proof} See Appendix. \qed \end{proof} \begin{lemma}\label{lem:balanced} For every $0<\epsilon_2<1$, there exists $N_2$ such that, for all $n \geq \Delta > N_2$, at least $(1-\epsilon_2)\cdot n!$ permutations of $[n]$ are $(\Delta,\epsilon_2)$-balanced. \end{lemma} \begin{proof} Let $N_1$ be chosen to satisfy Lemma~\ref{lem:prob} with $\epsilon_1 :=\frac{\epsilon^2_2}{4}$. We choose $N_2 \geq \max(N_1,\frac{12}{\epsilon_2})$. Let $k_1,k_2,\ldots,k_l \in [n]$ be a collection of integers such that for every $k \in [n]$ there exists $i \in [l]$ satisfying $0 \leq k-k_i \leq \epsilon_2\cdot \frac{n}{3}$. Clearly such a collection can be chosen with $l \leq \frac{n}{\lfloor \epsilon_2\cdot n/3 \rfloor} \leq \frac{4}{\epsilon_2}$, where the last inequality holds as $n \geq \frac{12}{\epsilon_2}$. Let $\pi$ be a permutation of $[n]$ chosen uniformly at random. By Lemma~\ref{lem:prob} and the choice of $N_2$ we have \begin{equation}\label{eq:balanced1} \brm{Pr}\left[|[\Delta] \cap \Pi_{k_i}|\leq \left( \frac{k_i}{n} - \epsilon_1\right)\cdot \Delta \right] < \epsilon_1 \end{equation} for every $1 \leq i \leq l$. We claim that if $|[\Delta] \cap \Pi_{k_i}| \geq \left( \frac{k_i}{n} - \epsilon_1\right)\cdot \Delta$ for every $0 \leq i \leq l$ then $|[\Delta] \cap \Pi_{k}| \geq \left( \frac k n -\epsilon_2 \right)\cdot \Delta$ for every $0\leq k \leq n$. Indeed, given $k$ let $i \in [l]$ satisfy $0 \leq k-k_i \leq \epsilon_2\cdot \frac{n}{3}$. Then \begin{eqnarray*} |[\Delta] \cap \Pi_k| &\geq& |[\Delta] \cap \Pi_{k_i}| \\ &\geq& \left( \frac{k_i}{n} - \epsilon_1\right)\cdot \Delta \\ &\geq& \left( \frac{k}{n} -\frac{\epsilon_2}{3} - \epsilon_1 \right)\cdot \Delta \\ &=& \left( \frac{k}{n} -\frac{\epsilon_2}{3} - \frac{\epsilon_2^2}{4} \right)\cdot \Delta \\ &\geq& \left( \frac k n -\epsilon_2 \right)\cdot \Delta \end{eqnarray*} as claimed. By the union bound applied to (\ref{eq:balanced1}) we have \begin{eqnarray}\label{eq:balanced2} \brm{Pr}\left[\forall i: i\le l \: :\: |[\Delta] \cap \Pi_{k_i}| \ge \left( \frac{k_i}{n} - \epsilon_1\right)\cdot \Delta \right] & \ge & 1- l\cdot \epsilon_1\notag\\ &\geq& 1 - \frac{4}{\epsilon_2}\cdot \frac{\epsilon_2^2}{4} \notag \\ &=& 1-\epsilon_2 \end{eqnarray} The lemma immediately follows from (\ref{eq:balanced2}) and the claim above.~\qed \end{proof} We are now ready to prove Theorem~\ref{thm:permutation}. \vskip 5pt \noindent \emph{Proof of Theorem~\ref{thm:permutation}.} Let $N_2$ be chosen to satisfy Lemma~\ref{lem:balanced} with $\epsilon_2:=\frac{\epsilon}{3}.$ We show that $N_{\epsilon}:=\max(N_2,\lceil \frac{6}{\epsilon_2} \rceil)$ satisfies the theorem. Let $v$ be a vertex of $G$ with in-degree $\Delta:=\Delta^{-}(G)$. We assume that $V(G)=[n]$, where $v$ is vertex $n$, and $[\Delta]$ is the set of neighbors of $v$. For a permutation $\pi$, let $d(\pi)$ denote the in-degree of the winner determined by the mechanism. Let $\pi'$ be a fixed $(\Delta,\epsilon_2)$-balanced permutation of $[n-1]$. We claim that \begin{equation}\label{eq:main} \brm{E}[ d(\pi) \:|\: \pi|_{[n-1]}=\pi'] \ \ \geq \ \ \left(\frac 34 - \epsilon/2 \right)\cdot \Delta \end{equation} Note that the theorem follows from (\ref{eq:main}), as the probability that $\pi|_{[n-1]}$ is not $(\Delta,\epsilon_2)$-balanced is at most $\epsilon_2$ by the choice of $N_{\epsilon}$, and thus \begin{equation*} \brm{E}[d(\pi)] \ \ \geq\ \ (1- \epsilon_2) \cdot \left(\frac 34 - \epsilon/2 \right)\cdot\Delta \ \ \geq\ \ \left( \frac 34 - \epsilon \right)\cdot \Delta \end{equation*} It remains to prove (\ref{eq:main}). Let $w$ be the winner when the permutation mechanism is applied to $G \setminus v$ and $\pi'$, and let $x$ be the number of votes $w$ receives from its left (\emph{i.e.} from vertices before it in the permutation). Let $\pi$ be a permutation of $[n]$ such that $\pi|_{[n-1]}=\pi'$. It is not hard to check that if at least $x+1$ neighbors of $v$ precede $v$ in $\pi$ then $v$ wins the election. Moreover, whilst the addition of vertex $v$ can change the winner (and, indeed, produce a less popular winner), it cannot decrease the ``left'' degree of any vertex. Thus, the (new) winner has still in-degree at least $x$ after the addition of $v$. So, as $\pi'$ is $(\Delta,\epsilon_2)$-balanced, we have $|[\Delta] \cap \Pi_{cn}| \geq c\Delta -\epsilon_2\Delta \geq x+1,$ whenever $c \geq \frac{x+1}{\Delta}+\epsilon_2.$ Furthermore, $\brm{Pr}[\pi(x)>cn] \geq 1-c$. Thus the probability that $v$ wins the election is at least $1-(x+1)/\Delta-\epsilon_2$. It follows that \begin{eqnarray*} \brm{E}[ d(\pi) \:|\: \pi|_{[n-1]}=\pi'] &\geq& \left(\frac{x+1}{\Delta}+\epsilon_2\right)\cdot x+\left(1-\frac{x+1}{\Delta}-\epsilon_2 \right)\cdot\Delta \\ &\geq& \frac{\Delta^2 -(x+1)\Delta+(x+1)x}{\Delta}-\epsilon_2\Delta \\ &\geq& \left(\frac 3 4 - \epsilon_2 -\frac{1}{\Delta} \right)\cdot\Delta+ \frac{(x-\Delta/2)^2}{\Delta} \\ &\geq& \left(\frac 34 - \frac{\epsilon}{2} \right)\cdot\Delta \end{eqnarray*} \vspace{-1cm}\qed \vskip 15pt The $\frac34$ bound provided in Theorem~\ref{thm:permutation} is tight for any $\Delta$. \begin{theorem}\label{thm:tight} For every $0<\epsilon<1/4$ and every $N>0$, there exists a directed graph $G$ such that $\Delta^-(G) \geq N$ and the expected degree of the winner selected by the permutation mechanism is at most $(\frac 3 4 + \epsilon)\Delta^-(G)$. \end{theorem} \begin{proof} Without loss of generality we assume that $N \geq 1/\epsilon$. Let $G'$ be a directed graph such that $n:=|V(G')| \geq (N+1)(N^2+N+1)\cdot \log \frac{1}{\epsilon}$, and $d^-(v)=d^{+}(v)=N$ for every $v \in V(G')$. Let $G$ be obtained from $G'$ by adding a new vertex $v_0$ and $2N-1$ directed edges from arbitrary vertices in $V(G')$ to $v_0$. Thus $\Delta:=\Delta-(G)=d^-(v_0)=2N-1$. Now, in $G'$ one can greedily construct a set $Z$ of at least $n/(N^2+N+1)$ vertices, such that no two vertices of $Z$ have common in-neighbors and no two vertices of $Z$ are joined by an edge. After a vertex $z\in Z$ is chosen, simply remove $z$, the in-neighbors and out-neighbors of $z$, and the out-neighbors of $z$'s in-neighbors (the inequality is satisfied since the in-neighbors have a common out-neighbor). Then recurse. Let $\pi$ be a permutation of $V(G)$ chosen uniformly at random. Let $X_v$ denote the event that a vertex $v \in V(G' )$ is preceded by all of its neighbors in $\pi$. Clearly $\brm{Pr}[X_v]=\frac{1}{N+1}$ for every $v \in V(G')$, and moreover, by construction of $Z$, the events $\{X_v\}_{v \in Z}$ are mutually independent. Hence \begin{eqnarray*} \brm{Pr}[\cup_{v \in V(G')}X_v] &\geq& 1 - \left(1 - \frac{1}{N+1} \right)^{\frac{n}{N^2+N}} \\ &\geq& 1-\left(1 - \frac{1}{N+1} \right)^{(N+1)\cdot \log \frac{1}{\epsilon}} \\ &\geq& 1 -\epsilon. \end{eqnarray*} Note that if the event $\cup_{v \in V(G')}X_v$ occurs then one of the vertices of $G'$ receives $N$ votes in the permutation mechanism. By symmetry the probability that $v_0$ is preceded by at most $N-1$ of its neighbors in $\pi$ is equal to $1/2$. Thus $v_0$ is not selected as a winner with probability at least $1/2-\epsilon$. We deduce that the expected in-degree of the winner is at most \begin{eqnarray*} \left(\frac 12 -\epsilon\right)\cdot \frac{\Delta+1}{2} + \left(\frac 12 +\epsilon \right)\cdot \Delta &= &\left( \frac 3 4 + \epsilon \right)\cdot \Delta - \epsilon N + \frac{1}{4} \\ &\leq& \left( \frac 3 4 + \epsilon \right)\cdot \Delta .\hspace{60pt}\qed \end{eqnarray*} \end{proof} \section{The Slicing Mechanism} In this section, we present the {\em slicing mechanism} and prove that it outputs a vertex whose expected in-degree is near optimal. \restatethm{\ref{thm:slice}}{For any $\epsilon>0$, there is a constant $M_{\epsilon}$ such that if $\Delta^- \ge M_{\epsilon}$ then the slicing mechanism is $(1-\epsilon)$-optimal.} The constant $M_{\epsilon}$ is independent of the number of vertices and is a a polynomial function of $\frac{1}{\epsilon}$. We remark that we have made no attempt to optimize this constant. The {\em slicing mechanism} is formalized in Procedure \ref{alg:slice-mech}. \begin{algorithm}[t] \caption{The Slicing Mechanism} \label{alg:slice-mech} \begin{algorithmic}[PERF] \STATE \ \STATE {\bf SAMPLING PHASE} \STATE {\scriptsize [Sample]}\ \ Draw a random sample $\mathcal{X}$, where each vertex is sampled with probability $\epsilon$. \FOR{all $v\in V\setminus \mathcal{X}$} \STATE {\scriptsize [Estimated-Degree.]}\ \ $d_e(v) \gets \frac{1}{\epsilon}\cdot d_ {\mathcal{X}}^-(v)$ \ENDFOR \STATE \ \STATE {\bf SLICING PHASE} \STATE {\scriptsize [Slices]}\ \ Create $\tau= \lceil \frac{1}{\epsilon^2}\rceil$ sets $\{S_1, \dots, S_{\tau}\}$ initialized to empty sets. \STATE $\Delta_e \gets \max_{v \in V\setminus \mathcal{X}}(d_e(v))$ \FOR{all $v\in V\setminus \mathcal{X}$} \FOR{$i=1$ to $\tau$} \IF{$(i-1) \epsilon^2 \cdot \Delta_e \leq d_e(v) \leq i \epsilon^2 \cdot \Delta_e$} \STATE $S_i \gets S_i\cup \{v\}$ \ENDIF \ENDFOR \ENDFOR \STATE \ \STATE {\bf ELECTION PHASE} \STATE {\scriptsize [Revealed Set]}\ \ $\mathcal{R}\gets \mathcal{X}$ \STATE {\scriptsize [Provisional Winner]}\ \ $y_0\gets \textrm{argmax}_{u \in V \setminus \mathcal{R}}(d^-_\mathcal{R}(u))$ \hfill {\scriptsize [Break ties arbitrarily.]} \FOR{$i=1$ to $\tau$} \FOR{all $v\in S_i\setminus \{y_{i-1}\}$} \STATE $\mathcal{R}\gets \mathcal{R}\cup \{v\}$ with probability $(1-\epsilon)$. \ENDFOR \STATE $y_i'\gets \textrm{argmax}_{u \in V \setminus \mathcal{R}}(d^-_\mathcal{R}(u))$ \hfill {\scriptsize [Break ties arbitrarily.]} \STATE $\mathcal{R}\gets (\mathcal{R}\cup S_i\cup \{y_{i-1}\}) \setminus \{y_{i}'\}$ \STATE {\scriptsize [Provisional Winner]}\ \ $y_i\gets \textrm{argmax}_{u \in V \setminus \mathcal{R}}(d^-_\mathcal{R}(u))$ \hfill {\scriptsize [Break ties arbitrarily.]} \STATE $\mathcal{R}\gets (\mathcal{R}\cup \{y_{i}'\}) \setminus \{y_{i}\}$ \ENDFOR \STATE The elected vertex is $y_{\tau}$. \end{algorithmic} \end{algorithm} This mechanism consists of three parts which we now informally discuss. In the first part, the {\em sampling phase}, we independently at random collect a sample $\mathcal{X}$ of the vertices. We use arcs incident to $\mathcal{X}$ to estimate the in-degree of every other vertex in the graph. In the second part, the {\em slicing phase}, we partition the unsampled vertices into slices, where each slice consists of vertices with roughly the same {\em estimated-degree}. The third part, the {\em election phase}, selects the winning vertex. It does this by considering each slice in increasing order (of estimated-degrees). After the $i$-th slice is examined the mechanism selects as {\em provisional leader}, $y_i$, the vertex that has the largest number of in-neighbors amongst the set of vertices $\mathcal{R}$ that have currently been eliminated. The winning vertex is the provisional leader after the final slice has been examined. We emphasize, again, that the impartiality of the mechanisms follows from the fact that the votes of a vertex are only revealed when it has been eliminated, that is, added to $\mathcal{R}$. Observe that at any stage we have one provisional leader; if this leader changes when we examine a slice then the votes of the previous leader are revealed if its slice has already been examined. \subsection{Analysis of the Sampling Phase} Observe that the sampling phase is used to estimate the in-degree of each unsampled vertex $v$. Since each in-neighbor of $v$ is sampled in $\mathcal{X}$ with probability $\epsilon$, we anticipate that an $\epsilon$-fraction of the in-neighbors of $v$ are sampled. Thus, we have an \emph{estimated in-degree} $d_e(v):=\frac{1}{\epsilon}\cdot d_{\mathcal{X}}^-(v)$, for each vertex $v\in V\setminus \mathcal{X}$. It will be important to know how often these estimates are (roughly) accurate. In particular, we say that a vertex $u$ is \emph{$\hat{\epsilon}$-well-estimated} if $|d_e(u)-d(u)| \leq \hat{\epsilon} d(u)$. We will be interested in the case where $\hat{\epsilon} \ll \epsilon$. (In particular, we will later select $\hat{\epsilon} = \frac{\epsilon^2}{4}$.) Before analyzing the probability that a vertex is $\hat{\epsilon}$-well-estimated, recall the classical Chernoff bound. \begin{theorem}\label{thm:chernoff}\emph{[Chernoff bound]}\\ Let $(X_i)_{i \leq n}$ be $n$ independent Bernouilli variables each having probability $p$. Then $$\brm{Pr}[|\sum X_i-pn| \geq \delta pn] \leq e^{-\frac{\delta^2 pn}{3}}.\ \ \ \ $$ \end{theorem} \begin{corollary}\label{coro:chernoff} For any vertex $v$ of in-degree at least $\Delta_0=\max(3000,\frac{9\epsilon^2}{\hat{\epsilon}^4})$, the probability that $v$ is not $\hat{\epsilon}$-well-estimated is at most $\frac{1}{d(v)^6}$. \end{corollary} \begin{proof} The proof is an application of Theorem~\ref{thm:chernoff}. For every in-neighbor $u_i$ of $v$, the vertex $u_i$ is sampled with probability $\epsilon$. Denote by $X_i$ the Bernouilli variable corresponding to ``$u_i$ is in $\mathcal{X}$'' which has value $1$ if $u_i \in \mathcal{X}$ and $0$ otherwise. The variables $X_i$ are obviously independent and identically distributed. Note that $\sum X_i = \epsilon\cdot d_e(u)$ and its expectation is $\epsilon \cdot d(u)$. \begin{eqnarray*} \brm{Pr}\Big(|d_e(u) - d(u)| \geq \frac{\hat{\epsilon}}{\epsilon} \cdot d(u)\Big) &=& \brm{Pr}\Big(|\epsilon\cdot d_e(u) - \epsilon \cdot d(u)| \geq \hat{\epsilon} \cdot d(u)\Big) \\ &\leq& e^{-\frac{\hat{\epsilon}^2 d(u)}{3\epsilon}} \\ &\leq& e^{-\frac{\hat{\epsilon}^2 \sqrt{\Delta_0}}{3\epsilon} \cdot \sqrt{d(u)}} \\ &\leq & e^{-\sqrt{d(u)}} \\ &\leq& \frac{1}{d(u)^6} \end{eqnarray*} Here the first inequality is an application of Theorem~\ref{thm:chernoff} with $\delta=\frac{\hat{\epsilon}}{\epsilon}$. The second inequality holds because $d(u)\ge \Delta_0$. The third inequality follows as $\Delta_0=\frac{9\epsilon^2}{\hat{\epsilon}^4}$. Finally, the fourth inequality holds since $\sqrt{d(u)} \geq 6 \log(d(u))$ when $d(u) \geq \Delta_0 \geq 3000$. \qed \end{proof} Let $\hat{\epsilon} := \frac{\epsilon^2}{4}$. We will be interested in the probability that every vertex of high degree in a local region is $\hat{\epsilon}$-well-estimated. Specifically, let $x$ be a vertex of maximum in-degree $\Delta$. Denote by $N^{-k}(x)$ the set of vertices which can reach $x$ with an oriented path of length at most $k$. For instance, $N^{-1}(x)$ is the in-neighborhood of $x$ plus $x$. Applying the union bound with Corollary~\ref{coro:chernoff}, we obtain: \begin{corollary}\label{coro:inneighbors} Let $x$ be a vertex of in-degree $\Delta$. If $\Delta \geq \Delta_1=\max(\frac{\Delta_0}{\epsilon^2},\frac{3}{\epsilon^{5}})$ then, with probability $(1-\epsilon)$, any vertex of $N^{-3}(x)$ of in-degree at least $\epsilon^2\cdot \Delta$ is $\hat{\epsilon}$-well-estimated. \end{corollary} \begin{proof} Since $\epsilon^2\cdot \Delta \geq \Delta_0$, Corollary~\ref{coro:chernoff} ensures that a vertex of in-degree at least $\epsilon^2\cdot \Delta$ is not $\hat{\epsilon}$-well-estimated with probability at most $\frac{1}{(\epsilon^2 \Delta)^6}$. There are at most $1+\Delta+ \Delta^2+\Delta^3 \leq 3\cdot \Delta^3$ vertices in $N^{-3}(x)$ since $\Delta \geq 2$. The union bound implies that every vertex in $N^{-3}(x)$ with in-degree at least $\epsilon^2 \Delta$ is $\hat{\epsilon}$-well-estimated with probability at least $(1-\frac{3\Delta^3}{\epsilon^{12} \Delta^6})$. As $\Delta \geq \frac{3}{\epsilon^{5}}$, the conclusion holds.~\qed \end{proof} It the rest of this section we will make a set of assumptions. Given these assumptions, we will prove that the mechanism outputs a vertex of high expected in-degree. We will say that the mechanism ``fails" if these assumptions do not hold. We will then show that the probability that the mechanism fails is very small. The two assumptions we make are:\\ \vskip 3pt (A1) Vertex $x$ is not sampled. This assumption fails with probability~$\epsilon$. \\ \vskip 3pt (A2) Every vertex in $N^{-2}(x)$ with in-degree at least $\epsilon^2 \cdot \Delta$ is regionally well-estimated. Here, we say a vertex is \emph{regionally well-estimated} if its degree is $\hat{\epsilon}$-well-estimated and all its in-neighbors of in-degree at least $\epsilon^2 \Delta$ are also $\hat{\epsilon}$-well-estimated. Corollary~\ref{coro:inneighbors} ensures that all the vertices of $N^{-2}(x)$ of degree at least $\epsilon^2 \cdot \Delta$ are regionally well-estimated with probability $(1-\epsilon)$. Thus, this assumption also fails with probability at most $\epsilon$. \subsection{Analysis of the Slicing Phase} Now we consider the slicing phase. In this phase we partition the unsampled vertices into groups (slices) according to their estimated degrees. The {\em width} of a slice is the difference between the upper and lower estimated-degree requirements for vertices in that group. We will need the following bounds on the width of a slice. \begin{lemma}\label{lem:width} The width of any slice is at least $(1-\hat{\epsilon})\epsilon^2 \cdot \Delta$ and at most $\epsilon\cdot \Delta$. \end{lemma} \begin{proof} By assumption, the vertex $x$ of maximum degree is $\hat{\epsilon}$-well-estimated. Thus, $\Delta_e \geq (1-\hat{\epsilon}) \cdot \Delta$. Therefore the width of any slice is at least $(1-\hat{\epsilon})\epsilon^2 \cdot \Delta$. On the other-hand, take any vertex $u$. At at most $\Delta$ of $u$'s in-neighbors can be sampled because it has degree at most $\Delta$. It follows that $d_e(u) \leq \frac{\Delta}{\epsilon}$. Thus, $\Delta_e \leq \frac{\Delta}{\epsilon}$, and the width of any slice is at most $\epsilon\cdot \Delta$. \qed \end{proof} \subsection{Analysis of the Election Phase} We are now ready to analyze the election phase. Initially we reveal every vertex in the sample $\mathcal{X}$. The vertex $y_0$ with largest estimated-degree is then the provisional winner. We then treat the slices in increasing order of estimated-degree. When we consider slice $S_i$, we will reveal every vertex in $S_i$ except one (if it is the provisional winner $y_i$). For technical reasons, we will denote by $S_0$ the set $\mathcal{X}$. Observe that the set $\mathcal{R}$ is the set of already revealed (eliminated) vertices. Now let $S_{\le \ell}=\cup_{j=0}^{\ell} S_j$, and denote by $d_\ell(u)=|\{u\in S_{\le \ell}: vu\in A\}$ the number of in-neighbors of $v$ that are in $S_j$, for $j \leq \ell$. Then we begin by proving two lemmas. The first, Lemma~\ref{lemma:smalldegrees}, states that if a vertex $u \in S_{\ell}$ has a large $d_{\ell-1}(u)$ then the elected vertex has large in-degree. The second, Lemma~\ref{lemma:bigdegrees}, guarantees that the elected vertex has a large in-degree (with high probability) if there are many regionally well-estimated vertices in $S_\ell$ with large $d_{\ell}(u)$. These lemmas will be applied to a vertex $x$ of in-degree $\Delta$: either many in-neighbors of $x$ are in slices before $x$ and Lemma~\ref{lemma:smalldegrees} will apply, or many in-neighbors of $x$ are in its slice and we will apply Lemma~\ref{lemma:bigdegrees} to this set of in-neighbors. \begin{lemma}\label{lemma:smalldegrees} Take $u \in S_{\ell+1}$. If $d_{\ell}(u) = d$, the elected vertex has in-degree at least $d-1$. \end{lemma} \begin{proof} When we select the provisional winner $y_{\ell}$ all vertices of $S_{\le \ell}=\cup_{j=0}^{\ell} S_j$ (but at most one, $y_{\ell}'$, if it is in this set) have been revealed. Now $u \in S_{\ell+1}$ is an eligible candidate for $y_{\ell}$. Thus, at that time, $d^-_{\mathcal{R}}(y_{\ell}) \geq d^-_\mathcal{R}(u)\ge d_{\ell}(u) -1 = d-1$. Since the in-degrees of the provisional winners can only increase, the elected vertex $y_{\tau}$ has is in-degree at least $d-1$. Note that the minus one comes from the fact that $y_\ell'$ can be an in-neighbor of $u$. \qed \end{proof} \begin{lemma}\label{lemma:bigdegrees} Let $\Delta \geq \Delta_1=\frac{12^2}{\hat{\epsilon}^4}$. If there exists an integer $\ell$ and a set $Z \subseteq S_\ell$ of size at least $\epsilon \Delta$ of regionally well-estimated vertices with $d_{\ell}(z) \geq (1-3\epsilon) \Delta+1$ for every $z \in Z$, then with probability at least $(1- \epsilon)$ we have $d(y_\ell') \geq (1-5\epsilon)\Delta$. \end{lemma} \begin{proof} First, by selecting a subset of $Z$ if necessary, we may assume that $Z = \lceil \epsilon \Delta \rceil$. Now we define a collection of bad events and show that $d(y_\ell) \geq (1-5\epsilon)\Delta$ if none of these events arise. We then show the probability that any of these bad events occurs is small. Let ${\bf B}_0$ be the event that every vertex in $Z$ is placed in $\mathcal{R}$ when we sample the vertices of slice $\ell$. We may assume the provisional leader $y_{\ell-1}$ is not in $Z$. Thus, since $|Z| \geq \epsilon \Delta$, the probability of event ${\bf B}_0$ is at most \begin{equation*} (1-\epsilon)^{\epsilon \Delta} \ \ =\ \ e^{\epsilon\Delta\cdot \log (1-\epsilon)} \ \ \leq\ \ e^{-\epsilon^2 \Delta} \ \ \leq\ \ \frac{\epsilon}{2} \end{equation*} Here the first inequality holds since $\log(1-\epsilon) \leq -\epsilon$. The second inequality holds as $\Delta \geq \frac{2}{\epsilon^4} \ge \frac{12^2}{\hat{\epsilon}^4}$. Now take any $z \in Z$ and let $U_z$ be the set of in-neighbors of $z$ in $S_{\leq \ell}\setminus \{y_{\ell-1}\}$. We have $|U_z| \geq (1-3\epsilon)\cdot \Delta$. Let ${\bf B}_z$ be the event that less than $(1-5\epsilon)\cdot\Delta$ vertices of $|U_z|$ are in $\mathcal{R}$ at the time we sample the vertices of slice $\ell$. To analyze the probability of this event consider any $u_i \in U_z$. Now, if $u_i \in S_j$ for $j< \ell$ then $u _i$ is already in $\mathcal{R}$. Otherwise, if $u_i \in S_{\ell}$ then it is now added to $\mathcal{R}$ with probability $(1-\epsilon)$. So consider a random variable $Y_i$ which has value $1$ if $u_i\in \mathcal{R}$ after this sampling and $0$ otherwise. Note the $Y_i$ are not identically distributed. So let $X_i$ be variables which are independent and identically distributed and such that $X_i=Y_i$ if $u_i \in S_{\ell}$ and $X_i$ has value $1$ with probability $(1-\epsilon)$ otherwise. We have \begin{eqnarray*} \brm{Pr} [\sum_i Y_i \leq (1-\epsilon-\hat{\epsilon})\cdot |U_z|] &\leq& \brm{Pr}[ \sum_i X_i \leq (1-\epsilon-\hat{\epsilon})\cdot |U_z|] \\ &\leq& e^{-\hat{\epsilon}^2 (1-\epsilon)\cdot |U_z|/3} \\ &\leq& e^{-\frac13 \hat{\epsilon}^2 (1-\epsilon)(1-3\epsilon)\Delta} \\ &\leq& e^{-2 \sqrt{\Delta}} \\ &\leq& \frac{1}{3\Delta} \end{eqnarray*} Here the first inequality follows from Theorem~\ref{thm:chernoff}. The second inequality holds as $|U_z| \geq (1-3\epsilon) \Delta$. The third inequality holds by the choice $\sqrt{\Delta} \ge \frac{12}{\hat{\epsilon}^2} \ge \frac{6}{\hat{\epsilon}^2 (1-\epsilon)(1-3\epsilon)}$. The fourth one is satisfied since $\Delta \geq 100$. We now apply the union bound to the events ${\bf B}_0 \cup \bigcup_{z\in Z} {\bf B}_z$. Since $Z = \lceil \epsilon \Delta \rceil$, none of these events occur with probability at least $1-\frac{\epsilon \Delta+1}{3\Delta}-\frac{\epsilon}{2}\ge 1-\epsilon$. Thus, with probability at least $1-\epsilon$, after the sampling of the slice $S_\ell$, there is a vertex $z\in Z$ that is not in $\mathcal{R}$ but that has at least $(1-5\epsilon)\cdot \Delta$ in-neighbors in $\mathcal{R}$. The new provisional leader $y_{\ell}'$ must then satisfy $d_{\mathcal{R}}^-(y_{\ell}') \geq d_{\mathcal{R}}^-(z) \geq (1-5\epsilon)\Delta$, as required, since $(1-5\epsilon)\cdot\Delta \le (1-\epsilon-\hat{\epsilon})\cdot |U_z|$. \qed \end{proof} \vskip 5pt \noindent \emph{Proof of Theorem~\ref{thm:slice}.} We may now prove that the slicing mechanism is nearly optimal. We assume that $\Delta \geq M_\epsilon=\max(\Delta_1,\Delta_2)$ and that $\epsilon\leq \frac{1}{8}$. Let $x$ be a vertex of in-degree $\Delta$. We assume that $x$ is not selected in $\mathcal{X}$ during the sampling phase and that all the vertices of $N^{-2}(x)$ with in-degree at least $\epsilon^2 \Delta$ are regionally well-evaluated. We need the following claim, where $k$ denotes the integer such that the vertex $x$ of maximum in-degree is in $S_k$. \begin{claim}\label{cl:kplusone} Let $u$ be a vertex in $N^{-3}(x)$ that is not in $S_{\le k}$. Then $u\in S_{k+1}$. \end{claim} \begin{proof} Take a vertex $u\in N^{-3}(x)$. If $d^-(u) \leq \epsilon^2 \Delta$, then its estimated degree is at most $\epsilon \Delta \leq d_e(x)$. Thus now we can assume that $d^-(u) \geq \epsilon^2 \Delta$ and then $u$ is $\hat{\epsilon}$-well-estimated by assumption on $x$. First observe that the set of possible estimated degrees of $u$ intersects at most two slices. To see this note that the range of $d_e(u)$ is less than $2\hat{\epsilon}\cdot \Delta$ as $u$ is $\hat{\epsilon}$-well-estimated. On the other-hand, by Lemma \ref{lem:width}, the width of a slice is at least $(1-\hat{\epsilon}) \epsilon^2 \cdot \Delta$. Since $\hat{\epsilon} = \frac{\epsilon^2}{4}$ we have \begin{equation*} 2\hat{\epsilon} \Delta \ \ \leq \ \ \frac{1}{2} \epsilon^2 \Delta \ \ <\ \ (1-\hat{\epsilon}) \epsilon^2 \Delta \end{equation*} Since the range is less than the width, the observation follows. The vertex $x$ of maximum degree is $\hat{\epsilon}$-well-estimated and is in the slice $k$. Therefore, because $u$ is $\hat{\epsilon}$-well-estimated (and necessarily $d(u)\le d(x)$), there must be a slice smaller than or equal to $k$ in its range of $u$. Thus $u$ cannot be in a slice with index exceeding $k+1$. \qed \end{proof} Assume first that there exists a set $Z_1$ of at least $\epsilon \Delta$ vertices of $N^{-2}(x)$ such that $Z_1 \cap S_i = \emptyset$ for $i \leq k$. The claim ensures that $Z_1 \subseteq S_{k+1}$. By considering a subset of $Z_1$, we may assume that $|Z_1|=\epsilon \Delta$. (We assume that $\epsilon \Delta$ is an integer, for simplicity.) Then, for any $z \in Z_1$, we have $d_e(z) \geq d_e(x)$ since $z$ is in the slice after $x$. Moreover, as $x$ and $z$ are $\hat{\epsilon}$-well-estimated, the facts that $|d_e(z) -d(z)| \leq \hat{\epsilon} \Delta$ and $|d_e(x) -d(x)| \leq \hat{\epsilon} \Delta$ imply that \begin{equation*} d(z) \ \ \geq\ \ (1-2\hat{\epsilon})\Delta \ \ \geq \ \ (1-\epsilon)\Delta \end{equation*} Furthermore, by the above claim, we must have that $d_{k+1}(z) = d(z)$. Consequently, we may apply Lemma~\ref{lemma:bigdegrees} to the set $Z_1$. This ensures that the in-degree of the elected vertex is at least $(1-5\epsilon)\Delta$ with probability at least $(1-\frac{1}{\epsilon})$. On the other hand, assume that now less than $\epsilon \Delta$ vertices of $N^{-2}(x)$ are in $S_{k+1}$. In particular, we have $d_k(x) \geq (1-\epsilon)\Delta$. If $d_{k-1}(x) \geq (1-4\epsilon)\cdot \Delta+1$ then the elected vertex has degree at least $(1-4\epsilon) \Delta$ by Lemma~\ref{lemma:smalldegrees}. So, assume that $d_{k-1}(x) \leq (1-4\epsilon)\Delta$. Then at least $3\epsilon \Delta$ in-neighbors of $x$ are in $S_k$. Denote by $Z_2$ a set of $\epsilon \Delta$ in-neighbors of $x$ in $S_k$. Every vertex $z\in Z_2$ has in-degree at least $(1-\epsilon-2 \hat{\epsilon})\Delta \geq (1-2\epsilon)\Delta+1$; this follows because both $x$ and $z$ are $\hat{\epsilon}$-well-estimated and because the width of a slice is at most $\epsilon \Delta$ (Lemma~\ref{lem:width}). For any $z \in Z_2$, since at most $\epsilon \Delta$ of the in-neighbors of $z$ are in $S_{k+1}$, we have $d_k(z) \geq (1-3\epsilon) \Delta+1$. Moreover, by assumption all the vertices of $Z_2$ are regionally well-estimated. Hence, by Lemma~\ref{lemma:bigdegrees}, with probability at least $(1-\epsilon)$, the degree of the elected vertex is at least $(1-5\epsilon)\Delta$, as desired. \vspace{8pt} Consequently, the slicing mechanism typically outputs a near-optimal vertex. So what is the probability that assumptions made during the proof fail to hold? Recall that Assumptions (A1) and (A2) fail to hold with probability at most $2\epsilon$. Given these two assumptions, Lemma~\ref{lemma:bigdegrees} fails to output a provisional leader with in-degree at least $(1-5\epsilon)\cdot \Delta$ with probability at most $\epsilon$. Thus the total failure probability is at most $3\epsilon$. Consequently, the expected in-degree of the elected vertex is at least $(1-3\epsilon)(1-5\epsilon)\cdot \Delta \geq (1-8\epsilon)\Delta$, which concludes the proof of Theorem~\ref{thm:slice}. \qed \vskip 5pt We conclude with some remarks. Here $M_\epsilon = \mathcal{O}(\frac{1}{\epsilon^8})$; the degree of this polynomial can certainly be improved as we did not attempt to optimize it. The slicing mechanism can be adapted to select a fixed number $c$ of winners rather than one. Let us briefly explain how. Instead of selecting only one provisional winner $y$ during each iteration of the election phase, we can select a set of size $c$ containing unrevealed vertices maximizing $d^-_ \mathcal{R}$. \\ Let $x_1,\ldots,x_c$ be the $c$ vertices of highest in-degree. With high probability all the vertices of $N^{-2}(x_i)$ are regionally well-estimated for every $i \leq c$ and with high probability none of them are selected during the sampling phase. Now consider two cases: either $N^{-2}(x_1)$ contains many vertices of degree almost $\Delta$, and then an adaptation of Lemma~\ref{lemma:bigdegrees} ensures that with high probability $c$ vertices are not sampled during the sampling of the election phase and the $c$ elected vertices have large degree. Or $N^{-2}(x_1)$ has few vertices of degree almost $\Delta$ and then when the slice of $x_1$ is considered, if $x_1$ is not selected, then all the selected vertices have degree almost $\Delta$ by Lemma~\ref{lemma:smalldegrees}. A similar argument can be repeated for every vertex $x_i$. \ \\ \noindent {\bf Acknowledgements.} The authors are extremely grateful to Felix Fischer for introducing us to the impartial selection problem and for discussions.
{'timestamp': '2014-08-01T02:12:40', 'yymm': '1407', 'arxiv_id': '1407.8535', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8535'}
arxiv
\section{Introduction}\label{sec1} The modeling of the time from disease onset or infection (i.e., initiating event) to an outcome of relevance is of considerable importance\vadjust{\goodbreak} in studies of the natural history of a disease and in projection of disease burden. Prospective studies which recruit and follow an appropriate cohort of subjects from disease onset to the event of interest are ideal for this purpose. However, these studies are inefficient in terms of resources if the event of interest tends to occur well after disease onset, as is the case for hepatitis C virus (HCV) studies of progression to cirrhosis from initial infection. The alternative is to follow a prevalent cohort of cross-sectionally sampled subjects who, prior to recruitment, have already experienced the initiating event (e.g., HCV infection) but not yet the event of interest (e.g., cirrhosis). The left truncated time-to-event data obtained from such a study provide a length-biased sample of the incident population, if sampling is such that an assumption of stationarity over calendar time for the occurrence of the initiating event can be made. Methods for handling both incidence data and such length-biased prevalence data have been well described in the (bio)statistics literature [\citet{AndersenBorganGill1993}, \citet{WangBrookmeyerJewell1993}, \citet{KalbfleischPrentice2002}, \citet{Brookmeyer2005}, \citet{Keiding2005}, \citet{Wang2005}, \citet{Tsai2009}, \citet{QinShen2010}]. A less explored situation is the analysis of prevalence data arising from a referral cohort where entry into the cohort is dependent on a subject's residual fraction of time remaining to the event of interest, and inference on the incident population is required. Such data are believed to occur in HCV studies conducted in tertiary care settings, where HCV patients are more likely to be referred to specialist clinics at later stages of disease [\citet{FuTomBird2007}]. The conventional truncation likelihood approach which simply conditions on the time of entry into the cohort does not work here, as the referral time and the time to the event are correlated. The ignoring of this referral bias has led to higher rates of progression to cirrhosis being reported in studies in specialist clinics compared to those in community-based settings [\citet{FreemanDoreLaw2001}]. As cirrhosis linked to HCV infection is a major epidemic of the 21st century, it is extremely important to get an accurate picture of the present and future disease burden facing affected regions in order to inform public health decisions and actions. The aforementioned type of referral or outcome-dependent sampling bias is particularly difficult to deal with unless a full specification (up to unknown parameters) of the probability sampling generating mechanism is provided. In practice, this mechanism will rarely be known and, instead, an approximate formulation of the sampling distribution, which is reasonably robust to misspecification, would be sought. Previously, \citet{FuTomBird2009} proposed a weighted pseudo score [\citet{Lawless1997}, \citet{CookLawless2007}] or inverse probability weighted method for estimating the parameters of a Weibull regression model for the incubation period from infection to cirrhosis for the community of hepatitis C virus-infected individuals, when there is cirrhosis-related referral bias to the studied prevalent cohort. The method assumed that everyone in the community would come to clinical attention at or before cirrhosis, so that cirrhosis events are not missed. Therefore, the target community population was assumed ``immortal'' (in the sense of no competing events), and individuals observed in the study sample to have experienced a cirrhotic event were associated with a weight of one in the estimation procedure. However, for other individuals, \citet{FuTomBird2009} used approximate weights and, therefore, consistency of these estimated weights, and, consequently, the regression parameter estimates of interest, was, in general, not guaranteed. Here we outline a full likelihood approach to this outcome-dependent referral problem in which the likelihood for the joint distribution of the time to referral and the time to outcome of interest, both from the initiating event, is fully specified. In practice, depending on the dimensionality of the joint parameter space, the full likelihood may be difficult to maximize over both the regression parameters of interest and the parameters associated with the time-to-entry process. Therefore, we also investigate another strategy based on a hybrid two-stage approach that iteratively alternates between estimating the parameters associated with the time-to-outcome distribution (i.e., regression and shape parameters) from a pseudo score with fixed weights and then estimating the parameters associated with the time-to-entry/referral process from the profiled full likelihood assuming the regression and shape parameters are known. We retain the assumption of an immortal cohort, although this can be relaxed [\citet{CopasFarewell2001}]. Primarily, we describe the approaches where the time-to-event distribution is assumed Weibull. However, we show how the methods can be extended to the family of parametric time-to-event distributions characterized by the generalized gamma distribution [\citet{Stacy1962}, \citet{StacyMihram1965}, \citet {Prentice1974}, \citet{FarewellPrentice1977}, \citet{Lawless1980}, \citet {CoxChu2007}], for which the Weibull is an important special case. \section{Notation, framework and assumptions}\label{sec2} For individuals in the target/\break incident population, let the calendar time of the initiating event be $Y$ and the calendar period of interest for inference on this population be between calendar times $d_1$~and~$d_2$. Therefore, $d_1 \leq Y \leq d_2$. Clinical observation of an individual will be left truncated at their time of referral to the clinic which is the time of entry into the cohort for those referred before $d_{2}$. Let the time intervals from $Y$ to potential referral and to the event of interest be $R$ and $T$, respectively, and denote by $Z$ the $p \times1$ vector of explanatory variables. We assume that the time-to-event $T$ from $Y$ in the incident population comes from a Weibull distribution with support on the positive real line and with positive shape and scale parameters, $\gamma$ and $\lambda$, respectively, where $\lambda= \exp(\beta^Tz)$ for given $Z=z$ and $\beta$ is a vector of regression parameters associated with $z$. More explicitly, the density and distribution functions of $T$ from an initiating event calendar time $Y=y$, and given the vector of explanatory variables $Z=z$, are $f_{T}(t \mid y,z)= \{\gamma\exp(-\gamma\beta^Tz)\} \exp[- \{t/\exp(\beta^Tz)\}^\gamma] t^{\gamma-1}$ and $F_{T}(t \mid y,z)=1 - \exp[-\{t/\exp(\beta^Tz)\}^\gamma]$, respectively. As there is no dependence on the actual value of $y$ in these functions, we simplify the notation for the density and distribution functions of $T$ to $f_{T}(t \mid z)$ and $F_{T}(t \mid z)$, respectively. Additionally, we assume, as is done for length-biased sampling problems, that within the calendar period $[d_1,d_2]$, the rate of occurrence of the initiating event remains constant. The independence of the distribution of $T$ from when its initiating event occurred and the stationarity of the initiating event process within the calendar period of interest are together referred to as the steady state or equilibrium condition [\citet{Wang2005}]. An individual is assumed to be included in the studied prevalent cohort if $0 < R < d_2 - Y$, with $S = I(0 < R < d_2-Y)$ the indicator variable denoting selection/inclusion. In addition to the assumption that selected patients will experience the event of interest and be referred prior to the time of the event, we assume the following for the individuals in the target population. \begin{assumption}[(Truncation before outcome)] \label{assumption1} The truncation (or potential referral or entry) time of an individual is always less than the time to outcome and so $R < T$. \end{assumption} \begin{assumption}[(Conditional truncation time)] \label{assumption2} For a known vector $\nu= (\nu_0,\ldots,\nu_{m+1})^T$, with $\nu_0=0$, $\nu_{m+1}=1$ and $\nu_j < \nu_{j+1}$ $(j=0,\ldots,m)$, and\vspace*{1.5pt} unknown mixture probability vector $\pi'=(\pi_0,\ldots, \pi_m)^T$ with $\sum_{j=0}^{m}\pi_j=1$, the distribution of $R$ given $T=t$ (for $t>0$) is a mixture of independent uniform random variables with support in the interval $[0,t)$, density function \begin{eqnarray*} f_{R \mid T}(r \mid t) &=& \sum_{j=0}^{m} \frac{\pi_j}{(\nu_{j+1}-\nu_j)t}I(\nu_j < r/t \leq\nu_{j+1}) \end{eqnarray*} and cumulative distribution function \begin{eqnarray*} F_{R \mid T}(r \mid t) &=& \sum_{j=0}^{m} \frac{\pi_j\{ \min(r,\nu _{j+1}t) - \max(0,\nu_j t) \}}{(\nu_{j+1}-\nu_j)t}I(\nu_j < r/t). \end{eqnarray*} \end{assumption} The form chosen for this conditional density reflects the belief that the residual fraction, $1-r/t$, of time remaining to the event of interest (or, alternatively, the fraction, $r/t$, of event time elapsed) drives whether a subject is referred [\citet{FuTomBird2009}]. It is constructed as a mixture of uniforms so as to allow flexibility in the shape of distribution that can be captured. A notable feature of the random variable $V=R/T$ (for $T>0$), corresponding to the fraction of time elapsed to the event of interest, is its independence from $T$ (see theorem in the supplementary material [\citet{supp}]). We will subsequently investigate the impact of misspecifying the partitioning of $\nu$ on results obtained. For selected subjects ($S=1$), denote by $C$ the censoring time from entry into the cohort, and let $X=\min(T,R+C)$ be the observed follow-up\vadjust{\goodbreak} time until the outcome event or censoring, with $\Delta= I(T-R<C)$ the ``right censoring'' indicator taking the value $1$ when uncensored. As the calendar period of interest for inference on this population is between $d_1$ and $d_2$, then for selected subjects, $d_2-Y \geq X$. That is, follow-up beyond $d_2$ is not planned. Additionally, we assume that $(T,R)$ is independent of $C$ [conditional on either $Z$ or $(Z,Y)$] and that the parameters governing the distribution of $C$ are distinct from those governing the joint distribution of $(T,R)$. That is, the censoring process is ignorable. To proceed with estimation, we make the following further simplifying assumption: \begin{assumption}[(Known initiation time)] \label{assumption3} The calendar time of the initiating event can be determined for those subjects selected for inclusion in the cohort. \end{assumption} In Section~\ref{discuss} we discuss how one would proceed if the time of the initiating event is best known to within an interval. Figure~\ref{fig1} presents pictorially the salient features of our prevalent referral cohort design setup. \begin{figure \includegraphics{725f01.eps} \caption{Prevalent referral cohort sampling setup.}\label{fig1} \end{figure} \section{Estimation methods}\label{sec3} \subsection{Maximum likelihood approach}\label{sec3.1} Let $n$ be the number of individuals who have been selected into the cohort. For an included individual $i \in\{1,\ldots,n\}$, let the observed data be $(r_i,x_i,\delta_i,y_i,z_i)$, which are assumed to be independent realizations of $(R_i, X_i, \Delta_i, Y_i, Z_i)$. Under Assumptions~\ref{assumption1} and \ref{assumption3}, the ignorability of the censoring process and conditional on $\{Z_i\}$ and $\{Y_i\}$, the full likelihood for $\theta^T = (\gamma, \beta^T, \pi^T)$, where $\pi =(\pi_1,\ldots, \pi_m)^T$, can be written (with, for conciseness, some abuse of notation for continuous variables) as \begin{eqnarray} L(\theta)&=& \prod_{i=1}^{n}\bigl\{ \operatorname{pr}(R_i=r_i, T_i=x_i \mid Y_i=y_i, Z_i=z_i, S_i=1)^{\delta_i} \nonumber \\ &&\hspace*{15pt}{} \times \operatorname{pr}(R_i=r_i, T_i \geq x_i \mid Y_i=y_i, Z_i=z_i, S_i=1)^{1-\delta_i}\bigr\} \label{like1} \\ &=& \prod_{i=1}^nL_i( \theta). \nonumber \end{eqnarray} The first term in the product is the likelihood contribution if $x_i$ corresponds to the true time-to-event $t_i$ (i.e., $\delta_i=1$) and the second when a right censored event time is observed (i.e., $\delta_i=0$). When $\delta_i=1$ and setting $u_i=d_2-y_i$, it can be shown that \begin{eqnarray*} && \operatorname{pr}(R_i=r_i, T_i=x_i \mid Y_i=y_i, Z_i=z_i, S_i=1) \\ &&\qquad = \frac {f_{R \mid T}(r_i \mid x_i) f_{T}(x_i \mid z_i)}{\operatorname{pr}(0 < R_i < u_i)}. \end{eqnarray*} In the situation where $\gamma> 1$ (i.e., the hazard rate of $T$ increases over time), and defining $\varphi= (\gamma- 1)/\gamma$, the denominator, $\operatorname{pr}(0 < R_i < u_i)$, can be analytically evaluated and is found to be \begin{eqnarray} \label{one} & & \sum_{j=0}^{m} \frac{\pi_j}{(\nu_{j+1}-\nu_j)} \bigl[ \frac{}{} \bigl\{ \nu_{j+1} F_{T}(u_i/\nu_{j+1} \mid z_i) - \nu_j F_{T}(u_i/\nu_j \mid z_i) \bigr\} \nonumber \\ &&\hspace*{77pt} {}+u_ie^{-\beta^Tz_i}\Gamma( \varphi) \bigl\{F_G\bigl((u_i/\nu_{j})^\gamma; e^{-\gamma\beta^Tz_i},\varphi\bigr)\nonumber \\ &&\hspace*{155pt}{} - F_G\bigl((u_i/ \nu_{j+1})^\gamma; e^{-\gamma\beta^Tz_i},\varphi\bigr) \bigr\} \bigr] \nonumber\\[-8pt]\\[-8pt] & &\qquad = \sum_{j=0}^{m}\frac{\pi_j}{(\nu_{j+1}-\nu_j)} \bigl[ \frac {}{} \bigl\{ \nu_{j+1} F_{T}(u_i/ \nu_{j+1} \mid z_i) - \nu_j F_{T}(u_i/\nu_j \mid z_i) \bigr \}\nonumber \\ &&\hspace*{110pt}{} + u_ie^{-\beta^Tz_i} \bigl\{\Gamma\bigl(\varphi,e^{- \gamma\beta^Tz_i}(u_i/ \nu_{j+1})^\gamma\bigr)\nonumber \\ &&\hspace*{173pt}{} - \Gamma\bigl(\varphi,e^{- \gamma\beta^Tz_i}(u_i/ \nu_{j})^\gamma\bigr) \bigr\} \bigr] \nonumber \end{eqnarray} with $F_G(u; r, s) = \gamma(s,ru)/\Gamma(s) = \{\Gamma(s) - \Gamma(s,ru)\}/\Gamma(s)$ the cumulative distribution function of a gamma random variable with rate $r>0$ and shape \mbox{$s>0$}, evaluated at $u$ ($0 < u < \infty$), where $\gamma(s,u)= \int _0^ut^{s-1}e^{-t}\,dt$ and $\Gamma(s,u)=\int_u^\infty t^{s-1}e^{-t}\,dt$ denote the lower and upper incomplete gamma functions and $\Gamma(s) = \int_0^\infty t^{s-1}e^{-t}\,dt$ the ordinary gamma function. Details of the derivation are provided in the supplementary material [\citet{supp}] for the family of parametric time-to-event distributions characterized by the generalized gamma distribution with either monotonically increasing or arc shaped (upside-down bathtub) hazards [\citet{Glaser1980}, \citet{CoxChu2007}]. For selected individuals with $\delta_i=0$, the likelihood contribution in (\ref{like1}), $\operatorname{pr}(R_i=r_i, T_i \geq x_i \mid Y_i=y_i, Z_i=z_i, S_i=1)$, can be written as \[ \frac{\operatorname{pr}(R_i=r_i, T_i \geq x_i \mid Y_i=y_i, Z_i=z_i)}{\operatorname{pr}(0 <R_i <u_i)}, \] where it can be shown (see the supplementary material [\citet{supp}]) that when $\gamma> 1$, the numerator, $\operatorname{pr}(R_i=r_i, T_i \geq x_i \mid Y_i=y_i, Z_i=z_i) = \operatorname{pr}(R_i=r_i, T_i \geq x_i \mid Z_i=z_i)$, takes the closed form \begin{eqnarray}\label {two} & & \sum_{j=0}^{m} \frac{\pi_j}{(\nu_{j+1}-\nu_j)} \bigl[ \frac{}{} \Gamma(\varphi) e^{-\beta^Tz_i}I\bigl( \nu_j < \min(r_i/x_i,\nu_{j+1}) \bigr) \nonumber \\ &&\hspace*{76pt}{}\times \bigl\{ F_G\bigl((r_i/\nu_{j})^\gamma; e^{-\gamma\beta ^Tz_i},\varphi\bigr) \nonumber \\ &&\hspace*{93pt}{}- \frac{}{} F_G\bigl(\bigl(r_i/ \min(r_i/x_i,\nu_{j+1})\bigr)^\gamma; e^{-\gamma\beta^Tz_i},\varphi\bigr) \bigr\} \bigr] \nonumber\\[-8pt]\\[-8pt] &&\qquad = \sum_{j=0}^{m} \frac{\pi_j}{(\nu_{j+1}-\nu_j)} \bigl[ \frac{}{} e^{-\beta^Tz_i}I\bigl(\nu_j < \min(r_i/x_i,\nu_{j+1})\bigr) \nonumber \\ &&\hspace*{109pt}{}\times \bigl\{ \Gamma\bigl(\varphi,e^{-\gamma\beta^Tz_i}\bigl(r_i/ \min(r_i/x_i,\nu_{j+1})\bigr)^\gamma \bigr) \nonumber \\ &&\hspace*{178pt}{} - \Gamma\bigl(\varphi,e^{-\gamma\beta^Tz_i}(r_i/\nu _{j})^\gamma\bigr) \bigr\} \bigr]. \nonumber \end{eqnarray} For the case where $\gamma< 1$ (i.e., the hazard rate of $T$ is monotonically decreasing over time), similar closed-form expressions for $\operatorname{pr}(0 < R_i < u_i)$ and $\operatorname{pr}(R_i=r_i, T_i \geq x_i \mid Z_i=z_i)$ can be obtained but with the upper incomplete gamma function of the form $\Gamma(\varphi,(u/\lambda)^\gamma)$ replaced with $(u/\lambda )^{\gamma\varphi} E_{1-\varphi}((u/\lambda)^\gamma)$ in (\ref{one}) and~(\ref{two}), where $E_p(z)$ denotes the generalized exponential integral with $p > 1$ and $z \geq0$. However, for this present paper, we consider only $\gamma> 1$, as it is difficult to envisage in our context a situation where an initially decreasing hazard rate over time would arise. The maximum likelihood estimates, $\hat{\theta}$, for $\theta$ can now be obtained by substituting these various expressions for the terms in (\ref{like1}) into $L(\theta)=\prod_{i=1}^{n}L_i(\theta)$ and then maximizing $l(\theta)=\log L(\theta) = \sum_{i=1}^n l_i(\theta)$ over $\theta $. Estimates of the standard errors for $\hat{\theta}$ are obtained from inverting the observed information matrix, $-\partial^2l(\theta)/\partial\theta\,\partial \theta^T$, evaluated at $\hat{\theta}$. \subsection{Hybrid pseudo score/profile likelihood approach}\label{sec3.2} As an alternative to the full likelihood approach, a pseudo score method based on inverse probability weights can be developed [\citet {CookLawless2007}]. We assume that the incident population has $N$ individuals with initiating event times\vspace*{1pt} occurring in the period $d_1$ to $d_2$. The weighted pseudo score, $U_1(\psi,\pi)$, with $\psi^T=(\gamma,\beta^T)$, is constructed by weighting the Weibull score contributions, $\partial l^{W}_{i}/\partial\psi$ for selected subjects by $w_i = 1/p_i$ ($i=1,\ldots, n)$, where $p_i$ is the selection probability for subject $i$. This weighted pseudo Weibull score, which has expectation zero, takes the form \begin{eqnarray*} U_1(\psi, \pi) &=& \sum_{i=1}^N {S_i} {w_i} \frac{\partial l^{W}_{i}}{\partial\psi} \\ &=& \sum_{i=1}^N\frac{S_i}{p_i} \frac{\partial}{\partial\psi} \bigl[ \delta_i\log f_T(x_i \mid z_i) + (1-\delta_i)\log\bigl(1-F_T(x_i \mid z_i)\bigr) \bigr]. \end{eqnarray*} For a selected study subject $i$ (i.e., $S_i=1$), $p_i$ is either $\operatorname{pr}(0< R_i < u_i=d_{2}-y_{i}|T_i=x_i)$ if $\delta_i=1$ or $\operatorname{pr}(0< R_i < u_i|T_i \geq x_i)$ if $\delta_i=0$, with $x_i \leq u_i$. The former probability expression evaluates to $1$, as a subject who is observed to have experienced the event of interest would have $t_i=x_i \leq u_i$ and since $T_i > R_i$ (by Assumption~\ref{assumption1}), then, with probability $1$, $R_i < u_i$. The latter probability expression is shown in the supplementary material [\citet{supp}] to be $\{\operatorname{pr}(0 < R_i <u_i) - F_T(x_i \mid z_i)\}/\{1-F_T(x_i \mid z_i)\}$, which is a function of $\theta$. These expressions are derived under the supposition that no further follow-up information on referred individuals beyond $d_2$, the close of the study, is available. This reflects the situation in our application. However, these expressions can be easily modified to take account of further follow-up information beyond the close of study, as shown in the supplementary material [\citet{supp}] for selected individuals with $\delta_i=0$ and $x_i > u_i$. The former probability expression for an uncensored selected individual $i$ is trivially $F_{R_i \mid T_i}(u_i \mid x_i)$, where $x_i$ can now be greater than $u_i$.\vspace*{1pt} Estimation of $\theta^T=(\gamma,\beta^T,\pi^T)$ under this second approach proceeds in two stages. First, $\psi$, the vector of Weibull shape and regression parameters, is estimated by setting the pseudo score, $U_1(\psi,\pi)$, to zero and solving for $\psi$ with given $\{p_i\}$ to get the maximum weighted pseudo score estimates of $\psi$. Next, the inclusion probabilities $\{p_i\}$ for selected subjects with $\delta_i=0$ are reevaluated at these maximum weighted pseudo score estimates and at the maximum profile likelihood estimate of $\pi$ obtained after maximizing $l(\theta)$ over $\pi$ with $\psi$ set in (\ref{like1}) to its maximum weighted pseudo score estimates. These two steps are iterated until convergence of the estimates for $\theta$ to $\tilde {\theta}$. Initially the inclusion probabilities $\{p_i\}$ are all assumed to take the value $1$ and, therefore, the initial estimate of $\psi$ is from the standard (unweighted) Weibull regression model. This iterative estimation procedure is similar to that used by \citet{HardinHilbe2003} for longitudinal data, although, to minimize efficiency loss, we do not adopt their assumption of orthogonality of the estimating equations. Estimated standard errors based on this approach can be obtained either through a standard bootstrap procedure or determined based on Taylor series expansion arguments applied to the set of unbiased estimating equations $U_1(\psi,\pi)=0$ and $U_2(\psi,\pi) \equiv\partial l(\theta )/\partial\pi= 0$. Under appropriate regularity conditions, the asymptotic joint distribution of $((\tilde{\psi}-\psi)^T,(\tilde{\pi}-\pi)^T)$ is Gaussian with expectation zero and variance--covariance matrix consistently estimated by the robust sandwich matrix $\Sigma\Lambda\Sigma^T$ evaluated at $\tilde{\theta}$, where $\Sigma^{-1}$ is \[ - \pmatrix{ \displaystyle\frac{\partial U_1}{\partial\psi^T} & \displaystyle\frac{\partial U_1}{\partial\pi^T} \vspace*{5pt}\cr \displaystyle\frac{\partial U_2}{\partial\psi^T} & \displaystyle\frac{\partial U_2}{\partial \pi^T}} \] and\vspace*{1pt} $\Lambda= \sum_{\{i\dvtx S_i=1\}} U_{0i}U_{0i}^T$, where $U_{0i}^T= (U_{1i}^T,U_{2i}^T)=(w_i(\theta)\,\partial l^{W}_{i}/\partial\psi^T, \partial l_i/\partial\pi^T)$ for $S_i=1$, with the dependency of $w_i(\theta )$ on $\theta$ explicitly shown. With this extra notation, it is easily seen that $U_1(\psi,\pi)=\sum_{i=1}^nU_{1i}$ and $U_2(\psi,\pi)=\sum _{i=1}^nU_{2i}$, and \begin{eqnarray*} \frac{\partial U_1}{\partial\psi^T} &=& \sum_{i=1}^{n} \biggl( \frac{\partial l^{W}_{i}}{\partial\psi} \frac{\partial w_i}{\partial\psi^T} + w_i \frac{\partial^2 l^{W}_{i}}{\partial\psi\,\partial\psi^T} \biggr),\qquad \frac{\partial U_1}{\partial\pi^T} = \sum _{i=1}^{n} \frac {\partial l^{W}_{i}}{\partial\psi} \frac{\partial w_i}{\partial\pi^T}, \\ \frac{\partial U_2}{\partial\psi^T} &=& \sum_{i=1}^{n} \frac {\partial^2 l_i}{\partial\pi\,\partial\psi^T}\quad\mbox{and}\quad \frac{\partial U_2}{\partial\pi^T} = \sum _{i=1}^{n} \frac {\partial^2 l_i}{\partial\pi\,\partial\pi^T}. \end{eqnarray*} \subsection{Simulation study: Consistency, efficiency and robustness considerations}\label{sec3.3} To illustrate the performance of the proposed methods, in particular, with regard to efficiency, bias and robustness, we conducted a small-scale simulation with a design similar to that in \citet{FuTomBird2007}, \citet{FuTomBird2009}. We performed 500 simulation runs and generated, in each of the runs, a community sample size of $N=5000$. We considered three different time-to-event distributions from which to simulate our data. These were (i)~the Weibull, (ii) the gamma and (iii)~the log-normal. The parameter configurations for these three distributions were (i)~$\psi_W^T = (\gamma_W,\beta_0,\beta_1,\beta_2) = (4, 4\ta 6, -0\ta 03, -0\ta 4)$, (ii) $\psi_G^T = (\gamma_G,\beta_0,\beta_1,\beta_2) = ( 12\ta 71, 1\ta 96, -0\ta 03, -0\ta 4)$, and (iii) $\psi_{LN}^T = (\sigma_{LN},\beta_0,\beta_1,\beta_2) = (0\ta 275, 4\ta 464, -0\ta 03, -0\ta 4)$, corresponding to the shape parameters, $\gamma_W$ and $\gamma_G$, scale parameter, $\sigma_{LN}$, and the regression parameters $\beta=(\beta_0,\beta_1,\beta_2)^T$ associated with the covariate vector $z$ comprising of an intercept, a continuous variable, $z_1$, generated from a log-normal distribution with location and scale parameters taking the values 3 and 0\ta 3, respectively, and a binary variable, $z_2$, generated from a Bernoulli distribution with success probability of $1/3$. These covariates are included through a log-linear regression model on the Weibull's and gamma's scale parameters and a linear model on the log-normal's location parameter. The parameters $\beta_0$, $\gamma_W$, $\gamma_G$ and $\sigma_{LN}$ were chosen to make the log baseline means from the regression models corresponding to the three distribution all equal to $4.50$. The truncation times (in years), which are entry times for those selected, are generated from the conditional distribution proposed earlier with $\pi'=(\mbox{0\ta 1, 0\ta 06, 0\ta 12, 0\ta 24, 0\ta 48})^T$ and $\nu=(\mbox{0, 0\ta 5, 0\ta 625, 0\ta 75, 0\ta 875, 1})^T$. For simplicity in interpretation of the various simulation results to be presented, we assume everyone in the community experienced the initiating event at the same calendar date and those whose truncation time was less than $d_0=15$ years entered the referral cohort. Administrative right censoring of sampled subjects occurred at $c_0=15$ years from the calendar date of the initiating event. This was the only type of censoring considered here. The parameters of the Weibull distribution were informed by the data that arose from the Edinburgh Royal Infirmary's hepatitis C virus liver clinic, which are analyzed later. \subsubsection*{Correct specification of the time-to-event distribution} Table~\ref{tab1} presents the findings from the aforementioned simulation. Both approaches produce consistent estimates of the parameters from the Weibull model and the sampling mechanism when the time-to-event distribution was Weibull. As expected, more efficient estimates of the shape and regression parameters were obtained from the full likelihood approach than the hybrid pseudo score/profile likelihood approach. Similar estimated standard errors were obtained from both approaches for the corresponding estimates of $\pi$. This perhaps reflects the near optimality of the hybrid approach when estimating $\pi$ since the relevant part of the full likelihood is being used. \begin{table \tabcolsep=0pt \caption{Full and hybrid pseudo score/profiled Weibull likelihood simulation results}\label{tab1} \begin{tabular*}{\tablewidth}{@{\extracolsep{\fill}}@{}lcd{2.3}d{1.3}d{1.3}d{2.3}d{1.3}d{1.3}d{1.3}@{}} \hline & & \multicolumn{3}{c}{} & \multicolumn{3}{c}{\textbf{Hybrid pseudo score/}}\\ & & \multicolumn{3}{c}{\textbf{Full likelihood}} & \multicolumn{3}{c}{\textbf{profile likelihood}}\\[-6pt] \multirow{2}{46pt}{\textbf{True distribution}} & \multirow{2}{27pt}{\textbf{Para\-meters}}& \multicolumn{3}{c}{\hrulefill} & \multicolumn{3}{c}{\hrulefill} \\ & & \multicolumn{1}{c}{\textbf{Mean}} & \multicolumn{1}{c}{$\overline{\mbox{\textbf{SE}}}$} & \multicolumn{1}{c}{\textbf{ESE}} & \multicolumn{1}{c}{\textbf{Mean}} & \multicolumn{1}{c}{$\overline{\mbox{\textbf{RSE}}}$} & \multicolumn{1}{c}{\textbf{ESE}} & \multicolumn{1}{c@{}}{\textbf{RE}}\\ \hline Weibull & $\beta_0$ & 4\ta 635 & 0\ta 289 & 0\ta 287 & 4\ta 631 & 0\ta 386& 0\ta 397 & 0\ta 525 \\ & $\beta_1$ & -0\ta 031 & 0\ta 005 & 0\ta 006 & -0\ta 030 &0\ta 007 & 0\ta 007 & 0\ta 604 \\ & $\beta_2$ & -0\ta 405 & 0\ta 093 & 0\ta 090 & -0\ta 404 &0\ta 109 & 0\ta 112 & 0\ta 645 \\ & $\gamma_W$ & 4\ta 041 & 0\ta 345 & 0\ta 342 & 4\ta 062 & 0\ta 361& 0\ta 401 & 0\ta 729 \\ & $\pi_1$ & 0\ta 060 & 0\ta 020 & 0\ta 020 & 0\ta 061& 0\ta 018& 0\ta 019 & 1\ta 011 \\ & $\pi_2$ & 0\ta 120 & 0\ta 030 & 0\ta 031 & 0\ta 120& 0\ta 029& 0\ta 031 & 0\ta 998 \\ & $\pi_3$ & 0\ta 241 & 0\ta 041 & 0\ta 040 & 0\ta 240& 0\ta 040& 0\ta 040 & 1\ta 011 \\ & $\pi_4$ & 0\ta 480 & 0\ta 047 & 0\ta 047 & 0\ta 479& 0\ta 050& 0\ta 049 & 0\ta 929 \\[3pt] Gamma & $\beta_0$ & 4\ta 378 & 0\ta 276 & 0\ta 307 & 4\ta 325 & 0\ta 277& 0\ta 335 & 0\ta 838 \\ & $\beta_1$ & -0\ta 028 & 0\ta 005 & 0\ta 006 & -0\ta 027 &0\ta 005 & 0\ta 006 & 0\ta 839 \\ & $\beta_2$ & -0\ta 405 & 0\ta 091 & 0\ta 091 & -0\ta 402 &0\ta 103 & 0\ta 111 & 0\ta 677 \\ & $\gamma_W$ & 6\ta 658 & 0\ta 772 & 0\ta 779 & 6\ta 821 & 0\ta 646& 0\ta 883 & 0\ta 779 \\ & $\pi_1$ & 0\ta 059 & 0\ta 022 & 0\ta 022 & 0\ta 060& 0\ta 019& 0\ta 022 & 1\ta 066 \\ & $\pi_2$ & 0\ta 114 & 0\ta 039 & 0\ta 041 & 0\ta 113& 0\ta 037& 0\ta 039 & 1\ta 080 \\ & $\pi_3$ & 0\ta 233 & 0\ta 054 & 0\ta 056 & 0\ta 231& 0\ta 053& 0\ta 054 & 1\ta 063 \\ & $\pi_4$ & 0\ta 482 & 0\ta 066 & 0\ta 071 & 0\ta 475& 0\ta 066& 0\ta 070 & 1\ta 046 \\[3pt] Log-normal & $\beta_0$ & 4\ta 344 & 0\ta 269 & 0\ta 308 & 4\ta 338 & 0\ta 276& 0\ta 392 & 0\ta 617 \\ & $\beta_1$ & -0\ta 028 & 0\ta 004 & 0\ta 005 & -0\ta 028 &0\ta 005 & 0\ta 007 & 0\ta 671 \\ & $\beta_2$ & -0\ta 402 & 0\ta 094 & 0\ta 101 & -0\ta 416 &0\ta 113 & 0\ta 136 & 0\ta 554 \\ & $\gamma_W$ & 7\ta 919 & 0\ta 993 & 1\ta 071 & 8\ta 027 & 0\ta 767& 1\ta 230 & 0\ta 757 \\ & $\pi_1$ & 0\ta 062 & 0\ta 023 & 0\ta 025 & 0\ta 062& 0\ta 020& 0\ta 025 & 1\ta 007 \\ & $\pi_2$ & 0\ta 108 & 0\ta 042 & 0\ta 043 & 0\ta 109& 0\ta 040& 0\ta 041 & 1\ta 088 \\ & $\pi_3$ & 0\ta 225 & 0\ta 061 & 0\ta 062 & 0\ta 224& 0\ta 059& 0\ta 060 & 1\ta 053 \\ & $\pi_4$ & 0\ta 492 & 0\ta 076 & 0\ta 078 & 0\ta 484& 0\ta 076& 0\ta 075 & 1\ta 073\\ \hline \end{tabular*} \tabnotetext[]{}{Mean, average of the estimate; $\overline{\mbox{SE}}$, average of the estimated standard error; ESE, empirical standard error; $\overline{\mbox {RSE}}$, average of the estimated robust standard error; RE, the empirical variance of the maximum likelihood estimator divided by the empirical variance of the maximum hybrid pseudo score/profile likelihood estimator.} \end{table} \subsubsection*{Misspecification of the time-to-event distribution} Table~\ref{tab1} also shows the results when the true time-to-event distributions are gamma and log-normal but the full likelihood and hybrid pseudo score/profile likelihood approaches were fitted assuming the time-to-event distribution was Weibull. Here we see that the impact of this incorrect assumption for the time-to-event distribution is negligible for the estimation of the regression parameters $\beta_1$ and $\beta_2$ and minor for the estimation of $\pi$. The estimates of the log baseline mean under misspecification of the true gamma and log-normal distributions by the Weibull [i.e., $\log(\Gamma(1+1/\gamma_W))+\beta_0$] were approximately $4.31$ and $4.28$, respectively. As earlier mentioned, the true log baseline mean is $4.50$. Therefore, for these particular cases of misspecification there is underestimation of the log baseline mean. This underestimation of the log baseline mean would result in an underestimation of the tail probabilities of the marginal population time-to-event distribution, which would lead to underestimation of the population size. \begin{table} \tabcolsep=10pt \caption{Full and hybrid pseudo score/profiled likelihood Weibull simulation results under a less parsimonious representation of the truncation time conditional distribution}\label{tab2} \begin{tabular*}{\tablewidth}{@{\extracolsep{\fill}}ld{2.3}d{1.3}d{1.3}d{2.3}d{1.3}d{1.3}@{}} \hline & \multicolumn{3}{c}{} & \multicolumn{3}{c@{}}{\textbf{Hybrid pseudo score/}}\\ & \multicolumn{3}{c}{\textbf{Full likelihood}} & \multicolumn{3}{c@{}}{\textbf{profile likelihood}}\\[-6pt] & \multicolumn{3}{c}{\hrulefill} & \multicolumn{3}{c@{}}{\hrulefill}\\ \textbf{Parameters} & \multicolumn{1}{c}{\textbf{Mean}} & \multicolumn{1}{c}{$\overline{\mbox{\textbf{SE}}}$} & \multicolumn{1}{c}{\textbf{ESE}} & \multicolumn{1}{c}{\textbf{Mean}} & \multicolumn{1}{c@{}}{$\overline{\mbox{\textbf{RSE}}}$} & \multicolumn{1}{c@{}}{\textbf{ESE}} \\ \hline $\beta_0$ & 4\ta 606 & 0\ta 255 & 0\ta 258 & 4\ta 604& 0\ta 238& 0\ta 252 \\ $\beta_1$ & -0\ta 030 & 0\ta 005 & 0\ta 005 & -0\ta 030 &0\ta 005 & 0\ta 005 \\ $\beta_2$ & -0\ta 400 & 0\ta 085 & 0\ta 087 & -0\ta 400 &0\ta 084 & 0\ta 086 \\ $\gamma$ & 4\ta 057 & 0\ta 394 & 0\ta 385 & 4\ta 056 &0\ta 363& 0\ta 380 \\ $\pi_1$ & 0\ta 125 & 0\ta 027 & 0\ta 026 & 0\ta 125 &0\ta 026& 0\ta 026 \\ $\pi_2$ & 0\ta 125 & 0\ta 030 & 0\ta 030 & 0\ta 125 &0\ta 030& 0\ta 031 \\ $\pi_3$ & 0\ta 127 & 0\ta 032 & 0\ta 031 & 0\ta 127 &0\ta 031& 0\ta 031 \\ $\pi_4$ & 0\ta 125 & 0\ta 032 & 0\ta 032 & 0\ta 125 &0\ta 032& 0\ta 031 \\ \hline \end{tabular*} \tabnotetext[]{}{Mean, average of the estimate; $\overline{\mbox{SE}}$, average of the estimated standard error; ESE, empirical standard error; $\overline{\mbox{RSE}}$, average of the estimated robust standard error.} \end{table} \subsubsection*{Misspecification of the referral mechanism} To investigate the relative robustness of the proposed mixture of uniforms for the conditional distribution of the truncation times given the time to event, we began by rerunning our simulation study as before, except with the conditional distribution of the truncation time now generated from a single uniform distribution in the interval zero to the true time to event instead of the five-component mixture of uniforms. However, the \textit{less parsimonious} five-component mixture of uniforms, with $\nu=(0, 0\ta 5, 0\ta 625, 0\ta 75, 0\ta 875, 1)^T$, was assumed as the working conditional distribution of the truncation times when fitting the full likelihood and hybrid approaches to the simulated data at each simulation run. The results are shown in Table~\ref{tab2}. The less parsimonious working conditional distribution for the truncation times has no apparent impact, as would be expected, on consistent estimation of the regression and shape parameters of the Weibull distribution. This suggests that finer partitions of $\nu$ than needed do not impact on consistency of estimated regression and shape parameters, although may inflate the standard errors of these estimates and the mixture probability estimates. \begin{table \tabcolsep=5pt \caption{Full and hybrid pseudo score/profiled Weibull likelihood simulation results under misspecification of the truncation time conditional distribution by a cruder partitioning}\label{tab3} \begin{tabular*}{\tablewidth}{@{\extracolsep{\fill}}ld{2.3}d{1.3}d{1.3}d{2.3}d{1.3}d{1.3}@{}} \hline & \multicolumn{3}{c}{} & \multicolumn{3}{c@{}}{\textbf{Hybrid pseudo score/}}\\ & \multicolumn{3}{c}{\textbf{Full likelihood}} & \multicolumn{3}{c@{}}{\textbf{profile likelihood}}\\[-6pt] & \multicolumn{3}{c}{\hrulefill} & \multicolumn{3}{c@{}}{\hrulefill}\\ \textbf{Parameters} & \multicolumn{1}{c}{\textbf{Mean}} & \multicolumn{1}{c}{$\overline{\mbox{\textbf{SE}}}$} & \multicolumn{1}{c}{\textbf{ESE}} & \multicolumn{1}{c}{\textbf{Mean}} & \multicolumn{1}{c@{}}{$\overline{\mbox{\textbf{RSE}}}$} & \multicolumn{1}{c@{}}{\textbf{ESE}} \\ \hline $c_0=d_0=15$ & & & & & & \\ $\beta_0$ & 3\ta 841 & 0\ta 133 & 0\ta 156 & 4\ta 790& 0\ta 383 & 0\ta 388 \\ $\beta_1$ & -0\ta 018 & 0\ta 003 & 0\ta 004 & -0\ta 033 & 0\ta 007 & 0\ta 007 \\ $\beta_2$ & -0\ta 211 & 0\ta 052 & 0\ta 056 & -0\ta 427 & 0\ta 107 & 0\ta 108 \\ $\gamma$ & 5\ta 231 & 0\ta 391 & 0\ta 470 & 4\ta 048 &0\ta 341 & 0\ta 392 \\ $\pi_1$ & 0\ta 244 & 0\ta 030 & 0\ta 028 & 0\ta 252 &0\ta 032 & 0\ta 037 \\ $\pi_2$ & 0\ta 132 & 0\ta 030 & 0\ta 029 & 0\ta 156 &0\ta 035 & 0\ta 035 \\ $\pi_3$ & 0\ta 169 & 0\ta 032 & 0\ta 033 & 0\ta 193 &0\ta 037 & 0\ta 038 \\ $\pi_4$ & 0\ta 214 & 0\ta 036 & 0\ta 038 & 0\ta 244 &0\ta 041 & 0\ta 043 \\[3pt] $c_0=d_0=20$ & & & & & & \\ $\beta_0$ & 4\ta 224 & 0\ta 100 & 0\ta 112 & 4\ta 654& 0\ta 158 & 0\ta 174 \\ $\beta_1$ & -0\ta 023 & 0\ta 002 & 0\ta 003 & -0\ta 031 & 0\ta 003 & 0\ta 004 \\ $\beta_2$ & -0\ta 290 & 0\ta 039 & 0\ta 041 & -0\ta 417 & 0\ta 059 & 0\ta 062 \\ $\gamma$ & 4\ta 565 & 0\ta 227 & 0\ta 253 & 4\ta 020 &0\ta 212 & 0\ta 230 \\ $\pi_1$ & 0\ta 199 & 0\ta 018 & 0\ta 018 & 0\ta 196 &0\ta 019 & 0\ta 019 \\ $\pi_2$ & 0\ta 146 & 0\ta 019 & 0\ta 019 & 0\ta 153 &0\ta 020 & 0\ta 020 \\ $\pi_3$ & 0\ta 184 & 0\ta 020 & 0\ta 020 & 0\ta 194 &0\ta 022 & 0\ta 022 \\ $\pi_4$ & 0\ta 230 & 0\ta 023 & 0\ta 023 & 0\ta 247 &0\ta 024 & 0\ta 025 \\[3pt] $c_0=d_0=30$ & & & & & & \\ $\beta_0$ & 4\ta 527 & 0\ta 051 & 0\ta 048 & 4\ta 603& 0\ta 056 & 0\ta 054 \\ $\beta_1$ & -0\ta 028 & 0\ta 001 & 0\ta 001 & -0\ta 030 & 0\ta 002 & 0\ta 001 \\ $\beta_2$ & -0\ta 374 & 0\ta 023 & 0\ta 023 & -0\ta 402 & 0\ta 025 & 0\ta 025 \\ $\gamma$ & 4\ta 114 & 0\ta 112 & 0\ta 111 & 4\ta 013 &0\ta 109 & 0\ta 112 \\ $\pi_1$ & 0\ta 151 & 0\ta 009 & 0\ta 010 & 0\ta 150 &0\ta 009 & 0\ta 010 \\ $\pi_2$ & 0\ta 152 & 0\ta 010 & 0\ta 010 & 0\ta 152 &0\ta 010 & 0\ta 011 \\ $\pi_3$ & 0\ta 197 & 0\ta 011 & 0\ta 011 & 0\ta 199 &0\ta 011 & 0\ta 011 \\ $\pi_4$ & 0\ta 245 & 0\ta 012 & 0\ta 013 & 0\ta 249 &0\ta 013 & 0\ta 013 \\ \hline \end{tabular*} \tabnotetext[]{}{Mean, average of the estimate; $\overline{\mbox{SE}}$, average of the estimated standard error; ESE, empirical standard error; $\overline{\mbox {RSE}}$, average of the estimated robust standard error.} \end{table} To explore the impact of misspecification due to the incorrect partitioning of $\nu$, we again repeated the simulation study but now allowing the truncation times to be generated from an eight-component mixture of uniform conditional distribution, with $\nu=(0, 0\ta 125,\ldots, 0\ta 875, 1)^T$ and $\pi' = (0 \ta 025, 0\ta 05, 0\ta 1, 0\ta 1, 0\ta 125, 0\ta 15, 0\ta 2, 0\ta 25)^T$, mimicking a strong preference for referrals to occur in the last half of individuals' incubation period. Additionally, we considered three scenarios for recruitment and administrative censoring, which reflected an increasing number of individuals referred and observed experiencing the event of interest and thus providing more information to the analysis: (i) $c_0=d_0=15$; (ii) $c_0=d_0=20$; and (iii) $c_0=d_0=30$. We fitted the simulated data sets assuming the working five-component conditional truncation time distribution mentioned earlier, which is based on a \textit{coarser} partitioning of $\nu$ than the true generating mechanism. The results are shown in Table~\ref{tab3}. Here, we see a noticeable negative impact of misspecification, from a cruder partitioning of $\nu$, on the estimates of the regression parameters and shape parameter (and mixture probabilities) when using the full likelihood approach (i.e., bias), which diminishes as the amount of information from the sample increases (as reflected by the diminishing standard errors). There is, however, no noticeable bias observed in the estimates of the regression parameters and shape parameter obtained using the hybrid approach. Moreover, there is no apparent bias, under this hybrid approach, in the mixture probabilities, except for $\pi_1$, where the bias decreases as the information content increases. This result suggests that the hybrid approach is significantly more robust to misspecification than the full likelihood approach under various data scenarios, but at the cost of being less efficient in general. This perhaps is due to the hybrid approach being a two-stage method. \subsection{Application to Edinburgh Royal Infirmary's hepatitis C virus liver clinic}\label{sec3.4} The hepatitis C virus epidemic is a major public health concern in the UK and across the world. To project national hepatitis C virus burden, unbiased estimation of the progression rate from infection to liver cirrhosis is required for the whole community of hepatitis C viral infected individuals. Often, however, the available data on progression to cirrhosis are from a biased sample of the population of interest. In the application we consider here, the data on $387$ individuals infected with the hepatitis C virus prior to 2000 (i.e., within the calendar period 1950 to 2000) arose from the Edinburgh Royal Infirmary's hepatitis C virus liver clinic, a tertiary referral hospital clinic whereby patients with more rapid disease progression, or symptomatic disease, would be preferentially referred, with referral increasingly likely to be closer to onset of cirrhosis. Thus, it is important to account for this outcome-dependent recruitment when analyzing these data so as to provide realistic estimates of the progression rates and the effects of risk factors on time to cirrhosis from infection for the Edinburgh's community (of unknown size) of hepatitis C virus-infected individuals. To investigate the pattern of referral over patients' cirrhosis incubation period, we model the referral time $R$ given the cirrhosis time $T$ as coming from the probability density function \begin{eqnarray*} f_{R \mid T}(r \mid t) &=& \sum_{j=0}^1 \frac{4\pi_j}{t}I\biggl(\frac{j}{4} < \frac{r}{t} \leq \frac{j+1}{4}\biggr) + \sum_{j=2}^5 \frac{8\pi_j}{t}I\biggl(\frac{j+2}{8} < \frac{r}{t} \leq \frac{j+3}{8}\biggr), \end{eqnarray*} where $\{\pi_j\dvtx j=0,\ldots,5 \}$ are the unknown mixture probabilities, summing to $1$, that are required to be estimated. This distribution is chosen because of the clinical belief that patients are more likely to be referred in the last half of their cirrhosis incubation period and we therefore decided to model this half in more detail. Furthermore, we assume that, for the $i$th hepatitis C virus patient in the community, the time to cirrhosis from known infection time follows a Weibull distribution with unknown shape and scale parameters, $\gamma$ and $\lambda_i$, respectively. The scale parameter, $\lambda_i$, is related to the $i$th patient's continuous and binary explanatory variables, age at hepatitis C viral infection ($x_{1i}$) and excessive alcohol consumption ($x_{2i}$), through the relationship $\log\lambda_i=\beta_0+\beta_1x_{1i}+\beta _2x_{2i}$, where $\beta^T=(\beta_0,\beta_1,\beta_2)$ is the vector of regression parameters. \begin{table} \tabcolsep=0pt \caption{Full and hybrid pseudo score/profile likelihood results for time to cirrhosis from hepatitis C virus (HCV) infection data from Edinburgh Royal Infirmary's liver clinic prior to 2000}\label{tab4} \begin{tabular*}{\tablewidth}{@{\extracolsep{\fill}}ld{2.3}d{1.3}d{2.3}d{1.3}d{1.3}@{}} \hline & \multicolumn{2}{c}{} & \multicolumn{3}{c@{}}{\textbf{Hybrid pseudo score/}}\\ & \multicolumn{2}{c}{\textbf{Full likelihood}} & \multicolumn{3}{c@{}}{\textbf{profile likelihood}}\\[-6pt] & \multicolumn{2}{c}{\hrulefill} & \multicolumn{3}{c@{}}{\hrulefill} \\ \textbf{Parameters} & \multicolumn{1}{c}{\textbf{Estimate}} & \multicolumn{1}{c}{\textbf{s.e.}} & \multicolumn{1}{c}{\textbf{Estimate}} & \multicolumn{1}{c}{\textbf{Robust s.e.}} & \multicolumn{1}{c@{}}{\textbf{Bootstrap s.e.}} \\ \hline $\beta_0$ & 4\ta 410 & 0\ta 123 & 4\ta 380 & 0\ta 174& 0\ta 181\\ $\beta_1$ & -0\ta 022 & 0\ta 004 & -0\ta 023 & 0\ta 004 & 0\ta 004\\ $\beta_2$ & -0\ta 521 & 0\ta 082 & -0\ta 494 & 0\ta 109 & 0\ta 111\\ $\gamma$ & 4\ta 948 & 0\ta 408 & 5\ta 256 & 0\ta 441 &0\ta 467\\ $\pi_1$ & 0\ta 096 & 0\ta 020 & 0\ta 093 & 0\ta 014 &0\ta 015\\ $\pi_2$ & 0\ta 065 & 0\ta 055 & 0\ta 060 & 0\ta 050 &0\ta 046\\ $\pi_3$ & 0\ta 126 & 0\ta 076 & 0\ta 139 & 0\ta 070 &0\ta 065\\ $\pi_4$ & 0\ta 064 & 0\ta 036 & 0\ta 062 & 0\ta 035 &0\ta 036\\ $\pi_5$ & 0\ta 639 & 0\ta 055 & 0\ta 635 & 0\ta 051 &0\ta 041 \\[3pt] Log-likelihood & \multicolumn{2}{c}{$-$1259.78} \\ N (bootstrap IQR) & & & \multicolumn{1}{c}{4196} & \multicolumn{1}{c}{(3414--5139)} \\ \hline \end{tabular*} \tabnotetext[]{}{s.e., standard error; N, estimated size of Edinburgh's hepatitis C virus community prior to 2000; IQR, inter-quartile range; $\beta_1$ and $\beta_2$, regression coefficients corresponding to age at HCV infection and excessive alcohol consumption status.} \end{table} Table~\ref{tab4} shows the results obtained on fitting the Edinburgh Royal Infirmary data using both the full likelihood and hybrid pseudo score/profile likelihood approaches. The bootstrap standard errors are obtained from a bootstrap sample of $500$. Relatively similar regression parameter estimates and corresponding estimated standard errors are obtained from the two approaches. The belief by clinicians that referral was more likely in the last half of the cirrhosis period is borne out with about $90\%$ of infected individuals estimated to be referred then. Strikingly, about $64\%$ of infected individuals are estimated to have been referred in the last one eighth of their cirrhosis period. On repeating the analysis with a cruder representation of the referral mechanism based on partitioning $\nu$ only into halves produced fairly similar regression estimates under both approaches (data not shown) to those in Table~\ref{tab4}. However, for the more variable Weibull shape parameter, there are noticeable differences in the estimates from this cruder referral mechanism to those previously obtained, in particular, for the full likelihood approach. The estimates (with standard errors) of the shape parameter are now 3\ta 833 (0\ta 360) and 4\ta 755 (0\ta 400) for the full likelihood and hybrid approaches, respectively. Additionally, the estimates of the probability of being referred in the last half of the incubation period, obtained assuming the cruder referral mechanism, are roughly equal under the two approaches but now calculated to be approximately $98\%$ as opposed to the $90\%$ previously estimated.\looseness=1 From the hybrid method, we obtain an estimate (bootstrap inter-quartile range) of 4196 (3414--5139) infected individuals in Edinburgh's hepatitis C virus community prior to 2000, through the summation of the inverse probability weights. Both older age at onset of infection and excessive alcohol consumption are found statistically significantly to increase the rate of progression to cirrhosis. The corresponding relative risk estimates (with 95\% confidence intervals) for age at infection onset and for excessive alcohol consumption are 1\ta 13 (1\ta 09, 1\ta 18) and 13\ta 4 (5\ta 1, 35\ta 3), respectively. The (inverse probability weighted) estimates of the mean age at HCV infection (with standard deviation) and the proportion consuming excessive alcohol in the Edinburgh HCV community prior to 2000 are 20\ta 3 (6\ta 3) years and 6\ta 7\%, respectively. For comparison, the mean age at HCV infection (with standard deviation) and the proportion consuming excessive alcohol from the Edinburgh Royal Infirmary clinic data are 22\ta 4 (9\ta 8) years and 30\%, respectively. There is a striking difference in the community's and clinic's estimates of the proportion consuming excessive alcohol. An estimated marginal 30-year progression rate (with sampling uncertainty) to cirrhosis from infection in the Edinburgh HCV community can also be calculated through a fast parametric bootstrap-like approach [\citet{AalenFarewell1997}]. Here we repeatedly sample $\theta^T=(\gamma,\beta^T,\pi^T)$ from the asymptotic distribution of $\tilde{\theta}$, specified by a multivariate normal distribution with mean vector and variance--covariance matrix given by $\tilde {\theta}$ and the robust sandwich matrix, $\Sigma\Lambda\Sigma^T$ evaluated at ${\tilde{\theta}}$. For each of these sampled parameter vectors, we define a corresponding hypothetical Edinburgh HCV community (prior to 2000) that can be entirely followed up to cirrhosis. The size, mean and standard deviation of the age at HCV infection and the excessive alcohol consumption proportion for each of these hypothetical communities are calculated by applying the inverse probability weights, calculated using the sampled $\theta$'s, to the Edinburgh Royal Infirmary data. The communities' cirrhosis data can be constructed by generating the times to cirrhosis from the proposed Weibull model using the sampled regression and shape parameters, after first simulating the explanatory variables, age at HCV infection and alcohol consumption status, for the created communities. We assume that the age at HCV infection and alcohol consumption status distributions are independent from one another and are log-normal and Bernoulli, respectively, with mean and standard deviation (for the log normal) and excessive alcohol consumption proportion parameters arising from the application of the sampled $\theta$, through the generated inverse probability weights, to the Edinburgh Royal Infirmary data. Our assumption of marginal independence is based on an estimated Pearson's correlation between age at HCV infection and excessive alcohol consumption status of 0\ta 012 in the actual collected data, which we do not anticipate to change dramatically when translated to the community. The application of this fast parametric bootstrap-like approach, over 500 runs, gave a mean 30-year progression rate to cirrhosis in the hypothetical communities of 14\% with a standard deviation of 6\% and a 95\% range of 6\% to 29\%. Figure~\ref{fig2} provides an example of a marginal Kaplan--Meier curve for one hypothetical Edinburgh community generated at the maximum weighted pseudo score estimates. \begin{figure} \includegraphics{725f02.eps} \caption{Marginal Kaplan--Meier curves for hypothetical Edinburgh HCV communities derived under the assumption that the time-to-cirrhosis distribution is either Weibull (solid line) or generalized gamma (dashed line). The vertical dotted lines correspond to time from infection of $30$ years and the last observed time in the Edinburgh liver clinic data of $42.4$ years, which corresponds to an (uncensored) cirrhotic event.}\vspace*{-2pt}\label{fig2} \end{figure} The estimated 30-year Kaplan--Meier progression rate (with 95\% confidence interval) to cirrhosis based on the actual Edinburgh Royal Infirmary data, ignoring the outcome-dependent referral and left truncation, is 42\% (31\%, 52\%). The corresponding conditional Kaplan--Meier estimate (conditioning on not experiencing cirrhosis at least roughly 1 year after infection), assuming that the Edinburgh Royal Infirmary data is a length-biased sample of the Edinburgh HCV community, is 86\% with a 95\% confidence interval of (75\%, 92\%). Both of these standard estimates dramatically overestimate the 30-year progression rate, as they do not account for the correlation between the referral time and the time to cirrhosis of a referred patient. To check the robustness of our findings for the Edinburgh data, we implemented our two approaches replacing the assumption of a Weibull time-to-event distribution with the generalized gamma distribution (see the supplementary material [\citet{supp}] for its formulation), which has one extra parameter and includes the Weibull, gamma and log-normal all as special cases. Although a likelihood ratio test on 1 degree of freedom ($p=0.02$) rejected the Weibull in favor of the generalized gamma, the maximum likelihood estimates for the regression parameters of interest were similar to those previously obtained ($\hat{\beta}_1=-0.021$ and $\hat{\beta }_2=-0.546$) and the estimate of the proportion of infected individuals referred to in the last one eighth of their cirrhosis period was again $64\%$. Furthermore, the estimated mean 30-year progression rate to cirrhosis was similar. On closer inspection, we found that the differences between the assumption of a generalized gamma and that of a Weibull for the time-to-event distribution was noticeable only in the upper tails of the estimated marginal time-to-event distributions of the Edinburgh HCV community, past the actual largest observed time to cirrhosis (i.e., an uncensored event of $42.4$ years) seen from the Edinburgh Royal Infirmary's liver clinic. Similar to the marginal Kaplan--Meier curve presented under the assumption that the time-to-event distribution is Weibull, Figure~\ref{fig2} also displays the equivalent Kaplan--Meier curve under the assumption of the generalized gamma, and thus provides an illustration of the discrepancy between curves being evident in the upper tail beyond $42.4$ years. \section{Discussion}\label{sec4}\label{discuss} A weighted pseudo score method is commonly suggested for handling response-biased observations, where specifying the full likelihood is difficult. Provided that the inverse probability weights can be consistently estimated, then consistency of regression parameter estimates will be achieved using this approach. However, if the full likelihood is available, then it is generally preferable to use it to estimate the parameters of interest, as these estimates will be more efficient than those obtained from the weighted pseudo score method. This preference for the full likelihood over the weighted pseudo score method also holds when the time-to-event distribution is misspecified. In the context of misspecification, we would advocate fitting the more flexible generalized gamma time-to-event distribution (or an alternative such as a semi-parametric piecewise exponential-type distribution), instead of the Weibull, in order to get better estimates of the marginal progression rates. Nevertheless, it is worth noting that a by-product of the weighted pseudo score approach, which makes it appealing, is the straightforward estimation of the total incident population size. This is not directly available (although calculable) from the full likelihood approach. In public health terms, estimation of the total number of HCV carriers and the ``true'' impact of covariates on HCV progression are key. In the informative entry time problem addressed here, we were able to develop both a full likelihood approach and a hybrid two-stage pseudo score/profile likelihood approach for outcome-dependent referral where sampling is dependent on the residual fraction of time remaining to develop the event. Under correct specification of the referral mechanism, we found that the full likelihood approach was indeed more efficient than the hybrid approach in the estimation of the regression parameters of interest and the shape parameter. The former approach, however, appeared to be more susceptible to bias if the outcome-dependent referral mechanism was misspecified through a coarser representation and the ``information content'' of the data (in terms of number of referrals, number of events and length of follow-up) was low. In the situation where the ``information content'' is considered to be relatively high, it perhaps would be more appealing to adopt the hybrid method over the full likelihood approach, as it could be significantly more robust and the decrease in the resulting efficiency may still be acceptable. In general, we would recommend that when using either approach, and, in particular, the full likelihood one, analysts should begin by specifying a reasonably fine partitioning of the $\nu$ which can then be refined to obtain a more parsimonious representation of the referral mechanism. This strategy would allow checking for sensitivity/robustness to misspecification of the referral mechanism. However, convergence issues may arise if the partitioning is too fine or if the selection probability for a subject is too small. We have not investigated these convergence issues here. The application of these methods to data from the Edinburgh Royal Infirmary's hepatitis C virus liver clinic allowed us to characterize realistically the extent of Edinburgh's HCV epidemic prior to 2000 in terms of progression rate to cirrhosis and the impact of alcohol consumption and age at HCV infection on this progression. Standard survival analysis methods severely overestimated the 30-year progression rate and underestimated the relative risks for the explanatory variables. In our present analysis of the Edinburgh HCV data, we assumed that the time of infection was known. This simplifying assumption was thought reasonable in our case, since even when the times of HCV infection in the Edinburgh liver clinic were uncertain, this uncertainty tended to be only in the determination of the exact date of infection within a calendar year or two. As the mean incubation period to cirrhosis is several orders of magnitude greater than the size of this interval, we expect that, for the analysis of our data set, the added uncertainty in estimation due to this imprecision in timing of infection will be inconsequential. However, in other applications where the timing of the initiation event (e.g., cancer or HIV infection onset) is known only to within an interval, which may be quite large, and where either the mean time to the event of interest (e.g., death or AIDS) or the mean follow-up time are not of an appreciably long enough length compared to the mean width\vadjust{\goodbreak} of these intervals, the implications for analyses of assuming-known initiation time (e.g., by choosing the mid-point of the interval) can be major. \citet{StruthersFarewell1989} discuss an approach to account for unknown onset times, when the time of onset is known only to be in an interval, say, $(a,b)$. This approach requires the specification of a density, say, $g$, for the time of infection (e.g., a uniform distribution) over the interval $(a,b)$. The likelihood to be optimized over the parameters then takes the form $\prod_{i=1}^{n}\int_{a_i}^{b_i}L_i(\theta)g_i(y;\tau)\,dy$, where $L_i(\theta)$ is the likelihood contribution from the $i$th subject, given known infection time, and the density, $g_i(\cdot)$, for this subject's time of infection may be specified up to an unknown parameter vector, $\tau$. Therefore, it can be seen that this approach can be adapted to our situation where the sampling is dependent on the residual fraction of time left to developing the event of interest and the onset time is known only to within an interval. However, careful thought is required on the most appropriate form for $g$. For example, in HCV studies where the majority of subjects are injecting drug users and when time of HCV infection is unknown, there is evidence to suggest that infection occurs earlier in a subject's injecting career [\citet {Hutchinson2005}, \citet{Hagan2008}, \citet{Deangelis2009}]. Future application of these methods to the HCV epidemic in Scotland, more generally, is planned with Health Protection Scotland. Health Protection Scotland has developed a clinical database on referrals of HCV patients to liver clinics across all regions of Scotland. Application of our methodology should provide regional estimates for the number of HCV carriers in Scotland and will allow us to examine if the ``true'' impact of covariates (such as age at HCV infection and heavy alcohol use) are stable across regions although the covariate distribution may differ between regions.\vspace*{-1pt} \section*{Acknowledgments} We would like to acknowledge the anonymous referees and Editor for their insightful comments and suggestions which have helped improve the paper.\vspace*{-2pt} \begin{supplement \stitle{Appendix: Derivations of the expressions based on the generalized gamma and mixture of uniforms} \slink[doi]{10.1214/14-AOAS725SUPP \sdatatype{.pdf} \sfilename{AOAS725\_supp.pdf} \sdescription{Proofs of the various expressions required in the constructing of the likelihood and pseudo score based on the assumption that the time-to-event distribution is from a generalized gamma distribution and the conditional referral distribution is a mixture of independent uniforms.} \end{supplement}
{'timestamp': '2014-08-01T02:08:49', 'yymm': '1407', 'arxiv_id': '1407.8374', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8374'}
arxiv
\subsection{Intel Sandy Bridge Architecture} The SpMV performance measurements were conducted on Intel Sandy Bridge, a multi-core, non-uniform memory access architecture. The Sandy Bridge memory hierarchy has two levels of on-core cache (L1D and L2), a shared on-chip L3 cache, and shared off-chip DRAM, as shown in Figure~\ref{fig:SandyBridge}. This architecture has a memory prefetcher, which preemptively loads data into the L2 cache from the L3 cache (or from DRAM, if the data is not found in L3) to speed up future access to this data. If the link to DRAM is too congested with demand requests from the SpMV kernel, the prefetcher will not turn on~\cite{IntelOpt}. \begin{figure}[htb] \centering \includegraphics[scale=0.47]{SandyBr.pdf} \caption{Sandy Bridge Architecture.} \label{fig:SandyBridge} \end{figure} This architecture is commonly found in laptop, desktop, workstation and server computers. Sandy Bridge processors are also used in Amazon's Elastic Compute Cloud and Google's Compute Engine. The Intel Sandy Bridge architecture was selected because of its widespread use, its multi-core processor, and the availability of tools to access various hardware counters in the processor for tracking data such as cache hits and instruction counts. For this study, performance data was obtained on a Sandy Bridge system containing two Intel Xeon E5-2690 processors running at 2.9 GHz, with 32 GB of shared DRAM for each processor. Each processor has 20MB of on-chip shared L3 cache and contains 8 cores. Each core has 32KB of on-core L1D cache and 256 KB of on-core L2 cache~\cite{IntelXeon}. \section{Background} \label{sec:background} \input{matrices} \input{architecture} \input{cache} \subsection{Cache Utility} The performance of SpMV depends greatly on the architecture's ability to utilize cache efficiently. The multiplication operation uses three data structures that must be stored in memory: a matrix, an input vector ($\vec{x}$), and a vector for the solution. When the problem size is small enough that all three data structures fit in cache, every memory request is satisfied on-chip (cache hit). When the problem size is large, the processors must access DRAM to obtain data that has not yet been pulled into cache. Accesses to DRAM are far more costly than accesses to cache and hinder performance. The matrices tested have sizes ranging from $8\times2^{11} = 16,384$ nonzeros to $9\times2^{26} = 603,979,776$ nonzeros.\footnote{The R-MAT matrix sizes range from $2^{11}$ to $2^{26}$ rows, times 8 nonzeros per row. The FD matrices have the same range of rows, times 9 nonzeros per row.} The smallest problems fit entirely in the L2 cache, while the largest barely fit in DRAM. Table~\ref{table:cacheSizes} shows the maximum number of nonzeros a matrix may have and still fit within each cache level. \begin{table}[htb] \centering \renewcommand{\arraystretch}{1.2} \begin{tabular}{|r|c|r||r|r|r|} \cline{2-5} \multicolumn{1}{r|}{} & Level & Size & FD & R-MAT \\ \hline \multirow{2}{*}{Serial} & L2 & 256KB & 18,432 & 18,078 \\ & L3 & 20MB & 1,474,560 & 1,446,311 \\ \hline \multirow{2}{*}{Parallel} & L2 & 4MB & 294,912 & 289,262 \\ & L3 & 40MB & 2,949,120 & 2,892,623 \\ \hline \end{tabular} \caption{Maximum number of nonzeros a matrix can contain, such that the problem fits in the given cache level. Data shown for serial execution (1 thread, 1 L2 cache, 1 L3 cache) and parallel execution (16 threads, 16 L2 caches, 2 L3 caches).} \label{table:cacheSizes} \end{table} For both FD and R-MAT matrices, the CSR matrix data is straightforward for the system architecture to load. The elements of all three arrays of the CSR format are stored and accessed sequentially, allowing each memory request to retrieve an entire cache line of useful data. This spatial locality enables the L2 prefetcher to anticipate data needs correctly and retrieve useful data from lower memory in advance. The challenge arises when accessing the elements of $\vec{x}$. Caching data from $\vec{x}$ is much easier for matrix-vector multiplication on structured matrices than on unstructured matrices. First, consider the ideal case of a dense matrix. In dense matrix-vector multiplication, elements of $\vec{x}$ are accessed sequentially (since every element in each row is treated as a nonzero), so portions of $\vec{x}$ can be fetched into the cache in advance for efficient access. The pattern of accesses to $\vec{x}$ is not so simple for SpMV with sparse matrices. \begin{figure}[htb] \centering \begin{tabular}{cm{.11in}c} \begin{tikzpicture}[baseline=(current bounding box.east)] \matrix[matrix of math nodes,inner sep=0pt,row sep=.7em,column sep=.7em, left delimiter=[,right delimiter={]}, outer sep=1pt] (M) { 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 &\\ 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 &\\ 0 & {\bf \color{red}A} & {\bf \color{red}A} & {\bf \color{red}A} & 0 & 0 & 0 & 0 & \\ 0 & 0 & 1 & 1 & 1 & 0 & 0 & 0 & \cdots \\ 0 & 0 & 0 & 1 & 1 & {\bf \color{blue}B} & 0 & 0 & \\ 0 & 0 & 0 & 0 & 1 & {\bf \color{blue}B} & 1 & 0 &\\ 0 & 0 & 0 & 0 & 0 & {\bf \color{blue}B} & 1 & 1 &\\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & \\ & & & \raisebox{.5em}[1.4em][\depth]{\vdots} & & & & & \raisebox{.5em}[1.4em][\depth]{$\ddots$}\\ } ; \draw[->] (M-3-2.east) -- (M-3-3.west); \draw[->] (M-3-3.east) -- (M-3-4.west); \draw[->] (M-5-6.south west) -- (M-6-5.north east); \draw[->] (M-6-5.east) -- (M-6-6.west); \draw[->] (M-6-6.east) -- (M-6-7.west); \draw[->] (M-6-7.south west) -- (M-7-6.north east); \end{tikzpicture} & \begin{tikzpicture} $\times$ \end{tikzpicture} & \begin{tikzpicture}[baseline=(current bounding box.east)] \matrix[matrix of math nodes,inner sep=0pt,row sep=.7em,column sep=.9em, left delimiter=[,right delimiter={]}, outer sep=1pt] (X) { 1\\ {\bf \color{red}A}\\ {\bf \color{red}A}\\ {\bf \color{red}A}\\ 1\\ {\bf \color{blue}B}\\ 1\\ 1\\ \raisebox{.5em}[1.4em][\depth]{\vdots}\\ } ; \end{tikzpicture} \\ Finite difference matrix && $\vec{x}$ \end{tabular} \caption{Part of an FD matrix is multiplied by an input vector $\vec{x}$, showing how the pattern of nonzeros in the matrix determines sequential accesses (red As) and repeated accesses (blue Bs) to the elements in $\vec{x}$. FD matrices have three diagonal bands of three nonzeros each. One of the bands is shown here.} \label{fig:MatrixExample} \end{figure} For FD matrices, accesses to elements of $\vec{x}$ have strong spatial and temporal locality. In a given row, there are three sets of three adjacent nonzero elements. For each set, the SpMV kernel requires three adjacent elements of $\vec{x}$, as shown in Figure~\ref{fig:MatrixExample} by red letter As. This sequential access pattern allows the prefetcher to anticipate the needs of the kernel successfully and load the appropriate elements of $\vec{x}$ into the L2 cache. Since memory accesses are performed in units of a cache line, additional elements of $\vec{x}$ are loaded and will be in cache when needed. Accesses to $\vec{x}$ also exhibit temporal locality: after an element of $\vec{x}$ is used the first time, it gets used again during the multiplications of the next two rows of the matrix, since they have nonzeros in the same column (see Figure~\ref{fig:MatrixExample}, blue letter Bs). Even if the kernel were to miss in cache for the first usage of an element of $\vec{x}$, it would hit for the next two uses immediately after. These properties of FD matrix structure and the resultant accesses to $\vec{x}$ allow the SpMV kernel to use cache effectively. For R-MAT matrices, the lack of structure forces the SpMV kernel to access elements of $\vec{x}$ at random. Without spatial or temporal locality in accesses to $\vec{x}$, the prefetcher fails to predict data needs; therefore, useful data is rarely found in cache. This forces the SpMV kernel to make many more demand requests to DRAM, slowing the computation and damaging performance. \section{Conclusions} \label{sec:conclusion} Matrix structure plays a strong role in the performance of the SpMV kernel. Structured matrices allow the SpMV kernel to take advantage of prefetching and caches to achieve good performance. Unstructured matrices, however, inhibit the utilization of these architectural features and cause performance to suffer. For FD matrices, the regular matrix structure leads to a regular data access pattern that is easy for the architecture to handle. This leads to low L2 and L3 cache miss rates, high prefetcher effectiveness, and low L2 Stall Cycles. The result is high GFLOPS, which shows high performance of the SpMV kernel with FD matrices. For R-MAT matrices, the random matrix structure creates an irregular data access pattern, which is difficult for the architecture to anticipate. Even though the matrix itself is stored in a structured format (like the FD matrices), the erratic accesses to $\vec{x}$ cause high L2 and L3 cache miss rates, prefetcher failure, and high L2 Stall Cycles. The result is low GFLOPS, which shows low performance of the SpMV kernel. More specifically, the performance in GFLOPS of the SpMV kernel with large R-MAT matrices is only 20\% of the GFLOPS SpMV achieves with large FD matrices. There are several potential solutions to mitigate the problem of poor SpMV performance on unstructured, sparse matrices. One possibility is to bypass the L3 cache for larger problems. As the L2 and L3 miss rates show, the L3 cache rarely contains data useful to the SpMV kernel, even in the case of FD matrices, so performance would be improved by not accessing the L3 cache at all. This would save power and time on standard hardware, and potentially save chip space on specialized hardware. The prefetcher would also perform better if it were exclusively fetching matrix data, since it is stored in a dense format, rather than also fetching portions of $\vec{x}$. In conjunction with this more refined prefetcher activity, most of the cache could be used to store the values from $\vec{x}$ (rather than extra matrix data, which the prefetcher could retrieve easily). A more sophisticated improvement to the prefetcher would be to give it a more intelligent strategy to predict data requirements. The prefetcher is able to anticipate memory accesses that are sequential, but is currently unable to predict non-sequential data needs. If the prefetcher were able to predict the non-sequential data, the structure of the matrix would not matter. In general, these improvements would require allowing the kernel more control over the architecture and tailoring the architecture usage for the particular problem of performing SpMV on unstructured, sparse matrices. \subsection{Datasets} We analyze the SpMV kernel for two types of matrices: one somewhat structured and one highly unstructured. Structured matrices allow the SpMV kernel to make better use of the cache structure. Unstructured matrices, however, result in the SpMV kernel making many cache misses and generally not using cache to speed up computation. For a baseline to compare peformance too, dense matrices are also included. FD matrices are used to represent somewhat structured matrices. These matrices are generated using two-dimensional finite difference method. The resultant matrices consist of three diagonal bands of three elements each, which means that FD matrices have nine elements per row. To respresent unstructured matrices, R-MAT matrices~\cite{rmat} are used. R-MAT matrices are constructed to approximate realistic network models using a powr law distribution. This distribution naturally creates a skew in the distribution of nonzeros, leading to difficulties in effective load balancing to allow easy comparison to SpMV performance on FD matrices. To counteract this, the rows and columns of the R-MAT matrices are randomly permuted. This does not impact the problem represented by the matrix, but allows a uniform block distribution to easily split data across processors. All sparse matrices are stored in the compressed sparse row (CSR) format. The CSR format is analagous to the compresses sparse column format~\cite{1973sparse} with entries stored by row rather than column. The CSR format consists of three arrays with values stored sequentially. The total number of elements within these arrays for a matrix with $n$ rows and $m$ nonzeros is $2m+n+1$. The total amount of memory required to store all the values used by the SpMV kernel is called the problem size. The values required are the three arrays from the CSR representation of the matrix, the array to store the vector the matrix is being multiplied by (called $\vec{x}$) and the array storing the result of the multiplication. \begin{figure}[htb] \centering \begin{tabular}{|r|r||r|r|r|} \hline Level & Size & FD9 & RMAT \\ \hline L2 & 256KB & 18,432 & 18,078 \\ L3 & 20MB & 1,474,560 & 1,446,311 \\ \hline $16\times$L2 & 4MB & 294,912 & 289,262 \\ $2\times$L3 & 40MB & 2,949,120 & 2,892,623 \\ \hline \end{tabular} \caption{Maximum number of nonzeros for matrices that fit in each cache level for singular caches and all availible caches.} \label{fig:cacheSizes} \end{figure} The matrices tested have sizes ranging from $8*2^{11} = 16384$ nonzeros to $9*2^{26} = 603,979,776$ nonzeros. The problems range from being small enough to fit within L2 cache to barely fitting inside DRAM. Figure~\ref{fig:cacheSizes} shows the maximum NNZ a matrix of each type may have and still fit within each cache level. For both FD and R-MAT matrices, the CSR matrix data is very easy for the system architecture to load. The elements of all three arrays are stored and accessed sequantially, allowing each memory request to retreive an entire cache line of useful data. Additionally, if active, the prefetcher will be able to predict what data will be needed and retreive it. For FD matrices, $\vec{x}$ exhibits similar behavior. The three diagonals of three elements each causes the SpMV kernel to require sequantial access to the elements of $\vec{x}$. Additionally, the kernel uses each of the elements twice nearly immediately following the first use. These two properties allow the SpMV kernel to make effective use of cache, and allow the prefetcher to successfully anticipate the needs of the kernel. The R-MAT matrices, however, cause the SpMV kernel to require random elements of $\vec{x}$. The random pattern causes the prefetcher to fail to get required data, and causes cache lines to contain mostly useless information. These two impediments result in the SpMV kernel making many more requests to DRAM and greatly slowing the computation. \subsection{GFLOPS} \label{sec:gflops} \begin{figure*}[t] \centering \begin{subfigure}[b]{.98\columnwidth} \centering \includegraphics[width=1\textwidth]{GFLOPS_FD.pdf} \caption{Performance in GFLOPS for FD matrices.} \label{fig:gflopsFD9} \end{subfigure} \hspace{\columnsep} \begin{subfigure}[b]{.98\columnwidth} \centering \includegraphics[width=1\textwidth]{GFLOPS_RMAT.pdf} \caption{Performance in GFLOPS for R-MAT matrices.} \label{fig:gflopsRMAT} \end{subfigure} \caption{Performance in GFLOPS for the SpMV kernel across matrix size for 1, 2, 4, 8, and 16 threads.} \label{fig:gflops} \end{figure*} Figure~\ref{fig:gflopsFD9} shows the performance in GFLOPS (Eq.~\ref{eq:GFLOPS}) of the SpMV kernel on FD matrices. The data indicates that doubling the number of threads approximately doubles the GFLOPS. This shows that the SpMV kernel is able take advantage of the resources provided by additional threads. The performance in GFLOPS remains constant across the number of nonzeros, indicating that the SpMV kernel generally scales well with matrix size, with the exception of 16 threads. The behavior on 16 threads differs due to a bottleneck in DRAM accesses. The prefetcher causes a large amount of DRAM activity, which, although beneficial overall, slows demand requests and causes the SpMV kernel to stall. Similar to the FD matrices, the SpMV kernel with R-MAT matrices is able to utilize the resources provided by additional threads, as shown in Figure~\ref{fig:gflopsRMAT}. Unlike for FD matrices, increasing R-MAT matrix size causes GFLOPS to decline. In particular, when the problem size exceeds the capacity of the L3 cache, the SpMV kernel begins to be limited by a bottleneck in DRAM accesses, causing a performance drop. \section{Introduction} Unstructured, sparse matrices arise in many common applications such as network analysis, linear dynamical systems, Markov chains, and eigendecomposition. Performance of these applications depends on the efficiency of sparse linear algebra operations on matrices. Sparse matrix-vector multiplication (SpMV) is the foundation for many of these operations. For example, SpMV is an essential kernel in signal processing for graph application , where the computation of principal components (obtained through the use of eigensolvers) is a key step in finding anomalies in network data~\cite{spg}. In this and many other applications, SpMV dominates the runtime, so performance is limited by SpMV efficiency. In previous work, it was shown that the SpMV kernel performs one to three orders of magnitude worse in GOPS/Watt than its dense counterpart \cite{PAKCK_HPEC2013}. Dense matrix-vector multiplication is highly optimized and makes good use of modern architectural features~\cite{goto:2008}. Sparse matrix-vector multiplication (SpMV) with structured, sparse matrices benefits from many of the same features. For SpMV on unstructured, sparse matrices, however, irregularity of data access causes a high amount of traffic within the memory hierarchy. The architectural features of processors such as caches and prefetchers do not improve the performance of the SpMV kernel significantly for these matrices. This work quantifies the performance of the SpMV kernel for unstructured sparse matrices, using data on structured sparse matrices for comparison. In Section~\ref{sec:background}, the structure of the matrices and the architecture used are detailed, as well as the relationship between the two. Section~\ref{sec:methodology} explains how the data was collected and how it is used to measure the performance of various components of the architecture, the caches, and the prefetcher. Results are presented in Section~\ref{sec:results}. Finally, Section~\ref{sec:conclusion} discusses the implications of sparse matrix structure and proposes architectural innovations to improve SpMV performance. \subsection{SpMV} The sparse matrix-dense vector (SpMV) product is the workhorse kernel of sparse iterative methods for solving linear systems and eigenvalue problems (e.g., CG, GMRES, and Krylov-Schur based eigensolvers) and is often the key computational kernel in these methods, dominating the runtime. SpMV has been an essential kernel in the signal processing for graphs work undertaken at MIT Lincoln Laboratory, where the computation of principal components (obtained through the use of eigensolvers) is a key step in finding anomalies in network data~\cite{spg}. For our experiments with this sparse kernel, we used synthetically generated R-MAT matrices~\cite{rmat} that approximate the typical graphs present in many applications involving network data. R-MAT matrices approximate a power law degree distribution and are straightforward to scale across a range of problem sizes. \subsection{L2 Miss Rate} Figure~\ref{fig:L2MR} shows the L2 Miss Rate (Eq.~\ref{eq:L2MR}) of the SpMV kernel for FD and R-MAT matrices. For the FD matrices, the SpMV kernel maintains a low L2 Miss Rate of about 0.1 misses per thousand instructions across all matrix sizes. For the R-MAT matrices, as the problem size exceeds the capacity of the L2 cache, L2 Miss Rate increases dramatically, reaching a plateau around 26 misses per thousand instructions. This discrepancy is caused by the difference in structure between the two matrix types. The regular structure of the FD matrices results in some sequential accesses to $\vec{x}$ by the SpMV kernel and allows reuse of some data in the L2 cache. The consequence of this regular access pattern is that the needed data is regularly present in the L2 cache, producing a low (good) L2 Miss Rate. For R-MAT matrices, their unstructured composition generates random accesses to $\vec{x}$. These erratic accesses to $\vec{x}$ hinder the architecture's ability to keep relevant data in the L2 cache, causing a high (bad) L2 Miss Rate. The L2 Miss Rate differs little between the SpMV kernel running in serial and in parallel. Although running in parallel provides multiple L2 caches, the increased net capacity does not increase L2 cache capacity for any individual core. The performance of each core depends only on the data present within its own L2 cache, not on the data within the L2 caches of other cores. The performance of each core for a given matrix size, therefore, remains the same as in the serial case. The L2 Miss Rates level out when only a trivial portion of the problem fits in the L2 cache. For these large problem sizes, data accesses to elements of $\vec{x}$ by the SpMV kernel settle into a pattern of where the data is found. For FD matrices, the pattern is that the hardware prefetcher successfully anticipates data requirements and loads the correct data into the L2 cache. For R-MAT matrices, the prefetcher fails to predict data requirements (due do the random R-MAT structure), so the data access pattern is as follows: look for the data in the L2 cache, miss, and then retrieve the data from a more remote location in memory. \subsection{L2 Stall Cycles \& Prefetch Miss Rate} L2 Stall Cycles (Eq.~\ref{eq:L2SC}) in Figure~\ref{fig:L2SC} shows the percentage of total cycles that are wasted due to L2 cache misses. High L2 Stall Cycles indicates congestion in the memory hierarchy and shows that the SpMV kernel is performing poorly. High L2 and L3 Miss Rates both contribute to L2 Stall Cycles. An L2 miss leads to an L3 access, causing the processor to stall for several cycles. An L3 miss leads to a DRAM access, causing the processor to stall for many more cycles. In the case where most L2 misses are followed by L3 misses (which happens for both types of matrices), an L2 miss is extremely costly. For FD matrices, L2 Stall Cycles is less than one percent for problem sizes that fit in the L3 cache. On larger matrices, L2 Stall Cycles increases, especially in the parallel case. Although the L3 Miss Rate is still low for these large matrices, high Prefetch Miss Rate (as shown in Figure~\ref{fig:PFMR}, from Eq.~\ref{eq:PFMR}) congests memory and causes stalls. A high Prefetch Miss Rate shows that the prefetcher is successfully anticipating data needs and making the SpMV kernel more efficient. However, the tradeoff is additional traffic to DRAM, which increases the L2 Stall Cycles resulting from an L3 miss.\footnote{For small problems that fit entirely in the L2 cache, the SpMV kernel does not miss in L2, so the Prefetch Miss Rate does not factor into L2 Stall Cycles.} In the serial case, prefetcher activity does not stall the processor significantly, but in the threaded case, each core has its own prefetcher, so prefetcher activity causes congestion and stall cycles. For R-MAT matrices, L2 Stall Cycles begins to increase at the point when the problem size exceeds the capacity of the L2 cache (where the L2 Miss Rate increases). The effect of the L2 Miss Rate on L2 Stall Cycles is exacerbated by the L3 Miss Rate, particularly once the problem size exceeds the capacity of the L3 cache (where the L3 Miss Rate jumps). As more requests go to DRAM, the DRAM quickly reaches a bottleneck in the rate at which it can fulfill requests. The Prefetch Rate indicates that the congestion in DRAM overwhelms the prefetcher, causing the prefetcher to be shut off. Once the DRAM bottleneck is reached, the L2 Stall Cycles plateaus around 70\%. This means that, for the largest R-MAT matrices, at most 30\% of cycles are used for computation of the SpMV kernel, and the rest are wasted stalling. \subsection{L3 Miss Rate} The L3 Miss Rate (Eq.~\ref{eq:L3MR}) of the SpMV kernel behaves analogously to the L2 Miss Rate, only shifted by the increased cache size, as shown in Figure~\ref{fig:L3MR}. Just as with the L2 Miss Rate, L3 Miss Rate for FD matrices is consistently low, at about 0.1 misses per thousand instructions. For R-MAT matrices, the L3 Miss Rate increases dramatically, to about 25 misses per thousand instructions, at the point where the problem size exceeds the capacity of the L3 cache. The L3 Miss Rate data parallels the observation made in the previous section of the pattern of fetching data from the L2 cache. For the FD matrices, the prefetcher successfully loads data into the L2 cache. Because the SpMV kernel nearly always finds the data it needs in the L2 cache, it rarely needs to access the L3 cache. Consequently, the L3 Miss Rate (which is normalized by the number of instructions, not the number of L3 accesses) is low (good) for FD matrices. For the R-MAT matrices, the L3 Miss Rate follows the same pattern as the L2 Miss Rate: once the problem size no longer fits in cache, the miss rate increases sharply. For both types of matrices, the L3 Miss Rate approaches the L2 Miss Rate. In the case of the largest matrices (for which only a trivial portion of the problem fits in the L3 cache) nearly every L2 miss is followed by an L3 miss. This implies that when the SpMV kernel looks for data in the L2 cache and misses, it consistently misses in the L3 cache as well and must access DRAM to retrieve the data. This shows that the L3 cache rarely contains relevant data and that L3 cache accesses merely waste compute cycles. \subsection{Matrices} R-MAT matrices are unstructured and model the type of graphs that arise frequently in network applications~\cite{rmat}. R-MAT matrices are constructed to approximate realistic network models using a power law distribution. This construction skews the distribution of nonzeros in the matrix. To avoid problems of load balancing across threads, the rows and columns of the R-MAT matrices are permuted randomly. This does not change the results of the multiplication and eliminates a confounding element in comparisons to performance with other matrices. These R-MAT matrices are generated to represent a network with an average of eight connections per node, giving an average of eight nonzeros per row. Finite difference (FD) matrices are also sparse, but have a more regular structure than R-MAT matrices. The FD matrices are generated using a two-dimensional, 9-point stencil~\cite{Saad:2003}. The matrices have three diagonal bands of three nonzero elements each, giving nine nonzeros per row. Both types of sparse matrices are stored efficiently in compressed sparse row (CSR) format~\cite{1973sparse}. The CSR format consists of three dense arrays: an array of nonzero values, an array of column indices for each nonzero, and an array of indices to the start of each new row in the values array. The total number of elements in these arrays, for a matrix with $n$ rows and $m$ nonzeros, is $2m+n+1$. The CSR format stores sparse matrices compactly, which allows sequential access to the nonzero entries of the matrix. Matrix accesses, however, are not the only source of memory requests. To perform matrix-vector multiplication, each nonzero element (found in some column $j$) is multiplied by the $j^{th}$ element of an input vector $\vec{x}$. For sparse matrices, the order of accesses to $\vec{x}$ is determined by the location of the nonzeros in the matrix. The kernel's ability to access the needed elements of $\vec{x}$ determines the performance of matrix-vector multiplication. \section{Methodology} \label{sec:methodology} \input{vtune} \input{metrics} \subsection{Metrics} From the VTune counters\footnote{ The VTune counters are renamed above for readability. Here is the correspondence between the names above and the identifiers used in VTune:\\ {\scriptsize \centering \setlength{\tabcolsep}{2pt} \begin{tabular}{ll} \hspace{10pt}L2 Demand Misses & MEM\_LOAD\_UOPS\_RETIRED.L2\_MISS\\ \hspace{10pt}L3 Demand Misses & MEM\_LOAD\_UOPS\_RETIRED.LLC\_MISS\\ \hspace{10pt}Prefetcher L2 Misses & L2\_RQSTS.PF\_MISS\\ \hspace{10pt}L2 Cycles Stalled & CYCLE\_ACTIVITY.STALL\_CYCLES\_L2\_PENDING\\ \hspace{10pt}Number of Instructions & INST\_RETIRED.ANY\\ \hspace{10pt}Total Number of Cycles & CPU\_CLK\_UNHALTED.THREAD\\ \end{tabular}} }, five compound metrics are computed to capture concisely the relevant performance information. These five metrics are L2 Miss Rate, L3 Miss Rate, Prefetch Miss Rate, L2 Stall Cycles, and GFLOPS. L2 Miss Rate is a measure of how often the process misses the L2 cache for demand requests. A high cache miss rate indicates poor utilization of the cache. The L2 Miss Rate is computed as: \begin{equation} \label{eq:L2MR} \mbox{L2 Miss Rate}=10^3\times\frac{\mbox{L2 Demand Misses}}{\mbox{Number of Instructions}} \end{equation}\vspace{0pt} L3 Miss Rate is the equivalent metric for the L3 cache. A high cache miss rate (in the L2 or L3 caches) causes the system to waste time waiting for the request to complete.\footnote{Data on the L1D cache was not included because L1D miss rate would not affect L2 Stall Cycles, one of the primary metrics used to measure performance} The L3 Miss Rate is computed as: \begin{equation} \label{eq:L3MR} \mbox{L3 Miss Rate}=10^3\times\frac{\mbox{L3 Demand Misses}}{\mbox{Number of Instructions}} \end{equation}\vspace{0pt} Prefetch Miss Rate measures how often the prefetcher loads data into the L2 cache. A high Prefetch Miss Rate indicates prefetcher success in speeding up the SpMV operation. It is important to note that this is contrary to the L2 and L3 Miss Rates in that a higher Prefetch Miss Rate implies better performance. Prefetch Miss Rate is computed as: \begin{equation} \label{eq:PFMR} \mbox{Prefetch Miss Rate}=10^3\times\frac{\mbox{Prefetcher L2 Misses}}{\mbox{Number of Instructions}} \end{equation}\vspace{0pt} L2 Stall Cycles is the percent of total cycles spent waiting for data in the L2 cache. L2 Stall Cycles includes not only L2 misses but also subsequent L3 accesses and fetches from DRAM. These are the cycles that would have been saved, had the data been present in L2. L2 Stall Cycles is computed as: \begin{equation} \label{eq:L2SC} \mbox{L2 Stall Cycles}=\frac{\mbox{L2 Cycles Stalled}}{\mbox{Total Number of Cycles}} \end{equation}\vspace{0pt} GFLOPS shows performance in billion floating-point operations per second. In SpMV, each non-zero element is involved in one multiplication and one addition, so the number of floating point operations is twice the number of nonzeros. GFLOPS is inversely proportional to the runtime, so faster runtimes correspond to higher GFLOPS. GFLOPS is computed as: \begin{equation} \label{eq:GFLOPS} \mbox{GFLOPS}=\frac{1}{10^9}\times\frac{2\times\mbox{Number of Nonzeros}}{\mbox{SpMV runtime}} \end{equation}\vspace{0pt} \section*{Acknowledgments} The authors want to thank the DARPA MTO for support of the PAKCK study. We thank Albert Reuther his contributions. \IEEEtriggeratref{11} \bibliographystyle{IEEEtran} \subsection{Prefetcher Miss Rate} \begin{figure}[htb] \centering \includegraphics[width=0.49\textwidth]{images/PFMR.png} \caption{Prefetcher Miss Rate of the SpMV kernel on FD matrices (blue) and R-MAT matrices (red) in serial and in parallel.} \label{fig:PFMR} \end{figure} Figure~\ref{fig:PFMR} Prefetcher activity --> L2 stall cycles \section{Results} \label{sec:results} \begin{figure*}[t] \centering \begin{subfigure}[b]{0.98\columnwidth} \centering \includegraphics[width=1\textwidth]{L2MR-fig.pdf} \caption{L2 Miss Rate.} \label{fig:L2MR} \end{subfigure} \hspace{\columnsep} \begin{subfigure}[b]{0.98\columnwidth} \centering \includegraphics[width=1\textwidth]{L3MR-fig.pdf} \caption{L3 Miss Rate.} \label{fig:L3MR} \end{subfigure} \caption{Cache miss rates of the SpMV kernel on FD matrices (blue) and R-MAT matrices (red) in serial and in parallel. Cache miss rates for FD matrices are around zero, but miss rates for R-MAT matrices grow with increasing matrix size} \label{fig:CacheMR} \end{figure*} Performance data on the SpMV kernel is presented for 1, 2, 4, 8, and 16 threads. Data is not shown for 32 threads, as the results are confounded by hyperthreading. \footnote{The system has 16 physical cores and uses hyperthreading to simulate an additional 16 cores~\cite{IntelXeon}. Hyperthreading does not duplicate the resources essential to the SpMV kernel, so there is no performance gain from attempting to use more threads than physical cores. In fact, simulating additional cores only fragments resources and increases congestion. } For cache metrics, two representative cases are presented for simplicity. The serial case (1 thread) is presented to show performance without the congestion of additional threads. Data for 16 threads is used as the parallel case, to show maximal utilization of all processor resources by the kernel. Performance is quantified in terms of L2 Miss Rate, L3 Miss Rate, Prefetcher Miss Rate, L2 Stall Cycles, and GFLOPS. \input{L2MR} \begin{figure*}[t] \centering \begin{minipage}{.98\columnwidth} \centering \includegraphics[width=1\textwidth]{L2SC-fig.pdf} \caption{L2 Stall Cycles of the SpMV kernel on FD (blue) and R-MAT (red) matrices in serial and in parallel.} \label{fig:L2SC} \end{minipage} \hspace{\columnsep} \begin{minipage}{.98\columnwidth} \centering \includegraphics[width=1\textwidth]{PFMR-fig.pdf} \caption{Prefetch Miss Rate of the SpMV kernel on FD matrices (blue) and R-MAT matrices (red) in serial and in parallel.} \label{fig:PFMR} \end{minipage} \end{figure*} \input{L3MR} \input{L2SC} \input{GFLOPS} \subsection{Intel VTune Amplifier} Performance data is measured precisely with Intel's VTune Amplifier XE tool. VTune records activity on various components of the processor. This study concentrates on cache-related metrics. VTune collects hits and misses for each level of cache, as well as remote versus local DRAM accesses. It also captures high-level metrics such as the number of instructions executed and the number of cycles used. The most powerful functionality of VTune is the ability to collect data on specific functions, threads, or even line numbers. In this work, the data is collected exclusively from the SpMV operation. To ensure the SpMV operation uses enough resources for VTune to track it accurately, the SpMV kernel is run many times and the result is averaged over the number of runs. The number of times SpMV is run per matrix is: $$\mbox{Number of Runs} = \frac{2^{33}}{\mbox{\# of non-zeros}}$$ This function has the property that the amount of computational work performed is constant and independent of the matrix size. This allows for comparison of the counters across matrix sizes without normalizing. Additionally, the SpMV program is run without VTune to measure the runtime of the SpMV kernel, to ensure that gathering the metrics does not slow the runtime measurement.
{'timestamp': '2014-07-31T02:11:23', 'yymm': '1407', 'arxiv_id': '1407.8168', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8168'}
arxiv
\section{Introduction} Recent results on lattice codes applied to additive Gaussian networks show remarkable advantages of their linear structure. In particular the compute-and-forward scheme \cite{NazerGastpar_2011} demonstrates the idea that sometimes it is better to first decode sums of several codewords than the codewords individually. Similar ideas have also been exploited in several communication networks and are shown to be beneficial in various perspectives, see for example \cite{wilson_joint_2010} \cite{Nam_etal_2011} \cite{Nam_etal_2010} \cite{Zhan_etal_2010}. The Gaussian multiple access channel is a well-understood communication system. To achieve its entire capacity region, the receiver can either use joint decoding (a multi-user decoder), or a single-user decoder combined with successive cancellation decoding and time-sharing \cite[Ch. 15]{cover_elements_2006}. An extension of the successive cancellation decoding called Rate-Splitting Multiple Access is developed in \cite{rimoldi_rate-splitting_1996} where only single-user decoders are used to achieve the whole capacity region without time-sharing, but at the price that messages have to be split to create more virtual users. In this paper we provide and analyze a novel strategy for the Gaussian MAC using lattice codes based on a modified compute-and-forward technique. For the $2$-user Gaussian MAC, the receiver first decodes the sum of the two transmitted codewords, and then decodes either one of the codewords, using the sum as side information. As an example, Figure \ref{fig:illustration} gives an illustration of an achievable rate region for a \textit{symmetric} $2$-user Gaussian MAC with our proposed scheme. When the \textit{signal-to-noise ratio} (SNR) of both users is below $1.5$, the proposed scheme cannot attain rate pairs on the dominant face of the capacity region. If the SNR exceeds $1.5$, a line segment on the capacity boundary is achievable. As SNR increases, the end points of the line segment approach the corner points, and the whole capacity region is achievable as soon as the SNR of both users is larger than $1+\sqrt{2}$. We point out that the decoder used in our scheme is a single-user decoder since it merely performs lattice quantizations on the received signal. Hence this novel approach allows us to achieve rate pairs in the capacity region using only a single-user decoder without time-sharing or rate splitting. This feature of the proposed coding scheme could be of interest for practical considerations. The proposed coding scheme is then extended to the general $K$-user Gaussian MAC and achievable rate regions are derived. While a complete characterization of the achievable region is difficult to give for the general case, we raise a conjecture that the symmetric capacity\footnote{For a symmetric $K$-user Gaussian MAC where the SNR of all users equals $P$, we say that the symmetric capacity is achievable if each user has a rate $\frac{1}{2K}\log(1+KP)$.} is always achievable for the symmetric Gaussian MAC, provided the SNR exceeds a certain threshold. While this conjecture is established for the $2$-user case where the SNR threshold is $1.5$, some numerical evidence is given to support this conjecture for larger $K$. For example the numerical results suggest that the SNR threshold is less than $2.24$ for the $3$-user symmetric MAC and less than $3.75$ for the $4$-user symmetric MAC. In a related result in \cite{ordentlich_successive_2013} it is shown that under certain conditions, some isolated (non-corner) points of the capacity region can be attained. To prove this, the authors use fixed lattices which are independent of channel gains. From this perspective, our paper shows that if the lattices are properly scaled in accordance with the channel gains, then we can attain the full capacity region. \begin{figure} \centering \includegraphics[width=2.5in]{illustration.png} \caption{An illustration of an achievable rate region for a $2$-user Gaussian MAC with the proposed scheme. The rate pairs in the shaded region can be achieved using a single-user decoder without time-sharing. As SNR increases, the end points of the line segment approach the corner points and the whole capacity region becomes achievable. A sufficient condition for achieving the whole capacity region is that the SNR of both users are above $1+\sqrt{2}$.} \label{fig:illustration} \end{figure} We then study the so-called ``dirty'' Gaussian MAC with two additive interference signals which are non-causally known to two encoders in a distributed manner. It was shown in \cite{philosof_lattice_2011} that lattice codes are well-suited for this problem. We devise a coding scheme within our framework to this system which extends the previous results and gives a new achievable rate region, which could be considerably larger for general interference strength. Lastly we should point out that although this paper exclusively considers the Gaussian multiple access channel, the proposed coding scheme is more general and can be applied to many other Gaussian network problems. The paper is organized as follows. Section \ref{sec:system} gives the problem statement and introduces the nested lattice codes used in our coding scheme. The important notion of computation rate tuple is also introduced. Section \ref{sec:MAC_2usr} gives a complete analysis of our coding scheme in the $2$-user Gaussian MAC. In Section \ref{sec:K_user} we extend the coding scheme to the $K$-user Gaussian MAC. A similar strategy is then applied to the Gaussian dirty MAC in Section \ref{sec:dirty} for the two user case. Throughout this paper, vectors and matrices are denoted by lowercase and uppercase bold letters, such as $\ve a$ and $\ve A$, respectively. The $(i,j)$-entry of a matrix $\ve A$ is denoted by $A_{ij}$. The notation $\text{diag}(x_1,\ldots,x_K)$ denotes a diagonal matrix whose diagonal entries are $x_1,\ldots,x_K$. The determinant of a matrix $\ve A$ is denoted by $|\ve A|$. The probability of a given event $E$ is denoted by $\mathbb P(E)$. \section{Nested lattice codes and computation rate tuples}\label{sec:system} We consider a $K$-user Gaussian multiple access channel. The discrete-time real Gaussian MAC has the following vector representation \begin{IEEEeqnarray}{rCl} \ve y=\sum_{k=1}^K h_k\ve x_k+\ve z \label{eq:sys_K_MAC} \end{IEEEeqnarray} with $\ve y, \ve x_k\in\mathbb R^n$ denoting the channel output at the receiver and channel input of transmitter $k$. The Gaussian white noise with unit variance per entry is denoted by $\ve z\in\mathbb R^n$. A fixed real number $h_k$ denotes the channel coefficient from user $k$ to the receiver and is known to transmitter $k$. We can assume without loss of generality that every user has the same power constraints on the channel input as $\mathbb E\{\norm{\ve x_k}^2\}\leq nP$. In our coding scheme, we map messages $W_k$ of user $k$ bijectively to points in $\mathbb R^n$ denoted by $\ve t_k$, which are elements of the codebook $\mathcal C_k$ to be defined later. The \textit{rate} of the codebook $\mathcal C_k$ is defined to be \begin{align} r_k:=\frac{1}{n}\log|\mathcal C_k|\quad\text{ for }k=1, 2 \label{eq:message_rate} \end{align} Each transmitter is equipped with an encoder $\mathcal E_k$ which maps its message (or the corresponding codeword) to the channel input as $\ve x_k=\mathcal E_k(\ve t_k)$. At the receiver, a decoder wishes to estimate all the messages using the channel output $\ve y$. The decoded codewords are denoted by $\hat{\ve t}_1,\ldots,\hat{\ve t}_K$ and they are mapped back to messages. Hence we can define the message error probability as \begin{align} P_{e,msg}^{(n)}:=\mathbb P\left(\hat{\ve t}_k\neq \ve t_k,k=1,\ldots,K\right) \label{eq:error_message} \end{align} where $n$ is the length of codewords. We require the receiver to decode all messages from $\ve y$ with arbitrarily small error. Formally we have the following definition. \begin{definition}[Message rate tuple] Consider a $K$-user Gaussian MAC in (\ref{eq:sys_K_MAC}). We say \textit{a message rate tuple $(R_1,\ldots, R_K)$} is achievable if it holds that for any $\epsilon>0$ there exists a number $n$, such that the message error probability in (\ref{eq:error_message}) satisfies $P_{e,msg}^{(n)}<\epsilon$ whenever the rate $r_k$ defined in (\ref{eq:message_rate}) of user $k$ satisfies $r_k< R_k$ for $k=1,\ldots, K$. \label{def:message_rate} \end{definition} The capacity region, equivalently all possible achievable message rate tuples, of a $K$-user Gaussian MAC is known, see for example \cite{ahlswede_multi-way_1973}, \cite{liao_multiple_1972}, \cite[Ch. 15]{cover_elements_2006}. In this paper we devise a novel approach to achieve the capacity region of the Gaussian MAC. \subsection{Nested lattice codes} A lattice $\Lambda$ is a discrete subgroup of $\mathbb R^n$ with the property that if $\ve t_1, \ve t_2\in \Lambda$, then $\ve t_1+\ve t_2\in \Lambda$. More details about lattices and lattice codes can be found in \cite{ErezZamir_2004} \cite{Erez_etal_2005}. Define the lattice quantizer $Q_{\Lambda}: \mathbb R^n\rightarrow\Lambda$ as \begin{IEEEeqnarray*}{rCl} Q_{\Lambda}(\ve x)=\mbox{argmin}_{\ve t\in\Lambda}\norm{\ve t-\ve x} \end{IEEEeqnarray*} and define the fundamental Voronoi region of the lattice to be \begin{IEEEeqnarray*}{rCl} \mathcal V:=\{\ve x\in\mathbb R^n:Q_{\Lambda}(\ve x)=\ve 0\} \end{IEEEeqnarray*} The modulo operation gives the quantization error: \begin{IEEEeqnarray*}{rCl} [\ve x]\mbox{mod }\Lambda=\ve x-Q_{\Lambda}(\ve x) \label{eq:mode} \end{IEEEeqnarray*} Two lattices $\Lambda$ and $\Lambda'$ are said to be nested if $\Lambda'\subseteq\Lambda$. Let $\Lambda$ be a simultaneously good lattice in the sense of \cite{ErezZamir_2004} \cite{Erez_etal_2005}. Let $\beta_k, k=1,\ldots, K$ be $K$ nonzero real numbers and we collect them into one vector $\underline{\beta}:=(\beta_1,\ldots,\beta_K)$. We can construct lattices $\Lambda_k^{s}\subseteq\Lambda$ for all $k$ where all lattices are simultaneously good and with second moment \begin{align*} \frac{1}{n\mbox{Vol }(\mathcal V_k^s)}\int_{\mathcal V_k^{s}}\norm{\ve x}^2d\ve x=\beta_k^2 P \end{align*} where $\mathcal V_k^{s}$ denotes the Voronoi region of the lattice $\Lambda_k^{s}$. The lattice $\Lambda_k^s$ is used as the \textit{shaping region} for the codebook of user $k$. For each transmitter $k$, we construct the codebook as \begin{IEEEeqnarray}{rCl} \mathcal C_k=\Lambda\cap\mathcal V_k^s \label{eq:codebook} \end{IEEEeqnarray} With this codebook the message rate of user $k$ is \begin{IEEEeqnarray}{rCl} r_k=\frac{1}{n}\log|\mathcal C_k|=\frac{1}{n}\log\frac{\mbox{Vol }(\mathcal V_k^s)}{\mbox{Vol }(\mathcal V)} \label{eq:message_rate_lattice} \end{IEEEeqnarray} where $\mathcal V$ is the Voronoi region of the fine lattice $\Lambda$. The parameters $\underline{\beta}$ are used to control the individual rates of different users. We will see later that the proper choice of these parameters depend on the channel coefficients. We also note that a similar idea appears in \cite{ntranos_asymmetric_2013} \cite{ordentlich_precoded_2013} whereas the authors do not make connections between these parameters and channel coefficients. \subsection{The computation rate tuple} Throughout this work, we will be interested in decoding integer sums of the lattice codewords of the form \begin{align} \ve u:=\sum_{k=1}^Ka_k\ve t_k \end{align} where $a_k$ is an integer. Let $\hat{\ve u}$ denote the decoded integer sum at the receiver and define the error probability of decoding a sum as \begin{align} P_{e,sum}^{(n)}:=\mathbb P(\hat{\ve u}\neq \ve u) \label{eq:error_sum} \end{align} where $n$ is the length of codewords. This idea is, in the first place, different from the usual decoding procedure where individual messages are decoded. To articulate the point, we give a definition of the computation rate tuple in the context of the $K$-user Gaussian MAC. \begin{definition}[Computation rate tuple] Consider a $K$-user Gaussian MAC in (\ref{eq:sys_K_MAC}). We say \textit{a computation rate tuple $(R_1^{\ve a},\ldots, R_K^{\ve a})$ with respect to a sum with coefficients $\ve a:=(a_1,\ldots, a_K)$} is achievable if it holds for any $\epsilon>0$ there exists a number $n$, such that the sum decoding error probability in (\ref{eq:error_sum}) satisfies $P_{e,sum}^{(n)}<\epsilon$ whenever the rate $r_k$ defined in (\ref{eq:message_rate}) of user $k$ satisfies $r_k< R_k^{\ve a}$ for $k=1,\ldots, K$. \label{def:computation_rate} \end{definition} An achievable computation rate tuple in the Gaussian MAC is given in the following theorem, as a generalization of the result of \cite{NazerGastpar_2011}. \begin{theorem}[A general compute-and-forward formula] Consider a $K$-user Gaussian MAC with channel coefficients $\ve h=(h_1,\ldots, h_K)$ and equal power constraint $P$. Let $\beta_1,\ldots,\beta_K$ be $K$ nonzero real numbers. The computation rate tuple $(R_1^{\ve a},\ldots, R_K^{\ve a})$ with coefficients $\ve a=:(a_1,\ldots, a_K)$ is achievable where \begin{IEEEeqnarray}{rCl} R_k^{\ve a}= \left[\frac{1}{2}\log \left(\norm{\ve{\tilde a}}^2-\frac{P(\ve h^T\ve{\tilde a})^2}{1+P\norm{\ve h}^2}\right)^{-1}+\frac{1}{2}\log \beta_k^2\right]^+ \label{eq:compute_rate} \end{IEEEeqnarray} for all $k$ where $\ve{\tilde a}:=[\beta_1a_{1},...,\beta_Ka_{K}]$ and $a_{k}\in\mathbb Z$ for all $k\in[1:K]$. \label{thm:computation_rate} \end{theorem} \begin{proof} A proof of this theorem is given in Appendix \ref{sec:appen_proof_computation}. \end{proof} \begin{remark} \ \begin{itemize} \item By setting $\beta_k=1$ for all $k$ we recover the original compute-and-forward formula given in \cite{NazerGastpar_2011} Theorem 4. \item The usefulness of the parameters $\beta_1,\ldots,\beta_K$ lies in the fact that they can be chosen according to the channel coefficients $h_k$ and power $P$. This is crucial to our coding scheme as we will see in the sequel. \item This formula also illustrates why it is without loss of generality to assume that all powers are equal. In the case that each transmitter has power $P_k$, just replace $h_k$ by $h_k':=\sqrt{P_k/P}h_k$ for all $k$ in (\ref{eq:compute_rate}). \item It is straightforward to extend the result when there are multiple receivers, see Theorem 2 in \cite{ZhuGastpar_2014}. \item Unlike most compute-and-forward coding schemes where a modulo integer sum (see \cite[Def. 24]{NazerGastpar_2011}) is decoded, our scheme only considers decoding the integer sums $\sum_ka_k\ve t_k$ themselves. This approach suffices for our purpose and makes the presentation cleaner. \end{itemize} \end{remark} \subsection{Message rate tuple vs. computation rate tuple} It is important to distinguish the achievable \textit{message rate tuple} in Definition \ref{def:message_rate}, where individual messages should be decoded, and the achievable \textit{computation rate tuple} in Definition \ref{def:computation_rate}, where only one function of messages is to be decoded. The superscript $\ve a$ in the notation $R_k^{\ve a}$ is used to emphasize the different decoding goals. We give an example of computation rate pairs for a $2$-user Gaussian MAC in Figure \ref{fig:CompRateRegion}. It is worth noting that the achievable computation rate region can be strictly larger than the achievable message rate region. \begin{figure}[h!] \centering \includegraphics[scale=0.5]{CompRateRegion.eps} \caption{In this figure we show an achievable computation rate region for computing the sum $\ve t_1+\ve t_2$ over a $2$-user Gaussian MAC where $h_1=1, h_2=\sqrt{2}$ and $P=4$. The dotted black line shows the capacity region of this MAC. The dashed blue line depicts the computation rate pairs given by (\ref{eq:compute_rate}) in Theorem \ref{thm:computation_rate}. Points along this curve are obtained by choosing different $\beta_1, \beta_2$. The shaded region shows the whole computation rate region, in which all the computation rate pairs are achievable. Notice that in this case the computation rate region contains the whole capacity region and is strictly larger than the latter.} \label{fig:CompRateRegion} \end{figure} One simple yet important observation is that when the receiver has multiple sums, the two notions can be formally related in the following way. \begin{lemma}[Computation rate and message rate] Consider a $K$-user Gaussian MAC and let $\ve a_1,\ldots, \ve a_K$ be $K$ linearly independent $K$-length vectors. If all $K$ computation rate tuples $(R_1^{\ve a_\ell},\ldots, R_K^{\ve a_\ell}), \ell=1,\ldots K$ are achievable, then the message rate tuple $(R_1,\ldots, R_K)$ is achievable where \begin{align} R_k= \min_{\ell} R_k^{\ve a_{\ell}} \end{align} for all $k=1,\ldots K$. \label{lemma:comp_message} \end{lemma} \begin{proof} Since $\ve a_1,\ldots, \ve a_K$ are linearly independent vectors, the receiver can solve the individual codewords $\ve t_1,\ldots, \ve t_K$ with such $K$ sums. Also notice that in order to decode the sum with coefficient $\ve a_{\ell}$, we need $r_k< R_k^{\ve a_{\ell}}$ for all $\ell=1,\ldots K$. \end{proof} \section{The 2-user Gaussian MAC}\label{sec:MAC_2usr} In this section we study the 2-user Gaussian MAC \begin{IEEEeqnarray}{rCl} \ve y=h_1\ve x_1+h_2\ve x_2+\ve z \label{eq:system_clean_MAC} \end{IEEEeqnarray} with other specifications given in (\ref{eq:sys_K_MAC}). We will give a complete characterization of the achievable rate region under our coding scheme. The receiver decodes two integer sums of the two codewords as $\sum_{k=1}^2a_{k}\ve t_k$ and $\sum_{k=1}^2b_k\ve t_k$. We use $\ve a$ to denote the row vector $(a_1, a_2)\in\mathbb Z^2$. Notice that if one sum, say $\sum_{k=1}^2a_{k}\ve t_k$, is available at the decoder, it can be used along with the channel output $\ve y$ to decode another sum. The following theorem gives achievable message rate pairs for the $2$-user Gaussian MAC. \begin{theorem}[Achievable message rate pairs for the $2$-user Gaussian MAC] Consider the $2$-user multiple access channel in (\ref{eq:system_clean_MAC}). The following message rate pair is achievable \begin{align*} R_k= \begin{cases} r_k(\ve a, \underline{\beta}) &\quad\mbox{if }b_k=0\\ r_k(\ve b|\ve a, \underline{\beta}) &\quad\mbox{if }a_k=0\\ \min\{r_k(\ve a, \underline{\beta}), r_k(\ve b|\ve a, \underline{\beta})\}&\quad\mbox{otherwise} \end{cases} \end{align*} for any linearly independent $\ve a,\ve b\in\mathbb Z^2$ and $\underline{\beta}\in\mathbb R^2$ if it holds $r_k(\ve a, \underline{\beta}), r_k(\ve b|\ve a, \underline{\beta})\geq 0$ for $k=1,2$, where we define \begin{IEEEeqnarray}{rCl} r_k(\ve a,\underline{\beta})&:=&\frac{1}{2}\log\frac{\beta_k^2(1+h_1^2P+h_2^2P)}{K(\ve a,\underline{\beta})}\label{eq:rate_a_clean}\\ r_k(\ve b|\ve a,\underline{\beta})&:=&\frac{1}{2}\log\frac{\beta_k^2 K(\ve a,\underline{\beta})}{\beta_1^2\beta_2^2(a_2b_1-a_1b_2)^2}\label{eq:rate_b_clean} \end{IEEEeqnarray} with \begin{align} K(\ve a,\underline{\beta}):=\sum_ka_k^2\beta_k^2+P(a_1\beta_1h_2-a_2\beta_2h_1)^2 \label{eq:contant_K} \end{align} \label{thm:MAC_general} \end{theorem} \begin{proof} The transmitted signal for user $k$ is given by \begin{IEEEeqnarray}{rCl} \ve x_k=[\ve t_k/\beta_k+\ve d_k]\mbox{mod }\Lambda_k^s/\beta_k \end{IEEEeqnarray} where $\ve d_k$ is called a \textit{dither} which is a random vector uniformly distributed in the scaled Voronoi region $\mathcal V_k^s/\beta_k$. As pointed out in \cite{ErezZamir_2004}, $\ve x_k$ is independent of $\ve t_k$ and uniformly distributed in $\Lambda_k^s/\beta_k$ hence has average power $P_k$ for $k=1,2$. Given two integers $a_1, a_2$ and some real number $\alpha_1$, we can form \begin{IEEEeqnarray}{rCl} \tilde {\ve y}_1&:=&\alpha_1\ve y-\sum_ka_{k}\beta_k\ve d_k\\ &=&\underbrace{\sum_k(\alpha_1 h_{k}-a_{k}\beta_k)\ve x_k+\alpha_1\ve z_1}_{\tilde{\ve z}(1)}+\sum_k a_{k}\beta_k\ve x_k-\sum_ka_{k}\beta_k\ve d_k\\ &\stackrel{(a)}{=}&\tilde{\ve z}_1+\sum_k a_{k}\left(\beta_k (\ve t_k/\beta_k+\ve d_k)-\beta_k Q_{\Lambda_k^s/\beta_k}(\ve t_k/\beta_k+\ve d_k)\right)-\sum_ka_{k}\beta_k\ve d_k\\ &\stackrel{(b)}{=}&\tilde {\ve z}_1+\sum_k a_{k} (\ve t_k-Q_{\Lambda_k^s}(\ve t_k+\beta_k\ve d_k))\\ &=&\tilde {\ve z}_1+\sum_k a_{k} \tilde{\ve t}_k \label{eq:y(1)} \end{IEEEeqnarray} with the notation \begin{IEEEeqnarray}{rCl} \tilde{\ve z}_1&:=&\sum_k(\alpha_1h_k-\beta_ka_k)\ve x_k+\alpha_1\ve z\\ \tilde{\ve t}_k&:=&\ve t_k-Q_{\Lambda_k^s}(\ve t_k+\beta_k\ve d_k) \label{eq:t_tilde} \end{IEEEeqnarray} Step (a) follows from the definition of $\ve x_k$ and step (b) uses the identity $Q_{\Lambda}(\beta\ve x)=\beta Q_{\Lambda/\beta}(\ve x)$ for any real number $\beta\neq 0$. Note that $\tilde{\ve t}_k$ lies in $\Lambda$ due to the nested construction $\Lambda_k^s\subseteq\Lambda$. The term $\tilde{\ve z}_1$ acts as an equivalent noise independent of $\sum_k a_k\tilde{\ve t}_k$ (thanks to the dithers) and has an average variance per dimension \begin{IEEEeqnarray}{rCl} N_1(\alpha_1)=\sum_k(\alpha_1h_1-\beta_ka_k)^2P+\alpha_1^2 \end{IEEEeqnarray} The decoder obtains the sum $\sum_ka_k\tilde{\ve t}_k$ from $\tilde{\ve y}_1$ using \textit{lattice decoding}: it quantizes $\tilde{\ve y}_1$ to its closest lattice point in $\Lambda$. Using the same argument in \cite[Th. 5]{NazerGastpar_2011} \cite[Th. 1]{ZhuGastpar_2014}, we can show this decoding process is successful if the rate of the transmitter $k$ satisfies \begin{IEEEeqnarray}{rCl} r_k&< &r_k(\ve a, \underline{\beta})=\max_{\alpha_1}\frac{1}{2}\log^+\frac{\beta_k^2P}{N_1(\alpha_1)} \label{eq:rate_a_clean_proof} \end{IEEEeqnarray} Optimizing over $\alpha_1$ we obtain the claimed expression in (\ref{eq:rate_a_clean}). In other words we have the computation rate pair $(R_1^{\ve a}:=r_1(\ve a,\underline{\beta}), R_2^{\ve a}:=r_2(\ve a,\underline{\beta}))$. \footnote{Strictly speaking, the computation rate pair is defined under the condition that the sum $\sum_ka_k\ve t_k$ can be decoded in Definition \ref{def:computation_rate}. Here we actually decode the sum $\sum_ka_k\tilde{\ve t}_k$. However this will not affect the achievable message rate pair, because we can also recover the two messages $\ve t_1$ and $\ve t_2$ using the two sums $\sum_ka_k\tilde{\ve t}_k$ and $\sum_kb_k\tilde{\ve t}_k$, as shown in the proof. } We remark that the expression (\ref{eq:rate_a_clean}) is exactly the general compute-and-forward formula given in Theorem \ref{thm:computation_rate} for $K=2$. To decode a second integer sum with coefficients $\ve b$ we use the idea of successive cancellation \cite{NazerGastpar_2011}\cite{Nazer_2012}. If $r_k(\ve a,\underline{\beta})>0$ for $k=1,2$, i.e., the sum $\sum_ka_k\tilde{\ve t}_k$ can be decoded, we can reconstruct the term $\sum_ka_k\beta_k\ve x_k$ as $\sum_ka_k\beta_k\ve x_k=\sum_ka_k\tilde{\ve t}_k+\sum_k a_k\beta_k\ve d_k$. Similar to the derivation of (\ref{eq:y(1)}), we can use $\sum_ka_k\beta_k\ve x_k$ to form \begin{IEEEeqnarray}{rCl} \tilde{\ve y}_2&:=&\alpha_2\ve y+\lambda(\sum_ka_k\beta_k\ve x_k)-\sum_kb_k\beta_k\ve d_k\\ &=&\sum_k(\alpha_2h_k-(b_k+\lambda a_k)\beta_k)\ve x_k+\alpha_2\ve z+\sum_kb_k\tilde{\ve t}_k\\ &=&\tilde{\ve z}_2+\sum_kb_k\tilde{\ve t}_k \end{IEEEeqnarray} where the equivalent noise \begin{align} \tilde{\ve z}_2:=\sum_k(\alpha_2h_k-(b_k+\lambda a_k)\beta_k)\ve x_k+\alpha_2\ve z \end{align} has average power per dimension \begin{align} N_2(\alpha_2,\lambda)=\sum_k(\alpha_2h_k-(b_k+\lambda a_k)\beta_k)^2P+\alpha_2^2. \end{align} Under lattice decoding, the term $\sum_k b_k\tilde{\ve t}_k$ can be decoded if for $k=1, 2$ we have \begin{IEEEeqnarray}{rCl} r_k&< &r_k(\ve b|\ve a,\underline{\beta})=\max_{\alpha_2,\lambda}\frac{1}{2}\log^+\frac{\beta_k^2P}{N_2(\alpha_2,\lambda)} \end{IEEEeqnarray} Optimizing over $\alpha_2$ and $\lambda$ gives the claimed expression in (\ref{eq:rate_b_clean}). In other words we have the computation rate pair $(R_1^{\ve b}:=r_1(\ve b|\ve a,\underline{\beta}), R_2^{\ve b}:=r_2(\ve b|\ve a,\underline{\beta}))$. With Lemma \ref{lemma:comp_message} and the fact that two vectors $\ve a$ and $\ve b$ are linearly independent, we know that a message pair $(R_1,R_2)$ is achievable with \begin{align} R_k=\min\{r_k(\ve a, \underline{\beta}), r_k(\ve b|\ve a, \underline{\beta})\} \label{eq:message_rate_proof} \end{align} An important observation is that when we decode a sum $\sum_ka_k\tilde{\ve t}_k$ with the coefficient $a_i=0$, the lattice point $\tilde{\ve t}_i$ does not participate in the sum $\sum_ka_k\tilde{\ve t}_k$ hence the rate $R_i$ will not be constrained by this decoding procedure as in (\ref{eq:rate_a_clean_proof}). For example if we decode $a_1\tilde{\ve t}_1+a_2\tilde{\ve t}_2$ with $a_1=0$, the computation rate pair is actually $(R_1^{\ve a}=\infty, R_2^{\ve a}=r_1(\ve a,\underline{\beta}))$, since the rate of user $1$ in this case can be arbitrarily large. The same argument holds for the case $b_k=0$. Combining (\ref{eq:message_rate_proof}) and the special cases when $a_k$ or $b_k$ equals zero, we have the claimed result. \end{proof} Now we state the main theorem in this section showing it is possible to use the above scheme to achieve non-trivial rate pairs satisfying $R_1+R_2=C_{sum}:=\frac{1}{2}\log(1+h_1^2P+h_2^2P)$. Furthermore, we show that the whole capacity region is achievable under certain conditions on $h_1, h_2$ and $P$. \begin{theorem}[Capacity achieving for the $2$-user Gaussian MAC] We consider the two-user Gaussian MAC in (\ref{eq:system_clean_MAC}) where two sums with coefficients $\ve a$ and $\ve b$ are decoded. We assume that $a_k\neq 0$ for $k=1,2$ and define \begin{align} A:=\frac{h_1h_2P}{\sqrt{1+h_1^2P+h_2^2P}}. \end{align} \textbf{Case I):} If it holds that \begin{align} A< 3/4, \label{eq:AchieCap_no} \end{align} the sum capacity cannot be achieved by the proposed coding scheme. \textbf{Case II):} If it holds that \begin{align} A\geq 3/4, \label{eq:AchieCap_part} \end{align} the sum rate capacity can be achieved by decoding two integer sums using $\ve a=(1,1), \ve b=(0,1)$ with message rate pairs \begin{align} R_1=r_1(\ve a, \beta_2), R_2=r_2(\ve b|\ve a,\beta_2), \mbox{ with } \quad \beta_2\in[\beta_2',\beta_2''] \label{eq:rate_b01} \end{align} or using $\ve a=(1,1), \ve b=(1,0)$ with message rate pairs \begin{align} R_1=r_1(\ve b|\ve a, \beta_2), R_2=r_2(\ve a,\beta_2), \mbox{ with } \quad \beta_2\in[\beta_2',\beta_2''] \label{eq:rate_b10} \end{align} where $\beta_2',\beta_2''$ are two real roots of the quadratic equation \begin{align} f(\beta_2):=K(\ve a,\beta_2)-\beta_2\sqrt{1+h_1^2P+h_1^2P}=0 \label{eq:mac_achive_inequa} \end{align} The expressions $r_k(\ve a, \beta_2)$, $r_k(\ve b|\ve a, \beta_2)$and $K(\ve a,\beta_2)$ are given in (\ref{eq:rate_a_clean}), (\ref{eq:rate_b_clean}) and (\ref{eq:contant_K}) by setting $\beta_1=1$, respectively. \textbf{Case III:} If it holds that \begin{align} A\geq 1, \label{eq:AchieCap_whole} \end{align} by choosing $\ve a=(1,1)$ and $\ve b=(0,1)$ or $\ve b=(1,0)$, the achievable rate pairs in (\ref{eq:rate_b01}) and (\ref{eq:rate_b10}) cover the whole dominant face of the capacity region. \label{thm:clean_MAC} \end{theorem} \begin{proof} It is easy to see from the rate expressions (\ref{eq:rate_a_clean}) and (\ref{eq:rate_b_clean}) that we can without loss of generality assume $\beta_1=1$ in the following derivations. We do not consider the case when $a_k=0$ for $k=1$ or $k=2$, which is just the classical interference cancellation decoding. Also notice that it holds: \begin{align} r_1(\ve a,\beta_2)+r_2(\ve b|\ve a,\beta_2)&=r_2(\ve a,\beta_2)+r_1(\ve b|\ve a,\beta_2)=\frac{1}{2}\log\frac{1+(h_1^2+h_2^2)P}{(a_2b_1-a_1b_2)^2}=C_{sum}-\log|a_2b_1-a_1b_2| \label{eq:sum_of_rates} \end{align} We start with \textbf{Case I)} when the sum capacity cannot be achieved. This happens when \begin{align} r_k(\ve a,\beta_2)<r_k(\ve b|\ve a,\beta_2), k=1,2 \end{align} for \textit{any} choice of $\beta_2$, which is equivalent to \begin{align} f(\beta_2)>0 \end{align} where $f(\beta_2)$ is given in (\ref{eq:mac_achive_inequa}). To see this, notice that Theorem \ref{thm:MAC_general} implies that in this case the sum message rate is \begin{align} R_1+R_2=r_1(\ve a,\beta_2)+r_2(\ve a,\beta_2) \end{align} for $a_k\neq 0$. Due to Eqn. (\ref{eq:sum_of_rates}) we can upper bound the sum message rate by \begin{align} R_1+R_2&<r_1(\ve a)+r_2(\ve b|\ve a,\beta_2)\leq C_{sum}\\ R_1+R_2&<r_2(\ve a)+r_1(\ve b|\ve a,\beta_2)\leq C_{sum}, \end{align} meaning the sum capacity is not achievable. It remains to characterize the condition under which the inequality $f(\beta_2)>0$ holds. It is easy to see the expression $f(\beta_2)$ is a quadratic function of $\beta_2$ with the leading coefficient $a_2^2(1+h_1^2P)$. Hence $f(\beta_2)>0$ always holds if the equation $f(\beta_2)=0$ does not have any real root. The solutions of $f(\beta_2)=0$ are given by \begin{subequations} \begin{align} \beta_2':=\frac{2a_1a_2h_1h_2P+S-\sqrt{SD}}{2(a_2^2+a_2^2h_1^2P)}\\ \beta_2'':=\frac{2a_1a_2h_1h_2P+S+\sqrt{SD}}{2(a_2^2+a_2^2h_1^2P)} \end{align} \label{eq:roots} \end{subequations} with \begin{align} S&:=\sqrt{1+(h_1^2+h_2^2)P}\\ D&:=S(1-4a_1^2a_2^2)+4Pa_1a_2h_1h_2 \end{align} Inequality $f(\beta_2)>0$ holds for all real $\beta_2$ if $D<0$ or equivalently \begin{align} \frac{h_1h_2P}{\sqrt{1+(h_1^2+h_2^2)P}}<\frac{4a_1^2a_2^2-1}{4a_1a_2} \label{eq:case1_general} \end{align} The R.H.S. of the above inequality is minimized by choosing $a_1=a_2=1$ which yields the condition (\ref{eq:AchieCap_no}). This is shown in Figure \ref{fig:clean_caseI}: in this case the computation rate pair of the first sum $\tilde{\ve t}_1+\tilde{\ve t}_2$ is too small and it cannot reach the sum capacity. In \textbf{Case II)} we require $r_k(\ve a,\beta_2)\geq r_k(\ve b|\ve a,\beta_2)$ or equivalently $f(\beta_2)\leq 0$ for some $\beta_2$. By the derivation above, this is possible if $D\geq 0$ or equivalently \begin{align} \frac{h_1h_2P}{\sqrt{1+(h_1^2+h_2^2)P}}\geq \frac{4a_1^2a_2^2-1}{4a_1a_2} \label{eq:cap_achiev_general_a} \end{align} If we choose the coefficients to be $\ve a=(a_1,a_2)$ and $\ve b=(0, b_2)$ for some nonzero integers $a_1,a_2,b_2$, Theorem \ref{thm:MAC_general} implies the sum rate is \begin{align} R_1+R_2=r_1(\ve a,\beta_2)+r_2(\ve b|\ve a,\beta_2)=C_{sum}-\log|a_2b_1-a_1b_2| \end{align} If the coefficients satisfy $|a_2b_1-a_1b_2|=1$, the sum capacity is achievable by choosing $\beta_2\in[\beta_2',\beta_2'']$, with which the inequality (\ref{eq:cap_achiev_general_a}) holds. Notice that if we choose $\beta_2\notin [\beta_2',\beta_2'']$, then $r_k(\ve a,\beta_2)< r_k(\ve b|\ve a,\beta_2)$ and we are back to Case I). The condition $|a_2b_1-a_1b_2|=1$ is satisfied if the coefficients are chosen to be $\ve a=(1,1), \ve b=(0,1)$. For simplicity we collect these two vectors and denote them as $\ve A_1:=(\ve a^T, \ve b^T)^T$. The same result holds if the coefficients are of the form $\ve a=(a_1,a_2), \ve b=(b_1, 0)$ and in particular $\ve a=(1,1), \ve b=(1,0)$. Similarly we denote these two vectors using $\ve A_2:=(\ve a^T, \ve b^T)^T$. We will let the coefficients be $\ve A_1$ or $\ve A_2$ for now and comment on other choices of coefficients later. With this choice of $\ve a$ the inequality (\ref{eq:cap_achiev_general_a}) is just the condition (\ref{eq:AchieCap_part}). In general, not the whole dominant face of the capacity region can be achieved by varying $\beta_2\in[\beta_2',\beta_2'']$. One important choice of $\beta_2$ is $\beta_2^{(1)}:=\frac{h_1h_2P}{1+h_1^2P}$. With this choice of $\beta_2$ and coefficients $\ve A_1$ we have \begin{align} R_1&=r_1(\ve a, \beta_2^{(1)})=\frac{1}{2}\log(1+h_1^2P)\\ R_2&=r_2(\ve b|\ve a,\beta_2^{(1)})=\frac{1}{2}\log(1+\frac{h_2^2P}{1+h_1^2P}) \end{align} which is one corner point of the capacity region. Similarly with $\beta_2^{(2)}:=\frac{1+h_2^2P}{h_1h_2P}$ and coefficients $\ve A_2$ we have \begin{align} R_2&=r_2(\ve a, \beta_2^{(2)})=\frac{1}{2}\log(1+h_2^2P)\\ R_1&=r_1(\ve b|\ve a,\beta_2^{(2)})=\frac{1}{2}\log(1+\frac{h_1^2P}{1+h_2^2P}) \end{align} which is another corner point of the capacity region. If the condition $\beta_2^{(1)},\beta_2^{(2)}\notin[\beta_2',\beta_2'']$ is not fulfilled, we cannot choose $\beta_2$ to be $\beta_2^{(1)}$ or $\beta_2^{(2)}$ hence cannot achieve the corner points of the capacity region. In Figure \ref{fig:clean_caseII} we give an example in this case where only part of rate pairs on the dominant face can be achieved. In \textbf{Case III)} we require $\beta_2^{(1)},\beta_2^{(2)}\in[\beta_2',\beta_2'']$. In Appendix \ref{sec:appen_proof_clean} we show that $\beta_2^{(1)},\beta_2^{(2)}\in[\beta_2',\beta_2'']$ if and only if the condition (\ref{eq:AchieCap_whole}) is satisfied. With the coefficients $\ve A_1$, the achievable rate pairs $(r_1(\ve a,\beta_2),r_2(\ve b|\ve a,\beta_2))$ lies on the dominant face by varying $\beta_2$ in the interval $[\beta_2',\beta_2^{(1)}]$ and in this case we do not need to choose $\beta_2$ in the interval $(\beta_2^{(1)},\beta_2'']$, see Figure \ref{fig:clean_caseIII01} for an example. Similarly with coefficients $\ve A_2$, the achievable rate pairs $(r_1 (\ve b|\ve a,\beta_2),r_2(\ve a,\beta_2))$ lie on the dominant face by varying $\beta_2$ in the interval $[\beta_2^{(2)},\beta_2'']$ and we do not need to let $\beta_2$ take values in the interval $[\beta_2',\beta_2^{(2)})$, see Figure \ref{fig:clean_caseIII10} for an example. Since we always have $r_1(\ve a,\beta_2')\leq r_1(\ve b|\ve a,\beta_2'')$ and $r_2(\ve b|\ve a,\beta_2')\geq r_2(\ve a,\beta_2'')$, the achievable rate pairs with coefficients $\ve A_1$ and $\ve A_2$ cover the whole dominant face of the capacity region. \end{proof} \begin{figure*}[!h] \centerline{\subfloat[Case I with $h_1=1, h_2=\sqrt{2}, P=1$]{\includegraphics[width =2.8in]{Clean_CaseI_test.eps} \label{fig:clean_caseI}} \hfil \subfloat[Case II with $h_1=1, h_2=\sqrt{2}, P=1.2$] {\includegraphics[width=2.8in]{Clean_CaseII_test.eps} \label{fig:clean_caseII}}} \caption{Plot (a) shows the achievable rate pairs in Case I. In this case the condition (\ref{eq:AchieCap_no}) is satisfied and the computation rate pair of the first sum is too small. It has no intersection with the dominant face hence cannot achieve sum rate capacity. Notice that the (message) rate pairs contained in the computation rate region are achievable. Plot (b) shows the situation in Case II. In this case the condition (\ref{eq:AchieCap_part}) is fulfilled and the computation rate pair of the first sum is larger. It intersects with the dominant face. hence the sum capacity is achievable. In this example the condition (\ref{eq:AchieCap_whole}) is not satisfied hence only part of the dominant face can be achieved, as depicted in the plot. The rate pair segement on the dominant face can be achieved by choosing $\ve a=(1,1)$, $\ve b=(1,0)$ or $\ve b=(0,1)$ and varying $\beta_2\in[\beta_2',\beta_2'']$. Choosing $\beta_2$ to be $\beta_2',\beta_2''$ gives the end points of the segement.} \label{fig:clear_caseI_II} \end{figure*} \begin{figure*}[!h] \centerline {\subfloat[Case III with $h_1=1, h_2=\sqrt{2},P=4$]{\includegraphics[width=2.8in]{Clean_CaseIII01_test.eps} \label{fig:clean_caseIII01}} \hfil \subfloat[Case III with $h_1=1, h_2=\sqrt{2},P=4$]{\includegraphics[width=2.8in]{Clean_CaseIII10_test.eps} \label{fig:clean_caseIII10}}} \caption{Achievable rate pairs in Case III. The capacity region and the computation rate pairs in the two plots are the same. In this case the condition (\ref{eq:AchieCap_whole}) is satisfied hence the computation rate pair of the first sum is large enough to achieve the whole capacity region by decoding two nontrivial integer sums. Plot (a) shows the achievable rate pairs by choosing $\ve a=(1,1), \ve b=(0,1)$ and varying $\beta_2\in[\beta_2',\beta_2^{(1)}]$. Plot (b) shows the achievable rate pairs by choosing $\ve a=(1,1), \ve b=(1,0)$ and varying $\beta_2\in[\beta_2^{(2)},\beta_2'']$. The union of the achievable rate pairs with coefficients cover the whole dominant face of the capacity region. Recall that we have studied the achievable computation rate region for this channel in Figure \ref{fig:CompRateRegion}.} \label{fig:caseIII} \end{figure*} \begin{remark} For \textit{any} $h_1, h_2$ and $P$, applying Theorem \ref{thm:MAC_general} to two trivial sums with coefficients $\ve a=(1,0), \ve b=(0,1)$ or $\ve a=(0,1), \ve b=(1,0)$ allows us to obtain the corner points of the capacity region. In this case the proposed scheme reduces to the well-known successive cancellation decoding. \end{remark} \begin{remark} Notice that the decoder used for lattice decoding is in fact a single-user decoder since it only requires performing lattice quantizations on the received signal. Figure \ref{fig:partition} shows the achievability of our scheme for different values of received signal-to-noise ratio $h_k^2P$. In Region III (a sufficient condition is $h_k^2P\geq 1+\sqrt{2}$ for $k=1, 2$), we can achieve any point in the capacity region using only a single-user decoder without time-sharing or rate splitting. \end{remark} \begin{figure}[!b] \centering \includegraphics[scale=0.5]{partition.eps} \caption{The plane of the received SNR $h_1^2P, h_2^2P$ is divided into three regions. Region I corresponds to Case I when the condition (\ref{eq:AchieCap_no}) holds and the scheme cannot achieve points on the boundary of the capacity region. In Region II the condition (\ref{eq:AchieCap_part}) is met but the condition (\ref{eq:AchieCap_whole}) is not, hence only part of the points on the capacity boundary can be achieved. Region III corresponds to Case III where (\ref{eq:AchieCap_whole}) are satisfied and the proposed scheme can achieve any point in the capacity region.} \label{fig:partition} \end{figure} \subsection{On the choice of coefficients} In Theorem \ref{thm:clean_MAC} we only considered the coefficients $\ve a=(1,1)$, $\ve b=(1,0)$ or $\ve b=(0,1)$. It is natural to ask whether choosing other coefficients could be advantageous. We first consider when the coefficients $\ve a$ of the first sum is chosen differently. \begin{lemma}[Achieving capacity with a different $\ve a$] Consider a $2$-user Gaussian MAC where the receiver decodes two integer sums of the codewords with coefficients $\ve a=(a_1, a_2)$ and $\ve b=(0,1)$ or $\ve b=(1,0)$. Certain rate pairs on the dominant face are achievable if it holds that \begin{align} \frac{h_1h_2P}{\sqrt{1+(h_1^2+h_2^2)P}}\geq \frac{4a_1^2a_2^2-1}{4a_1a_2} \label{eq:no_capacity} \end{align} Furthermore the corner points of the capacity region are achievable if it holds that \begin{align} \frac{h_1h_2P}{\sqrt{1+(h_1^2+h_2^2)P}}\geq a_1a_2 \end{align} \label{lemma:coef} \end{lemma} \begin{proof} The proof of the first statement is given in the proof of Theorem \ref{thm:clean_MAC}, see Eqn. (\ref{eq:case1_general}). The proof of the second statement is omitted as it is the same as the proof of Case III in Theorem \ref{thm:clean_MAC} with a general $\ve a$. \end{proof} This result suggests that although it is always possible to achieve the sum capacity with any $\ve a$, provided that the SNR of users are large enough, the choice $\ve a=(1,1)$ is the best, in the sense that it requires the lowest SNR threshold, above which the sum capacity or the whole capacity region is achievable. To illustrate this, let us reconsider the setting of Fig. \ref{fig:caseIII}, but now select the coefficients $\ve a$ different from $(1,1)$. As can be seen in Figure \ref{fig:coef1221_noCapacity}, it is not possible to achieve sum capacity with $\ve a=(1,2)$ or $\ve a=(2,1)$. As as we increase the power from $P=4$ to $P=10$, part of the capacity boundary is achieved, as shown in Figure \ref{fig:coef1221}. However in this case we cannot achieve the whole capacity region. The reason lies in the fact that the computation rate pairs are different for $\ve a=(1,2)$ and $\ve a=(2,1)$. \begin{figure*}[!h] \centerline {\subfloat[Achievable (computation) rate pairs with $h_1=1, h_2=\sqrt{2},P=4$ and $\ve a=(1,2)$, $\ve a=(2,1)$]{\includegraphics[width=2.8in]{coef1221_noCapacity.eps} \label{fig:coef1221_noCapacity}} \hfil \subfloat[Achievable rate pairs with $h_1=1, h_2=\sqrt{2},P=10$ and $\ve a=(1,2)$ or $\ve a=(2,1)$. ]{\includegraphics[width=2.8in]{coef1221_test.eps} \label{fig:coef1221}}} \caption{In the left plot we show the computation rate pairs with parameters $h_1=1, h_2=\sqrt{2}, P=4$ where the coefficients of the first sum are chosen to be $\ve a=(1,2)$ or $\ve a=(2,1)$. In this case the condition (\ref{eq:no_capacity}) is not satisfied hence no point on the dominant face can be achieved for the first sum. Compare it to the example in Figure \ref{fig:clean_caseIII01} or \ref{fig:clean_caseIII10} where $\ve a=(1,1)$ and the whole capacity region is achievable. We also note that the achievable computation rate pairs depicted in the Figure are also achievable message rate pairs, which can be shown using Theorem \ref{thm:MAC_general}. In the right plot we show the achievable rate pairs with parameters $h_1=1, h_2=\sqrt{2}, P=10$ where the coefficient of the first sum is chosen to be $\ve a=(1,2)$ or $\ve a=(2,1)$. It can be checked with Lemma \ref{lemma:coef} that we can achieve the sum capacity with the given system parameters. Notice that only parts of the capacity boundary are achievable and we cannot obtain the whole dominant face in this case. In contrast, choosing $\ve a=(1,1)$ achieves the whole dominant face.} \end{figure*} Now we consider a different choice on the coefficients $\ve b$ of the second sum. Although from the perspective of solving equations, having two sums with coefficients $\ve a=(1,1), \ve b=(1,0)$ or $\ve a=(1,1), \ve b=(1,2)$ is equivalent, here it is very important to choose $\ve b$ such that it has one zero entry. Recall the result in Theorem \ref{thm:MAC_general} that if $b_k\neq 0$ for $k=1,2$, then both message rates $R_1, R_2$ will have two constraints from the two sums we decode. This extra constraint will diminish the achievable rate region, and in particular it only achieves some isolated points on the dominant face. This is illustrated by the example in Figure \ref{fig:b21}. As a rule of thumb, the receiver should always decode the sums whose coefficients are as small as possible in a Gaussian MAC. \begin{figure}[!h] \centering \includegraphics[width=3.0in]{b21_test.eps} \caption{The achievable rate pairs with parameters $h_1=1, h_2=\sqrt{2}, P=4$. In this case the condition (\ref{eq:AchieCap_whole}) is satisfied hence the first sum is chosen properly. But as we choose $\ve b=(1,2)$, only two isolated points (indicated by arrows) on the dominant face can be achieved. This is due to the fact non-zero entries in $\ve b$ will give an extra constraint on the rate, cf. Theorem \ref{thm:MAC_general}. Compare it to the example in Figure \ref{fig:clean_caseIII10}.} \label{fig:b21} \end{figure} \section{The K-user Gaussian MAC}\label{sec:K_user} In this section we consider the general $K$-user Gaussian MAC given in (\ref{eq:sys_K_MAC}). Continuing with the coding scheme for the $2$-user Gaussian MAC, in this case the receiver decodes $K$ integer sums with linearly independent coefficients and uses them to solve for the individual messages. The coefficients of the $K$ sums will be denoted by a \textit{coefficient matrix} $\ve A\in\mathbb Z^{K\times K}$ \begin{align} \ve A:=(\ve a_1^T \ldots \ve a_K^T)^T= \begin{pmatrix} a_{11} &a_{12} &\ldots &a_{1K}\\ a_{22} &a_{22} &\ldots &a_{2K}\\ \ldots &\ldots &\ldots &\ldots\\ a_{K1} &a_{K2} &\ldots &a_{KK}\\ \end{pmatrix} \end{align} where the row vector $\ve a_{\ell}:=(a_{\ell 1},\ldots,a_{\ell K})\in \mathbb Z^{1\times K}$ denotes the coefficients of the $\ell$-th sum, $\sum_{k=1}^Ka_{\ell k}\tilde{\ve t}_k$, the receiver decodes. The following theorem gives an achievable message rate tuple for the general $K$-user Gaussian MAC. It is an extension of \cite[Thm. 2]{ordentlich_successive_2013} as the scaling parameters $\beta_k$ in our proposed scheme allow a larger achievable rate region. \begin{theorem}[Achievable message rate tuples for the $K$-user Gaussian MAC] Consider the $K$-user Gaussian MAC in (\ref{eq:sys_K_MAC}). Let $\ve A$ be a full-rank integer matrix and $\beta_1,\ldots,\beta_K$ be $K$ non-zero real numbers. We define $\ve B:=\text{diag}(\beta_1,\ldots,\beta_K)$ and \begin{align} \ve K_{\ve Z'}:=P\ve A\ve B(\ve I+P\ve h\ve h^T)^{-1}\ve B^T\ve A^T \label{eq:cov_noise} \end{align} Let the matrix $\ve L$ be the unique Cholesky factor of the matrix $\ve A\ve B(\ve I+P\ve h\ve h^T)^{-1}\ve B^T\ve A^T$, i.e. \begin{align} \ve K_{\ve Z'}=P\ve L\ve L^T \label{eq:chol} \end{align} The message rate tuple $(R_1,\ldots, R_K)$ is achievable with \begin{align} R_k= \min_{\ell\in[1:K]}\left\{\frac{1}{2}\log^+\left(\frac{\beta_k^2}{L_{\ell\ell}^2}\right)\cdot\chi(a_{\ell k})\right\}, k=1,\ldots, K \end{align} where we define \begin{align} \chi(x)=\begin{cases} +\infty &\mbox{if } x=0,\\ 1 &\mbox{otherwise.} \end{cases} \end{align} Furthermore if $\ve A$ is a unimodular ($|\ve A|=1$) and $R_k$ is of the form \begin{align} R_k=\frac{1}{2}\log\left(\frac{\beta_k^2}{L_{\Pi(k)\Pi(k)}^2}\right), k=1,\ldots, K \end{align} for some permutation $\Pi$ of the set $\{1,\ldots, K\}$, then the sum rate satisfies \begin{align} \sum_k R_k=C_{sum}:=\frac{1}{2}\log(1+\sum_k h_k^2P) \end{align} \label{thm:K_MAC} \end{theorem} \begin{proof} To proof this result, we will adopt a more compact representation and follow the proof technique given in \cite{ordentlich_successive_2013}. We rewrite the system in (\ref{eq:sys_K_MAC}) as \begin{align} \ve Y=\ve h\ve X+\ve z \end{align} with $\ve h=(h_1,\ldots, h_K)\in\mathbb R^{1\times K}$ and $\ve X=(\ve x_1^T \ldots \ve x_K^T)^T\in\mathbb R^{K\times n}$ where each $\ve x_k\in R^{1\times n}$ is the transmitted signal sequence of user $k$ given by \begin{IEEEeqnarray}{rCl} \ve x_k=[\ve t_k/\beta_k+\ve d_k]\mbox{mod }\Lambda_k/\beta_k \end{IEEEeqnarray} Similar to the derivation for the $2$-user case, we multiply the channel output by a matrix $\ve F\in\mathbb R^{K\times 1}$ and it can be shown that the following equivalent output can be obtained \begin{IEEEeqnarray}{rCl} \tilde{\ve Y}=\ve A\ve T+\tilde{\ve Z} \label{eq:equivlent_vec} \end{IEEEeqnarray} where $\ve T:=(\tilde{\ve t}_1^T \ldots \tilde{\ve t}_K^T)^T\in\mathbb R^{K\times n}$ and the lattice codeword $\tilde{\ve t}_k\in R^{n\times 1}$ of user $k$ is the same as defined in (\ref{eq:t_tilde}). Furthermore the noise $\tilde{\ve Z}\in\mathbb R^{K\times n}$ is given by \begin{align} \tilde{\ve Z}=(\ve F\ve h-\ve A\ve B)\ve X+\ve F\ve z \end{align} where $\ve B:=\text{diag}(\beta_1,\ldots,\beta_K)$. The matrix $\ve F$ is chosen to minimize the variance of the noise: \begin{align} \ve F:=P\ve A\ve B\ve h^T\left(\frac{1}{P}\ve I+\ve h\ve h^T\right)^{-1} \end{align} As shown in the proof of \cite[Thm. 5]{NazerGastpar_2011}, when analyzing the lattice decoding for the system given in (\ref{eq:equivlent_vec}), we can consider the system \begin{align} \tilde{\ve Y}=\ve A\ve T+\ve Z' \label{eq:equivalent_vec_Gauss} \end{align} where $\ve Z'\in\mathbb R^{K\times n}$ is the equivalent noise and each row $\ve z_k$ is a $n$-sequence of i.i.d Gaussian random variables $z_k$ for $k=1,\ldots,K$. The covariance matrix of the Gaussians $z_1,\ldots,z_K$ is the same as that of the original noise $\tilde{\ve Z}$ in (\ref{eq:equivlent_vec}). It is easy to show that the covariance matrix of the equivalent noise $z_1,\ldots,z_K$ is given in Eq. (\ref{eq:cov_noise}). Now instead of doing the successive interference cancellation as in the $2$-user case, we use an equivalent formulation which is called ``noise prediction" in \cite{ordentlich_successive_2013}. Because the matrix $\ve A\ve B(\ve I+P\ve h\ve h^T)^{-1}\ve B^T\ve A^T$ is positive definite, it admits the Cholesky factorization hence the covariance matrix $\ve K_{\ve Z'}$ can be rewritten as \begin{align} \ve K_{\ve Z'}=P\ve L\ve L^T \end{align} where $\ve L$ is a lower triangular matrix. Using the Cholesky decomposition of $\ve K_{\tilde{\ve Z}}$, the system (\ref{eq:equivalent_vec_Gauss}) can be represented as \begin{align} \tilde{\ve Y}&=\ve A\ve T+\sqrt{P}\ve L\ve W\\ &=\begin{pmatrix} a_{11} &a_{12} &\ldots &a_{1K}\\ a_{22} &a_{22} &\ldots &a_{2K}\\ \vdots &\vdots &\vdots &\vdots\\ a_{K1} &a_{K2} &\ldots &a_{KK}\\ \end{pmatrix} \begin{pmatrix} \tilde{\ve t}_1\\ \tilde{\ve t}_2\\ \vdots\\ \tilde{\ve t}_K \end{pmatrix} +\sqrt{P} \begin{pmatrix} L_{11} &0 &0 &\ldots &0\\ L_{21} &L_{22} &0 &\ldots &0\\ \vdots &\vdots &\vdots &\vdots&\vdots\\ L_{K1} &L_{K2} &L_{K3} &\ldots &L_{KK} \end{pmatrix} \begin{pmatrix} \ve w_1\\ \ve w_2\\ \vdots\\ \ve w_K\\ \end{pmatrix} \label{eq:system_lower} \end{align} with $\ve W=[\ve w_1^T,\ldots, \ve w_K^T]\in \mathbb R^{K\times n}$ where $\ve w_i\in\mathbb R^{n\times 1}$ is an $n$-length sequence whose components are i.i.d. zero-mean white Gaussian random variables with unit variance. This is possible by noticing that $\sqrt{P}\ve L\ve W$ and $\ve Z'$ have the same covariance matrix. Now we apply lattice decoding to each row of the above linear system. The first row of the equivalent system in (\ref{eq:system_lower}) is given by \begin{align} \tilde{\ve y}_1:=\ve a_1\ve T+\sqrt{P}L_{11}\ve w_1 \end{align} Using lattice decoding, the first integer sum $\ve a_1\ve T=\sum_k a_{1k}\tilde{\ve t}_k$ can be decoded reliably if \begin{align} r_k< \frac{1}{2}\log^+\frac{\beta_k^2P}{PL_{11}^2}=\frac{1}{2}\log^+\frac{\beta_k^2}{L_{11}^2} \end{align} Notice that if $a_{1k}$ equals zero, the lattice point $\tilde{\ve t}_k$ does not participate in the sum $\ve a_1\ve T$ hence $R_k$ is not constrained as above. The important observation is that knowing $\ve a_1\ve T$ allows us to recover the noise term $\ve w_1$ from $\tilde{\ve y}_1$. This ``noise prediction" is equivalent to the successive interference cancellation, see also \cite{ordentlich_successive_2013}. Hence we could eliminate the term $\ve w_1$ in the second row of the system (\ref{eq:system_lower}) to obtain \begin{align} \tilde{\ve y}_2:=\ve a_2\ve T+\sqrt{P}L_{22}\ve w_2 \end{align} The lattice decoding of $\ve a_2\ve T$ is successful if \begin{align} r_k< \frac{1}{2}\log^+\frac{\beta_k^2P}{PL_{22}^2}=\frac{1}{2}\log^+\frac{\beta_k^2}{L_{22}^2} \end{align} Using the same idea we can eliminate all noise terms $\ve w_1,\ldots,\ve w_{\ell-1}$ when decode the $\ell$-th sum. Hence the rate constraints on $k$-th user when decoding this sum is given by \begin{align} r_k< \frac{1}{2}\log^+\frac{\beta_k^2P}{PL_{\ell\ell}^2}=\frac{1}{2}\log^+\frac{\beta_k^2}{L_{\ell\ell}^2} \end{align} When decoding the $\ell$-th sum, the constraint on $R_k$ will be active only if the coefficient of $\tilde{\ve t}_k$ is not zero. Otherwise this decoding will not constraint $R_k$. This fact is captured by introducing the $\chi$ function in the statement of the Theorem. Combing the above results and Lemma \ref{lemma:comp_message} we have the claimed expression. In the case when $R_k$ is of the form \begin{align} R_k=\frac{1}{2}\log\left(\frac{\beta_k^2}{L_{\Pi(k)\Pi(k)}^2}\right) \end{align} The sum rate is \begin{align} \sum_{k}R_k&=\sum_k \frac{1}{2}\log\frac{\beta_k^2}{L_{\Pi(k)\Pi(k)}^2}=\frac{1}{2}\log\prod_k\frac{\beta_k^2}{L_{kk}^2}\\ &=\frac{1}{2}\log\frac{\prod_k\beta_k^2}{|\ve L\ve L^T|}=\frac{1}{2}\log\frac{\prod_k\beta_k^2}{|\ve A\ve B(\ve I+P\ve h\ve h^T)^{-1}\ve B^T\ve A^T|}\\ &=\frac{1}{2}\log |\ve I+P\ve h\ve h^T|+\frac{1}{2}\log\prod_k \beta_k^2-\log|\ve A|-\frac{1}{2}\log|\ve B^T\ve B|\\ &=\frac{1}{2}\log|\ve I+P\ve h\ve h^T|-\log|\ve A|\\ &=C_{sum}-\log|\ve A| \end{align} If $\ve A$ is unimodular, i.e., $|\ve A|=1$, the sum rate is equal to the sum capacity. \end{proof} \begin{remark} The theorem says that to achieve the sum capacity, we need $\ve A$ to be unimodular and $R_k$ should have the form $R_k=\frac{1}{2}\log\frac{\beta_k^2}{L_{\Pi(k)\Pi(k)}^2}$, whose validity of course depends on the choice of $\ve A$. It is difficult to characterize the class of $\ve A$ for which this holds. In the case when $\ve A$ is upper triangular with non-zero diagonal entries and $L_{11}^2\leq\ldots\leq L_{KK}^2$, this condition holds and in fact in this case we have $R_k=\frac{1}{2}\log\frac{\beta_k^2}{L_{kk}^2}$. It can be seen that we are exactly in this situation when we study the $2$-user MAC in Theorem \ref{thm:clean_MAC}. \end{remark} \subsection{An example of a $3$-user MAC} It is in general difficult to analytically characterize the achievable rate using our scheme of the $K$-user MAC. We give an example of a $3$-user MAC in Figure \ref{fig:3user} to help visualize the achievable region. The channel has the form $\ve y=\sum_{k=1}^3\ve x_3+\ve z$ and the receiver decodes three sums with coefficients of the form \begin{align} \ve A=\begin{pmatrix} 1 &1 &1\\ &\ve e_i\\ &\ve e_j \end{pmatrix} \end{align} for $i,j=1,2,3$ and $i\neq j$ where $\ve e_i$ is a row vector with $1$ in its $i$-th and zero otherwise. It is easy to see that there are in total $6$ matrices of this form and they all satisfy $|\ve A|=1$ hence it is possible to achieve the capacity of this MAC according to Theorem \ref{thm:K_MAC}. For power $P=8$, most parts of the dominant face are achievable except for three triangular regions. For smaller power $P=2$, the achievable part of the dominant face shrinks and particularly the symmetric capacity point is not achievable. It can be checked that in this example, no other coefficients will give a larger achievable region. Unlike the $2$-user case, even with a large power, not the whole dominant face can be obtained in this symmetric $3$-user MAC. To obtain some intuition why it is the case, we consider one edge of the dominant face indicated by the arrow in Figure \ref{fig:3user_p8}. If we want to achieve the rate tuple on this edge, we need to decode user $1$ last because $R_1$ attains its maximum. Hence a reasonable choice of the coefficients matrix would be \begin{align} \ve A'=\begin{pmatrix} 0 &1 &1\\ 0 &1 &0\\ 1 &0 &0 \end{pmatrix} \mbox{ or } \ve A'=\begin{pmatrix} 0 &1 &1\\ 0 &0 &1\\ 1 &0 &0 \end{pmatrix} \end{align} Namely we first decode two sums to solve both $\ve t_2$ and $\ve t_3$, and then decode $\ve t_1$ without any interference. When decoding the first two sums, we are effectively dealing with a $2$-user MAC while treating $\ve t_1$ as noise. But the problem is that with $\ve t_1$ as noise, the signal-to-noise ratio of user $2$ and $3$ are too high, such that computation rate pair cannot reach the dominant face of the effective $2$-user MAC with $\ve t_1$ being noise. This is the same situation as the Case I considered in Theorem \ref{thm:clean_MAC}. We also plot the achievable rates with the coefficients $\ve A'$ above in Figure \ref{fig:3user_p8} on the side face. On the side face where $R_1$ attains its maximal value, we see the achievable rates cannot reach the dominant face, as a reminiscence of the $2$-user example in Figure \ref{fig:clean_caseI}. \begin{figure*}[!thb] \centerline{\subfloat[$h_k=1, P=8$]{\includegraphics[width =3in]{3userP8_v3.eps} \label{fig:3user_p8}} \hfil \subfloat[$h_k=1, P=2$] {\includegraphics[width=3in]{3userP2.eps} \label{fig:3user_p2}}} \caption{The achievable rate region (red part) in Theorem \ref{thm:K_MAC} for a symmetric $3$-user Gaussian MAC with $h_k=1$ for $k=1,2,3$ and different powers $P$.} \label{fig:3user} \end{figure*} \subsection{The symmetric capacity for the symmetric Gaussian MAC} As it is difficult to obtain a complete description of the achievable rate region for a $K$-user MAC, in this section we investigate the simple symmetric channel where all the channel gains are the same. In this case we can absorb the channel gain into the power constraint and assume without loss of generality the channel model to be \begin{align} \ve y=\sum_k\ve x_k+\ve z \end{align} where the transmitted signal $\ve x_k$ has an average power constraint $P$. We want to see if the proposed scheme can achieve the symmetric capacity \begin{align} C_{sym}=\frac{1}{2K}\log(1+KP) \end{align} For this specific goal, we will fix our coefficient matrix to be \begin{align} \ve A:=\begin{pmatrix} 1 &1 &1 &\ldots &1\\ 0 &1 &0 &\ldots &0\\ 0 &0 &1 &\ldots &0\\ \vdots &\vdots &\vdots &\ddots &\vdots\\ 0 &0 &0 &0 &1 \end{pmatrix} \label{eq:coef_sym} \end{align} Namely we first decode a sum involving all codewords $\sum_{k}\ve t_k$, then decode the individual codewords one by one. Due to symmetry the order of the decoding procedure is irrelevant and we fix it to be $\ve t_2,\ldots,\ve t_K$. As shown in Theorem \ref{thm:K_MAC}, the analysis of this problem is closely connected to the Cholesky factor $\ve L$ defined in (\ref{eq:chol}). This connection can be made more explicit if we are interested in the symmetric capacity for the symmetric channel. We define \begin{align} \ve C:=\begin{pmatrix} 1 &\beta_2 &\beta_3 &\ldots &\beta_{K}\\ 0 &1 &0 &\ldots &0\\ 0 &0 &1 &\ldots &0\\ \vdots &\vdots &\vdots &\dots &\vdots\\ 0 &0 &0 &0 &1 \end{pmatrix} \end{align} and $\ve E$ to be the all-one matrix. Let the lower triangular matrix $\tilde{\ve L}$ denote the unique Cholesky factorization of the matrix $\ve C(\ve I-\frac{P}{1+KP}\ve E)\ve C^T$, i.e., \begin{align} \ve C\left(\ve I-\frac{P}{1+KP}\ve E\right)\ve C^T=\tilde{\ve L}\tilde{\ve L}^T \label{eq:L_tilde} \end{align} \begin{proposition}[Symmetric capacity] If there exist real numbers $\beta_2,\ldots,\beta_K\geq 1$ with $|\beta_k|\geq 1$ such that the diagonal entries of $\tilde{\ve L}$ given in (\ref{eq:L_tilde}) are equal in amplitude i.e., $|\tilde{L}_{kk}|=|\tilde{L}_{jj}|$ for all $k,j$, then the symmetric capacity, i.e., $R_k=C_{sym}$ for all $k$, is achievable for the symmetric $K$-user Gaussian MAC. \label{prop:C_sym} \end{proposition} \begin{proof} Recall we have $\ve B=\text{diag}(\beta_1,\beta_2,\ldots,\beta_K)$. Let $\ve A$ be as given in (\ref{eq:coef_sym}) and the channel coefficients $\ve h$ be the all-one vector. Substituting them into (\ref{eq:cov_noise}), (\ref{eq:chol}) gives \begin{align} P\tilde{\ve C}\left(\ve I-\frac{P}{1+KP}\right)\tilde{\ve C}^T=P\ve L\ve L^T \label{eq:chol_sym} \end{align} where \begin{align} \tilde{\ve C}=\begin{pmatrix} \beta_1 &\beta_2 &\beta_3 &\ldots &\beta_{K}\\ 0 &\beta_2 &0 &\ldots &0\\ 0 &0 &\beta_3 &\ldots &0\\ \vdots &\vdots &\vdots &\ldots &\vdots\\ 0 &0 &0 &0 &\beta_K \end{pmatrix} \end{align} In this case the we are interested in the Cholesky factorization $\ve L$ above. Due to the special structure of $\ve A$ chosen in (\ref{eq:coef_sym}), Theorem \ref{thm:K_MAC} implies that the following rates are achievable \begin{align} R_1&= \frac{1}{2}\log\frac{\beta_1^2}{L_{11}^2}\\ R_k&= \min\left\{\frac{1}{2}\log\frac{\beta_k^2}{L_{11}^2},\frac{1}{2}\log\frac{\beta_k^2}{L_{kk}^2}\right\}, k\geq 2 \end{align} Using the same argument in the proof of Theorem \ref{thm:K_MAC}, it is easy to show that the sum capacity is achievable if $L_{kk}^2\geq L_{11}^2$ for all $k\geq 2$. In the case of symmetric capacity we further require that \begin{align} \frac{\beta_k^2}{L_{kk}^2}=\frac{\beta_j^2}{L_{jj}^2} \label{eq:sym_eq_L} \end{align} for all $k,j$. This is the same as requiring $\ve B^{-1}\ve L$ to have diagonals equal in amplitude with $\ve L$ given in (\ref{eq:chol_sym}), or equivalently requiring the matrix $\ve B^{-1}\ve A\ve B(\ve I+P\ve h\ve h^T)^{-1}\ve B^T\ve A^T\ve B^{-T}$ having Cholesky factorization whose diagonals are equal in amplitude. We can let $\beta_1=1$ without loss of generality and it is straightforward to check that in this case $\ve B^{-1}\ve A\ve B=\ve C$. Now the condition in (\ref{eq:sym_eq_L}) is equivalently represented as \begin{align} \tilde L_{kk}^2=\tilde L_{jj}^2 \end{align} and the requirement $L_{kk}^2\geq L_{11}^2$ for $k\geq 2$ can be equivalently written as $\beta_k^2\geq \beta_1^2=1$. \end{proof} We point out that the value of power $P$ plays a key role in Proposition \ref{prop:C_sym}. It is not true that for any power constraint $P$, there exists $\beta_2,\ldots,\beta_K$ such that the equality condition in Proposition \ref{prop:C_sym} can be fulfilled. For the two user case analyzed in Section \ref{sec:MAC_2usr}, we can show that for the symmetric channel, the equality condition in Proposition \ref{prop:C_sym} can be fulfilled if the condition (\ref{eq:AchieCap_part}) holds, which in turn requires $P\geq 1.5$ for the symmetric channel. In general for a given $K$, we expect that there exists a threshold $P^*(K)$ such that for $P\geq P^*(K)$, we can always find $\beta_2,\ldots,\beta_K$ which satisfy the equality condition in Proposition \ref{prop:C_sym} hence achieve the symmetric capacity. This can be formulated as follows. \begin{conjec}[Achievablity of the symmetric capacity] For any $K\geq 2$, there exists a positive number $P^*(K)$, such that for $P\geq P^*(K)$, we can find real numbers $\beta_2,\ldots,\beta_K$, where $|\beta_k|\geq 1$ with which the diagonal entries of $\tilde{\ve L}$ given in (\ref{eq:L_tilde}) are equal in amplitude i.e., $|\tilde{L}_{kk}|=|\tilde{L}_{jj}|$ for all $k,j$. \label{conj} \end{conjec} We have not been able to prove this claim. Table \ref{tab:beta_P15} gives some numerical results for the choices of $\underline{\beta}$ which achieve the symmetric capacity in a $K$-user Gaussian MAC with power constraint $P=15$ and different values of $K$. With this power constraint the claim in Conjecture \ref{conj} is numerically verified with $K$ up to $6$. Notice that the value $\beta_k$ decreases with the index $k$ for $k\geq 2$. This is because with the coefficient matrix $\ve A$ in (\ref{eq:coef_sym}), the decoding order of the individual users is from $2$ to $K$ (and user $1$ is decoded last). The earlier the message is decoded, the larger the corresponding $\beta$ will be. \begin{table}[!hbt] \renewcommand{\arraystretch}{1.3} \caption{The choice of $\underline{\beta}$ for a $K$-user Gaussian MAC with power $P=15$.} \centering \begin{tabular}{c||c|c|c|c|c|c} \hline $K$ &$\beta_1$ & $\beta_2$ & $\beta_3$ & $\beta_4$ & $\beta_5$ &$\beta_6$\\ \hline\hline 2 &1 & 1.1438\\ \hline 3 &1 &1.5853 &1.2582\\ \hline 4 &1 &1.6609 &1.3933 &1.1690\\ \hline 5 &1 &1.6909 &1.4626 &1.2796 &1.1034\\ \hline 6 &1 &1.6947 &1.4958 &1.3361 &1.1980 &1.0445 \end{tabular} \label{tab:beta_P15} \end{table} Some numerical results for $P^*(K)$ for $K$ up to $5$ is given in Table \ref{tab:Ps}. As we have seen $P^*(2)=1.5$. For other $K$ we give the interval which contains $P^*(K)$ by numerical evaluations. \begin{table}[!hbt] \renewcommand{\arraystretch}{1.3} \caption{The intervals containing $P^*(K)$} \centering \begin{tabular}{c||c} \hline $K$ &$P^*(K)$\\ \hline\hline 2 &1.5\\ \hline 3 & [2.23, 2.24]\\ \hline 4 &[3.74, 3.75]\\ \hline 5& [7.07, 7.08] \end{tabular} \label{tab:Ps} \end{table} \section{The $2$-user Gaussian dirty MAC}\label{sec:dirty} In the previous sections we focused on the standard Gaussian multiple access channels. In this section we will consider the Gaussian MAC with interfering signals which are non-causally known at the transmitters. This channel model is called Gaussian ``dirty MAC" and is studied in \cite{philosof_lattice_2011}. Some related results are given in \cite{somekh-baruch_cooperative_2008}, \cite{kotagiri_multiaccess_2008}, \cite{wang_approximate_2012}. A two-user Gaussian dirty MAC is given by \begin{align} \ve y=h_1\ve x_1+h_2\ve x_2+\ve s_1+\ve s_2+\ve z \label{eq:doubly_dirty_mac} \end{align} where the assumption on $\ve x_1, \ve x_2$ and $\ve z$ are the same as for the standard Gaussian MAC in (\ref{eq:sys_K_MAC}). The interference $\ve s_k$ is a zero-mean i.i.d. Gaussian random sequence with variance $Q_k$ for each entry, $k=1, 2$. An important assumption is that the interference signal $\ve s_k$ is only non-causally known to transmitter $k$. Two users need to mitigate two interference signals in a distributed manner, which makes this problem challenging. By letting $Q_1=Q_2=0$ we recover the standard Gaussian MAC. This problem can be seen as an extension of the well-known dirty-paper coding problem \cite{costa_DPC_1983} to the multiple-access channels. However as shown in \cite{philosof_lattice_2011}, a straightforward extension of the usual Gelfand-Pinsker scheme \cite{Gelfand_Pinsker} is not optimal and in the limiting case when interference is very strong, the achievable rates are zero. Although the capacity region of this channel is unknown in general, it is shown in \cite{philosof_lattice_2011} that lattice codes are well-suited for this problem and give better performance than the usual random coding scheme. Now we will extend our coding scheme in previous sections to the dirty MAC. The basic idea is still to decode two linearly independent sums of the codewords. The new ingredient is to mitigate the interference $\ve s_1, \ve s_2$ in the context of lattice codes. For a point-to-point AWGN channel with interference known non-causally at the transmitter, it has been shown that capacity can be attained with lattice codes \cite{zamir_nested_2002}. Our coding scheme is an extension of the schemes in \cite{zamir_nested_2002} and \cite{philosof_lattice_2011}. \begin{theorem}[Achievability for the Gaussian dirty MAC] For the dirty multiple access channel given in (\ref{eq:doubly_dirty_mac}), the following message rate pair is achievable \begin{align} R_k= \begin{cases} r_k(\ve a,\underline{\gamma}, \underline{\beta}) &\quad\mbox{if }b_k=0\\ r_k(\ve b|\ve a,\underline{\gamma}, \underline{\beta}) &\quad\mbox{if }a_k=0\\ \min\{r_k(\ve a,\underline{\gamma}, \underline{\beta}), r_k(\ve b|\ve a,\underline{\gamma}, \underline{\beta})\}&\quad\mbox{otherwise} \end{cases} \end{align} for any linearly independent integer vectors $\ve a, \ve b\in\mathbb Z^{2}$ and $\underline{\gamma},\underline{\beta}\in\mathbb R^{2}$ if $r_k(\ve a,\underline{\gamma}, \underline{\beta}), r_k(\ve b|\ve a,\underline{\gamma}, \underline{\beta})>0$ for $k=1,2$, whose expressions are given as \begin{align} r_k(\ve a,\underline{\gamma},\underline{\beta})&:=\max_{\alpha_1}\frac{1}{2}\log^+\frac{\beta_k^2 P_k}{N_1(\alpha_1,\underline{\gamma},\underline{\beta})}\\ r_k(\ve b|\ve a, \underline{\gamma},\underline{\beta})&:=\max_{\alpha_2,\lambda}\frac{1}{2}\log^+\frac{\beta_k^2 P_k}{N_2(\alpha_2,\underline{\gamma},\underline{\beta},\lambda)} \end{align} with \begin{align} N_1(\alpha_1,\underline{\gamma},\underline{\beta})&=\alpha_1^2+\sum_k\Big((\alpha_1-a_k\beta_k)^2P_k+(\alpha_1-a_k\gamma_k)^2Q_k\Big) \label{eq:N_1}\\ N_2(\alpha_2,\underline{\gamma},\underline{\beta},\lambda)&=\alpha_2^2+\sum_k\bigg((\alpha_2-\lambda a_k\gamma_k-b_k\gamma_k)^2Q_k+(\alpha_2-\lambda a_k\beta_k-b_k\beta_k)^2P_k\bigg) \label{eq:N_2} \end{align} \label{thm:two_sums} \end{theorem} \begin{proof} Let $\ve t_k$ be the lattice codeword of user $k$ and $\ve d_k$ the dither uniformly distributed in $\mathcal V_k^s/\beta_k$. The channel input is given as \begin{align*} \ve x_k=[\ve t_k/\beta_k+\ve d_k-\gamma_k \ve s_k/\beta_k]\mod\Lambda_k^s/\beta_k \end{align*} for some $\gamma_k$ to be determined later. In Appendix \ref{sec:appen_dirty} we show that with the channel output $\ve y$ we can form \begin{IEEEeqnarray}{rCl} \tilde {\ve y}_1&:=&\tilde {\ve z}_1+\sum_k a_{k} \tilde{\ve t}_k +\sum_k(\alpha_1-a_k\gamma_k)\ve s_k \label{eq:y1_dirty} \end{IEEEeqnarray} where $\alpha_1$ is some real numbers to be optimized later and we define $\tilde{\ve t}_k :=\ve t_k-Q_{\Lambda_k^s}(\ve t_k+\beta_k\ve d_k-\gamma_k \ve s_k)$ and $\tilde{\ve z}_1:=\sum_k(\alpha_1 -a_{k}\beta_k)\ve x_k+\alpha_1\ve z$. Due to the nested lattice construction we have $\tilde{\ve t}_k\in\Lambda$. Furthermore the term $\tilde{\ve z}_1 +\sum_k(\alpha_1-a_k\gamma_k)\ve s_k$ is independent of the sum $\sum_k a_k\tilde{\ve t}_k$ thanks to the dither and can be seen as the equivalent noise having average power per dimension $N_1(\alpha,\underline{\gamma},\underline{\beta})$ in (\ref{eq:N_1}) for $k=1, 2$. In order to decode the integer sum $\sum_k a_k\tilde{\ve t}_k$ we require \begin{align} r_k<r_k(\ve a,\underline{\gamma},\underline{\beta}):=\max_{\alpha_1}\frac{1}{2}\log^+\frac{\beta_k^2 P_k}{N_1(\alpha_1,\underline{\gamma},\underline{\beta})} \label{eq:rate_a} \end{align} Notice this constraint on $R_k$ is applicable only if $a_k\neq 0$. If we can decode $\sum_ka_k\tilde{\ve t}_k$ with positive rate, the idea of successive interference cancellation can be applied. We show in Appendix \ref{sec:appen_dirty} that for decoding the second sum we can form \begin{IEEEeqnarray}{rCl} \tilde{\ve y}_2&:=&\tilde{\ve z}_2+\sum_k(\alpha_2-\lambda a_k\gamma_k-b_k\gamma_k)\ve s_k+\sum_kb_k\tilde{\ve t}_k \label{eq:y2_dirty} \end{IEEEeqnarray} where $\alpha_2$ and $\lambda$ are two real numbers to be optimized later and we define $\tilde{\ve z}_2:=\sum_k(\alpha_2 -\lambda a_k\beta_k-b_k\beta_k)\ve x_k+\alpha_2\ve z$. Now the equivalent noise $\tilde{\ve z}_2+\sum_k(\alpha_2-\lambda a_k\gamma_k-b_k\gamma_k)\ve s_k$ has average power per dimension $N_2(\alpha_2,\underline{\gamma},\underline{\beta},\lambda)$ given in (\ref{eq:N_2}). Using lattice decoding we can show the following rate pair for decoding $\sum_kb_k\tilde{\ve t}_k$ is achievable \begin{IEEEeqnarray}{rCl} r_k<r_k(\ve b|\ve a, \underline{\gamma},\underline{\beta}):=\max_{\alpha_2,\lambda}\frac{1}{2}\log^+\frac{\beta_k^2 P_k}{N_2(\alpha_2,\underline{\gamma},\underline{\beta},\lambda)} \label{eq:rate_b} \end{IEEEeqnarray} Again the lattice points $\tilde{\ve t}_k$ can be solved from the two sums if $\ve a$ and $\ve b$ are linearly independent, and $\ve t_k$ is recovered by the modulo operation $\ve t_k=[\tilde{\ve t}_k]\mbox{mod }\Lambda_k^s$ even if $\ve s_k$ is not known at the receiver. Again if we have $b_k=0$, the above constraint does not apply to $R_k$. \end{proof} \subsection{Decoding one integer sum}\label{subsec:one_sum} We revisit the results obtained in \cite{philosof_lattice_2011} and show they can be obtained in our framework in a unified way. \begin{theorem}[\cite{philosof_lattice_2011} Theorem 2, 3] For the dirty multiple access channel given in (\ref{eq:doubly_dirty_mac}), we have the following achievable rate region: \begin{IEEEeqnarray*}{rCl} &R_1&+R_2=\begin{cases} \frac{1}{2}\log(1+\min\{P_1,P_2\})\: &\text{if }\sqrt{P_1P_2}-\min\{P_1,P_2\}\geq 1\\ \frac{1}{2}\log^+\left(\frac{P_1+P_2+1}{2+(\sqrt{P_1}-\sqrt{P_2})^2}\right)\:&\text{otherwise} \end{cases} \end{IEEEeqnarray*} \label{thm:single_sum} \end{theorem} \begin{remark}The above rate region was obtained by considering the transmitting scheme where only one user transmits at a time. In our framework, it is the same as assuming one transmitted signal, say $\ve t_1$, is set to be $\ve 0$ and known to the decoder. In this case we need only one integer sum to decode $\ve t_2$. Here we give a proof to show the achievability for \begin{align} R_2= \begin{cases} \frac{1}{2}\log(1+P_2)&\quad\text{for } P_1\geq \frac{(P_2+1)^2}{P_2}\\ \frac{1}{2}\log(1+P_1)&\quad\text{for } P_2\geq \frac{(P_1+1)^2}{P_1}\\ \frac{1}{2}\log^+\left(\frac{P_1+P_2+1}{2+(\sqrt{P_1}-\sqrt{P_2})^2}\right)&\quad\text{otherwise} \end{cases} \label{eq:single_sum_r2} \end{align} while $R_1=0$. Theorem \ref{thm:single_sum} is obtained by showing the same result holds when we switch the two users and a time-sharing argument. \end{remark} \begin{proof} Choosing $\ve a=(1,1)$ and $\gamma_1=\gamma_2=\alpha_1$ in (\ref{eq:rate_a}), we can decode the integer sum $\sum_k \tilde{\ve t}_k$ if \begin{IEEEeqnarray}{rCl} r_2<r_2(\ve a,\underline{\beta} &=&\frac{1}{2}\log\frac{P_2(1+P_1+P_2)}{r^2P_1+P_2+P_1P_2(r-1)^2} \label{eq:r2_r} \end{IEEEeqnarray} by choosing the optimal $\alpha_1^*=\frac{\beta_1P_1+\beta_2P_2}{P_1+P_2+1}$ and defining $r:=\beta_1/\beta_2$. An important observation is that in order to extract $\ve t_2$ from the integer sum (assuming $\ve t_1=\ve 0$) \begin{align*} \sum_k \tilde{\ve t}_k=\ve t_2-Q_{\Lambda_2^s}(\ve t_2+\beta_2\ve d_2-\gamma_2\ve s_2)-Q_{\Lambda_1^s}(\beta_1\ve d_1-\gamma_1\ve s_1), \end{align*} one sufficient condition is $\Lambda_1^s\subseteq\Lambda_2^s$. Indeed, due to the fact that $[\ve x]\mbox{mod }\Lambda_2^s=0$ for any $\ve x\in\Lambda_1^s\subseteq\Lambda_2^s$, we are able to recover $\ve t_2$ by performing $[\sum_k\tilde{\ve t}_k]\mbox{mod }\Lambda_2^s$ if $\Lambda_1^s\subseteq\Lambda_2^s$. This requirement amounts to the condition $\beta_1^2P_1\geq \beta_2^2P_2$ or equivalently $r\geq \sqrt{P_2/P_1}$. Notice if we can extract $\ve t_2$ from just one sum $\sum_k\tilde{\ve t}_k$ (with $\ve t_1$ known), then the computation rate $R_2^{\ve a}=r_2(\ve a,\underline{\beta})$ will also be the message rate $R_2=r_2(\ve a,\underline{\beta})$. Taking derivative w. r. t. $r$ in (\ref{eq:r2_r}) gives the critical point \begin{align} r^*=\frac{P_2}{P_2+1} \end{align} If $r^*\geq \sqrt{P_2/P_1}$ or equivalently $P_1\geq\frac{(P_2+1)^2}{P_2}$, substituting $r^*$ in (\ref{eq:r2_r}) gives \begin{align*} R_2=\frac{1}{2}\log(1+P_2) \end{align*} If $r^*\leq \sqrt{P_2/P_1}$ or equivalently $P_1\leq \frac{(P_2+1)^2}{P_2}$, $R_2$ is non-increasing in $r$ hence we should choose $r=\sqrt{P_2/P_1}$ to get \begin{align} R_2=\frac{1}{2}\log^+\left(\frac{1+P_1+P_2}{2+(\sqrt{P_2}-\sqrt{P_1})^2}\right) \end{align} To show the result for the case $P_2\geq \frac{(P_1+1)^2}{P_1}$, we set the transmitting power of user $2$ to be $P_2'=\frac{(P_1+1)^2}{P_1}$ which is smaller or equal to its full power $P_2$ under this condition. In order to satisfy the nested lattice constraint $\Lambda_1^s\subseteq\Lambda_2^s$ we also need $\beta_1^2P_1\leq\beta_2^2P_2'$ or equivalently $r\geq \sqrt{P_2'/P_1}$. By replacing $P_2$ by the above $P_2'$ and choosing $r=\sqrt{P_2'/P_1}$ in (\ref{eq:r2_r}) we get \begin{align} R_2=\frac{1}{2}\log(1+P_1) \end{align} Interestingly under this scheme, letting the transmitting power to be $P_2'$ gives a larger achievable rate than using the full power $P_2$ in this power regime. \end{proof} An outer bound on the capacity region given in \cite[Corollary 2]{philosof_lattice_2011} states that the sum rate capacity should satisfy \begin{align} R_1+R_2\leq \frac{1}{2}\log(1+\min\{P_1,P_2\}) \end{align} for strong interference (both $Q_1, Q_2$ go to infinity). Hence in the strong interference case, the above achievability result is either optimal (when $P_1, P_2$ are not too close) or only a constant away from the capacity region (when $P_1, P_2$ are close, see \cite[Lemma 3]{philosof_lattice_2011}). However the rates in Theorem \ref{thm:single_sum} are strictly suboptimal for general interference strength as we will show in the sequel. \subsection{Decoding two integer sums} Now we consider decoding two sums for the Gaussian dirty MAC by evaluating the achievable rates stated in Theorem \ref{thm:two_sums}. Unlike the case of the clean MAC studied in Section \ref{sec:MAC_2usr}, here we need to optimize over $\underline{\gamma}$ for given $\ve a, \ve b$ and $\underline{\beta}$, which does not have a closed-form solution due to the $\min\{\cdot\}$ operation. Hence in this section we resort to numerical methods for evaluations. To give an example of the advantage for decoding two sums, we show achievable rate regions in Figure \ref{fig:RateRegion_doublyDirty} for a dirty MAC where $P_1=Q_1=10$ and $P_2=Q_2=2$. We see in the case when the transmitting power and interference strength are comparable, decoding two sums gives a significantly larger achievable rate region. In this example we choose the coefficients to be $\ve a=(a_1,1),\ve b=(1,0)$ or $\ve a=(1,a_2),\ve b=(1,0)$ for $a_1,a_2=1,\ldots, 5$ and optimize over parameters $\underline{\gamma}$. We also point out that unlike the case of the clean MAC where it is best to choose $a_1, a_2$ to be $1$, here choosing coefficients $a_1, a_2$ other than $1$ gives larger achievable rate regions in general. \begin{figure}[!h] \centering \includegraphics[scale=0.45]{RateRegion_P1_10_P2_2.eps} \caption{We consider a dirty MAC with $P_1=Q_1=10$ and $P_2=Q_2=2$. The dashed line is the achievable rate region given in Theorem \ref{thm:single_sum} from \cite{philosof_lattice_2011} which corresponds to decoding only one sum. The solid line gives the achievable rate region in Theorem \ref{thm:two_sums} by decoding two sums with the coefficients $\ve a=(a_1,1),\ve b=(1,0)$ or $\ve a=(1,a_2),\ve b=(1,0)$ for $a_1,a_2=1,\ldots, 5$ and optimizing over parameters $\underline{\gamma}$.} \label{fig:RateRegion_doublyDirty} \end{figure} Different from the point-to-point Gaussian channel with interference known at the transmitter, it is no longer possible to eliminate all interference completely without diminishing the capacity region for the dirty MAC. The proposed scheme provides us with a way of trading off between eliminating the interference and treating it as noise. Figure \ref{fig:compare} shows the symmetric rate of the dirty MAC as a function of interference strength. When the interference is weak, the proposed scheme balances the residual interference $\ve s_1, \ve s_2$ in $N_1$, see Eqn. (\ref{eq:N_1}) and $N_2$, see Eqn. (\ref{eq:N_2}) by optimizing the parameters $\underline{\gamma}$. This is better than only decoding one sum in which we completely cancel out the interference. \begin{figure}[!h] \centering \includegraphics[scale=0.55]{compare_SymRate_P_1_diff_X0.eps} \caption{We consider a dirty MAC with $P_1=P_2=1$ and $Q_1=Q_2=\alpha P_1$ with different $\alpha$ varying from $[0,4.5]$. The vertical axis denotes the maximum symmetric rate $R_1=R_2$. The dotted line is the maximum symmetric rate $1/4\log(1+P_1+P_2)$ for a clean MAC as an upper bound. The dashed line gives the achievable symmetric rate in Theorem \ref{thm:single_sum} from \cite{philosof_lattice_2011} and the solid line depicts the symmetric rate in Theorem \ref{thm:two_sums} by decoding two sums. } \label{fig:compare} \end{figure} As mentioned in the previous subsection, decoding one integer sum is near-optimal in the limiting case when both interference signals $\ve s_1, \ve s_2$ are very strong, i.e., $Q_1,Q_2\rightarrow \infty$. It is natural to ask if we can do even better by decoding two sums in this case. It turns out in the limiting case we are not able to decode two linearly independent sums with this scheme. \begin{lemma}[Only one sum for high interference] For the $2$-user dirty MAC in (\ref{eq:doubly_dirty_mac}) with $Q_1, Q_2\rightarrow\infty$, we have $r_k(\ve a,\underline{\gamma},\underline{\beta})=r_k(\ve b|\ve a,\underline{\gamma},\underline{\beta})=0, k=1,2 $ for any linearly independent $\ve a, \ve b$ where $a_k\neq 0$, $k=1,2$. \end{lemma} \begin{proof} The rate expressions in (\ref{eq:rate_a}) and (\ref{eq:rate_b}) show that we need to eliminate all terms involving $Q_k$ in the equivalent noise $N_1$ in (\ref{eq:N_1}) and $N_2$ in (\ref{eq:N_2}), in order to have a positive rate when $Q_1,Q_2\rightarrow\infty$. Consequently we need $\alpha_1-a_k\gamma_k=0$ and $\alpha_2-\lambda a_k\gamma_k-b_k\gamma_k=0$ for $k=1,2$. or equivalently \begin{align} \begin{pmatrix} 1 &0 &-a_1 &0\\ 0 &1 &-\lambda a_1-b_1 &0\\ 1 &0 &0 &-a_2\\ 0 &1 &0 &-\lambda a_2-b_2 \end{pmatrix} \begin{pmatrix} \alpha_1\\ \alpha_2\\ \gamma_1\\ \gamma_2 \end{pmatrix} =\ve 0 \end{align} Performing elementary row operations gives the following equivalent system \begin{align} \begin{pmatrix} 1 &0 &-a_1 &0\\ 0 &1 &-\lambda a_1-b_1 &0\\ 0 &0 &a_1 &-a_2\\ 0 &0 &0 &\frac{a_2(\lambda a_1+b_1)}{a_1}-\lambda a_2-b_2 \end{pmatrix} \begin{pmatrix} \alpha_1\\ \alpha_2\\ \gamma_1\\ \gamma_2 \end{pmatrix} =\ve 0 \end{align} To have non-trivial solutions of $\underline{\alpha}$ and $\gamma$ with $a_1\neq 0$, we must have $\frac{a_2(\lambda a_1+b_1)}{a_1}-\lambda a_2-b_2=0$, which simplifies to $a_2b_1=a_1b_2$, meaning $\ve a$ and $\ve b$ are linearly dependent. \end{proof} This observation suggests that when both interference signals are very strong, the strategy in \cite{philosof_lattice_2011} to let only one user transmit at a time (section \ref{subsec:one_sum}) is the best thing to do within this framework. However we point out that in the case when only one interference is very strong, we can still decode two independent sums with positive rates. For example consider the system in (\ref{eq:doubly_dirty_mac}) with $\ve s_2$ being identically zero, $\ve s_1$ only known to User 1 and $Q_1\rightarrow\infty$. In this case we can decode two linearly independent sums with $\ve a=(1,1), \ve b=(1,0)$ or $\ve a=(1,0), \ve b=(0,1)$. The resulting achievable rates with Theorem \ref{thm:two_sums} is the same as that given in \cite[Lemma 9]{philosof_lattice_2011}. Moreover, the capacity region of the dirty MAC with only one interference signal commonly known to both users \cite[VIII]{philosof_lattice_2011} can also be achieved using Theorem \ref{thm:two_sums}, by choosing $\ve a=(1,0), \ve b=(0,1)$ for example. \section{Concluding Remarks}\label{sec:conclusion} We have shown that the lattice code combined with a compute-and-forward technique is able to achieve the capacity of multiple access channels. This coding scheme is of possible practical interests because it only uses a single-user decoder without time-sharing or rate-splitting techniques. The proposed coding scheme is a generalization of the celebrated compute-and-forward technique and can be applied to many other Gaussian network scenarios. However as we have seen in the $2$-user and $3$-user examples, the capacity-achieving ability of this scheme fails if the signal-to-noise ratio is low. The reason lies in the fact that in this regime the computation rate pair is not large enough (recall the examples in Theorem \ref{thm:clean_MAC}). Hence it is interesting to ask what is the largest possible computation rate tuple in a Gaussian MAC. The answer to this question has implications on many other unsolved network communication problems, including the Gaussian interference channel and the Gaussian two-way relay channel. \appendices \section{The proof of Theorem \ref{thm:computation_rate}}\label{sec:appen_proof_computation} A proof of the $2$-user case of Theorem \ref{thm:computation_rate} is already contained in the proof of Theorem \ref{thm:MAC_general}. We now give a proof for the $K$-user case. When the message (codeword) $\ve t_k$ is given to encoder $k$, it forms its channel input as follows \begin{align} \ve x_k=\left[\ve t_k/\beta_k+\ve d_k\right]\mbox{mod }\Lambda_k^s/\beta_k \end{align} where the dither $\ve d_k$ is a random vector uniformly distributed in the scaled Voronoi region $\mathcal V_k^s/\beta_k$. Notice that $\ve x_k$ is independent from $\ve t_k$ and also uniformly in $\Lambda_k^s/\beta_k$ hence has average power $P$ for all $k$. At the decoder we form \begin{IEEEeqnarray}{rCl} \tilde {\ve y}&:=&\alpha\ve y-\sum_ka_{k}\beta_k\ve d_k\\ &=&\sum_k a_{k}\left(\beta_k (\ve t_k/\beta_k+\ve d_k)-\beta_k Q_{\Lambda_k^s/\beta_k}(\ve t_k/\beta_k+\ve d_k)\right)-\sum_ka_{k}\beta_k\ve d_k+\tilde{\ve z}\\ &\stackrel{(a)}{=}&\tilde {\ve z}+\sum_k a_{k} (\ve t_k-Q_{\Lambda_k^s}(\ve t_k+\beta_k\ve d_k))\\ &:=&\tilde {\ve z}+\sum_k a_{k} \tilde{\ve t}_k \end{IEEEeqnarray} with $\tilde {\ve t}_k:=\ve t_k-Q_{\Lambda_k^s}(\ve t_k+\beta_k\ve d_k)$ and the equivalent noise \begin{IEEEeqnarray}{rCl} \tilde {\ve z}:=\sum_k(\alpha h_{k}-a_{k}\beta_k)\ve x_k+\alpha\ve z \end{IEEEeqnarray} which is independent of $\sum_k a_{k}\tilde{\ve t}_k$ since all $\ve x_k$ are independent of $\sum_k a_{k}\tilde {\ve t}_k$ thanks to the dithers $\ve d_k$. The step $(a)$ follows because it holds $Q_{\Lambda}(\beta X)=\beta Q_{\frac{\Lambda}{\beta}}(X)$ for any $\beta\neq 0$. Notice we have $\tilde {\ve t}_k\in\Lambda$ since $\ve t_k\in\Lambda$ and $\Lambda_k^s\subseteq\Lambda$ due to the code construction. Hence the linear combination $\sum_k a_{k}\tilde{\ve t}_k$ along belongs to the decoding lattice $\Lambda$. The decoder uses lattice decoding to obtain $\sum_ka_{k}\tilde{\ve t}_k$ with respect to the decoding lattice $\Lambda$ by quantizing $\tilde {\ve y}$ to its nearest neighbor in $\Lambda$. The decoding error probability is equal to the probability that the equivalent noise $\tilde {\ve z}$ leaves the Voronoi region surrounding the lattice point representing $\sum_ka_{mk}\tilde{\ve t}_k$. If the fine lattice $\Lambda$ used for decoding is good for AWGN channel, as it is shown in \cite{ErezZamir_2004}, the probability $\prob{\tilde {\ve z}_m\notin \mathcal V}$ goes to zero exponentially if \begin{IEEEeqnarray}{rCl} \frac{\mbox{Vol }(\mathcal V)^{2/n}}{N(\alpha)}> 2\pi e \label{eq:volume_to_noise} \end{IEEEeqnarray} where \begin{align} N(\alpha):=\mathbb E\norm{\tilde {\ve z}}^2/n=\norm{\alpha\ve h-\tilde{\ve a}}^2P+\alpha^2 \end{align} denotes the average power per dimension of the equivalent noise. Recall that the shaping lattice $\Lambda_k^s$ is good for quantization hence we have \begin{IEEEeqnarray}{rCl} \mbox{Vol }(\mathcal V_k^s)=\left(\frac{\beta_k^2P}{G(\Lambda_k^s)}\right)^{n/2} \end{IEEEeqnarray} with $G(\Lambda_k^s)2\pi e<(1+\delta)$ for any $\delta>0$ if $n$ is large enough \cite{ErezZamir_2004}. Together with the message rate expression in (\ref{eq:message_rate_lattice}) we can see that lattice decoding is successful if $\beta_k^2P2^{-2R_k}/G(\Lambda_k^s)>2\pi e N$ for every $k$, or equivalently \begin{IEEEeqnarray*}{rCl} r_k<\frac{1}{2}\log\left(\frac{P}{N(\alpha)}\right)+\frac{1}{2}\log\beta_k^2-\frac{1}{2}\log(1+\delta) \end{IEEEeqnarray*} By choosing $\delta$ arbitrarily small and optimizing over $\alpha$ we conclude that the lattice decoding of $\sum_ka_k\tilde{\ve t}_k$ will be successful if \begin{align} r_k<\max_{\alpha}\frac{1}{2}\log\left(\frac{P}{N(\alpha)}\right)+\frac{1}{2}\log\beta_k^2=R_k^{\ve a} \end{align} with $R_k^{\ve a}$ given in (\ref{eq:compute_rate}). Finally, since there is a one-to-one mapping between $\tilde {\ve t}_k$ and $\ve t_k$ when the dithers $\ve d_k$ are known, we can also recover $\sum_ka_k\ve t_k$. \section{Derivations in the proof of Theorem \ref{thm:clean_MAC}}\label{sec:appen_proof_clean} Here we prove the claim in Theorem \ref{thm:clean_MAC} that $\beta_2^{(1)},\beta_2^{(2)}\in[\beta_2',\beta_2'']$ if and only if the Condition (\ref{eq:AchieCap_whole}) holds. Recall we have defined $\beta_2^{(1)}:=\frac{h_1h_2P}{1+h_1^2P}$, $\beta_2^{(2)}:=\frac{1+h_2^2P}{h_1h_2P}$ and $\beta_2',\beta_2''$ in Eqn. (\ref{eq:roots}). With the choice $\ve a=(1,1)$ we can rewrite (\ref{eq:roots}) as \begin{align} \beta_2':=\frac{2h_1h_2P+S-\sqrt{SD}}{2(1+h_1^2P)}\\ \beta_2'':=\frac{2h_1h_2P+S+\sqrt{SD}}{2(1+h_1^2P)} \end{align} with $S:=\sqrt{1+h_1^2P+h_2^2P}$ and $D:=4Ph_1h_2-3S$. Clearly the inequality $\beta_2'\leq \beta_2^{(1)}$ holds if and only if $S-\sqrt{SD}\leq 0$ or equivalently \begin{align} \frac{Ph_1h_2}{\sqrt{1+h_1^2P+h_2^2P}}\geq 1 \end{align} which is just Condition (\ref{eq:AchieCap_whole}). Furthermore notice that $\beta_2^{(1)}<\frac{h_2}{h_1}P<\beta_2^{(2)}$ hence it remains to prove that $\beta_2^{(2)}\leq \beta_2''$ if and only if (\ref{eq:AchieCap_whole}) holds. But this follows immediately by noticing that $\beta_2^{(2)}\leq \beta_2''$ can be rewritten as \begin{align} 2S^2\leq h_1h_2P(S+\sqrt{SD}) \end{align} which is satisfied if and only if $S\leq D$, or equivalently Condition (\ref{eq:AchieCap_whole}) holds. \section{The derivations in the proof of Theorem \ref{thm:two_sums}}\label{sec:appen_dirty} In this section we give the derivation of the expressions of $\tilde{\ve y}_1$ in (\ref{eq:y1_dirty}) and $\tilde{\ve y}_2$ in (\ref{eq:y2_dirty}). To obtain $\tilde{\ve y}_1$, we process the channel output $\ve y$ as \begin{IEEEeqnarray}{rCl} \tilde {\ve y}_1&:=&\alpha_1\ve y-\sum_ka_{k}\beta_k\ve d_k\nonumber\\ &=&\underbrace{\sum_k(\alpha_1 -a_{k}\beta_k)\ve x_k+\alpha_1\ve z}_{\tilde{\ve z}_1}+\alpha_1 \sum_k\ve s_k+\sum_k a_{k}\beta_k\ve x_k-\sum_ka_{k}\beta_k\ve d_k\\ &=&\tilde{\ve z}_1+\alpha_1\sum_k\ve s_k+\sum_k a_{k}\beta_k (\ve t_k/\beta_k+\ve d_k-\gamma_k\ve s_k/\beta_k)\\ &&-\sum_k a_k\beta_k Q_{\Lambda_k^s/\beta_k}(\ve t_k/\beta_k+\ve d_k-\gamma_k\ve s_k/\beta_k)-\sum_ka_{k}\beta_k\ve d_k\\ &=&\tilde {\ve z}_1+\sum_k a_{k} (\ve t_k-Q_{\Lambda_k^s}(\ve t_k+\beta_k\ve d_k-\alpha_1 \ve s_k))+\sum_k(\alpha_1-a_k\gamma_k)\ve s_k\\ &=&\tilde {\ve z}_1+\sum_k a_{k} \tilde{\ve t}_k +\sum_k(\alpha_1-a_k\gamma_k)\ve s_k \end{IEEEeqnarray} When the sum $\sum_k a_{k} \tilde{\ve t}_k$ is decoded, the term $\tilde{\ve z}_1 +\sum_k(\alpha_1-a_k\gamma_k)\ve s_k$ which can be calculated using $\tilde{\ve y}_1$ and $\sum_ka_k\tilde{\ve t}_k$. For decoding the second sum we form the following with some numbers $\alpha_2'$ and $\lambda$: \begin{IEEEeqnarray}{rCl} \tilde{\ve y}_2&:=&\alpha_2'\ve y+\lambda\left(\tilde{\ve z}_1 +\sum_k(\alpha_1-a_k\gamma_k)\ve s_k\right)-\sum_kb_k\beta_k\ve d_k\\ &=&\alpha_2'(h_1\ve x_1+h_2\ve x_2+\ve s_1+\ve s_2+\ve z)+\sum_k(\lambda\alpha_1h_k-\lambda a_k\beta_k)\ve x_k+\lambda\alpha_1\ve z+\lambda\sum_k(\alpha_1-a_k\gamma_k)\ve s_k\\ &=&\sum_k(\alpha_2' +\lambda \alpha_1-\lambda a_k\beta_k)\ve x_k+(\alpha_2'+\lambda\alpha_1)\ve z+\sum_k(\alpha_2'+\lambda\alpha_1- \lambda a_k\gamma_k)\ve s_k-\sum_kb_k\beta_k\ve d_k\\ &: =&\sum_k(\alpha_2-\lambda a_k\beta_k)\ve x_k+\alpha_2\ve z+\sum_k(\alpha_2- \lambda a_k\gamma_k)\ve s_k-b_k\beta_k\ve d_k \end{IEEEeqnarray} by defining $\alpha_2:=\alpha_2'+\lambda\alpha_1$. In the same way as deriving $\tilde{\ve y}_1$, we can show \begin{IEEEeqnarray*}{rCl} \tilde{\ve y}_2&=&\underbrace{\sum_k(\alpha_2 -\lambda a_k\beta_k-b_k\beta_k)\ve x_k+\alpha_2\ve z}_{\tilde{\ve z}_2}+\sum_k(\alpha_2-\lambda a_k\gamma_k)\ve s_k+\sum_k b_k\beta_k\ve x_k-\sum_kb_k\beta_k\ve d_k\\ &=&\tilde{\ve z}_2+\sum_k(\alpha_2-a_k\gamma_k)\ve s_k+ \sum_k b_{k}\left(\beta_k (\ve t_k/\beta_k+\ve d_k-\gamma_k\ve s_k/\beta_k)-\beta_k Q_{\Lambda_k^s/\beta_k}(\ve t_k/\beta_k+\ve d_k-\gamma_k\ve s_k/\beta_k)\right)-\sum_kb_k\beta_k\ve d_k\\ &=&\tilde{\ve z}_2+\sum_k(\alpha_2-\lambda a_k\gamma_k-b_k\gamma_k)\ve s_k+\sum_kb_k\tilde{\ve t}_k \end{IEEEeqnarray*} by defining $\alpha_2:=\alpha_2'+\lambda\alpha_1$ and $\tilde{\ve z}_2:=\sum_k(\alpha_2 -\lambda a_k\beta_k-b_k\beta_k)\ve x_k+\alpha_2\ve z$. \section*{Acknowledgment} The authors wish to thank Chien-Yi Wang, Bobak Nazer and Sung Hoon Lim for helpful comments. \bibliographystyle{IEEEtran}
{'timestamp': '2014-08-01T02:11:07', 'yymm': '1407', 'arxiv_id': '1407.8463', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8463'}
arxiv
\section{Introduction} Linear regression is one of the most broadly and frequently used statistical tools. Despite hundreds of years of research on the subject \cite{legendre1805nouvelles}, modern applications of linear regression to large datasets present a number of new challenges. Modern applications of linear regression, such as Genome Wide Association Studies (GWAS), often consider datasets that have at least as many potential variables (or features) as there are data points \cite{mccarthy2008genome}. Applying linear regression to high dimensional datasets often involves selecting a subset of relevant features, a problem known as feature selection in the literature on statistics and machine learning \cite{guyon2003introduction}. Even for classical least-squares linear regression, it turns out that the associated feature selection problem is quite difficult \cite{huo2007stepwise}. The difficulties associated with feature selection are especially pronounced in genomics and GWAS. In general, the goal of many genomics studies is to identify a relationship between a small number of genes and a phenotype of interest, such as height or body mass index \cite{mccarthy2008genome, peng2010regularized,burton2007genome,subramanian2005gene,wu2009genome}. For example, many GWAS seek to identify specific genetic mutations (called single nucleotide polymorphisms or SNPs) that best explain the variation of a quantitative trait, such as height or body mass index, in a population \cite{yang2012conditional}. Using various techniques, the trait is regressed against binary variables representing the presence or absence of the SNPs in order to find a subset of SNPs that are highly explanatory for the trait \cite{wu2009genome,peng2010regularized}. Although the number of individuals genotyped in such a study may be in the thousands or even tens of thousands, this pales in comparision to the number of potential SNPs which can be in the millions \cite{mccarthy2008genome}. Moreover, the presence or absence of various SNPs tend to be correlated due to chromosome structure and genetic processes that induce so-called linkage disequilibrium \cite{yang2012conditional}. As a result, selecting the best subset of SNPs for the regression involves a search for the global minimum of a landscape that is both high dimensional (due to the large number of SNPs) and rugged (due to correlations between SNPs). The obstacles that make feature selection difficult in GWAS also occur in many other applications of linear regression to big datasets. In fact, the task of finding the optimal subset of features is proven, in general, to be NP-hard \cite{huo2007stepwise}. Therefore, it is usually computationally prohibitive to search over all possible subsets of features and one has to resort to other methods of feature selection. For example, forward (or backward) selection adds (or eliminates) one feature at a time to the regression in a greedy manner \cite{guyon2003introduction}. Alternatively, one may use heuristic methods such as Sure Independence Screening (SIS) \cite{fan2008sure}, which selects features independently based on their correlation with the response, or Minimum Redundancy Maximum Relevance (MRMR) \cite{ding2005minimum}, which penalizes features that are correlated with each other. The most popular approaches to feature selection for linear regression, however, are penalized least-squares methods \cite{hoerl1970ridge,tibshirani1996regression,zou2005regularization,candes2007dantzig} that introduce a penalty function that penalizes large regression coefficients. Common choices for the penalty function include a L2 penalty, called `Ridge' regression \cite{hoerl1970ridge}, and a L1 penalty, commonly referred to as LASSO regression \cite{tibshirani1996regression}. Penalized methods for linear regression typically have natural interpretations as Bayesian approaches with appropriately chosen prior distributions. For example, L2 penalized regression can be derived by maximizing the posterior distribution obtained with a Gaussian prior on the regression coefficients. Similarly, L1 penalized regression can be derived by maximizing the posterior distribution obtained with a Laplace (i.e.\ double-exponential) prior on the regression coefficients. Within a Bayesian framework, relevant features are those with the highest posterior probabilities. However, calculating exact marginal posterior probabilities is generally intractable for high dimensional problems; as a result, the posterior distribution of feature relevance must be explored using Monte Carlo simulations, highlighting the crucial need for new approaches to feature selection \cite{george1993variable,li2010bayesian}. Inspired by the success of statistical physics approaches to hard problems in computer science \cite{monasson1999determining,mezard2002analytic} and statistics \cite{bialek1996field,nemenman2002occam,balasubramanian1997statistical,malzahn2005statistical,periwal1997reparametrization}, we study high dimensional regression in the ``strongly-regularized regime'' where the prior distribution has a profound influence on the estimators. In the regime where the regression problem is strongly regularized by the prior, we show that the marginal posterior probabilities of feature relevance for L2 penalized regression are well-approximated by the magnetizations of an appropriately chosen Ising model. For this reason, we call our approach the Bayesian Ising Approximation (BIA) of the posterior distribution. Using the BIA, the posterior probabilities can be computed without resorting to Monte Carlo simulation using an efficient mean field approximation that facilitates the analysis of very high dimensional datasets. We envision the BIA as part of a two-stage procedure where the BIA is applied to rapidly screen irrelevant variables, i.e.\ those that have low rank in posterior probability, before applying a more computationally intensive cross validation procedure to infer the regression coefficients for the reduced feature set. Our work is especially well suited to modern feature selection problems where the number of features, $p$, is often larger than the sample size, $n$. Our approach differs significantly from previous methods for feature selection. Traditionally, penalized regression and related Bayesian approaches have focused on the ``weakly-regularized regime'' where the effect of the prior is assumed to be negligable as the sample size tends to infinity. The underlying intuition for considering the weak-regularization regime is that as long as the prior (i.e.\ the penalty parameter) is strong enough to regularize the inference problem, a less influential prior distribution should be better suited for feature selection and prediction tasks because it ``allows the data to speak for themselves''. In the machine learning literature, the penalty parameter is usually chosen using cross validation to maximize out-of-sample predictive ability \cite{tibshirani1996regression,zou2005regularization}. A similar aesthetic is also reflected in the abundant literature on `objective' priors for Bayesian inference \cite{ghosh2011objective}. As expected, these weakly regularizing approaches perform well when the sample size exceeds the number of features ($n \gg p$). However, for high dimensional inference where the number of features can greatly exceed the sample size ($p \gg n$), very strong priors may be required. Our BIA approach exploits the large penalty parameter in this strongly regularized regime to efficiently calculate marginal posterior probabilities using methods from statistical physics. The paper is organized as follows: in Section \ref{regress}, we review Bayesian linear regression; in Section \ref{select}, we derive the BIA using a series expansion of the posterior distribution and describe the associated algorithm for variable selection; and in Section \ref{examples} we present (A) analytical results and simulations on the performance of the BIA using features with a constant correlation, (B) we analyze a real dataset for predicting bodyfat percentage from 12 different body measurements, and (C) we analyze a real dataset for predicting a quantitative phenotypic trait from data on the expression of 28,395 genes in soybeans. \section{Bayesian Linear Regression} \label{regress} In this section, we briefly review the necessary aspects of Bayesian linear regression. This entire section follows standard arguments, the details of which can be found in many textbooks on Bayesian statistics e.g.\ \cite{o2004bayesian}. The goal of linear regression is to infer the set of coefficients $\b_j$ for $j = 1, \ldots, p$ that describe the relationship $y = \bold{x}^T \boldsymbol{\b} + \eta $ from $n$ observations $(y_i, \bold{x}_i)$ for $i = 1, \ldots, n$. Here, $\bold{x}$ is a ($1 \times p)$ vector of features and $\eta \sim \mathcal{N}(0,\sigma^2)$ is a Gaussian distributed random variable with unknown variance $\sigma^2$. Without loss of generality, we will assume throughout this paper that the data are standardized with $ \sum_i y_i = 0$, $\sum_i y_i^2 = n$, $\sum_i (\bold{x}_{i})_j = 0$, and $\sum_i (\bold{x}_{i})_j^2 = n$ so that it is not necessary to include an intercept term in the regression. Penalized least-squares methods estimate the regression coefficients by minimizing a convex objective function in the form of: \be U(\boldsymbol{\b}) = \sum_i (y_i - \bold{x}_i^T \boldsymbol{\b})^2 + \l f(\boldsymbol{\b}) \label{eq:errors} \ee where $f(\boldsymbol{\b})$ is a function that penalizes large regression coefficients and $\l$ is the strength of the penalty. Common choices for the penalty function include $f(\boldsymbol{\b}) = \sum_j \b_j^2$ for L2 penalized or `Ridge' regression \cite{hoerl1970ridge}, and $f(\boldsymbol{\b}) = \sum_j |\b_j|$ for L1 penalized or LASSO regression \cite{tibshirani1996regression}. The standard least-squares (and maximum likelihood) estimate $\boldsymbol{\hat{\b}} = (X^T X)^{-1} X^T \bold{y}$ is recovered by setting $\l = 0$, where $X$ is the $(n \times p)$ design matrix with rows $\bold{x}_i$. Adding a penalty to the least-squares objective function mitigates instability that results from computing the inverse of the $X^T X$ matrix. In the case of the L1 penalty, many of the regression coefficients end up being shrunk exactly to zero resulting in a type of automatic feature selection \cite{tibshirani1996regression,zou2005regularization,candes2007dantzig}. Bayesian methods combine the information from the data, described by the likelihood function, with \emph{a priori} knowledge, described by a prior distribution, to construct a posterior distribution that describes one's knowledge about the parameters after observing the data. In the case of linear regression, the likelihood function is a Gaussian: \be P(\bold{y} | \boldsymbol{\b}, \sigma^2) = \left(\frac{1}{\sqrt{2 \pi \sigma^2}}\right)^n \exp \left( - \frac{(\bold{y} - X^T \boldsymbol{\b})^T (\bold{y} - X^T \boldsymbol{\b})} {2\sigma^2} \right) \ee In this work, we will use standard conjugate prior distributions for $\boldsymbol{\b}$ and $\sigma^2$ given by $P(\boldsymbol{\b},\sigma^2 | \bold{s}) = P(\sigma^2) P(\boldsymbol{\b}|\sigma^2, \bold{s})$ where: \begin{align} P(\sigma^2) &\propto (\sigma^2)^{-(a_0 + 1)} \exp(-b_0 / \sigma^2 ) \\ P(\boldsymbol{\b} | \sigma^2, \bold{s}) &\propto \prod_j \HF \left[ (1-s_j) \d(\b_j ) + (1+s_j) \sqrt{ \frac{\l}{2 \pi \sigma^2}} \exp\left(-\frac{\l \b_j^2}{2 \sigma^2}\right) \right] \end{align} These distributions were chosen because they ensure that the posterior distribution can be obtained in closed-form \cite{o2004bayesian}. Here, we have introduced a vector ($\bold{s}$) of indicator variables so that $\b_j = 0$ if $s_j = -1$ and $\b_j \neq 0$ if $s_j = +1$. We also have to specify a prior for the indicator variables, which we will set to a flat prior $P(\bold{s}) \propto 1$ for simplicity. In principle, $a_0$, $b_0$ and the penalty parameter on the regression coefficients, $\l$, are free parameters that must be specified ahead of time to reflect our prior knowledge. We will discuss these parameters in the next section. We have set up the problem so that identifying which features are relevant is equivalent to identifying those features for which $s_j = +1$. Therefore, we need to compute the posterior distribution for $\bold{s}$, which can be determined from Bayes' theorem: \begin{align} \log P_{\l}(\bold{s} | \bold{y}) &= C + \log \int d\boldsymbol{\b} d\sigma^2 P(\bold{y} | \boldsymbol{\b}, \sigma^2) P(\boldsymbol{\b} ,\sigma^2 |\bold{s}) P(\bold{s}) \nonumber \\ &= C+ \HF \ln | \l I| -\HF \ln | \l I + X _{\bold{s}}^T X_{\bold{s}} | - (a_0 + \frac{n}{2}) \ln (b_0 + \HF E_{\bold{s}}(\l)) \label{eq:posterior} \end{align} where $C$ represents a constant and $E_{\bold{s}}(\l)$ is the sum of the squared residual errors. In this expression, $q = \sum_j (1+s_j)/2$, is the number of variables with $s_j = +1$, $I$ is the $(q \times q)$ identity matrix, and $X_{\bold{s}}$ is a $(n \times q)$ restricted design matrix which only contains rows corresponding to features where $s_j = +1$. The sum of the squared residual errors is given by $E_{\bold{s}}(\l) = \bold{y}^T \bold{y} - \bold{y}^T X_{\bold{s}} \boldsymbol{\bar{\b}}_{\bold{s}}(\l)$, where $\boldsymbol{\bar{\b}}_{\bold{s}}(\l) = (\l I + X_{\bold{s}}^T X_{\bold{s} })^{-1} X_{\bold{s}}^T \bold{y}$ is the Bayesian estimate for the regression coefficients corresponding to those variables for which $s_j = +1$. In these expressions, notice that the Bayesian estimate for the regression coefficients conditioned on $\bold{s}$ (i.e.\ $\boldsymbol{\bar{\b}}_{\bold{s}}(\l)$) is equivalent to an estimate obtained with L2 penalized regression. That is, we have specifically chosen these priors to correspond to a Bayesian formulation of L2 penalized regression. Furthermore, we note that the logarithm of the posterior distribution can be partitioned into an `entropic' term ($\ln | \l I| - \ln | \l I + X _{\bold{s}}^T X_{\bold{s}} |$) measuring the variance of the posterior distribution, and an `energetic' term ($\ln (b_0 + \hf E_{\bold{s}}(\l) ) $) quantifying the fit to the data. \section{The Ising Approximation} \label{select} \subsection{Strongly Regularized Expansion} In principle, one can directly use Equation \ref{eq:posterior} to estimate the relevance of each feature using two different approaches. First, we could find the $\bold{s}$ that maximizes the posterior probability distribution. Alternatively, we could compute the marginal probabilities of feature relevance, $P_{\l}(s_j = +1 | \bold{y}) = (1+\<s_j\>) /2$, where $\<s_j\>$ is the expectation value of $s_j$ with respect to the posterior distribution, and select the features with the largest $P_{\l}(s_j = +1 | \bold{y})$. In the Bayesian setting, these two point estimates result from the use of different utility functions \cite{berger1985statistical}. Here, we will focus on computing the latter, i.e.\ the expected value of $\bold{s}$. The expectation values cannot be evaluated analytically due to the cumbersome restriction of the design matrix to those variables for which $s_j = +1$. Moreover, although the computation of the expectation values can be performed using Monte Carlo methods \cite{george1993variable,li2010bayesian}, the numerical calculations often take a long time to converge for high dimensional inference problems. Our main result -- which we call the Bayesian Ising Approximation (BIA) of the posterior distribution for feature selection -- is that a second order series expansion of Equation \ref{eq:posterior} in $\l^{-1}$ corresponds to an Ising model described by: \begin{align} \log P_{\l}(\bold{s} | \bold{y}) &\simeq C + \frac{n^2}{4 \l} \left(\sum_{i} h_i(\l) s_i + \HF \sum_{i,j; i \neq j} J_{ij}(\l) s_i s_j \right) + O\left(\frac{\text{Tr}[ (X_{\bold{s}}^T X_{\bold{s}})^3] }{\l^3}\right) \label{eq:ising} \end{align} where $\text{Tr}[\cdot]$ is the matrix trace operator and the external fields and couplings are defined as: \begin{align} h_i(\l) &= r^2(y,x_i) -\frac{1}{n} +\sum_{j} J_{ij}(\l) \label{eq:fields} \\ J_{ij}(\l) &= \frac{n}{\l} \left( \frac{r^2 (x_i,x_j)}{n} - r(x_i, x_j) r(y,x_i) r(y,x_j) + \HF r^2(y,x_i) r^2(y,x_j) \right) \label{eq:couplings} \end{align} Here, $r(z_1,z_2)$ is the Pearson correlation coefficient between variables $z_1$ and $z_2$. In writing this expression we have assumed that the hyperparameters $a_0$ and $b_0$ are small enough to neglect, though this assumption is not necessary. A detailed derivation of this result is presented in the Appendix. The series expansion converges as long as $\l > \text{Tr}[X_{\bold{s}}^T X_{\bold{s}} ]$ for all $\bold{s}$, which defines the regime that we call `strongly regularized'. Since $X_{\bold{s}}$ is the restricted design matrix for standardized data, we can relate $ \text{Tr}[X_{\bold{s}}^T X_{\bold{s}} ]$ to the covariances between $x_j$'s. In particular, Gershgorin's Circle Theorem \cite{varga2010gervsgorin} implies that the series will converge as long as $\lambda > n(1+ p \tilde{r})$ where $\tilde{r}= \frac{1}{p} \inf_{i} \sum_{j\neq i} |r(X_i, X_j)|$ (see Appendix). For large $p$, we can replace $\tilde{r}$ by the root-mean-squared correlation between features, $r =\sqrt{p^{-1}(p-1)^{-1} \sum_{i \neq j} r^2(X_i, X_j) }$. This defines a natural scale, \be \lambda^* = n(1+ p r). \ee for the penalty parameter at which the BIA is expected to breakdown. We expect the BIA to be accurate when $\l \gg \l^*$ and to breakdown when $\l \ll \l^*$. Because higher order terms in the series can be neglected, the strongly regularized expansion allows us to remove any references to the restricted design matrix, and maps the posterior distribution to the Ising model, which has been studied extensively in the physics literature. To perform feature selection, we are interested in computing marginal probabilities $P_{\l}(s_j = 1 | \bold{y}) \simeq (1+ m_j(\l) )/2$, where we have defined the magnetizations $m_j(\l) = \< s_j \>$. While there are many techniques for calculating the magnetizations of an Ising model, we focus on the mean field approximation which leads to a self-consistent equation \cite{opper20012}: \be m_i(\l) = \tanh \left[ \frac{n^2}{4 \l} \left( h_i(\l) + \HF \sum_{j \neq i} J_{ij}(\l) m_j(\l) \right) \right] \label{eq:nmf} \ee This mean field approximation provides a computationally efficient tool that approximates Bayesian feature selection for linear regression, requiring only the calculation of the Pearson correlations and solution of Equation \ref{eq:nmf}. \subsection{Computing the Feature Selection Path} As with other approaches to penalized regression, our expressions depend on a free parameter ($\l$) that determines the strength of the prior distribution. As it is usually difficult, in practice, to choose a specific value of $\l$ ahead of time it is often helpful to compute the feature selection path; i.e.\ to compute $m_j(\l)$ over a wide range of $\l$'s. Indeed, computing the variable selection path is a common practice when applying other feature selection techniques such as LASSO regression. To obtain the mean field variable selection path as a function of $\e = 1/\l$, we notice that $\lim_{\e \to 0} m_j(\e) = 0$ and so define the recursive formula: \be m_i \left(\e +\d\e\right) \approx \tanh \left[ \frac{(\e + \d\e) n^2}{4} \left( h_i\left(\e + \d\e\right) + \HF \sum_{j \neq i} J_{ij}\left(\e + \d\e\right) m_j\left(\e\right) \right) \right] \label{eq:recursive} \ee with a small step size $\d \e \ll 1/\l^{*} = n^{-1}( 1+ pr)^{-1}$. We have set $\d \e = 0.05 / \l^{*}$ in all of the examples presented below. \subsection{Remarks} The BIA provides a computationally efficient framework to calculate posterior probabilities of feature relevance as a function of $\l$ without Monte Carlo simulations. The local fields and couplings of the BIA (Eqs.\ \ref{eq:fields}, \ref{eq:couplings}) are simple functions of Pearson correlation coefficients. The most challenging computational aspect of feature selection with the BIA is the large amount of memory required for storing the $(p \times p)$ coupling matrix for very high dimensional problems. One potential route for decreasing the memory requirement is to use adaptive thresholding estimators for the correlations to obtain a sparse coupling matrix, though we do not explore this idea further in this work because memory requirements did not cause a problem for our examples even when considering datasets with $p \sim 30,000$ features. To first order in $\e= \l^{-1}$, the posterior distribution corresponds to an Ising model with fields and couplings given by $h_i = r^2(y,x_i) - 1/n$ and $J_{ij} = 0$. That is, the spin variables representing feature relevance are independent, and the probability that a feature is relevant is only a function of its squared correlation with the response. Specifically, $m_j(\l) \geq 0$ if $ |r(y,x_j)| > 1/\sqrt{n}$ and $m_j(\l) \leq 0$ if $ |r(y,x_j)| < 1/\sqrt{n}$. Therefore, the BIA demonstrates that methods that rank features by their squared Pearson correlation with the response, such as Sure Independence Screening \cite{fan2008sure}, are actually performing a first order approximation to Bayesian feature selection in the strongly regularized limit. The couplings between the spin variables representing feature relevance enter into the BIA with the second order term in $\epsilon= \l^{-1}$. A positive (or `ferrogmagnetic') coupling between spins $i$ and $j$ favors models that include both features $i$ and $j$, whereas a negative (or `antiferromagnetic') coupling favors models that include one feature or the other, but not both. In general, the coupling terms are antiferromagnetic for highly correlated variables, which minimizes the redundancy of the feature set. \section{Examples} \label{examples} We have chosen three examples to illustrate different characteristics of the BIA for Bayesian feature selection. (A) First, we consider regression problems with $p$ features that have a constant correlation $r$. We present some simple analytic expressions in the large $p$ limit that illustrate how different aspects of the problem affect feature selection performance, and study some simulated data. (B) Next, we analyze a dataset on the prediction of bodyfat percentage from various body measurements. The number of features ($p = 12$) is small enough that we can compute the exact posterior probabilties and, therefore, directly assess the accuracy of the BIA for these data. (C) Finally, we demonstrate the applicability of the BIA for feature selection on high dimensional regression problems by examining a dataset relating the expression of $p = 28395$ genes to the susceptibility of soybean plants to a pathogen. \subsection{Features with a Constant Correlation} Intuitively, one may expect that correlations between features are detrimental to feature selection. Indeed, previous observations on feature selection with LASSO have demonstrated the negative impact of inter-feature correlations on variable selection performance \cite{tibshirani1996regression,zou2005regularization}. Given these observations, we use this section to analyze a simple model of BIA feature selection that allows us to examine many of the characteristics that influence feature selection performance. Specifically, we consider a simple, analytically tractable, model in which we are given $p$ features that are correlated with each other with a constant Pearson correlation coefficient, $r$. The response, $\tilde{y}$, is a linear function of the first $\tilde{p} \leq p$ variables, which have equal true regression coefficients $\b_j = \b$ for $j \leq \tilde{p}$. That is, $\tilde{y} = \b \sum_{j=1}^{j=\tilde{p}} x_j + \tilde{\eta}$ where $\tilde{\eta} \sim \mathcal{N}(0,\tilde{\sigma}^2)$ is a Gaussian noise. We are interested in studying the behavior of this model when the number of features is large ($p \gg 1$). To simplify analytic expressions, it is helpful to define the number of samples as $n = \theta p$, and the number of relevant features as $\tilde{p} = \phi p$. Furthermore, we assume that the correlation between features scales as $r= \alpha p^{-1}$ so that the correlation between $y$ and $x_j$ stays constant in the large $p$ limit. Figure \ref{fig:fig1}a presents an example feature selection path computed using the BIA for a simulation of this model. This variable selection path was generated for data simulated from a linear model using with $p=200$ features with a constant correlation $r = 2/p$, $n = 100$, $\tilde{p} = 10$, and $\w^2 = \tilde{\sigma}^2 / \b^2 = 1$. Figure \ref{fig:fig1}a demonstrates that all but one of the relevant features (red) have higher posterior probabilities than the irrelevant features (black) as long as $\l > \l^*$. In fact, there is a clear gap in posterior probability separating the relevant and irrelevant features, and the correct features can be easily selected by visible inspection of the feature selection path in Figure \ref{fig:fig1}a. The BIA breaks down beyond the threshold of the penalty parameter and the feature selection performance of the BIA deteriorates, as demonstrated by the mixing of the probabilities for the relevant (red lines) and irrelevant (black lines) features in Figure \ref{fig:fig1}a. \begin{figure}[t] \begin{center} \includegraphics[angle=0,width=0.75\textwidth]{Fig_1.png} \caption{\label{fig:fig1} Performance of BIA feature selection. a) An example variable selection path as a function of decreasing regularization. The relevant variables are red, and the irrelevant variables are black. The dashed vertical line is at $ \l = \l^* = n(1+rp)$, which is the estimated breakdown point of the approximation. Simulations were performed with $p=200$, $n = 100$, $\tilde{p} = 10$, $r = 2/p$, and $\w^2 = 1$. b) A phase diagram illustrating the regions of parameter space where $m_{(-)} < 0 < m_{(+)}$ computed with $\l = \theta p^2$. } \end{center} \end{figure} Of course, we expect that the performance of the BIA for feature selection will vary depending on the characteristics of the problem. The model with equally correlated features provides a simple scenario to study which characteristics affect feature selection performance, because the correlations between the features and the standardized response $y = \tilde{y} / \sqrt{\text{VAR}(\tilde{y})}$ can be easily computed analytically for the large sample size limit where we can neglect sample-to-sample fluctuations. The spins characterizing the feature selection problem can be divided into two groups: relevant features with $j \leq \tilde{p}$ and magnetization $m_{(+)}$, and irrelevant features with $j > \tilde{p}$ and magnetization $m_{(-)}$. Note that an algorithm that performs perfect variable selection will have $m_{(+)} = + 1$ and $m_{(-)} = -1$. The Pearson correlation coefficient of a relevant feature ($j \leq \tilde{p}$) with the standardized response $y = \tilde{y} / \sqrt{\text{VAR}(\tilde{y})}$ is given by: \be r(y,x_{j=1\ldots \tilde{p}}) \equiv r_{(+)} = \frac{ 1 + r (\tilde{p}-1) } {\sqrt{ \w^2 + \tilde{p} (r \tilde{p} + 1 - r) } } \nonumber \ee where $\w^2 = \tilde{\sigma}^2 / \b^2 \sim O(1)$ is an inverse signal-to-noise ratio. Similarly, the Pearson correlation coefficient of an irrelevant variable ($j > \tilde{p}$) with the standardized response is: \be r(y,x_{j=\tilde{p}+1, \ldots, p}) \equiv r_{(-)} = \frac{r \tilde{p}} {\sqrt{ \w^2 + \tilde{p} (r \tilde{p} + 1 - r) } } \nonumber \ee If we choose $\l = \theta p^2$ to ensure that the problem is always in the strongly regularized regime, the magnetizations can be computed explicity to order $1/p$ giving: \begin{align} m_{(+)} &\approx \frac{\theta - \phi(1 - \a \theta) }{4 \phi} \frac{1}{p} + O(\frac{1}{p^2}) \nonumber \\ m_{(-)} &\approx -\frac{1+\a \phi - \a^2 \phi \theta}{4(1+\a \phi) } \frac{1}{p} + O(\frac{1}{p^2}) \nonumber \end{align} In general, we say that feature selection performance is good, on average, as long as $m_{(-)} < 0 < m_{(+)}$, because revelant features have $P(s_j=+1|\bold{y}) > 1/2$ and irrelevant features have $P(s_j=+1|\bold{y}) < 1/2$. Figure \ref{fig:fig1}b shows that the average feature selection performance is good in this sense within a large volume of the phase space. Specifically, $m_{(-)} < 0 < m_{(+)}$ when: \be \frac{1}{1+\a \phi} < \frac{\theta}{\phi} < \frac{1+\a \phi}{(\phi \a)^2} \nonumber \ee However, $m_{(-)}< m_{(+)}$ even if the stronger statement $m_{(-)} < 0 < m_{(+)}$ is not satisfied. As a result, there is always a gap between the posterior probabilities of the relevant and irrelevant features. Feature selection is most difficult if the features are correlated and if the number of relevant features is large compared to the sample size. Moreover, note that our choice of $\l = \theta p^2$ leads to $|m_{(\pm)} | \ll 1$ in the large $p$ limit, indicating a high degree of uncertainty even in the regime in which the BIA is accurate and in which the signs of the magnetizations are correct. Our choice of $\l = \theta p^2$ provides much stronger regularization than the estimated breakdown point of $\l^{*} = \theta (1+\a)p$. As a result, the absolute magnitudes of the magnetizations (i.e.\ $|m_{(\pm)}|$) are small, even compared to other values of $\l$ for which the BIA still holds. \subsection{Bodyfat Percentage} \begin{figure}[t] \begin{center} \includegraphics[angle=0,width=0.75\textwidth]{Fig_2.png} \caption{\label{fig:fig2} Comparison of exact Bayesian marginal probabilities to the BIA for the bodyfat data. a) Exact Bayesian marginal probabilities for decreasing regularization. b) BIA approximations of the marginal probabilities for decreasing regularization. c) Root Mean Squared Error (RMSE) between the exact and BIA probabilities as a function of decreasing regularization. The dashed vertical line is at $ \l = \l^* = n(1+rp)$, which is the estimated breakdown point of the approximation. The variables have been color coded (blue to red) by increasing squared Pearson correlation coefficient with the response (bodyfat percentage). } \end{center} \end{figure} Bodyfat percentage is an important indicator of health, but obtaining accurate estimates of bodyfat percentage is challenging. For example, underwater weighing is one of the most accurate methods for measuring bodyfat percentage but it requires special equipment, e.g.\ a pool. Here, we analyze a well-known dataset obtained from StatLib (http://lib.stat.cmu.edu/datasets/) on the relationship between bodyfat percentage and various body measurements from $n = 252$ men \cite{penrose1985generalized}. The $p = 12$ features included in our regression are: age and body mass index ($\text{height} / \text{mass}^2$), as well as circumference measurements of the neck, chest, waist, hip, thigh, knee, ankle, upper arm, forearm and wrist. All of the data were standardized to have mean zero and variance one. Therefore, there are $2^{12} = 4096$ potential combinations of features. For our purposes, the most interesting part about the bodyfat dataset is that the number of features is small enough to compute the posterior probabilities exactly using Equation \ref{eq:posterior} by enumerating all of the $4096$ feature combinations. The exact posterior probabilities as a function of $\l^{-1}$ are shown in Figure \ref{fig:fig2}a. In the figure, we have color coded variables from blue to red in terms of increasing squared Pearson correlation coefficients with bodyfat percentage; (blue) ankle, body mass index, age, wrist, forearm, neck, upper arm, knee, thigh, hip, chest, waist (red). The posterior probabilities computed from the BIA (Equation \ref{eq:recursive}) are shown in Figure \ref{fig:fig2}b. Comparing Figures \ref{fig:fig2}a-b demonstrates that the posterior probabilities computed from the BIA are very accurate for $\l \gg \l^*$, with $\l^*=n(1+pr)$ and $r$ the root-mean-squared correlation between features. However, the approximation breaks down for $\l \ll \l^*$ as expected. Figure \ref{fig:fig2}c provides another representation of the breakdown of the BIA upon approaching the breakdown point of the penalty ($\l^*$). The Root Mean Squared Error given by $\text{RMSE}(\l) =\sqrt{p^{-1} \sum_j (P_{\l}^{\text{exact}}(s_j = 1 | \bold{y} )- P_{\l}^{\text{BIA}}(s_j = 1 | \bold{y}))^2}$ is sigmoidal, with an inflection point close to $\l^*$. In the strongly regularized regime with $\l \gg \l^*$, the exact Bayesian probabilties and those computed using the BIA both rank waist and chest circumference as the most relevant features. Below the breakdown point of the penalty parameter, however, the BIA suggests solutions that are too sparse. That is, it underestimates many of the posterior probabilities describing whether or not the features are relevant. Far below the breakdown point of the penalty parameter (beyond the range of the graph in Figure \ref{fig:fig2}), the BIA ranks age and body mass index as the most relevant variables even though these have some of the smallest correlations with the response. Age and body mass index also become increasingly important for small $\l$'s in the exact calculation; though, they are never ranked as the most relevant variables. The change in the rankings of the features as a function of $\l$ highlights the importance of the coupling terms ($J_{ij}(\l)$) that punish correlated features. \subsection{Gene Expression} In 2010, the Dialogue for Reverse Engineering Assessments and Methods (DREAM) \cite{prill2010towards} initiative issued a challenge to predict the response of soybean plants to a pathogen from data on gene expression \cite{zhou2009infection}. The training data consist of a response of $n = 200$ different soybean plants to a pathogen along with the expressions of $p = 28395$ genes. The team (Loh et al.\ \cite{loh2011phenotype}) that achieved the highest rank correlation on a blind test set of 30 other soybean plants trained their model using elastic net regression to predict the ranks of the responses in the training set. The ranks were used rather than the actual values of the responses to mitigate the effects of outliers, and the value of the penalty parameter was chosen using cross validation. Loh et al.\ found that their cross validation procedure for elastic net regression favored sparse models with only a few features, and they highlighted 12 of these features that were frequently chosen by their procedure \cite{loh2011phenotype}. Clearly, this DREAM-5 soybean dataset presents a severely underdetermined problem, with the number of features exceeding the sample size by two orders of magnitude. Therefore, it is unsurprising, perhaps, that even the best teams achieved only modest performance on the test data \cite{loh2011phenotype}. Nevertheless, the soybean gene expression dataset presents a good benchmark to compare Bayesian feature selection with the BIA to feature selection using cross validated penalized regression for a very high dimensional inference problem. \begin{figure}[t] \begin{center} \includegraphics[angle=0,width=0.75\textwidth]{Fig_3.png} \caption{\label{fig:fig3} Feature selection path for the gene expression data. The problem is severely under-determined, involving the prediction of a quantitative phenotype from the expressions of $p=28395$ genes given a sample size of $n=200$ and, therefore, the posterior probabilities remain close to $P_{\l}(s_j = 1 | \bold{y}) = 1/2$. a) Features selected in a previous study (red lines) by cross validation with the elastic net have high ranking posterior probabilities. Gray scale represents the outer 10\% quantiles (light gray), the outer 10\% - 25\% quantiles (gray), and the middle 50\% quantiles (dark gray). b) The median (solid black line) and mean (dashed red line) percentage of features with higher posterior probabilities than those identified by Loh et al. The vertical axis is a logarithmic scale. The dashed vertical line is at $ \l = \l^* = n(1+rp)$, which is the estimated breakdown point of the approximation. } \end{center} \end{figure} We used the BIA to compute the posterior probabilities for all $p = 28395$ features as a function of $\l^{-1}$. Following the lead from the team that won the DREAM-5 challenge, we chose our $y$ variable as the ranks of the responses of the soybean plants to the pathogen rather than the actual values. As before, all of the data were standarized to have mean zero and variance one. It is not particularly helpful to plot the posterior probabilities of all $28395$ features. Therefore, Figure \ref{fig:fig3}a compares the posterior probabilities of the 12 features highlighted by Loh et al.\ (red lines) to the distribution of posterior probabilities for all of the features (gray area). Here, the distribution of posterior probabilities is represented by quantiles; the gray scale represents the outer 10\% quantiles (light gray), the outer 10\% - 25\% quantiles (gray), and the middle 50\% quantiles (dark gray). Visual inspection of Figure \ref{fig:fig3}a suggests that the 12 features identified by Loh et al.\ have some of the highest posterior probabilities among all $28395$ features. Similarly, Figure \ref{fig:fig3}b shows that only a small percentage of features have higher posterior probabilities than those identified by Loh et al, demonstrating that there is generally pretty good agreement between features that are predictive (i.e.\ those that perform well in cross validation) and those with high posterior probabilities computed with the BIA. Although our analyses of the soybean gene expression data identifies similar features as cross validated elastic net regression, the posterior probabilities all fall in the range $P_{\l}(s_j | \bold{y}) = 1/2 \pm 0.001$. The small range of posterior probabilities around the value representing random chance ($P_{\l}(s_j | \bold{y}) = 1/2$) that we identify is consistent with the highly variable out-of-sample performance discussed by Loh et al. The fact that there is no strong evidence favoring the selection of any of the features is not really surprising considering the vastly underdetermined nature of the problem ($n = 200$ and $p = 28395$). Moreover, the gene expression features have a root mean square correlation of $r \approx 0.29$. As a result, the critical value of the penalty parameter is $\l^* = n(1+pr) \approx 1.65 \times 10^6$, which is huge compared to what the breakdown point of $\l^* = 200$ would be if we were to assume that $r = 0$. Given that smaller $\l$'s generally lead to magnetizations that are larger in absolute value, it is clear that ignoring the correlations between genes vastly inflates estimates of certainty in gene relevance. This highlights the importance of strong regularization procedures that specifically account for correlation between genes in high dimensional genomic studies. \section{Discussion} To summarize, we have shown that Bayesian feature selection for L2 penalized regression, in the strongly regularized regime, corresponds to an Ising model, which we call the Ising Approximation (BIA). Mapping the posterior distribution to an Ising model that has simple expressions for the local fields and couplings using a controlled approximation opens the door to analytical studies of Bayesian feature selection using the vast number of techniques developed in physics for studying the Ising model. In fact, our analyses can be generalized to study Bayesian feature selection for many statistical techniques other than linear regression, as well as other prior distributions \cite{FisherBayesian2}. From a practical standpoint, the BIA provides an algorithm to efficiently compute Bayesian feature selection paths for L2 penalized regression. Using our approach, it is possible to compute posterior probabilities of feature relevance for very high dimensional datasets such as those typically found in genomic studies. Unlike most previous work of feature selection, the BIA is ideally suited for large genomic datasets where the number of features can be much greater than the sample size, $p \gg n$. The underlying reason for this is that we work in strongly-regularized regime where the prior always has a large influence on the posterior probabilities. This is in contrast to previous works on penalized regression and related Bayesian approaches that have focused on the ``weakly-regularized regime'' where the effect of the prior is assumed to be small. Moreover, we have identified a sharp threshold for the regularization parameter $\l^* = n(1+pr)$ where the BIA is expected to break down. This threshold depends on the sample size, $n$, number of features, $p$, and root-mean-squared correlation between features, $r$. The threshold at which the BIA breaks down occurs precisely at the transition from the strongly-regularized to the weakly-regularized regimes where the prior and the likelihood have a comparable influence on the posterior distribution. Our work also highlights the importance of accounting for correlations between features when assessing statistical significance in large data sets. In general, we have found that when the number of features is large, even small correlations can cause a huge reduction in the posterior probabilities of features. For example, our analysis of a dataset including the expression of 28,395 genes in soybeans demonstrates that the resulting posterior probabilities of gene relevance may be very close to value representing random chance $P_{\l}(s_j | \bold{y}) = 1/2$ when $p \gg n$ and the genes are moderately correlated, e.g.\ $r \sim 0.29$. This is likely to have important implications for assessing the results of GWAS studies where such correlations are often ignored. Another implication of the small marginal posterior probabilities resulting from correlations among potential features is that it is probably not reasonable to choose a posterior probability threshold for judging significance on very high dimensional problems. Instead, the BIA can be used as part of a two-stage procedure in the same manner as Sure Independence Screening \cite{fan2008sure}, where the BIA is applied to rapidly screen irrelevant variables, i.e.\ those that have low rank in posterior probability, before applying a more computationally intensive cross validation procedure to infer the regression coefficients. The computational efficiency of the BIA and the existence of a natural threshold for the penalty parameter where the BIA works make this procedure ideally suited for such two stage procedures. \section{Acknowledgements} \section{Appendix} \setcounter{equation}{0} \setcounter{figure}{0} \makeatletter \renewcommand{\theequation}{S\@arabic\c@equation} \makeatletter \renewcommand{\thefigure}{S\@arabic\c@figure} \makeatletter \renewcommand{\theequation}{S\@arabic\c@equation} \subsection{Bayesian Linear Regression} In this section, we briefly review the necessary aspects of Bayesian linear regression. This entire section follows standard arguments, the details of which can be found in many textbooks on Bayesian statistics e.g.\ \cite{o2004bayesian}, and also appears in the main text; we repeat it here so that the Appendix is self contained. The goal of linear regression is to infer the set of coefficients $\b_j$ for $j = 1, \ldots, p$ that describe the relationship $y = \bold{x}^T \boldsymbol{\b} + \eta $ from $n$ observations $(y_i, \bold{x}_i)$ for $i = 1, \ldots, n$. Here, $\bold{x}$ is a ($1 \times p)$ vector of features and $\eta \sim \mathcal{N}(0,\sigma^2)$ is a Gaussian distributed random variable with unknown variance $\sigma^2$. Without loss of generality, we will assume throughout this paper that the data are standardized with $ \sum_i y_i = 0$, $\sum_i y_i^2 = n$, $\sum_i (\bold{x}_{i})_j = 0$, and $\sum_i (\bold{x}_{i})_j^2 = n$ so that it is not necessary to include an intercept term in the regression. Penalized least-squares methods estimate the regression coefficients by minimizing a convex objective function in the form of: \be U(\boldsymbol{\b}) = \sum_i (y_i - \bold{x}_i^T \boldsymbol{\b})^2 + \l f(\boldsymbol{\b}) \ee where $f(\boldsymbol{\b})$ is a function that penalizes large regression coefficients and $\l$ is the strength of the penalty. Common choices for the penalty function include $f(\boldsymbol{\b}) = \sum_j \b_j^2$ for L2 penalized or `Ridge' regression \cite{hoerl1970ridge}, and $f(\boldsymbol{\b}) = \sum_j |\b_j|$ for L1 penalized or LASSO regression \cite{tibshirani1996regression}. The standard least-squares (and maximum likelihood) estimate $\boldsymbol{\hat{\b}} = (X^T X)^{-1} X^T \bold{y}$ is recovered by setting $\l = 0$, where $X$ is the $(n \times p)$ design matrix with rows $\bold{x}_i$. Adding a penalty to the least-squares objective function mitigates instability that results from computing the inverse of the $X^T X$ matrix. In the case of the L1 penalty, many of the regression coefficients end up being shrunk exactly to zero resulting in a type of automatic feature selection \cite{tibshirani1996regression,zou2005regularization,candes2007dantzig}. Bayesian methods combine the information from the data, described by the likelihood function, with \emph{a priori} knowledge, described by a prior distribution, to construct a posterior distribution that describes one's knowledge about the parameters after observing the data. In the case of linear regression, the likelihood function is a Gaussian: \be P(\bold{y} | \boldsymbol{\b}, \sigma^2) = \left(\frac{1}{\sqrt{2 \pi \sigma^2}}\right)^n \exp \left( - \frac{(\bold{y} - X^T \boldsymbol{\b})^T (\bold{y} - X^T \boldsymbol{\b})} {2\sigma^2} \right) \ee In this work, we will use standard conjugate prior distributions for $\boldsymbol{\b}$ and $\sigma^2$ given by $P(\boldsymbol{\b},\sigma^2 | \bold{s}) = P(\sigma^2) P(\boldsymbol{\b}|\sigma^2, \bold{s})$ where: \begin{align} P(\sigma^2) &\propto (\sigma^2)^{-(a_0 + 1)} \exp(-b_0 / \sigma^2 ) \\ P(\boldsymbol{\b} | \sigma^2, \bold{s}) &\propto \prod_j \HF \left[ (1-s_j) \d(\b_j ) + (1+s_j) \sqrt{ \frac{\l}{2 \pi \sigma^2}} \exp\left(-\frac{\l \b_j^2}{2 \sigma^2}\right) \right] \end{align} These prior distributions were chosen so that the posterior distribution has a simple closed-form expression. Here, we have introduced a vector ($\bold{s}$) of indicator variables so that $\b_j = 0$ if $s_j = -1$ and $\b_j \neq 0$ if $s_j = +1$. We also have to specify a prior for the indicator variables, which we will set to a flat prior $P(\bold{s}) \propto 1$ for simplicity. In principle, $a_0$, $b_0$ and the penalty parameter, $\l$, are free parameters that must be specified ahead of time and reflect our prior knowledge. We will discuss these parameters more in the next section. We have set up the problem so that identifying which features are relevant is equivalent to identifying those features for which $s_j = +1$. Therefore, we need to compute the posterior distribution for $\bold{s}$, which can be determined from Bayes' theorem: \begin{align} \log P_{\l}(\bold{s} | \bold{y}) &= C + \log \int d\boldsymbol{\b} d\sigma^2 P(\bold{y} | \boldsymbol{\b}, \sigma^2) P(\boldsymbol{\b} ,\sigma^2 |\bold{s}) P(\bold{s}) \nonumber \\ &= C+ \HF \ln | \l I| -\HF \ln | \l I + X _{\bold{s}}^T X_{\bold{s}} | - (a_0 + \frac{n}{2}) \ln (b_0 + \HF E_{\bold{s}}(\l)) \nonumber \\ &\equiv \mathcal{L}(\bold{s} | y) \end{align} where $C$ represents a constant and $E_{\bold{s}}(\l)$ is the sum of the squared residual errors. In this expression, $q = \sum_j (1+s_j)/2$, is the number of variables with $s_j = +1$, $I$ is the $(q \times q)$ identity matrix, and $X_{\bold{s}}$ is a $(n \times q)$ restricted design matrix which only contains rows corresponding to features where $s_j = +1$. The sum of the squared residual errors is given by $E_{\bold{s}}(\l) = \bold{y}^T \bold{y} - \bold{y}^T X_{\bold{s}} \boldsymbol{\bar{\b}}_{\bold{s}}(\l)$, where $\boldsymbol{\bar{\b}}_{\bold{s}}(\l) = (\l I + X_{\bold{s}}^T X_{\bold{s} })^{-1} X_{\bold{s}}^T \bold{y}$ is the Bayesian estimate for the regression coefficients corresponding to those variables for which $s_j = +1$. \subsection{Strongly Regularized Expansion} Now, we will perturbatively study the model selection posterior distribution about the limit where $\l$ is large. It is helpful to rewrite the expressions in terms of $\e = 1/\l$ which will be the small parameter that we will use in the expansion. The log-posterior is: \begin{align} \mathcal{L}(\bold{s} | y) &= \text{constant} + \HF \ln |I| - \HF \ln | I + \e X_{\bold{s}}^T X_{\bold{s}} | - (a_0 + \frac{n}{2}) \ln (b_0 + \hf y^Ty - \hf y^T X_{\bold{s}} \boldsymbol{\bar{\b}}_{\bold{s}}(\e) ) \nonumber \end{align} where $\boldsymbol{\bar{\b}}_{\bold{s}}(\e) = \e (I + \e X_{\bold{s}}^T X_{\bold{s} })^{-1} X_{\bold{s}}^T \bold{y}$. We will expand $\mathcal{L}(\bold{s}|y)$ in powers of $\e$ to second order. For now, we will assume that higher order terms can be neglected, and we will ask later on when this assumption breaks down. We need: \be \ln | I + \e X_{\bold{s}}^T X_{\bold{s}} | - \ln | I | = \e \text{Tr}[X_{\bold{s}}^T X_{\bold{s}}] - \HF \e^2 \text{Tr}[ (X_{\bold{s}}^T X_{\bold{s}})^2] + O( \e^3 ) \nonumber \ee and \begin{align} &\ln (b_0 + \frac{1}{2}( y^Ty - y^T X_{\bold{s}} \boldsymbol{\bar{\b}}_{\bold{s}}(\e) ) + \ln 2 - \ln (2b_0 + n)\nonumber \\ &= \e \left( \frac{ y^T X_{\bold{s}} \del_{\e} \boldsymbol{\bar{\b}}_{\bold{s}}(0) } {2 b_0 + n} \right) - \frac{\e^2}{2} \left( \frac{ y^T X_{\bold{s}} \del_{\e}^2 \boldsymbol{\bar{\b}}_{\bold{s}}(0) }{2 b_0 + n} + \left( \frac{y^T X_{\bold{s}} \del_{\e} \boldsymbol{\bar{\b}}_{\bold{s}}(0) }{2 b_0 + n } \right)^2 \right) + O(\e^3 ) \nonumber \end{align} Now, we can calculate: \begin{align} \del_{\e} \boldsymbol{\bar{\b}}_{\bold{s}}(0) &= \del_{\e} \left[\e ( I + \e X_{\bold{s}}^T X_{\bold{s}})^{-1} X_{\bold{s}}^T y \right]_{\e=0} \nonumber \\ &= \left[( I + \e X_{\bold{s}}^T X_{\bold{s}})^{-1} X_{\bold{s}}^T y - \e ( I + \e X_{\bold{s}}^T X_{\bold{s}})^{-1} X_{\bold{s}}^T X_{\bold{s}} ( I + \e X_{\bold{s}}^T X_{\bold{s}})^{-1} X_{\bold{s}}^T y \right]_{\e=0} \nonumber \\ &= X_{\bold{s}}^T y \nonumber \end{align} and \begin{align} \del_{\e}^2 \boldsymbol{\bar{\b}}_{\bold{s}}(0) &= \del_{\e}^2 \left[\e ( I + \e X_{\bold{s}}^T X_{\bold{s}})^{-1} X_{\bold{s}}^T y \right]_{\e=0} \nonumber \\ &= \left[\del_{\e} ( I + \e X_{\bold{s}}^T X_{\bold{s}})^{-1} X_{\bold{s}}^T y - \del_{\e} \e ( I + \e X_{\bold{s}}^T X_{\bold{s}})^{-1} X_{\bold{s}}^T X_{\bold{s}} ( I + \e X_{\bold{s}}^T X_{\bold{s}})^{-1} X_{\bold{s}}^T y \right]_{\e=0} \nonumber \\ &= -2 \left[ ( I + \e X_{\bold{s}}^T X_{\bold{s}})^{-1} X_{\bold{s}}^T X_{\bold{s}} ( I + \e X_{\bold{s}} X_{\bold{s}})^{-1} X_{\bold{s}}^T y\right]_{\e=0} \nonumber \\ &-\left[ \e \del_{\e} ( I + \e X_{\bold{s}}^T X_{\bold{s}})^{-1} X_{\bold{s}}^T X_{\bold{s}} ( I + \e X_{\bold{s}}^T X_{\bold{s}})^{-1} X_{\bold{s}}^T y \right]_{\e=0} \nonumber \\ & = -2 X_{\bold{s}}^T X_{\bold{s}} X_{\bold{s}}^T y \nonumber \end{align} Therefore, (up to a constant term): \begin{align} &\ln (b_0 + \frac{1}{2}( y^T y - y^T X_{\bold{s}} \boldsymbol{\bar{\b}}_{\bold{s}}(\e) ) \nonumber \\ &= - \e \left( \frac{ y^T X_{\bold{s}} X_{\bold{s}}^T y } {2 b_0 + n} \right) + \e^2\left( \frac{y^T X_{\bold{s}} X_{\bold{s}}^T X_{\bold{s}} X_{\bold{s}}^T y }{2 b_0 + n} - \HF \left( \frac{y^T X_{\bold{s}} X_{\bold{s}}^T y }{2 b_0 + n} \right)^2 \right) + O(\e^3) \nonumber \end{align} Putting things together the log-posterior is (up to a constant term): \begin{align} \mathcal{L}(\bold{s} | y) &= \frac{\e}{2} \left( \left(\frac{2 a_0 + n}{ 2 b_0 + n} \right) y^T X_{\bold{s}} X_{\bold{s}}^T y - \text{Tr}[X_{\bold{s}}^T X_{\bold{s}}] \right) \nonumber \\ &+ \frac{\e^2}{2} \left( \text{Tr}[(X_{\bold{s}}^T X_{\bold{s}})^2] - \left(\frac{2 a_0 + n}{2 b_0 + n} \right) \left( y^T X_{\bold{s}} X_{\bold{s}}^T X_{\bold{s}} X_{\bold{s}}^T y - \HF \frac{(y^T X_{\bold{s}} X_{\bold{s}}^T y)^2 }{2 b_0 + n} \right) \right) + O(\e^3) \nonumber \end{align} To simplify things a little, we will assume that $a_0$ and $b_0$ can be neglected, which gives: \begin{align} \mathcal{L}(\bold{s} | y) &= \frac{\e}{2} \left( y^T X_{\bold{s}} X_{\bold{s}}^T y - \text{Tr}[X_{\bold{s}}^T X_{\bold{s}}] \right) \nonumber \\ &+ \frac{\e^2}{2} \left( \text{Tr}[(X_{\bold{s}}^T X_{\bold{s}})^2] - \left( y^T X_{\bold{s}} X_{\bold{s}}^T X_{\bold{s}} X_{\bold{s}}^T y - \frac{1}{2n} (y^T X_{\bold{s}} X_{\bold{s}}^T y)^2 \right) \right) + O(\e^3) \label{eq:expanded-posterior} \end{align} \subsection{Breakdown of the Approximation} In a truly Bayesian setting, the parameters $a_0$, $b_0$ and $\l$ are chosen ahead of time to reflect the prior knowledge of the statistician. By contrast, L2 penalized regression is also commonly used in a frequentist setting with $\l$ chosen by cross-validation. In any case, the inclusion of the penalty parameter helps to regularize the inverse of $X_{\bold{s}}^T X_{\bold{s}}$, which is often of low rank. Indeed, in the high-dimensional setting with $p > n$ the $(p \times p)$ matrix $X_{\bold{s}}^T X_{\bold{s}}$ has a maximum rank of $n$ and is, therefore, never invertible. Note, however, that we can always compute the inverse of $\Lambda = (\l I + X_{\bold{s}}^T X_{\bold{s}})$ for any $\l > 0$ because the combination of a postive definite matrix with a postive semi-definite matrix is postive definite. The convergence of the series expansion for $\Lambda$ is, by and large, the factor determining the convergence of the series expansion for the log-posterior. Let's expand the inverse of $\Lambda$ about $\l = \infty$ as \be \Lambda^{-1} = \l^{-1}( I + \l^{-1} X_{\bold{s}}^T X_{\bold{s}})^{-1} = \l^{-1} \sum_{k = 0}^{\infty} (-1)^k \l^{-k} (X_{\bold{s}}^T X_{\bold{s}})^k \nonumber \ee The geometric series converges as long as $\l > \text{Tr}[ X_{\bold{s}}^T X_{\bold{s}} ]$, and truncating the series after the $k^{th}$ order term leads to an error of order $O( \text{Tr}[ (X_{\bold{s}}^T X_{\bold{s}} / \l )^{(k+1)} ] )$. Thus, to ensure that the series converges for all $\bold{s}$ we need $\l > \text{Tr}[ X^T X ]$, where $X$ is the design matrix for all $p$ features. For large $k$, we know that $Tr[(X_{\bold{s}}^T X_{\bold{s}} )^{(k+1)}]$ is dominated by the largest eigenvalue, $\gamma$, of $X^T X$. Thus, we expect the BIA series to converge if $\l < \gamma$. We can place a bound on $\gamma$ using the Gergoshin Circle Theorem \cite{varga2010gervsgorin}. Since the $X_i$ are standardized variables, as the number of samples goes to infinity, $n \rightarrow \infty$, the matrix element in row $i$ and column $j$ of $X^T X$ is converges to the correlation between $X_i$ and $X_j$, $r(X_i,X_j)$. Plugging this result into the Gergoshin Cirlcle Theorem gives a bound for the largest eigenvalue, namely $\gamma \le n(1+ p \tilde{r})$ where $\tilde{r}= \frac{1}{p} \inf_{i} \sum_{j\neq i} |r(X_i, X_j)|$. This suggests that BIA holds when $\lambda > \gamma=n(1+ p \tilde{r})$. For large $p$, we can approximate $\tilde{r}$ by the root-mean-squared correlation between features, $r =\sqrt{p^{-1}(p-1)^{-1} \sum_{i \neq j} r^2(X_i, X_j) }$. This defines a natural scale, \be \lambda^* = n(1+ p r). \ee for the penalty parameter at which the BIA is expected to breakdown. We expect the BIA to be accurate when $\l \gg \l^*$ and to breakdown when $\l \ll \l^*$. \subsection{Bayesian Ising Approximation} Equation \ref{eq:expanded-posterior} still contains design matrices ($X_{\bold{s}}$) that are restricted to the features for which $s_j = +1$. To remove these restrictions, let's introduce some binary indicator variables $\gamma} \def \a{\alpha_j = (s_j+1)/2$. Thus, $\gamma} \def \a{\alpha_j = 1$ if variable $j$ is included in the model and $\gamma} \def \a{\alpha_j = 0$ if variable $j$ is not included in the model. Also, let $V = X^T X/n$ and $G$ be the matrix with elements $G_{ij} = \sum_{k,l= 1}^{k,l = n} y_k y_l X_{ki} X_{lj} / n^2$. Note that standardizing all of the data leads to $V_{ij} = r(x_i,x_j)$ and $G_{ij} \simeq r(y,x_i) r (y,x_j)$, where $r(z_1,z_2)$ is the Pearson correlation between dummy variables $z_1$ and $z_2$. Now, we will rewrite Eq.\ \ref{eq:expanded-posterior} in terms of the indicator variables ($\boldsymbol{\gamma} \def \a{\alpha}$), $V$, and $G$. We have: \begin{align} \text{Tr}[X_{\bold{s}}^T X_{\bold{s}}] & = \sum_{i = 1}^{i = p} \gamma} \def \a{\alpha_i \left( \sum_{j = 1}^{j=n} X_{ji}^2 \right) = n \sum_{i = 1}^{i = p} V_{ii} \gamma} \def \a{\alpha_i \nonumber \end{align} \begin{align} \text{Tr}[(X_{\bold{s}}^T X_{\bold{s}})^2] &= \sum_{i,j =1}^{i,j = p} \gamma} \def \a{\alpha_i \gamma} \def \a{\alpha_j \left( \sum_{k =1}^{k=n} X_{ki} X_{kj}\right)^2 = n^2 \sum_{i,j =1}^{i,j = p} V_{ij}^2 \gamma} \def \a{\alpha_i \gamma} \def \a{\alpha_j \nonumber \end{align} \begin{align} y^T X_{\bold{s}} X_{\bold{s}}^T y &= \sum_{i = 1}^{i = p} \gamma} \def \a{\alpha_i \left( \sum_{j,k = 1}^{j,k = n} y_j y_k X_{ji} X_{ki} \right) = n^2 \sum_{i = 1}^{i = p} G_{ii} \gamma} \def \a{\alpha_i \nonumber \end{align} \begin{align} y^T X_{\bold{s}} X_{\bold{s}}^T X_{\bold{s}} X_{\bold{s}}^T y & = \sum_{i,j = 1}^{i,j = p} \gamma} \def \a{\alpha_i \gamma} \def \a{\alpha_j \left( \sum_{q = 1}^{q = n} X_{qi} X_{qj} \right) \left( \sum_{k,l= 1}^{k,l = n} y_k y_l X_{ki} X_{lj} \right) = n^3 \sum_{i,j = 1}^{i,j = p} V_{ij} G_{ij} \gamma} \def \a{\alpha_i \gamma} \def \a{\alpha_j \nonumber \end{align} Plugging these into Eq.\ \ref{eq:expanded-posterior}, we have: \begin{align} \mathcal{L}(\bold{s} | y) &= \frac{n^2}{2 \l} \left\{ \sum_{i = 1}^{i = p} \left( G_{ii}- \frac{V_{ii} }{n} \right) \gamma} \def \a{\alpha_i + \frac{n}{\l } \sum_{i,j =1}^{i,j = p} \left( \frac{V_{ij}^2}{n} - V_{ij} G_{ij} +\HF G_{ii} G_{jj} \right) \gamma} \def \a{\alpha_i \gamma} \def \a{\alpha_j \right\} \nonumber \end{align} Plugging in $\gamma} \def \a{\alpha_j = (1+s_j)/2$, rearranging and dropping constant terms yields our final result: \begin{align} \mathcal{L}(\bold{s} | y) &\simeq \frac{n^2}{4 \l} \left(\sum_{i} h_i(\l) s_i + \HF \sum_{i,j; i \neq j} J_{ij}(\l) s_i s_j \right) \end{align} where the external fields and couplings are defined as: \begin{align} h_i(\l) &= r^2(y,x_i) -\frac{1}{n} +\sum_{j} J_{ij}(\l) \\ J_{ij}(\l) &= \frac{n}{\l} \left( \frac{r^2 (x_i,x_j)}{n} - r(x_i, x_j) r(y,x_i) r(y,x_j) + \HF r^2(y,x_i) r^2(y,x_j) \right) \end{align}
{'timestamp': '2014-08-01T02:00:33', 'yymm': '1407', 'arxiv_id': '1407.8187', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8187'}
arxiv
\section{Introduction} Looped-functionals have been introduced in \cite{Seuret:13} for the analysis of sampled-data systems. They have been then further considered in \cite{Briat:11l,Briat:12d} for the analysis of impulsive systems (see e.g. \cite{Bainov:89,Hespanha:08}) and in \cite{Briat:13b} in the context of switched systems (see e.g. \cite{Morse:96,Hespanha:99,Liberzon:03}). The main rationale behind such functionals lies in the reformulation of a discrete-time condition into an expression that allows for the consideration of linear uncertain time-varying systems \cite{Briat:11l,Briat:12d,Briat:13b} and nonlinear systems \cite{Peet:14}. The main difference with Lyapunov functionals, see e.g. \cite{Naghshtabrizi:08}, is that positivity is not a required condition anymore. Instead, we demand that a certain algebraic boundary condition be satisfied, the so-called \emph{looping-condition}. It has been demonstrated in the aforementioned papers that this class of functionals leads to less conservative conditions than those obtained using usual Lyapunov functionals, demonstrating then the relevance of the approach. In the papers \cite{Briat:12h,Briat:13b}, the considered looped-functional was shown to yield sufficient conditions for the feasibility of the discrete-time stability criterion characterizing the stability of impulsive, sampled-data and switched systems. The goal of this paper is to show that this very same looped-functional is, in fact, ``complete'', in the sense that the resulting condition is also \emph{necessary}. This result is proved for a larger class of systems, referred to as \emph{pseudo-periodic systems}, that include periodic systems, impulsive systems, sampled-data systems and switched systems as particular cases. Along these lines, several corollaries pertaining on the analysis of these systems are directly obtained from the main result, and shown to complete those previously obtained in the literature. As the conditions are infinite-dimensional, we also describe how they can be (approximately) solved using sum of squares programming \cite{Parrilo:00}. \textbf{Outline:} Preliminaries are stated in Section \ref{sec:prel} while the main result is presented in Section \ref{sec:main}. This result is then applied to various problems in Section \ref{sec:applications}. Finally, Section \ref{sec:comp} provides some practical discussions about the verification of infinite-dimensional semidefinite programs. \textbf{Notations:} The sets of symmetric and positive definite matrices of dimension $n$ are denoted by $\mathbb{S}^n$ and $\mathbb{S}_{\succ0}^n$ respectively. Given two real symmetric matrices $A,B$, the expression $A\succ(\succeq) B$ means that $A-B$ is positive (semi)definite. Given a real square matrix $A$, the operator $\He(A)$ stands for the sum $A+A^{\T}$. The set of natural numbers $\{1,\ldots\}$ is denoted by $\mathbb{N}$ where the set of whole numbers is denoted by $\mathbb{N}_0:=\mathbb{N}\cup\{0\}$. \section{Definitions}\label{sec:prel} Some definitions and preliminary results are introduced below. In particular, pseudo-periodic functions and pseudo-periodic systems are formally characterized. Discrete-time state-transition matrices for pseudo-periodic systems are also defined. \begin{define}[Pseudo-periodic functions] Given scalars $0<\delta\le T_{min}\le T_{max}<\infty$, let $f:[0,T_{max}]\times[T_{min},T_{max}]\to\mathbb{R}$ be bounded and integrable, and define the family of sequence of time instants\footnote{Note that this sequence does not admit any accumulation point and is unbounded from above.} \begin{equation} \mathbb{I}:=\left\{\{t_k\}_{k\in\mathbb{N}}:\ t_{i+1}-t_i\in[T_{min},T_{max}],\ i\in\mathbb{N}_0,\ t_0=0\right\}. \end{equation} The generated class of \textbf{pseudo-periodic functions} is given by \begin{equation} \begin{array}{lcl} \mathcal{G}_f&:=&\left\{\sum_{k=0}^{\infty}\phi_k(t):\ t\ge t_0=0,\ \{t_k\}_{k\in\mathbb{N}}\in\mathbb{I}\right\}, \end{array} \end{equation} where $\phi_k(t):=f(t-t_k,t_{k+1}-t_k)\mathds{1}_{[t_k,t_{k+1})}(t)$ and $\mathds{1}_{[t_k,t_{k+1})}$ is the indicator function of the interval $[t_k,t_{k+1})$. We also define $T_k:=t_{k+1}-t_k$ for all $k\in\mathbb{N}_0$.\menddef \end{define} The function $f$ above is referred to as a \emph{seed function} and the set $\mathbb{I}$ as a \emph{family of sequence of transition times}. \begin{define} The linear system \begin{equation}\label{eq:mainsyst} \begin{array}{lcl} \dot{x}(t)&=&\Sigma(t)x(t),\ t\notin\{t_k\}_{k\in\mathbb{N}}\\ x(t)&=&Jx(t^-),\ t\in\{t_k\}_{k\in\mathbb{N}}\\ x(0)&=&x_0 \end{array} \end{equation} where $x,x_0\in\mathbb{R}^n$ are the system state\footnote{The state is assumed to be right-continuous and the left-limit at $t_k$ is denoted by $x(t_k^-)=\lim_{s\uparrow0}x(t_k+s)$.} and the initial condition, is said to be an \emph{impulsive pseudo-periodic system} if the matrix $\Sigma(t)$ is a pseudo-periodic matrix function, i.e. it can be expressed as \begin{equation}\label{eq:mainsystA} \Sigma(t):=\sum_{k=0}^{\infty}A(t-t_k,t_{k+1}-t_k)\mathds{1}_{[t_k,t_{k+1})}(t),\ t_0=0 \end{equation} for some seed matrix function $A(\cdot,\cdot)$ with $\{t_k\}_{k\in\mathbb{N}}\in\mathbb{I}$.\menddef \end{define} It is assumed here that the matrix $\Sigma(t)$ is sufficiently regular so that solutions to the differential equation are well defined. It is immediate to see that periodic systems and impulsive systems are a particular case of pseudo-periodic systems. Note that we assume here that the impulse times and transition times coincide. \begin{define}[State-transition matrix] The state-transition matrix of system (\ref{eq:mainsyst})-(\ref{eq:mainsystA}) is defined as the unique matrix function \begin{equation} \Phi:[0,T_{max}]\times[T_{min},T_{max}]\to\mathbb{R}^{n\times n} \end{equation} that solves the parametrized family of linear differential equations \begin{equation}\label{eq:mono2} \begin{array}{rcl} \dfrac{\partial}{\partial \eta}\Phi(\eta,T)&=&A(\eta,T)\Phi(\eta,T),\ \eta\in[0,T]\\ \Phi(0,T)&=&I_n \end{array} \end{equation} for all $T\in[T_{min},T_{max}]$.\menddef \end{define} Using the state-transition matrix above, it is possible to define the transition map associated to the system (\ref{eq:mainsyst})-(\ref{eq:mainsystA}). This operator plays a key role in the paper. \begin{define}[Discrete-time transition map] Given a family of transition times, the discrete-time transition map corresponding to system (\ref{eq:mainsyst})-(\ref{eq:mainsystA}) is defined by $\Psi(T):=\Phi(T,T)$, $T\in[T_{min},T_{max}]$, and we have that \begin{equation}\label{eq:mono1} \begin{array}{rcl} x(t_{k+1}^-)&=&\Psi(T_k)Jx(t_k^-),\ k\in\mathbb{N}\\ x(t_0)&=&x_0 \end{array} \end{equation} where $\{t_k\}_{k\in\mathbb{N}}\in\mathbb{I}$. \end{define} The discrete-time transition map hence defines the sequence of state values for any sequence of transition times in $\mathbb{I}$. \section{Main result}\label{sec:main} The following result is the main result of the paper that will allow us to prove that the conditions based on looped-functionals considered in \cite{Briat:12h,Briat:13b} equivalently characterize certain stability conditions taking the form of linear matrix inequalities: \begin{theorem}\label{th:ncs} Let $A,J\in\mathbb{R}^{n\times n}$ and $M\in\mathbb{S}^n$ be given matrices, and let $T$ be a positive scalar. Then, the following statements are equivalent: \begin{enumerate} \item There exists a matrix $P\in\mathbb{S}_{\succ0}^n$ such that the matrix inequality \begin{equation}\label{eq:LMIth} J^{\T}\Psi(T)^{\T}P\Psi(T)J-J^{\T}PJ+M+\eps I\preceq0 \end{equation} holds for some $\eps>0$ and where $\Psi(\cdot)$ is defined in \eqref{eq:mono1}. \item There exist a matrix $P\in\mathbb{S}_{\succ0}^n$ and continuous matrix-valued functions $Z_1,Z_2:[0,T]\to\mathbb{S}^n$ such that the conditions \begin{equation}\label{eq:LMI1th} \begin{array}{rcl} Z_1(T)&=&0\\ J^{\T}Z_{1}(0)J+Z_{2}(0)-Z_{2}(T)&=&0 \end{array} \end{equation} and \begin{equation}\label{eq:LMI2th} \begin{array}{rcl} \He[(TP+Z_1(\tau))A(\tau)]+\dot{Z}_1(\tau)&\preceq&0\\ M+\eps I_n+\dot{Z}_2(\tau)&\preceq&0 \end{array} \end{equation} hold for some $\eps>0$ and for all $\tau\in[0,T]$. \end{enumerate} \end{theorem} \begin{proof} The proof is given in the Appendix. \end{proof} \begin{remark}\label{rem:1} The above result straightforwardly extends to the case when matrices $\Psi$, $J$ and $M$ depend on some additional time-invariant parameters, say $\rho$. In such a case, the matrix-valued functions $Z_1$ and $Z_2$ also need to depend on this additional parameter in order to preserve necessity. \end{remark} \section{Applications}\label{sec:applications} To demonstrate the versatility and usefulness of the main result, we now apply it to the analysis of various systems such as pseudo-periodic systems, impulsive systems, sampled-data systems and switched systems. It is important to stress that these results have been partially obtained in \cite{Briat:12h,Briat:12h,Seuret:13}. However, only sufficiency was proven. Using Theorem \ref{th:ncs}, we demonstrate that these conditions are also necessary. \subsection{Application to pseudo-periodic systems with impulses} We have the following result: \begin{theorem}\label{th:fundd2} The pseudo-periodic system (\ref{eq:mainsyst})-(\ref{eq:mainsystA}) with pseudo-period $T_k\in[T_{min},T_{max}]$, $0<\delta\le T_{min}\le T_{max}<\infty$, is asymptotically stable if one of the following equivalent statements hold: \begin{enumerate} \item There exists a matrix $P\in\mathbb{S}_{\succ0}^n$ such that the LMI \begin{equation}\label{eq:stabmono2} J^T\Psi(\theta)^{\T}P\Psi(\theta)J-P\prec0 \end{equation} holds for all $\theta\in[T_{min},T_{max}]$. \item There exist a constant matrix $P\in\mathbb{S}_{\succ0}^n$, a scalar $\eps>0$ and a matrix function $Z:[0,T_{max}]\times[T_{min},T_{max}]\to\mathbb{S}^{3n}$ differentiable with respect to the first variable and verifying \begin{equation}\label{eq:loliloolldr_ap} Y_2^{\T}Z(\theta,\theta)Y_2-Y_1^{\T}Z(0,\theta)Y_1=0 \end{equation} for all $\theta\in[T_{min},T_{max}]$ where \begin{equation}\label{eq:y1y2} \begin{array}{lclclcl} Y_1&=&\begin{bmatrix} J & 0_n\\ I_n & 0_n\\ 0_n & I_n \end{bmatrix},&\quad& Y_2&=&\begin{bmatrix} 0_n & I_n\\ I_n & 0_n\\ 0_n & I_n \end{bmatrix} \end{array} \end{equation} and such that the LMI \begin{equation}\label{eq:expless_ap} \hspace{-5mm}\Theta(\tau,\theta)+\He\left(Z(\tau,\theta)\begin{bmatrix} A(\tau,\theta) & 0_n & 0_n\\ 0_n & 0_n & 0_n\\ 0_n & 0_n & 0_n \end{bmatrix}\right)+\dfrac{\partial}{\partial\tau}Z(\tau,\theta)\preceq0 \end{equation} holds for all $\tau\in[0,\theta]$ and $\theta\in[T_{min},T_{max}]$ where \begin{equation}\label{eq:dlksqdqsjdql_ap} \Theta(\tau,\theta):=\begin{bmatrix} \theta\He\left[PA(\tau,\theta)\right] & 0_n & 0_n\\ \star & \eps I_n+J^{\T}PJ-P & 0_n\\ \star & \star & 0_n \end{bmatrix}. \end{equation} \end{enumerate} \end{theorem} \begin{proof} From Lyapunov theory, we can see that the condition of statement (a) is a quadratic stability condition implying stability of the system. To prove the equivalence between the two statements, we consider Remark \ref{rem:1} and extends the matrix function $Z(\tau)$ to $Z(\tau,T_k)$ so that the equality condition \eqref{eq:loliloolldr_ap} may be satisfied (see also \cite{Briat:12h,Briat:13b}). Choosing then $Z=\diag(Z_1,Z_2,0_n)$ in \eqref{eq:expless_ap} leads to a condition of the form \eqref{eq:LMI2th}, from which the equivalence follows. \end{proof} \subsection{Application to impulsive and sampled-data systems} The case of impulsive systems is obtained by simply choosing the matrix $\Sigma(t)$ in \eqref{eq:mainsyst} to be a constant matrix $A\in\mathbb{R}^{n\times n}$. This leads to the following system \begin{equation}\label{eq:impsyst} \begin{array}{lcl} \dot{x}(t)&=&Ax(t),\ t\notin\{t_k\}_{k\in\mathbb{N}}\\ x(t)&=&Jx(t^-),\ t\in\{t_k\}_{k\in\mathbb{N}}\\ x(t_0)&=&x_0. \end{array} \end{equation} and the following result completing the one derived in \cite{Briat:12h}: \begin{corollary}\label{cor:imp} The impulsive system \eqref{eq:impsyst} with inter-impulses times $T_k:=t_{k+1}-t_k\in[T_{min},T_{max}]$, $0<\delta\le T_{min}\le T_{max}<\infty$, is asymptotically stable if one of the following equivalent statements hold: \begin{enumerate} \item There exists a matrix $P\in\mathbb{S}_{\succ0}^n$ such that the LMI \begin{equation} J^{\T}e^{A^{\T}\theta}Pe^{A\theta}J-P\prec0 \end{equation} holds for all $\theta\in[T_{min},T_{max}]$. \item There exist a constant matrix $P\in\mathbb{S}_{\succ0}^n$, a scalar $\eps>0$ and a matrix function $Z:[0,T_{max}]\times[T_{min},T_{max}]\to\mathbb{S}^{3n}$ differentiable with respect to the first variable and verifying \begin{equation} Y_2^{\T}Z(\theta,\theta)Y_2-Y_1^{\T}Z(0,\theta)Y_1=0 \end{equation} for all $\theta\in[T_{min},T_{max}]$ where $Y_1$ and $Y_2$ are defined in \eqref{eq:y1y2} and such that the LMI \begin{equation \Theta(\theta)+\He\left(Z(\tau,\theta)\begin{bmatrix} A & 0_n & 0_n\\ 0_n & 0_n & 0_n\\ 0_n & 0_n & 0_n \end{bmatrix}\right)+\dfrac{\partial}{\partial\tau}Z(\tau,\theta)\preceq0 \end{equation} hold for all $\tau\in[0,\theta]$ and $\theta\in[T_{min},T_{max}]$ where \begin{equation \Theta(\theta):=\begin{bmatrix} \theta\He\left[PA\right] & 0_n & 0_n\\ \star & \eps I_n+J^{\T}PJ-P & 0_n\\ \star & \star & 0_n \end{bmatrix}. \end{equation} \end{enumerate} \end{corollary} For numerical results obtained using the above corollary, see \cite{Briat:12h}. \begin{remark} It is known that sampled-data systems can be reformulated as impulsive systems; see e.g. \cite{Goebel:09}. In this respect, the result above can be applied to sampled-data systems as well. See \cite{Seuret:13} for some numerical results about sampled-data systems using looped-functionals. \end{remark} \subsection{Application to switched systems} Let us consider now switched systems of the form \begin{equation}\label{eq:swsyst} \begin{array}{rcl} \dot{x}(t)&=&A_{\sigma(t)}x(t)\\ x(0)&=&x_0 \end{array} \end{equation} where $\sigma:\mathbb{R}_{\ge0}\to\{1,\ldots,N\}$ and assume that the switching times are given by the sequence $\{t_k\}_{k\in\mathbb{N}}$. We then have the following result completing the one obtained in \cite{Briat:13b}: \begin{corollary} The switched system \eqref{eq:swsyst} is asymptotically stable for any dwell-time $t_{k+1}-t_k=:T_k\in[T_{min},T_{max}]$, $0<\delta\le T_{min}\le T_{max}<\infty$, $k\in\mathbb{N}$, if one of the following equivalent statements hold: \begin{enumerate} \item There exist matrices $P_i\in\mathbb{S}_{\succ0}^n$, $i=1,\ldots,N$ such that the LMIs \begin{equation e^{A_i^{\T}\theta}P_ie^{A_i\theta}-P_j\prec0 \end{equation} holds for all $\theta\in[T_{min},T_{max}]$ and for all $i,j=1,\ldots,N$, $i\ne j$. \item There exist constant matrices $P_i\in\mathbb{S}_{\succ0}^n$, $i=1,\ldots,N$, a scalar $\eps>0$ and matrix functions $Z_{ij}:[0,T_{max}]\times[T_{min},T_{max}]\to\mathbb{S}^{3n}$, $i,j=1,\ldots,N$, $i\ne j$, differentiable with respect to the first variable and verifying \begin{equation W_2^{\T}Z_{ij}(\theta,\theta)W_2-W_1^{\T}Z_{ij}(0,\theta)W_1=0 \end{equation} for all $\theta\in[T_{min},T_{max}]$ where \begin{equation} \begin{array}{lclclcl} W_1&=&\begin{bmatrix} I_n & 0_n\\ I_n & 0_n\\ 0_n & I_n \end{bmatrix},&\quad& W_2&=&\begin{bmatrix} 0_n & I_n\\ I_n & 0_n\\ 0_n & I_n \end{bmatrix} \end{array} \end{equation} and such that the LMI \begin{equation \hspace{-4mm}\Theta_{ij}(\theta)+\He\left(Z_{ij}(\tau,\theta)\begin{bmatrix} A_i & 0_n & 0_n\\ 0_n & 0_n & 0_n\\ 0_n & 0_n & 0_n \end{bmatrix}\right)+Z_{ij}^\prime(\tau,\theta)\preceq \end{equation} hold for all $\tau\in[0,\theta]$, all $\theta\in[T_{min},T_{max}]$ and for all $i,j=1,\ldots,N$, $i\ne j$, where \begin{equation \Theta_{ij}(\theta):=\begin{bmatrix} \theta\He\left[PA_i\right] & 0_n & 0_n\\ \star & \eps I_n+P_i-P_j & 0_n\\ \star & \star & 0_n \end{bmatrix}. \end{equation} \end{enumerate} \end{corollary} \begin{proof} Based on Theorem \ref{th:fundd2}, we can define $A(\tau,T)=A_i$, $Z=Z_{ij}$ and $M=M_{ij}:=P_i-P_j$ for all $i,j=1,\ldots,N$, $i\ne j$. The result then follows. \end{proof} For numerical results obtained using the above corollary, see \cite{Briat:13b}. \section{Computational considerations}\label{sec:comp} The conditions stated in the above results are infinite-dimensional semidefinite programs that cannot be checked directly. A way for turning these conditions into finite-dimensional ones is to use sum of squares techniques \cite{Parrilo:00,sostools3}. To use this approach, we need to assume that all the infinite-dimensional variables are polynomials. Note that the choice of using polynomials can be justified by the fact that polynomials are dense in the set of continuous functions with compact support. Once the conditions have been reformulated in the sum of squares paradigm, then the problem can be turned into an equivalent finite-dimensional LMI problem, using for instance SOSTOOLS \cite{sostools3}, which can be solved in turn using standard SDP solvers. In what follows, we say that a polynomial symmetric matrix $S(y)$, $y\in\mathbb{R}^n$, is a sum of squares matrix if there exists a (possibly very tall) polynomial matrix $T(y)$ such that $S(y)=T(y)^{\T}T(y)$. Below is the sum of squares formulation for the conditions of statement (b) of Corollary \ref{cor:imp}: \begin{proposition} Assume that there exist a matrix $P\in\mathbb{S}^n_{\succ0}$ and polynomial matrices $Z,\Gamma_1,\Gamma_2:\mathbb{R}^2\to\mathbb{S}^{3n}$ such that \begin{itemize} \item $\Gamma_1$ and $\Gamma_2$ are sum of squares matrices. \item The equality $Y_2^{T}Z(\theta,\theta)Y_2-Y_1^{\T}Z(0,\theta)Y_1=0$ holds for all $\theta\in\mathbb{R}$. \item The expression \begin{equation} \begin{array}{l} -\Theta(\theta)-\He\left(Z(\tau,\theta)\begin{bmatrix} A & 0_n & 0_n\\ 0_n & 0_n & 0_n\\ 0_n & 0_n & 0_n \end{bmatrix}\right)-\dfrac{\partial}{\partial\tau}Z(\tau,\theta)\\ -\Gamma_1(\tau,\theta)\tau(\theta-\tau)-\Gamma_2(\tau,\theta)(T_{max}-\theta)(\theta-T_{min}) \end{array} \end{equation} is a sum of squares matrix where $\Theta(\theta)$ is defined in Corollary \ref{cor:imp}. \end{itemize} Then, the impulsive system \eqref{eq:impsyst} with inter-impulses times $T_k:=t_{k+1}-t_k\in[T_{min},T_{max}]$, $0<\delta\le T_{min}\le T_{max}<\infty$, is asymptotically stable. \end{proposition} The role of the SOS matrices $\Gamma_1$ and $\Gamma_2$ is to incorporate the constraints that $\tau\in[0,\theta]$ and $\theta\in[T_{min},T_{max}]$ inside the conditions. \section{Conclusion} A proof for the necessity of previously obtained looped-functional conditions have been proposed. It is shown that the conditions obtained for the analysis of switched, sampled-data and impulsive systems are necessary and sufficient for the characterization of the associated discrete-time stability conditions. This result therefore consolidates the framework of looped-functionals.
{'timestamp': '2015-01-06T02:05:32', 'yymm': '1407', 'arxiv_id': '1407.8383', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8383'}
arxiv
\section{Introduction} \label{sec:intro} Many practical acquisition devices in signal processing and algorithms in machine learning use a small number of linear measurements to represent a high-dimensional signal. Compressed sensing is a technology which takes advantage of the fact that, for some interesting classes of signals, one can use far fewer measurements than dictated by traditional Nyquist sampling paradigm. In this setting, one obtains $m$ linear measurements of a signal $\vect{x} \in {\mathbb R}^n$ of the form $$ y_i = \ip{\vect{a}_i}{\vect{x}}, \qquad i=1,\ldots,m. $$ Written concisely, one obtains the measurement vector $\vect{y} = \mathbf{A}\vect{x}$, where $\mathbf{A} \in {\mathbb R}^{m \times n}$ is the matrix with rows $\vect{a}_1,\ldots,\vect{a}_m$. From these (or even from corrupted measurements $\vect{y} = \mathbf{A}\vect{x} + \vect{e}$), one wishes to recover the signal $\vect{x}$. To make this problem well-posed, one must exploit a priori information on the signal $\vect{x}$, for example that it is \em $s$-sparse\em, i.e., $$ \|\vect{x}\|_0 \overset{\mathrm{\scriptscriptstyle{def}}}{=} |\mathrm{supp}(\vect{x})| = s \ll n, $$ or is well-approximated by an $s$-sparse signal. After a great deal of research activity in the past decade (see the website \cite{DSPweb} or the references in the monographs \cite{eldar2012compressed,foucart2013}), it is now well known that when $\mathbf{A}$ consists of, say, independent standard normal entries, one can, with high probability, recover all $s$-sparse vectors ${\vect{x}}$ from the $m \approx s\log(n/s)$ linear measurements $y_i = \ip{\vect{a}_i}{\vect{x}}$, $i=1,\ldots,m$. However, in practice, the compressive measurements $\ip{\vect{a}_i}{\vect{x}}$ must be quantized: one actually observes $\vect{y} = Q(\mathbf{A} \vect{x})$, where the map $Q: {\mathbb R}^m \to \mathcal{A}^m$ is a quantizer that acts entrywise by mapping each real-valued measurement to a discrete quantization alphabet $\mathcal{A}$. This type of quantization with an alphabet $\mathcal{A}$ consisting of only two elements was introduced in the compressed sensing setting by \cite{Boufounos2008} and dubbed \em one-bit compressed sensing \em. In this work, we focus on this one-bit approach and seek quantization schemes $Q$ and reconstruction algorithms $\Delta$ so that $\hat{\vect{x}} = \Delta( Q( \mathbf{A} \vect{x}) )$ is a good approximation to $\vect{x}$. In particular, we are interested in the trade-off between the error of the approximation and the \em oversampling factor \em \[ \lambda \overset{\mathrm{\scriptscriptstyle{def}}}{=} \frac{m}{s\log(n/s)}.\] \subsection{Motivation and previous work} \sloppy The most natural quantization method is \em Memoryless Scalar Quantization \em (MSQ), where each entry of $\vect{y} = \mathbf{A} \vect{x}$ is rounded to the nearest element of some quantization alphabet $\mathcal{A}$. If $\mathcal{A}= \delta \mathbb{Z}$ for some suitably small $\delta > 0$, then this rounding error can be modeled as an additive measurement error~\cite{Dai2009}, and the recovery algorithm can be fine-tuned to this particular situation~\cite{jacques2011dequantizing}. In the one-bit case, however, the quantization alphabet is $\mathcal{A} = \inset{\pm 1}$ and the quantized measurements take the form $\vect{y} = \mathrm{sign} (\mat{A} \vect{x})$, meaning that $\mathrm{sign}$\footnote{We define $\mathrm{sign}(0)=1$.} acts entrywise as \[y_i = Q_{\rm MSQ}(\ip{\vect{a}_i}{\vect{x}}) = \mathrm{sign}( \ip{\vect{a}_i}{\vect{x}}), \qquad i=1,\ldots,m. \] One-bit compressed sensing was introduced in~\cite{Boufounos2008}, and it has generated a considerable amount of work since then, see~\cite{DSPweb} for a growing list of literature in this area. Several efficient recovery algorithms have been proposed, based on linear programming~\cite{pv-1-bit,pv-noisy-1bit, gnjn2013} and on modifications of iterative hard thresholding~\cite{Jacques2011,jacques2013quantized}. As shown in \cite{Jacques2011}, with high probability one can perform the reconstruction from one-bit measurements with error \[ \twonorm{ \vect{x} - \hat{\vect{x}} } \lesssim \frac{1}{\lambda} \qquad \text{ for all } \vect{x} \in \Sigma_s' := \{ \vect{v} \in {\mathbb R}^n \ :\ \|\vect{v}\|_0 \leq s, \|\vect{v}\|_2 = 1\}. \] In other words, a uniform $\ell_2$-reconstruction error of at most $\gamma>0$ can be achieved with $m \asymp \gamma^{-1} s\log(n/s)$ one-bit measurements. \sloppy Despite the dimension reduction from $n$ to $s\log(n/s)$, MSQ presents substantial limitations~\cite{Jacques2011, goyal1998quantized}. Precisely, according to~\cite{goyal1998quantized}, even if the support of $\vect{x} \in \Sigma_s'$ is known, the best recovery algorithm $\Delta_{\rm opt}$ must obey \begin{equation}\label{eq:lowerbound} \twonorm{ \vect{x} - \Delta_{\rm opt}( Q_{\rm MSQ}(\mathbf{A} \vect{x}) ) } \gtrsim \frac{1}{\lambda} \end{equation} up to a logarithmic factor. An intuition for the limited accuracy of MSQ is given in Figure \ref{fig:tesselate}. \begin{figure} \begin{center} \input{fig_tesselate} \end{center} \caption{\em Geometric interpretation of one-bit compressed sensing. \em Each quantized measurement reveals which side of a hyperplane (or great circle, when restricted to the sphere) the signal $\vect{x}$ lies on. After several measurements, we know that $\vect{x}$ lies in one unique region. However, if the measurements are non-adaptive, then as the region of interest becomes smaller, it becomes less and less likely that the next measurement yields any new information about $\vect{x}$.} \label{fig:tesselate} \end{figure} Alternative quantization schemes have been developed to overcome this drawback. For a specific signal model and reconstruction algorithm, \cite{Sun2009} obtained the optimal quantization scheme, but more general quantization schemes remain open. Recently, Sigma-Delta quantization schemes have also been proposed as a more general quantization model~\cite{gunturk2010,krahmer2013sigma}. These works show that, with high probability on measurement matrices with independent subgaussian entries, $r$-th order Sigma-Delta quantization can be applied to the standard compressed sensing problem to achieve, for any $\alpha \in (0,1)$, the reconstruction error \begin{equation} \twonorm{ \vect{x} - \hat{\vect{x}} } \lesssim_r \lambda^{-\alpha(r - 1/2)} \label{eq:xx1} \end{equation} with a number of measurements \[ m \approx s \inparen{\log(n/s)}^{1/(1-\alpha)}. \] For suitable choices of $\alpha$ and $r$, the guarantee (\ref{eq:xx1}) overcomes the limitation~\eqref{eq:lowerbound}, but it is still polynomial in~$\lambda$. This leads us to ask whether an exponential dependence can be achieved. \subsection{Our contributions} In this work, we focus on improving the trade-off between the error $\twonorm{\vect{x} - \hat{\vect{x}}}$ and the oversampling factor $\lambda$. To the best of our knowledge, all quantized compressed sensing schemes obtain guarantees of the form \begin{equation}\label{eq:bestknown} \twonorm{\vect{x} - \hat{\vect{x}}} \lesssim \lambda^{-c} \qquad \text{ for all $\vect{x} \in \Sigma_s'$} \end{equation} with some constant $c>0$. We develop one-bit quantizers $Q: {\mathbb R}^m \to \inset{\pm 1}$, coupled with two efficient recovery algorithms $\Delta: \inset{\pm 1} \to {\mathbb R}^m$ that yield the reconstruction guarantee \begin{equation}\label{eq:guarantee} \twonorm{\vect{x} -\Delta(Q(\mathbf{A} \vect{x}))} \leq \exp(-\Omega(\lambda)) \qquad \text{ for all $\vect{x} \in \Sigma_s'$}. \end{equation} It is not hard to see that the dependence on $\lambda$ in (\ref{eq:guarantee}) is optimal, since any method of quantizing measurements that provides the reconstruction guarantee $\twonorm{\vect{x} - \hat{\vect{x}}} \leq \gamma$ must use at least $\log_2 \mathcal{N}(\Sigma_s', \gamma) \geq s\log_2(1/\gamma)$ bits, where $\mathcal{N}(\cdot)$ denotes the covering number. \subsubsection{Adaptive measurement model} A key element of our approach is that the quantizers are {\em adaptive} to previous measurements of the signal in a manner similar to Sigma-Delta quantization~\cite{gunturk2010}. In particular, the measurement matrix $\mathbf{A} \in {\mathbb R}^{m \times n}$ is assumed to have independent standard normal entries and the quantized measurements take the form of thresholded signs, i.e., \begin{equation}\label{eq:query} y_i = \mathrm{sign}(\ip{ \vect{a}_i }{\vect{x}} - \tau_i) = \left\{ \begin{array}{lrr} 1 & \text{if} & \ip{ \vect{a}_i }{\vect{x}} \geq \tau_i,\\ -1 & \text{if} & \ip{ \vect{a}_i }{\vect{x}} < \tau_i. \end{array} \right. \end{equation} Such measurements are readily implementable in hardware, and they retain the simplicity and storage benefits of the one-bit compressed sensing model. However, as we will show, this model is much more powerful in the sense that it permits optimal guarantees of the form \eqref{eq:guarantee}, which are impossible with standard MSQ one-bit quantization. As in the Sigma-Delta quantization approach, we allow the quantizer to be adaptive, meaning that the quantization threshold $\tau_i$ of the $i$th entry may depend on the $1$st, $2$nd, $\ldots$, $(i-1)$st quantized measurements. In the context of \eqref{eq:query}, this means that the thresholds $\tau_i$ will be chosen adaptively, resulting in a feedback loop as depicted in Figure \ref{fig:loop}. The thresholds $\tau_i$ can also be interpreted as an additive {\em dither}, which is oft-used in the theory and practice of analog-to-digital conversion. \begin{figure} \begin{center} \begin{tikzpicture}[scale=3] \draw[->] (0.6,0) -- (1,0); \draw[->] (2.3,0) -- (2.5,0); \draw[->] (2.7,0) -- (2.95,0); \draw[->] (4.2,0) -- (4.6,0); \draw[dashed, ->] (2.6,-0.4) -- (2.6,-0.1); \draw[dashed] (4, -0.1) -- (4, -0.5); \draw[dashed, ->] (4, -0.5) -- ( 2.8, -0.5); \draw (1.1,-0.2) rectangle (1.7,0.2); \draw (3.1,-0.2) rectangle (3.7,0.2); \node at (1.4,0) {$\mathbf{A}$}; \node at (2.6, 0) {$\bigoplus$}; \node at (3.4, 0) {quantize}; \node at (0.4, 0) {$\vect{x}\in\mathbb{R}^n$}; \node at (2, 0) {$\mathbf{A}\vect{x}\in\mathbb{R}^m$}; \node at (4,0) {$\vect{y}\in\mathbb{R}^m$}; \node at (2.6, -0.5) {$\tau\in\mathbb{R}^m$}; \end{tikzpicture} \end{center} \caption{Our closed-loop feedback system for binary measurements.} \label{fig:loop} \end{figure} In contrast to Sigma-Delta quantization, the feedback loop involves the calculation of the quantization threshold. This is the concession made to arrive at exponentially decaying error rates. It is an interesting open problem to determine low-memory quantization methods with such error rates that do not require such a calculation. \subsubsection{Overview of our main result} Our main result is that there is a recovery algorithm using measurements of the form \eqref{eq:query} and providing a guarantee of the form \eqref{eq:guarantee}. For clarity of exposition, we overview a simplified version of our main result below. The full result is stated in Section \ref{sec:strategy}. \begin{theorem}[Main theorem, simplified version]\label{thm:informal} Let $Q$ and $\Delta$ be the quantization and recovery algorithms given below in Algorithms \ref{alg:simpleQ} and \ref{alg:simpleDelta}, respectively. Suppose that $\mat{A} \in {\mathbb R}^{m \times n}$ and $\tau \in {\mathbb R}^{m}$ have independent standard normal entries. Then, with probability at least $C\lambda \exp(-cs\log(n/s))$ over the choice of $\mat{A}$ and $\tau$, for all $\vect{x} \in B_2^n$ with $\|\vect{x}\|_0 \leq s$, \[ \twonorm{ \vect{x} - \Delta( Q( \mat{A}\vect{x}, \mat{A}, \tau)) } \leq \exp( -\Omega(\lambda)), \qquad \text{where} \qquad \lambda = \frac{m}{s\log(n/s)}. \] \end{theorem} The quantization algorithm works iteratively. First, a small batch of measurements are quantized in a memoryless fashion. From this first batch, one gains a very rough estimate of $\vect{x}$ (called $\vect{x}_1$). The next batch of measurements are quantized with a focus on encoding the difference between $\vect{x}$ and $\vect{x}_1$, and so on. Thus, the trap depicted in Figure \ref{fig:tesselate} is avoided; each hyperplane is translated with an appropriate dither, with the aim of cutting the size of the feasible region. The recovery algorithm also works iteratively and its iterates are in fact intertwined with the iterates of the quantization algorithm. We artificially separate the two algorithms below. \begin{algorithm}[t] \KwIn{ Linear measurements $\mathbf{A}\vect{x} \in {\mathbb R}^m$; measurement matrix $\mat{A} \in {\mathbb R}^{m \times n}$; sparsity parameter $s$; thresholds $\tau \in~{\mathbb R}^m$; parameter $q \geq Cs\log(n/s)$ for the size of batches.} \KwOut{Quantized measurements $\vect{y} \in \{\pm 1\}^m$. } $T \gets \left\lfloor \frac{m}{q} \right\rfloor$ Partition $\mat{A}$ and $\tau$ into $T$ blocks $\mat{A}^{(1)}, \ldots, \mat{A}^{(T)} \in {\mathbb R}^{q \times n}$ and $\tau^{(1)},\ldots.\tau^{(T)} \in {\mathbb R}^q$. $\vect{x}_0 \gets {\bf 0}$ \For{$t=1,\ldots,T$} { $\mathbf{\sigma}^{(t)} \gets \mathbf{A}^{(t)} \vect{x}_{t-1}$ $\vect{y}^{(t)} \gets \mathrm{sign}(\mat{A}^{(t)} \vect{x} - 2^{2-t}\mathbf{\tau}^{(t)} - \mathbf{\sigma}^{(t)})$ $\vect{z}_t \gets \mathrm{argmin} \|\vect{z}\|_1 \qquad \text{subject to} \quad \|\vect{z}\|_2 \leq 2^{2-t}, \ y^{(t)}_i \left(\ip{ \vect{a}^{(t)}_i }{\vect{z}} - 2^{2-t} \tau^{(t)}_i \right) \geq 0 \quad \text{for all } i$ \tcp{$\vect{z}_t$ is an approximation of $\vect{x} - \vect{x}_{t-1}$} $\vect{x}_t \gets H_s( \vect{x}_{t-1} + \vect{z}_t )$ \tcp{$H_s$ keeps $s$ largest (in magnitude) entries and zeroes out the rest} } \Return{$\vect{y}^{(t)} \mbox{ \rm for } t=1,\ldots,T$ }\tcp{Notice that we discard $\mathbf{\sigma}^{(t)}$} \caption{Adaptive quantization}\label{alg:simpleQ} \end{algorithm} \begin{algorithm}[t] \KwIn{ Quantized measurements $\vect{y} \in \{\pm 1\}^m$; measurement matrix $\mathbf{A}$; sparsity parameter $s$; thresholds $\mathbf{\tau} \in {\mathbb R}^m$; size of batches $q$.} \KwOut{ Approximation $\hat{\vect{x}} \in {\mathbb R}^n$. } $T \gets \left\lfloor \frac{m}{q} \right\rfloor$ Partition $\mat{A}$ and $\tau$ into $T$ blocks $\mat{A}^{(1)}, \ldots, \mat{A}^{(T)} \in {\mathbb R}^{q \times n}$ and $\tau^{(1)},\ldots.\tau^{(T)} \in {\mathbb R}^q$. $x_0 \gets {\bf 0}$ \For{ $t=1,\ldots,T$ } { $\vect{z}_t \gets \mathrm{argmin} \|\vect{z}\|_1 \qquad\text{subject to} \quad\|\vect{z}\|_2 \leq 2^{2-t}, \ y^{(t)}_i \left(\ip{ \vect{a}^{(t)}_i }{\vect{z}} - 2^{2-t}\tau^{(t)}_i \right) \geq 0 \quad \text{for all } i$ $\vect{x}_t = H_s( \vect{x}_{t-1} + \vect{z}_t )$ } \Return{$\vect{x}_T$} \caption{Recovery} \label{alg:simpleDelta} \end{algorithm} Note that we present Algorithms \ref{alg:simpleQ} and \ref{alg:simpleDelta} at this point mainly because they are the simplest to state. Below we will provide a more general framework for algorithms that satisfy the guarantees of Theorem \ref{thm:informal} and develop a second set of algorithms with computational advantages. \subsubsection{Robustness} Our algorithms are robust to two different kinds of measurement corruption. First, they allow for perturbed linear measurements of the form $\ip{\vect{a}_i}{\vect{x}} + e_i$ for an error vector $\vect{e} \in {\mathbb R}^m$ with bounded $\ell_\infty$-norm. Second they allow for post-quantization sign flips, recorded as a vector $\mathbf{f} \in \{\pm 1\}^m$. Formally, the measurements take the form \begin{equation}\label{eq:noisyquery} y_i = f_i \, \mathrm{sign}(\ip{ \vect{a}_i }{\vect{x}} - \tau_i + e_i), \qquad i=1,\ldots,m. \end{equation} It is known that for inaccurate measurements with pre-quantization noise on the same order of magnitude as the signal, even unquantized compressed sensing algorithms must obey a lower bound of the form \eqref{eq:lowerbound} \cite{candes2013well}. Our algorithms respect this reality and exhibit exponentially fast convergence until the estimate hits the ``noise floor''---that is, until the error $\twonorm{\vect{x} - \hat{\vect{x}}}$ is on the order of $\|\vect{e}\|_\infty$. Table \ref{tab:algs} summarizes the various noise models, adaptive threshold calculations, and algorithms we develop and study below. \begin{table}[t] \begin{center} \caption{ Summary of the noise models, adaptive threshold calculations, and algorithms considered. See Section~\ref{sec:magnitude recovery} for further discussion of the trade-offs between the two algorithms.} \label{tab:algs} \smallskip \begin{tabular}{|>{\centering\arraybackslash}m{2in}|>{\centering\arraybackslash}m{2in}|>{\centering\arraybackslash}m{2in}|} \hline {\bf Noise model} & {\bf Threshold algorithm} & {\bf Recovery algorithm} \\ \hline Additive error $e_i$ in \eqref{eq:noisyquery} & Algorithm~\ref{alg:Q}, instantiated by Algorithm~\ref{alg:T0socp} & Convex programming: Algorithm~\ref{alg:Delta}, instantiated by Algorithm~\ref{alg:Delta0socp} \\ \hline Additive error $e_i$ and sign flips $f_i$ in \eqref{eq:noisyquery} & Algorithm~\ref{alg:Q}, instantiated by Algorithm~\ref{alg:T0ht} & Iterative hard thresholding: Algorithm~\ref{alg:Delta}, instantiated by Algorithm~\ref{alg:Delta0ht}\\\hline \end{tabular} \end{center} \end{table} \subsubsection{Relationship to binary regression} Our one-bit adaptive quantization and reconstruction algorithms are more broadly applicable to a certain kind of statistical classification problem related to sparse binary regression, and in particular sparse logistic and probit regression. These techniques are often used to explain statistical data in which the response variable is binary. In regression, it is common to assume that the data $\{z_i\}$ is generated according to the \textit{generalized linear model}, where $z_i \in \{0,1\}$ is a Bernoulli random variable satisfying \begin{equation}\label{eq:gen lin} \E {z_i} = f(\langle \vect{a}_i, \vect{x} \rangle) \end{equation} for some function $f : {\mathbb R} \rightarrow [0,1]$. The generalized linear model is equivalent to the noisy one-bit compressed sensing model when the measurements $y_i = 2 z_i - 1 \in \{\pm 1\}$ and \[ P(y_i = 1) =: f(\langle \vect{a}_i, \vect{x} \rangle), \] or equivalently, when \[ y_i = \mathrm{sign}(\langle \vect{a}_i, \vect{x} \rangle + e_i) \] with $f(t) := P(e_i \geq -t)$. In summary, one-bit compressed sensing is equivalent to binary regression as long as $f$ is the cumulative distribution function (CDF) of the noise variable $e_i$. The most commonly used CDFs in binary regression are the inverse logistic link function $f(t) = \frac{1}{1+e^{t}}$ in logistic regression and the inverse probit link function $f(t) = \int^t_{-\infty} \mathcal{N}(s) \mathrm{d}s$ in probit regression. These cases correspond to the noise variable $e_i$ being logistic and Gaussian distributed, respectively. The new twist here is that the quantization thresholds are selected adaptively; see Section~\ref{sec:related} for some examples. Specifically, our adaptive threshold measurement model is equivalent to the adaptive binary regression model \[ y_i = \mathrm{sign} (\langle \vect{a}_i, \vect{x} \rangle + e_i - \tau_i ) \] with \[ P(y_i = 1) = P(e_i - \tau_i >= -t) = f( t - \tau_i). \] The effect of $\tau_i$ in this adaptive binary regression is equivalent to an offset term added to all measurements $y_i$. Standard binary regression corresponds to the special case with $\tau_i = 0$. \subsection{Organization} In Section~\ref{sec:magnitude recovery}, we introduce two methods to recover not only the direction, but also the magnitude, of a signal from one-bit compressed sensing measurements of the form \eqref{eq:noisyquery}. These methods may be of independent interest (in one-bit compressed sensing, only the direction can be recovered), but they do not exhibit the exponential decay in the error that we seek. In Section~\ref{sec:strategy}, we will show how to use these schemes as building blocks to obtain \eqref{eq:guarantee}. The proofs of all of our results are given in Section \ref{sec:proofs}. In Section~\ref{sec:exps}, we present some numerical results for the new algorithms. We conclude in Section \ref{sec:discussion} with a brief summary. \subsection{Notation} Throughout the paper, we use the standard notation $\|\vect{v}\|_2 = \sqrt{\sum_i v_i^2}$ for the $\ell_2$-norm of a vector $\vect{v} \in {\mathbb R}^n$, $\|\vect{v}\|_1 = \sum_i |v_i|$ for its $\ell_1$-norm, and $\|\vect{v}\|_0$ for its number of nonzero entries. A vector $\vect{v}$ is called $s$-sparse if $\|\vect{v}\|_0 \le s$ and effectively $s$-sparse if $\|\vect{v}\|_1 \le \sqrt{s} \|\vect{v}\|_2$. We write $H_s(\vect{v})$ to represent the vector in ${\mathbb R}^n$ agreeing with $\vect{v}$ on the index set of largest $s$ entries of $\vect{v}$ (in magnitude) and with the zero vector elsewhere. We use a prime to indicate $\ell_2$-normalization, so that $H_s'(\vect{v})$ is defined as $H_s'(\vect{v}) := H_s(\vect{v})/\twonorm{H_s(\vect{v})}$. The set $\Sigma_s := \{ \vect{v} \in {\mathbb R}^n: \|\vect{v}\|_0 \le s \}$ of $s$-sparse vectors is accompanied by the set $\Sigma_s' := \{ \vect{v} \in {\mathbb R}^n: \|\vect{v}\|_0 \le s, \|\vect{v}\|_2 = 1 \}$ of $\ell_2$-normalized $s$-sparse vectors. For $R>0$, we write $R \Sigma_s'$ to mean the set $\{ \vect{v} \in {\mathbb R}^n: \|\vect{v}\|_0 \le s, \|\vect{v}\|_2 = R \}$. We also write $B_2^n = \{ \vect{v} \in {\mathbb R}^n: \|\vect{v}\|_2 \leq 1\}$ for the $\ell_2$-ball in ${\mathbb R}^n$ and $RB_2^n$ for the appropriately scaled version. We consider the task of recovering $\vect{x} \in \Sigma_s$ from measurements of the form \eqref{eq:query} or \eqref{eq:noisyquery} for $i=1, \ldots, m$. These measurements are organized as a matrix $\mathbf{A} \in {\mathbb R}^{m \times n}$ with rows $\vect{a}_1,\ldots,\vect{a}_m$ and a vector $ \tau \in {\mathbb R}^m$ of thresholds. Matching the Sigma-Delta quantization model, the $\vect{a}_i \in {\mathbb R}^n$ may be random but are non-adaptive, while the $\tau_i \in {\mathbb R}$ may be chosen adaptively, in either a random or deterministic fashion. The Hamming distance between sign vectors $\vect{y},\tilde{\vect{y}} \in \{\pm 1\}^m$ is defined as $d_H(\vect{y},\tilde{\vect{y}}) = \sum_i {\bf 1}_{ \{ y_i \not= \tilde{y}_i \} }$. \section{Magnitude recovery}\label{sec:magnitude recovery} Given an $s$-sparse vector $\vect{x} \in {\mathbb R}^n$, several convex programs are provably able to extract an accurate estimate of the direction of $\vect{x}$ from $\mathrm{sign}(\mathbf{A} \vect{x})$ or $\mathrm{sign}(\mathbf{A} \vect{x} + \vect{e})$ \cite{pv-noisy-1bit, pv-1-bit}. However, recovery of the magnitude of $\vect{x}$ is challenging in this setting \cite{knudson2014one}. Indeed, all magnitude information about $\vect{x}$ is lost in measurements of the form $\mathrm{sign}(\mathbf{A} \vect{x})$. Fortunately, if random (non-adaptive) dither is added before quantization, then magnitude recovery becomes possible, i.e., noise can actually help with signal reconstruction. This observation has also been made in the concurrently written paper \cite{knudson2014one} and also in the literature on binary regression in statistics \cite{1bit-MC}. Our main result will show that both the magnitude and direction of $\vect{x}$ can be estimated with exponentially small error bounds. In this section, we first lay the groundwork for our main result by developing two methods for one-bit signal acquisition and reconstruction that provide accurate reconstruction of both the magnitude and direction of $\vect{x}$ with polynomially decaying error bounds. We propose two different order-one recovery schemes. The first is based on second-order cone programming and is simpler but more computationally intensive. The second is based on hard thresholding, is faster, and is able to handle a more general noise model (in particular, random sign flips of the measurements) but requires an adaptive dither. Recall Table \ref{tab:algs}. \subsection{Second-order cone programming}\label{sec:linprog} The size of the appropriate dither/threshold depends on the magnitude of $\vect{x}$. Thus, let $R > 0$ satisfy $\twonorm{\vect{x}} \leq R$. We take measurements of the form \begin{equation} \label{eq:socp meas} y_i = \mathrm{sign}(\< \vect{a}_i, \vect{x} \> - \tau_i + e_i ), \qquad i = 1, \hdots, q, \end{equation} where $\tau_1,\ldots,\tau_q \sim N(0, 4 R^2)$ are known independent normally distributed dithers that are also independent of the rows $\vect{a}_1,\ldots,\vect{a}_q$ of the matrix $\mathbf{A}$ and $e_1,\ldots,e_q$ are small deterministic errors (possibly adversarial) satisfying $|e_i| \leq c R$ for an absolute constant $c$. The following second-order cone program \begin{equation} \label{eq:socp} {\rm argmin \,} \|\vect{z}\|_1 \qquad \mbox{subject to} \quad \twonorm{\vect{z}} \leq 2R, \quad y_i (\ip{\vect{a}_i}{\vect{z}} - \tau_i) \ge 0 \quad \mbox{for all } i=1,\hdots, q \end{equation} provides a good estimate of $\vect{x}$, as formally stated below. \begin{theorem}\label{thm:linpro} Let $1 \geq \delta >0$, let $\mat{A} \in {\mathbb R}^{q \times n}$ have independent standard normal entries, and let $\tau_1,\ldots, \tau_q \in {\mathbb R}$ be independent normal variables with variance $4 R^2$. Suppose that $n \geq 2q$ and \[q \geq C' \delta^{-4} s \log(n/s).\] Then, with probability at least $1 - 3 \exp(-c_0 \delta^4 q)$ over the choice of $\mat{A}$ and the dithers $\tau_1,\ldots,\tau_q$, the following holds for all $\vect{x} \in R B_2^n \cap \Sigma_s$ and $\vect{e} \in {\mathbb R}^q$ satisfying $\inftynorm{\vect{e}} \leq c \delta^3 R$: for $\vect{y}$ obeying the measurement model \eqref{eq:socp meas}, the solution $\hat{\vect{x}}$ to \eqref{eq:socp} satisfies $$ \twonorm{\vect{x} - \hat{\vect{x}}} \le \delta R. $$ The positive constants $C'$, $c$ and $c_0$ above are absolute constants. \end{theorem} \begin{remark} The choice of the constraint $\twonorm{\vect{z}} \le 2R$ and the variance $4R^2$ for the $\tau_i$'s allows for the above theoretical guarantees in the presence of pre-quantization error $\vect{e} \not= {\bf 0}$. However, in the ideal case $\vect{e} = {\bf 0}$, the guarantees also hold if we impose $\twonorm{\vect{z}} \le R$ and take a variance of $R^2$. This more natural choice seems to give better results in practice, even in the presence of pre-quantization error (as $R$ was already an overestimation for $\twonorm{\vect{x}}$). This is the route followed in the numerical experiments of Section \ref{sec:exps}. It only requires changing $2^{2-t}$ to $2^{1-t}$ in Algorithms \ref{alg:simpleQ} and \ref{alg:simpleDelta}. \end{remark} To fit into our general framework for exponential error decay, it is helpful to think of the program \eqref{eq:socp} as two separate algorithms: an algorithm $T_0$ that produces thresholds and an algorithm $\Delta_0$ that performs the recovery. These are formally described in Algorithms \ref{alg:T0socp} and \ref{alg:Delta0socp}. \begin{algorithm}[t] \KwIn{Bound $R$ on $\twonorm{\vect{x}}$} \KwOut{ Thresholds $\tau \in {\mathbb R}^q$ } \Return{ $\tau \sim N(0,R^2 I_q)$ } \caption{$T_0$: Threshold production for second-order cone programming} \label{alg:T0socp} \end{algorithm} \begin{algorithm}[t] \KwIn{ Quantized measurements $\vect{y} \in \{\pm 1\}^q$; measurement matrix $\mat{A} \in {\mathbb R}^{q \times n}$; bound $R$ on $\twonorm{\vect{x}}$; thresholds $\tau \in {\mathbb R}^q$.} \KwOut{ Approximation $\hat{\vect{x}}$ } \Return{ ${\rm argmin \,} \|\vect{z}\|_1 \qquad \mbox{\rm subject to} \quad \twonorm{\vect{z}} \leq 2R, \quad y_i (\ip{\vect{a}_i}{\vect{z}} - \tau_i) \ge 0 \quad \mbox{\rm for all } i=1,\hdots, q.$} \caption{$\Delta_0$: Recovery procedure for second-order cone programming} \label{alg:Delta0socp} \end{algorithm} \subsection{Hard thresholding}\label{sec:hardthresholding} The convex programming approach is attractive in many respects; in particular, the thresholds/dithers $\tau_i$ are non-adaptive, which makes them especially easy to apply in hardware. However, the recovery algorithm $\Delta_0$ in Algorithm \ref{alg:Delta0socp} can be costly. Further, while the convex programming approach can handle additive pre-quantization error, it cannot necessarily handle post-quantization error (sign flips). In this section, we present an alternative scheme for estimating magnitude, based on iterative hard thresholding that addresses these challenges. The only downside is that the thresholds/dithers $\tau_i$ become {\em adaptive} within the order-one recovery scheme. Given an $s$-sparse vector $\vect{x} \in {\mathbb R}^n$, one can easily extract from $\mathrm{sign}(\mathbf{A} \vect{x})$ a good estimate for the direction of $\vect{x}$. For example, we will see that $H'_s(\mathbf{A}^* \mathrm{sign}(\mathbf{A}\vect{x}))$ is a good approximation of $\vect{x} / \|\vect{x}\|_2$. However, as mentioned earlier, there is no hope of recovering the magnitude $\|\vect{x}\|_2$ of the signal from $\mathrm{sign}(\mathbf{A}\vect{x})$. To get around this, we use a second estimator, this time for the direction of $\vect{x}-\vect{z}$ for a well-chosen vector $\vect{z} \in {\mathbb R}^n$ obtained by computing $H_s'(\mathbf{A}^* \mathrm{sign}(\mathbf{A}(\vect{x} - \vect{z})))$. This allows us to estimate both the direction and the magnitude of $\vect{x}$. As above, we break the measurement/recovery process into two separate algorithms. The first is an algorithm $T_0$ describing how to generate the thresholds $\tau_i$. The second is a recovery algorithm $\Delta_0$ that describes how to recover an approximation $\hat{\vect{x}}$ to $\vect{x}$ based on measurements of the form \eqref{eq:noisyquery}, using the $\tau_i$ as thresholds. These are formally described in Algorithms \ref{alg:T0ht} and \ref{alg:Delta0ht}. In the algorithm statements, $V$ denotes any fixed rule associating to a vector $\vect{u}$ an $\ell_2$-normalized vector $V(\vect{u})$ that is both orthogonal to $\vect{u}$ and has the same support. \begin{algorithm}[t] \KwIn{Measurements $\mat{A}\vect{x} \in {\mathbb R}^q$; measurement matrix $\mat{A} \in {\mathbb R}^{q \times n}$; sparsity parameter $s$; bound $R$ on $\twonorm{\vect{x}}$. } \KwOut{ Thresholds $\tau \in {\mathbb R}^q$ } Partition $\mat{A}\vect{x}$ into $\mat{A}_1 \vect{x}$, $\mat{A}_2 \vect{x} \in {\mathbb R}^{q/2}$. $\vect{u} \gets H_s'( \mat{A}_1^* \mathrm{sign}(\mat{A}_1\vect{x}) )$ $\vect{v} \gets V(\vect{u})$ $\vect{w} \gets 2R \cdot( \vect{u} + \vect{v} )$ \Return{${\bf 0} \in {\mathbb R}^{q/2}, \mat{A}_2\vect{w} \in {\mathbb R}^{q/2}$} \caption{$T_0$: Threshold production for hard thresholding} \label{alg:T0ht} \end{algorithm} \begin{algorithm}[t] \KwIn{ Quantized measurements $\vect{y} \in \{\pm 1\}^q$; measurement matrix $\mat{A} \in {\mathbb R}^{q \times n}$; sparsity parameter $s$; bound $R$ on $\twonorm{\vect{x}}$. } \KwOut{ Approximation $\hat{\vect{x}}$ } Partition $\vect{y}$ into $\vect{y}_1$, $\vect{y}_2 \in {\mathbb R}^{q/2}$. $\vect{u} \gets H_s'( \mat{A}_1^* \vect{y}_1 )$ $\vect{v} \gets V(\vect{u})$ $\vect{t} \gets - H_s'( \mat{A}_2^* \vect{y}_2 )$ \Return{ $2Rf(\ip{\vect{t}}{\vect{v}}) \cdot \vect{u}$, where $f(\xi) = 1 - \frac{ \sqrt{1 - \xi^2}}{\xi} $ } \caption{$\Delta_0$: Recovery procedure for hard thresholding} \label{alg:Delta0ht} \end{algorithm} The analysis for $T_0$ and $\Delta_0$ relies on the following theorems. \begin{theorem}\label{ThmRobHT} Let $1 \geq \delta >0$ and let $\mat{A} \in {\mathbb R}^{q \times n}$ have independent standard normal entries. Suppose that $n \ge 2q$ and $q \ge c_1 \delta^{-7} s \log (n/s)$. Then, with probability at least $1 - c_2 \exp(-c_3 \delta^2 q)$ over the choice of $\mat{A}$, the following holds for all $s$-sparse $\vect{x} \in {\mathbb R}^n$, all $\vect{e} \in {\mathbb R}^q$ with $\twonorm{\vect{e}} \le c_6 \sqrt{q} \twonorm{\vect{x}}$, and all $\vect{y} \in \{\pm1\}^q$: \begin{equation}\label{ObjRobHT1} \twonorm{ \frac{\vect{x}}{\twonorm{\vect{x}}} - H_s' \inparen{\mathbf{A}^* \vect{y} } } \le \delta + c_4 \frac{\twonorm{\vect{e}}}{\sqrt{q} \twonorm{\vect{x}}} + c_5 \sqrt{\frac{d_H(\vect{y},\mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}})}{q}} \end{equation} The positive constants $c_1$, $c_2$, $c_3$, $c_4$, $c_5$, and $c_6$ above are absolute constants. \end{theorem} The proof of Theorem~\ref{ThmRobHT} is given in Section~\ref{sec:proofs}. Once Theorem~\ref{ThmRobHT} is shown, we will be able to establish the following results when the threshold production and recovery procedures $T_0$ and $\Delta_0$ are given by Algorithms~\ref{alg:T0ht} and \ref{alg:Delta0ht}. \begin{theorem}\label{thm:hardthresh} Let $1 \geq \delta >0$, let $\mat{A} \in {\mathbb R}^{q \times n}$ have independent standard normal entries, and let $T_0$ and $\Delta_0$ be as in Algorithms \ref{alg:T0ht} and \ref{alg:Delta0ht}. Suppose that $n \ge 2q$ and $$ q \ge c_1 \delta^{-7} s \log (n/s). $$ Further assume that whenever a signal $\vect{z}$ is measured, the corruption errors satisfy $\| \mathbf{e} \|_\infty \leq c \delta\|\vect{z}\|_2$ and $|\{i : f_i = -1\}| \leq c' \delta q$. Then, with probablity at least $1 - c_7\exp( - c_8\delta^2 q )$ over the choice of $\mat{A}$, the following holds for all $\vect{x} \in RB_2^n \cap \Sigma_s$ : for $\vect{y}$ obeying the measurement model \eqref{eq:noisyquery} with $\tau = T_0( \mat{A}\vect{x}, \mat{A}, s, R)$, the vector $\hat{\vect{x}} = \Delta_0( \vect{y}, \mat{A}, s, R )$ satisfies $$ \twonorm{\vect{x} - \hat{\vect{x}}} \le \delta R. $$ The positive constants $c_1$, $c$, $c'$, $c_7$, and $c_8$ above are absolute constants. \end{theorem} Having proposed two methods for recovering both the direction and magnitude of a sparse vector from binary measurements, we now turn to our main result. \section{Exponential decay: General framework} \label{sec:strategy} In the previous section, we developed two methods for approximately recovering $\vect{x}$ from binary measurements. Unfortunately, these methods exhibit polynomial error decay in the oversampling factor, and our goal is to obtain an exponential decay. We can achieve this goal by applying the rough estimation methods iteratively, in batches, with {\em adaptive thresholds/dithers}. As we show below, this leads to an extremely accurate recovery scheme. To make this framework precise, we first define an {\em order-one recovery scheme} $(T_0,\Delta_0)$. \begin{definition}[Order-one recovery scheme] \label{def:app_rec_scheme} An order-one recovery scheme with sparsity parameter $s$, measurement complexity $q$, and noise resilience $(\eta, b)$ is a pair of algorithms $(T_0, \Delta_0)$ such that: \begin{itemize} \item The \em thresholding algorithm \em $T_0$ takes a parameter $R$ and, optionally, a set of linear measurements $\mat{A}\vect{x} \in {\mathbb R}^q$ and the measurement matrix $\mat{A} \in {\mathbb R}^{q \times n}$. It outputs a set of thresholds $\tau \in {\mathbb R}^q$. \item The \em recovery algorithm \em $\Delta_0$ takes $q$ corrupted quantized measurements of the form \eqref{eq:noisyquery}, i.e., \[ y_i = f_i \, \mathrm{sign}( \ip{ \vect{a}_i }{\vect{x}} - \tau_i + e_i ) , \] where $\vect{e} \in {\mathbb R}^q$ is a pre-quantization error and $\mathbf{f} \in \{\pm 1\}^q$ is a post-quantization error. It also takes as input the measurement matrix $\mat{A} \in {\mathbb R}^{q \times n}$, a parameter $R$, and, optionally, a sparsity parameter $s$ and the thresholds $\tau$ returned by $T_0$. It outputs a vector $\hat{\vect{x}} \in {\mathbb R}^n$. \item With probability at least $1 - C\exp( -cq )$ over the choice of $\mat{A} \in {\mathbb R}^{q \times n}$ and the randomness of~$T_0$, the following holds: for all $\vect{x} \in RB_2^n \cap \Sigma_s$, all $\vect{e} \in {\mathbb R}^q$ with $\|\vect{e}\|_\infty \leq \eta \|\vect{x}\|_2$, and all $\mathbf{f} \in \{\pm 1\}^q$ with at most $b$ sign flips, the estimate $\hat{\vect{x}} = \Delta_0( \vect{y}, \mat{A}, R, s, \tau)$ satisfies \[ \twonorm{\vect{x} - \hat{\vect{x}}} \leq \frac{R}{4}. \] \end{itemize} \end{definition} We saw two examples of order-one recovery schemes in Section \ref{sec:magnitude recovery}. The scheme based on second-order cone programming is an order-one recovery scheme with sparsity parameter $s$, measurement complexity $q = C_0s\log(n/s)$, and noise resilience $\eta = c_0R$ and $b = 0$. The scheme based on iterated hard thresholding is an order-one recovery scheme with sparsity parameter $s$, measurement complexity $q = C_1 s\log(n/s)$, and noise resilience $\eta = c_1R$ and $b = c_2q$. Above, $c_0,c_1,c_2, C_0,C_1>0$ are absolute constants. We use an order-one recovery scheme to build a pair of one-bit quantization and recovery algorithms for sparse vectors that exhibits extremely fast convergence. Our quantization and recovery algorithms $Q$ and $\Delta$ are given in Algorithms \ref{alg:Q} and \ref{alg:Delta}, respectively. They are in reality intertwined, but again we separate them for expositional clarity. \begin{algorithm}[t] \KwIn{ Linear measurements $\mat{A} \vect{x} \in {\mathbb R}^m$; measurement matrix $\mat{A} \in {\mathbb R}^{m \times n}$; sparsity parameter $s$; bound $R$ on $\|\vect{x}\|_2$; parameter $q \geq Cs\log(n/s)$ for the size of batches.} \KwOut{ Quantized measurements $\vect{y} \in \{\pm 1\}^m$ and thresholds $\tau \in {\mathbb R}^m$ } $T \gets \left\lfloor \frac{m}{q} \right\rfloor$ Partition $\mat{A}$ into $T$ blocks $\mat{A}^{(1)}, \ldots, \mat{A}^{(T)} \in {\mathbb R}^{q \times m}$ $\vect{x}_0 \gets {\bf 0}$ \For{ $t = 1,\ldots, T$} { $R_t = 2^{-t + 1}$ $\tau^{(t)} \gets T_0( \mat{A}^{(t)}(\vect{x} - \vect{x}_{t-1}), \mat{A}^{(t)}, R_t )$ $\sigma^{(t)} \gets \mat{A}^{(t)} \vect{x}_{t-1}$ $\vect{y}^{(t)} \gets \mathbf{f}^{(t)} \odot \mathrm{sign}( \mat{A}^{(t)} \vect{x} - \tau^{(t)} - \sigma^{(t)} + \vect{e}^{(t)} ) $ $\vect{x}_t \gets H_s(\vect{x}_{t-1} + \Delta_0( \vect{y}^{(t)}, \mat{A}^{(t)}, R_t, \tau^{(t)} ))$ } \Return{ $\vect{y}^{(t)}, \tau^{(t)}$ for $t =1 ,\ldots, T$ } \caption{$Q$: Quantization} \label{alg:Q} \end{algorithm} \begin{algorithm}[t] \KwIn{ Quantized measurements $\vect{y} \in \{\pm 1\}^m$; measurement matrix $\mat{A} \in {\mathbb R}^{m \times n}$; sparsity parameter $s$; bound $R$ on $\|\vect{x}\|_2$; thresholds $\tau \in {\mathbb R}^m$; size of batches $q$.} \KwOut{ Approximation $\hat{\vect{x}} \in {\mathbb R}^n$} $T \gets \left\lfloor \frac{m}{q} \right\rfloor$ Partition $\mat{A}$ into $T$ blocks $\mat{A}^{(1)}, \ldots, \mat{A}^{(T)} \in {\mathbb R}^{q \times m}$ $\vect{x}_0 \gets {\bf 0}$ \For{ $t=1, \ldots, T$} { \begin{equation} \label{eq:it thresh} \vect{x}_t \gets H_s(\vect{x}_{t-1} + \Delta_0( \vect{y}^{(t)}, \mat{A}^{(t)}, R 2^{-t+1}, \tau^{(t)})) \end{equation} } \Return{ $\vect{x}_T$} \caption{$\Delta$: Recovery} \label{alg:Delta} \end{algorithm} The intuition motivating Step \eqref{eq:it thresh} is that $\Delta_0( \vect{y}^{(t)}, \mat{A}^{(t)}, R_t, \tau^{(t)}, )$ estimates $\vect{x} - \vect{x}_{t-1}$; hence $\vect{x}_t$ approximates $\vect{x}$ better than $\vect{x}_{t-1}$ does. Note the similarity to the intuition motivating iterative hard thresholding, with the key difference being that the quantization is also performed iteratively. \begin{remark}[Computational and storage considerations] Let us analyze the storage requirements and computational complexity of $Q$ and $\Delta$, both during and after quantization. We begin by considering the approach based on convex programming. In this case, the final storage requirements of the quantizer $Q$ are similar to those in standard one-bit compressed sensing. The ``algorithm'' $T_0$ is straightforward: it simply draws random thresholds/dithers. In particular, we may treat these thresholds as predetermined independent normal random variables in the same way as we treat $\mat{A}$. If $\mat{A}$ and $\tau$ are generated by a short seed, then all that needs to be stored after quantization are the binary measurements $\vect{y} \in \{\pm 1\}^q$. During quantization, the algorithm $Q$ needs to store $\vect{x}_t$. However, this requires small memory since $\vect{x}_t$ is $s$-sparse. While the convex programming approach is designed to ease storage burdens, the order-one recovery scheme based on hard thresholding is built for speed. In this case, the threshold algorithm $T_0$ (Algorithm \ref{alg:T0ht}) is more complicated, and the adaptive thresholds $\tau$ need to be stored. On the other hand, the computation of $\vect{x}_t$ is much faster, and both the quantization and recovery algorithms are very efficient. \end{remark} Given an order-one recovery scheme $(T_0,\Delta_0)$, the quantizer $Q$ given in Algorithm \ref{alg:Q} and the recovery algorithm $\Delta$ given in Algorithm \ref{alg:Delta} have the desired exponential convergence rate. This is formally stated in the theorem below and proved in Section~\ref{sec:proofs}. \begin{theorem}\label{thm:outeralg} Let $(T_0,\Delta_0)$ be an order-one recovery scheme with sparsity parameter $2s$, measurement complexity $q$, and noise resilience $(\eta, b)$. Fix $R > 0$ and recall that $T := \lfloor m/q \rfloor$. With probability at least $1 - CT \exp( -c q )$ over the choice of $\mat{A}$ and the randomness of $T_0$, the following holds for all $\vect{x} \in R B_2^n \cap \Sigma_s$, all $\vect{e} \in {\mathbb R}^m$ with $\inftynorm{\vect{e}} \leq \eta 2^{-T} \|\vect{x}\|_2$, and all $\mathbf{f} \in \{\pm 1\}^m$ with $|\{ i \ : \ f_i = -1 \}| \leq b$ in the measurement model \eqref{eq:noisyquery}: for $\vect{y} \in \{\pm 1\}^m$ and $\tau = Q( \mat{A}\vect{x}, \mat{A}, s, R, q ) \in {\mathbb R}^m$, the output $\hat{\vect{x}}$ of $\Delta( \vect{y}, \mat{A}, s, R, \tau, q )$ satisfies \begin{equation} \|\vect{x} - \hat{\vect{x}}\|_2 \leq R \, 2^{-T}. \end{equation} The positive constants $\eta$, $b$, $c$, and $C$ above are absolute constants. \end{theorem} Our two order-one recovery schemes each have measurement complexity $q = Cs\log(n/s)$. This implies the announced exponential decay in the error rate. \begin{cor} \label{cor:main} Let $Q,\Delta$ be as in Algorithms \ref{alg:Q} and \ref{alg:Delta} with one-bit recovery schemes $(T_0,\Delta_0)$ given either by Algorithms (\ref{alg:T0socp},\ref{alg:Delta0socp}) or (\ref{alg:T0ht},\ref{alg:Delta0ht}). Let $\mathbf{A} \in {\mathbb R}^{m \times n}$ have independent standard normal entries. Fix $R > 0$ and recall that $\lambda = m/(slog(n/s))$. With probability at least $1 - C\lambda \exp( -cs\log(n/s) )$ over the choice of $\mat{A}$ and the randomness of $T_0$, the following holds for all $\vect{x} \in R B_2^n \cap \Sigma_s$, all $\vect{e} \in {\mathbb R}^m$ with $\inftynorm{\vect{e}} \leq \eta 2^{-T} \|\vect{x}\|_2$, and all $\mathbf{f} \in \{\pm 1\}^m$ with $|\{ i \ : \ f_i = -1 \}| \leq b$ in the measurement model \eqref{eq:noisyquery} ($b = 0$ if $(T_0,\Delta_0)$ is based on convex programming or $b = cs\log(n/s)$ if $(T_0,\Delta_0)$ is based on hard thresholding): for $\vect{y} \in \{\pm 1\}^m$ $\tau = Q( \mat{A}\vect{x}, \mat{A}, s, R, q ) \in {\mathbb R}^m$, the output $\hat{\vect{x}}$ of $\Delta( \vect{y}, \mat{A}, s, R, \tau, q )$ satisfies \begin{equation} \|\vect{x} - \hat{\vect{x}}\|_2 \leq R \, 2^{-c\lambda}. \end{equation} The positive constants $\eta$, $c'$, $c$, and $C$ above are absolute constants. \end{cor} \section{Proofs}\label{sec:proofs} \subsection{Exponentially decaying error rate from order-one recovery schemes} First, we prove Theorem \ref{thm:outeralg} which states that, given an appropriate order-one recovery scheme, the recovery algorithm $\Delta$ in Algorithm \ref{alg:Delta} converges with exponentially small reconstruction error when the measurements are obtained by the quantizer $Q$ of Algorithm \ref{alg:Q}. \begin{proof}[Proof of Theorem~\ref{thm:outeralg}] \sloppy For $\vect{x} \in RB_2^n \cap \Sigma_s$, we verify by induction on $t \in \{0,1,\ldots,T\}$ that $$ \twonorm{ \vect{x} - \vect{x}_t } \le R 2^{-t}. $$ This induction hypothesis holds for $t=0$. Now, suppose that it holds for $t-1$, $t \in \{1,\ldots,T\}$. Consider $\Delta_0(\vect{y}^{(t)}, \mat{A}^{(t)}, R_t, \tau^{(t)})$, the estimate returned by the order-one recovery scheme in \eqref{eq:it thresh}. By definition, the thresholds $\tau^{(t)}$ were obtained in step $t$ by running $T_0$ on $A^{(t)}(\vect{x} - \vect{x}_{t-1})$. Similarly, the quantized measurements $\vect{y}^{(t)}$ are formed by quantizing (with noise) the affine measurements \[ \mat{A}^{(t)} \vect{x} - \sigma^{(t)} - \tau^{(t)} = \mat{A}^{(t)}(\vect{x} - \vect{x}_{t-1}) - \tau^{(t)}. \] Thus, we have effectively run the order-one recovery scheme on the $2s$-sparse vector $\vect{x} - \vect{x}_t$. By the guarantee of the order-one recovery algorithm, with probability at least $1 - C\exp( -cq )$, \[ \twonorm{ (\vect{x} - \vect{x}_{t-1}) - \Delta_0(\vect{y}^{(t)}, \mat{A}^{(t)}, R_t, \tau^{(t)}) } \leq R_t/4 = R2^{-t + 1}/4. \] Suppose that this occurs. Let \[ \vect{z} = \vect{x}_{t-1} + \Delta_0(\vect{y}^{(t)}, \mat{A}^{(t)}, R_t, \tau^{(t)}), \] so $\twonorm{\vect{x} - \vect{z}} \leq R2^{-t + 1}/4.$ Since $\vect{x}_t = H_s(\vect{z})$ is the best $s$-term approximation to $\vect{z}$, it follows that $$ \twonorm{ \vect{x} -\vect{x}_t } = \twonorm{ \vect{x} - H_s(\vect{z}) } \le \twonorm{ \vect{x} - \vect{z} } + \twonorm{ H_s(\vect{z}) - \vect{z} } \le 2 \twonorm{ \vect{x} - \vect{z} } \le R 2^{-t}. $$ Thus, the induction hypothesis holds for $t$. A union bound over the $T$ iterations completes the proof, since the announced result is the inductive hypothesis in the case that $t=T$. \end{proof} \subsection{Hard-thresholding-based order-one recovery scheme} The proof of Theorem~\ref{ThmRobHT} relies on three properties of random matrices $\mat{A} \in {\mathbb R}^{q \times n}$ with independent standard normal entries. In their descriptions below, the positive constants $c$, $C$, and $d$ are absolute constants. \begin{itemize} \item The \em restricted isometry property \em of order $s$ (\cite[Theorems 9.6 and 9.27]{foucart2013}): for any $\delta >0$, with failure probability at most $2 \exp(-c\delta^{2}q)$, the estimates \begin{equation}\label{RIP} (1-\delta) \twonorm{\vect{x}}^2 \le \frac{1}{q} \twonorm{\mathbf{A} \vect{x}}^2 \le (1+\delta) \twonorm{\vect{x}}^2 \end{equation} hold for all $s$-sparse $\vect{x} \in {\mathbb R}^n$ provided $q \ge C \delta^{-2} s \log(n/s)$. \item The \em sign product embedding property \em of order $s$ (\cite{jacques2013quantized,pv-noisy-1bit}): for any $\delta >0$, with failure probability at most $8 \exp(-c\delta^{2}q)$, the estimates \begin{equation}\label{SPEP} \left| \frac{\sqrt{\pi/2}}{q} \ip{\mathbf{A} \vect{w}}{\mathrm{sign} \inparen{\mathbf{A} \vect{x}}} - \ip{\vect{w}}{\vect{x}} \right| \le \delta \end{equation} hold for all effectively $s$-sparse $\vect{w},\vect{x} \in {\mathbb R}^n$ with $\twonorm{\vect{w}}=\twonorm{\vect{x}}=1$ provided $q \ge C \delta^{-6} s \log(n/s)$. \item The \em $\ell_1$-quotient property \em (\cite{Wojtaszczyk2009} or \cite[Theorem 11.19]{foucart2013}): if $n \ge 2q$, then with failure probability at most $\exp(-cq)$, every $\vect{e} \in {\mathbb R}^q$ can be written as \begin{equation}\label{QP} \vect{e} = \mathbf{A} \vect{u} \qquad \mbox{with} \quad \onenorm{\vect{u}} \le d \sqrt{s_*} \twonorm{\vect{e}}/\sqrt{q} \quad \mbox{where } s_* := \frac{q}{\log(n/q)}. \end{equation} \end{itemize} Combining the $\ell_1$-quotient property and the restricted isometry property (of order $2s$ for a fixed~$\delta \in (0,1/2)$, say) yields the \em simultaneous $(\ell_2,\ell_1)$-quotient property \em (use, for instance, \cite[Theorem~6.13 and Lemma~11.16]{foucart2013}); that is, there are absolute constants $d,d'>0$ such that every $\vect{e} \in {\mathbb R}^q$ can be written as \begin{equation} \label{SimQP} \vect{e} = \mathbf{A} \vect{u} \qquad \mbox{with} \quad \left\{ \begin{matrix} \twonorm{\vect{u}} & \le & d \twonorm{\vect{e}}/\sqrt{q},\\ \onenorm{\vect{u}} & \le & d' \sqrt{s_*} \twonorm{\vect{e}}/\sqrt{q}. \end{matrix} \right. \end{equation} \begin{proof}[Proof of Theorem \ref{ThmRobHT}] We target the inequalities \begin{equation}\label{ObjRobHT2} \twonorm{ \frac{\vect{x}}{\twonorm{\vect{x}}} - \frac{\sqrt{\pi/2}}{q} H_s \inparen{\mathbf{A}^* \vect{y} } } \le \delta + c_4 \frac{\twonorm{\vect{e}}}{\sqrt{q} \, \|\vect{x}\|_2} + c_5 \sqrt{\frac{d_H(\vect{y},\mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}})}{q}} . \end{equation} The desired inequalities \eqref{ObjRobHT1} then follows modulo a change of constants, because $H'_s \inparen{\mathbf{A}^* \vect{y}}$ is the best unit-norm approximation to $ \sqrt{\pi/2} \, q^{-1} H_s \inparen{\mathbf{A}^* \vect{y}}$, so that \begin{align*} \twonorm{ \frac{\vect{x}}{\twonorm{\vect{x}}} - H_s' \inparen{\mathbf{A}^* \vect{y} } } & \le \twonorm{ \frac{\vect{x}}{\twonorm{\vect{x}}} - \frac{\sqrt{\pi/2}}{q} H_s \inparen{\mathbf{A}^* \vect{y} } } + \twonorm{ H_s' \inparen{\mathbf{A}^* \vect{y} } - \frac{\sqrt{\pi/2}}{q} H_s \inparen{\mathbf{A}^* \vect{y} }}\\ & \le 2 \twonorm{ \frac{\vect{x}}{\twonorm{\vect{x}}} - \frac{\sqrt{\pi/2}}{q} H_s \inparen{\mathbf{A}^* \vect{y} } }. \end{align*} With $s_* = q /\log( n / q)$ as in \eqref{QP}, we remark that it is enough to consider the case $s = c s_*$, $c := c_1^{-1} \delta^7$. Indeed, the inequality $q \ge c_1 \delta^{-7} s \log(n/s)$ yields $q \ge c^{-1} s \log(n/q)$, i.e., $s \le c s_*$. Then \eqref{ObjRobHT2} for $s$ follows from \eqref{ObjRobHT2} for $cs_*$ modulo a change of constants because $H_s(\mathbf{A}^* \vect{y})$ is the best $s$-term approximation to $H_{c s_*}(\mathbf{A}^* \vect{y})$, so that \begin{align*} \Bigg\| \frac{\vect{x}}{\twonorm{\vect{x}}} &- \frac{\sqrt{\pi/2}}{q} H_s \inparen{\mathbf{A}^* \vect{y} } \Bigg\|_2 \\ & \le \twonorm{ \frac{\vect{x}}{\twonorm{\vect{x}}} - \frac{\sqrt{\pi/2}}{q} H_{cs_*} \inparen{\mathbf{A}^* \vect{y} } } + \twonorm{\frac{\sqrt{\pi/2}}{q} H_s \inparen{\mathbf{A}^* \vect{y} } - \frac{\sqrt{\pi/2}}{q} H_{cs_*} \inparen{\mathbf{A}^* \vect{y} }}\\ & \le 2 \twonorm{ \frac{\vect{x}}{\twonorm{\vect{x}}} - \frac{\sqrt{\pi/2}}{q} H_{cs_*} \inparen{\mathbf{A}^* \vect{y} } }. \end{align*} We now assume that $s = c s_*$. This reads $q = c_1 \delta^{-7} s \log(n/q)$ and arguments similar to \cite[Lemma C.6(c)]{foucart2013} lead to $q \ge (c_1 \delta^{-7} / \log(ec_1\delta^{-7})) s \log(n/s)$. Thus, if $c_1$ is chosen large enough at the start, we have $q \ge C \delta^{-6} s \log( n / s)$. This ensures that the sign product embedding property \eqref{SPEP} of order $2s$ with constant $\delta/2$ holds with high probability. Likewise, the restricted isometry property \eqref{RIP} of order $2s$ with constant $9/16$, say, holds with high probability. In turn, the simultaneous $(\ell_2,\ell_1)$-quotient property \eqref{SimQP} holds with high probability. We place ourselves in the situation where all three properties hold simultaneously, which occurs with failure probability at most $c_2 \exp(-c_3 \delta^2 q)$ for some absolute constants $c_2,c_3 > 0$. Then, writing $S=\mathrm{supp} \inparen{\vect{x}}$ and $T = \mathrm{supp} \inparen{H_s \inparen{ \mathbf{A}^* \vect{y} } }$, we remark that $H_s \inparen{\mathbf{A}^* \vect{y}}$ is the best $s$-term approximation to $\mathbf{A}_{S \cup T}^* \vect{y}$, so that \begin{align} \nonumber \twonorm{ \frac{\vect{x}}{\twonorm{\vect{x}}} - \frac{\sqrt{\pi/2}}{q} H_s \inparen{\mathbf{A}^* \vect{y} } } & \le \twonorm{ \frac{\vect{x}}{\twonorm{\vect{x}}} - \frac{\sqrt{\pi/2}}{q} \mathbf{A}_{S \cup T}^* \vect{y} } + \twonorm{ \frac{\sqrt{\pi/2}}{q} H_s \inparen{\mathbf{A}^* \vect{y} } - \frac{\sqrt{\pi/2}}{q} \mathbf{A}_{S \cup T}^* \vect{y} }\\ \label{StepRobHT0} & \le 2 \twonorm{ \frac{\vect{x}}{\twonorm{\vect{x}}} - \frac{\sqrt{\pi/2}}{q} \mathbf{A}_{S \cup T}^* \vect{y} }. \end{align} We continue with the fact that \begin{align} \nonumber \Bigg\| \frac{\vect{x}}{\twonorm{\vect{x}}} & - \frac{\sqrt{\pi/2}}{q} \mathbf{A}_{S \cup T}^* \vect{y} \Bigg\|_2\\ \label{StepRobHT1} & \le \twonorm{ \frac{\vect{x}}{\twonorm{\vect{x}}} - \frac{\sqrt{\pi/2}}{q} \mathbf{A}_{S \cup T}^* \mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}} } + \frac{\sqrt{\pi/2}}{q} \Bigg\| \mathbf{A}_{S \cup T}^* \inparen{\vect{y} - \mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}}} \Bigg\|_2. \end{align} The second term on the right-hand side of \eqref{StepRobHT1} can be bounded with the help of the restricted isometry property \eqref{RIP} as \begin{align*} \twonorm{ \mathbf{A}^*_{S \cup T} \inparen{\vect{y} - \mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}}} }^2 & = \ip{\mathbf{A}_{S \cup T} \mathbf{A}^*_{S \cup T} \inparen{\vect{y} - \mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}}}}{ \vect{y} - \mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}}}\\ & \le \twonorm{\mathbf{A}_{S \cup T} \mathbf{A}^*_{S \cup T} \inparen{\vect{y} - \mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}}}} \twonorm{\vect{y} - \mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}}}\\ & \le \sqrt{1+\frac{9}{16}} \sqrt{q} \twonorm{ \mathbf{A}^*_{S \cup T} \inparen{\vect{y} - \mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}}}} \twonorm{ \vect{y} - \mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}}}. \end{align*} Simplifying by $\twonorm{ \mathbf{A}^*_{S \cup T} \inparen{\vect{y} - \mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}}}}$, we obtain \begin{equation} \label{StepRobHT2} \twonorm{ \mathbf{A}^*_{S \cup T} \inparen{\vect{y} - \mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}}}} \le \frac{5}{4} \sqrt{q} \twonorm{ \vect{y} - \mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}}} = \frac{5}{2} \sqrt{q} \sqrt{d_H \inparen{\vect{y} , \mathrm{sign}{\inparen{\mathbf{A} \vect{x} + \vect{e}}}}}. \end{equation} The first term on the right-hand side of \eqref{StepRobHT1} can be bounded with the help of the simultaneous $(\ell_2,\ell_1)$-quotient property \eqref{SimQP} and of the sign product embedding property \eqref{SPEP}. We start by writing $\mathbf{A} \vect{x} + \vect{e}$ as $\mathbf{A} \inparen{\vect{x}+\vect{u}}$ for some $\vect{u} \in {\mathbb R}^n$ as in \eqref{SimQP}. We then notice that \begin{align*} \twonorm{\vect{x}+\vect{u}} & \ge \twonorm{\vect{x}} - \twonorm{\vect{u}} \ge \twonorm{\vect{x}} - d \twonorm{\vect{e}}/\sqrt{q} \ge (1-d c_6)\twonorm{\vect{x}},\\ \onenorm{\vect{x}+\vect{u}} & \le \onenorm{\vect{x}} + \onenorm{\vect{u}} \le \sqrt{s} \twonorm{\vect{x}} + d' \sqrt{s_*} \twonorm{\vect{e}}/\sqrt{q} \le \inparen{ \frac{1}{\sqrt{2}} + \frac{d' c_6}{\sqrt{2c}} } \sqrt{2s} \twonorm{\vect{x}}. \end{align*} Hence, if $c_6$ is chosen small enough at the start, then we have $\onenorm{\vect{x}+\vect{u}} \le \sqrt{2s} \twonorm{\vect{x}+\vect{u}}$, i.e., $\vect{x}+\vect{u}$ is effectively $(2s)$-sparse. The sign product embedding property \eqref{SPEP} of order $2s$ then implies that \begin{align*} \Bigg| \Bigg\langle\vect{w}, \frac{\vect{x}+\vect{u}}{\twonorm{\vect{x}+\vect{u}}} & - \frac{\sqrt{\pi/2}}{q} \mathbf{A}_{S \cup T}^* \mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}} \Bigg\rangle \Bigg|\\ & = \left| \ip{\vect{w}}{\frac{\vect{x}+\vect{u}}{\twonorm{\vect{x}+\vect{u}}}} - \frac{\sqrt{\pi/2}}{q} \ip{\mathbf{A} \vect{w}}{ \mathrm{sign} \inparen{ \mathbf{A} \inparen{\vect{x}+\vect{u}} } } \right| \le \frac{\delta}{2} \end{align*} for all unit-normed $\vect{w} \in {\mathbb R}^n$ supported on $S \cup T$. This gives $$ \twonorm{ \frac{\vect{x}+\vect{u}}{\twonorm{\vect{x}+\vect{u}}} - \frac{\sqrt{\pi/2}}{q} \mathbf{A}_{S \cup T}^* \mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}}} \le \frac{\delta}{2}, $$ and in turn \begin{align*} \twonorm{ \frac{\vect{x}}{\twonorm{\vect{x}}} - \frac{\sqrt{\pi/2}}{q} \mathbf{A}_{S \cup T}^* \mathrm{sign} \inparen{\mathbf{A} \vect{x} + \vect{e}}} & \le \frac{\delta}{2} + \twonorm{ \frac{\vect{x}}{\twonorm{\vect{x}}} - \frac{\vect{x}+\vect{u}}{\twonorm{\vect{x}+\vect{u}}} }\\ & \le \frac{\delta}{2} + \twonorm{ \inparen{\frac{1}{\twonorm{\vect{x}}} - \frac{1}{\twonorm{\vect{x}+\vect{u}}} }\vect{x}} + \twonorm{\frac{\vect{u}}{\twonorm{\vect{x}+\vect{u}}}}\\ & \le \frac{\delta}{2} + \frac{ | \twonorm{\vect{x}+\vect{u}} - \twonorm{\vect{x}} |}{\twonorm{\vect{x}+\vect{u}}} + \frac{\twonorm{\vect{u}}}{\twonorm{\vect{x}+\vect{u}}} \le \frac{\delta}{2} + \frac{2 \twonorm{\vect{u}}}{\twonorm{\vect{x}+\vect{u}}}. \end{align*} From $\twonorm{\vect{u}} \le d \twonorm{\vect{e}} / \sqrt{q}$ and $\twonorm{\vect{x}+\vect{u}} \ge (1-dc_6) \twonorm{\vect{x}} \ge \twonorm{\vect{x}}/2$ for $c_6$ is small enough, we derive that \begin{equation} \label{StepRobHT3} \twonorm{ \frac{\vect{x}}{\twonorm{\vect{x}}} - \frac{\sqrt{\pi/2}}{q} \mathbf{A}_{S \cup T}^* \inparen{\mathrm{sign} \inparen{ \mathbf{A} \vect{x} + \vect{e} }}} \le \frac{\delta}{2} + \frac{4d \twonorm{\vect{e}}}{\sqrt{q}\twonorm{\vect{x}}}. \end{equation} Substituting \eqref{StepRobHT2} and \eqref{StepRobHT3} into \eqref{StepRobHT1} enables us to derive the desired result \eqref{ObjRobHT2} from \eqref{StepRobHT0}. \end{proof} The proof of Theorem~\ref{thm:hardthresh} presented next follows from Theorem~\ref{ThmRobHT}. \begin{proof}[Proof of Theorem~\ref{thm:hardthresh}] For later purposes, we introduce the constant $$ C:= \max_{\xi \in \left[\frac{1}{\sqrt{2}}-\frac{1}{20},\frac{2}{\sqrt{5}}+\frac{1}{20} \right] } \left| f'(\xi) \right| \ge 2, \qquad f(\xi):= 1-\frac{\sqrt{1-\xi^2}}{\xi}. $$ Given $\vect{x} \in R B_2^n \cap \Sigma_s$, we acquire a corrupted version $\vect{y}_1 \in \{\pm 1\}^{q/2}$ of the quantized measurements $\mathrm{sign}( \mathbf{A}_1 \vect{x})$. Since the number of rows of the matrix $\mathbf{A}_1 \in {\mathbb R}^{(q/2) \times n}$ is large enough for Theorem \ref{ThmRobHT} to hold with $\delta_0 = \delta/(4(1+2C))$ instead of $\delta$, we obtain $$ \twonorm{\frac{\vect{x}}{\twonorm{\vect{x}}} - \vect{u}} \le \delta_0 + c_4 c \delta + c_5 c' \delta \le 2 \delta_0, \qquad \vect{u} := H_s'(\mathbf{A}_1^* \vect{y}_1), $$ provided that the constants $c$ and $c'$ are small enough. With $\vect{x}^\sharp$ denoting the orthogonal projection of $\vect{x}$ onto the line spanned by $\vect{u}$, we have $$ \twonorm{\vect{x}-\vect{x}^\sharp} \le \twonorm{ \vect{x} - \twonorm{\vect{x}} \vect{u} } \le 2 \delta_0 \twonorm{\vect{x}}. $$ We now consider a unit-norm vector $\vect{v} \in {\mathbb R}^n$ supported on $\mathrm{supp}(\vect{u})$ and orthogonal to $\vect{u}$. The situation in the plane spanned by $\vect{u}$ and $\vect{v}$ is summarized in Figure~\ref{fig:situation}. \begin{figure} \begin{center} \begin{tikzpicture}[scale=3] \draw[->] (0,0) -- (0,1); \draw[->] (0,1) -- (1,1); \draw[->] (0,0) -- (1,1); \draw (1,1) -- (0,.45); \node at (-.15, .45) {$\vect{x}^\sharp$}; \node at (-.15, 1) {$2R\vect{u}$}; \node at (.5, 1.15) {$2R\vect{v}$}; \node at (1.15, 1) {$\vect{w}$}; \draw[dashed] (.7, 1) -- (.7,.83); \node at (.6, .92) {$\theta$}; \end{tikzpicture} \end{center} \caption{The situation in the plane spanned by $\vect{u}$ and $\vect{v}$.} \label{fig:situation} \end{figure} We point out that $\|\vect{x}^\sharp\| \le \|\vect{x}\| \le R$ gave $\|\vect{x}^\sharp\|_2 \le 2R$, but that $2R$ was just an arbitrary choice to ensure that $\cos(\theta)$ stays away from $1$---here, $\cos(\theta) \in [1/\sqrt{2}, 2/\sqrt{5}]$. Forming the $s$-sparse vector $\vect{w}:=2R \cdot (\vect{u}+\vect{v})$, we now acquire a corrupted version $\vect{y}_2 \in \{\pm 1\}^{q/2}$ of the quantized measurements $\mathrm{sign}( \mathbf{A}_2 (\vect{x}- \vect{w}))$ on the $2s$-sparse vector $\vect{x} - \vect{w}$. Since the number of rows of the matrix $\mathbf{A}_2 \in {\mathbb R}^{(q/2) \times n}$ is large enough for Theorem \ref{ThmRobHT} to hold with $\delta_0 = \delta/(4(1+2C))$ instead of $\delta$ and $2s$ instead of $s$, we obtain $$ \twonorm{ \frac{\vect{w} - \vect{x}}{\twonorm{\vect{w} - \vect{x}}} - \vect{t} } \le \delta_0 + c_4 c \delta + c_5 c' \delta \le 2 \delta_0, \qquad \vect{t} = - H_s'(\mathbf{A}_2^* \vect{y}_2). $$ We deduce that $\vect{t}$ also approximates $(\vect{w} - \vect{x}^\sharp)/\twonorm{\vect{w} - \vect{x}^\sharp}$ with error \begin{align*} \Bigg\| & \frac{\vect{w}- \vect{x}^\sharp}{\|\vect{w} - \vect{x}^\sharp\|} - \vect{t} \Bigg\|_2\\ & \le \twonorm{ \frac{\vect{w}-\vect{x}^\sharp}{\twonorm{\vect{w}-\vect{x}^\sharp}} - \frac{\vect{w}-\vect{x}}{\twonorm{\vect{w}-\vect{x}^\sharp}} } + \twonorm{ \left( \frac{1}{\twonorm{\vect{w} - \vect{x}^\sharp}} - \frac{1}{\twonorm{\vect{w}-\vect{x}}} \right) (\vect{w}-\vect{x}) } +\twonorm{ \frac{\vect{w}-\vect{x}}{\twonorm{\vect{w}-\vect{x}}} - \vect{t} } \\ & \le \frac{\twonorm{\vect{x}-\vect{x}^\sharp}}{\twonorm{\vect{w}-\vect{x}^\sharp}} + \frac{\left| \big\| \vect{w}-\vect{x} \big\|_2 - \twonorm{\vect{w}-\vect{x}^\sharp} \right|}{\twonorm{\vect{w}-\vect{x}^\sharp}} + 2 \delta_0 \le 2 \frac{\twonorm{\vect{x}-\vect{x}^\sharp}}{\twonorm{\vect{w}-\vect{x}^\sharp}} + 2 \delta_0 \le 2 \frac{2 \delta_0 \twonorm{\vect{x}}}{2R} + 2 \delta_0\\ & \le 4 \delta_0. \end{align*} It follows that $\ip{\vect{t}}{\vect{v}}$ approximates $ \ip{(\vect{w}-\vect{x}^\sharp)/\|\vect{w}-\vect{x}^\sharp\|}{\vect{v}} = \cos(\theta)$ with error $$ |\cos(\theta) - \ip{\vect{t}}{\vect{v}}| = \left| \ip{\frac{\vect{w}-\vect{x}^\sharp}{\twonorm{\vect{w}-\vect{x}^\sharp}} - \vect{t}}{\vect{v}} \right| \le \twonorm{ \frac{\vect{w} - \vect{x}^\sharp}{\twonorm{\vect{w}-\vect{x}^\sharp}} - \vect{t} } \twonorm{\vect{v}} \le 4 \delta_0. $$ We then notice that $$ \twonorm{\vect{x}^\sharp} = 2R - 2R \tan(\theta) = 2R f(\cos(\theta)), $$ so that $2R f(\ip{\vect{t}}{\vect{v}})$ approximates $\twonorm{\vect{x}^\sharp}$ with error $$ \left| \twonorm{\vect{x}^\sharp} - 2R f(\ip{\vect{t}}{\vect{v}}) \right| = 2R |f(\cos(\theta)) - f(\ip{\vect{t}}{\vect{v}})| \le 2R \, C \, |\cos(\theta) - \ip{\vect{t}}{\vect{v}}| \le 2R \, C \, 4 \delta_0 = 8 C \delta_0 R. $$ Here, we used the facts that $\cos(\theta) \in [1/\sqrt{2}, 2/\sqrt{5}]$ and that $\ip{\vect{t}}{\vect{v}} \in [1/\sqrt{2}-4 \delta_0, 2/\sqrt{5}+4\delta_0] \subseteq [1/\sqrt{2}-1/20, 2/\sqrt{5}+1/20]$. We derive that \begin{align*} \left| \Big\| \vect{x} \Big\|_2 - 2R f(\ip{\vect{t}}{\vect{v}}) \right| & \le \left| \Big\| \vect{x} \Big\|_2 - \twonorm{\vect{x}^\sharp } \right| + \left| \twonorm{\vect{x}^\sharp} - 2 R f(\ip{\vect{t}}{\vect{v}}) \right|\\ & \le \twonorm{\vect{x}-\vect{x}^\sharp} + \left| \twonorm{\vect{x}^\sharp} - 2 R f(\ip{\vect{t}}{\vect{v}}) \right|\\ & \le 2 \delta_0 \twonorm{\vect{x}} + 8 C \, \delta_0 R \le 2(1+4C) \delta_0 R. \end{align*} Finally, with the estimate $\hat{\vect{x}}$ for $\vect{x}$ being defined as $$ \hat{\vect{x}} := 2 R f(\ip{\vect{t}}{\vect{v}}) \, \vect{u}, $$ the previous considerations lead to the error estimate \begin{align*} \twonorm{\vect{x}-\hat{\vect{x}}} & \le \twonorm{\vect{x} - \twonorm{\vect{x}} \vect{u} } + \left| \twonorm{\vect{x}} - 2 R f(\ip{\vect{t}}{\vect{v}}) \right| \twonorm{\vect{u}} \le 2 \delta_0 \twonorm{\vect{x}} + 2(1+4C) \delta_0 R \\ & \le 4(1+2C) \delta_0 R . \end{align*} Our initial choice of $\delta_0 = \delta/(4(1+2C))$ enables us to conclude that $\twonorm{\vect{x}-\hat{\vect{x}}} \le \delta R$. \end{proof} \subsection{Second-order-cone-programming-based order-one recovery scheme} \begin{proof}[Proof of Theorem~\ref{thm:linpro}] Without loss of generality, we assume that $R = 1/2$. The general argument follows from a rescaling. We begin by considering the exact case in which $\vect{e} = {\bf 0}$. Observe that, by the Cauchy--Schwarz inequality, \[\onenorm{\vect{x}} \leq \sqrt{\zeronorm{\vect{x}}} \cdot \twonorm{\vect{x}} \leq \sqrt{s}.\] Since $\vect{x}$ is feasible for program \eqref{eq:socp}, we also have $\onenorm{\hat{\vect{x}}} \leq \sqrt{s}$. The result will follow from the following two observations: \begin{itemize} \item $\vect{x}, \hat{\vect{x}} \in \sqrt{s} B_1^n \cap B_2^n$ \item $\mathrm{sign}(\< \vect{a}_i, \vect{x}\> - \tau_i ) = \mathrm{sign}(\< \vect{a}_i, \hat{\vect{x}}\> - \tau_i), \qquad i = 1, \hdots, q$. \end{itemize} Each equation $\< \vect{a}_i, \vect{z} \> - \tau_i = 0$ defines a hyperplane perpendicular to $\vect{a}_i$ and translated proportionally to $\tau_i$; further, $\vect{x}$ and $\hat{\vect{x}}$ are on the same side of the hyperplane. To visualize this, imagine $\sqrt{s} B_1^n \cap B_2^n$ as an oddly shaped apple that we are trying to dice. Each hyperplane randomly slices the apple, eventually cutting it into small sections. The vectors $\hat{\vect{x}}$ and $\vect{x}$ belong to the same section. Thus, we ask: \textit{how many random slices are needed for all sections to have small diameter?} Similar questions have been addressed in a broad context in \cite{pv-embeddings}. We give a self-contained proof that $O(s \log(n/s))$ slices suffice based on the following result \cite[Theorem 3.1]{pv-embeddings}. \begin{theorem}[Random hyperplane tessellations of $\sqrt{s} B_1^n \cap S^{n-1}$] \label{thm:embeddings} Let $\vect{a}_1, \vect{a}_2, \hdots, \vect{a}_q \in {\mathbb R}^n$ be independent standard normal vectors. If \[q \geq C \delta^{-4} s \log(n/s),\] then, with probability at least $1 - 2 \exp(-c \delta^4 q)$, all $\vect{x}, \vect{x}' \in \sqrt{s} B_1^n \cap S^{n-1}$ with \[\mathrm{sign} \< \vect{a}_i, \vect{x}\> = \mathrm{sign} \< \vect{a}_i, \vect{x}'\> , \qquad i = 1, \hdots, q,\] satisfy \[\twonorm{\vect{x} - \vect{x}'} \leq \frac{\delta}{8}. \] The positive constants $c$ and $C$ are absolute constants. \end{theorem} We translate the above result into a tessellation of $\sqrt{s} B_1^n \cap B_2^n$ in the following corollary. \begin{cor}[Random hyperplane tessellations of $\sqrt{s} B_1^n \cap B_2^n$] \label{cor:tessellations} Let $\vect{a}_1, \vect{a}_2, \hdots, \vect{a}_q \in {\mathbb R}^n$ be independent standard normal vectors and let $\tau_1, \tau_2, \hdots, \tau_q$ be independent standard normal random variables. If \[q \geq C \delta^{-4} s \log(n/s),\] then, with probability at least $1 - 2 \exp(-c \delta^4 q)$, all $\vect{x}, \vect{x}' \in \sqrt{s} B_1^n \cap B_2^n$ with \[\mathrm{sign}(\< \vect{a}_i, \vect{x}\> - \tau_i) = \mathrm{sign}(\< \vect{a}_i, \vect{x}'\> - \tau_i), \qquad i = 1, \hdots, q,\] satisfy \[\twonorm{\vect{x} - \vect{x}'} \leq \frac{\delta}{4}. \] The positive constants $c$ and $C$ are absolute constants. \end{cor} \begin{proof} For any $\vect{z} \in \sqrt{s} B_1^n \cap B_2^n$, we notice that $\mathrm{sign}( \< \vect{a}_i, \vect{z} \> - \tau_i) = \mathrm{sign}( \< [\vect{a}_i, -\tau_i], [\vect{z}, 1] \> )$, where the augmented vectors $[\vect{a}_i, -\tau_i] \in {\mathbb R}^{n+1}$ and $[\vect{z}, 1] \in {\mathbb R}^{n+1}$ are the concatenations of $\vect{a}_i$ with $-\tau_i$ and $\vect{z}$ with $1$, respectively. Thus, we have moved to the ditherless setup by only increasing the dimension by one. Since $$ \twonorm{[\vect{z},1]} \ge 1 \quad \mbox{and} \quad \onenorm{[\vect{z},1]} = \onenorm{\vect{z}} + 1 \le \sqrt{s}+1 \le \sqrt{4s}, $$ we may apply Theorem \ref{thm:embeddings} after projecting on $S^n$ to derive \begin{equation} \label{eq:original equation} \twonorm{\frac{[\vect{x}, 1]}{\twonorm{[\vect{x}, 1]}} - \frac{[\vect{x}', 1]}{\twonorm{[\vect{x}', 1]}}} \leq \frac{\delta}{8}. \end{equation} with probability at least $1 - 2 \exp(c \delta^4 q)$. We now show that the inequality (\ref{eq:original equation}) implies that $\twonorm{\vect{x} - \vect{x}'} \leq \delta/4$. First note that \[ \twonorm{\vect{x} - \vect{x}'} \leq \sqrt{2} \, \twonorm{\frac{\vect{x}}{\twonorm{[\vect{x}, 1]}} - \frac{\vect{x}'}{\twonorm{[\vect{x}, 1]}}} \] since $\twonorm{\vect{x}} \leq 1$. Subtract and add $\vect{x}'/\twonorm{[\vect{x}', 1]}$ inside the norm and apply triangle inequality to obtain \[ \twonorm{\vect{x} - \vect{x}'} \leq \sqrt{2}\left( \twonorm{\frac{\vect{x}}{\twonorm{[\vect{x}, 1]}} - \frac{\vect{x}'}{\twonorm{[\vect{x}', 1]}}} + \twonorm{\vect{x}'}\cdot \left |\frac{1}{\twonorm{[\vect{x}, 1]}} - \frac{1}{\twonorm{[\vect{x}', 1]}} \right| \right). \] Since $\twonorm{\vect{x}'} \leq 1$, we may remove $\twonorm{\vect{x}'}$ from in front of the second term in parenthesis. Next, use the inequality $a + b \leq \sqrt{2} \cdot \sqrt{a^2 + b^2}$ on the two terms in parenthesis. This bounds the right-hand side by precisely \[2 \twonorm{\frac{[\vect{x}, 1]}{\twonorm{[\vect{x}, 1]}} - \frac{[\vect{x}', 1]}{\twonorm{[\vect{x}', 1]}}},\] which is bounded by $\delta/4$ according to \eqref{eq:original equation}. \end{proof} This corollary immediately completes the proof of Theorem~\ref{thm:linpro} in the case $\vect{e} = {\bf 0}$. We now turn to the general problem where $\inftynorm{\vect{e}} \leq c \delta^3$ and thus $\twonorm{\vect{e}} \leq c \delta^3 \sqrt{q}$. We reduce to the exact problem using the simultaneous $(\ell_1,\ell_2)$-quotient property \eqref{SimQP}, which guarantees that the error can be represented by a signal with small $\ell_1$-norm. In particular, \eqref{SimQP} implies that, with probability at least $1 - \exp(-c q)$, there exists a vector $\vect{u}$ satisfying \begin{equation} \vect{e} = \mathbf{A} \vect{u} \qquad \mbox{with} \quad \left\{ \begin{matrix} \twonorm{\vect{u}} & \le & \delta/4,\\ \onenorm{\vect{u}} & \le & c_1 \delta^3 \sqrt{q/\log(n/q) } \end{matrix} \right. \end{equation} where $c_1$ is an absolute constant which we may choose as small as we need. We may now replace $\vect{x}$ with $\tilde{\vect{x}} = \vect{x} + \vect{u}$ and proceed as in the proof in the noiseless case. Reconstruction of $\tilde{\vect{x}}$ to accuracy $\delta/4$ yields reconstruction of $\vect{x}$ to accuracy $\delta/2$, as desired. By replacing $\vect{x}$ with $\tilde{\vect{x}}$, we have (mildly) increased the bound on the $\ell_1$-norm and the $\ell_2$-norm. Fortunately, $\twonorm{\tilde{\vect{x}}} \leq \twonorm{\vect{x}} + \twonorm{\vect{u}} \leq 1$ and thus $\tilde{\vect{x}}$ remains feasible for the program \eqref{eq:socp}. Further, $\tilde{\vect{x}}$ is approximately sparse in the sense that $\onenorm{\tilde{\vect{x}}} \leq \onenorm{\vect{x}} + \onenorm{\vect{u}} \leq \sqrt{s} + c_1 \delta^3 \sqrt{q/\log(n/q)} =: \sqrt{\tilde{s}}$. To conclude the proof, we must show that the requirement of Theorem \ref{thm:linpro}, namely $q \geq C' \delta^{-4} s \log(n/s)$, implies that the required condition of Corollary \ref{cor:tessellations}, namely $q \geq C \delta^{-4} \tilde{s} \log(n/\tilde{s})$, is still satisfied. The result follows from massaging the equations, as sketched below. If $s \geq c_1^2 \delta^6 q/\log(n/q)$, then $\sqrt{\tilde{s}} \leq 2 \sqrt{s}$ and the desired result follows quickly. Suppose then that $s < c_1^2 \delta^6 q/\log(n/q)$ and thus $\tilde{s} \leq c_2 \delta^6 q/\log(n/q)$. To conclude, note that \[C \delta^{-4} \tilde{s} \log(n/\tilde{s}) \leq q \cdot C \cdot c_2\frac{\delta^2}{\log(n/q)}\cdot (\log(n/q) + \log(1/c_2) + 6 \log(1/\delta) + \log(\log(n/q)) \leq q,\] where the first inequality follows since $s \log(n/s)$ is increasing in $s$ and thus $\tilde{s}$ may be replaced by its upper bound, $c_2 \delta^6 q/\log(n/q)$. The last inequality follows by taking $c_2$ small enough. This concludes the proof. \end{proof} \section{Numerical Results}\label{sec:exps} This brief section provides several experimental validations of the theory developed above. The computations, performed in MATLAB, are reproducible and can be downloaded from the second author's webpage. The random measurements $\vect{a}_i$ were always generated as vectors with independent standard normal entries. As for the random sparse vectors $\vect{x}$, after a random choice of their supports, their nonzero entries also consisted of independent standard normal variables. Our first experiment (results not displayed here) verified on a single sparse vector that both its direction and magnitude can be accurately estimated via order-one recovery schemes, while only its direction could be accurately estimated using convex programs \cite{pv-1-bit,pv-noisy-1bit}, $\ell_1$-regularized logistic regression, or binary iterative hard thresholding \cite{Jacques2011}. We also noted the reduction of the reconstruction error by several orders of magnitude from the same number $m$ of quantized measurements when Algorithms~\ref{alg:Q}-\ref{alg:Delta} are used instead of the above methods. We remark in passing that this number $m$ is significantly larger than the number of measurements in classical compressed sensing with real-valued measurements, as intuitively expected. Our second experiment corroborates the exponential decay of the error rate. The results are summarized in Figure \ref{FigExpDecay}, whose logarithmic scale on the vertical axis confirms the behavior $\log(\|\vect{x}-\vect{x}^*\|_2/\|\vect{x}\|_2) \le - c \lambda$ for the relative reconstruction error as a function of the oversampling factor $\lambda=m / \log(n/s)$. The tests were conducted on four sparsity levels $s$ at a fixed dimension $n$ for an oversampling ratio $\lambda$ varying through the increase of the number $m$ of measurements. The number $T$ of iterations in Algorithms \ref{alg:Q} and \ref{alg:Delta} was fixed throughout the experiment based on hard thresholding and throughout the experiment based on second-order cone programming. The values of all these parameters are reported directly in Figure \ref{FigExpDecay}. We point out that we could carry out a more exhaustive experiment for the faster hard-thresholding-based version than for the slower second-order-cone-programming-based version, both in terms of problem scale and of number of tests. \begin{figure}[htbp] \center \subfigure{ (a) \includegraphics[width=0.42\textwidth]{FigExpDecayHT_new.png} \label{FigExpDecayHT} }\quad \subfigure{ (b) \includegraphics[width=0.42\textwidth]{FigExpDecayLP_new.png} \label{FigExpDecayLP} } \caption{Averaged relative error for the reconstruction of sparse vectors ($n = 100$) by the outputs of Algorithms~\ref{alg:Q}-\ref{alg:Delta} based on (a) hard thresholding and (b) second-order cone programming as a function of the oversampling ratio. } \label{FigExpDecay} \end{figure} Our third experiment examines the effect of measurement errors on the reconstruction via Algorithms \ref{alg:Q} and \ref{alg:Delta}. Once again, the problem scale was much larger when relying on hard thresholding than on second-order cone programming. The values of the size parameters are reported on Figure \ref{FigNoise}. This figure shows how the reconstruction error decreases as the iteration count $t$ increases in Algorithms \ref{alg:Q} and \ref{alg:Delta}. For the hard-thresholding-based version, see Figure \ref{FigNoise}(a), we observe an error decreasing by a constant factor at each iteration when the measurements are totally accurate. Introducing a pre-quantization noise $\vect{e} \sim N(0,\sigma^2 {\bf I})$ in $\vect{y} = \mathrm{sign} (\mathbf{A} \vect{x} + \vect{e})$ does not affect this behavior too much until the ``noise floor'' is reached. Flipping a small fraction of the bits $\mathrm{sign} \ip{\vect{a}_i}{\vect{x}}$ by multiplying them with $f_i = \pm 1$, most of which being equal to $+1$, seems to have an even smaller effect on the reconstruction. However, these bit flips prevent the use of the second-order-cone-programming-based version, as the constraints of the optimization problems become infeasible. But we still remark that the pre-quantization noise is not very damaging in this case either, see Figure \ref{FigNoise}(b), where the results of an experiment using $\ell_1$-regularized logistic regression in Algorithms \ref{alg:Q} and \ref{alg:Delta} are also displayed. \begin{figure}[htbp] \center \subfigure{ (a) \includegraphics[width=0.42\textwidth]{FigNoiseHT_new.png} \label{FigNoiseHT} }\quad \subfigure{ (b) \includegraphics[width=0.42\textwidth]{FigNoiseLP_new.png} \label{FigNoiseLP} } \caption{Averaged relative error for the reconstruction of sparse vectors ($n=100$) by the outputs of Algorithms~\ref{alg:Q}-\ref{alg:Delta} based on (a) hard thresholding ($s=15$, $m=10^5$) and second-order cone programming and (b) $\ell_1$-regularized logistic regression ($s=10$, $m=2\cdot 10^4$) as a function of the iteration count when measurement error is present. } \label{FigNoise} \end{figure} \section{Discussion}\label{sec:discussion} \subsection{Related work}\label{sec:related} The one-bit compressed sensing framework developed by Boufounos and Baraniuk~\cite{Boufounos2008} is a relatively new line of work, with theoretical backing only recently being developed. Empirical evidence and convergence analysis of algorithms for quantized measurements appear in the works of Boufounos et al. and others~\cite{Boufounos2009,Boufounos2008,Laska2010,Zymnis2010}. Theoretical bounds on recovery error have only recently been studied, outside from results which model the one-bit setting as classical compressed sensing with specialized additive measurement error~\cite{Dai2009,jacques2011dequantizing,Sun2009}. Other settings analyze quantized measurements where the number of bits used depends on signal parameters like sparsity level or the dynamic range~\cite{ardestanizadeh2009,gunturk2010,gunturk2010paper}. Boufounos develops hierarchical and scalar quantization with modified quantization regions which aim to balance the rate-distortion trade-off~\cite{boufounos2011hierarchical,boufounos2012universal}. These results motivate our work but do not directly apply to the compressed sensing setting. Theoretical guarantees more in line with the objectives of this paper began with Jacques et al.~\cite{Jacques2011} who proved robust recovery from approximately $s\log n$ one-bit measurements. However, the program used has constraints which require sparsity estimation, making it NP-Hard in general. Gupta et al. offers a computationally feasible method via a scheme which either depends on the dynamic range of the signal or is adaptive~\cite{Gupta2010}. Plan and Vershynin analyze a tractable non-adaptive convex program which provides accurate recovery without these types of dependencies~\cite{pv-1-bit,pv-noisy-1bit,alpv-1bit}. Other methods have also been proposed, many of which are largely motivated by classical compressed sensing methods (see e.g.~\cite{Boufounos2009,movahed2012robust,yan2012robust,ma2013two,jacques2013quantized}). In order to break the bound \eqref{eq:bestknown} and obtain an exponential rather than polynomial dependence on the oversampling factor, one cannot take traditional non-adaptive measurements. Several schemes have employed adaptive samples including the work of Kamilov et. al. which utilizes a generalized approximate message passing algorithm (GAMP) for recovery, and the adaptive thresholds are selected in line with this recovery method. Adaptivity is also considered in~\cite{Gupta2010} which allows for a constant factor improvement in the number of measurements required. However, to our best knowledge our work is the first to break the bound given by~\eqref{eq:bestknown}. Regarding the link between our methods and sparse binary regression, there is a number of related theoretical results focusing on sparse logistic regression \cite{negahban2010unified, bunea2008honest,van2008high, bach2010self, ravikumar2010high, meier2008group, kakade2009learning}, but these are necessarily constrained by the same limited accuracy of the one-bit compressed sensing model discussed in Section \ref{sec:intro}. We also point to the closely related threshold group testing literature, see e.g., \cite{cheraghchi2013improved}. In many cases, the statistician has some control over the threshold beyond which the measurement maps to a one. For example, the wording of a binary survey may be adjusted to only ask for a positive answer in an extreme case; a study of the relationship of heart attacks to various factors may test whether certain subjects have heart attacks in a short window of time and other subjects have heart attacks in a long window of time. The main message of this paper is that by carefully choosing this threshold the accuracy of reconstruction of the parameter vector $\vect{x}$ can be greatly increased. \subsection{Conclusions} We have proposed a recursive framework for adaptive thresholding quantization in the setting of compressed sensing. We have developed both a second-order-cone-programming-based method and a hard-thresholding-based method for signal recovery from these type of quantized measurements. Both of our methods feature a bound on the recovery error of the form $e^{-\Omega(\lambda)}$, an exponential dependence on the oversampling factor $\lambda$. To our best knowledge, this is the first result of this kind, and it improves upon the best possible dependence of $\Omega(1/\lambda)$ for non-adaptively quantized measurements. \subsection*{Acknowledgements} We would like to thank the AIM SQuaRE program for hosting our initial collaboration and also Mr.\ Lan for discussions around the relationship of our work to logistic regression. \bibliographystyle{myalpha}
{'timestamp': '2014-08-01T02:04:09', 'yymm': '1407', 'arxiv_id': '1407.8246', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8246'}
arxiv
\section{Introduction} \label{sec:intro} In genetic epidemiology studies [\citet{Struewingetal1997,Marderetal2003,Goldwurm2011}], family history data is collected to estimate the cumulative distribution function of disease onset in populations with different risk factors (e.g., genetic mutation carriers and noncarriers). Such estimates provide crucial information to assist clinicians, genetic counselors and patients to make important decisions such as mastectomy [\citet{Gradyetal2013}]. The family history data, however, raises serious challenges when estimating the cumulative risk. First, a family member's exact risk factor is unknown; the only available information is the estimated \emph {probabilities} that a family member has each risk factor. Second, ages of disease onset are subject to censoring due to patient drop-out or loss to follow-up. For such family history data, the cumulative risk of disease is thus a mixture of cumulative distributions for the risk factors with known mixture probabilities. While different parametric and nonparametric estimators have been proposed for estimating these mixture data distribution functions, they are not guaranteed to be monotonic or nonnegative, two principle features of distribution functions. Most of these estimators also examine the mixture distributions only at individual time points, rather than at a range of time points. To overcome these challenges, we develop a novel, simultaneous estimation method which combines isotone regression [\citet {Barlowetal1972}] with an Expectation--Maximization (EM) algorithm. Our algorithm is based on the binomial likelihood at all observations [\citet{Huangetal2007,MaWang2013}], and yields estimated distribution functions that are nonnegative, monotone, consistent, efficient and that provide estimates of the cumulative risk over a range of time points. Family history data is often collected when studying the risk of disease associated with rare mutations [\citet{Struewingetal1997,Marderetal2003,Wangetal2008,Goldwurm2011}]. For example, estimating the probability that Ashkenazi Jewish women with specific mutations of BRCA1 or BRCA2 will develop breast cancer [\citet{Struewingetal1997}], estimating the survival function from relatives of Huntington's Disease probands with expanded C-A-G repeats in the huntingtin gene [\citet{Wangetal2012}] and, in this paper, estimating age at onset of Parkinson's disease in carriers of PARK2 mutations (Section~\ref{sec:intro-corepd}). In all these cases, a sample of (usually diseased) subjects referred to as probands are genotyped. Disease history in the probands' first-degree relatives, including age at onset of the disease, is obtained through validated interviews [\citet {Marderetal2003}]. Because of practical considerations, including high costs or unwillingness to undergo genetic testing, the relatives' genotype information is not collected. Instead, the probability that the relative has the mutation or not is computed based on the relative's relationship to the proband and the proband's mutation status [\citet{Khouryetal1993}, Section~8.4]. Thus, the distribution of the relative's age at onset of a disease is a mixture of genotype-specific distributions with known, subject-specific mixing proportions. A first attempt at estimating the mixture distribution functions was based on assuming parametric or semiparametric forms [\citet {Wuetal2007}] for the underlying mixture densities. To avoid model misspecification, however, nonparametric estimators such as the nonparametric maximum likelihood estimator (NPMLE) were also proposed. While in many situations the NPMLEs are consistent and efficient, they are neither for the mixture model [\citet{Wangetal2012,MaWang2013}]. As improvements over the NPMLEs, \citet{Wangetal2012} and \citet{MaWang2013} proposed consistent and efficient nonparametric estimators based on estimating equations. The estimators stem from casting the problem into a semiparametric theory framework and identifying the efficient estimator. The resulting estimator, however, can have computational difficulties when the data is censored, as it uses inverse probability weighting (IPW) and augmented IPW to estimate the mixture distribution functions [\citet {Wangetal2012}]. The weighting function involves a Kaplan--Meier estimator which can result in unstable estimation because the weighting function can be close to zero in the right tail. There is also no guarantee that the resulting estimator is monotonic or nonnegative, thus, a post-estimate adjustment was implemented to ensure monotonicity. In this paper, we propose a novel nonparametric estimator that is neither complex nor computationally intensive, and yields a genuine distribution for the mixture data problem under the monotonicity constraint of a distribution function. Providing nonparametric estimators for survival functions under ordered constraints has received considerable attention recently [\citet {Parketal2012,Barmi2013}], but the emphasis has been on nonmixture data. The method we propose is applicable to mixture data. Our method is motivated from a real-world study on genetic epidemiology of Parkinson's disease (see Section~\ref{sec:intro-corepd}) and is based on maximizing a binomial likelihood simultaneously at all observations [\citet{Huangetal2007}]. Our method involves combining an EM algorithm and isotone regression [\citet{Ayeretal1955}] so that monotonicity is ensured. We demonstrate that our estimator is consistent, satisfies self-consistent estimating equations and yields large power in detecting differences between the distribution functions in the mixture populations. Our estimator is easy to implement and, for nonmixture data, we show that our method coincides with the NPMLE. \subsection{CORE-PD study to estimate the risk of PARK2 mutations} \label{sec:intro-corepd} Parkinson's disease (PD) is a neurodegenerative disorder of the central nervous system that results in bradykinesia, tremors and problems with gait. PD mostly affects the elderly 50 and older, but early onset cases do occur and are hypothesized to be a result of genetic risk factors. Mutations in the PARK2 gene [\citet{Kitadaetal1998,Hedrichetal2004}] are the most common genetic risk factor for early-onset PD [\citet {Luckingetal2000}] and may be a risk factor for late onset [\citet {Oliveiraetal2003}]. While mutations in the PARK2 gene are rare, genetic or acquired defects in Parkin function may have far-reaching implications for the understanding and treatment of both familial and sporadic PD. To understand the effects of mutations in the PARK2 gene, the Consortium on Risk for Early Onset PD (CORE-PD) study was begun in 2004 [\citet{Marderetal2010}]. Experienced neurologists performed in-depth examinations (i.e., neurological, cognitive, psychiatric assessments) of proband participants, a subset of noncarriers, and some of the first-degree relatives of probands and noncarriers. For relatives who were not examined in person, their PARK2 genotypes were not available, but their age at onset of PD was obtained through systematic family history interviews [\citet{Marderetal2003}]. Based on this family history data, the objective then is to determine the age-specific cumulative risk of PD in PARK2 mutation carriers and noncarriers. The results will help patients interpret a positive test result both in deciding treatment options and making important life decisions such as family planning. The remaining sections of this paper are as follows. Section~\ref{sec:bin_main_results} describes our proposed estimator which involves maximizing a binomial log-likelihood with an EM algorithm. We demonstrate that the ensuing estimator solves a self-consistent estimating equation and is consistent for complete and right censored data. We demonstrate in Section~\ref{sec:main_results} that we can reformulate the estimator using a different EM algorithm, for which we can apply the pool adjacent violators algorithm (PAVA) from isotone regression to yield a nonnegative and monotonic estimator. We demonstrate the advantages of our new estimator over current ones through extensive simulation studies in Section~\ref{sec:simulation_study}. We apply our estimator to the CORE-PD study in Section~\ref{sec:real_data} and conclude the paper in Section~\ref{sec:conclusion}. Technical details are in the \hyperref[app]{Appendix}, and additional numerical results are available in the supplementary material [\citet{supp}]. \section{Binomial likelihood estimation} \label{sec:bin_main_results} To simplify the presentation, we focus on a mixture distribution with two components; the techniques presented can be easily extended to more than two components. For $i=1,\ldots,n$, we observe a quantitative measure $S_i$ known to come from one of $p=2$ populations with corresponding distributions $F_1,F_2$ and densities $dF_1,dF_2$. For example, in the Parkinson's disease study, $S_i$ is the age of disease onset, $F_1$ is the distribution for the PARK2 mutation carrier group, and $F_2$ is for the noncarrier group. The exact population to which $S_i$ belongs is unknown (i.e., we do not know whether a family member is a mutation carrier or noncarrier), but one can estimate the probability $q_{ki}$ that $S_i$ was generated from the $k$th population, $k=1,2$. We suppose the mixture probability $\bQ_i$ has a discrete distribution, denoted as $p_{\bQ}({\mathbf{q}}_i)$, with finite support ${\mathbf {u}}_1,\ldots,{\mathbf{u}}_m$. We also suppose that $q_{1i}+q_{2i}=1$ and, hence, sometimes write $q_{1i}\equiv\lambda_i$ and $q_{2i}\equiv1-\lambda_i$. In this case, instead of referring to the discrete distribution $p_{\bQ }({\mathbf{q}}_i)$, we simply refer to the distribution of $\lambda_i$, denoted as $\eta (\lambda_i)$. Furthermore, $S_i$ is subject to right-censoring, so we observe $X_i=\min(S_i,C_i)$, where $C_i$ is a random censoring time independent of $S_i$. We let $G(\cdot)$ denote the survival function of $C_i$ and $dG(\cdot)$ its corresponding density. Last, we let $\Delta_i=I(S_i\leq C_i)$ denote the censoring indicator. Our objective is to use the independent, identically distributed (i.i.d.) data $(\bQ_i={\mathbf{q}}_i,X_i=x_i,\Delta_i=\delta_i)$ to form a nonparametric estimator of $\bF(t)=\{F_1(t),F_2(t)\}^T$ that is consistent, monotone on the support of $S_i$ and efficient. Identifiability of $\bF(t)$ is ensured since the mixture probabilities are assumed known and $\bQ_i$ are not all the same [\citet{Wangetal2007}]. In fact, if $Q_i$ has at least $k$ distinguished the support points, then the model is identifiable. To estimate $\bF(t)$, we first consider the nonparametric log-likelihood \[ \sum_{i=1}^n \log \bigl(p_{\bQ}({ \mathbf{q}}_i)\bigl\{{\mathbf {q}}_i^T \bd\bF(x_i)G(x_i)\bigr\} ^{\delta_i}\bigl[\bigl\{1-{ \mathbf{q}}_i^T\bF(x_i)\bigr \}\,dG(x_i)\bigr]^{1-\delta _i} \bigr). \] Because $p_{\bQ}(q_i)$ is independent of the estimation of $\bF(t)$, and the censoring times are random, the log-likelihood above simplifies to \begin{equation} \label{eqn:npmle} \sum_{i=1}^n \log\bigl[ \bigl\{{\mathbf{q}}_i^T \bd\bF(x_i)\bigr \}^{\delta _i}\bigl\{1-{\mathbf{q}}_i^T\bF (x_i)\bigr\}^{1-\delta_i}\bigr]. \end{equation} Different maximizations of (\ref{eqn:npmle}) result in the commonly used NPMLEs (see Appendix \ref{sec:npmle_solution}). Unfortunately, for the mixture data problem, they turn out to be inconsistent or inefficient [\citet{MaWang2012}]. \subsection{Motivation for binomial likelihood formulation} \label{sec:motivation_binlik} As an improvement over the NPMLEs, we consider a binomial likelihood estimator. To motivate this estimator, we first consider a nonmixture model without censoring. That is, we observe independent observations $S_1,\ldots,S_n$ generated from a common distribution~$F$. Without loss of generality, we suppose $S_1\leq S_2\leq\cdots\leq S_n$ (i.e., ties may occur). We demonstrate that, in this setting, the NPMLE and the binomial likelihood estimator of $F$ are the same. Thus, because the NPMLE is most efficient in this setting, the binomial likelihood estimator is as well. For nonmixture data without censoring, the nonparametric estimator of $F$ maximizes \[ \sum_{i=1}^n \log \,dF(s_i) \] with respect to $dF(s_i)$ subject to $\sum_{i=1}^n \,dF(s_i)=1$ and $dF(s_i)\geq0$. From first principles, the maximizer is the well-known empirical distribution function, $\wh F_n(t)=n^{-1}\sum_{i=1}^nI(s_i\leq t)$. On the other hand, the empirical distribution function is also the maximizer of the following binomial log-likelihood. For distinctive time points $t_1 < t_2< \cdots< t_h$ and each $S_i$, denote a success if $S_i >t_j$ and a failure if $S_i\leq t_j$ $i=1,\ldots,n$, $j=1,\ldots,h$. The probability of a success is $\bar F(t_j):=1-F(t_j)$, and the probability of a failure is $F(t_j)$. The times $t_1,\ldots,t_h$ can be arbitrary, but are typically chosen to span the support of the events $S_i$ so as to estimate the cumulative distribution function over the full support. Accounting for all possible successes and failures, the binomial log-likeli\-hood is \[ \sum_{j=1}^h\sum _{i=1}^n \bigl\{I(s_i\leq t_j)\log F(t_j)+I(s_i>t_j) \log \bar F(t_j)\bigr\}. \] Maximizing the above with respect to each $F(t_j)$ and subject to the monotonic constraint $F(t_1)\leq F(t_2)\leq\cdots\leq F(t_h)$ gives \[ \wh{F}_n(t_j)=n^{-1}\sum _{i=1}^n I(s_i\leq t_j), \qquad j=1,\ldots,h. \] However, this is exactly the empirical distribution function which, by definition, satisfies the monotonic constraint. Therefore, in the nonmixture case, maximizing the nonparametric log-likelihood with respect to $dF$ is equivalent to maximizing the binomial log-likelihood with respect to $F$ subject to the monotonic constraint $F(t_1)\leq F(t_2)\leq\cdots\leq F(t_h)$. Because the two estimators are equivalent and the NPMLE is known to be most efficient, the resulting binomial likelihood estimator is fully efficient. Motivated by this result, we anticipate that maximizing the binomial log-likelihood may yield highly efficient estimators in more general mixture models. \subsection{Binomial likelihood estimator for censored mixture data} \label{sec:bin_censored} We now construct a binomial likelihood estimator for mixture data with censoring. Again, consider arbitrary time points $t_1 < \cdots< t_h$, such that for each event time $S_i$, a~success occurs if $S_i > t_j$ and a failure if $S_i \leq t_j$, $i=1,\ldots,n$, $j=1,\ldots,h$. As in Section~\ref{sec:motivation_binlik}, we allow for ties in the event times $S_i$, and choose times $t_1,\ldots,t_h$ to span the support of the event times. Under censoring, we observe $X_i=\min(S_i,C_i)$, which means a success, $I(S_i>t_j)$, is unobservable for those subjects who are lost to follow-up before $t_j$. A natural approach then is to view the unobserved successes as missing data and to use an EM algorithm to maximize the constructed binomial log-likelihood. Let $V_{ij}=I(S_i>t_j)$, the unobserved success. For mixture data, when $V_{ij}$ is observable (i.e., noncensored data), we have that $P(V_{ij}=1)=\lambda_i \bar F_1(t_j) + (1-\lambda_i) \bar F_2(t_j)$ and $P(V_{ij}=0)=\lambda_iF_1(t_j)+(1-\lambda_i)F_2(t_j)$, where $\bar F_k(t_j)=1-F_k(t_j)$, $k=1,2$. Considering all time points $t_1,\ldots, t_h$, and all possible successes and failures, the complete data binomial log-likelihood of $\{I(S_i>t_j)\}$, $i=1,\ldots,n$, $j=1,\ldots,h$, is \begin{eqnarray*} &&\sum_{j=1}^h\sum _{i=1}^n\bigl[ I(s_i\leq t_j)\log\bigl\{\lambda_i F_1(t_j)+(1- \lambda_i)F_2(t_j)\bigr\} \\ &&\quad\qquad{}+I(s_i> t_j)\log\bigl\{\lambda_i \bar F_1(t_j)+(1-\lambda_i)\bar F_2(t_j)\bigr\}\bigr]. \end{eqnarray*} If $V_{ij}=I(S_i>t_j)$ were observable, we could estimate $\bF(t_j)$, $j=1,\ldots,h$, by maximizing the binomial log-likelihood with respect to $F_1(t_j)$ and $F_2(t_j)$. However, because $V_{ij}$ is unobservable, we instead use an EM algorithm for maximization. An EM algorithm at a single $t_j$ was given in \citet{MaWang2013}, but they did not further pursue it. In fact, \citet{Efron1967} did impute this. The EM algorithm we propose is an iterative procedure where at the $b$th step the imputed $V_{ij}$ is \begin{eqnarray} \label{eqn:w_formula} w_{ij}^{(b)}&=&E\bigl\{I(S_i>t_j)|x_i \bigr\} \nonumber \\[-8pt] \\[-8pt] \nonumber &=&I(x_i>t_j)+(1-\delta_i)I(x_i \leq t_j)\frac{\lambda_i\bar F_1^{(b)}(t_j)+(1-\lambda_i)\bar F_2^{(b)}(t_j)} { \lambda_i\bar F_1^{(b)}(x_i)+(1-\lambda_i)\bar F_2^{(b)}(x_i)},\nonumber \end{eqnarray} based on the observed data $X_i=x_i$. The E-step is then the imputed binomial log-likelihood \begin{eqnarray} \label{eqn:estep}&& \sum_{j=1}^h\sum _{i=1}^n\bigl[\bigl(1-w_{ij}^{(b)} \bigr)\log\bigl\{\lambda _iF_1(t_j)+(1- \lambda_i)F_2(t_j)\bigr\} \nonumber \\[-8pt] \\[-8pt] \nonumber &&\quad\qquad{}+w_{ij}^{(b)}\log\bigl\{\lambda_i\bar F_1(t_j)+(1-\lambda_i)\bar F_2(t_j)\bigr\} \bigr]. \end{eqnarray} The M-step then maximizes the above with respect to $F_1(t_j)$ and $F_2(t_j)$; specifically, the M-step involves solving \begin{eqnarray} \label{eqn:bin_esteqn_censor} -\sum_{i=1}^n \lambda_i\frac{w_{ij}^{(b)}-\lambda_i\bar F_1(t_j)-(1-\lambda_i)\bar F_2(t_j)} { \{\lambda_iF_1(t_j)+(1-\lambda_i)F_2(t_j)\}\{\lambda_i \bar F_1(t)+(1-\lambda_i)\bar F_2(t)\}}&=&0, \nonumber \\[-8pt] \\[-8pt] \nonumber -\sum_{i=1}^n(1-\lambda_i) \frac{w_{ij}^{(b)}-\lambda_i\bar F_1(t_j)-(1-\lambda_i)\bar F_2(t_j)} { \{\lambda_iF_1(t_j)+(1-\lambda_i)F_2(t_j)\}\{\lambda_i \bar F_1(t)+(1-\lambda_i)\bar F_2(t)\}}&=&0, \end{eqnarray} for $j=1,\ldots,h$. The solution to (\ref{eqn:bin_esteqn_censor}) leads to the new estimate $F_1^{(b+1)}(t_j)$ and $F_2^{(b+1)}(t_j)$. Iterating the E- and M-steps until convergence leads to the binomial likelihood estimator $\wh\bF(t_j)$, $j=1,\ldots,h$, for censored mixture data. We now make several observations about this proposed estimator. The estimating equations in (\ref{eqn:bin_esteqn_censor}) are optimally weighted [\citet{Godambe1960}] and are, in fact, self-consistent estimating equations [\citet{Efron1967}]. The self-consistency stems from the imputation procedure of the EM algorithm, analogously to the work of \citet{Efron1967}. In the special case of right censoring but no mixture, the above approach has a closed-form solution, which is the celebrated Kaplan--Meier estimator [\citet{Efron1967}]. In the general case, it can be shown that the proposed estimator $\wh\bF$ is consistent. The proof is trivial if $\bF$ takes discrete finite many values. On the other hand, if $\bF$ is a continuous distribution, one may use the law of large sample and Kullback--Leibler information inequality to prove it. Details are given in the Appendix \ref{sec:consistency_imputed_loglikelihood}. Asymptotics of $\wh\bF(t_j)$ are much more involved, however, and require solving a complex integral equation which is impractical. Hence, inference is usually performed using a Bootstrap approach. Solving for $\wh\bF(t)$ in practice is also a computationally intensive task. No closed-form solution to (\ref{eqn:bin_esteqn_censor}) exists, and ensuring monotonicity and nonnegativity of $\wh\bF(t)$ would actually require solving (\ref{eqn:bin_esteqn_censor}) subject to the constraints $F_k(t_1)\leq F_k(t_2)\leq\cdots\leq F_k(t_h)$, $k=1,2$, for $t_1\leq\cdots\leq t_h$. Such a constraint only further complicates the already demanding estimation procedure. Still, requiring monotonicity is essential when the data is censored. Without monotonicity, the imputed weights $w_{ij}^{(b)}$ may not be in the range $(0,1)$, which could lead to nonconvergence when solving~(\ref{eqn:bin_esteqn_censor}). Thus, to ensure monotonicity and avoid the complexities of directly solving~(\ref{eqn:bin_esteqn_censor}), we now describe another approach for obtaining the binomial likelihood estimator. \section{Genuine nonparametric distribution estimators} \label{sec:main_results} To construct a monotone and nonnegative estimator $\wh\bF(t)$ at times $t_1< \cdots< t_h$, we maximize a binomial log-likelihood using a combined EM algorithm and pool adjacent violators algorithm (PAVA). Before describing the new method, we first provide a brief overview of PAVA. \subsection{Pool adjacent violator algorithm} Isotone regression [\citet{Barlowetal1972}] is the notion of fitting a monotone function to a set of observed points $y_1,\ldots,y_n$ in a plane. Formally, the problem involves finding a vector $\ba =(a_1,\ldots,a_n)^T$ that minimizes the weighted least squares \[ \sum_{i=1}^n r_i(y_i-a_i)^2 \] subject to $a_1\leq\cdots\leq a_n$ for weights $r_i>0$, $i=1,\ldots,n$. The solution to this optimization problem is the so-called max-min formula [\citet{Barlowetal1972}]: \[ \wh a_j=\max_{s \leq j}\min _{t\geq j} \frac{\sum_{h=s}^t y_hr_h}{\sum_{h=s}^t r_h},\qquad j=1,\ldots,n. \] Rather than solving this max-min formula, the weighted least squares problem is instead solved using PAVA [\citet{Ayeretal1955,Barlowetal1972}], a simple procedure that yields the solution in $O(n)$ time [\citet{GrotzingerWitzgall1984}]. The history of PAVA, its computational aspects and a fast implementation in R are discussed in \citet{Leeuwetal2009}. Variations of PAVA implementation include using up-and-down blocks [\citet{Kruskal1964}] and recursive partitioning [\citet{Lussetal2010}]. Our idea is to apply PAVA to a variant of our binomial loglikehood and yield a monotone estimator $\wh\bF(t)$. It is important to note that we cannot simply apply PAVA to the estimator solving (\ref{eqn:bin_esteqn_censor}). The E-step in (\ref {eqn:estep}) is not in the exponential family, which is a requirement of PAVA [\citet{Robertsonetal1988}].\vadjust{\goodbreak} Furthermore, applying PAVA to maximize a binomial log-likelihood has been used in current status data [\citet{JewellKalbfleisch2004}], but not in the context of mixture data as we do. \subsection{PAVA-based binomial likelihood estimator for censored mixture data} \label{sec:non_censored_data} We now modify the construction of the binomial likelihood estimator for censored mixture data (Section~\ref{sec:bin_censored}) so that PAVA may be applied. In our earlier construction (Section~\ref{sec:bin_censored}), we viewed the event $I(S_i>t_j)$ as the only missing data, $i=1,\ldots,n$, $j=1,\ldots,h$. Now, we also consider the unobserved population membership as missing. Let $L_i$ denote the unobserved population membership for observation $i$. Analogous to the argument in Section~\ref{sec:bin_censored}, we first consider the ideal situation when $L_i$ and $I(S_i>t_j)$ are observable. We suppose $L_i=1$ when $S_i$ is generated from $F_1$, and $L_i=0$ when $S_i$ is generated from $F_2$. In this case, $P(L_i=1)=\lambda_i$ and $P(L_i=0)=1-\lambda_i$. For mixture data, the probability $S_i >t_j$ is $\lambda_i \bar F_1(t_j)$ when $L_i=1$ and is $(1-\lambda_i)\bar F_2(t_j)$ when $L_i=0$. Likewise, the probability $S_i\leq t_j$ is $\lambda_i F_1(t_j)$ when $L_i=1$ and is $(1-\lambda_i)F_2(t_j)$ when $L_i=0$. Therefore, the complete data log-likelihood of $\{L_i, I(S_i\leq t_j)\}, i=1,2\ldots,n, j=1,2,\ldots,h$, is the binomial log-likelihood \begin{eqnarray*} \ell_c &=& \sum_{j=1}^h \sum_{i=1}^n \bigl[L_iI(S_i \leq t_j)\log\bigl\{\lambda _iF_1(t_j) \bigr\} +L_iI(S_i>t_j)\log\bigl\{ \lambda_i\bar F_1(t_j)\bigr\} \\ &&\quad\qquad{}+ (1-L_i)I(S_i\leq t_j)\log\bigl\{(1- \lambda_i)F_2(t_j)\bigr\} \\ &&\hspace*{78pt}\qquad{}+(1-L_i)I(S_i>t_j)\log\bigl\{(1- \lambda_i)\bar F_2(t_j)\bigr\}\bigr]. \end{eqnarray*} However, neither the population membership $L_i$ nor the event $I(S_i>t_j)$ are available. Hence, these values must be imputed, and an EM algorithm will be used for maximization. At the $b$th step of the EM algorithm, we compute $E\{L_iI(S_i\leq t_j)|x_i\}= E\{L_i|S_i\leq t_j\}E\{I(S_i\leq t_j)|x_i\}$ and $E\{ L_iI(S_i > t_j)|x_i\}= E\{L_i|\break S_i>t_j\}E\{I(S_i> t_j)|x_i\}$ based on observed data $X_i=\min(S_i,C_i)$ with $X_i=x_i$. We found earlier that $E\{I(S_i> t_j)|x_i\}=w_{ij}^{(b)}$ as defined in (\ref {eqn:w_formula}). Using a similar calculation, we obtain \begin{eqnarray*} u_{ij}^{(b)}&\equiv& E(L_i|S_i \leq t_j)=\frac{\lambda_i F_1^{(b)}(t_j)}{\lambda_i F_1^{(b)}(t_j)+(1-\lambda _i)F_2^{(b)}(t_j)}, \\ v_{ij}^{(b)}&\equiv& E(L_i|S_i> t_j)=\frac{\lambda_i\bar F_1^{(b)}(t_j)}{\lambda_i\bar F_1^{(b)}(t_j)+(1-\lambda_i)\bar F_2^{(b)}(t_j)}. \end{eqnarray*} Therefore, at the $b$th step, with observed data $\bO^{(b)}=\{X_i\}, i=1,\ldots,n$, the E-step is \begin{eqnarray*} E\bigl(\ell_c|\bO^{(b)}\bigr)&=& \sum _{j=1}^h \sum_{i=1}^n \bigl[u_{ij}^{(b)}\bigl(1-w_{ij}^{(b)} \bigr)\log\bigl\{\lambda_i F_1(t_j)\bigr\} +v_{ij}^{(b)}w_{ij}^{(b)}\log\bigl\{ \lambda_i\bar F_1(t_j)\bigr\} \\ &&\quad\qquad{}+ \bigl(1-u_{ij}^{(b)}\bigr) \bigl(1-w_{ij}^{(b)} \bigr)\log\bigl\{(1-\lambda_i)F_2(t_j)\bigr \} \\ &&\hspace*{85pt}\qquad{}+\bigl(1-v_{ij}^{(b)}\bigr)w_{ij}^{(b)} \log\bigl\{(1-\lambda_i)\bar F_2(t_j)\bigr\} \bigr]. \end{eqnarray*} The M-step then maximizes the above expression with respect to $F_1(t_j)$ and $F_2(t_j)$ at each $t_j$. To ensure monotonicity, however, the M-step actually involves maximizing $E(\ell_c|\bO^{(b)})$ subject to the monotonic constraints $F_k(t_1)\leq F_k(t_2)\leq \cdots\leq F_k(t_h)$, $k=1,2$. Though constrained maximization is typically a challenging procedure, the task is simplified because the log-likelihood $E(\ell_c|\bO^{(b)})$ belongs to the exponential family, in which case PAVA is applicable. From the theory of isotonic regression [\citet{Robertsonetal1988}], we have \begin{eqnarray*} &&\argmax_{F_1(t_1)\leq\cdots\leq F_1(t_h)}E\bigl(\ell_c|\bO^{(b)}\bigr)\\ &&\qquad= \argmin_{F_1(t_1)\leq\cdots\leq F_1(t_h)} \sum_{j=1}^h \sum _{i=1}^n r_{1ij}^{(b)} \biggl\{u_{ij}^{(b)}\frac {1-w_{ij}^{(b)}}{r_{1ij}^{(b)}}-F_1(t_j) \biggr\}^2, \\ &&\argmax_{F_2(t_1)\leq\cdots\leq F_2(t_h)}E\bigl(\ell_c|\bO^{(b)}\bigr)\\ &&\qquad= \argmin_{F_2(t_1)\leq\cdots\leq F_2(t_h)} \sum_{j=1}^h \sum _{i=1}^n r_{2ij}^{(b)} \biggl\{ \bigl(1-u_{ij}^{(b)} \bigr)\frac {1-w_{ij}^{(b)}}{r_{2ij}^{(b)}}-F_2(t_j) \biggr\}^2, \end{eqnarray*} where $r_{1ij}^{(b)}=u_{ij}^{(b)} (1-w_{ij}^{(b)} )+v_{ij}^{(b)}w_{ij}^{(b)}$ and $r_{2ij}^{(b)}= (1-u_{ij}^{(b)} ) (1-w_{ij}^{(b)} )+ (1-v_{ij}^{(b)} )w_{ij}^{(b)}$. These formulations suggest that $\{F_1(t_j)\}_{j=1}^h$ is the weighted isotonic regression of u_{ij}^{(b)} (1-w_{ij}^{(b)} )/r_{1ij}^{(b)}$ with weights $r_{1ij}^{(b)}$. Likewise, $\{F_2(t_j)\}_{j=1}^h$ is the weighted isotonic regression of (1-u_{ij}^{(b)} ) (1-w_{ij}^{(b)} )/r_{2ij}^{(b)}$ with weights $r_{2ij}^{(b)}$. Thus, the max-min results of isotone regression apply and yield solutions\looseness=1 \begin{eqnarray*} \wt F_1^{(b+1)}(t_j)&=&\max _{s\leq j}\min_{t\geq j}\frac{\sum_{h=s}^t\sum_{i=1}^n u_{ih}^{(b)} (1-w_{ih}^{(b)} )}{\sum_{h=s}^t\sum_{i=1}^n \{u_{ih}^{(b)} (1-w_{ih}^{(b)} ) +v_{ih}^{(b)}w_{ih}^{(b)} \}}, \\ \wt F_2^{(b+1)}(t_j)&=&\max_{s\leq j} \min_{t\geq j}\frac{\sum_{h=s}^t\sum_{i=1}^n (1-u_{ih}^{(b)} ) (1-w_{ih}^{(b)} )}{\sum_{h=s}^t\sum_{i=1}^n \{ (1-u_{ih}^{(b)} ) (1-w_{ih}^{(b)} ) + (1-v_{ih}^{(b)} )w_{ih}^{(b)} \}}. \end{eqnarray*}\looseness=0 Rather than solving these max-min formulas, we instead use the PAVA algorithm implemented in R [\citet{Leeuwetal2009}]. Iterating through the E- and M-steps with PAVA leads to a genuine estimator of the mixture distributions. For noncensored data (i.e., $\delta_i=1$, $i=1,\ldots,n$), $w_{ij}^{(b)}$ in (\ref{eqn:w_formula}) simplifies to $w_{ij}^{(b)}=I(S_i > t_j)$. In this case, the proposed EM algorithm with PAVA in the M-step remains as stated but with $w_{ij}^{(b)}=I(S_i > t_j)$ throughout. Finally, the proposed EM-PAVA algorithm converges to the maximum likelihood estimate of the binomial likelihood. This follows because $E(\ell_c|\bO^{(b)})$ belongs to the exponential family and is convex [\citet{Wu1983}]. Thus, the derived estimator is the unique maximizer and satisfies the monotonic property of distribution functions. \subsection{Hypothesis testing} \label{sec:hypothesis_tests} For a two-mixture model, one key interest is testing for differences between the two mixture distributions, that is, testing $H_0\dvtx F_1(t)=F_2(t)$ vs. $H_1\dvtx F_1(t)\neq F_2(t)$ for a finite set of $t$ values or over an entire range. To test this difference, we suggest the following permutation strategy [\citet{ChurchillDoerge1994}]. For the data set given, obtain the estimate $\wt\bF^{(0)}(t)$ using the EM-PAVA algorithm and compute $s^{(0)}=\sup_{t}|\wt F_1^{(0)}(t)-\wt F_2^{(0)}(t)|$. Then, for $k=1,\ldots,K$, create a permuted sample of the data by permuting the pairs $(X_i,\delta_i)$ and coupling them with the mixture proportions ${\mathbf{q}}_1,\ldots,{\mathbf {q}}_n$. For the $k$th permuted data set, compute $\wt\bF^{(k)}(t)$ and $s^{(k)}=\sup_{t}|\wt F_1^{(k)}(t)-\wt F_2^{(k)}(t)|$. Finally, the $p$-value associated with testing $H_0$ is $\sum_{k=1}^K I(s^{(k)}\geq s^{(0)})/K$. In practice, we recommend using $K=1000$ permutation data sets. We compare the power of various tests in Section~\ref{sec:simulation_study}.\eject \section{Simulation study} \label{sec:simulation_study} \subsection{Simulation design} We performed extensive simulation studies to investigate the performance of the proposed EM-PAVA algorithm. We report here the results of three experiments comparing EM-PAVA to existing estimators in the literature: the type~I NPMLE, type~II NPMLE (see Appendix \ref {sec:npmle_solution} for the forms of the NPMLEs), and the oracle efficient augmented inverse probability weighting estimator (Oracle EFFAIPW) of \citet{Wangetal2012}, Section~3. ``Oracle'' here refers to the assumption that the underlying density $\bd\bF(t)$ is known exactly and is not estimated using nonparametric methods. The three experiments were designed as follows: \begin{longlist}[Experiment 1:] \item[\textit{Experiment} 1:] $F_1(t)=\{1-\exp(-t)\}/\{1-\exp(-10)\}$ and $F_2(t)=\{1-\exp (-t/2.8)\} /\{1-\exp(-10/2.8)\}$ for $0\leq t\leq10$. \item[\textit{Experiment} 2: $F_1(t)=0.8/[1+\exp\{-(t-80)/5\}]$ for $0\leq t\leq100$ and $F_1(t)=0.678+0.001t$ for $100\leq t\leq300$. $F_2(t)=0.2/[1+\exp\{ -(t-80)/5\}]$ for $0\leq t\leq100$ and $F_2(t)=-0.205+0.004t$ for $100\leq t\leq300$. Data is generated as specified, however, the estimation procedure focuses on estimates of $\bF(t)$ for $0\leq t\leq100$. \item[\textit{Experiment} 3:] $F_1(t)=\{1-\exp(-t/4)\}/\{1-\exp(-2.5)\}$ for $0\leq t\leq10$ and $F_2(t)=\{1-\exp(-t/2)\}/\{1-\exp(-2.5)\}$ for $0\leq t\leq5$. \end{longlist} The second experiment is designed to mimic the Parkinson's disease data in Section~\ref{sec:real_data}. In all experiments, we set the random mixture proportion ${\mathbf {q}}_i=(\lambda _i,1-\lambda_i)$ to be one of $m= 4$ vector values: $(1,0)^T$, $(0.6,0.4)^T$, $(0.2,0.8)^T$ and $(0.16,0.84)^T$. The four vector values had an equally likely chance of being selected. Our sample size was 500 and we generated a uniform censoring distribution to achieve 0\%, 20\% and 40\% censoring rates. The primary goal of the simulation studies is to compare the bias, efficiency and power of detecting distribution differences. Bias and efficiency were evaluated at different $t$ values. First, we evaluated the pointwise bias, $\wh\bF(t)-\bF_0(t)$, at different $t$ values, where $\bF_0(t)$ denotes the truth. Specifically, we ran 500 Monte Carlo simulations and evaluated the pointwise bias at $t=1.3$ in Experiment 1 (Table~\ref{table:simu_pointwise}), at $t=85$ in Experiment 2 (Table~\ref{table:simu_pointwise}), and at $t=2$ in Experiment 3 (supplementary material, Table~S.1). \begin{table}[t!] \tabcolsep=0pt \caption{Results for Experiment 1 at $t=1.3$ and Experiment 2 at $t=85$: Bias, empirical standard deviation (emp sd), average estimated standard deviation (est sd), and 95\% coverage (95\% cov) of estimators at different censoring rates. Results based on 500 simulations with sample size $n=500$} \label{table:simu_pointwise} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ld{2.4}ccccd{2.4}ccc@{}} \hline &\multicolumn{9}{c@{}}{\textbf{Experiment 1}}\\[-6pt] &\multicolumn{9}{c@{}}{\hrulefill}\\ &\multicolumn{4}{c}{$\bolds{F_1(t)= 0.7275}$}&&\multicolumn{4}{c@{}}{$\bolds{F_2(t)= 0.3822}$}\\[-6pt] &\multicolumn{4}{c}{\hrulefill}&&\multicolumn{4}{c@{}}{\hrulefill}\\ \textbf{Estimator}&\multicolumn{1}{c}{\textbf{bias}}&\textbf{emp sd}& \textbf{est sd}& \textbf{95\% cov}&& \multicolumn{1}{c}{\textbf{bias}}&\textbf{emp sd}&\textbf{est sd}& \multicolumn{1}{c@{}}{\textbf{95\% cov}}\\ \hline &\multicolumn{9}{c}{Censoring rate${} = {}$0\%}\\ EM-PAVA& 0.0002 & 0.0471 & 0.0440 & 0.9420&& -0.0015 & 0.0438 & 0.0419 & 0.9480\\ Oracle EFFAIPW& 0.0004& 0.0461 & 0.0440 & 0.9520&& -0.0014 & 0.0435& 0.0419 & 0.9480 \\ type~I NPMLE&-0.0159 & 0.1048& 0.0579& 0.9120&& -0.0029 & 0.0804 & 0.0627 & 0.9160\\ type~II NPMLE&-0.0674 & 0.0588 & 0.0329 & 0.5040&& 0.0824& 0.0473 & 0.0288 & 0.2980\\[3pt] &\multicolumn{9}{c}{Censoring rate${} = {}$20\%}\\ EM-PAVA& 0.0023 & 0.0491 & 0.0456 & 0.9360&&-0.0024 & 0.0445 & 0.0430 & 0.9520\\ Oracle EFFAIPW& 0.0019 & 0.0488 & 0.0454 & 0.9420&& 0.0011 & 0.0447& 0.0432 & 0.9440 \\ type~I NPMLE &-0.0089 & 0.0921 & 0.0588 & 0.9260&&-0.0041 & 0.0835& 0.0644 & 0.9180 \\ type~II NPMLE & -0.0846 & 0.0849 &0.0440 & 0.5720&& 0.0920 & 0.0720 & 0.0393 & 0.3900\\[3pt] &\multicolumn{9}{c}{Censoring rate${} = {}$40\%}\\ EM-PAVA&0.0022 & 0.0526 & 0.0486 & 0.9420&& -0.0025 & 0.0464 & 0.0456 & 0.9500\\ Oracle EFFAIPW& 0.0057 & 0.0562 & 0.0486 & 0.9220 &&-0.0017 & 0.0508 & 0.0460 & 0.9360 \\ type~I NPMLE &-0.0103 & 0.0981 & 0.0614 & 0.9160&& -0.0061 & 0.0868 & 0.0674 & 0.9120\\ type~II NPMLE &-0.0954 & 0.0952 & 0.0453 & 0.5580&&0.1008 & 0.0854 & 0.0395 & 0.3800\\[6pt] \end{tabular*} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ld{2.4}ccccd{2.4}ccc@{}} \hline &\multicolumn{9}{c@{}}{\textbf{Experiment 2}}\\[-6pt] &\multicolumn{9}{c@{}}{\hrulefill}\\ &\multicolumn{4}{c}{$\bolds{F_1(t)= 0.5848}$}&& \multicolumn{4}{c@{}}{$\bolds{F_2(t)=0.1462}$}\\[-6pt] &\multicolumn{4}{c}{\hrulefill}&&\multicolumn{4}{c@{}}{\hrulefill}\\ \textbf{Estimator}&\multicolumn{1}{c}{\textbf{bias}}&\textbf{emp sd}& \textbf{est sd}& \textbf{95\% cov}&& \multicolumn{1}{c}{\textbf{bias}}&\textbf{emp sd}&\textbf{est sd}& \multicolumn{1}{c@{}}{\textbf{95\% cov}}\\ \hline &\multicolumn{9}{c}{Censoring rate${} = {}$0\%}\\ EM-PAVA&-0.0009 & 0.0482& 0.0470 & 0.9540&&-0.0037& 0.0398 & 0.0357 & 0.9280\\ Oracle EFFAIPW& -0.0015 & 0.0480 & 0.0472 & 0.9600&& -0.0036 & 0.0403 & 0.0368 & 0.9480\\ type~I NPMLE &-0.0133 & 0.0890 & 0.0597 & 0.9500&& -0.0034 & 0.0659 & 0.0521& 0.8980\\ type~II NPMLE & -0.0872 & 0.0697 & 0.0349& 0.4520&&0.1035 & 0.0532 & 0.0248 & 0.0520\\[3pt] &\multicolumn{9}{c}{Censoring rate${} = {}$20\%}\\ EM-PAVA& 0.0002 & 0.0548 & 0.0493 & 0.9300&&-0.0013 & 0.0391& 0.0381& 0.9540\\ Oracle EFFAIPW&0.0006 & 0.0548 & 0.0498 & 0.9340&& -0.0015 & 0.0396 & 0.0389 & 0.9640 \\ type~I NPMLE &-0.0078 & 0.0908& 0.0623 & 0.9160&& -0.0030 & 0.0682 & 0.0544 & 0.8860\\ type~II NPMLE &-0.0959 & 0.0792& 0.0437& 0.4800&&0.1086& 0.0695 &0.0353& 0.1160\\[3pt] &\multicolumn{9}{c}{Censoring rate${} = {}$40\%}\\ EM-PAVA&-0.0016 & 0.0557 & 0.0525 & 0.9320&&-0.0002 & 0.0425 & 0.0401 & 0.9500\\ Oracle EFFAIPW& 0.0009 & 0.0578 & 0.0525 & 0.9380 && -0.0008& 0.0434 & 0.0410 & 0.9560 \\ type~I NPMLE &-0.0111 & 0.0977 & 0.0650 & 0.9100 &&-0.0043 & 0.0711 & 0.0560& 0.8760 \\ type~II NPMLE &-0.1048 & 0.0857 &0.0454 & 0.4740&& 0.1153 & 0.0846 & 0.0361 & 0.1380 \\ \hline \end{tabular*} \end{table} \begin{table}[t!] \tabcolsep=0pt \caption{Results for Experiments 1 and 2 across a range of time points: Integrated absolute bias, average pointwise variance, and average 95\% coverage probabilities of estimators at different censoring rates. Results based on 500 simulations with sample size $n=500$} \label{table:simu_full} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccccccc@{}} \hline &\multicolumn{8}{c@{}}{\textbf{Censoring rate}}\\[-6pt] &\multicolumn{8}{c@{}}{\hrulefill}\\ &\multicolumn{2}{c}{\textbf{0\%}}&&\multicolumn{2}{c}{\textbf{20\%}}&& \multicolumn {2}{c@{}}{\textbf{40\%}}\\[-6pt] &\multicolumn{2}{c}{\hrulefill}&&\multicolumn{2}{c}{\hrulefill}&& \multicolumn {2}{c@{}}{\hrulefill}\\ \textbf{Estimator}&$\bolds{F_1(t)}$ & $\bolds{F_2(t)}$ & & $\bolds{F_1(t)}$ & $\bolds{F_2(t)}$& &$\bolds{F_1(t)}$ & $\bolds{F_2(t)}$\\ \hline & \multicolumn{8}{c}{Experiment 1}\\ &\multicolumn{8}{c}{Integrated absolute bias$^*$}\\ EM-PAVA& 0.0085 & 0.0065&& 0.0190 & 0.0071&& 0.0327 & 0.0199\\ Oracle EFFAIPW & 0.0040 & 0.0055 && 0.0248 & 0.0232 && 0.0967 & 0.0689\\ type~I NPMLE & 0.1409 & 0.0407&& 0.2276 & 0.1063 && 0.4726 & 0.5084 \\ type~II NPMLE & 0.4290 & 0.2960&& 0.5656 & 0.3332 &&0.7127 & 0.3814 \\[3pt] &\multicolumn{8}{c}{Average pointwise variance$^*$}\\ EM-PAVA& 0.0009 & 0.0005&& 0.0012 & 0.0006&& 0.0015 & 0.0014 \\ Oracle EFFAIPW & 0.0009 & 0.0005 && 0.0011 & 0.0007 && 0.0016 & 0.0015\\ type~I NPMLE & 0.0010 & 0.0013&& 0.0013 & 0.0017&& 0.0022 & 0.0038\\ type~II NPMLE & 0.0006 & 0.0003 &&0.0013 & 0.0004&& 0.0024 & 0.0009\\[3pt] &\multicolumn{8}{c}{Average 95\% coverage probabilities$^{\dagger}$}\\ EM-PAVA& 0.9512 & 0.9551&&0.9530 & 0.9518 &&0.9513 & 0.9535\\ Oracle EFFAIPW & 0.9498 & 0.9557&& 0.9535 & 0.9514 && 0.9519 & 0.9445 \\ type~I NPMLE & 0.9471 & 0.9508&& 0.9378 & 0.9344 && 0.9130 & 0.8458\\ type~II NPMLE & 0.3756 & 0.5838 && 0.4234 & 0.5927 && 0.3890 & 0.6760\\[6pt] & \multicolumn{8}{c}{Experiment 2}\\ &\multicolumn{8}{c}{Integrated absolute bias$^{**}$}\\ EM-PAVA& 0.1372 & 0.0342&& 0.1140 & 0.0307&& 0.1049 & 0.0261 \\ Oracle EFFAIPW & 0.0966 & 0.0266&& 0.1282 & 0.0729&& 0.2704 & 0.1215\\ type~I NPMLE & 0.1097 & 0.0467&& 0.0770 & 0.0574 && 0.0791 & 0.0557\\ type~II NPMLE & 3.7021 & 2.4581 && 3.9157 & 2.4937 && 4.4027 & 2.5877 \\[3pt] &\multicolumn{8}{c}{Average pointwise variance$^{**}$ }\\ EM-PAVA& 0.0011 & 0.0003&& 0.0013 & 0.0003 && 0.0014 & 0.0003 \\ Oracle EFFAIPW & 0.0011 & 0.0003 && 0.0013 & 0.0003 && 0.0015 & 0.0003 \\ type~I NPMLE & 0.0013 & 0.0007&& 0.0016 & 0.0007&& 0.0017 & 0.0008\\ type~II NPMLE & 0.0006 & 0.0001 && 0.0006 & 0.0001&& 0.0007 & 0.0002 \\[3pt] &\multicolumn{8}{c}{Average 95\% coverage probabilities$^{\dagger \dagger}$}\\ EM-PAVA& 0.9564 & 0.9495 && 0.9538 & 0.9513&& 0.9552 & 0.9530 \\ Oracle EFFAIPW & 0.9547 & 0.9436&& 0.9518 & 0.9475 && 0.9507 & 0.9467 \\ type~I NPMLE & 0.9556 & 0.9479&& 0.9506 & 0.9492&& 0.9505 & 0.9481 \\ type~II NPMLE & 0.5738 & 0.4737&& 0.5781 & 0.4740&& 0.5504 & 0.4805\\ \hline \end{tabular*} \tabnotetext[]{}{$^*$Computed over $(0,10)$ for $F_1(t)$ and $F_2(t)$. $^{\dagger}$Computed over $(0,4)$ for $F_1(t)$ and over $(0,9)$ for $F_2(t)$. $^{**}$Computed over $(0,100)$ for $F_1(t)$ and $F_2(t)$. $^{\dagger\dagger}$Computed over $(48,100)$ for $F_1(t)$ and $F_2(t)$.} \end{table} Second, we evaluated the estimators over the entire range of $t$ values based on results from 500 Monte Carlo simulations; see Tables~\ref{table:simu_full} and S.2 (supplementary material). In this case, we evaluated the estimators based on the integrated absolute bias (IAB), average pointwise variance and average pointwise 95\% coverage probabilities. The integrated absolute bias (IAB) is $\int_0^\infty|\bar F_k(t)-F_{k0}(t)|\,dt$, $k=1,2$, where $\bar F_k(t)$ is the average estimate over the 500 data sets and $F_{k0}$ is the truth. In our simulation study, the integral in the IAB was computed using a Riemann sum evaluated at 50 evenly spaced time points across the entire range [i.e., over $(0,10)$ in Experiments 1 and 3, and over $(0,100)$ in Experiment 2]. The IAB for $F_2(t)$ in Experiment 3 was computed over $(0,5)$ because it is only defined on this interval. The average pointwise variance and average pointwise 95\% coverage probabilities were also computed over 50 time points evenly spaced across the entire range [i.e., over $(0,10)$ in Experiments 1 and 3, and over $(0,100)$ in Experiment 2]. Specifically, for each of the 50 time points, we computed the pointwise variance and pointwise 95\% coverage probabilities of the 500 data sets. Then, we reported the average of the 50 pointwise values. \begin{table} \tabcolsep=0pt \caption{Empirical rejection rates for Experiments 1 and 2. Test of $F_1(t)=F_2(t)$ over the entire time range was performed using a permutation test with 1000 permutations. Results based on 1000 simulations (for test under $H_0$) and 200 simulations (for test under $H_1$), with sample size $n=500$ and 40\% censoring (under $H_1$)} \label{table:power} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccccccccc@{}} \hline &\multicolumn{9}{c@{}}{\textbf{Nominal levels}}\\[-6pt] &\multicolumn{9}{c@{}}{\hrulefill}\\ &\multicolumn{4}{c}{\textbf{Under} $\bolds{H_0\dvtx F_1(t)=F_2(t)}$} & & \multicolumn{4}{c@{}}{\textbf{Under} $\bolds{H_1\dvtx F_1(t)\neq F_2(t)}$}\\[-6pt] &\multicolumn{4}{c}{\hrulefill} & & \multicolumn{4}{c@{}}{\hrulefill}\\ \textbf{Estimator}& \textbf{0.01} & \textbf{0.05}& \textbf{0.10}& \textbf{0.20} & & \textbf{0.01} & \textbf{0.05}& \textbf{0.10}& \multicolumn{1}{c@{}}{\textbf{0.20}}\\ \hline &\multicolumn{9}{c}{Experiment 1}\\ EM-PAVA & 0.0120 & 0.0560 & 0.0950 & 0.1920 && 0.9000 & 0.9800 & 0.9900 & 1.0000 \\ Oracle EFFAIPW & 0.0090 & 0.0500 & 0.0900 & 0.1820&& 0.6150 & 0.7950 & 0.8650 & 0.9350 \\ type~I NPMLE & 0.0130 & 0.0550 & 0.1020 & 0.1970 && 0.6200 & 0.7650 & 0.8450 & 0.9000 \\ type~II NPMLE & 0.0060 & 0.0490 & 0.1020 & 0.2020&& 0.4400 & 0.5150 & 0.5550 & 0.5900 \\[6pt] &\multicolumn{9}{c}{Experiment 2}\\ EM-PAVA & 0.0170 & 0.0551 & 0.1022 & 0.2094 && 0.9950 & 0.9950 & 0.9950 & 1.0000\\ Oracle EFFAIPW & 0.0140 & 0.0600 & 0.1100 & 0.2050 && 0.9950 & 0.9950 & 0.9950 & 1.0000\\ type~I NPMLE & 0.0080 & 0.0550 & 0.1120 & 0.2100 && 0.9200 & 0.9400 & 0.9500 & 0.9600 \\ type~II NPMLE & 0.0100 & 0.0550 & 0.1120 & 0.2150&& 0.7000 & 0.7300 & 0.7500 & 0.7700 \\ \hline \end{tabular*} \end{table} Third, we evaluated the type~I error rate and power in detecting differences between $F_1(t)$ and $F_2(t)$ over the entire range of $t$ values. We investigated the type~I error rate under $H_0\dvtx F_1(t)=F_2(t)$ based on 1000 simulations. In this case, we generated data so that $F_2(t)$ was set to the form of $F_1(t)$ in each experiment (see the description of Experiments 1, 2 and 3). Everything else was left unchanged. The type~I error rate was then computed using the permutation test in Section~\ref{sec:hypothesis_tests} using 1000 permutations. The power was computed based on 200 Monte Carlo simulations. That is, we tested for differences between $F_1(t)$ and $F_2(t)$ when $F_1(t), F_2(t)$ were evaluated at 50 time points evenly spaced across the entire range: over $(0,10)$ in Experiments 1 and 3, and over $(0,100)$ in Experiment 2. To compute the empirical power under $H_1\dvtx F_1(t)\neq F_2(t)$, we used the permutation test in Section~\ref{sec:hypothesis_tests} with 1000 permutations. Results are in Tables~\ref{table:power} and S.3 (supplementary material). \subsection{Simulation results} Among all four estimators considered, the type~I NPMLE has the largest estimation variability and the type~II has the largest estimation bias [see Tables~\ref{table:simu_full} and S.2 (supplementary material)]. In all experiments, as the censoring rate increases from 0\% to 40\%, the inefficiency for the type~I and the bias for the type~II worsens. These poor performances alter the 95\% coverage probabilities, especially for the type~II NPMLE which has coverage probabilities well under the nominal level (see Table~\ref{table:simu_full}). The inconsistency of the type~II NPMLE is most apparent in Experiments 1 and 2, where the estimated curve and 95\% confidence band completely miss the true underlying distributions; see Figures~\ref{fig:newcox40} and \ref{fig:cure40}. The type~II NPMLE is also not consistent in Experiment 3, but to a lesser extent; see Figure~S.1 (supplementary material). \begin{figure} \includegraphics{730f01.eps} \caption{Experiment 1. True cumulative distribution function and the mean of 500 simulations along with 95\% confidence band (dotted) for the four proposed estimators. Sample size is 500, censoring rate is 40\%.} \label{fig:newcox40} \end{figure} \begin{figure} \includegraphics{730f02.eps} \caption{Experiment 2. True cumulative distribution function and the mean of 500 simulations along with 95\% confidence band (dotted) for the four proposed estimators. Sample size is 500, censoring rate is 40\%.} \label{fig:cure40} \end{figure} In contrast, across all experiments and censoring rates, the EM-PAVA estimator performs satisfactorily throughout the entire range of $t$ [see Figures~\ref{fig:newcox40}, \ref{fig:cure40} and S.1 (supplementary material)]. The EM-PAVA estimator is as efficient as the Oracle EFFAIPW, but with much smaller bias, especially when censoring is present. The EM-PAVA also performs well in detecting small differences between $F_1(t)$ and $F_2(t)$. In Table~\ref{table:power}, the type~I error rates for all estimators adhere to their nominal levels. When $F_1(t)$ and $F_2(t)$ are largely different (i.e., Experiment 2), then both EM-PAVA and the Oracle EFFAIPW have similar power in detecting differences. However, when $F_1(t)$ and $F_2(t)$ are different but to a lesser degree (i.e., Experiment 1), then EM-PAVA has larger power in detecting the difference than all other estimators, including the Oracle EFFAIPW. The larger power of the EM-PAVA estimator is not too surprising considering that it estimates $\bF(t)$ across a range of time points, unlike the pointwise estimation of the Oracle EFFAIPW. A benefit of EM-PAVA over the Oracle EFFAIPW (and the two NPMLEs) is that EM-PAVA yields a genuine distribution function (i.e., the estimator is monotone, nonnegative and has values in the $[0,1]$ range). The curves shown in Figures~\ref{fig:newcox40}, \ref{fig:cure40} and S.1 (supplementary material) for Oracle EFFAIPW are the result of doing a post-estimation procedure to yield monotonicity. The ingenuity of the Oracle EFFAIPW estimator, however, is evident from its 95\% confidence band, which was constructed from the 2.5\% and 97.5\% pointwise quantiles of the 500 Monte Carlo data sets. Figure~S.1 (supplementary material) shows that the Oracle EFFAIPW estimator can have 95\% confidence bands outside of the $[0,1]$; for large $t$ in Figure~S.1, the upper confidence bound is larger than 1. In contrast, the EM-PAVA estimator is always guaranteed to be within $[0,1]$ and, thus, its 95\% confidence bands are always within this range. \section{Application to the CORE-PD study} \label{sec:real_data} \subsection{CORE-PD data and mixture proportions} We applied our estimator to the CORE-PD study introduced in Section~\ref{sec:intro-corepd}. Data from the CORE-PD study include information from first-degree relatives (i.e., parents, siblings and children) of PARK2 probands. The probands had age at onset (AAO) of Parkinson's disease (PD) less than or equal to 50 and did not carry mutations in other genes [i.e., neither LRRK2 mutations nor GBA mutations, \citet {Marderetal2010}]. The key interest is estimating the cumulative risk of PD-onset for the first-degree relatives belonging to different populations: \begin{longlist}[1.] \item[1.]\textit{PARK2 mutation carrier vs. noncarrier}: We compared the estimated cumulative risk in first-degree relatives expected to carrying one or more copies of a mutation in the PARK2 gene (carriers) to relatives expected to carry no mutation (noncarrier). \item[2.]\textit{PARK2 compound heterozygous (or homozygous) mutation carrier vs. heterozygous mutation carrier vs. noncarrier}: We considered first-degree relatives who have the compound heterozygous genotype (two or more different copies of the mutation) or homozygous genotype (two or more copies of the same mutation). We compared distribution of risk in this population to two different populations: (a) relatives who are expected to have the heterozygous genotype (mutation on a single allele), and (b) relatives who are expected to be noncarriers (no mutation). These comparisons will bring insight into whether heterozygous PARK2 mutations alone increase the risk of PD or if additional risk alleles play a role. \end{longlist} In the CORE-PD study, the ages at onset for the first-degree relatives are at least 90\% censored. Information discerning to which population a relative belongs is available through different mixture proportions. The mixture proportions are vectors $(p_i, 1-p_i)$, where $p_i$ is the probability of the $i$th first-degree relative carrying at least one copy of a mutation. This probability was computed based on the proband's genotype, a relative's relationship to a proband under the Mendelian transmission assumption. For example, a child of a heterozygous carrier proband has a probability of 0.5 to inherit the mutated allele, and thus a probability of 0.5 to be a carrier. A child of a homozygous carrier proband has a probability of 1 to be a carrier. More details are given in \citeauthor{Wangetal2007} (\citeyear{Wangetal2007,Wangetal2008}). Summary statistics for the populations and the mixture proportions are listed in Table~\ref{table:summary_data}. \begin{table} \tabcolsep=0pt \caption{Summary statistics for CORE-PD study. Total number of first-degree relatives ($n$), number of parents, siblings and children, and percentage of first-degree relatives who have the specified mixture proportion $(p, 1-p)$, where $p$ is the probability of a relative carrying at least one copy~of~mutation} \label{table:summary_data} \begin{tabular*}{\textwidth}{@{\extracolsep{4in minus 4in}}ld{3.0}d{2.0}d{3.0} d{3.0}d{3.1}d{2.1}d{1.1}@{}} \hline & & & & & \multicolumn{3}{c@{}}{\textbf{Mixture proportion (\%)}}\\[-6pt] & & & & & \multicolumn{3}{c@{}}{\hrulefill}\\ & \multicolumn{1}{c}{$\bolds{n}$} & \multicolumn{1}{c}{\textbf{Parents}} & \multicolumn{1}{c}{\textbf{Siblings}} & \multicolumn{1}{c}{\textbf{Children}} & \multicolumn{1}{c}{$\bolds{(1,0)}$} & \multicolumn{1}{c}{$\bolds{(0,1)}$} & \multicolumn{1}{c}{$\bolds{(0.5,0.5)}$}\\ \hline Carrier vs. noncarrier & 355 & 63 & 182 & 110 & 31.5 & 64.8 & 3.7\\ Compound heterozygous & 17 &1 & 15 & 1 & 100.0 & 0 & 0\\ \quad carrier or homozygous carrier$^*$ &\\ Heterozygous carrier & 338 & 62 & 167 & 109 & 28.1 & 68.1 & 3.8 \\ \quad vs. noncarrier&&&&&&&\\ \hline \end{tabular*} \tabnotetext[]{}{$^*$Genotype for subjects in this group are known.} \end{table} \subsection{Results} We estimated the cumulative risk based on the EM-PAVA estimator and compared its results with the type~I NPMLE. The Oracle EFFAIPW\vadjust{\goodbreak} estimator could not be used because the high censoring led to unstable estimation: the inverse weights in the estimator were close to zero. Estimates for the PARK2 compound heterozygous (or homozygous) mutation carriers were based on a Kaplan--Meier estimator because these subjects were observed to carry two or more mutations and there is no uncertainty about the relatives' genotype status (i.e., the data is not mixture data). We report the cumulative risk estimates along with 95\% confidence intervals based on 100 Bootstrap replicates. \begin{figure} \includegraphics{730f03.eps} \caption{CORE-PD study. Estimated cumulative distribution function for age-at-onset of Parkinson's disease for Parkin mutation carrier vs. noncarrier (top), and Parkin compound heterozygous or homozygous carrier vs. Parkin heterozygous carrier and noncarrier (bottom).} \label{fig:pd_carrier} \end{figure} Figure~\ref{fig:pd_carrier} (top right) shows that by age 50, PARK2 mutation carriers have a large increase in cumulative risk of PD onset compared to noncarriers. Based on EM-PAVA, the cumulative risk (see Table~\ref{table:real_pointestimates_carrier}) of PD-onset for PARK2 mutation carriers at age 50 is 17.1\% (95\% CI: 8.5\%, 25.6\%), whereas the cumulative risk for noncarriers at age 50 is 0.8\% (95\% CI: 0\%, 2.1\%). This difference between PARK2 mutation carriers and noncarriers at age 50 was formally tested using the permutation test in Section~\ref{sec:hypothesis_tests}. We found that carrying a PARK2 mutation significantly increases the cumulative risk by age 50 ($p$-value${}<0.001$, Table~\ref{table:pvalue}), suggesting that a mutation in the PARK2 gene substantially increases the chance of early onset PD. The difference is smaller yet still significant at age 70 ($p\mbox{-value }=0.04$, Table~\ref{table:pvalue}). Even across the age range $(20,70)$, the cumulative risk for PARK2 mutation carriers was significantly different than the cumulative risk for noncarriers ($p\mbox{-value }=0.01$0, see Table~\ref{table:pvalue}). These findings are consistent with other clinical and biological evidence that PARK2 mutations contribute to early-age onset of PD [\citet {Hedrichetal2004,Luckingetal2000}]. \begin{table} \tabcolsep=0pt \caption{Results for Parkin mutation carriers vs. noncarriers: Estimated cumulative distribution function and 95\% confidence intervals (in parentheses) based on type~I NPMLE and EM-PAVA} \label{table:real_pointestimates_carrier} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccccc@{}} \hline & \multicolumn{2}{c}{\textbf{Carrier}} & & \multicolumn{2}{c@{}}{\textbf{Noncarrier}} \\[-6pt] & \multicolumn{2}{c}{\hrulefill} & & \multicolumn{2}{c@{}}{\hrulefill} \\ \textbf{Age} & \textbf{type~I NPMLE} & \textbf{EM-PAVA} && \textbf{type~I NPMLE} & \textbf{EM-PAVA}\\ \hline 20 & 0.015 (0.000, 0.043) & 0.017 (0.000, 0.048) && $-0.011$ ($-0.009$, 0.000)\phantom{0.} & 0.000 (0.000, 0.000) \\ 25 & 0.023 (0.007, 0.061) & 0.026 (0.008, 0.068) && $-0.011$ ($-0.013$, $-0.001$) & 0.000 (0.000, 0.000) \\ 30 & 0.032 (0.008, 0.073) & 0.036 (0.009, 0.083) && $-0.011$ ($-0.016$, $-0.002$) & 0.000 (0.000, 0.000)\\ 35 & 0.061 (0.026, 0.116)& 0.068 (0.029, 0.134) && $-0.011$ ($-0.026$, $-0.007$) & 0.000 (0.000, 0.000) \\ 40 & 0.072 (0.030, 0.128) & 0.081 (0.034, 0.143) && $-0.011$ ($-0.030$, $-0.008$) & 0.000 (0.000, 0.000)\\ 45 & 0.121 (0.058, 0.198) & 0.137 (0.067, 0.217) && $-0.011$ ($-0.044$, $-0.015$) & 0.000 (0.000, 0.000)\\ 50 & 0.150 (0.074, 0.225) & 0.171 (0.085, 0.256) && $-0.011$ ($-0.053$, $-0.005$) & 0.008 (0.000, 0.021) \\ 55 & 0.166 (0.091, 0.263) & 0.190 (0.104, 0.299) && $-0.011$ ($-0.057$, $-0.008$) & 0.008 (0.000, 0.021) \\ 60 & 0.166 (0.086, 0.262) & 0.190 (0.105, 0.299) && $-0.011$ ($-0.053$, 0.016)\phantom{0.} & 0.023 (0.000, 0.053)\\ 65 & 0.321 (0.117, 0.505) & 0.266 (0.138, 0.400) && 0.117 ($-0.039$, 0.250) & 0.027 (0.000, 0.060) \\ 70 & 0.321 (0.109, 0.495) & 0.266 (0.148, 0.400) && 0.170 ($-0.005$, 0.323) & 0.094 (0.009, 0.193) \\ \hline \end{tabular*} \end{table} \begin{table} \caption{Results for Parkin compound heterozygous or homozygous carrier (Compound carrier), Parkin heterozygous carrier and noncarrier: Estimated cumulative distribution function and 95\% confidence intervals (in parentheses)}\label{table:real_pointestimates_splitcar} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccc@{}} \hline \textbf{Age} & \textbf{Kaplan--Meier}$\bolds{^*}$ & & \textbf{type~I NPMLE} & \textbf{EM-PAVA \\ \hline & {Compound carrier} && \multicolumn{2}{c}{Heterozygous carrier} \\ 20 & 0.118 (0.000, 0.258) && 0.000 (0.000, 0.000)\phantom{0.} & 0.000 (0.000, 0.000)\\ 25 & 0.118 (0.000, 0.258) && 0.009 (0.000, 0.027)\phantom{0.} & 0.010 (0.000, 0.030) \\ 30 & 0.186 (0.000, 0.355) && 0.009 (0.000, 0.027)\phantom{0.} & 0.010 (0.000, 0.030)\\ 35 & 0.389 (0.087, 0.591) && 0.009 (0.000, 0.027)\phantom{0.} & 0.010 (0.000, 0.030) \\ 40 & 0.389 (0.087, 0.591) && 0.023 (0.000, 0.049)\phantom{0.} & 0.026 (0.000, 0.056)\\ 45 & 0.644 (0.252, 0.830) && 0.037 (0.000, 0.089)\phantom{0.} & 0.041 (0.000, 0.100)\\ 50 & 0.822 (0.391, 0.948) && 0.037 ($-0.004$, 0.088) & 0.041 (0.000, 0.100)\\ 55 & 0.822 (0.391, 0.948) && 0.056 (0.000, 0.119)\phantom{0.} & 0.063 (0.000, 0.130) \\ 60 & 0.822 (0.391, 0.948) && 0.056 ($-0.001$, 0.116) & 0.064 (0.000, 0.131) \\ 65 & 0.911 (0.432, 0.986) && 0.177 (0.042, 0.304)\phantom{0.} & 0.100 (0.016, 0.206)\\ 70 & 0.911 (0.432, 0.986) && 0.177 (0.027, 0.288)\phantom{0.} & 0.100 (0.016, 0.206) \\[3pt] &&&\multicolumn{2}{c}{Noncarrier}\\ 20 &&& $-0.002$ (0.000, 0.000)\phantom{0.} & 0.000 (0.000, 0.000) \\ 25 &&& $-0.002$ ($-0.007$, 0.000) & 0.000 (0.000, 0.000) \\ 30 &&& $-0.002$ ($-0.007$, 0.000) & 0.000 (0.000, 0.000) \\ 35 &&& $-0.002$ ($-0.007$, 0.000) & 0.000 (0.000, 0.000) \\ 40 &&& $-0.002$ ($-0.014$, 0.000) & 0.000 (0.000, 0.000) \\ 45 &&& $-0.002$ ($-0.018$, 0.000) & 0.000 (0.000, 0.000) \\ 50 &&& $-0.002$ ($-0.015$, 0.014) & 0.008 (0.000, 0.022) \\ 55 &&& $-0.002$ ($-0.023$, 0.011) & 0.008 (0.000, 0.022) \\ 60 &&& \phantom{0.}0.009 ($-0.022$, 0.044) & 0.023 (0.000, 0.055) \\ 65 &&& \phantom{0.}0.142 ($-0.006$, 0.259) & 0.032 (0.000, 0.076) \\ 70 &&& 0.199 (0.009, 0.334) & 0.106 (0.015, 0.181) \\ \hline \end{tabular*} \tabnotetext[]{}{$^*$Genotype for subjects in this group are known. When there is no mixture, both methods reduce to Kaplan--Meier.}\vspace*{3pt} \end{table} To further distinguish the risk of PD among compound heterozygous or homozygous carriers (with at least two copies of mutations) from heterozygous carriers, we separately estimated the distribution functions in these two groups and compared them to the risk in the noncarrier group. The numerical results in Table~\ref{table:real_pointestimates_splitcar} and a plot of the cumulative risk in Figure~\ref{fig:pd_carrier} (bottom panel) indicate a highly elevated risk in compound heterozygous or homozygous carriers combined. In contrast, the risk for heterozygous carriers closely resembles the risk in noncarriers. This result that being a heterozygous carrier has an essentially similar risk to being a noncarrier was also observed in another study [\citet{Wangetal2008}]. Further investigation in a larger study is needed to examine whether risk differs in any subgroup. Using a permutation test, we also formally tested for differences between the distribution functions for each group. Results in Table~\ref{table:pvalue} show that there is a significant difference between compound heterozygous carriers and heterozygous carriers as well as a significant difference between compound heterozygous and the noncarriers over the age range $(20,70)$ and at particular ages 50 and 70. Furthermore, there is no significant difference between heterozygous carriers and noncarriers. These analyses suggest a recessive mode of inheritance for PARK2 gene mutations for early-onset PD. In comparison to the EM-PAVA, the type~I NPMLE had wide and nonmonotone confidence intervals, which altered the inference conclusions and is undesirable (see Table~\ref{table:pvalue}). Moreover, the type~I NPMLE provided a higher cumulative risk in noncarriers by age 70 (17\%), which appears to be higher than reported in other epidemiological studies [e.g., \citet{Wangetal2008}]. The poor performance of the type~I NPMLE can be due to instability and inefficiency of the type~I, especially at the right-tail area. In contrast, EM-PAVA always provided monotone distribution function estimates, as well as monotone and narrower confidence bands. The EM-PAVA also gave a lower cumulative risk in noncarriers by age 70 (9.4\%), which better reflects the population-based estimates. The increased risk in PARK2 carriers at earlier ages compared to population-based estimates can also suggest that there are other genetic and environmental causes of PD in early-onset cases that are different than late onset. \begin{table} \caption{$P$-values associated with testing $H_0\dvtx F_1(t)=F_2(t)$ at different $t$-values for CORE-PD study. $H_0$ was tested using the permutation test with 1000 permutations}\label{table:pvalue} \begin{tabular*}{\textwidth}{@{\extracolsep{4in minus 4in}}lcc@{}} \hline & \textbf{type~I NPMLE} & \multicolumn{1}{c@{}}{\textbf{EM-PAVA}}\\ \hline &\multicolumn{2}{c}{Carrier vs. noncarrier} \\ $t\in[20,70]$ &\phantom{$<$}0.013 & \phantom{$<$}0.010 \\ $t=50$ &$<$0.001 &$<$0.001 \\ $t=70$ &\phantom{$<$}0.073 & \phantom{.}0.04 \\[3pt] & \multicolumn{2}{c}{Het. carrier vs. noncarrier}\\ $t\in[20,70]$ &\phantom{$<$}0.790 & \phantom{$<$}0.594 \\ $t=50$ & \phantom{$<$}0.341 & \phantom{$<$}0.386 \\ $t=70$& \phantom{$<$}0.813 & \phantom{$<$}0.969 \\[3pt] &\multicolumn{2}{c}{Compound het./hom. carrier vs. het. carrier} \\ $t\in[20,70]$ & \phantom{$<$}0.013& \phantom{$<$}0.006 \\ $t=50$& $<$0.001& $<$0.001 \\ $t=70$ & \phantom{$<$}0.013& \phantom{$<$}0.017 \\[3pt] & \multicolumn{2}{c}{Compound het/hom. carrier vs. noncarrier}\\ $t\in[20,70]$& \phantom{$<$}0.011& \phantom{$<$}0.007\\ $t=50$& $<$0.001 & $<$0.001 \\ $t=70$ & \phantom{$<$}0.013& \phantom{$<$}0.017 \\ \hline \end{tabular*} \end{table} \section{Concluding remarks} \label{sec:conclusion} In this work we provide nonparametric estimation of age-specific cumulative risk for mutation carriers and noncarriers. This topic is an important issue in genetic counseling since clinicians and patients use risk estimates to guide their decisions on choices of preventive treatments and planning for the future. For example, individuals with a family history of Parkinson's disease generally stated that if they were found to be a carrier and in their mid-thirties, they would most likely elect to not have children [\citet{Leoetal2005}]. Or, in the instance they did choose to start a family, PARK2 mutation carriers were more inclined to undergo prenatal testing [\citet{Leoetal2005}]. It is well known that the NPMLE is the most robust and efficient method when there is no parametric assumption for the underlying distribution functions. Unfortunately, in the mixture model discussed in this paper, the NPMLE (type~II) fails to produce consistent estimates. On the other hand, the maximum binomial likelihood method studied in this paper provides an alternative consistent estimation method. Moreover, to implement this method, we have used the combination of an EM algorithm and PAVA, which leads to genuine distribution function estimates. For a nonmixture model, the proposed method coincides with the NPMLE. As a result, we expected the proposed method to have high efficiency, which was apparent through the various simulation studies. Even though we only considered two-component mixture models, in principle, the proposed method can be applied to more than two components mixture models without essential difficulty. In some applications, it may be desirable to consider parametric or semiparametric models (e.g., Cox proportional hazards model, proportional odds model) in a future work. However, diagnosing model misspecification has received little attention in the genetics literature. Our maximum binomial likelihood method can be used as a basis to construct numerical goodness-of-fit tests. In this case, we can test whether the distributions conform to a particular parametric or semiparametric model. That is, the interest is in testing $H_0\dvtx F_1(t)=F_1(t,\bbeta_1), F_2(t)=F_2(t,\bbeta_2)$ for some parametric models $F_1(t,\bbeta_1)$ and $F_2(t,\bbeta_2)$. To perform this test, we can use the Kolmogorov--Smirnov goodness of fit \[ \Delta=\sqrt{n}\max_{-\infty<t< \infty}\bigl\{\bigl|\wt F_1(t)-F_1(t, \wh \bbeta _1)\bigr|+\bigl|\wt F_2(t)-F_2(t,\wh \bbeta_2)\bigr|\bigr\}, \] where $\wh\bbeta_1,\wh\bbeta_2$ are the parametric maximum likelihood estimates of $\bbeta_1$ and $\bbeta_2$. Moreover, if one is interested in estimating other quantities of the underlying distribution functions, for example, the densities, one may use the kernel method to smooth the estimated distribution functions. In our analysis of CORE-PD data, probands were not included due to concerns of potential ascertainment bias that may be difficult to adjust [\citet{Begg2002}]. In studies where a clear ascertainment scheme is implemented, adjustment can be made based on a retrospective likelihood. Last, the computational procedure of the proposed estimator is simple and efficient. An R function implementing the proposed method is available from the authors. \begin{appendix}\label{app} \section*{Appendix: Sketch of technical arguments} \subsection{The type~I and type~II NPMLEs} \label{sec:npmle_solution} For the type~I NPMLE, let $s_{j}(x_i)={\mathbf{u}}_j^T\bd\bF (x_i)$ and $S_{j}(x_i)=1-{\mathbf{u}}_j^T\,\bF(x_i)$, $i=1,\ldots,n$, $j=1,\ldots,m$. The type~I NPMLE maximizes \[ \label{eq:target} \sum_{j=1}^m\sum _{i=1}^n\log \bigl\{s_j(x_i)^{\delta _i}S_j(x_i)^{1-\delta _i} \bigr\} I({\mathbf{q}}_i={\mathbf{u}}_j) \] with respect to $s_j(x_i)$'s and subject to $\sum_{i=1}^n s_j(x_i)I({\mathbf{q}}_i={\mathbf{u}}_j)\le1$, $s_j(x_i)\ge 0$ for $j=1,\dots,m$. Because this is equivalent to $m$ separate maximization problems, each concerning $s_j(\cdot)$ and $S_j(\cdot)$ only, the maximizers are the classical Kaplan--Meier estimators: \[ \wh S_j(t)=\prod_{x_i\le t,{\mathbf{q}}_i={\mathbf{u}}_j} \biggl\{1- \frac{\delta_i}{\sum_{{\mathbf{q}}_k={\mathbf {u}}_j}I(x_k\ge x_i)} \biggr\}, \] with $s_j(t)=S_j(t^-)-S_j(t)$ for all $t$. With $\wh\bS(t)=\{\wh S_1(t), \dots, \wh S_m(t)\}^T$ and $\bU=({\mathbf{u}}_1, \dots, {\mathbf{u}}_m)^T$, the type~I NPMLE is \[ \wt\bF_{\mathrm{type\ I}}(t) = \bigl(\bU^T\bU \bigr)^{-1} \bU^T\bigl\{\bone_m-\wh\bS(t)\bigr\}. \] Let the variance--covariance matrix of $\wh\bS(t)$ be $\bSigma$, which is a diagonal matrix because each of the $m$ components of $\wh\bS(t)$ is estimated using a distinct subset of the observations. Then, $\wt \bF_w(t)=(\bU^T\bSigma^{-1}\bU)^{-1}\bU^T\bSigma^{-1}\{\bone _m-\wh\bS (t)\}$ is a weighted version of the type~I NPMLE and is more efficient than the type~I NPMLE. The type~II NPMLE has no closed-form solution, and an EM algorithm is typically employed. Specifically, for $k=1,2$, we form at the $b$th step in the EM algorithm \[ c_{ik}^{(b)}=\delta_i\frac{ q_{ik}\,dF_k^{(b)}(x_i) }{\sum_{k=1}^2 q_{ik} \,dF_k^{(b)}(x_i)}+(1- \delta_i) \frac{q_{ik}\{1-F_k^{(b)}(x_i)\} }{\sum_{k=1}^2 q_{ik}\{1-F_k^{(b)}(x_i)\}}, \] and update the type~II NPMLE estimate as \begin{eqnarray*} 1-\check F_{{\mathrm{type\ II}},k}^{(b+1)}(t) &=&\prod _{x_i\le t,\delta_i=1} \biggl\{1-\frac{\sum_{j=1}^n I(x_j=x_i, \delta_j=1)c_{jk}^{(b)}} { \sum_{j=1}^n c_{jk}^{(b)}I(x_j\ge x_i) } \biggr\} \\ &=&\prod_{x_i\le t,\delta_i=1} \biggl\{1-\frac{c_{ik}^{(b)}} { \sum_{j=1}^n c_{jk}^{(b)}I(x_j\ge x_i) } \biggr \}. \end{eqnarray*} The procedure is iterated until convergence. \subsection{Consistency of imputed log-likelihood} \label{sec:consistency_imputed_loglikelihood} We first demonstrate consistency for the noncensored data case. When $\bF$ takes discrete finite many values, the result holds true trivially. If $\bF$ is a continuous distribution function, then for noncensored data, the binomial log-likelihood is \begin{eqnarray*} \ell&=&\sum_{j=1}^h\sum _{i=1}^n I(s_i\leq t_j) \log\bigl[\lambda_i F_1(t_j)+(1- \lambda_i)F_2(t_j)\bigr] \\ &&\quad\qquad{}+I(s_i>t_j)\log\bigl[\lambda_i \bar{F}_1(t_j) +(1-\lambda_i) \bar{F}_2(t_j)\bigr]. \end{eqnarray*} This can be written as \begin{eqnarray*} n^{-2}\ell&=&\int\int I(s\leq t)\log\bigl[\lambda F_1(t)+(1- \lambda )F_2(t)\bigr] \\ &&\qquad{}+I(s>t)\log\bigl[\lambda\bar{F}_1(t) +(1-\lambda) \bar{F}_2(t)\bigr]\,d\eta_n(s,\lambda)\,d\xi_n(t), \end{eqnarray*} where \[ \eta_n(s,\lambda)=n^{-1}\sum_{i=1}^n I(s_i\leq s, \lambda_i\leq \lambda ), \qquad \xi_h(t)=h^{-1}\sum_{i=1}^h I(t_i\leq t). \] By the Law of Large Numbers, it can be shown that \begin{eqnarray*} n^{-2}\ell& =& \int\bigl\{\lambda F_{10}(t)+(1- \lambda)F_{20}(t)\bigr\}\log\bigl\{\lambda F_1(t)+(1- \lambda)F_2(t)\bigr\}\,d\eta_0(\lambda)\,d \xi_0(t) \\ &&{}+ \bigl\{\lambda\bar{F}_{10}(t)+(1-\lambda)\bar{F}_{20}(t) \bigr\}\log\bigl\{\lambda \bar {F}_1(t)+(1-\lambda) \bar{F}_2(t)\bigr\}\,d\eta_0(\lambda)\,d\xi _0(t)\\ &=:&\Delta, \end{eqnarray*} where $\eta_0(\lambda)$ is the marginal distribution of $\lambda$ and \[ \xi_0(t)=\int\bigl\{\lambda F_{10}(t)+(1- \lambda)F_{20}(t)\bigr\}\,d\eta _0(\lambda). \] Here, the subscript $_0$ denotes the truth. By the Kullback--Leibler information inequality, the above limiting value achieves the maximum if and only if $F_1=F_{10}$ and $F_2=F_{20}$. Therefore, the maximum binomial likelihood estimation is consistent. For the censored data case, consistency also holds following a similar argument. The only difference in the log-likelihood\vadjust{\goodbreak} is that the indicator function $I(S_i\leq t_j)$ is replaced by $w_{ij}=E\{I(S_i\geq t_j)|S_i\geq x_j\}$. If $\hat {w}_i(t_j)$ is replaced by an initial consistency estimation, then the log-censored binomial likelihood will converge to~$\Delta$ again. \end{appendix} \section*{Acknowledgments} J. Qin and T.~P. Garcia contributed equally to this work. \begin{supplement}[id=suppA] \stitle{Additional simulation results} \slink[doi]{10.1214/14-AOAS730SUPP} \sdatatype{.pdf} \sfilename{aoas730\_supp.pdf} \sdescription{The supplementary material contains additional simulation results.} \end{supplement}
{'timestamp': '2014-08-01T02:09:50', 'yymm': '1407', 'arxiv_id': '1407.8412', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8412'}
arxiv
\section{Introduction} Genome-wide association studies (GWAS) are now at a crossroads. After the discovery of thousands of genes influencing hundreds of common traits \citep{Hindorff2009}, much of the low-hanging fruit has been plucked \citep{Ku2010,Visscher2012}. Because of the enormous sample sizes of current studies, new trait genes are still being uncovered. Unfortunately, most entail small effects. Is it possible that inheritance is predominantly polygenic, and a law of diminishing returns has set in? The push to exploit rare variants is one response to this dilemma. The previous generation of geneticists relied on linkage to map rare variants. Linkage mapping fell from grace because of its poor resolution. Reducing a genome search to a one or two megabase region leaves too large an expanse of DNA to sift. The real gold of linkage mapping may well be its legacy pedigrees \citep{Ott2011}. Pedigree data is particularly attractive in association studies because it permits control of population substructure and study of parent-of-origin effects. Related affecteds are also more likely to share the same disease predisposing gene than unrelated affecteds. Even in population-based association studies, taking into account estimated identity-by-descent (IBD) information is apt to reduce false positives and increases power. The recent availability of dense marker data from genotyping chips enables quick and accurate estimation of global and even local IBD \citep{Day-Williams2011}. \begin{table*}[t] \centering \begin{tabular}{lccc} \toprule & {\sc Mendel} & {\sc FaST-LMM} & {\sc GEMMA} \\ \midrule\midrule Multi-threaded operation & Yes & Yes & No \\ Can estimate kinships via SNPs & Yes & Yes & Yes \\ Imports \& exports kinship estimates & Yes & Yes & Yes \\ Allows retained co-variates & Yes & Yes & Yes \\ Allows linear constraints on co-variates & Yes & No & No \\ Can use either LRT or score test & Yes & No & Yes* \\ Allows multivariate analysis & Yes & No & Yes \\ Can perform multiple univariate analyses & Yes & No & No \\ Allows $> 2$ variance components & Yes & No & No \\ Analyzes X-linked loci & Yes & No & No \\ Automatic SNP filtering on MAF & Yes & No & Yes \\ Allows non-additive SNP models & Yes & No & No \\ Detects outlier pedigrees & Yes & No & No \\ Detects outlier individuals & Yes & No & No \\ Can simulate genotype/phenotype data & Yes & No & No \\ Reads in fractional genotype values & No & Yes & Yes \\ \bottomrule \\ \end{tabular} \caption{Comparison of features in {\sc Mendel}, {\sc FaST-LMM}, and {\sc GEMMA}\ for GWAS of QTLs. *{\sc GEMMA}\ can use the likelihood ratio, score, or Wald test.} \label{table:software-comparison} \vspace{-0.25in} \end{table*} Geneticists turned to random sample and case-control data because of the relative ease of collecting population data and the computational challenges posed by pedigrees. The tide of computational complexity is now beginning to turn. To handle pedigree data in association testing, statistical geneticists have proposed semiparametric methods such as the generalized linear mixed model (GLMM) \citep{Amin07,Aulchenko07} and generalized estimating equations (GEE) \citep{ChenYang09GWAF,ChenLiuWei11GWAFComparison}. Although such methods work for both quantitative and binary traits, they are compromised by current restrictions that reduce power. The GEE approach requires input of a working correlation structure for each pedigree. The kinship coefficient matrix is a natural candidate. However, current implementations require the same working correlation matrix across all clusters, which implicitly requires all pedigrees to have the same structure \citep{ChenLiuWei11GWAFComparison}. This is a dubious and restrictive assumption. In the limited context of case-control studies, recent methods such as $M_{QLS}$ \citep{MQLS2007}, {\sc roadtrips} \citep{Thornton10Roadtrips}, and {\sc FPCA} \citep{ZhuXiong2012} correct for pedigree and ethnically induced correlations by exploiting dense marker data. Other authors attack the same issues more broadly from the GLMM perspective \citep{EMMAX2010,TASSEL2010,FaST2011}. \citet{MTMM2012} generalizes GLMM to multivariate traits. Models based on the transmission-disequilibrium test (TDT) \citep{SpielmanEwens98TDT} and its generalization, the family-based association test (FBAT) \citep{LairdHorvathXu2000FBAT,LangeLaird02FBAT,PBAT2005,PBAT2009-Stats,PBAT2009-PLoS}, are promising but ignore covariates and polygenic background. See \citet{VanSteen2011} for a recent overview of FBAT methods for GWAS. We treat all of these extensions in a unified framework consistent with exceptionally fast computing. The present paper re-examines the computational bottlenecks encountered in association mapping with pedigree data. It turns out that the previous objections to pedigree GWAS can be overcome. Kinship coefficients can be based on explicitly provided pedigree structure or estimated from dense markers when genealogies are missing or dubious. Frequentist hypothesis testing usually operates by comparing maximum likelihoods under the null and alternative hypotheses. Maximization of the alternative likelihood must be conducted for each and every marker. Score tests constitute a more efficient strategy than likelihood ratio tests. This is the point of departure taken by \citet{Chen2007}, but they use approximations that we avoid. The {\sc glogs} program \citep{GLOGS2012} makes similar approximations in the case-control setting. Here we consider arbitrary pedigrees and multivariate quantitative traits. Score tests require no additional iteration under the alternative model. All that is needed is evaluation of a quadratic form combining the score vector and the expected information matrix at the maximum likelihood estimates under the null model. Although it takes work to assemble these quantities, a careful analysis of the algorithm shows that fast testing is perfectly feasible. In our implementation of score testing, the few SNPs with the most significant score-test p-values are automatically re-analyzed by the slightly more powerful, but much slower, likelihood ratio test (LRT). Our fixed effects (mean component) model assumes Gaussian variation of the trait; the two alleles of a SNP shift trait means. There is no confounding of association and linkage. This framework carries with it several advantages. First, it applies to random sample data, pedigree data, or a mix of both. Second, it enables covariate adjustment, including correction for population stratification. Third, it accommodates additive, dominant, and recessive SNP models. Fourth, it also accommodates both univariate and multivariate traits. And fifth, as just mentioned, it fosters both likelihood ratio tests and score tests. The mean component model is now implemented in our software package {\sc Mendel}\ for easy use by the genetics community. In addition, {\sc Mendel}\ provides a complete suite of tools for pedigree analysis, including GWAS data preparation and manipulation, pedigree genotype simulation (gene dropping), trait simulation, genotype imputation, local and global kinship coefficient estimation, and pedigree-based GWAS (ped-GWAS) \citep{Lange2005Association,Lange2013Mendel}. The competing software packages {\sc EMMAX} \citep{Kang2008}, {\sc MMM} \citep{PirinenDonnellySpencer2013MMM}, {\sc FaST-LMM}\ \citep{FaST2011,FaST2012}, and {\sc GEMMA}\ \citep{ZhouStephens12GEMMA,ZhouStephens14GEMMA} already implement variance component models for quantitative trait locus (QTL) analysis. Exhaustive comparison of {\sc Mendel}\ to each of these programs is beyond the scope of the current paper. We limit our comparisons of {\sc Mendel}\ to the state-of-art packages {\sc FaST-LMM}\ and {\sc GEMMA}, arguably the fastest and most sophisticated of the competition. Table~\ref{table:software-comparison} summarizes some of the qualitative features of these packages. Our numerical examples also demonstrate an order of magnitude advantage in speed of {\sc Mendel}\ over {\sc FaST-LMM}\ and {\sc GEMMA}. This advantage stems from our careful formulation of the score test and our exploitation of the multicore processors resident in almost all personal computers and computational clusters. \section{Methods} \subsection{QTL Association Mapping with Pedigrees} QTL association mapping typically invokes the multivariate Gaussian distribution to model the trait values $\boldsymbol{y}=(y_{i})$ over a pedigree. The observed trait value $y_i$ of person $i$ can be either univariate or multivariate. For simplicity we first assume $y_i$ is univariate and later indicate the necessary changes for multivariate $y_i$. The standard model \citep{Lange02GeneticsBook} collects the corresponding trait means into a vector $\boldsymbol{\nu}$ and the corresponding covariances into a matrix $\boldsymbol{\Omega}$ and represents the loglikelihood of a pedigree as \begin{eqnarray} L & = & -\frac{1}{2} \ln \det \boldsymbol{\Omega} -\frac{1}{2} (\boldsymbol{y}-\boldsymbol{\nu})^t \boldsymbol{\Omega}^{-1}(\boldsymbol{y}-\boldsymbol{\nu}), \label{eqn:normal_loglikelihood} \end{eqnarray} where $\det$ denotes the determinant function and the covariance matrix is typically parametrized as \begin{eqnarray} \boldsymbol{\Omega} & = & 2 \sigma_a^2 \boldsymbol{\Phi} + \sigma_d^2 \boldsymbol{\Delta}_7 + \sigma_h^2 \boldsymbol{H} + \sigma_e^2 \boldsymbol{I}. \label{variance_decomposition} \end{eqnarray} Here the variance component $\boldsymbol{\Phi}$ is the global kinship coefficient matrix capturing additive polygenic effects, and $\boldsymbol{\Delta}_7$ is a condensed identity coefficient matrix capturing dominance genetic effects. When pedigree structure is explicitly given, these genetic identity coefficients are easily calculated \citep{Lange02GeneticsBook}. With unknown or dubious genealogies, the global kinship coefficient can be accurately estimated from dense markers \citep{Day-Williams2011}. The household effect matrix $\boldsymbol{H}$ has entries $h_{ij}=1$ if individuals $i$ and $j$ belong to the same household and 0 otherwise. Individual environmental contributions and trait measurement errors are incorporated via the identity matrix $\boldsymbol{I}$. {\sc Mendel}'s implementation of this model can include both the two standard variance classes, additive and environmental, as well as the two extra variances classes, dominance and household. Inclusion of additional variance classes has no significant effect on {\sc Mendel}'s speed of computation. \begin{table}[t] \centering \begin{tabular}{c||ccc} \toprule {\bf Genotype} & {\bf Additive} & {\bf Dominant} & {\bf Recessive} \\ \midrule\midrule \verb|1/1| & --1 & --1 & --1 \\ \verb|1/2| & 0 & --1 & +1 \\ \verb|2/2| & +1 & +1 & +1 \\ \bottomrule \end{tabular} \vspace{0.05in} \caption{Genotype encodings for the major gene models. The additive model is the default choice. In the genotype column, ``1'' and ``2'' represent the first and second alleles for each SNP. An effect size estimate reflects the change in trait values due to each positive unit change in the encodings. For example, the default additive model estimates the mean trait difference in moving from a 1/2 genotype to a 2/2 genotype.} \label{table:genotype-code} \end{table} In general, a mixed model for QTL association mapping captures polygenic and other random effects through $\boldsymbol{\Omega}$ and captures QTL fixed effects through $\boldsymbol{\nu}$. Let $\boldsymbol{\beta}$ denote the full vector of regression coefficients parameterizing $\boldsymbol{\nu}$. In a linear model one postulates that $\boldsymbol{\nu} = \boldsymbol{A} \boldsymbol{\beta}$ for some predictor matrix $\boldsymbol{A}$ incorporating relevant covariates such as age, gender, and diet. In testing association against a given SNP, $\boldsymbol{A}$ is augmented by an extra column whose entries encode genotypes according to one of the models (additive, dominant, and recessive) shown in see Table~\ref{table:genotype-code}. To accommodate imprecise imputation in an additive model, these encodings can be made fractional. The corresponding component of $\boldsymbol{\beta}$, $\beta_\text{SNP}$, is the SNP effect size. In likelihood ratio association testing one contrasts the null hypothesis $\beta_\text{SNP} = 0$ with the alternative hypothesis $\beta_\text{SNP} \ne 0$. In testing a univariate trait, the likelihood ratio statistic asymptotically follows a $\chi_1^2$ distribution. In testing a multivariate trait with $T>1$ components, each row of $\boldsymbol{A}$ must be replicated $T$ times. The likelihood ratio statistic then asymptotically follows a $\chi_T^2$ distribution. To implement likelihood ratio testing, iterative maximum likelihood estimation must be undertaken for each and every SNP under the alternative hypothesis. This unfortunate requirement is the major stumbling block retarding pedigree analysis. Score tests serve as convenient substitutes for likelihood ratio tests. The current paper describes how to implement ultra-fast score tests for screening SNPs. Only SNPs with the most significant score test p-values are further subjected to the more accurate likelihood ratio test. An advantage of the likelihood ratio method is that it estimates effect sizes. In contrast, the score test only requires parameter estimates under the null hypothesis and involves no iteration beyond fitting the null model. The score vector is the gradient $\nabla L(\boldsymbol{\theta})$ of the loglikelihood $L(\boldsymbol{\theta})$, where the full parameter vector $\boldsymbol{\theta}$ includes variance components such as the additive genetic variance in addition to the regression coefficient vector $\boldsymbol{\beta}$. The transpose $dL(\boldsymbol{\theta})$ of the score is a row vector called the first differential of $L(\boldsymbol{\theta})$. The expected information $J(\boldsymbol{\theta})$ is the covariance matrix of the score vector. It is well known that the expected value of the observed information matrix (negative second differential) $-d^2 L(\boldsymbol{\theta})$ coincides with $J(\boldsymbol{\theta})$ \citep{Rao2009}. The score statistic \begin{eqnarray*} S(\boldsymbol{\theta}) & = & dL(\boldsymbol{\theta}) J(\boldsymbol{\theta})^{-1} \nabla L(\boldsymbol{\theta}) \;\;\, \approx \;\;\, dL(\boldsymbol{\theta}) [-d^2L(\boldsymbol{\theta})]^{-1} \nabla L(\boldsymbol{\theta}) \end{eqnarray*} is evaluated at the maximum likelihood estimates under the null hypothesis with the parameter $\beta_\text{SNP}$ of the alternative hypothesis set to 0. \subsection{Fast Score Test for Individual SNPs} Under the multivariate model, the expected information matrix $J(\boldsymbol{\theta})$ for a single pedigree can be written in the block diagonal form \begin{eqnarray} J(\boldsymbol{\theta}) & = & \begin{pmatrix} \mathop{\rm E\,\!}\nolimits[- d_{\boldsymbol{\beta}}^2 L(\boldsymbol{\theta})] & 0 \cr 0 & \mathop{\rm E\,\!}\nolimits[ - d_{\boldsymbol{\sigma}}^2 L(\boldsymbol{\theta})] \end{pmatrix}, \label{eqn:expected-information} \end{eqnarray} where $\boldsymbol{\sigma}$ denotes the vector of variance parameters \citep{Lange02GeneticsBook}. For independent pedigrees, the loglikelihoods (\ref{eqn:normal_loglikelihood}) and corresponding score vectors and expected information matrices add. Hence, the block diagonal form of $J(\boldsymbol{\theta})$ is preserved. Because the inverse of a block diagonal matrix is block diagonal, the score statistic splits into a piece contributed by the variance components plus a piece contributed by the mean components. The maximum likelihood estimate $\hat{\boldsymbol{\theta}}=(\hat{\boldsymbol{\beta}},\hat{\boldsymbol{\sigma}})$ under the null model is a stationary point of the loglikelihood. Thus, the variance components segment $\nabla_{\boldsymbol{\sigma}} L (\hat{\boldsymbol{\theta}})$ of the score vector vanishes. We therefore focus on the mean components segment of the score vector. If the pedigrees are labeled $1,\ldots,n$, then the pertinent quantities for implementing the score test are \begin{eqnarray*} \sum_{i=1}^n \nabla_{\boldsymbol{\beta}} L_i (\boldsymbol{\theta}) & = & \sum_{i=1}^n \boldsymbol{A}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{r}_i \\ \sum_{i=1}^n \mathop{\rm E\,\!}\nolimits[- d_{\boldsymbol{\beta}}^2 L_i(\boldsymbol{\theta})] & = & \sum_{i=1}^n \boldsymbol{A}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{A}_i , \end{eqnarray*} where $\boldsymbol{r}_i = \boldsymbol{y}_i - \boldsymbol{A}_i \hat{\boldsymbol{\beta}}$ is the residual for pedigree $i$ and the covariance matrix $\boldsymbol{\Omega}_i$ for pedigree $i$ is determined by equation (\ref{variance_decomposition}). See Chapter 8 of \citet{Lange02GeneticsBook} for a detailed derivation of the score and expected information. Since the score statistic is calculated from estimated parameters under the null model, residuals do not change when we expand the null model to the alternative model keeping $\beta_\text{SNP}=0$. Calculation of the maximum likelihood estimate $\hat{\boldsymbol{\theta}}$ under the null is accomplished by a quasi-Newton algorithm whose initial step reduces to Fisher scoring \citep{Lange1976,Lange02GeneticsBook}. For pedigree $i$ under the alternative hypothesis, the design matrix $\boldsymbol{A}_i$ can be written as $( \boldsymbol{a}_i,\boldsymbol{N}_i)$, where $\boldsymbol{N}_i$ is the design matrix under the null hypothesis and $\boldsymbol{a}_i$ conveys the genotypes at the current SNP. In testing a univariate trait, the entries of $\boldsymbol{a}_i$ are taken from Table~\ref{table:genotype-code}. If allele counts are imputed under the additive model, then the entries of $\boldsymbol{a}_i$ may be fractional numbers drawn from the interval $[-1,1]$. In testing a multivariate trait with $T>1$ components, each row of $\boldsymbol{A}_i =(\boldsymbol{a}_i,\boldsymbol{N}_i)$ must be replicated $T$ times. The only exceptions to this rule occur for people missing some but not all component traits; otherwise, the covariance matrix $\boldsymbol{\Omega}_i$ for pedigree $i$ decomposes into a sum of Kronecker products \citep{Lange02GeneticsBook}. Regardless of whether the trait is univariate or multivariate, one must compute the quantities \begin{eqnarray*} \sum_{i=1}^n \nabla_{\boldsymbol{\beta}} L_i (\boldsymbol{\theta}) & = & \begin{pmatrix} \sum_{i=1}^n \boldsymbol{a}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{r}_i \\ \sum_{i=1}^n \boldsymbol{N}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{r}_i \end{pmatrix} \\ \sum_{i=1}^n \mathop{\rm E\,\!}\nolimits[- d_{\boldsymbol{\beta}}^2 L_i(\boldsymbol{\theta})] & = & \begin{pmatrix} \sum_{i=1}^n \boldsymbol{a}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{a}_i & \sum_{i=1}^n \boldsymbol{a}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{N}_i\\ \sum_{i=1}^n \boldsymbol{N}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{a}_i & \sum_{i=1}^n \boldsymbol{N}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{N}_i \end{pmatrix}. \end{eqnarray*} At the maximum likelihood estimates under the null model, the partial score vector $\sum_{i=1}^n \boldsymbol{N}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{r}_i$ vanishes. Hence, the score statistic for testing a SNP can be expressed as \begin{eqnarray*} S & \!\!\! = \!\!\! & \boldsymbol{R}^t \left[ \boldsymbol{Q} - \boldsymbol{W}^t \left( \sum_{i=1}^n \boldsymbol{N}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{N}_i \right)^{-1} \boldsymbol{W} \right]^{-1} \boldsymbol{R}, \end{eqnarray*} where \begin{eqnarray*} \boldsymbol{Q} & = & \sum_{i=1}^n \boldsymbol{a}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{a}_i, \quad \boldsymbol{R} \;\; = \;\; \sum_{i=1}^n \boldsymbol{a}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{r}_i, \\ \quad \boldsymbol{W} & = & \sum_{i=1}^n \boldsymbol{N}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{a}_i. \end{eqnarray*} In the score statistic $S$, the covariance matrices $\boldsymbol{\Omega}_i^{-1}$ and residual vectors $\boldsymbol{r}_i$ are evaluated at the maximum likelihood estimates under the null model. Large sample theory says that $S$ asymptotically follows a $\chi_T^2$ distribution. These formulas suggest that we precompute and store the quantities $ \boldsymbol{\Omega}_i^{-1}$, $\boldsymbol{\Omega}_i^{-1}\boldsymbol{N}_i$, and $\boldsymbol{\Omega}_i^{-1}\boldsymbol{r}_i$ for each pedigree $i$ and the overall sum $\sum_{i=1}^n \boldsymbol{N}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{N}_i$ at the maximum likelihood estimates under the null hypothesis. From these parts, the basic elements of the score statistic can be quickly assembled. The most onerous quantity that must be computed on the fly as each new SNP is encountered is $\sum_{i=1}^n \boldsymbol{a}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{a}_i $. If there are $p_i$ people in pedigree $i$, then computation of the quadratic form $\boldsymbol{a}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{a}_i $ requires $O(p_i^2)$ arithmetic operations. This looks worse than it is in practice since the entries of $\boldsymbol{a}_i$ are integers (--1, 0, and 1) in the absence of fractional imputation. This simplification allows one to avoid a fair amount of arithmetic. Assembling the remaining parts of the score statistic requires $O(p_i)$ arithmetic operations. Individuals missing univariate trait values are omitted from analysis. Individuals missing some but not all components of a multivariate trait are retained in analysis. The proper adjustments for missing data are made automatically in the score statistic because sections of Gaussian random vectors are Gaussian. SNPs with minor allele counts below a user-designated threshold are also omitted from analysis. Note that if the minor allele count across a study is 0, then the given SNP is mono-allelic and worthless in association testing. {\sc Mendel}'s default threshold of 3 is motivated by the rule of thumb in contingency table testing that all cells have an expected count of at least 3. For a multivariate trait, a SNP may fall below the threshold for some component traits but not for others. This situation can occur when each trait displays a different pattern of missing data across individuals. {\sc Mendel}\ retains such anomalous SNPs only for those component traits with a sufficient number of minor alleles. Again, proper adjustments are made automatically within the score test statistic to account for partial data. {\sc Mendel}'s analysis yields a score test p-value for each SNP. For the user-designated most significant SNPs, {\sc Mendel}'s subsequent likelihood ratio test outputs an estimated SNP effect size, a standard error of that estimate, and the fraction of the total variance explained by that SNP. For a multivariate trait, {\sc Mendel}\ outputs a SNP effect size and associated standard error for each component trait. In the initial analysis under the null model with no SNPs, {\sc Mendel}\ provides estimates with standard errors of all mean and variance components included in the model. Finally, an estimate of heritability with standard error is also provided. The extension of the score test to the multivariate $t$-distribution is straightforward \citep{Lange89Robust}. Suppose $\eta$ equals the degrees of freedom of the $t$-distribution and $m_i$ equals the number of observed person-trait combinations for pedigree $i$. The sections of the score and expected information pertinent to the mean components for the pedigree reduce to \begin{eqnarray*} \nabla_{\boldsymbol{\beta}} L_i (\boldsymbol{\theta}) & = & \frac{\eta+m_i}{\eta+s_i} \boldsymbol{A}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{r}_i \\ \mathop{\rm E\,\!}\nolimits[- d_{\boldsymbol{\beta}}^2 L_i(\boldsymbol{\theta})] & = & \frac{\eta+m_i}{\eta+m_i+2} \boldsymbol{A}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{A}_i , \end{eqnarray*} where $r_i$ is the residual and $s_i = \boldsymbol{r}_i^t \boldsymbol{\Omega}_i^{-1} \boldsymbol{r}_i$ is the associated Mahalanobis distance. A sensible choice for $\eta$ is its estimate under the null model. \subsection{Kinship Estimation From SNPs} {\sc Mendel}\ can either calculate the global kinship coefficient matrix $\boldsymbol{\Phi}$ from the provided pedigree structures or estimate it from dense genotypes. In global kinship estimation {\sc Mendel}'s default uses an evenly spaced 20\% of the available SNPs, and only compares pairs of individuals within defined pedigrees. Hence, $\boldsymbol{\Phi}$ is block diagonal. Users can trivially elect to exploit a larger fraction of the available SNPs or estimate kinship for {\em all} pairs of individuals. Given $S$ selected SNPs, {\sc Mendel}\ estimates the global kinship coefficient of individuals $i$ and $j$ based on either the genetic relation matrix (GRM) method \begin{eqnarray*} \hat \Phi_{ij} & = & \frac{1}{2S} \sum_{k=1}^S \frac{(x_{ik} - 2p_k)(x_{jk} - 2p_k)}{2p_k(1-p_k)} \end{eqnarray*} or the method of moments (MoM) \citep{Day-Williams2011,Lange14NextGenStatGene} \begin{eqnarray*} \hat \Phi_{ij} & = & \frac{e_{ij} - \sum_{k=1}^S \left[p_k^2 + (1-p_k)^2 \right]}{S - \sum_{k=1}^S\left[p_k^2 + (1-p_k)^2\right]}, \end{eqnarray*} where $p_k$ is the minor allele frequency at SNP $k$, $x_{ik}$ is the number of minor alleles in $i$'s genotype at SNP $k$, and \begin{eqnarray*} e_{ij} & = & \frac{1}{4} \sum_{k=1}^S \left[ x_{ik}x_{jk} + (2-x_{ik})(2-x_{jk}) \right] \end{eqnarray*} is the observed fraction of alleles identical by state (IBS) between $i$ and $j$. The GRM method is {\sc Mendel}'s default. In general, one can think of the GRM method centering and scaling each genotype, while the MoM method uses the raw genotypes and then centers and scales the final result. \subsection{Other Utilities for Handling Pedigree Data} To encourage thorough testing of new statistical methods, such as the current Ped-GWAS score test, we have implemented both genotype and trait simulation in our genetic analysis program {\sc Mendel}\ \citep{Lange2013Mendel}. {\sc Mendel}\ does genotype simulation (gene dropping) subject to prescribed allele frequencies, a given genetic map, and Hardy-Weinberg and linkage equilibrium. If one fixes founder haplotypes and simulates conditional on these, then the unrealistic assumption of linkage equilibrium can be relaxed. Missing data patterns are respected or imposed by the user. It is also possible to set the rate for randomly deleting data and to simulate genotypes for people of mixed ethnicity by defining different ancestral populations, each with its own allele frequencies. If this feature is invoked, then each pedigree founder should be assigned to a population. Trait simulation can be layered on top of genotype simulation. {\sc Mendel}\ simulates either univariate traits determined by generalized linear models or multivariate Gaussian traits determined by variance component models. The biggest limitations are the restriction to a single major locus and the generalized linear model assumption that trait correlations are driven solely by this locus. Variance component models enable inclusion of environmental effects and more complicated correlations among relatives. In the variance component setting, univariate as well as multivariate Gaussian traits can be simulated. Most variance component models are built on Gaussian distributions, but {\sc Mendel}\ allows one to replace these by multivariate $t$-distributions. Thus, users can investigate robust statistics less prone to distortion by outliers. More theoretical and implementation details appear in the {\sc Mendel}\ documentation \citep{Lange2013Mendel}. \section{Results} \subsection{The San Antonio Family Heart Study} We analyzed a real data set collected by the San Antonio Family Heart Study (SAFHS) \citep{SAFHS1996}. The data consist of 3637 individuals in 211 Mexican American families. High-density lipoprotein (HDL) levels were measured at up to three time points for each of the 1429 phenotyped individuals. These traits are denoted HDL$_1$, HDL$_2$, and HDL$_3$, measured at corresponding ages AGE$_1$, AGE$_2$, and AGE$_3$. Some of the phenotyped individuals have HDL measurements at only one or two of the time points. Of the 1429 phenotyped individuals, 1413 were genotyped at 944,427 genome-wide SNPs. The genotyping success rate exceeded 98\% in 1388 of these individuals over 124 pedigrees. The largest family contains 247 individuals; five others also contain more than 90 individuals. The smallest pedigree was a singleton. Genotyping success rates were above 98\% for 935,392 SNPs. \subsection{Comparison with {\sc FaST-LMM}\ and {\sc GEMMA}} \begin{table*}[t] \vspace{-0.10in} \centering \begin{tabular}{l||lrrlrrrr} \toprule Trait & SNP & Chr. & Base Pair & MAF & $-\log_{10}(\text{p-val})$ & $-\log_{10}(\text{p-val})$ & $-\log_{10}(\text{p-val})$ & $-\log_{10}(\text{p-val})$ \\ & & & Position & & {\sc Mendel}\ default & {\sc Mendel}\ all-pairs & {\sc FaST-LMM} & {\sc GEMMA} \\ \midrule\midrule & rs7303112 & 12 & 97,596,023 & 0.00455 & 10.21 & 10.71 & 7.63 & 7.24 \\ HDL$_1$ & rs8040647 & 15 & 32,304,988 & 0.00147* & 7.44 & 7.56 & 7.35 & 7.45 \\ & rs9972594 & 15 & 32,421,102 & 0.00147* & 7.44 & 7.56 & 7.37 & 7.46 \\ & rs7167103 & 15 & 32,830,477 & 0.00147* & 7.44 & 7.56 & 7.35 & 7.44 \\ \midrule HDL$_2$ & rs7100957 & 10 & 28,207,332 & 0.00183* & 8.84 & 8.95 & 8.88 & 8.82 \\ \midrule HDL$_3$ & rs17060933 & 8 & 22,510,029 & 0.00382 & 8.23 & 8.28 & 8.61 & 8.59 \\ \midrule & rs7303112 & 12 & 97,596,023 & 0.00644 & 9.89 & 9.94 & & \\ HDL$_\text{Joint}$ & rs16925210 & 10 & 25,308,103 & 0.00217 & 8.15 & 8.33 & & \\ {\small with} & rs7091416 & 10 & 25,318,381 & 0.00217 & 8.15 & 8.33 & Not & Not \\ {\small constrained} & rs10075658 & 5 & 148,911,957 & 0.00144* & 8.16 & 8.21 & Available & Available \\ {\small covariates} & rs7733139 & 5 & 145,977,990 & 0.00217 & 7.36 & 7.34 & & \\ & rs7100957 & 10 & 28,207,332 & 0.00870 & 7.20 & 7.30 & & \\ \midrule & rs7303112 & 12 & 97,596,023 & 0.00644 & 9.82 & 9.88 & & 11.08 \\ HDL$_\text{Joint}$ & rs16925210 & 10 & 25,308,103 & 0.00217 & 8.04 & 8.23 & & 3.53 \\ {\small without} & rs7091416 & 10 & 25,318,381 & 0.00217 & 8.04 & 8.23 & Not & 3.52 \\ {\small constrained} & rs10075658 & 5 & 148,911,957 & 0.00144* & 8.12 & 8.17 & Available & 3.47 \\ {\small covariates} & rs7733139 & 5 & 145,977,990 & 0.00217 & 7.41 & 7.40 & & 3.47 \\ & rs7100957 & 10 & 28,207,332 & 0.00870 & 7.19 & 7.30 & & 4.48 \\ & rs10083226 & 13 & 104,434,452 & 0.00219 & 7.10 & 7.31 & & 2.14 \\ \bottomrule \end{tabular} \vspace{0.05in} \caption{All SNPs with minor allele frequency (MAF) above 0.001 that reach genome-wide significance in any of the analyses of the HDL traits from the San Antonio Family Heart Study (SAFHS). All default parameters were used except for minor changes to the quality control thresholds (see text). Also, {\sc Mendel}\ was run in both default and all-pairs modes. {\sc Mendel}'s default mode estimates non-zero global kinship coefficients only for pairs of individuals within the same input pedigree; {\sc Mendel}\ in all-pairs mode, {\sc FaST-LMM}, and {\sc GEMMA}\ estimate coefficients for all pairs of individuals. Genome-wide significance was declared for p-values $< 5\times 10^{-8} \implies -\log_{10}(\text{p-value}) > 7.3$. The SAFHS has 1413 genotyped and phenotyped individuals in 124 pedigrees. The genotypes include roughly 1 million SNPs. The phenotypes include the subjects' high-density lipoprotein (HDL) level and age at three time points. The HDL$_\text{Joint}$ runs are multivariate analyses of HDL$_1$, HDL$_2$, and HDL$_3$ jointly; all other runs are univariate analyses. See the text for a list of the covariates used in each analysis. Note that in the multivariate analysis, {\sc Mendel}\ is able to use roughly twice as many individuals as {\sc GEMMA}\ (see text and Table~\ref{table:run-time}), which may explain the less significant findings for {\sc GEMMA}. Each MAF is based on the pedigree founders, except where marked by an asterisk (*). In these cases the minor allele did not appear in the genotyped founders, and its frequency was estimated from all genotyped individuals.}\label{table:HDL} \vspace{-0.25in} \end{table*} For fair comparisons, we directed {\sc Mendel}\ to estimate SNP-based global kinship coefficients for all pairs of individuals ignoring the input pedigrees. This is the default in {\sc FaST-LMM}\ and {\sc GEMMA}. In addition, we ran {\sc Mendel}'s default in which the coefficients are estimated only for pairs of individuals within the same input pedigree. We also slightly adjusted some of the default quality control thresholds so the programs would be analyzing roughly the same set of SNPs and individuals. For example, by default {\sc Mendel}\ filters SNPs with fewer than three occurrences of the minor allele in the data; in contrast, {\sc FaST-LMM}\ only filters SNPs with zero occurrences of the minor allele, and {\sc GEMMA}\ filters SNPs with minor allele frequency (MAF) $< 0.01$. All other defaults were observed throughout. Users can easily adjust the {\sc Mendel}\ analysis parameters via its control file and the {\sc FaST-LMM}\ and {\sc GEMMA}\ analysis parameters via their command line. We first carried out three univariate QTL analyses of HDL$_1$, HDL$_2$, and HDL$_3$, using SEX and AGE$_1$, AGE$_2$, or AGE$_3$ as covariates. We then ran a multivariate QTL analysis of HDL$_1$, HDL$_2$, and HDL$_3$ jointly, which we refer to as HDL$_\text{Joint}$. For the multivariate analysis, the most appropriate configuration is to constrain the effects of the SEX and AGE covariates to be the same on all three HDL measurements. Such linear constraints are imposed in {\sc Mendel}\ via a few simple lines in its control file. {\sc FaST-LMM}\ and {\sc GEMMA}\ do not allow constraints on covariates. Therefore, we also ran a multivariate analysis with only the SEX covariate and no constraints. With no constraints, SEX will have a slightly different effect on each component phenotype in the multivariate analysis. For instance, {\sc Mendel}'s default run estimated a female effect of $2.5 \pm 0.3$ on HDL$_1$, $2.1 \pm 0.4$ on HDL$_2$, and $2.7 \pm 0.4$ on HDL$_3$. {\sc FaST-LMM}\ cannot perform any multivariate analyses. \begin{figure}[tb] \vspace{-0.10in} \centering \includegraphics[width=3.2in]{SAFHS_HDL1_manhanttan} \includegraphics[width=3.0in]{SAFHS_HDL1_qqplot} \caption{The results of {\sc Mendel}'s HDL$_1$ univariate analysis in the SAFHS data set with global kinship coefficients estimated for all pairs of individuals. Upper: The Manhattan plot graphs roughly one million SNPs against their $-\log_{10}(\text{p-value})$. The horizontal line is the genome-wide significance threshold, $7.3 = -\log_{10}(5 \times 10^{-8})$. Lower: The Q-Q plot graphs the observed $-\log_{10}(\text{p-value})$ quantiles versus their expectations. The genomic control value of $\hat\lambda = 1.006$ derived from this comparison suggests no systematic biases in the data or analysis.} \label{fig:SAFHS-HDL_1} \vspace{-0.15in} \end{figure} Table~\ref{table:HDL} reports all SNPs with MAF $> 0.01$ that achieve genome-wide significance (p-values less than $5 \times 10^{-8}$) as reported by at least one software package. For the univariate analyses, each software package found the same set of significant SNPs, except that one of {\sc GEMMA}'s p-values was slightly short of the significance threshold. Figure~\ref{fig:SAFHS-HDL_1} shows a Manhattan plot and a Q-Q plot from the HDL$_1$ analysis by {\sc Mendel}\ given kinship estimates for all pairs of individuals. The results for the other analyses, both univariate and multivariate, were similar. Each {\sc Mendel}\ all-pairs univariate analysis had genomic control $\lambda$ in the range 1.002 to 1.006; in default mode, $\lambda$ was in the range 0.992 to 1.022. The various Q-Q plots and associated $\lambda$ values show there is no systematic biases in the data or analysis. In the all-pairs {\sc Mendel}\ HDL$_1$ analysis, the grand mean (intercept) was 49.0 $\pm$ 0.8. The SEX covariate was significant in all null models. For example, in the all-pairs {\sc Mendel}\ HDL$_\text{Joint}$ analysis with constrained covariates, the SEX effect was 2.4 $\pm$ 0.3 for females and, by design, the opposite for males. The AGE covariate was not significant in any run. For example, again in the all-pairs HDL$_\text{Joint}$ analysis with parameter constraints, the AGE effect was 0.04 $\pm$ 0.02. In the null model for the all-pairs {\sc Mendel}\ HDL$_1$ analysis, the additive variance was estimated as 78.8 $\pm$ 9.9, and the environmental variance was estimated as 78.1 $\pm$ 7.2. This gives an overall heritability estimate for HDL$_1$ of 0.50 $\pm$ 0.04. Similar variance estimates were seen in other null models. For the multivariate analysis without parameter constraints, {\sc Mendel}\ is able to include almost twice as many individuals in the analysis as {\sc GEMMA}\ (see Table~\ref{table:run-time}). {\sc GEMMA}\ only includes individuals phenotyped at all component traits and covariates. This probably explains why {\sc Mendel}\ finds several more SNPs with significant p-values than {\sc GEMMA}. \begin{table}[b] \vspace{-0.10in} \centering {\footnotesize \begin{tabular}{llrrrr} \toprule Program & \multicolumn{2}{l}{Trait \;\;\;\, Analyzed} & Analyzed & RunTime & RAM \\ & \multicolumn{2}{r}{Samples} & SNPs & (min:sec) & (GB) \\ \midrule\midrule {\sc Mendel}\ default & & 1357 & 935,392 & 1:51 & 1.2 \\ {\sc Mendel}\ all-pairs & HDL$_1$ & 1357 & 935,392 & 7:49 & 1.2 \\ {\sc FaST-LMM} & & 1397 & 941,546 & 76:11 & 30.0 \\ {\sc GEMMA} & & 1397 & 919,050 & 206:54 & 0.4 \\ \midrule {\sc Mendel}\ default & & 818 & 935,392 & 1:33 & 1.1 \\ {\sc Mendel}\ all-pairs & HDL$_2$ & 818 & 935,392 & 3:25 & 1.1 \\ {\sc FaST-LMM} & & 840 & 934,216 & 49:44 & 18.0 \\ {\sc GEMMA} & & 840 & 914,051 & 180:21 & 0.3 \\ \midrule {\sc Mendel}\ default & & 914 & 935,392 & 1:38 & 1.1 \\ {\sc Mendel}\ all-pairs & HDL$_3$ & 914 & 935,392 & 3:54 & 1.1 \\ {\sc FaST-LMM} & & 939 & 937,208 & 54:58 & 20.0 \\ {\sc GEMMA} & & 939 & 918,626 & 182:26 & 0.3 \\ \midrule {\sc Mendel}\ default & HDL$_{\text{Joint}}$ & 1388 & 935,392 & 4:08 & 1.2 \\ {\sc Mendel}\ all-pairs & {\footnotesize with} & 1388 & 935,392 & 83:24 & 1.2 \\ {\sc FaST-LMM} & \multicolumn{2}{l}{{\footnotesize constrained}} & \multicolumn{3}{c}{Not Available} \\ {\sc GEMMA} & \multicolumn{2}{l}{{\footnotesize covariates}} & \multicolumn{3}{c}{Not Available} \\ \midrule {\sc Mendel}\ default & HDL$_{\text{Joint}}$ & 1388 & 935,392 & 3:49 & 1.2 \\ {\sc Mendel}\ all-pairs & {\footnotesize without} & 1388 & 935,392 & 80:04 & 1.2 \\ {\sc FaST-LMM} & \multicolumn{2}{l}{{\footnotesize constrained}} & \multicolumn{3}{c}{Not Available} \\ {\sc GEMMA} & {\footnotesize covariates} & 712 & 912,318 & 630:37 & 0.6 \\ \bottomrule \end{tabular} } \vspace{0.05in} \caption{Comparison of run times and memory (RAM) usage on a typical computer but with adequate RAM to accommodate {\sc FaST-LMM}\ (6 CPU cores at 2.67 GHz, with 48 GB total RAM). The listed run times include reading the data set, performing quality checks, estimating the kinship coefficients, and calculating the association test p-values. All default parameters were used except for minor changes to the quality control thresholds (see text). Also, {\sc Mendel}\ was run in both default and all-pairs modes. {\sc Mendel}'s default mode estimates non-zero global kinship coefficients only for pairs of individuals within the same input pedigree; {\sc Mendel}\ in all-pairs mode, {\sc FaST-LMM}, and {\sc GEMMA}\ estimate coefficients for all pairs of individuals. For the multivariate analysis, {\sc Mendel}\ includes roughly twice as many individuals as {\sc GEMMA}\ because {\sc GEMMA}\ only analyzes individuals phenotyped at all component traits and covariates. {\sc Mendel}\ performs score tests for all SNPs and LRTs for the top SNPs; {\sc FaST-LMM}\ performs LRTs; and {\sc GEMMA}\ by default performs Wald tests, but the user can change this to LRTs or score tests. Using score tests in {\sc GEMMA}\ would make it faster (see text).} \label{table:run-time} \vspace{-0.25in} \end{table} Table~\ref{table:run-time} tallies the run times and memory footprints from each analysis on a typical personal computer with adequate RAM to accommodate {\sc FaST-LMM}\ (6 CPU cores at 2.67 GHz, with 48 GB total RAM). Even when estimating the global kinship coefficients for all pairs of individuals, each univariate QTL run took {\sc Mendel}\ less than 8 minutes to read, quality check, and analyze the data for kinship estimates and association tests, roughly 10\% of the time required for {\sc FaST-LMM}\ and 5\% of the time required by {\sc GEMMA}. (For {\sc GEMMA}, the kinship estimation and association tests are run separately. The run times reported here are their total.) The three programs use different association test strategies: {\sc Mendel}\ performs score tests for all SNPs and LRTs for the top SNPs; {\sc FaST-LMM}\ performs LRTs; and {\sc GEMMA}\ by default performs Wald tests, but the user can change this to LRTs or score tests. For the univariate analyses on a six-core computer, excluding estimation of kinship coefficients, {\sc GEMMA}'s run times under the Wald test and LRT options were roughly similar to {\sc FaST-LMM}'s; {\sc GEMMA}'s run time under the score test option was roughly double {\sc Mendel}'s in all-pairs mode. This is impressive given {\sc GEMMA}'s lack of multithreading. It is kinship estimation, which in practice can be done once per data set, that is substantially slower in {\sc GEMMA}\ (running roughly 135 minutes) than in {\sc FaST-LMM}\ or {\sc Mendel}\ (less than 1 minute). Each trivariate QTL run took {\sc Mendel}\ less than 90 minutes. {\sc Mendel}\ required roughly one-eighth the time of {\sc GEMMA}\ while analyzing almost twice as many individuals. {\sc Mendel}\ is also memory efficient. The univariate and multivariate runs each required less than 1.5 GB of memory, which is well below the amount of RAM in a typical computer. {\sc FaST-LMM}'s memory usage is more than 15 times larger than {\sc Mendel}'s. {\sc GEMMA}\ uses even less memory than {\sc Mendel}\ but is considerably slower. \section{Discussion} We have implemented an ultra-fast algorithm for QTL analysis of pedigree data or mix of population and pedigree data. In our opinion {\sc Mendel}'s comprehensive environment for genetic data analysis is a decided advantage. In addition to its exceptional speed and memory efficiency, {\sc Mendel}\ can handle multivariate quantitative traits and detect outlier trait values and pedigrees. Most competing programs ignore multivariate traits and outliers altogether. A recent review of univariate QTL analysis packages for family data \citep{Cordell2014Review} shows that all the explored packages obtain similar results, leaving speed, features, and ease of use as the important factors in choosing between them. Once the current version of {\sc Mendel}\ came out, the authors of the review were kind enough to add a comment (\url{http://www.plosgenetics.org/annotation/listThread.action?root=81847}{www.plosgenetics.org/annotation/listThread.action?root=81847}) to their article observing that {\sc Mendel}\ was now the fastest and one of the easiest to use packages they reviewed. In the SAFHS example data set we used with HDL phenotypes, all the significant SNPs we found had MAF $< 0.01$. Due to these low MAFs, we do not claim these SNPs are strong candidates for further study. However, the key point here is that all four methods found the same SNPs, at least for the univariate analyses. We also note that the p-values are quite similar regardless of whether one uses kinship estimates between all individuals ({\sc Mendel}'s all-pairs mode) or only between individuals within the same input pedigrees ({\sc Mendel}'s default mode). This suggests that the input pedigree structures for this data set are substantially correct and complete, with few mistaken or hidden relationships. Obviously, this may not be true for other data sets. By supplying good kinship estimates ignoring pedigree structures, the currently reviewed packages make the hard fieldwork of relationship discovery superfluous. A future version of {\sc Mendel}\ will address its failure to read fractional genotype values. This is simply a logistical issue, as all {\sc Mendel}'s internal genotype computations are already handled as floating point operations. Another imminent feature is a fourth style of kinship coefficient estimation that allows the user to force theoretical kinship coefficients for pairs of individuals within the same pedigree and estimated kinships for all other pairs. By supplying a comprehensive, fast, and easy to use package for GWAS on quantitative traits in general pedigrees, we hope to encourage exploitation of family-based data sets for gene mapping. A gene mapping study should collect as large a sample as possible consistent with economic constraints and uniform trait phenotyping. If the sample includes pedigrees, all the better. One should {\em not} let the choice of statistical test determine the data collected; on the contrary, the data should determine the test. Here we have argued that score tests can efficiently handle unrelated individuals, pedigrees, or a mixture of both. For human studies, where controlled breeding is forbidden, nature has provided pedigrees segregating every genetic trait. Many of these pedigrees are known from earlier linkage era studies and should be treasured as valuable resources. Let us suggest a few directions for future work. The current method works marker by marker and is ill equipped to perform model selection. Lasso penalized regression is available to handle model selection for case-control and random sample data \citep{WuLange08Coordinate,WuChenHastieSobelLange09PenLogistic,Zhou2010-GroupLasso,Zhou2011-WeightedLasso} and can be generalized to variance component models. Although we have generalized the score test to distributions such as the multivariate $t$, extending it to discrete traits may be out of reach. For likelihood based methods, there simply are no discrete analogues of the Gaussian distribution that lend themselves to graceful evaluation of pedigree likelihoods. Treating case/control data as a 0/1 quantitative variable is a possibility that has been explored by \citet{PirinenDonnellySpencer2013MMM}. The GEE method is another fallback option because it does not depend on precise distributional assumptions. In rare variant mapping, grouping related SNPs in a variance component may be a good alternative to the mean component models used here. Each variant may be too rare to achieve significance in hypothesis testing. Fortunately, aggregating genotype information within biological units such as genes or pathways offer better power than marginal testing of individual SNPs. See \citet{Asimit2010} for a recent review of aggregation strategies. \citet{Kwee08Kernel} have successfully applied a variance component model for association testing of SNP sets in a sample of unrelated subjects. \citet{Ronnegard2008} consider score tests for random effects models in the context of experimental line crosses. Score tests may well be the key to implementing random effect models in pedigrees. However, the computational demands are apt to be more formidable than those encountered here with fixed effects models. In particular, if tests are based simply on local identity-by-descent (IBD) sharing, then the boundaries between pedigrees disappear, and the entire sample collapses to one large pedigree. The required local kinship coefficients can again be well estimated from dense markers, but this demands more computation than the estimation of global kinship coefficients under the mean components model advocated here \citep{Day-Williams2011}. Since inversion of a pedigree covariance matrix scales as the cube of the number of individuals in the pedigree, treating the entire sample as a single pedigree will put a practical upper limit on sample size. There are other issues in implementing variance component models such as assigning p-values and dealing with multivariate traits that are best left to a separate paper. \section*{Acknowledgement} \paragraph{Funding:} NIH (GM053275, HG006139, MH059490) and NSF (DMS-1310319). Burroughs Wellcome Fund Inter-school Training Program in Metabolic Diseases (KHKC).
{'timestamp': '2014-12-23T02:07:37', 'yymm': '1407', 'arxiv_id': '1407.8253', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8253'}
arxiv
\section{Introduction} \label{sec:intro} \input{intro} \section{Background} \label{sec:bg} \input{background} \subsection{Motivation} \label{sec:motiv} \input{motivation} \section{Gossip Service} \label{sec:protocol} \input{protocol} \section{Performance Evaluation} \label{sec:impl} \input{implementation} \section{Related Work} \label{sec:related} \input{related} \section{Conclusion} \label{sec:concl} \input{conclusion} \section{Availability of Code} The source code developed and used for the performance evaluation comprised in this paper is available as open source, allowing the experiments to be reproduced. In detail, our implementation of WS-Gossip on the Web Services for Devices (WS4D) Java Multi Edition DPWS Stack (JMEDS) is available at \url{https://github.com/filipecampos/ws_gossip}. The code used in the WS-Eventing scenarios, as well as for setting up and controlling all the experiments, is available at \url{https://github.com/filipecampos/ws_gossip_tests}. \section*{Acknowledgments} \small{ This work has been partially supported by the Portuguese National Science Foundation FCT - FundaΓ§Γ£o da CiΓͺncia e Tecnologia, through grant SFRH/BD/66242/2009. } \bibliographystyle{abbrv} \subsection{Service Oriented Standards} \subsubsection{Eventing and messaging} The WS-Eventing specification supports simple publisher-subscriber interaction, by defining how Web Services can subscribe to or accept subscriptions for event notification messages\,\cite{ws_eventing}. The specification defines the four following roles: \begin{description} \item [Event Source]Sends notifications on triggered events, and accepts requests for creating subscriptions. \item [Subscription Manager]Manages event subscriptions. It notifies \textbf{Subscribers} when their subscriptions are terminated unexpectedly, and replies to their subscription management enquiries, such as subscription's status retrieval, renewal or deletion. \item [Event Sink]Receives event notification messages. \item [Subscriber]Contacts an \textbf{Event Source} to create a subscription to manifest the interest of its associated \textbf{Event Sink} to be notified on the occurrence of some event. notifications. It is also responsible for issuing subscription management requests to the \textbf{Subscription Manager}. \end{description} In the simplest scenario, with only two intervening Web Services, a \textbf{Publisher} will comprise both the \textbf{Event Source} and the \textbf{Subscription Manager} roles, whereas the entity that accumulates both the \textbf{Subscriber} and \textbf{Event Sink} roles will be referred as a \textbf{Subscriber}. \begin{figure}[htbp] \centering \includegraphics[width=.8\textwidth]{ws_eventing} \caption{WS-Eventing components.} \label{fig:ws_eventing} \end{figure} WS-Eventing defines the concept of delivery mode, in order to better adapt the general publish/subscribe pattern to scenarios with different event delivery requirements. The default delivery mode of this specification is the single delivery asynchronous \textit{push} mode. But, for instance, situations with slow event consumers where they poll for event messages may be preferred, in order to control the rate of message arrival and avoid overwhelming them if the rate of generation and transmission of event messages is far superior to their processing rate. The subscription request message defines the specific delivery mode to be used in notifying the identified \textbf{Event Sink}, and new delivery modes can be freely used, if both event sources and consumers support them. In the event that a \textbf{Subscriber} requests a delivery mode that is not supported by the \textbf{Event Source}, it will respond signaling this situation, and it may convey a list of the supported delivery modes. This specification proposes, as an example, that notifications can be wrapped in a standard message instead of the default unwrapped mode where each notification is transmitted as a message typed according to the event's action. Although it lacks explicit support for brokered dissemination, it embodies a flexible filtering mechanism in the base specification, favoring lightweight implementations and many-to-one dissemination scenarios. And since it was backed by major vendors, such as IBM, Microsoft or TIBCO, it has therefore been the preferred choice for connected devices, namely, within WS-Management\,\cite{ws_man} and DPWS. The alternative family of standards OASIS WS-Notification\,\cite{ws_bn,ws_brn,ws_t} also provides, besides simple notification and subscription mechanisms, extensible topic definition and brokered dissemination. Since the early 1990s, Reliable Messaging has been seen as a solution for such scenarios by the IT community, and so, several message queueing technologies have been used, such as IBM's WebSphereMQ and Microsoft's MSMQ, in addition to reliable publish/subscribe technologies, such as Tibco Rendezvous. In an effort to bridge all these different technologies, the Java Message Service (JMS) API was developed by the Java Community Process. Some of these technologies were adapted to Web Services. However, due to the exploitation of proprietary protocols, interoperability can only be achieved recurring to gateways that translate between specific pairs of environments. With the emergence of Web Services as the preferred integration solution for distributed systems, WS-Reliable\-Mes\-sag\-ing (WS-RM)\,\cite{wsrm} is the currently adopted standard for achieving reliable message exchange between distributed applications in the presence of software component, system and network failures. Due to the interoperable nature of Web Services, WS-RM allows to bridge two different infrastructures, such as different operating or middleware systems, into an end-to-end model where messages are exchanged reliably\,\cite{ibm_secure}. So, this standard ensures the interoperability of services in what comes to Reliable Messaging, which also simplifies the development of services, since they must implement the protocols, minimizing the number of errors in business logic\,\cite{ibm_secure}. WS-RM distinguishes all the entities involved in an interaction, as well as the various meanings of the terms \textit{send}, \textit{transmit}, \textit{receive} and \textit{deliver}, as they relate to different components. In that sense, the basic model of WS-RM is described in Figure\,\ref{rm_fig} and it includes four distinct entities: \begin{description} \item [Application Source]Service or application logic that \textit{sends} the message to the \textbf{RM Source}; \item [RM Source]Physical processor or node that performs the actual wire transmission; \item [RM Destination]Target processor or node that \textit{receives} the message and then \textit{delivers} it to the \textit{application destination}; \item [Application Destination]Target service of the message. \end{description} \begin{figure}[htbp] \centering \includegraphics[width=.6\textwidth]{ws_rm} \caption{WS-ReliableMessaging basic interaction.} \label{rm_fig} \end{figure} These nodes are endpoints, which according to the WS-RM standard, represent addressable entities that send and receive Web Services messages. The basic mechanism of the standard works, in a simplified way, as follows: the source node sends a Web Service message containing a WS-RM header, which is received by the destination node that then replies by sending an acknowledgment message to the source node. There are several types of assurances defined in WS-RM, in terms of message delivery: \begin{description} \item [AtMostOnce]A message is delivered at most once, but it might not be delivered at all. \item [AtLeastOnce]A message is delivered at least once, but it could be delivered more times. \item [ExactlyOnce]This type is a combination of the previous two. A message is delivered only once. \item [InOrder]When there are several ordered messages, they are delivered in the same order as they were sent. \end{description} Each reliable message exchanging sequence will enforce the message delivery guarantees according to the type defined in the sequence's creation. \subsubsection{Transactional Coordination} The term coordination sometimes refers to a type of orchestration that is defined in the WS-Coordination specification\,\cite{wscoor}. It specifies an extensible framework for \textit{context} management, that provides coordination for the actions of distributed applications. This coordination is achieved through provided protocols that support distributed applications, for instance, those that need to reach consistent agreement on the outcome of distributed transactions. An application service can create a context needed to propagate coordination information to other services involved in some activity. These services will then need to register as participants of that activity. For this purpose, the application must include the created \textit{coordination context} in the messages that it sends to the referred services. A \textit{coordination context} can be transmitted using application-specific mechanisms, such as the header element of a SOAP application message. This kind of conveyance is commonly referred to as flowing the \textit{context}. The structure of a \textit{context} and the requirements to propagate it between cooperating services are also defined in WS-Coordination, and can depend on the type of coordination that is used. A \textit{coordination context} contains information on: \begin{itemize} \item how to access a coordination registration service; \item the coordination type; \item relevant extensions. \end{itemize} This framework also enables existing transaction processing, workflow, and other systems for coordination to hide their proprietary protocols and to operate in an heterogeneous environment. This specification is not sufficient by itself to coordinate Web Services, since it provides only a coordination framework, leaving undefined the concrete protocol and targeted coordination type. The standards WS-Atomic{\-}Transaction (WS-AT)\,\cite{wsat} and WS-BusinessActivity (WS-BA)\,\cite{wsba} implement the WS-Coordination framework and also extend it by defining their own coordination type: short-term atomic transactions, and long-running business activities, respectively. The WS-AT specification defines a protocol that can be plugged into WS-Coordination to provide an adaptation for Web Services of the classic \textit{2PC}\,\cite{understanding_soa} mechanism, making the changes, resulting from the activity of some service, persistent. It is often said that this protocol does not adapt well to Web Services. Nonetheless, it is adequate for interoperability across short-lived, co-located services that need to ensure consistent, all-or-nothing results for a transaction. A \textit{2PC} process consists on a poll conducted by the \textit{coordinator} that will lead it to send two alternative directives to all the participants in the transaction: \begin{description} \item [commit]If all of the registered services have responded indicating that the changes were successful. \item [rollback]If at least one of the registered services fails to respond or responds indicating a failure. \end{description} A service that participates in an atomic transaction can register for more than one of the different types of coordination protocols, as defined in the WS-AT specification: \begin{description} \item [Two-Phase Commit]Coordinates registered participants to reach a commit or abort decision, and ensures that all participants are informed of the final result. It has two variants: \begin{description} \item [Volatile 2PC]Participants manage volatile resources such as a cache register or a window manager. \item [Durable 2PC]Participants manage durable resources such as a da{\-}ta{\-}base register or a file. \end{description} \item [Completion]Initiates commit processing when an application tells the \textit{coordinator} to either try to commit or abort an atomic transaction. Based on the registered participants for each protocol, the \textit{coordinator} begins with \textit{Volatile 2PC} and then proceeds through \textit{Durable 2PC}. After the transaction has completed, a status is returned to the application and the final result to the service that initiates the transaction (\textit{initiator}), if it has registered for this protocol. \end{description} \subsubsection{Combining services} One of the main benefits of using standards lies in the ability to combine them due to their well known interfaces and behavior, in order to extract the most suitable features for each scenario. For instance, both of the aforementioned event-driven specifications, WS-Eventing and WS-Notification, can be combined with a coordination protocol in order to guarantee the atomicity of an event\,\cite{4279671}. Although this composition ensures that notifications reach all the relevant targets, it proves to be a heavy process for resource constrained devices, specially in scenarios with a large number of targets, or with a large amount of communication errors, where WS-RM could help mitigating them, but also at the cost of increasing resource consumption. WS-RM can be combined with several WS-* standards. On the one hand, it can improve its features by leveraging: \begin{itemize} \item WS-Addressing, which enables the identification of messages and addresses of endpoints. This specification was modified to accommodate some needs of the WS-RM specification, like the reuse of a message ID when retransmitting identical messages to counter communication errors\,\cite{soa_concepts_tech_design}; \item WS-Security, to protect the integrity and confidentiality of the exchanged messages; \item WS-Policy, to specify the delivery assurance, among other requirements, for a sequence\,\cite{soa_concepts_tech_design,soa_field_guide,soa_approach}. \end{itemize} On the other hand, due to its ability to ensure reliable communication between two endpoints, WS-RM can be leveraged by other standards, such as WS-Eventing, WS-Notification, WS-AT, WS-BA and WS-Coordination to achieve reliable communication among the intervening parties. Although the WS-RM specification allows to condition service activities, it is different from WS-AT or WS-BA, in the sense that a coordinating entity is not needed to inspect the progress of the activities, being the reliability rules conveyed as SOAP headers in the exchanged messages\,\cite{soa_concepts_tech_design}. Regarding the questions posed in the beginning of this section, WS-RM would be a suitable standard to ensure point-to-point reliable message delivery. However, it would be very inefficient and poise a heavy weight on the message sender in terms of processing power, if there are lots of message recipients or if lots of errors occur. In order for WS-RM to guarantee atomic delivery to all targets, it would have to rely on WS-AT, or a similar protocol based in WS-Coordination, which would, once again, increase the consumption of the sender's processing and communication resources, due to the additional message traffic. \subsection{Gossip} In computer networking, gossiping describes the process where a participant that intends to disseminate some information chooses a small random subset of other participants and forwards the information to them. Each of these destinations, upon receiving the information, repeats the same procedure, hence, the gossip moniker. This procedure mimics also how epidemics spread in populations and, therefore, are also known as epidemic protocols\,\cite{Eugster:2004p10747}. \subsubsection{Reliability and Scale} \begin{figure}[t] \centering \begin{tikzpicture} \begin{axis}[xlabel=Fanout (f),ylabel=(\%),ymax=130] \addplot table[header=false,x index=0,y index=1]{gossip.dat}; \addplot table[header=false,x index=0,y index=2]{gossip.dat}; \legend{Average Receivers,Atomic Runs} \end{axis} \end{tikzpicture} \caption{Reliability of gossip (250 participants, 10 dissemination runs, variable fanout).} \label{fig:gosreliability} \end{figure} Most interestingly, gossip protocols don't need a reactive mechanism to deal with failures, namely, buffering, acknowledgement, retransmission, and garbage collection, which account for most of the complexity in common communication protocols. Instead, reliability is proactively achieved by the protocol's inherent redundancy and randomization, that cope with both process and network link failures. The expected probability for a message being delivered to each destination and to all destinations as a whole can be derived directly from protocol parameters $f$, the number of targets that are locally selected by each process for gossiping, and $r$, maximum number of times a message is relayed before being ignored. Figure~\ref{fig:gosreliability} illustrates the impact of these parameters by showing simulation results of disseminating 10 messages to 250 receivers, with $r=5$ and a variable $f$. Notice that with $f>4$ each destination gets each message with a very high probability. With $f>7$, each message is atomically received by all destinations also with a very high probability. By adjusting $r$ and $f$ parameters according to system size and expected faults, gossip can be configured such that any desired average number of receivers successfully get the message. Better yet, parameters can be set such that the message is atomically delivered to all the receivers with high probability leading to guaranteed atomic delivery\,\cite{1297243}. The key to scalability is that the required fanout configuration is at worst logarithmically proportional to system size. \subsubsection{Variants} There are two main variants of gossip protocols\,\cite{892324}, which provide different message exchange patterns and performance trade-offs. In \emph{push gossip}, a node that becomes aware of new information, conveys it immediately to target nodes. This variant is adequate for one-to-many dissemination of small messages and events. With \emph{pull gossip}, instead of gossiping upon arrival of new information, a node periodically selects a number of peers and asks them for new information. It has been shown that combining \emph{push} and \emph{pull gossip} results in dissemination being achieved in a lower number of steps\,\cite{892324} and provides a generic framework for gossiping that can be tailored for multiple purposes by parameterizing it with different aggregation functions\,\cite{newscast03}. In addition, lazily deferring the transmission of payload improves performance in heterogeneous networks, allowing gossip protocols to approximate ideal resource usage efficiency\,\cite{Pereira06}. Such \emph{lazy} variants are most useful when the data payload is very large, but also when it is very likely that the data is already known throughout the network. Finally, there are two options regarding relaying duplicate messages. In the \textit{infect-and-die} model, a participant that receives the message (i.e. is infected), sends the received message to other nodes, and then never sends it again, becoming dead in the analogy with epidemics. In the \textit{infect{\--}forever} model, also known as \textit{balls-and-bins}\,\cite{koldehofe02simple}, a participant might relay received message multiple times, possibly until $r$ rounds are reached. This last alternative has the advantage of requiring no state at participants to recall recently relayed messages. On the other hand, it usually requires more network resources as the relay limit has to be set conservatively. \subsubsection{Membership Management} A key component of a gossip protocol is the ability to obtain random subsets of participants to direct messages at in each gossip operation. This component has to provide an uniform random sample and, as much as possible, drawn from a current view of operational participants\,\cite{1045666}. The first option is to share the full list of participants, allowing each of them to locally draw subsets as desired\,\cite{312207}. This is adequate when the list does not change frequently, to avoid taxing the network with constant updates, and is small enough to fit each participants memory. If these conditions are not met, it has also been shown that sufficiently good random samples can be obtained by having each participant keep a small partial view of the system, which is itself maintained using a gossip protocol\,\cite{945507,Eugster:2004p10747}. A particularly simple but effective approach\,\cite{Voulgaris:2005p6235} is allowing a node to exchange some elements in its local list with the same number of elements from some other node. This progressively shuffles the list of each participant and leads to the desired uniform random sample. By adding a time-based lease and renewal mechanism, it also deals with participants entering and leaving the system. \subsection{Experimental setting} Experimental evaluation is done using the Minha middleware test platform\,\cite{Carvalho:2011:EED:2093185.2093188,minha_url}, which virtualizes multiple devices within a single JVM while simulating the performance characteristics of a real system. It also allowed us to inject network faults to better assess the reliability of WS-Gossip. Each test corresponds to the simulation of the runtime of a given number of devices collocated in the same LAN, in a single host with the following configuration: 64-bit Ubuntu Server 10.04.4 Linux, two 12-core AMD Opteron\textsuperscript{TM} Processor 6172, 2.1GHz, 128 GB RAM, 64-bit Sun Microsystems Java SE 1.6.0\_26. The evaluation consists in executing a periodic event dissemination, for the mentioned scenarios, where a new value is propagated from a single producer device to a given number of consumer devices. A centralized managing device was used to control peer management\footnote{Discovery proxy is not yet implemented in JMEDS 2.0 beta 3a. Instead we used a custom registry service.} and the execution of the test. The following scenarios were analyzed: \begin{description} \item [WS-Eventing]A publish/subscribe communication protocol was selected as it is one of the most used event dissemination patterns. Hence, the WS-Eventing standard, as provided by JMEDS, was evaluated using HTTP/TCP communication. \item [WS-Gossip]The \textit{push} variant of WS-Gossip was selected to be evaluated in conjunction with SOAP-over-UDP. Two different scenarios were evaluated for WS-Gossip in terms of communication errors to compare the achieved reliability and latency degradation. Each of these scenarios designation is then suffixed with (0\% Loss), when there are no message losses, and with (10\% Loss), when 10\% of communication losses are introduced by the Minha simulator. \end{description} The execution procedure of each test comprised the following steps: \begin{enumerate} \item The manager and the producer devices are started. \item The consumer devices are then started. In WS-Eventing, they subscribe with the producer as soon as they are started. In WS-Gossip, the manager, informs each consumer of its neighbors according with the configured fanout value, so they can convey new messages to them. For both scenarios, the manager verifies if all the devices started correctly before signaling the producer to start the dissemination. \item The producer begins disseminating events periodically, which are propagated across the network. \item The producer terminates and notifies the manager. \item The manager informs, sequentially, all the devices about the file they should write their run statistics to. \end{enumerate} The tests for each scenario consisted in 5 runs for each given number of devices, where 120 events were periodically emitted with an interval of 5 seconds. The interval between the initial emission of a message and its reception by a consumer was measured in nanoseconds since Minha enables the execution of all the intervening devices inside a single JVM on a single host. The sampling of the instant of emission was performed right before the producer sends a message, and the reception time measurement was done in the first operation of the method invoked to deal with a new message at a consumer. In WS-Gossip, the used values for the fanout parameter were computed according to\,\cite{amk-from-epidemics-to-dc}, taking into account the number of devices, as well as an expected error rate (e) of 5\% and a delivery assurance (p) of 99\%, ranging from a value of 8 for 10 devices to 11 for 250 devices. In these very same scenarios, the publisher is randomly selected from all the nodes, contrarily to the WS-Eventing scenario where the publisher is the first device. \subsection{Results and discussion} \begin{figure}[htbp] \centering \begin{tikzpicture} \begin{axis}[xlabel=devices,ylabel=ms,ymax=130, legend columns=1, legend style={ at={(1.03,0.48)}, anchor=west}] \addplot table[header=false,x index=0,y index=1]{pushudp-0.dat}; \addplot table[header=false,x index=0,y index=1]{pushudp-10.dat}; \addplot table[header=false,x index=0,y index=1]{notif.dat}; \legend{WS-Gossip(0\% Loss),WS-Gossip(10\% Loss),WS-Eventing} \end{axis} \end{tikzpicture} \caption{WS-Eventing vs. WS-Gossip (latency).} \label{fig:wse_wsg} \end{figure} \begin{figure}[htbp] \centering \begin{tikzpicture} \begin{axis}[xlabel=devices,ylabel=hops,ymin=0, legend columns=1, legend style={ at={(1.03,0.48)}, anchor=west}] \addplot table[header=false,x index=0,y index=3]{pushudp-0.dat}; \addplot table[header=false,x index=0,y index=3]{pushudp-10.dat}; \legend{WS-Gossip(0\% Loss),WS-Gossip(10\% Loss)} \end{axis} \end{tikzpicture} \caption{Average hops to delivery in WS-Gossip.} \label{fig:hops} \end{figure} Results presented in Figures~\ref{fig:wse_wsg} and \ref{fig:hops} are the average of all 5 runs for each scenario. For latency measurements, the first and the last 10 iterations were discarded in order to minimize the effect of Java JIT compilation, although it also masks the delay of TCP connection establishment in WS-Eventing. In Figure\,\ref{fig:wse_wsg}, the message delivery latency of the WS-Eventing grows linearly with the number of targets, from 10 to 126 milliseconds, whereas that of WS-Gossip(0\% Loss) is very small and grows very slowly, between 2.8 to 10.5 milliseconds. This can be justified by scattering the load of propagating a message throughout an entire network, by the devices on that network, instead of overloading a single device, such as the publisher in WS-Eventing. The message delivery latency of WS-Gossip(10\% Loss) is very close to that of WS-Gossip(0\% Loss), suffering a small increase of around 0.1 milliseconds. Figure\,\ref{fig:hops} presents the logarithmic growth of the average number of hops a message goes through from emission to reception in WS-Gossip, between 1.2 to 2.64 hops, confirming that the gossip protocol scales logarithmically with system size. This figure also shows that the introduction of communication losses has little effect on the number of hops a message goes through, with an average increase of around 0.6 hops in WS-Gossip(10\% Loss) compared to the baseline scenario, where no messages are lost in the network. Message delivery rate is not presented graphically since it is 100\% both in WS-Eventing and in WS-Gossip(0\% Loss) and it is always greater than 99.9\% in WS-Gossip(10\% Loss), and most frequently 100\%, even with a rate of communication losses that corresponds to the double of the expected 5\%. To conclude the analysis of the results, considering an environment with \textit{n} devices, where the WS-Eventing producer will always have to send \textit{n} messages for each event, whereas gossip peers will send a number of messages equal to its fanout \textit{f}, thus spreading the load throughout the network which results in savings in the consumption of resources by the producer for cases where \textit{n} $ > $ \textit{f}. \subsection{Header information} As previously stated, the unit of information being gossiped is the SOAP envelope. Messages in a gossip interaction contain an entry in the SOAP header section of the SOAP envelope describing how to relay such messages. These are initialized by the initiator device, either within a shadow service or by a gossip-aware client. Moreover, there is also the assumption of WS-Addressing\,\cite{ws_a} providing a unique identifier for each message and support for asynchronous replies. Briefly, it contains the following information: \begin{description} \item [Scope/Type]As defined by WS-Discovery, this field implicitly describes the set of targets. Devices can be configured to relay messages only within a specific scope and type. \item [Fanout]The number of peers to target in each interaction. \item [Hops]The remaining number of hops. This must be decremented by each device that relays the message. The message is discarded when it reaches zero. \item [IdTTL]The time that each device should buffer the message identifier for duplicate detection. If this is set to zero, the protocol degenerates to the \textit{balls-and-bins} variant\,\cite{ballsandbins}. \item [DataTTL]The time that each device should buffer the message itself for retransmission in lazy gossip variants. If this is set to zero, the protocol will never issue advertisements and will always use an \textit{eager} variant. \item [Filter]An optional item, specifying a rule to filter replies, which must be specified using XSLT. Valid rules are configured by the deployer and advertised as policies by the shadow service. \end{description} \subsection{Operation styles} SOAP and WSDL support several operation styles\,\cite{soap,wsdl_11,wsdl_12}. Besides a typical client-server interaction (i.e. \textit{request-response}), it is also possible to have input-only operations (i.e. \textit{one-way}), output-only operations (i.e. \textit{notification}), and call-back operations (i.e. \textit{solicit-response}). It is also possible that a \textit{two-way} operation leads to multiple replies. These different operation styles allow WS-Gossip to support different gossip variants in addition to the previously described eager \textit{push-style}, such as the \textit{lazy} and the \textit{pull} variants. Gossiping in \textit{one-way} and \textit{notification} operations is handled as described previously: Upon reception of a message, it is propagated and no reply is expected. In \textit{request-reply} and \textit{solicit-response} operation, the message is propagated and then all replies received are propagated back to the initiator. This requires the initiator's address to be stored alongside with the message identifier used for duplicate detection during the specified \textbf{IdTTL}. Consider the following example: A \textit{request-response} to query available disk space of servers in a data center. A client invokes the operation on the shadow service, which eventually reaches all targets. All responses then travel back along the same tree implicitly created by the request message and will eventually reach the initiator. An alternative is to make use of a filter. This can omit or aggregate replies according to a rule specified when gossip is initiated. Consider the following example: The same \textit{request-response} operation is used to determine which server has the most available disk space in a data center. This requires that upon deployment, devices are configured to support the maximum filter on the disk space query operation. A client invokes the operation on the shadow service, which eventually reaches all targets. Responses then travel back along the same tree implicitly created by request message, but they are buffered and filtered such that only the maximum discovered downstream is returned by each peer. Each peer's reply is sent as soon as all its targets have replied, with a value or with a fault, or when a timeout expires. \subsection{Gossip styles} In addition to eager \textit{push-style} gossip described so far, \textit{lazy} and \textit{pull} variants are supported as follows. Besides offering the same port type as the hosted service, the shadow gossip service provides a gossip port with the following operations: \begin{description} \item [Push]Alternative to directly using the interface. This allows a set of messages to be submitted in a single interaction. \item [PushIds]Informs the target that a number of messages are locally available. These should then be requested using \textbf{Fetch}. \item [Pull]Returns currently buffered messages during a time interval specified as a parameter. \item [PullIds]Variant of the previous operation, which requests identifiers instead of the actual messages. These can then be requested using \textbf{Fetch}. \item [Fetch]Returns currently buffered messages, as specified by a list of identifiers provided as a parameter. \end{description} Gossip variants can be achieved through the composition of the previous operations. Namely, \textit{lazy push} is obtained by using \textbf{PushIds} instead of \textbf{Push} and then waiting for \textbf{Fetch} to be used later on selected identifiers. \textit{Eager pull} is obtained by periodically invoking \textbf{Pull}. Finally, \textit{lazy pull} is obtained by periodically invoking \textbf{PullIds} and then using \textbf{Fetch} on the resulting identifiers that are unknown. The gossip variant chosen for each operation depends on configuration by the service deployer. In particular, the optimum configuration for \textit{push} gossip is to use the \textit{eager} variant for early rounds and then \textit{lazy}. For \textit{pull} gossip, the \textit{lazy} variant is interesting for very large payloads. The combination of both \textit{push} and \textit{pull} is known to ensure rapid and robust dissemination of information\,\cite{892324,312207}. \subsection{Peer service} \begin{figure}[htbp] \centering \includegraphics[width=.75\textwidth]{peers-crop} \caption{Overview of peer management.} \label{fig:memb} \end{figure} By default, WS-Gossip does not need an explicit peer management service. Instead, each gossip interaction can be configured with a scope or a service type that is then used to discover the full set of reachable peers through WS-Discovery. This is most useful in scenarios where a discovery proxy device exists, since a set of peers can be obtained efficiently by querying the proxy. This leads to a configuration with centralized peer information while information dissemination is distributed, which is adequate for scenarios with low churn and relatively high messaging rate. If a proxy is not available, the usage of the Ad-Hoc mode of WS-Discovery would lead to a large number of multicast messages that would most likely defeat the purpose of gossip. Instead, our proposal allows that peers discovered to be cached locally and exchanged with other peers to implicitly create an overlay network using the Newscast protocol\,\cite{newscast03}. The structure of the stored peer information comprises a list where each service instance is represented by an entry that contains the following elements: \begin{description} \item [Address]Corresponds to the service endpoint address. \item [Type]Identifies the type of the service. \item [DeviceId]Identifies the device where the service is hosted. This field is not applicable to services that are not associated with any device. \item [Heartbeat]Counter that is incremented as messages, such as the invocation of the \textbf{Exchange} operation, are issued by other peer. \end{description} This information is exchanged among different devices and also updated through the examination of WS-Dis\-cov\-er\-y multicast messages issued by target services entering or leaving the network. Periodically, if the instance has not received a request for exchanging its membership information during a certain time frame, it selects another instance of the peer service to which it sends such a request containing the list of the known endpoints. Upon reception of such a message, the contacted instance returns to the requester its own list of known endpoints, and merges it with the received one. The heartbeat counter of a service instance that never sends a new message, or eventually sends but without reaching a peer service instance, stays unchanged, implying that it will move towards the end of the membership list as the counter of other services is being updated and new services are discovered. That service instance will eventually be discarded when the cache of the Peer Service reaches the configured maximum size.
{'timestamp': '2014-08-01T02:13:05', 'yymm': '1407', 'arxiv_id': '1407.8546', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8546'}
arxiv
\section{Introduction}\label{sec1} Duplicate detection is the task of finding sets of records that refer to the same entities within a data file. This task is not trivial when unique identifiers of the entities are not recorded in the file, and it is especially difficult when the records are subject to errors and missing values. The existence of duplicates in a data file may compromise the validity of any analysis that uses those data, and therefore duplicate detection is needed in a wide variety of contexts, including public health and biomedical research [e.g., \citet{Hsuetal00,Milleretal00,Sariyaretal12MissingValues}], and census quality improvement [e.g., \citet{Fay04,Marshall08}]. In the context of an armed conflict, it is common for an institution recording civilian casualties to receive multiple reports on the same victims. These reports may come from witnesses who provide different degrees of detail, therefore leading to nontrivial duplicates in the institution's data file. Finding duplicates in those homicide registries is an important step toward keeping an accurate account of lethal violence. In this article we study a case from El Salvador, where a Truth Commission formed by the United Nations in 1992 collected data on killings that occurred during the Salvadoran civil war (1980--1991). Due to the way in which those data were collected, a victim could have been reported by different relatives and friends, and therefore it is important to detect those multiply reported casualties. \subsection{The United Nations Truth Commission for El Salvador} From 1980 to 1991, the Republic of El Salvador, in Central America, underwent a civil war between the Salvadoran Government and the left-wing guerrilla Farabundo Mart\'i National Liberation Front (FMLN, after its name in Spanish). The parties signed a peace agreement in 1992 which later led to the creation of the Commission on the Truth for El Salvador by the United Nations [\citeauthor{Buergenthal94} (\citeyear{Buergenthal94,Buergenthal96})], henceforth abbreviated as UNTC. Between 1992 and 1993, the UNTC summoned the Salvadoran society to report violations that occurred during the war, mainly focusing on homicides and disappearances of noncombatants. The UNTC ran announcements on the radio, television, and in newspapers inviting individuals to testify, and opened offices in different regions of the country where information from witnesses was collected [\citet{CTElSalvador93}]. Finally, in 1993 the UNTC published a report with the results of their investigations, including a list of homicides directly obtained from testimonials, which were mainly provided by the victims' family members, but also by close friends. In addition to the names of the victims, this list contains the reported locations and dates of the killings. Most of the killings reported to the UNTC occurred several years before 1992, and therefore it was expected that friends and relatives of the victims would not recall some details of the killings or would provide testimonials that conflict with each other. These characteristics of the data collection naturally led to missing information and nontrivial duplicate records in the UNTC data file. The variability among records that refer to the same victim and the presence of missing data make finding duplicates specially challenging. Furthermore, it is difficult to construct a reliable training data set for duplicate detection, that is, a set of record pairs with known coreference statuses, which supervised duplicate detection methods require. In this document we develop a new approach to duplicate detection inspired by these type of situations. Our approach handles missing data and allows the duplicate detection process to be assisted with prior information on the reliability of each field in the file, which helps to compensate for the absence of training data. \subsection{Current approaches to duplicate detection} Duplicate detection differs from the closely related task of \emph {record linkage} in the sense that the goal of the latter is to link multiple files usually obtained from different data collection processes, and it is assumed that these files do not contain duplicates within them [\citet{FellegiSunter69,Winkler88,Jaro89,LarsenRubin01,HerzogScheurenWinkler07}]. Despite this difference, the same principles and techniques can usually be adapted to solve both tasks. In this article two or more records referring to the same entity are called \textit{coreferent}. Traditional approaches to unsupervised duplicate detection and record linkage fit mixture models on pairwise comparisons of records with the goal of separating coreferent from noncoreferent pairs [\citet{Elmagarmidetal07,HerzogScheurenWinkler07}]. Traditional supervised approaches train classifiers on a sample of record pairs with known coreference statuses, and then predict the coreference statuses of the remaining record pairs [\citet{Elmagarmidetal07,ChristenBook}]. Both of these type of approaches output independent decisions on the coreference status of each record pair, and therefore neither of them guarantee transitivity of the coreference decisions. For example, it is possible that records $i$ and $j$ are declared as being coreferent, as well as records $j$ and $k$, but records $i$ and $k$ may be declared as noncoreferent. If $i$, $j$ and $k$ truly correspond to the same entity, the nontransitivity could occur due to measurement error and incomplete record information. It may be the case, however, that only two or none of those records are coreferent, but these methodologies do not offer any representation of uncertainty in these situations, and so they require resolving discrepancies in an ad-hoc post-processing step. Most recently, Bayesian approaches to both duplicate detection and record linkage have been proposed, which provide a natural account of the coreference decisions' uncertainty in the form of posterior distributions. Most of these approaches directly model the information contained in the data files [\citet{Matsakis10,TancrediLiseo11,Fortinietal02,Gutmanetal13,Steortsetal13}], which require crafting specific models for each type of field in the file, and are therefore currently limited to handle nominal categorical fields or continuous variables modeled under normality. In practice, however, fields that are complicated to model, such as names, addresses, phone numbers or dates, are important to detect coreferent records. These type of fields are often subject to typographical and other types of errors, which make it important to take into account partial agreements between their values. This is certainly an advantage of traditional methodologies, as they base their decisions on pairwise comparisons of records and therefore can use any type of field, as long as these can be compared in a meaningful way. The approaches of \citet{Fortinietal01} and \citeauthor{Larsen02} (\citeyear{Larsen02,Larsen05,Larsen12}) are Bayesian implementations of the traditional unsupervised approach to record linkage [\citet{FellegiSunter69,Winkler88,LarsenRubin01,HerzogScheurenWinkler07}], which bases its coreference decisions on pairwise comparison data. These latter approaches, however, do not currently handle missing data, do not take into account multiple levels of partial agreement, and they would lead to nontransitive decisions if they were applied without modification to a duplicate detection problem. \subsection{Overview of the article} The approach that we propose in this article builds upon the previous literature by combining a number of desirable characteristics for a duplicate detection technique. Our approach to duplicate detection guarantees transitivity of the coreference decisions by defining our parameter of interest as the partition of the data file that groups coreferent records together, as in \citet{Matsakis10}. Our approach is closely related to those of \citet{FellegiSunter69}, \citet{Winkler88}, \citet{Jaro89}, \citet{LarsenRubin01}, \citet{Fortinietal01} and \citeauthor{Larsen02} (\citeyear{Larsen02,Larsen05,Larsen12}) for record linkage in the sense that our coreference decisions are based on comparison data, but we also extend some ideas of \citet{Winkler90Strings} to take into account levels of disagreement among the fields' values. In practice, it is also common to have missing values in the data file, and so we show how our method can be adapted to those situations. By taking a Bayesian approach we can incorporate prior knowledge on the reliability of the fields, which is useful in situations where no training data are available. The introduction of prior information to solve this type of problem has been advocated by \citet{Fortinietal01}, \citeauthor{Larsen02} (\citeyear{Larsen02,Larsen05,Larsen12}) and others. Our Bayesian approach provides us with a posterior distribution on the possible partitions of the file, which is a natural way to account for the uncertainty in the coreference decisions, similarly as in \citet{Matsakis10} and \citet{Steortsetal13}. The remainder of the article is organized as follows: Section~\ref{s:methodology} presents a general description of the proposed methodology; Section~\ref{s:modelindepcomps} presents a conditional independence model that leads to a simple way of dealing with missing values, an illustrative example and a simulation study; Section~\ref{s:UNTRCapplication} addresses the problem of detecting killings reported multiple times to the United Nations Truth Commission for El Salvador; and Section~\ref{s:conclusions} concludes. \section{Methodology}\label{s:methodology} Assume we have a data file containing $r$ records labeled $\{1,\ldots,r\} $, where more than one record may refer to the same underlying entity. Finding duplicates in such a data file is equivalent to grouping records according to the underlying entities that they refer to. If there are $n\leq r$ entities represented in the data file, we can safely think of partitioning the data file into $n$ groups of coreferent records. This partition of the file, called \textit{coreference partition} [\citet{Matsakis10}], is our parameter of interest, and it can be represented in different ways. We use different representations throughout the article depending on which one is more convenient. \subsection{Representations of partitions}\label{ss:representations} A partition of a set is a collection of nonempty and nonoverlapping subsets whose union is the original set. In this article those subsets are called \textit{groups} or \textit{cells}. Given a data file with, say, five records $\{1,2,3,4,5\}$, a partition with cells $\{1,3\}$, $\{2\}$ and $\{4,5\}$ is denoted as $1, 3 / 2 / 4, 5$. In a coreference partition, each of its cells represents an underlying entity, therefore, in this example records 1 and 3 are coreferent, as well as records 4 and 5. This representation, however, is not useful for computations. A partition can also be represented by a matrix. Let us consider the matrix $\bD$ of size $r \times r$, whose $(i,j)$th entry is defined as \[ \Delta_{ij}= \cases{ 1, &\quad $\mbox{if records $i$ and $j$ refer to the same entity;}$ \vspace*{2pt}\cr 0, &\quad $\mbox{otherwise.}$} \] In the context of duplicate detection we will refer to $\bD$ as a \emph {coreference matrix}. Notice that $\bD$ is symmetric with only ones in the diagonal, and it would be block-diagonal if coreferent records were contiguous in the data file, with each block representing a group of coreferent records. Representing partitions using matrices is computationally inefficient, especially when the number of records is large. An alternative is to use arbitrary labelings of the partition's cells. Since $r$ is the number of records in the data file, it is safe to assume that $r$ is the maximum number of entities possibly represented in the data file, and therefore it is the maximum number of labels that we need. By assigning an arbitrary labeling to these $r$ potential entities, we can introduce the variables $Z_i$, $i=1,\ldots,r$, where $Z_{i}=q$ if record $i$ represents entity $q$, with $1\leq q \leq r$, and the vector $\bZ =(Z_1,\ldots,Z_r)$ contains all the records' labels. Notice that although the labeling of the $r$ potentially existing entities is arbitrary, any relabeling leads to the same partition of the records. In fact, $\Delta_{ij}=I(Z_i=Z_j)$, where $I(\cdot)$ is the indicator function, and this relationship does not depend on the labeling that we use. This relationship is important since a prior distribution on the space of partitions can be obtained by specifying a distribution for the records' labels $\bZ$. Notice that if the number of entities $n$ is lower than $r$, then there will be $r-n$ labels not in use for each particular labeling. According to this labeling scheme, a partition of $r$ elements into $n$ cells has $r!/(r-n)!$ possible labelings. Finally, to fix ideas, the vectors $\bZ=(1, 2, 1, 3, 3)$ and $\bZ=(4, 1, 4, 2, 2)$ are instances of arbitrary labelings of the partition $1, 3 / 2 / 4, 5$, since in both $Z_1=Z_3\neq Z_4=Z_5$, and $Z_2$ gets its own unique value. The number of ways in which a data file with $r$ records can be partitioned is given by the $r$th Bell number [see, e.g., \citet{Rota64}], which grows rapidly with $r$. For example, the number of possible partitions of a file with 10 records is 115,975, and if the file contains 15 records, the Bell number grows to 1,382,958,545. In practice, most files are much larger, but fortunately most partitions can be ruled out at an early stage, as we describe in Section~\ref{ss:complexity}. To make inferences on the file's coreference partition, we find how similar each pair of records is. \subsection{Levels of disagreement as comparison data}\label{ss:compdata} Comparison data are obtained by comparing pairs of records, with the goal of finding evidence of whether two records refer to the same entity. Intuitively, two records referring to the same entity should be very similar. The way of constructing the comparisons depends on the information contained by the records. The most straightforward way of comparing the same field of two records is by checking whether their information agrees or not. Although this comparison method is extensively used, and it is appropriate for comparing unordered categorical fields (e.g., sex or race), it completely ignores partial agreement. \citet{Winkler90Strings} proposes to take into account partial agreement among fields that contain strings (e.g., given names) by computing a string metric, such as the normalized Levenshtein edit distance or any other [see \citet{Bilenkoetal03,Elmagarmidetal07}], and then dividing the resulting set of similarity values into different \textit{levels of disagreement}. Winkler's approach can be extended to compute levels of disagreement for fields that are not appropriately compared in a dichotomous fashion. We compare the field $f$ of records $i$ and $j$ by computing some similarity measure $\mathcal{S}_f(i,j)$. The range of this similarity measure is then divided into $L_f+1$ intervals $I_{f0}, I_{f1},\ldots, I_{fL_f}$, that represent different levels of disagreement. By convention, the interval $I_{f0}$ represents the highest level of agreement, which includes no disagreement, and the last interval, $I_{fL_f}$, represents the highest level of disagreement, which depending on the field represents complete or strong disagreement. We can then build ordinal variables from these intervals. For records $i$ and $j$, and field $f$, we define \[ \gamma^{f}_{ij} = l\qquad \mbox{if } \mathcal{S}_f (i,j) \in I_{fl}. \] The larger the value of $\gamma^{f}_{ij}$, the larger the disagreement between records $i$ and $j$ with respect to field $f$. These different field comparisons are collected in a vector for each record pair, as in the record linkage literature [e.g., \citet{FellegiSunter69}]. $\bg _{ij}=(\gamma_{ij}^1,\ldots,\gamma_{ij}^f,\ldots,\gamma_{ij}^F)$ denotes the comparison vector for records $i$ and $j$, where $F$ is the number of fields being compared. Notice that, in principle, we could construct $\bg_{ij}$ using the original similarity values $\mathcal{S}_f(i,j)$. In our approach, however, we model these comparison vectors as a way to make inference on the coreference partition. Modeling directly the original $\mathcal {S}_f(i,j)$'s requires a customized model per type of comparison, since these similarity measures output values in different ranges, depending on their functional form and the field being compared. By building levels of disagreement as ordinal categorical variables, we can use a generic model for any type of comparison, as long as its values are categorized. This approach also raises the question of how to choose the thresholds to build the intervals $I_{fl}$. The selection of the thresholds should correspond to what the researcher genuinely considers as levels of disagreement. This depends on the specific application at hand and the type of field being compared. For example, in Sections~\ref{s:modelindepcomps} and \ref{s:UNTRCapplication} we build levels of disagreement according to what we consider to be no disagreement, mild disagreement, moderate disagreement and extreme disagreement. Although in principle the number of record comparisons is $ {r\choose 2}=r(r-1)/2$, in practice, most record pairs are noncoreferent, and most of them can be trivially detected using some simple criteria, thereby avoiding the computation of the complete set of comparisons, as we show next. \subsection{Reducing the inferential and computational complexity}\label {ss:complexity} In most applications there are simple ways to detect large numbers of obvious noncoreferent pairs at some early stage of the duplicate detection process. Detecting those pairs reduces tremendously the inferential and computational complexity of the problem, given that whenever records $i$ and $j$ are declared as noncoreferent, this translates to fixing $\Delta_{ij}=0$ in the coreference matrix, which in turn assigns probability zero to all the partitions where records $i$ and $j$ are grouped together. There are different techniques to detect sets of noncoreferent pairs, and here we refer to a few of them [see \citet{Christen12} for an extensive survey]. The most popular approach is called \textit{blocking}, and it consists of dividing the data file into different blocks (sets of records) according to one or more reliable categorical fields, such that records in different blocks are considered to be noncoreferent. The idea is that if a field is reliable enough, then it would be unlikely to find a coreferent pair among pairs of records disagreeing in that field. For example, if we believe a field like gender or postal code (zip code) to be free of error, we can declare records disagreeing on that field to be noncoreferent. This approach is appealing since it does not even require us to compute comparisons, as the file can be simply divided according to the categories of the fields being used for blocking. In many cases no field may be completely trusted, and therefore blocking may lead to miss truly coreferent pairs. We can, however, exploit prior knowledge on the types of errors expected for the different fields. By understanding what kind of errors would be unlikely for a certain field, we can declare as noncoreferent any pair of records that disagrees by more than a predefined threshold with respect to the field in consideration. Ideally, this comparison should be cheap to compute, since it will be checked for all record pairs. For example, information on time events for individuals, such as date of birth or date of death, is misreported in certain contexts, but it is common that whenever the correct date is not recorded, the date that appears in the record is somehow close to the true one. In this example, two records containing dates that are very different could be declared as noncoreferent. Other fields that can be used in this fashion include age or geographic information, given that in many contexts it is unlikely to find coreferent pairs among records that report very different ages or distant locations. Naturally, the validity of any of these approaches has to be assessed on a case-by-case basis. Ideally after applying one of the previous steps, or a combination of them, the set of pairs is reduced to a manageable size for which complete comparisons can be computed, as explained in Section~\ref{ss:compdata}. Computationally expensive comparisons, such as those involving string metrics, should be reserved for this stage. We call $\mathcal{P}$ the set of pairs for which complete comparisons are computed. The comparison data for the pairs in $\mathcal{P}$ comprises the information that we will use to estimate the partition of the file. Within $\mathcal{P}$, however, many pairs may still be obvious noncoreferent pairs that can be detected using combinations of the different levels of disagreement.\vadjust{\goodbreak} Therefore, we can further reduce the complexity of the inferential task by declaring record pairs as noncoreferent whenever they strongly disagree according to some user-defined criteria built using the computed levels of disagreement. For instance, criteria for declaring a pair as noncoreferent could be having strong disagreements in given and family names, or having strong disagreements in a combination of fields such as age, race and occupation, if they were available. Finally, if a pair of records meet any of the established criteria, then it is declared as noncoreferent. The reasoning behind this approach is that, although no single field may be enough to distinguish further noncoreferent records, strong disagreements in a combination of fields are probably a good indication of the records being noncoreferent, and therefore we would expect this approach to be robust to errors. The set of remaining pairs whose coreference statuses are still unknown is denoted by~$\mathcal{C}$, and we refer to it as the set of candidate pairs. Although we fix the pairs in $\mathcal{P}-\mathcal{C}$ as noncoreferent, we use their comparison data in the model presented in the next section, since those pairs provide examples of noncoreferent records. The possible coreference partition of the file is now constrained to the set $\mathcal{D}=\{\bD\dvtx \Delta_{ij}=0, \ \forall (i,j)\notin \mathcal{C}\}$, that is, the set of partitions that do not group together the record pairs that have already been declared as noncoreferent. In practice, $\mathcal{D}$ is much smaller than the set of all possible partitions of the file, which is why we heavily rely on being able to have a small set of candidate pairs $\mathcal{C}$ to apply our method to medium or large size data files. \subsection{Model description}\label{ss:GeneralModel} We now present a model for the comparison data $\bg= \{\bg_{ij}\} _{(i,j)\in\mathcal{P}}$ such that the distribution of the comparison vectors depends on whether the pairs are coreferent or not, which will allow us to estimate the coreference partition. Notice that we model all the pairs in $\mathcal{P}$ even though those in $\mathcal {P}-\mathcal{C}$ are fixed as noncoreferent. We assume that the comparison vector $\bg_{ij}$ is a realization of a random vector $\bG_{ij}$, and the comparison data $\bg$ are a realization of a random array $\bG$. It is clear that the set of record pairs is composed of two types: coreferent and noncoreferent pairs. Furthermore, we expect the distribution of the comparison vectors $\bG _{ij}$ to be very different among those two types. For example, we expect to observe more agreements among coreferent pairs than among noncoreferent pairs and, similarly, we expect many more disagreements among noncoreferent pairs than among coreferent pairs. This intuition can be formalized by assuming that the distribution of $\bG_{ij}$ is the same for all record pairs that refer to the \emph{same} entity (regardless of the entity), and that the distribution of $\bG_{ij}$ is the same for all record pairs that refer to \emph{different} entities (regardless of the pair of entities). These assumptions have been widely employed for linking different data files under the Fellegi--Sunter framework for record linkage [\citet{FellegiSunter69,Winkler88,LarsenRubin01,HerzogScheurenWinkler07}]. The intuitive description above can be formalized into a model for the comparison data as \begin{eqnarray} \label{eq:model1} \bG_{ij}|\Delta_{ij}&=&1\stackrel{\mathrm{i.i.d.}} { \sim} G_1, \nonumber \\[-8pt] \\[-8pt] \nonumber \bG_{ij}|\Delta_{ij}&=&0\stackrel{\mathrm{i.i.d.}} {\sim} G_0, \end{eqnarray} for all $(i,j)\in\mathcal{P}$, where $G_1$ and $G_0$ represent the models of the comparison vectors for pairs that are coreferent and noncoreferent, respectively. These models have to be specified according to the comparison data at hand. Leaving $G_1$ and $G_0$ unspecified by now, we can see that for a configuration of the coreference matrix~$\bD$, the joint probability of observing the comparison data $\bg$ can be written as \begin{eqnarray}\label{eq:PG_D} &&\mathbb{P}(\bG= \bg| \bD, \Phi) \nonumber \\[-8pt] \\[-8pt] \nonumber &&\qquad= \prod_{(i,j)\in\mathcal{C}} \mathbb {P}_1(\bg_{ij}|\Phi_1)^{\Delta_{ij}} \mathbb{P}_0(\bg_{ij}|\Phi _0)^{1-\Delta_{ij}} \prod_{(i,j)\in\mathcal{P}-\mathcal{C}} \mathbb {P}_0( \bg_{ij}|\Phi_0), \end{eqnarray} where $\mathbb{P}_1(\bg_{ij}|\Phi_1):=\mathbb{P}(\bG_{ij}=\bg _{ij}|\Delta_{ij}=1,\Phi_1)$ and, similarly, $\mathbb{P}_0(\bg_{ij}|\Phi _0):=\mathbb{P}(\bG_{ij}=\bg_{ij}|\Delta_{ij}=0,\Phi_0)$, with $\Phi =(\Phi_1,\Phi_0)$ representing a parameter vector of the models $G_1$ and $G_0$. Notice that equation \eqref{eq:PG_D} is obtained given that we fix $\Delta_{ij}=0$ for those pairs in $\mathcal{P}-\mathcal{C}$. Also, although the posterior on $\bD$ does not depend directly on the comparison data for pairs in $\mathcal{P}-\mathcal{C}$, it does depend on $\Phi_0$, which in turn depends on those pairs in $\mathcal {P}-\mathcal{C}$. In fact, the previous formulation is equivalent to a model for only the candidate pairs $\mathcal{C}$, as long as the factor $\prod_{(i,j)\in\mathcal{P}-\mathcal{C}} \mathbb{P}_0(\bg_{ij}|\Phi_0)$ gets incorporated in the prior for $\Phi_0$. \subsection{Prior distribution on the coreference partition}\label {ss:PriorCorefMatrix} Since the coreference matrix $\bD$ represents a partition, the entries of $\bD$ are not independent, for example, if $\Delta_{ij}=1$ and $\Delta_{jk}=1$, then $\Delta_{ik}=1$. In a mixture model implementation of the model presented in equations \eqref{eq:model1} and \eqref{eq:PG_D}, the $\Delta_{ij}$'s ($i<j$) are taken as i.i.d. Bernoulli($p$), where $p$ represents the proportion of coreferent pairs [\citet{Elmagarmidetal07,Sariyaretal09,SariyarBorg10,ChristenBook}]. The independence assumption of the $\Delta_{ij}$'s in a mixture model approach to duplicate detection leads to nontransitive decisions on the coreference statuses of record pairs. To avoid these undesirable results, we treat $\bD$ as a partition and put a prior distribution on it accordingly. As we showed before, $\mathcal{D}$ denotes the set of possible coreference partitions. In this article we use the prior that assigns equal probability to each partition in $\mathcal{D}$. This flat prior is such that $\pi(\bD)\propto I(\bD\in\mathcal{D})$. We can also obtain this prior in terms of the partition labelings introduced in Section~\ref{ss:representations}. The set $\mathcal{D}$ is equivalent to the set of labelings $\mathcal{Z}=\{\bZ\dvtx Z_i\neq Z_j,\ \forall (i,j)\notin\mathcal{C}\} $. A simple way to obtain the flat prior for $\bD$ from a prior for $\bZ $ is by assigning equal probability to each of the $r!/(r-n)!$ labelings of a partition with $n$ cells, which leads to the prior on labelings $\pi(\bZ)\propto[(r-n(\bZ))!/r!]I(\bZ\in\mathcal{Z})$, where $n(\bZ)$ measures the number of different labels in labeling $\bZ$. Notice that in some situations it may be desired to use a more structured prior on partitions, for example, if the researcher has a prior idea about the percentage of duplicates. How to appropriately incorporate this information requires further investigation, since commonly used distributions on partitions encourage the formation of large cells as they are designed for traditional clustering problems [see, e.g., the Dirichlet-Multinomial model for partitions in \citet{Keeneretal87,McCullagh11}], but in duplicate detection we rather expect the coreference partition to be composed by small cells. \subsection{Missing comparisons} The model presented in Section~\ref{ss:GeneralModel} was described assuming that the $F$ different comparison criteria were available for each pair of records. In practice, however, it is rather common to find records with missing fields of information, which lead to missing comparisons for the corresponding record pairs. If a certain field is missing for record $i$, and this field is being used to compute comparison data, then the vector $\bg_{ij}$, $j\neq i$, will be incomplete, regardless of whether the field is missing for record $j$. In order to deal with this common situation, we assume that the missing comparisons occur at random [MAR assumption in \citet{LittleRubin02}], and therefore we can base our inferences on the marginal distribution of the observed comparisons [\citet{LittleRubin02}, page 90]. The complete array of comparisons $\bG $ can be decomposed into observed $\bG^{\mathrm{obs}}$ and missing $\bG^{\mathrm{mis}}$ comparisons; similarly, for each record pair $\bG_{ij}=(\bG ^{\mathrm{obs}}_{ij},\bG^{\mathrm{mis}}_{ij})$. From equation \eqref{eq:PG_D}, summing over the possible missing comparison patterns, it is easy to see that the probabilities involving $\bG^{\mathrm{obs}}$ can be computed as \begin{eqnarray} \label{eq:PGobs_D}&& \mathbb{P} \bigl(\bG^{\mathrm{obs}} = \bg^{\mathrm{obs}}| \bD, \Phi \bigr) \nonumber \\[-8pt] \\[-8pt] \nonumber &&\qquad= \prod_{(i,j)\in\mathcal{C}} \mathbb{P}_1 \bigl( \bg_{ij}^{\mathrm{obs}}|\Phi _1 \bigr)^{\Delta_{ij}} \mathbb{P}_0 \bigl(\bg_{ij}^{\mathrm{obs}}|\Phi_0 \bigr)^{1-\Delta _{ij}}\prod_{(i,j)\in\mathcal{P}-\mathcal{C}} \mathbb{P}_0 \bigl(\bg _{ij}^{\mathrm{obs}}| \Phi_0 \bigr), \end{eqnarray} where \begin{equation} \label{eq:P1obs} \mathbb{P}_1 \bigl(\bg^{\mathrm{obs}}_{ij}| \Phi_1 \bigr)=\sum_{\bg^{\mathrm{mis}}_{ij}}\mathbb {P}_1 \bigl(\bg^{\mathrm{obs}}_{ij},\bg^{\mathrm{mis}}_{ij}| \Phi_1 \bigr), \end{equation} and we obtain an analogous expression for $\mathbb{P}_0(\bg ^{\mathrm{obs}}_{ij}|\Phi_0)$. Notice that equation \eqref{eq:PG_D} is a particular case of equation \eqref{eq:PGobs_D} arising when all the comparisons are complete for each record pair. In Section~\ref{s:modelindepcomps} we present a simple model under which this approach leads to a straightforward treatment of missing comparisons. Finally, we notice that equation \eqref{eq:PGobs_D} can be rewritten in terms of partition\vadjust{\goodbreak} labelings as \begin{eqnarray} \label{eq:PGobs_Z}&& \mathbb{P} \bigl(\bg^{\mathrm{obs}}| \bZ, \Phi \bigr) \nonumber\\ &&\qquad= \prod _{(i,j)\in\mathcal{C}} \mathbb{P}_1 \bigl( \bg_{ij}^{\mathrm{obs}}|\Phi _1 \bigr)^{I(Z_i=Z_j)} \mathbb{P}_0 \bigl(\bg_{ij}^{\mathrm{obs}}|\Phi_0 \bigr)^{I(Z_i\neq Z_j)}\\ &&\qquad\quad{}\times\prod_{(i,j)\in\mathcal{P}-\mathcal{C}} \mathbb{P}_0 \bigl(\bg _{ij}^{\mathrm{obs}}| \Phi_0 \bigr).\nonumber \end{eqnarray} \subsection{Conditional interpretation of the model} Let us think about the hypothetical scenario where we know the coreference partition for all the records except for the $i$th one. In this case we are interested in finding the probabilities that record $i$ refers to the different $r$ potential entities given the comparison data, the model parameters and the partition memberships of the remaining records, represented by an arbitrary labeling $\bZ^{(-i)}$. Using the prior for $\bZ$ presented in Section~\ref{ss:PriorCorefMatrix}, regardless of the parametrization used for $G_1$ and $G_0$, one can show that the probability that $i$ refers to potential entity $q$ is given by \begin{eqnarray} \label{eq:conditional}&& \mathbb{P} \bigl(Z_{i}=q | \bZ^{(-i)}, \bg^{\mathrm{obs}}, \Phi \bigr) \nonumber \\[-8pt] \\[-8pt] \nonumber &&\qquad\propto \cases{ \displaystyle\prod _{j \dvtx Z_j=q} I \bigl({(i,j)\in\mathcal{C}} \bigr) \biggl[\frac{\mathbb{P}_1(\bg^{\mathrm{obs}}_{ij}|\Phi_1)}{\mathbb{P}_0(\bg ^{\mathrm{obs}}_{ij}|\Phi_0)} \biggr], \vspace*{2pt}\cr \qquad \mbox{if $q$ labels a partition cell according to $\bZ^{(-i)}$;} \vspace*{2pt}\cr \bigl(r-n \bigl(\bZ^{(-i)} \bigr) \bigr)^{-1},\vspace*{2pt}\cr \qquad\mbox{otherwise.}} \end{eqnarray} This expression has a simple interpretation. The ratio within square brackets in the right-hand side of equation \eqref{eq:conditional} represents the likelihood ratio for testing the hypothesis ``\emph {records $i$ and $j$ are coreferent}'' versus ``\emph{records $i$ and $j$ are not coreferent},'' using the observed comparison vector $\bg _{ij}^{\mathrm{obs}}$. If $q$ is a label in $\bZ^{(-i)}$, then the probability that $i$ refers to entity $q$ is the product of the likelihood ratios for all records that refer to entity $q$ according to $\bZ^{(-i)}$ (all records $j$ such that $Z_j=q$), which is a measure of how likely record $i$ is to be coreferent with the group of records in cell $q$. However, if there is a record $j$ such that $Z_j=q$, but $(i,j)\notin\mathcal {C}$, that is, $(i,j)$ was fixed as noncoreferent, then $\mathbb {P}(Z_{i}=q | \bZ^{(-i)}, \bg^{\mathrm{obs}}, \Phi)=0$. Finally, if $q$ is a label not in use, then record $i$ takes this label with probability inversely proportional to the number of unused labels, which is equivalent to saying that record $i$ gets its own label with probability proportional to one, and the specific label is chosen uniformly at random among the $r-n(\bZ^{(-i)})$ labels not in use. Without being exhaustive, equation \eqref{eq:conditional} states that if for all partition cells the products of likelihood ratios are much smaller than one, then record $i$ will assume its own label with high probability, but if there is a cell partition for which we obtain a product of likelihood ratios much larger than one, then it is likely that record $i$ gets assigned to that cell. Equation \eqref {eq:conditional} is used in the supplementary material [\citet{SadinleAOASSupplement}] to derive a Gibbs sampler for the model presented in the next section. \section{A model for independent comparison fields}\label{s:modelindepcomps} In this section we describe a simple parametrization for $G_1$ and $G_0$, which represent the distributions of the comparison vectors among coreferent and noncoreferent pairs, respectively. Our model assumes that the comparison fields are independent for both coreferent and noncoreferent records. If comparison $\Gamma^f_{ij}$ takes $L_f+1$ values corresponding to levels of disagreement, its distribution among coreferent records can be modeled according to a multinomial distribution, this is \begin{equation} \label{eq:compdataMnom} \mathbb{P}_1 \bigl(\Gamma^f_{ij}= \gamma^f_{ij}|\bmm_f \bigr)= \prod _{l=0}^{L_f} \bigl(m_{fl}^{*} \bigr)^{I(\gamma^f_{ij}=l)}, \end{equation} where $\gamma^f_{ij}$ represents an observed level of disagreement, $m_{fl}^{*}=\mathbb{P}_1(\Gamma^f_{ij}=l)$, and $\sum_{l=0}^{L_f}m_{fl}^{*}=1$. It is easy to show that these probabilities can be rewritten as \[ m_{fl}^{*}=\cases{ m_{f0}, &\quad $\mbox{if } l=0;$ \vspace*{2pt}\cr \displaystyle m_{fl}\prod_{h<l} (1-m_{fh}), &\quad $\mbox{if } 0<l<L_f;$ \vspace*{2pt}\cr \displaystyle \prod_{h<L_f} (1-m_{fh}), &\quad $\mbox{if } l=L_f;$} \] where $m_{f0}=\mathbb{P}_1(\Gamma^f_{ij}=0)$, and $m_{fl}=\mathbb {P}_1(\Gamma^f_{ij}=l|\Gamma^f_{ij}>l-1)$ for $0<l<L_f$. We choose to parameterize $G_1$ in terms of the sequential conditional probabilities $m_{fl}$ since this facilitates prior specification, as we show in Section~\ref{ss:priorPhi}. Using this parametrization, equation \eqref {eq:compdataMnom} can be reexpressed as \[ \mathbb{P}_1 \bigl(\bG^f_{ij}= \bg^f_{ij}|\bmm_f \bigr) = \prod _{l=0}^{L_f-1} m_{fl}^{I(\gamma^{f}_{ij}=l)}(1-m_{fl})^{I(\gamma ^{f}_{ij}>l)}, \] where $\bmm_f=(m_{f0},\ldots,m_{f,L_f-1})$. Following an analogous construction of the distribution of $\Gamma^f_{ij}$ among noncoreferent pairs, we obtain \[ \mathbb{P}_0 \bigl(\bG^f_{ij}= \bg^f_{ij}|\bu_f \bigr) = \prod _{l=0}^{L_f-1} u_{fl}^{I(\gamma^{f}_{ij}=l)}(1-u_{fl})^{I(\gamma^{f}_{ij}>l)}, \] where\vspace*{1pt} $u_{f0}=\mathbb{P}_0(\Gamma^f_{ij}=0)$, $u_{fl}=\mathbb {P}_0(\Gamma^f_{ij}=l|\Gamma^f_{ij}>l-1)$ for $0<l<L_f$, and $\bu _f=(u_{f0},\ldots,u_{f,L_f-1})$. Notice that if $L_f=1$, that is, if comparison $f$ is binary, we obtain the traditional model used in record linkage for binary comparisons [e.g., \citet{Winkler88,Jaro89}]. \subsection{Missing comparisons and conditional independence} The assumptions of the comparison fields being conditionally independent (CI), along with being missing at random (MAR), make it straightforward to deal with missing comparisons. In fact, under these assumptions, equation \eqref{eq:P1obs} can be written as \begin{equation} \label{eq:P1missing} \mathbb{P}_1 \bigl(\bg^{\mathrm{obs}}_{ij}| \Phi_1 \bigr) = \prod_{f=1}^{F} \Biggl[\prod_{l=0}^{L_f-1} m_{fl}^{I(\gamma ^{f}_{ij}=l)}(1-m_{fl})^{I(\gamma^{f}_{ij}>l)} \Biggr]^{I_{\mathrm{obs}}(\gamma_{ij}^f)}, \end{equation} where $I_{\mathrm{obs}}(\cdot)$ is one if its argument is observed, and zero if it is missing, and $\Phi_1=(\bmm_1,\ldots,\bmm_F)$. Similarly, \begin{equation} \label{eq:P0missing} \mathbb{P}_0 \bigl(\bg^{\mathrm{obs}}_{ij}| \Phi_0 \bigr) = \prod_{f=1}^{F} \Biggl[\prod_{l=0}^{L_f-1} u_{fl}^{I(\gamma ^{f}_{ij}=l)}(1-u_{fl})^{I(\gamma^{f}_{ij}>l)} \Biggr]^{I_{\mathrm{obs}}(\gamma_{ij}^f)}, \end{equation} where $\Phi_0=(\bu_1,\ldots,\bu_F)$. Equations \eqref{eq:P1missing} and \eqref{eq:P0missing} indicate that the combination of the CI and MAR assumptions allow us to ignore the comparisons that are not observed and yet model the observed comparisons in a simple fashion. Under the CI assumption we can write the likelihood for $\bZ$ and $\Phi $ as \[ \mathcal{L}(\bZ,\Phi|\bg_{\mathrm{obs}}) = \prod_{f=1}^F \mathcal{L} \bigl(\bZ,\Phi _f|\bg^{f}_{\mathrm{obs}} \bigr), \] where $\Phi_f = (\bmm_f, \bu_f)$, and \[ \mathcal{L} \bigl(\bZ,\Phi_f|\bg^{f}_{\mathrm{obs}} \bigr) = \prod_{l=0}^{L_f-1} m_{fl}^{a^1_{fl}(\bZ)}(1-m_{fl})^{\sum_{h>l} a^1_{fh}(\bZ)}u_{fl}^{a^0_{fl}(\bZ)}(1-u_{fl})^{\sum_{h>l}a^0_{fh}(\bZ)}, \] where \begin{eqnarray*} a^1_{fl}(\bZ) &=& \sum_{(i,j)\in\mathcal{C}}I_{\mathrm{obs}} \bigl(\bg_{ij}^f \bigr)I \bigl(\gamma _{ij}^{f}=l \bigr)I(Z_i=Z_j), \\ a^0_{fl}(\bZ) &=&\sum_{(i,j)\in\mathcal{C}}I_{\mathrm{obs}} \bigl(\bg_{ij}^f \bigr)I \bigl(\gamma _{ij}^{f}=l \bigr)I(Z_i\neq Z_j)+\sum_{(i,j)\in\mathcal{P}-\mathcal {C}}I_{\mathrm{obs}} \bigl(\bg_{ij}^f \bigr)I \bigl(\gamma_{ij}^{f}=l \bigr). \end{eqnarray*} For a given matrix of memberships $\bZ$, $a^1_{fl}(\bZ)$ and $a^0_{fl}(\bZ)$ represent the number of coreferent and noncoreferent records disagreeing at level $l$ for observed comparison $f$. Although our main interest is to make inferences on the coreference matrix $\bD$, a fully Bayesian approach requires the specification of priors for the parameters $\Phi$ as well. \subsection{Prior specification for the model parameters}\label{ss:priorPhi} We now explain our selection of the priors for $m_{fl}$ and $u_{fl}$, $l=0,\ldots,L_f-1$. The first parameter that we focus on is $m_{f0}=\mathbb{P}_1(\Gamma^f_{ij}=0)$, which represents the probability of observing the level zero of disagreement in the comparison $f$ among coreferent records. This level represents no disagreement or a high degree of agreement, so if we believe that field $f$ contains no error, $m_{f0}$ should be, a priori, a point mass at one, but as the error in field $f$ increases, the mass of $m_{f0}$'s prior should move away from one. We therefore take a priori $m_{f0}$ to be in some interval $[\lambda_{f0},1]$ with probability one, for some $0<\lambda_{f0}<1$. If we believe that the field used to compute comparison $f$ is fairly accurate, then we should set the threshold $\lambda_{f0}$ to be close to one. On the other hand, the more errors we believe a field contains, the lower the value for $\lambda_{f0}$ that we should set. The prior distribution for $m_{f0}$ can be taken in general as Beta$(\alpha_{f0}^1,\beta_{f0}^1)$, truncated to the interval $[\lambda_{f0},1]$, which we denote as $\operatorname{TBeta}(\alpha _{f0}^1,\beta_{f0}^1,\lambda_{f0},1)$. The parameter $m_{f1}=\mathbb{P}_1(\Gamma^f_{ij}=1|\Gamma^f_{ij}>0)$ represents the probability of observing level one of disagreement in the comparison $f$, among coreferent record pairs with disagreement larger than the one captured by the level zero. Depending on the construction of the disagreement levels, and if the number of levels is greater than two, we can think of level one of disagreement as some mild disagreement and, therefore, if we expect the amount of error to be relatively small, $m_{f1}$ should be concentrated around values close to one. Following a similar reasoning as for $m_{f0}$, we take the prior of $m_{f1}$ as $\operatorname{TBeta}(\alpha_{f1}^1,\beta _{f1}^1,\lambda_{f1},1)$, where we can set the hyperparameters of this distribution, especially $\lambda_{f1}$, according to the amount of error that we expect field $f$ to contain. We can continue the previous reasoning to specify the prior distribution of the remaining parameters $m_{fl}=\mathbb{P}_1(\Gamma ^f_{ij}=l|\Gamma^f_{ij}>l-1)$, $l=2,\ldots,L_f-1$. In general, we can take the prior of $m_{fl}$ as $\operatorname{TBeta}(\alpha_{fl}^1,\beta _{fl}^1,\lambda_{fl},1)$, where the truncation points $\lambda_{fl}$ change according to the way the disagreement levels were constructed and the amount of error expected a priori in each field. Notice, however, that if we believe that a field may be too erroneous, it may be better to exclude it from the duplicate detection process since its inclusion can potentially harm the results [\citet{SadinleFienberg13} explore this issue in the multiple record linkage context]. For simplicity, in this article we set $\alpha_{fl}^1=\beta_{fl}^1=1$, for all fields $f$ and levels~$l$, that is, we take $m_{fl}\sim\operatorname {Uniform}(\lambda_{fl},1)$, and so we only need to choose the $\lambda_{fl}$'s. The probabilities $u_{fl}=\mathbb{P}_0(\Gamma^f_{ij}=l|\Gamma ^f_{ij}>l-1)$ among noncoreferent records may have quite different distributions depending on the fields used to compute the comparisons. For instance, if a nominal field contains a highly frequent category, then the probability of agreement will be high even for noncoreferent records. On the other hand, if a field is almost a unique identifier of the entities, then the probability of agreement will be small among noncoreferent records. We therefore simply take $u_{fl}\sim\operatorname {Uniform}(0,1)$ for all fields and levels of disagreement, although in general we could take $u_{fl}\sim\operatorname{Beta}(\alpha_{fl}^0,\beta _{fl}^0)$, for some hyperparameters $\alpha_{fl}^0$ and $\beta_{fl}^0$ if prior information was available. \subsection{Bayesian inference via Gibbs sampler}\label{ss:Gibbs} In the supplementary material [\citet{SadinleAOASSupplement}] we present a Gibbs sampler to explore the joint posterior of $\bZ$ and $\Phi$ given the observed comparison data $\bg_{\mathrm{obs}}$, for the likelihood obtained from equations \eqref{eq:PGobs_Z}, \eqref{eq:P1missing} and \eqref{eq:P0missing}, and the priors presented in the previous subsection. The supplementary material also contains a brief discussion on point estimation of the coreference partition. \begin{table} \caption{Illustrative example: Different sets of records may be considered as coreferent in different contexts}\label{t:toyexample} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccccc@{}} \hline \textbf{Record} & \textbf{Given name} & \textbf{Family name} & \textbf{Year} & \textbf{Month} & \textbf{Day} & \textbf{Municipality} \\ \hline 1. & JOSE & FLORES & 1981 & 1 & 29 & A \\ 2. & JOSE & FLORES & 1981 & 2 & NA & A \\ 3. & JOSE & FLORES & 1981 & 3 & 20 & A \\ 4. & JULIAN ANDRES & RAMOS ROJAS & 1986 & 8 & \phantom{0}5 & B \\ 5. & JILIAM & RMAOS & 1986 & 8 & \phantom{0}5 & B \\ \hline \end{tabular*} \end{table} \subsection{An illustrative example}\label{ss:toyexample} Table~\ref{t:toyexample} presents a small example to illustrate different situations where different sets of records may be considered as coreferent depending on how reliable we believe the fields are. We explore the results of our duplicate detection method under different scenarios where these data could have arisen, which is why we do not yet specify what the fields year, month, day, and municipality refer to. This example was inspired by the data file that we study in Section~\ref{s:UNTRCapplication}, where we have to compare Hispanic names. Full Hispanic names are usually composed by four pieces, two corresponding to given name and two to family name. In practice, however, Hispanic people do not always use their full given and family names. For example, someone whose full given name is \textit{JULIAN ANDRES} may be simply known as \textit{JULIAN} or as \textit{ANDRES} in his social circle. This phenomenon makes it particularly challenging to compare Hispanic names, for example, it has been reported to cause problems when tracking citations of Hispanic authors [\citet{RuizPerezetal02,FernandezGarcia03}]. Records 1, 2 and 3 in Table~\ref{t:toyexample} represent an example where pairwise decisions on the coreference statuses of record pairs may not be transitive. In this example, records 1, 2 and 3 agree in all the fields except for month and day. Records 1 and 2 disagree by one month, as well as records 2 and 3, but the comparison for the field day for those two pairs is missing. Notice also that records 1 and 3 disagree by two months and have a strong disagreement in the field day. In this situation, a~method taking pairwise decisions, or even a human taking decisions for one pair of records at a time, may decide that records 1 and 2 are coreferent, as well as records 2 and 3, since those pairs are fairly similar, but may decide that records 1 and 3 are not coreferent, since this pair has more disagreements. Table~\ref{t:toyexample} also presents records 4 and 5, which agree in all of their information, except for given and family name. Record 5 could refer to the same person as record 4, since this name is simply missing the second pieces of given and family name, which is common for Hispanic names, and the remaining disagreements could be typographical errors. The decision of whether to declare records 4 and 5 as coreferent will depend on the levels of error that we believe the fields given and family name may contain. Below we show how the proposed method deals with the uncertainty of these situations under different scenarios. Let us think of two different scenarios from where the records in Table~\ref{t:toyexample} could have arisen. In the first scenario, inspired by the application presented in Section~\ref{s:UNTRCapplication}, each record refers to a person who was killed during a war, and the data were reported by witnesses many years after the events occurred. In this scenario, year, month, day and municipality correspond to the date and location of the killing as reported by the witnesses. Under this scenario we expect to have reporting errors in the names of the victim and in the date and place of the killings, since different witnesses may have different memories of the victims and the events. In the second scenario, the records in Table~\ref{t:toyexample} come from tax forms, and the information was self-reported. In this case, year, month, day and municipality correspond to date and place of birth. In this case we may expect the levels of error in all fields to be much smaller compared to the first scenario, since it is quite unlikely for one person to misreport her information, at least unintentionally. \begin{table} \caption{Construction of levels of disagreement for the example in Table \protect\ref{t:toyexample}}\label{t:toyexample_compdata} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccccc@{}} \hline & & \multicolumn{4}{c@{}}{\textbf{Levels of disagreement}}\\[-4pt] & & \multicolumn{4}{c@{}}{\hrulefill}\\ \textbf{Field} & \textbf{Similarity measure} & $\bolds{0}$ & $\bolds{1}$ & $\bolds{2}$ & \multicolumn{1}{c@{}}{$\bolds{3}$} \\ \hline Given name & Modified Levenshtein & 0 & $(0,0.25]$ & $(0.25,0.5]$ & $(0.5,1]$ \\ Family name & Modified Levenshtein & 0 & $(0,0.25]$ & $(0.25,0.5]$ & $(0.5,1]$ \\ Year & Absolute difference & 0 & 1 & 2--3 & $4+$ \\ Month & Absolute difference & 0 & 1 & 2--3 & $4+$ \\ Day & Absolute difference & 0 & 1--2 & 3--7 & $8+$ \\ Municipality & Binary comparison & Agree & Disagree &&\\ \hline \end{tabular*} \end{table} In Table~\ref{t:toyexample_compdata} we show a summary of how we construct disagreement levels in this example. We compare all the record pairs since there are only 10 of them and use a modification of the \emph{Levenshtein edit distance} to compare names. The Levenshtein edit distance between two strings is the minimum number of deletions, insertions or replacements that we need to transform one string into the other. The modification that we use simply accounts for the fact that Hispanic names may have missing pieces. Basically, if name $V$ contains one token and name $W$ contains two tokens, we take the minimum of the Levenshtein distances between the token of name $V$ and each token of name $W$ and, finally, we transform this measure to the 0--1 interval. In this scale, 0 means total agreement (up to missing tokens) and 1 means extreme disagreement. We refer the reader to the supplementary material [\citet{SadinleAOASSupplement}] for details on our comparisons of Hispanic names. The intervals that we choose to construct the disagreement levels (except for municipality) correspond to what we consider as no disagreement, mild disagreement, moderate disagreement and extreme disagreement. In this example the field municipality is taken as a nominal variable, and so we compare it in a binary fashion. To implement the proposed method for duplicate detection, we need to choose the prior truncation points of the parameters $m_{fl}$. For the sake of simplicity, we suppose that our prior beliefs about each field of information can be classified in two categories: either the field is nearly accurate or it is inaccurate. If field $f$ is nearly accurate, we take the prior truncation points for all the parameters related to this field (all $m_{fl}$, $l=0,\ldots,L_f-1$) as 0.95, whereas if field $f$ is inaccurate, these prior truncation points are set to 0.85. For simplicity, we fix the prior truncation points for year and municipality parameters at 0.95 for all of the data collection scenarios presented here. For the remaining parameters, in the war scenario we expect the fields to contain considerable amounts of error, and so the prior truncation points for those parameters are set equal to 0.85 (case 1 of Figure~\ref{f:pp}); for the taxes scenario the prior truncation points are set equal to 0.95 since a priori we expect errors to be rare (case 4 of Figure~\ref{f:pp}). We also explore two intermediate cases that fall between the previous two extreme scenarios, where we consider day and month to be nearly accurate, but given and family names to be inaccurate (case 2 of Figure~\ref{f:pp}) and vice versa (case 3 of Figure~\ref{f:pp}). \begin{figure} \tabcolsep=0pt {\fontsize{9}{11}\selectfont{ \begin{tabular*}{\textwidth}{@{\extracolsep{4in minus 4in}}lccc@{}} \hline & \multicolumn{2}{c}{\textbf{Prior truncation points for} $\bolds{\{m_{fl}\}}$}&\\[-6pt] &\multicolumn{2}{c}{\rule{125pt}{0.5pt}}&\\ & \multicolumn{1}{c}{\textbf{Given and}} &\multicolumn{1}{c}{\textbf{Day and}}& \\ & \multicolumn{1}{c}{\textbf{family names}}&\multicolumn{1}{c}{\textbf{Month}}& \multicolumn{1}{c@{}}{\textbf{Posterior frequencies}}\\ \hline 1. & 0.85 & 0.85 & \includegraphics{779i01.eps} \\ 2. & 0.85 & 0.95 & \includegraphics{779i02.eps} \\ 3. & 0.95 & 0.85 & \includegraphics{779i03.eps} \\ 4. & 0.95 & 0.95 & \includegraphics{779i04.eps} \\[3pt] \multicolumn{3}{@{}c}{Coreference matrices} &\multicolumn{1}{l}{ \includegraphics{779i05.eps} }\\[2pt] \hline \end{tabular*}}} \caption{Posterior distributions of the coreference partition for the records in Table~\protect\ref{t:toyexample}, for different sets of priors corresponding to different contexts. Prior truncation points for Year and Municipality parameters are set at 0.95 for all cases. Posterior frequencies are obtained from 9000 iterations of a Gibbs sampler. The eight partitions presented here concentrate 100\% of the posterior frequencies in each case. The coreference matrices depicted here have black entries representing ones and white entries representing zeroes. }\label{f:pp} \end{figure} For each set of priors we run 10,000 iterations of the Gibbs sampler presented in the supplementary material [\citet{SadinleAOASSupplement}], and in each case we discard 1000 iterations as burn-in. Figure~\ref{f:pp} presents the posterior frequencies of the eight partitions that appear in the posterior samples. Although a file with five records can be partitioned in 52 ways (the 5th Bell number), the eight partitions presented in Figure~\ref{f:pp} concentrate 100\% of the posterior frequencies in each case. From Figure~\ref{f:pp} we can see that for case 1, that is, when given and family names, and day and month are inaccurate, the posterior distribution is mostly concentrated in partition $1,2,3/4,5$, that is, records 1, 2 and 3 are assigned to one entity and records 4 and 5 to another; this result is coherent with our priors, which indicated that the fields were potentially inaccurate, and therefore the disagreements between fields are not taken as strong evidence of the records being noncoreferent. In case 2, given and family names are thought to be inaccurate, whereas day and month are considered to be fairly accurate; in this case the strong disagreements between records 1 and 3 become important evidence of them not being coreferent, but since record pairs 1 and 2, and 2 and 3 are quite similar, the partitions $1,2/3/4,5$ and $1/2,3/4,5$ get equal posterior probability. In case 3, we present a scenario where day and month are thought to be inaccurate, but given and family names are believed to be accurate, and therefore the posterior gets almost completely concentrated in the partition $1,2,3/4/5,$ that is, compared to case 1, disagreements in given and family names become more important for distinguishing noncoreferent records, and therefore records 4 and 5 are probably noncoreferent. Finally, in case 4, all the fields are considered as accurate, and therefore the partitions where records 4 and 5 are coreferent become unlikely a posteriori, as well as the partitions where records 1 and 3 are clustered together. Since records 1 and 2 are quite similar, as well as records 2 and 3, but records 1 and 3 have strong disagreements, the posterior assigns equal probability to the partitions $1,2/3/4/5$ and $1/2,3/4/5,$ which accounts properly for the uncertainty of deciding whether records 1 and 2, or records 2 and 3 are coreferent. Finally, it is important to emphasize that although in this example it seems that the priors of the $m_{fl}$ parameters completely determine the posterior of $\bD$, both the $m_{fl}$ and $u_{fl}$ parameters influence the evolution of the memberships $\bZ$ in the Gibbs sampler (see the supplementary material [\citet{SadinleAOASSupplement}]). In particular, if these five records were contained in a larger file,\vadjust{\goodbreak} the resolution of their coreference statuses would depend on the distribution of the comparison data for the complete file, since, for instance, the distributions of the $u_{fl}$ parameters are heavily influenced by the observed frequencies of the corresponding levels of disagreement. \subsection{A simulation study}\label{ss:simAustralia} We now present a simulation study to explore the performance of the proposed methodology under different scenarios of measurement error. Peter Christen and his collaborators [\citet{Christen05,ChristenPudjijono09,ChristenVatsalan13}] developed a sophisticated data generation and corruption tool to create synthetic data sets containing various types of fields. This tool, written in Python, can include dependencies between fields, permits the generation of different types of errors, and can be easily adapted to generate additional fields that are not included in the default settings. We now describe the characteristics of the data files used in the simulation. We consider files having either five or seven fields of information. The synthetic files involving five fields include the following: gender, given name, family name, age, and occupation. The files with seven fields additionally include postal code and phone number. The fields gender and given name are sampled jointly from a table that contains frequencies of given names per gender, and therefore popular given names appear with higher probability in the synthetic data sets. Family name and postal codes are generated independently from additional frequency tables. The three tables mentioned so far were compiled by Christen and his collaborators using public sources from Australia. Phone numbers are randomly generated following the Australian format which consists of a two-digit area code and an eight-digit number made of two blocks of four digits. The previously described fields were included in the default configuration of Christen's generator. In addition, age and occupation are jointly sampled from a contingency table that serves as an estimate of the distribution of age and occupation in Australia. This table was obtained from the webpage of the Australian Bureau of Statistics, and it contains eight categories of occupation and eight age intervals. The generator first creates a number of original records which are later used to create distorted duplicates. The duplicates are allocated by randomly selecting an original record and assigning a random number of duplicates to it. The number of duplicates is generated according to a Poisson(1) truncated to the interval $[1, 5]$. Each duplicate has a fixed number of erroneous fields which are allocated uniformly at random, and each field contains maximum two errors. The types of errors are selected uniformly at random from a set of possibilities which vary from field to field, as summarized in Table~\ref{t:errors_simulationAustralia}. In this table, missing values means that the value of the field becomes missing; edit errors represent random insertions, deletions or substitutions of characters in the string; OCR errors happen typically when a document has been digitized using optical character recognition; keyboard errors use a keyboard layout to simulate typing errors; phonetic errors are simulated using a list of predefined phonetic rules; and finally, misspelling errors are generated by randomly selecting one of possibly many known misspellings of a family name. For further details on the generation of these types of errors, see \citet{ChristenPudjijono09} and \citet{ChristenVatsalan13}. \begin{table} \caption{Types of errors per field in the simulation study of Section \protect\ref{ss:simAustralia}}\label{t:errors_simulationAustralia} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccccc@{}} \hline & \multicolumn{6}{c@{}}{\textbf{Type of error}}\\[-4pt] & \multicolumn{6}{c@{}}{\hrulefill}\\ \textbf{Field} & \textbf{Missing values} & \textbf{Edits} & \textbf{OCR} & \textbf{Keyboard} & \textbf{Phonetic} & \textbf{Misspelling} \\ \hline Given name & & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark $ & \\ Family name & & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ \\ Age interval & $\checkmark$ & &&&& \\ Gender & $\checkmark$ & &&&& \\ Occupation & $\checkmark$ & &&&& \\[3pt] Phone number & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark $ && \\ Postal code & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark $ && \\ \hline \end{tabular*} \end{table} \begin{table}[b] \caption{Construction of levels of disagreement for the simulation study of Section \protect\ref{ss:simAustralia}}\label{t:simAustralia_compdata} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccccc@{}} \hline & & \multicolumn{4}{c@{}}{\textbf{Levels of disagreement}}\\[-4pt] & & \multicolumn{4}{c@{}}{\hrulefill}\\ \textbf{Field} & \textbf{Similarity measure} & $\bolds{0}$ & $\bolds{1}$ & $\bolds{2}$ & \multicolumn{1}{c@{}}{$\bolds{3}$} \\ \hline Given name & Levenshtein & 0 & $(0,0.25]$ & $(0.25,0.5]$ & $(0.5,1]$ \\ Family name & Levenshtein & 0 & $(0,0.25]$ & $(0.25,0.5]$ & $(0.5,1]$ \\ Age interval & Binary comparison & Agree & Disagree &&\\ Gender & Binary comparison & Agree & Disagree &&\\ Occupation & Binary comparison & Agree & Disagree &&\\[3pt] Phone number & Levenshtein & 0 & $(0,0.25]$ & $(0.25,0.5]$ & $(0.5,1]$ \\ Postal code & Levenshtein & 0 & $(0,0.25]$ & $(0.25,0.5]$ & $(0.5,1]$ \\ \hline \end{tabular*} \end{table} In the simulation presented here, each synthetic data set is composed of 450 original records and 50 duplicates. To explore the performance of the method as a function of the amount of error in the data file, we generate 100 five-field and 100 seven-field synthetic data sets for each of three levels of error, which correspond to the number of erroneous fields per duplicate being one, three and five. For each file, comparison data were created as indicated in Table~\ref{t:simAustralia_compdata}. For these files we model all pairs, so $|\mathcal{P}|={500\choose 2}$, and the record pairs having the level three of disagreement in either given or family name were fixed as noncoreferent, so these pairs constitute the set $\mathcal{P}-\mathcal {C}$, as explained in Section~\ref{ss:complexity}. Our model is then applied under three different sets of priors. For simplicity, each set of priors has the same prior truncation point for all the $m_{fl}$ parameters, although in practice the priors should be chosen carefully based on knowledge of the potential amounts of error in the file. The prior truncation points are 0.5, 0.8 and 0.95, which correspond to one scenario where we believe the amount of error in the file to be extremely large, one where we believe it to be moderate, and one where we are optimistic and believe the amount of error to be very limited. For each data set, and for each set of priors, we ran 10,000 iterations of the Gibbs sampler and discarded the first 1000 as burn-in. The average runtime using an implementation in R [\citet{R13}] with parts written in C language was of 24.5 seconds per file, including the computation of the comparison data, on a laptop with a 2.80 GHz processor. Before starting the complete simulation study, we obtained some longer chains for some data sets and for all priors, and we could check that 9000 iterations provided roughly the same frequencies of partitions as when we ran longer chains. For each data file, and each set of priors, we obtain a sample of partitions which approximate the posterior distribution of the coreference partition. We can assess how good each partition is in terms of classifying pairs of records as coreferent and noncoreferent. Two records $i$ and $j$ are coreferent according to a partition $\bD'$ if both belong to the same cell of the partition, that is, $\Delta _{ij}'=1$. Given $\bD'$ and the true partition $\bD^*$, let $b_{11}(\bD ',\bD^*)=\sum_{i<j}\Delta_{ij}'\Delta_{ij}^*$ be the number of record pairs that are coreferent in both partitions, and $b_{10}(\bD',\bD ^*)=\sum_{i<j}\Delta_{ij}'(1-\Delta_{ij}^*)$ and $b_{01}(\bD',\bD ^*)=\sum_{i<j}(1-\Delta_{ij}')\Delta_{ij}^*$ be the number of record pairs that are coreferent in one partition but not in the other. Given that $\bD^*$ is the true partition, the \emph{recall} of $\bD'$ is defined as $b_{11}(\bD',\bD^*)/ (b_{11}(\bD',\bD^*)+b_{01}(\bD',\bD ^*) )$, whereas the \emph{precision} of $\bD'$ is $b_{11}(\bD',\bD ^*)/ (b_{11}(\bD',\bD^*)+b_{10}(\bD',\bD^*) )$. The recall of a partition $\bD'$ measures the proportion of truly coreferent pairs that are classified correctly by $\bD'$, whereas the precision of $\bD '$ measures the proportion of pairs declared as coreferent by $\bD'$ that are truly coreferent. These two measures are preferred for evaluating performance in duplicate detection and record linkage problems, where the set of noncoreferent pairs is much bigger than the set of coreferent pairs, and therefore traditional measures of performance in classification, such as the misclassification rate and the true negative rate, are misleading [\citet{ChristenBook}, page 165]. The results of the simulation are presented in Figure~\ref{f:AustraliaSim}, where the rows of panels correspond to different number of fields and the columns to different priors. Notice that for each data set and each set of priors we obtain a distribution of recall and precision measures, since both of these measures are computed for each partition in the posterior sample. Therefore, we compute the median, the first and 99th percentile of each measure for each data set and each set of priors, and average over all the 100 results corresponding to each level of error, each number of fields and each prior. In each panel of Figure~\ref{f:AustraliaSim} black lines refer to recall, gray lines to precision, solid lines show average medians, and dashed lines show average first and 99th percentiles. \begin{figure} \includegraphics{779f02.eps} \caption{Performance of the proposed methodology in the simulation of Section \protect\ref{ss:simAustralia}. Black lines refer to recall, gray lines to precision, solid lines show average medians, and dashed lines show average first and 99th percentiles.} \label{f:AustraliaSim} \end{figure} We can see that the performance of the method depends greatly on the amount of identifying information contained in the files (number and type of fields) and the interplay between our prior beliefs and the real amount of error. As we would naturally expect, our ability to obtain results with high precision will depend on the amount\vadjust{\goodbreak} of identifying information contained in the files, that is, in general we will tend to obtain large proportions of false coreferent pairs whenever we have a small number of fields (see first row of Figure~\ref{f:AustraliaSim}). For the five-field data files the precision of the method is generally sensitive to prior specification, whereas the recall is somewhat insensitive except for when the amount of error is large but we believe it to be small (see upper right panel), in which case we obtain a very poor recall, which means that a large proportion of truly coreferent pairs will not be detected. For files with seven fields, if the amount of error is small, then both recall and precision are somewhat insensitive to the choice of the prior truncation points, as long as the prior is not overly pessimistic in terms of the expected amount of error, in which case the precision deteriorates (see bottom left panel). This indicates that when there are not many errors, it is easy to identify most truly coreferent pairs, but if our priors are overly pessimistic, indicating that the amount of error is potentially much larger than what it really is, then we will end up obtaining many false coreferent pairs. Although for some scenarios it is possible to obtain results that are both good and not too sensitive to prior specification, the general performance of the method can be seen in terms of a trade-off between recall and precision: if the priors indicate that the amount of error may be too small when it is actually large, then we may wind up missing too many true coreferent pairs; if the priors indicate that the amount of error may be too large when it is actually small, then we may end up having too many false coreferent pairs. The results of this simulation study provide us with some guidance for the application presented in the next section, where the data file we work with contains a small number of fields, and we believe its levels of error to be intermediate. \section{Detecting killings multiply reported to the U.N. Truth Commission for El Salvador}\label{s:UNTRCapplication} Unfortunately, the list of homicides obtained by the UNTC was never made available in electronic form and was publicly available only as photocopies as of 2007 [\citet{Amelia11}]. As part of her Ph.D. thesis, Amelia Hoover Green utilized Optical Character Recognition (OCR) technology, along with data cleaning and standardization, to transfer those scanned lists into spreadsheet format. The digitized lists therefore contained OCR errors that were corrected by hand as part of the current project. We now describe how we use the proposed methodology to find duplicated homicide records in the UNTC database. The fields that we use are given name, family name, date of death (year, month and day) and municipality of death, similarly as in the example of Section~\ref{ss:toyexample}. In this article, a valid homicide report is defined as a record in the data file that specifies given and family name of the victim, which leads to a data file containing 5395 records. We believe that no single field in this file is free of error, and therefore we do not use traditional blocking, as it may lead to miss many truly coreferent pairs. There are, however, some disagreements between pairs of records that make us confident about their noncoreference statuses. \subsection{Filtering trivial noncoreferent record pairs, and comparison data} We consider it reasonable to assume that two reports correspond to different homicides whenever their recorded municipalities have names with no overlap and are not geographical neighbors. This approach takes into account the fact that some homicides occurring near the boundary of two municipalities may get reported in the wrong, although neighboring, municipality. Another source of error occurs when a municipality gets wrongly coded due to multiple municipalities having similar names. Although the testimonies were collected in different regions of El Salvador, they were digitized in a central location and, therefore, if, for example, a~report indicated simply \textit{San Francisco} as the municipality where a killing occurred, the clerks who entered the data could have potentially assigned the wrong municipality code to this report, given that there are six different municipalities in El Salvador that include those two tokens, for example, \textit{San Francisco Moraz\'an}, \textit{San Francisco Lempa}, among others. We therefore only fully compare record pairs that either have the same municipality, neighboring municipalities, municipalities with names that overlap by at least one token (ignoring the common tokens \textit {San, Santa, Santo, La, El, Las, Los, Del, De}), or for which the municipality is missing. The set of pairs that meet any of the previous criteria constitute the set $\mathcal{P}$ introduced in Section~\ref{ss:complexity}, and the remaining pairs are fixed as noncoreferent. By using this approach we only need to fully compare around 12\% of the ${5395\choose 2}=14\mbox{,}550\mbox{,}315$ possible record pairs. We construct the comparison data in the same way as in the illustrative example of Section~\ref{ss:toyexample}, as summarized in Table~\ref{t:toyexample_compdata}. Given and family names were standardized and compared as described in the supplementary material [\citet{SadinleAOASSupplement}]. The record pairs having the level three of disagreement in either given or family name, or in year and month, were fixed as noncoreferent (these are the pairs in the set $\mathcal {P}-\mathcal{C}$ introduced in Section~\ref{ss:complexity}). After this step, the number of pairs on which we still need to take decisions reduces to only $|\mathcal{C}|=759$, which involve only 1035 records. \subsection{Prior specification} Following the general guidelines presented in Section~\ref{ss:priorPhi}, we use uniform priors on $[0,1]$ for all the $u_{fl}$ parameters, $f\in\{\mbox{Given name, Family name, Year, Month, Day, Municipality}\}$, $l=0,\ldots,L_f-1$. For the $m_{fl}$ parameters, we use flat priors in the intervals $[\lambda_{fl},1]$ for the truncation points $\lambda_{fl}$ given in Table~\ref{t:prior_ElSalvador}. These priors indicate our belief that coreferent pairs are very likely to have exact agreements, although we still expect a considerable amount of error in the fields. For example, the probability of exact agreement in the field year of death for coreferent pairs [$m_{\mathrm{Year},0}=\mathbb{P}_1(\Gamma^{\mathrm{Year}}_{ij}=0)$] is set to be at least 0.85 (i.e., $\lambda_{\mathrm{Year},0}=0.85$), which indicates that we expect a pair of coreferent records to agree exactly on year of death with high probability, but we still think that the amount of error could go up to 15\%. The remaining $\lambda_{f0}$ truncation points have similar interpretations. \begin{table} \caption{Prior truncation points $\lambda_{fl}$ for the $m_{fl}$ parameters in the detection of duplicate homicide records in the UNTC data file}\label{t:prior_ElSalvador} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccccc@{}} \hline & \multicolumn{6}{c@{}}{\textbf{Field ($\bolds{f}$)}}\\[-4pt] & \multicolumn{6}{c@{}}{\hrulefill}\\ $\bolds{l}$ & \textbf{Given name} & \textbf{Family name} & \textbf{Year} & \textbf{Month} & \textbf{Day} & \multicolumn{1}{c@{}}{\textbf{Municipality}} \\ \hline 0 &0.85 & 0.85 & 0.85 & 0.85 & 0.70 & 0.85\\ 1 &0.90 & 0.90 & 0.90 & 0.90 & 0.70 & -- \\ 2 &0.99 & 0.99 & 0.99 & 0.99 & 0.70 & -- \\ \hline \end{tabular*} \end{table} The truncation points for the remaining parameters reflect our belief on the fields' error structure. We believe that although the fields are erroneous, the error distribution has to be such that errors become more unlikely as their magnitude increases. For example, the family name \textit{RODRIGEZ} is more likely to be a misrecording of \textit{RODRIGUEZ} than of \textit{RAMIREZ}. Therefore, these truncation points $\lambda_{fl}, l>0$, indicate that the probability of observing a level of disagreement among coreferent pairs decreases as the disagreement increases. For example, the probability $m_{\mathrm{Year},1}=\mathbb {P}_1(\Gamma^{\mathrm{Year}}_{ij}=1|\Gamma^{\mathrm{Year}}_{ij}>0)$ is set to be minimum 0.9 a priori, that is, the probability that a coreferent pair disagrees by one year (level one of disagreement, see Table~\ref{t:toyexample_compdata}) \emph{given} that it disagrees in year of death (i.e., $\Gamma^{\mathrm{Year}}_{ij}>0$) should be at least 0.9. This indicates that among all coreferent pairs that have disagreements in year of death, we expect the majority to have the minimum disagreement, which is one year ($\Gamma^{\mathrm{Year}}_{ij}=1$). Similarly, $m_{\mathrm{Year},2}$ is set to be minimum 0.99 a priori, that is, the probability that a coreferent pair disagrees by two or three years (level two of disagreement, see Table~\ref{t:toyexample_compdata}) \emph{given} that it disagrees by more than one year (i.e., $\Gamma^{\mathrm{Year}}_{ij}>1$) should be at least 0.99. This prior specification constrains the prior probability of the level three of disagreement (difference of four or more years, see Table~\ref{t:toyexample_compdata}) to be very small among coreferent pairs. Finally, the prior for the field day of death has lower truncation points since we believe this field to be more unreliable than the rest, given that we do not expect witnesses to have been very accurate reporting the exact date of the killings. \subsection{Exploring the posterior sample of coreference partitions} \begin{figure} \includegraphics{779f03.eps} \caption{The set $\mathcal{C}$ of candidate pairs for duplicate detection. Each node represents a record, and two nodes appear connected if their corresponding records are candidates to be coreferent (i.e., not fixed as noncoreferent in the preprocessing step). The color and width of the edges convey the same information: The darker and thicker the edge, the larger the proportion of partitions in the posterior sample that group the pair together. Therefore, the lightest and thinnest edges indicate that those pairs never appeared together, and the black and thickest edges indicate those pairs were grouped together across all partitions in the posterior sample.}\label{f:network_possible_links} \end{figure} We obtained a posterior sample of partitions of size 19,800 using the Gibbs sampler and the implementation presented in the supplementary material [\citet{SadinleAOASSupplement}]. For the sake of illustration, in Figure~\ref{f:network_possible_links} we present a graph where each node represents one record, and the existence of an edge indicates that the pair was not fixed as noncoreferent in the preprocessing step, that is, there is one edge per pair in $\mathcal{C}$. This graph was obtained using the R package ``\texttt{igraph}'' [\citet{igraph}]. Our target coreference partition can be thought of as a subgraph of this graph composed by cliques. The sparsity of the graph in Figure~\ref{f:network_possible_links} illustrates the impact of fixing trivially noncoreferent pairs in the preprocessing step: the number of pairs that have to be resolved is small, and the possible set of partitions of the file gets greatly constrained. In Figure~\ref{f:network_possible_links} the color and the width of an edge are both proportional to the number of times that the pair appears grouped together across the chain of partitions. The thinnest and lightest edges indicate that the pair never appeared together in the partitions of the chain, whereas the thickest and black edges indicate that the pair appeared grouped together in all the partitions of the chain. The black edges in Figure~\ref{f:network_possible_links} illustrate the property of the method of ensuring transitive coreference decisions. The output of our method is a posterior sample of possible coreference partitions. Each of those partitions has a number of cells, which represent unique entities, or, in this case, unique homicides. The number of records minus the number of cells of a partition represents the number of duplicates according to that partition. We can therefore obtain a posterior distribution on this number. For the complete file, which contained 5395 records, the posterior distribution on the number of unique homicides has a mean and median of 5008, with a minimum of 4991, and a maximum of 5026 unique homicides, and a posterior 90\% probability interval of $[5001, 5015]$, which corresponds to a posterior interval on the percentage of duplicates of $[7.04, 7.30]$. The rate of duplication greatly varies across different subsets of the file. In Figure~\ref{f:resultsUNTRC} we summarize the posterior distribution of the percentage of duplicates for subsets of the data file corresponding to the different reported years and regions. The left panel of Figure~\ref{f:resultsUNTRC} presents the regions of El Salvador ordered by the number of records in the data file. We can observe that the percentage of duplicates is correlated with the number of homicides reported in that region: the more homicides reported, the larger the proportion of duplicates. A similar relation can be observed from the right panel of Figure~\ref{f:resultsUNTRC}, which shows the percentage of duplicates per year. \begin{figure} \includegraphics{779f04.eps} \caption{Left panel: Percentage of duplicates per reported region of death. The regions are ordered by the number of records. Right panel: Percentage of duplicates per reported year of death, in chronological order. In both cases the corresponding numbers of records appear in parenthesis.}\label{f:resultsUNTRC} \end{figure} \subsection{Evaluation of results and sensitivity analysis} Although there is no ground truth for the UNTC data file, it is important to have an idea of whether the results that we obtained are reasonable at all. To this end, we took the UNTC records that reported Cuscatl\'an and Ahuachap\'an as the regions of death (735 records), and identified possible duplicates among them by hand. At this point, it is important to clarify that we do not intend to treat these hand-labeled records as ground truth, since they are also the product of our subjective decisions, but rather we use them as a way to create a sanity check for our results. The idea is to compare each partition in the posterior sample with the hand-partitioned file subset in terms of precision and recall. We also would like to explore how sensitive our results are to small changes in the prior truncation points that we chose. For this purpose, we obtained two new posterior samples of partitions using two alternative priors. We consider one prior more pessimistic and one more optimistic than the one used in our application, in the sense that the maximum amounts of error in the fields could be larger or smaller than the ones implied by the prior truncation points set in Table~\ref{t:prior_ElSalvador}. These priors are obtained from subtracting/adding 0.02 to the prior truncation points of the $m_{fl}$ parameters in Table~\ref{t:prior_ElSalvador}, for $l=0,1$, and for all fields. For these two additional priors we keep the same truncations of the $m_{f2}$ parameters. \begin{figure} \includegraphics{779f05.eps} \caption{Posterior distribution of precision (left panel) and recall (right panel) computed with respect to hand-labeled records for two regions of El Salvador. Results obtained under three different sets of prior truncation points $\lambda_{fl}$ of the $m_{fl}$ parameters. The $\lambda_{f2}$'s are fixed as in Table~\protect\ref{t:prior_ElSalvador}. The prior truncation points used in the application to the UNTC data set are indicated in bold italics.} \label{f:sensitivity} \end{figure} In Figure~\ref{f:sensitivity} we summarize the posterior distributions of precision and recall under the different priors considered here. We can see that the precision of the method is somewhat sensitive to changes in the prior truncation points and, although the recall is somewhat robust, it starts to decay in the more optimistic scenario. These results agree with the findings presented in Section~\ref{ss:simAustralia} for data files with a small number of fields. We conclude that the prior employed in the application to the UNTC data file achieves a good balance between precision and recall, since a more optimistic prior would lead to less recall, and a more pessimistic prior would lead to less precision. Finally, we want to illustrate the issues that we would encounter if we were using a model that outputs pairwise coreference decisions for the UNTC data set. We implemented a two-components mixture model version of the model presented in Section~\ref{s:modelindepcomps} to classify the pairs in $\mathcal{C}$ into coreferent and noncoreferent pairs. The mixture model is obtained by simply taking $\Delta_{ij}|p\stackrel {\mathrm{i.i.d.}}{\sim} \operatorname{Bernoulli}(p)$, $i< j$, instead of treating $\bD$ as the representation of a partition. We used Bayesian estimation of this mixture model employing the same priors for the $m_{fl}$ and $u_{fl}$ parameters as in the application to the UNTC data set, and $p\sim\operatorname {Uniform}(0,1)$. From running a Gibbs sampler for 100,000 iterations, we obtained a posterior sample of $\Delta_{ij}$'s. The number of nontransitive triplets varies between 69 and 564 across the Gibbs iterations, which is not surprising given that this model treats the $\Delta_{ij}$'s as independent. As we mentioned in the \hyperref[sec1]{Introduction} of this article, if we wanted to use this mixture model approach, we would have to implement some ad-hoc strategy to ensure transitivity of the coreference decisions. \section{Conclusions and future work}\label{s:conclusions} We presented a novel, unsupervised approach to duplicate detection problems. This approach improves over current methodology since it guarantees transitive decisions, it allows us to incorporate prior information on the amount of error in the fields, and it provides a natural account for uncertainty of the coreference decisions in the form of a posterior distribution. We showed that the method provides reasonable results in an illustrative example and in a realistic simulation study. The application of this methodology to detect homicides reported multiple times to the Salvadoran UNTC indicates that, with 90\% of probability, between 7.04\% and 7.30\% of those reports are duplicates. A number of improvements can be made to this methodology. For example, the usage of field value frequencies would take into account that, for instance, a~name that is relatively rare has more distinguishing power than a common one [\citet{Winkler89Frequencies}]. Other extensions include modeling dependencies between field comparisons, possibly building on the work of \citet{LarsenRubin01}, and point estimation for the coreference partition. Our approach to duplicate detection is especially promising in the context of multiple systems estimation of population sizes, which plays an important role in human rights research [see \citet{LumPriceBanks13}]. It is important to note that the UNTC data file does not cover all the deaths that occurred during the civil war of El Salvador. Nevertheless, the combination of this source of information with other data files on killings can provide a better account of the lethal violence in El Salvador during the civil war. To pursue this goal, our future work includes the extension of this methodology to link multiple files, at the same time as finding duplicates within them. Our Bayesian approach to this problem will allow us to incorporate the uncertainty from record linkage and duplicate detection into subsequent procedures, such as population size estimation. \section*{Acknowledgments} This document benefited from discussions with the members of the CMU NCRN node. The author thanks K.~Bokalders, S.~E. Fienberg, R.~C. Steorts, R.~B. Stern, the editor and referees for helpful comments and suggestions that improved the quality of this article; P.~Ball, A.~Hoover Green, J.~Klingner and M.~E. Price from the Human Rights Data Analysis Group---HRDAG for providing the UNTC data file and other important documentation; and P. Christen for help with the generation of realistic synthetic data files. \begin{supplement \stitle{Supplement to ``Detecting duplicates in a homicide registry using\break a Bayesian partitioning approach''} \slink[doi]{10.1214/14-AOAS779SUPP} \sdatatype{.pdf} \sfilename{aoas779\_supp.pdf} \sdescription{We provide a Gibbs sampler for the model presented in Section~\ref{s:modelindepcomps}, a brief discussion on point estimation of the coreference partition, we explain how we standardized and compared Hispanic names and, finally, we present details on the implementation of the Gibbs sampler for the application in Section~\ref{s:UNTRCapplication}.} \end{supplement}
{'timestamp': '2015-02-04T02:10:04', 'yymm': '1407', 'arxiv_id': '1407.8219', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8219'}
arxiv
\section{Introduction}\label{sec:intro} \subsection{Background and Related Work} \IEEEPARstart{F}{ast} Fourier transform (FFT) is one of the most important approaches for fast computing discrete Fourier transform (DFT) of a signal with time complexity $O(N \log N)$, where $N$ is the signal length. FFT has been used widely in the communities of signal processing and communications. How to outperform FFT, however, remains a challenge and persistently receives attention. Sparsity is inherent in signals and has been exploited to speed up FFT in the literature. A signal of length $N$ is called exactly $K$-sparse if there are $K$ non-zero frequencies with $K < N$. On the other hand, a signal is called generally $K$-sparse if all frequencies are non-zero but we are only interested in keeping the first $K$-largest (significant) frequencies in terms of magnitudes and ignore the remainder. Instead of computing all frequencies, Sparse Fourier Transform (SFT) has emerged as a critical topic and aim to compute a compressed DFT, where the time complexity is proportional to $K$. A. C. Gilbert \cite{Gilbert2014} {\em et al.} propose an overview of SFT and summarize a common three-stage approach: 1) identify locations of non-zero or significant frequencies; 2) estimate the values of the identified frequencies; and 3) subtract the contribution of the partial Fourier representation computed from the first two stages from the signal and go back to stage 1. Some prior works are briefly described as follows. M. A. Iwen \cite{Iwen2010} proposes a sublinear-time SFT algorithm based on Chinese Remainder Theorem (CRT) with computational complexities (a) $O(K \log^{5} N)$ with a non-uniform failure probability per signal and (b) $O(K^2 \log^4 N)$ with a deterministic recovery guarantee. Iwen's algorithm can work for general $N$ with the help of interpolation. Although the algorithm offers strong theoretical analysis, the empirical experiments show that it suffers Big-O constants. For example, in Fig. 5 of \cite{Iwen2010}, it shows to outperform FFTW under $K=8$ and $N=2^{18}$. The approximation error bounds in \cite{Iwen2010} are further improved in \cite{Iwen2013}. H. Hassanieh {\em et al.} propose so-called Sparse Fast Fourier Transform (sFFT) \cite{Haitham2012}\cite{Haitham2012_1}. The idea behind sFFT is to subsample fewer frequencies (proportional to $K$) since most of frequencies are zero or insignificant. Nevertheless, the difficulty is which frequencies should be subsampled as the locations and values of the $K$ non-zero frequencies are unknown. To cope with this difficulty, sFFT utilizes the strategies of filtering and permutation introduced in \cite{Gilbert2005}, which can increase the probability of capturing useful information from subsampled frequencies. For exactly $K$-sparse and general $K$-sparse signals, sFFT costs $O (K \log N)$ and $O (K \log N \log \frac{N}{K})$, respectively. In their simulations, sFFT is faster than FFTW \cite{Frigo2005} (a very fast C subroutine library for computing FFT) for exactly $K$-sparse signals with $K\leq\frac{N}{2^{6}}$. Even though sFFT \cite{Haitham2012}\cite{Haitham2012_1} is outstanding, there are some limitations, summarized as follows: 1) Filtering and permutation are operated on the input signal. These operations are related to $N$. Thus, the complexity of sFFT still involves $N$ and cannot achieve the theoretical ideal complexity $O(K \log K)$. 2) sFFT only guarantees that it succeeds with a constant probability ({\em e.g.}, $2/3$). 3) The implementation of sFFT for generally $K$-sparse signals is very complicated as it involves too many parameters that are difficult to set.\footnote{In fact, according to our private communication with the authors of \cite{Haitham2012}\cite{Haitham2012_1}, they would not recommend implementing this code since it is not trivial. The authors also suggest that it is not easy to clearly illustrate which setting will work best because of the constants in the Big-O functions and because of the dependency on the implementation. The authors themselves did not implement it since they believed that the constants would be large and that it would not realize much improvement over FFTW.} Ghazi {\em et al.} \cite{Ghazi2013} propose another algorithm based on Prony's method for exactly $K$-sparse signals. The basic idea is similar to our previous work \cite{Hsieh2013}. The key difference is that Ghazi {\em et al.}'s method recovers all $K$ non-zero frequencies once, while we propose a top-down strategy to solve $K$ non-zero frequencies iteratively. Furthermore, due to different parameter settings and root finding algorithms, Ghazi's SFT costs $O(K \log K+K(\log\log N)^{O(1)})$ along with different big-O constants. The comparison between these two methods in terms of computational complexity and recovery performance will be discussed later in Sec. \ref{ssec:howtochoose_a_and_d}. S. Heider {\em et al.}'s method \cite{Heider2013} combines Prony-like methods with quasi random sampling and band pass filtering. Compared with our method, they estimate the positions and values of non-zero frequencies in each band based on the ESPRIT method instead of syndrome decoding. ESPRIT requires more computational cost resulting in the total complexity being $O(K^{\frac{5}{3}} \log^{2} N)$. Their proof also shows $K=O(N^{0.5})$ that is more strict than $K=O(N)$ in our case for exactly-$K$ sparse signal. Pawar and Ramchandran \cite{Pawar2013} propose an algorithm, called FFAST (Fast Fourier Aliasing-based Sparse Transform), which focuses on exactly $K$-sparse signals. Their approach is based on filterless downsampling of the input signal using a constant number of co-prime downsampling factors guided by CRT. These aliasing patterns of different downsampled signals are formulated as parity-check constraints of good erasure-correcting sparse-graph codes. FFAST costs $O(K \log K)$ but relies on the constraint that co-prime downsampling factors must divide $N$. Moreover, the smallest downsampling factor bounds FFAST's computational cost. For example, if $N=2^{20}3^{2}$ and $K=2^{16}$, the smallest downsampling factor is $3^{2}$. In this case, the computational cost of calculating FFT of a downsampled signal with length $\frac{N}{3}^{2}$ is higher than $O(K \log K)$. Actually, these limitations are possibly harsh. We summarize and compare the SFT algorithms reviewed above in Table \ref{Table: SFT comparision} in terms of the number of samples, computational complexity, and assumption regarding sparsity. More specifically, the number of samples decides how much information SFT algorithms require in order to reconstruct $K$-sparse signals. It is especially important for some applications, including Analog-to-Digital converter, which are benefited by low sampling rates. Moreover, the assumption of a certain range of sparsity guarantees that SFT algorithms can have high quality of reconstruction. We can find from Table \ref{Table: SFT comparision} that our algorithms have the lowest computational complexity, the lowest number of samples, and the best range of sparsity for exactly $K$-sparse signals. Although the sparsity constraint $K=\Theta(N)$ seems to be more tough for generally $K$-sparse signals in our method, for a (very) sparse signal we still can solve it by assuming that its sparsity is higher than the true one with more computational cost. In the simulations, we show that the Big-O constants for both exactly $K$-sparse and generally $K$-sparse signals are actually small, implying the practicability of our proposed approaches for real implementation. \begin{table}[t] \fontsize{7.5pt}{1em}\selectfont \centering \setlength{\abovecaptionskip}{0pt} \setlength{\belowcaptionskip}{4pt} \caption{Comparison between SFT algorithms in terms of computational complexity, required samples and assumptions.} \label{Table: SFT comparision} \doublerulesep=0pt \begin{tabular}[tc]{|c||c|c|c|c|c|c|} \hline \multirow{2}{*}{}& \multicolumn{3}{c|}{Exactly $K$-sparse signal}& \multicolumn{3}{c|}{Generally $K$-sparse signal} \\ \cline{2-7} & Samples & Complexity & Assumption & Samples & Complexity & Assumption \\ \hline\hline \cite{Iwen2010}& $O(K \log^{4} N)$ &$O(K \log^{5} N)$ & $K=O(N)$ & $O(K \log^{4} N)$& $O(K \log^{5} N)$& $K=O(N)$ \\ \hline \cite{Haitham2012_1}& $O(K )$ & $O(K \log N)$ & $K=O(N)$ & $O(K \log(\frac{N}{K})/\log\log N )$ & $O (K \log N \log \frac{N}{K})$ & $K=O(N)$ \\ \hline \cite{Ghazi2013}& $O(K)$ & $O(K \log K+K(\log\log N)^{O(1)})$& $K=O(N)$ &$O(K \log N)$ & $O(K \log^{2} N)$ & $K=\Theta(\sqrt{N})$ \\ \hline \cite{Heider2013}& $O(K)$ & $O(K^{\frac{5}{3}} \log^{2} N)$ & $K=O(\sqrt{N})$ & void & void & void \\ \hline \cite{Pawar2013}& $O(K)$ & $O(K \log K)$& $K=O(N^{\alpha})$, $\alpha<1$ & void & void & void \\ \hline This paper& $O(K)$ & $O(K \log K)$& $K=O(N)$ & $O(K)$ & $O(K \log K)$ & $K=\Theta(N)$ \\ \hline \end{tabular} \end{table} \subsection{Our Contributions} In our previous work \cite{Hsieh2013}, we propose a SFT algorithm, called sFFT-DT, based on filterless downsampling with time complexity of $O(K \log K)$ only for exactly $K$-sparse signals. The idea behind sFFT-DT is to downsample the input signal in the time domain before directly conducting all subsequent operations on the downsampled signals. By choosing an appropriate downsampling factor to make the length of a downsampled signal be $O(K)$, no operations related to $N$ are required in sFFT-DT. Downsampling, however, possibly leads to ``aliasing,'' where different frequencies become indistinguishable in terms of their locations and values. To overcome this problem, the locations and values of these $K$ non-zero entries are considered as unknown variables and the ``aliasing problem'' is reformulated as ``Moment Preserving Problem (MPP)''. Furthermore, sFFT-DT is conducted in a manner of a top-down iterative strategy under different downsampling factors, which can efficiently reduce the computational cost. In comparison with other CRT-based approaches \cite{Heider2013}\cite{Pawar2013} that require multiple co-prime integers dividing $N$, our method only needs the downsampling factor to divide $N$ but does not suffer the co-prime constraint, implying that sFFT-DT has more freedom for $N$. In this paper, we further examine the accurate computational cost and theoretical performance of sFFT-DT for exactly $K$-sparse signals. We derive the Big-O constants of computational complexity of sFFT-DT and show that they are smaller than those of Ghazi {\em et al.}'s sFFT \cite{Ghazi2013}. In addition, sFFT-DT is efficient due to $K=O(N)$, which makes it useful whatever the sparsity $K$ is. Finally, all operations of sFFT-DT are solved via analytical solutions but those of Ghazi {\em et al.}'s sFFT involve a numerical root finding algorithm, which is more complicated in terms of hardware implementation. In the context of SFT, sparsity $K$ plays an important role. The performance and computational complexity of previous SFT algorithms \cite{Haitham2012}\cite{Haitham2012_1}\cite{Ghazi2013}\cite{Pawar2013} have been analyzed based on the assumption that sparsity $K$ is known in advance. In practice, however, $K$ is unknown and is an input parameter decided by the user. If $K$ is not guessed correctly, the performance is degraded and/or the computational overhead is higher than expected because the choice of some parameters depends on $K$. In this paper, we propose a simple solution to address this problem and relax this impractical assumption. We show that the cost for deciding $K$ is the same as that required for sFFT-DT with known $K$. In addition to conducting more advanced theoretical analyses, we also study sFFT-DT for generally $K$-sparse signals in this paper. For generally $K$-sparse signals, since all frequencies are non-zero, each frequency of a downsampled signal is composed of significant and insignificant frequencies due to aliasing. To extract significant components from each frequency, the concept of sparse signal recovered from fewer samples, originating from compressive sensing (CS) \cite{Donoho2006}, is employed since significant entries are ``sparse''. A pruning strategy is further used to exclude locations of insignificant terms. We prove the sufficient conditions of robust recovery, which means reconstruction error is bounded, with time complexity $\max(O(K\log K), O(N))$ under $K=\Theta(N)$. The empirical experiments show that the Big-O constant of sFFT-DT is small and outperforms FFT when $N=2^{24}$ and $K\leq 2^{16}$. Finally, we conclude that our methods are easy to implement and are demonstrated to outperform the state-of-the-art in terms of theoretical analyses and simulation results. \subsection{Organization of This Paper} The remainder of this paper is organized as follows. In Sec. \ref{Sec: sFFT-DT: Exact K-Sparse}, we describe the proposed method for exactly $K$-sparse signals. Our method for generally $K$-sparse signals will be expounded in Sec. \ref{Sec: sFFT-DT: General K-Sparse}. Conclusions are provided in Sec. \ref{Sec: Conclusions}. \section{sFFT-DT for Exactly $K$-Sparse Signals}\label{Sec: sFFT-DT: Exact K-Sparse} We describe the proposed method for exactly $K$-sparse signals and provide analyses for parameter setting, computational complexity, and recovery performance. The proposed method contains three steps. \begin{itemize} \item[1.] Downsample the original signal in the time domain. \item[2.] Calculate Discrete Fourier Transform (DFT) of the downsampled signal by FFT. \item[3.] Use the DFT of the downsampled signal to locate and estimate $K$ non-zero frequencies.. \end{itemize} Steps 1 and 2 are simple and straightforward. Thus, we focus on Step 3 here. Throughout the paper, common notations are defined as follows. Let $\bm{x}\in \mathbb{C}^{N}$ be the input signal in the time domain, and let $\hat{\bm{x}} \in \mathbb{C}^{N} $ be DFT of $\bm{x}$. $F\in \mathbb{C}^{N\times N}$ is the DFT matrix such that $\hat{\bm{x}}=F\bm{x}$ with $F_{k,l}=e^{\frac{-i2\pi kl}{N}}/N$ and $F_{k,l}^{-1}=e^{\frac{i2\pi kl}{N}}$. \subsection{Problem Formulation}\label{ssec:DFT Property} Let $\bm{x_{d}}$ be the signal downsampled from an original signal $\bm{x}$, where $x_{d}[k]=x[dk]$, $k\in [0,\frac{N}{d}-1]$, and integer $d\geq 1$ is a downsampling factor. The length of the downsampled signal $\bm{x_{d}}$ is $\frac{N}{d}$ Let $\bm{\hat{x}_{d}}$ be DFT of $\bm{x_{d}}$, where \small \begin{equation} \begin{aligned} \hat{x}_{d}[k]=&(\hat{x}[k]+\hat{x}[k+\frac{N}{d}]+\hat{x}[k+2\frac{N}{d}]+...+\hat{x}[k+(d-1)\frac{N}{d}])/d. \end{aligned} \label{eq:xd} \end{equation} \normalsize The objective here is to locate and estimate $K$ non-zero frequencies of $\bm{\hat{x}}$ from $\bm{\hat{x}_{d}}$. Note that each frequency of $\bm{\hat{x}_{d}}$ is a sum of $d$ terms of $\bm{\hat{x}}$. When more than two terms of $\bm{\hat{x}}$ are non-zero, ``aliasing'' occurs, as illustrated in Fig. \ref{fig:Iterative Pyramid}. Fig. \ref{fig:Iterative Pyramid}(a) shows an original signal in the frequency domain, where only three frequencies are non-zero (appearing at normalized frequencies = $0\pi$, $0.5\pi$, and $\pi$). Fig. \ref{fig:Iterative Pyramid}(b) shows the downsampled signal in the frequency domain when $d=2$, where the downsampled frequency at $0\pi$ incurs aliasing; {\em i.e.}, the frequency of $\bm{\hat{x}}$ at $0\pi$ collides with the one at $\pi$. In Fig. \ref{fig:Iterative Pyramid}(b), we solve all non-zero downsampled frequencies once, no matter whether aliasing occurs or not. This procedure is called non-iterative sFFT-DT and will be discussed in detail later. Instead of solving all of the downsampled frequencies once, Fig. \ref{fig:Iterative Pyramid}(c) illustrates an example of iteratively solving frequencies. At the first iteration, the downsampled frequency without aliasing at $1\pi$ is solved. This makes the remaining downsampled frequencies more sparse. Then, the signal is downsampled again with $d=4$. At the second iteration, we solve the downsampled frequency with aliasing at $0\pi$. This procedure, called iterative sFFT-DT, will be discussed further in Sec. \ref{ssec:ItMethod}. \begin{figure}[h] \centering{\epsfig{figure=IterativePyramid.eps,width=4.25 in}} \hfill \caption{Aliasing and its iterative solver. (a) Original signal in frequency domain. (b) Downsampled signal in frequency domain with $d=2$. If we want to solve all frequencies once, it requires $4$ FFTs. (c) Similar to (b), however, the frequency (at normalized frequency $1\pi$) at $d=2$ is solved first and requires $2$ FFTs. (d) Remaining frequency (at $0\pi$) requires $2$ extra FFTs at $d=4$.} \label{fig:Iterative Pyramid} \end{figure} In the following, we describe how to solve the aliasing problem by introducing the shift property of DFT. Let $x_{d,l}[k]=x[dk+l]$, where $l$ denotes the shift factor. Each frequency of $\bm{\hat{x}_{d,l}}$ is denoted as: \small \begin{equation} \begin{aligned} \hat{x}_{d,l}[k]&=(\hat{x}[k]F_{k,l}^{-1}+\hat{x}[k+\frac{N}{d}]F_{k+\frac{N}{d},l}^{-1}+...+\hat{x}[k+(d-1)\frac{N}{d}]F_{k+(d-1)\frac{N}{d},l}^{-1})/d. \end{aligned} \label{eq:xd with shift} \end{equation} \normalsize Thus, Eq. (\ref{eq:xd with shift}) degenerates to Eq. (\ref{eq:xd}) when $l=0$. In practice, all we can obtain are $ \hat{x}_{d,l}[k]$'s for different $l$'s. For each downsampling factor $d$, there will be no more than $d$ terms on the right side of Eq. (\ref{eq:xd with shift}), where each term contains two unknown variables, $\hat{x}[k]$ and $F_{k,l}^{-1}$. Let $a$, $1\leq a\leq d$, denote the number of terms on the right side of Eq. (\ref{eq:xd with shift}). Therefore, we need $2a$ equations to solve these $2a$ variables, and $l$ is within the range of $[0,2a-1]$. By taking the above into consideration, the problem of solving the $2a$ unknown variables on the right side of Eq. (\ref{eq:xd with shift}) can be formulated\footnote{In the previous version \cite{Hsieh2013}, it is interpreted as a moment preserving problem (MPP). Specifically, solving MPP is equivalent to solving complex BCH codes, where the syndromes produced by partial Fourier transform are consistent with moments.} via BCH codes as: \small \begin{equation} \begin{aligned} m_{0}&=p_{0}z_{0}^{0}+p_{1}z_{1}^{0}+...+p_{a-1}z_{a-1}^{0}, \\ m_{1}&=p_{0}z_{0}^{1}+p_{1}z_{1}^{1}+...+p_{a-1}z_{a-1}^{1}, \\ &\vdots \\ m_{2a-1}&=p_{0}z_{0}^{2a-1}+p_{1}z_{1}^{2a-1}+...+p_{a-1}z_{a-1}^{2a-1}, \end{aligned} \label{eq:MPT obejective fun} \end{equation} \normalsize where $\hat{x}_{d,l}[k]$ is known and denoted as $m_{l}$ while $p_{j}$ and $z_{j}^{l}$ represent unknown $\hat{x}[s_{j}]$ and $F_{s_{j},l}^{-1}$, respectively, for $s_{j} \in \{k, \ k+\frac{N}{d} \ , ...\ ,k+(d-1)\frac{N}{d}\}$ and $j\in [0,a-1]$. To simplify the notation, we let $S_{k}= \{k, \ k+\frac{N}{d} \ , ...\ ,k+(d-1)\frac{N}{d}\}$ and $U_{k}=\{ F_{k,l}^{-1} , \ F_{k+\frac{N}{d},l}^{-1} \ , ...\ , F_{k+(d-1)\frac{N}{d},l}^{-1} \}$. It is trivial that no aliasing occurs if $a=1$, irrespective of the downsampling factor. Under this circumstance, we have $m_{0}=\hat{x}_{d,0}[k]$, $m_{1}=\hat{x}_{d,1}[k]$, $m_{0}=p_{0}z_{0}^{0}=\hat{x}[s_{0}]/d$, and $m_{1}=p_{0}z_{0}^{1}=\hat{x}[s_{0}]e^{i2\pi s_{0}/N}/d$, according to Eq. (\ref{eq:MPT obejective fun}). We obtain that $|m_{0}|=|\hat{x}[s_{0}]|/d=|m_{1}|$ and $m_{1}/m_{0}=e^{i2\pi s_{0}/N}$. After some derivations, we can solve $s_{0}$ and assign $\hat{x}[s_{0}]=d\hat{x}_{d,0}[k]$ at the position $s_0$. The above solver only works under a non-aliasing environment with $a=1$. Nevertheless, when aliasing appears ({\em i.e.}, $a>1$), it fails. To solve the aliasing problem, it is observed from Eq. (\ref{eq:MPT obejective fun}) that all we know are $ m_{i}$'s for $0\leq i\leq 2a-1$, called syndromes in BCH codes. Thus, we utilize syndrome decoding \cite{MacWilliams11977}, which is also equivalent to the solver presented in Ghazi {\em et al.}'s sFFT. Syndrome decoding is discussed in the next subsection. \subsection{Syndrome Decoding}\label{ssec:MPT} Note that Eq. (\ref{eq:MPT obejective fun}) is nonlinear and cannot be solved by simple linear matrix operations. On the contrary, we have to solve $z_j$'s first, such that Eq. (\ref{eq:MPT obejective fun}) becomes linear. Then, $p_{i}$'s can be solved by matrix inversion. Thus, the main difficulty is how to solve $z_j$'s given known syndromes. According to \cite{Szego1975}, given the unique syndromes with $m_{0}$, $m_{1}$, ..., $m_{2a-1}$, there must exist the corresponding orthogonal polynomial equation, $P(z)$, with roots $z_{j}$'s for $0\leq j\leq a-1$. That is, $z_{j}$'s can be obtained as the roots of $P(z)$. The steps for syndrome decoding are as follows. \\ Step (i): Let the orthogonal polynomial equation $P(z)$ be: \small \begin{equation} P(z)=z^{a}+c_{a-1}z^{a-1}+...+c_{1}z+c_{0}. \label{eq:poly fun of MPT} \end{equation} \normalsize The relationship between $P(z)$ and the syndromes is as follows: \small \begin{equation} \begin{aligned} -m_{a}&=c_{0}m_{0}+c_{1}m_{1}+...+c_{a-1}m_{a-1}, \\ -m_{a+1}&=c_{0}m_{1}+c_{1}m_{2}+...+c_{a-1}m_{a}, \\ &\vdots \\ -m_{2a-1}&=c_{0}m_{a-1}+c_{1}m_{a}+...+c_{a-1}m_{2a-2}. \end{aligned} \label{eq:auxiliary fun of MPT} \end{equation} \normalsize Eq. (\ref{eq:auxiliary fun of MPT}) can be formulated as $\bm{m}=\bm{M}\bm{c}$, where $\bm{M}_{i,j}= m_{i+j}$, $\bm{c}=[c_{0} \ c_{1} \ ... \ c_{a-1} ]^T$, and $\bm{m}=[-m_{a} \ -m_{a+1} \ ... \ -m_{2a-1} ]^T$. Thus, Eq. (\ref{eq:auxiliary fun of MPT}) can be solved by matrix inversion $\bm{M}^{-1}$ to obtain $c_{j}$'s.\\ Step (ii): Find the roots of $P(z)$ in Eq. (\ref{eq:poly fun of MPT}). These roots are the solutions of $z_{0}$, $z_{1}$,...$z_{a-1}$, respectively.\\ Step (iii): Substitute all $z_{j}$'s into Eq. (\ref{eq:MPT obejective fun}), and solve the resulting equations to obtain $p_{j}$'s. Tsai \cite{Tsai1985} showed a complete analytical solution composed of the aforementioned three steps for $a\leq 4$, based on the constraint that $p_{0}+p_{1}+...+p_{a-1}=1$. Nevertheless, for the aliasing problem considered here, the constraint is $p_{0}+p_{1}+...+p_{a-1}=\hat{x}_{d,0}[k]$, as indicated in Eq. (\ref{eq:xd with shift}). We have also derived the complete analytical solution accordingly for $2\leq a\leq 4$. Please see Appendix in Sec. \ref{Sec: Appendix}. The analytical solutions for a univariate polynomial with $a\leq 4$ cost $O(a^2)$ operations. Since there are $\frac{N}{d}$ frequencies, the computational cost of syndrome decoding is $O(\frac{N}{d}a^2)$. For $a > 4$, Step (i) still costs $O(a^2)$, according to the Berlekamp-Massey algorithm \cite{Massey1963}, which is well-known in Reed-Solomon decoding \cite{MacWilliams11977}. In addition, Step (iii) is designed to calculate the inverse matrix of a Vandermonde matrix and costs $O (a^2)$ \cite{NChen2008}. There is, however, no analytical solution of Step (ii) for $a > 4$. Thus, numerical methods of root finding algorithms with finite precision are required. A fast algorithm proposed by Pan \cite{Pan2002} can approximate all of the roots with $O(a(\log\log N)^{O(1)})$, where the detailed proof was shown in \cite{Ghazi2013}. If $(\log\log N)^{O(1)}>a$, Step (ii) will dominate the cost of syndrome decoding. It is noted that the actual number of collisions for each frequency, $a$ ($1\leq a\leq d$), is unknown in advance. In practice, we choose a maximum number of collision $a_{m}$ and expect $a\leq a_{m}$ for all downsampled frequencies. Under the circumstance, $2a_{m}$ syndromes are required for syndrome decoding. If $a$'s of all downsampled frequencies are smaller than or equal to $a_{m}$, the syndrome decoding perfectly recovers all of the frequencies; {\em i.e.,} it resolves all non-zero values and locations of $\bm{\hat{x}}$. Otherwise, the non-zero entries of $\bm{\hat{x}}$ cannot be recovered due to insufficient information. Although a larger $a_{m}$ guarantees better recovery performance, it also means that more syndromes and higher computational cost are required. In sum, the cost of syndrome decoding consists of two parts. Since the size of a downsampled signal is $\frac{N}{d}$, the cost of generating the required syndromes via FFT is $O(2a_{m}\frac{N}{d}\log \frac{N}{d})$, which is called the ``P1 cost of syndrome decoding'' hereafter. Second, as previously mentioned, solving the aforementioned Steps (i), (ii), and (iii) will cost $ O(\frac{N}{d}a_{m}^2)$ for $a_{m} \leq 4$ and cost $O(\frac{N}{d}a_{m}(\log\log N)^{O(1)})$ for $a_{m} > 4$, where either of which is defined as the ``P2 cost of syndrome decoding''. Lemma \ref{lemma:cost of non-iterative sFFT-DT} summarizes the computational cost of syndrome decoding. \begin{lemma} \label{lemma:cost of non-iterative sFFT-DT} Give $a_{m}$ and $d=O(\frac{N}{K})$, sFFT-DT, including generating syndromes by FFTs and syndrome decoding, totally costs $O(a_{m}\frac{N}{d}\log \frac{N}{d})$ for $a_{m}\leq 4$ and $O(a_{m}\frac{N}{d}\log \frac{N}{d}+a_{m}\frac{N}{d}(\log \log N)^{O(1)})$ for $a_{m} > 4$. \end{lemma} So far, our method of solving all downsampled frequencies is based on fixing downsampling factor $d$ (and $a_{m}$), as an example illustrated in Fig. \ref{fig:Iterative Pyramid} (b). In this case, we call this approach, non-iterative sFFT-DT. Its iterative counterpart, iterative sFFT-DT, will be described later in Sec. \ref{ssec:ItMethod} and Sec. \ref{ssec:exact_algorithm}. \subsection{Analysis}\label{ssec:howtochoose_a_and_d} In this section, we first will study the relationship between $a_{m}$ and $d$, and analyze the probability of a downsampled frequency with number of collisions larger than $a_m$. Second, we will discuss computational complexity and recovery performance of our non-iterative sFFT-DT. Third, we will compare non-iterative sFFT-DT with Ghazi {\em et al.}'s sFFT \cite{Ghazi2013}. In addition, the Big-O constant of complexity is induced in order to highlight the computational simplicity of non-iterative sFFT-DT. Finally, we will conclude by presenting an iterative sFFT-DT approach to reduce computational cost further. \subsubsection{Relationship between Maximum Number of Collisions and Downsampling Factor} Now, we consider the relationship between $a_m$ and $d$. If $a_{m}$ is set to $d$, then we always can recover any $\bm{\hat{x}}$ without errors but the computational cost will be larger than that of FFT. Thus, it is preferable to set smaller $a_{m}$, which is still feasible when $\bm{\hat{x}}$ is uniformly distributed. For each frequency, the number of collisions, $a$, will be small with higher probability if $\frac{dK}{N}$ is small enough, as Lemma \ref{lemma:probability of bin} illustrates \begin{lemma} \label{lemma:probability of bin} Suppose $K$ non-zero entries distribute uniformly ({\em i.e.}, with probability $\frac{K}{N}$) in $\bm{\hat{x}}$. Let $Pr(d,a_{m})$ denote the probability that there is at least a downsampled frequency with number of collisions $a > a_{m}$ when the downsampling factor is $d$. Then, $Pr(d,a_{m})\leq \frac{N}{d} (\frac{deK}{N(a_{m}+1)})^{a_{m}+1}$, where $e$ is Euler's. And non-iterative sFFT-DT obtains perfect recovery with probability at least $\rho=1-Pr(d,a_{m})$. \end{lemma} \begin{proof} For each downsampled frequency, the probability of $a > a_{m}$ is ${ \sum_{i=a_{m}+1}^{d} \binom{d}{i} (\frac{K}{N})^{i} (1-\frac{K}{N})^{d-i}} $, which is smaller than $\binom{d}{a_{m}+1} (\frac{K}{N})^{a_{m+1}}$. Under this circumstance, the probability of at least a downsampled frequency with $a > a_{m}$ is bounded by $\binom{\frac{N}{d}}{1} \binom{d}{a_{m}+1} (\frac{K}{N})^{a_{m+1}}$. Thus, we can derive: \small \begin{equation} \begin{aligned} Pr(d,a_{m}) &\leq \frac{N}{d} \binom{d}{a_{m}+1} (\frac{K}{N})^{a_{m+1}}\leq \frac{N}{d} (\frac{dK}{N})^{a_{m}+1} \frac{1}{(a_{m}+1)!} \\ &\leq \frac{N}{d} (\frac{dK}{N})^{a_{m}+1} (\frac{e}{a_{m}+1})^{a_{m}+1} = \frac{N}{d} (\frac{deK}{N(a_{m}+1)})^{a_{m}+1}. \end{aligned} \label{Eq: lemma:probability of bin} \end{equation} \end{proof} \normalsize The probability that $\bm{\hat{x}}$ can be perfectly reconstructed using sFFT-DT is $1-Pr(d,a_{m})$ since $a > a_{m}$ results in the fact that the syndrome decoding cannot attain the correct values and locations in the frequency domain. Furthermore, since $Pr(d,a_{m})$ is controlled by $\frac{N}{d}$, $K$, and $a_{m}$, it can be very low based on an appropriate setting. Let $\displaystyle N^{+}=\frac{N}{dK}$ denote the ratio of the length ($\displaystyle \frac{N}{d}$) of a downsampled signal to $K$. Our empirical observations, shown in Fig. \ref{fig:aliasing}, indicate the probability of collisions at different $N^{+}$'s. For $a>4$, the probability of collisions is very close to $0$. \begin{figure}[h] \centering{\epsfig{figure=Aliasing.eps,width=3.7in}} \hfill \caption{The probability of collisions for $1\leq a\leq 7$ at different $N^{+}$'s, where $a$ denotes the number of collisions. The results show that $a > 2$, in fact, seldom occurs.} \label{fig:aliasing} \end{figure} \subsubsection{Computational Cost and Recovery Performance} According to computational cost in Lemma \ref{lemma:cost of non-iterative sFFT-DT} and probability for perfect recovery in Lemma \ref{lemma:probability of bin}, we have Theorem \ref{theorem:probability of sfftdt v1}. \begin{theorem} \label{theorem:probability of sfftdt v1} If non-zero frequencies of $\bm{\hat{x}}$ distribute uniformly, given $a_{m}$ and $d$, sFFT-DT perfectly recovers $\bm{\hat{x}}$ with the probability at least $\rho = 1-\frac{N}{d} (\frac{deK}{N(a_{m}+1)})^{a_{m}+1}$ and the computational cost $O(a_{m}\frac{N}{d}\log \frac{N}{d})$ for $a_{m}\leq 4$ and $O(a_{m}\frac{N}{d}\log \frac{N}{d}+a_{m}\frac{N}{d}(\log \log N)^{O(1)})$ for $a_{m} > 4$. \end{theorem} Based on different parameter settings in Theorem \ref{theorem:probability of sfftdt v1}, we can further distinguish our sFFT-DT from Ghazi {\em et al.}'s sFFT \cite{Ghazi2013} in terms of recovery performance and computational cost as follows. (sFFT-DT): Set $a_{m}=4$ and $d=O(\frac{N}{K})$. We have the probability of perfect recovery, $\rho= 1-O(K)O(\frac{e}{5})^{5}$, and computational cost, $O(K \log K)$.\\ (Ghazi {\em et al.}'s sFFT): Set $a_{m}={C\log K}$ and $d = O(\frac{N\log K}{K})$. We have $\rho = 1 - O(\frac{1}{K}^{0.5C\log C})$ and computational cost $O(K \log K + K(\log\log N)^{O(1)})$. \\ Furthermore, Ghazi {\em et al.}'s sFFT aims to maximize the performance without the constraint of $a_{m} \leq 4$. Thus, it requires to use an extra root finding algorithm \cite{Pan2002} with complexity being related to the signal length $N$. On the contrary, sFFT-DT achieves the ideal computational cost, which is independent of $N$, but with the lower bound of successful probability degrading to $0$ for large $K$. Under this circumstance, sFFT-DT is seemingly unstable. Nevertheless, if we consider the recovery performance in terms of energy, sFFT-DT can guarantee that most of frequencies are estimated correctly, as Theorem \ref{theorem:probability of sfftdt v2} indicates. To prove this, we first define some parameters here. Let $d=\frac{N}{\mu K}$, where $\mu \in \mathbb{N}$ is the user-defined parameter, and let $\tau \in (0,1]$ with $(\frac{\tau}{\mu}-\frac{1}{\mu K})\times 100\%$ representing the proportion of frequencies that cannot be successfully recovered. \begin{theorem} \label{theorem:probability of sfftdt v2} If non-zero frequencies of $\bm{\hat{x}}$ distribute uniformly, given $a_{m}$ and $d=\frac{N}{\mu K}$, sFFT-DT recovers at least $(1-(\frac{\tau}{\mu}-\frac{1}{\mu K}))N$ frequencies of $\bm{\hat{x}}$ with the probability at least $\rho = 1- \left(\frac{d^{a_{m}}K^{a_{m}} e^{a_{m}+2}}{\tau N^{a_{m}} (a_{m}+1)^{a_{m}+1}}\right)^{\tau K}$, and computational cost $O(a_{m}\frac{N}{d}\log \frac{N}{d})$ for $a_{m}\leq 4$ and $O(a_{m}\frac{N}{d}\log \frac{N}{d}+a_{m}\frac{N}{d}(\log \log N)^{O(1)})$ for $a_{m} > 4$. \end{theorem} \begin{proof} We extend $Pr(d,a_{m})$ derived in Lemma \ref{lemma:probability of bin} as $Pr(d,a_{m},f)$ to represent the probability that at least $f$ frequencies with $a > a_{m}$ is derived as: \begin{equation} \begin{aligned} Pr(d,a_{m},f) & \leq \binom{\frac{N}{d}}{f} \left(\binom{d}{a_{m}+1} (\frac{K}{N})^{a_{m+1}}\right)^{f} \\ & \leq \frac{1}{f!}(\frac{N}{d})^{f} \left( (\frac{deK}{N(a_{m}+1)})^{(a_{m}+1)}\right)^{f} \\ & \leq \left(\frac{K}{f}(\frac{dK}{N})^{a_{m}} \frac{e^{a_{m}+2}}{(a_{m}+1)^{a_{m}+1}}\right)^{f}. \end{aligned} \label{Eq: tauK entries} \end{equation} Let $f = \tau K$ and plug it in Eq. (\ref{Eq: tauK entries}). We obtain the result that at least $f$ frequencies of $\bm{\hat{x}}_{d}$ cannot be solved with probability $Pr(d,a_{m},f) \leq \left(\frac{d^{a_{m}}K^{a_{m}} e^{a_{m}+2}}{\tau N^{a_{m}} (a_{m}+1)^{a_{m}+1}}\right)^{\tau K} $. In other words, there are at most $(f-1)d=(\frac{\tau}{\mu}-\frac{1}{\mu K})N$ frequencies of $\bm{\hat{x}}$ that cannot be solved with probability $\rho = 1 - Pr(d,a_{m},f)$. We complete this proof. \end{proof} By choosing appropriate $\mu$ and $\tau$, sFFT-DT performs better with successful probability converging to $1$ when $K$ increases, implying that it can work for $K=O(N)$. For example, by setting $a_{m}=4$ and $d=\frac{N}{\mu K}$, where $\mu$ is $4$, we have $\rho \approx 1-\left(\frac{5\times 10^{-4}}{\tau}\right)^{\tau K}$. In this case, let $\tau=10^{-2}$ and it means that sFFT-DT correctly recovers at least $99.0\%$ frequencies with probability at least $\delta=1-(\frac{1}{20})^{\tau K}$, which converges to $1$ when $\tau K$ is large enough. In addition, we further analyze the practical cost of additions and multiplications in detail along with the Big-O constants of computational complexity and find that the Big-O constants in Ghazi's sFFT are larger than those in sFFT-DT. More specifically, recall that the computational cost of sFFT-DT is composed of two parts: performing FFTs for obtaining syndromes (P1 cost) and solving Steps (i), (ii), and (iii) of syndrome decoding (P2 cost). Since $d = \frac{N}{4K}$ was set in our simulations, the Big-O constants for FFT are $96$ for addition and $64$ for multiplication\footnote{Recall that the P1 cost is $2a_{m}\frac{N}{d}\log \frac{N}{d}$. Under the situation that $a_{m}$ is $4$ and $\frac{N}{d}= 4K$, the Big-O constant is $ 2*4*4*3 = 93 $, where $3$ comes from the constant of additions of FFT \cite{Saidi1994}.}. Since the P2 cost in sFFT-DT is relatively smaller than the P1 cost, it is ignored. In contrast to sFFT-DT, the Big-O constants of the P1 cost in Ghazi's sFFT \cite{Ghazi2013} are about $6C$ for addition and $4C$ for multiplication ($C$ must be larger than or equal to $2$; otherwise Ghazi {\em et al.}'s sFFT cannot work). Nevertheless, the Big-O constants of one of the Steps (i) and (iii) within the P2 cost need about $96$ for addition and $160$ for multiplication (the detailed cost analysis is based on \cite{NChen2008}). Even though we do not take Step (ii) into account due to the lack of detailed analysis, the Big-O constants for multiplication in sFFT-DT are far smaller than those of Ghazi {\em et al.}'s sFFT, especially for multiplications. In addition, for hardware implementation, Ghazi {\em et al.}'s sFFT is more complex than sFFT-DT (due to its analytical solution) because an extra numerical procedure for root finding is required and the computational cost involves $N$. We conclude that there are two main advantages in sFFT-DT, compared to Ghazi's sFFT \cite{Ghazi2013}. First, the Big-O constants of sFFT-DT are smaller than those of Ghazi {\em et al.}'s sFFT. Second, our analytical solution is hardware-friendly in terms of implementation. On the other hand, when the signal is not so sparse with $K$ approaching $N$ ({\em e.g.}, $ K=\frac{N}{8}$ and $d=O(\frac{N}{K})$), the cost of $8$ FFTs in a downsampled signal is almost equivalent to that of one FFT in the original signal. To further reduce the cost, a top-down iterative strategy is proposed in Sec. \ref{ssec:ItMethod}. It also should be noted that the above discussions (and prior works) are based on the assumption that $K$ is known. In practice, $K$ is unknown in advance. Unfortunately, how to automatically determine K is ignored in the literature. Instead of skipping this problem, in this paper, we present a simple but effective strategy in Sec. \ref{ssec:how to decide K} to address this issue. \subsection{Top-Down Iterative Strategy for Iterative sFFT-DT}\label{ssec:ItMethod} In this section, an iterative strategy is proposed to solve the aliasing problem with an iterative increase of the downsampling factor $d$ according to our empirical observations that the probability of aliasing decreases fast with the increase of $a$ and the fact that when $d$ is increased, $a$ is increased as well. The idea is to solve downsampled frequencies from $a=1$ to $a=a_{m}$ iteratively. During each iteration, the solved frequencies are subtracted from $\hat{x}_{d}$ to make $\hat{x}_{d}$ more sparse. Under this circumstance, $d$ subsequently is set to be larger values to reduce computational cost without sacrificing the recovery performance. Fig \ref{fig:Iterative Pyramid} illustrates such an example. In Fig. \ref{fig:Iterative Pyramid}(b), if we try to solve all aliasing problems in the first iteration, $4$ FFTs are required, since the maximum value of $a$ is $2$. On the other hand, if we first solve the downsampled frequencies with $a=1$ (at normalized frequency = $\pi$), it costs $2$ FFTs, as shown in Fig. \ref{fig:Iterative Pyramid}(c). Since $2$ FFTs are insufficient for solving the aliasing problem completely under $a=2$, extra $2$ FFTs are required to solve a more ``sparse'' signal. The key is how to calculate the $2$ extra FFTs in the above example with lower cost. Since a more sparse signal is generated by subtracting the solved frequencies from $\hat{x}_{d}$, $d$ can be set to be larger to further decrease the cost of FFT. As shown in Fig. \ref{fig:Iterative Pyramid}(d), $2$ extra FFTs can be done quickly with a larger $d$ (=$4$) to solve the downsampled frequency (at normalized frequency = $0\pi$) with $a=2$. Consequently, $d$ is doubled iteratively in our method and the total cost is dominated by that required at the first iteration. The proposed method with the top-down iterative strategy is called iterative sFFT-DT. \subsection{Iterative sFFT-DT: Algorithm for Exactly K-Sparse Signals}\label{ssec:exact_algorithm} In this section, our method, iterative sFFT-DT, is developed and is depicted in Algorithm \ref{Table:our algorithm}, which is composed of three functions, \textbf{main}, \textbf{SubFreq}, and \textbf{SynDec}. Basically, iterative sFFT-DT solves downsampled frequencies from $a_{m}=1$ to $4$ with an iterative increase of $d$. Note that, its variation, non-iterative sFFT-DT, solves all downsampled frequencies with $a_{m} = 4$ and fixed $d$. At the initialization stage, the sets $S$ and $T$, recording the positions of solved and unsolved frequencies, respectively, are set to be empty. $a_m = 4$ and $d = \frac{N}{4K}$ are initialized. The algorithmic steps are explained in detail as follows. Function \textbf{main}, which is executed in a top-down manner by doubling the downsampling factor iteratively, is depicted from Line 1 to Line 16. In Lines 3-4, the input signal $\bm{x}$ is represented by two shift factors $2l$ and $2l+1$. Then they are used to perform FFT to obtain $\bm{\hat{x}_{d,2l}}$ and $\bm{\hat{x}_{d,2l+1}}$ in Lines 5-6. In Line 7, the function \textbf{SubFreq}, depicted between Line 17 and Line 22, is executed to remove frequencies from $\bm{\hat{x}_{d,2l}}$ and $\bm{\hat{x}_{d,2l+1}}$ that were solved in previous iterations. The goal of function \textbf{SubFreq} is to make the resulting signal more sparse. Line 9 in function \textbf{main} is used to judge if there are still unsolved frequencies. In particular, the condition $\hat{x}_{d,l}[k]=0$, initially defined in Eq. (\ref{eq:xd with shift}), may imply: 1) $ \hat{x}[k+j\frac{N}{d}]$'s for all $j \in [0,d-1]$ are zero, meaning that there is no unsolved frequency and 2) $ \hat{x}[k+j\frac{N}{d}]$'s are non-zero but their sum is zero, meaning that there exist unsolved frequencies. To distinguish both, $|\hat{x}_{d,j}[k]| > 0$ for $j\in [0,2l+1]$ is a sufficient condition. More specifically, if $a$ is less than or equal to $2l+2$, it is enough to distinguish both by checking whether any one of the $2l+2$ equations is not equal to $0$. If yes, it implies that at least a frequency grid is non-zero; otherwise, all $ \hat{x}[k+j\frac{N}{d}]$'s are definitely zero. Moreover, Line 9 is equivalent to checking $2l + 2$ equations at the $l$'th iteration. At $l=0$, two equations ($ \hat{x}_{d,0}[k] $ and $ \hat{x}_{d,1}[k] $) are verified to ensure that all frequencies with $a\leq2$ are distinguished. At $l=1$, if $k \in T$, it is confirmed that $ \hat{x}[k+j\frac{N}{d}]$'s are non-zero at the previous iteration. On the contrary, if $k \notin T$, extra 2 equations ($ \hat{x}_{d,2}[k] $ and $ \hat{x}_{d,3}[k] $) are added to ensure that all frequencies with $a\leq4$ are distinguished. Thus, at the $l$'th iteration, there are in total $2l+2$ equations checked. In Line 11, the function \textbf{SynDec}, depicted in Lines 23-35 (which was described in detail in Sec. \ref{ssec:MPT}), solves frequencies when aliasing occurs. sFFT-DT iteratively solves downsampled frequencies from $a=1$ to $a\leq a_{m}=4$. Nevertheless, we do not know $a$'s in advance. For example, it is possible that some downsampled frequencies with $a=4$ are solved in the first three iterations, and these solutions definitely fail. In this case, the solved locations do not belong to $ S_{k}$ (defined in Sec. \ref{ssec:DFT Property}). On the contrary, if the downsampled frequency is solved correctly, the locations must belong to $S_{k}$. Thus, by checking whether or not the solution satisfies the condition, $s_{j}\;mod\;d=k$ for all $j \in [0,l]$ (Line 30), we can guarantee that all downsampled frequencies are solved under correct $a$'s. Finally, the downsampling factor is doubled, as indicated in Line 14, to solve the unsolved frequencies in an iterative manner. This means that the downsampled signal in the next iteration will become shorter and can be dealt faster than that in the previous iterations. \begin{algorithm}[!htb] \fontsize{11pt}{0.9em}\selectfont \setlength{\abovecaptionskip}{0pt} \setlength{\belowcaptionskip}{0pt} \caption{Iterative sFFT-DT for exactly $K$-sparse signals.} \label{Table:our algorithm} \begin{tabular}[t]{p{17.7cm}l} \textbf{Input:} $\bm{x}$, $K$;\quad \textbf{Output:} $\bm{\hat{x}}$; \\ \textbf{Initialization:} $\bm{\hat{x}}=\mathbf{0}$, $ d=\frac{N}{4K}$, $S=\{ \}$, $T=\{ \}$, $a_{m}=4$; \\ \hline\hline 01. \textbf{function} \textbf{main}()\\ 02. \quad\textbf{for} $l = 0$ to $a_{m} -1$ \\ 03. \quad\quad $x_{d,2l}[k]=x[dk+2l]$ for $ k\in [0,\frac{N}{d}-1]$;\\ 04. \quad\quad $x_{d,2l+1}[k]=x[dk+2l+1]$ for $ k\in [0,\frac{N}{d}-1]$;\\ 05. \quad\quad $\bm{\hat{x}_{d,2l}}=\mathbf{FFT}( \bm{x_{d,2l}} )\times d$;\\ 06. \quad\quad $\bm{\hat{x}_{d,2l+1}}=\mathbf{FFT}( \bm{x_{d,2l+1}} )\times d$;\\ 07. \quad\quad $\mathbf{SubFreq}(\bm{\hat{x}_{d,2l}},\bm{\hat{x}_{d,2l+1}},\bm{\hat{x}},d,l,S)$;\\ 08. \quad\quad \textbf{for} $k = 0$ to $ \frac{N}{d}-1$\\ 09. \quad\quad \quad \textbf{if} ($k \in T$ or $|\hat{x}_{d,2l}[k]| > 0$ or $|\hat{x}_{d,2l+1}[k]| > 0$) \\ 10. \quad\quad \quad \quad $m_{j}= \hat{x}_{d,j}[k]$ for $j \in [0,2l+1]$; \\ 11. \quad\quad \quad \quad $\mathbf{SynDec}(\bm{m},l,d,k,\bm{\hat{x}},S,T)$;\\ 12. \quad\quad \quad \textbf{end if}\\ 13. \quad\quad \textbf{end for} \\ 14. \quad\quad $d=2d$; \\ 15. \quad\quad All elements in $T$ modulo $ \frac{N}{d}$.\\ 16. \quad\textbf{end for}\\ 17. \textbf{function} \textbf{SubFreq} $(\bm{\hat{x}_{d,2l}},\bm{\hat{x}_{d,2l+1}},\bm{\hat{x}},d,l,S)$\\ 18. \quad \textbf{for} $k \in S$\\ 19. \quad \quad $k_{d}=k $ mod $ \frac{N}{d}$;\\ 20. \quad \quad $ \hat{x}_{d,2l}[k_{d}]=\hat{x}_{d,2l}[k_{d}]- \hat{x}[k]e^{\frac{i2\pi k(2l)}{N}} $;\\ 21. \quad \quad $ \hat{x}_{d,2l+1}[k_{d}]=\hat{x}_{d,2l+1}[k_{d}]- \hat{x}[k]e^{\frac{i2\pi k(2l+1)}{N}} $;\\ 22. \quad \textbf{end for}\\ 23. \textbf{function} \textbf{SynDec} $(\bm{m},l,d,k,\hat{x},S,T)$\\ 24. \quad \textbf{if} $l=0$\\ 25. \quad \quad $ z_{0}= ( \frac{m_{1}}{m_{0}})$;\;\;$p_{0}= m_{0}$;\\ 26. \quad \textbf{else} \\ 27. \quad \quad Solve the aliasing problem with $a=l+1$ by \\ \quad \quad \quad \;\;syndrome decoding, described in Sec. \ref{ssec:MPT}. \\ 28. \quad \textbf{end if} \\ 29. \quad $s_{j}= (\ln z_{j})N/i2\pi $ for all $j \in [0,l] $; \\ 30. \quad \textbf{if} ($s_{j}\;mod\;d$) $ = k$ for all $j \in [0,l] $\\ 31. \quad \quad $S=S\cup \bm{s}$;\\ 32. \quad \quad $\hat{x}[s_{j}]=p_{j}$ for all $j \in [0,l]$;\\ 33. \quad \textbf{else} \\ 34. \quad \quad $T=T\cup \bm{s}$;\\ 35. \quad \textbf{end if}\\ \hline \end{tabular} \end{algorithm} \normalsize \subsection{Performance and Computational Complexity of Iterative sFFT-DT}\label{ssec:conv_analysis} We first discuss the complexity of iterative sFFT-DT. The cost of the outer loop in function \textbf{main} (Steps 5 and 6) is bounded by two FFTs. As mentioned in Theorem \ref{theorem:probability of sfftdt v2}, $d$ is set to be $ \frac{N}{4K}$, the dimensions of $x_{d,2l}$ and $x_{d,2l+1}$ are $O(K)$, and FFT costs $O(K \log K)$ in the first iteration. Since $d$ is doubled iteratively, the total cost of $a_m$ iterations is still bounded by $O(K \log K)$. In addition, the function \textbf{SubFreq} costs $O(K)$ operations due to $|S|\leq K$. The inner loop of the function \textbf{main} totally runs $O(K)$ times, which is not related to the outer loop, since at most $K$ frequencies must be solved. The cost at each iteration is bounded by the function \textbf{SynDec}. Recall that the P2 cost, as described in Sec. \ref{ssec:MPT}, requires $ O(\frac{N}{d}a^{2})$. More specifically, since $d$ is doubled iteratively, $ \frac{N}{d}$ can be derived to depend on $ \frac{O(K)}{2^{l}}$ from the initial setting $ d=O(\frac{N}{K})$. Therefore, \textbf{SynDec} at the $l$'th iteration costs $ O(\frac{K}{2^l}(l+1)^{2})$ and requires $ O(\frac{K}{2^0}1^{2}+\frac{K}{2^1}2^{2}+...+\frac{K}{2^{3}}4^{2} ) \leq O(6.25K) = O(K)$ in total. That is, the inner loop (Steps 8$\sim$13) costs $O(K)$, given an initial downsampling factor of $ d=\frac{N}{4K}$ and $a_{m}=4$. In sum, the proposed algorithm, iterative sFFT-DT, is dominated by ``FFT'' and costs $O(K \log K)$ operations. Now, we discuss Big-O constants for operations of addition and multiplication, respectively. Since $d$ is doubled iteratively, the P1 cost of syndrome decoding gradually is reduced in the later iterations. The total cost is $ \sum_{i=1}^{a_m} O(2\frac{N}{2^{i-1}d}\log\frac{N}{2^{i-1}d})$, where $a_m=4$. Due to the fact that iterative sFFT-DT possibly recovers $\bm{\hat{x}}$ with less than $a_m=4$ iterations, the benefit in reducing the computational cost depends on the number of iterations. In the worst case, the cost is about $ O((2+1+\frac{1}{2}+\frac{1}{4})\frac{N}{d}\log\frac{N}{d})= O(3.75\frac{N}{d}\log\frac{N}{d})$ under $a_m=4$. Recall that the P1 cost of syndrome decoding in non-iterative sFFT-DT is $ O(2a_m \frac{N}{d}\log\frac{N}{d})$. With $a_{m}=4$, the Big-O constants in non-iterative sFFT-DT are two times larger than those in iterative sFFT-DT. Similarly, in the best case ({\em i.e.}, $a$'s of all frequencies are $1$), the former is about $4$ times larger than the latter. Thus, it is easy to further infer Big-O constants of iterative sFFT-DT. For instance, since the Big-O constant of addition for non-iterative sFFT-DT is $96$, the Big-O constants for iterative sFFT-DT addition range from $12\times 2=24$ (the best case) to $12 \times 3.75 = 45$ (the worst case) and those for multiplication range from $16$ to $30$. As for recovery performance in iterative sFFT-DT, since the downsampling factor $d$ is doubled along with the increase of iterations, a question, which naturally arises, is if a larger downsampling factor leads to more new aliasing artifacts. If yes, these newly generated collisions possibly degrade the performance of iterative sFFT-DT. If no, the iterative style is good since it reduces computational cost and maintains recovery performance. In Lemma \ref{lemma:probabilityofaliasing}, we prove that the probability of producing new aliasing artifacts after a sufficient number of iterations will approach zero. \begin{lemma} \label{lemma:probabilityofaliasing} Suppose $K$ non-zero entries of ${\bm\hat{x}}$ distribute uniformly ({$i.e.$}, with probability $ \frac{K}{N}$). Let $Pr_{l}^{ali}$ be the probability that new aliasing artifacts are produced at the $l$'th iteration in iterative sFFT-DT. Let $K_{l}$ be the number of frequencies with $a \geq l+1$ at the $l$'th iteration ($0\leq l\leq 3$, $K_{0}=K$). If $ K_{l} \leq \frac{K}{2^{l}}$, we have $Pr_{l}^{ali} < \frac{1}{2^{l+1}}(\frac{d}{N})K^{2}$. \end{lemma} \begin{proof} According to Algorithm \ref{Table:our algorithm}, after the first iteration ($l=0$), all downsampled frequencies with only $a=1$ aliasing term are solved. Thus, we focus on discussing the probability of producing new aliasing artifacts under $l \geq 1$. By the same idea of Lemma \ref{lemma:probability of bin}, we can define $ \frac{N}{d}\binom{d}{2}(\frac{K}{N})^{2}$ to be the probability that there is a downsampled frequency with $a \geq 2$ aliasing terms. In the second iteration. $l=1$, however, some non-zero frequencies have been solved in previous iterations. Thus, the number of remaining non-zero frequencies are no longer $K$ and $\frac{K}{N}$ and should be modified. In other words, the number of downsampled frequencies with $a \geq 2$ must be less than $K_{l}$ for $l\geq 1$ and $ \frac{N}{d}\binom{d}{2}(\frac{K_{l}}{N})^{2}$ becomes the upper bound of the probability that there exists a downsampled frequency of producing new aliasing artifacts. According to our iterative sFFT-DT algorithm, let $d_{l}=2^ld$ for $l\geq 1$. We can derive: \small \begin{equation} Pr_{l}^{ali} \leq \frac{N}{d_{l}} \binom{d_{l}}{2} (\frac{K_{l}}{N})^{2} \leq \frac{N}{2^{l}d}(\frac{2^{l}d}{N})^{2}\frac{K^{2}_{l}}{(2)!}\leq 2^{l-1}(\frac{d}{N})K^{2}_{l}. \label{Eq: Bound of aliasing} \end{equation} \normalsize Eq. (\ref{Eq: Bound of aliasing}) converges to $0$ when $ K_{l}\leq\frac{K}{2^{l}}$. By initializing $d$ properly, almost $K$ frequencies can be solved in the first few iterations. This makes $ K_{l}\leq\frac{K}{2^{l}}$ easy to be satisfied. Under this circumstance, $d=\frac{N}{4K}$ would be a good choice. By replacing $K_{l}$ with $ \frac{K}{2^{l}}$, we can derive $Pr_{l}^{ali} \leq \frac{1}{2^{l+1}}(\frac{d}{N})K^{2}$. When $l$ increases to be large enough, the probability of $Pr_{l}^{ali}$ will be small since $ \frac{1}{2^{l+1}}(\frac{d}{N})K^{2} \rightarrow 0$. \end{proof} Lemma \ref{lemma:probabilityofaliasing} indicates the probability of producing new aliasing artifacts in an asymptotic manner. This provides us the information that the probability of producing new aliasing finally converges to zero. In our simulations, we actually observe that the exact probability with new aliasing is very low under $d=\frac{N}{4K}$, implying that the iterative approach can reduce the computational cost and maintain the recovery performance effectively. \subsection{A Simple Strategy for Estimating Unknown Sparsity $K$ }\label{ssec:how to decide K} As previously described, the sparsity $K$ of a signal is important in deciding the downsampling factor $d$. Nevertheless, $K$ is, in general, unknown. In this section, we provide a simple bottom-up strategy to address this issue. First, we set a large downsampling factor $d=N$, and then run sFFT-DT. If there is any downsampled frequency that cannot be solved, then $d$ is halved and sFFT-DT is applied to solve $\bm{\hat{x}}$ again. When $d$ is halved iteratively until the condition in either Theorem \ref{theorem:probability of sfftdt v1} or Theorem \ref{theorem:probability of sfftdt v2} is satisfied, sFFT-DT guarantees one to stop with the probability indicated in either Theorem \ref{theorem:probability of sfftdt v1} or Theorem \ref{theorem:probability of sfftdt v2}. This strategy needs the same computational complexity required in sFFT-DT with known $K$ because the cost with $d=N$ is $ O(2a_{m}\frac{N}{d}\log\frac{N}{d}) = O(2a_{m})$ and the total cost is $O(2a_{m})+O(2a_{m}2\log 2)+...+ O(2a_{m}K \log K) < O(4a_{m}K \log K)$. Thus, sFFT-DT with the strategy of automatically determining $K$ costs double the one with known $K$. \subsection{Simulation Results for Exactly K-Sparse Signals}\label{Sec: Experimental Results} Our method\footnote{Our code is now available in http://www.iis.sinica.edu.tw/pages/lcs/publications\_en.html (by searching ``Others'').}, iterative sFFT-DT, was verified and compared with FFTW (using the plan of FFTW\_ESTIMATE (http://www.fftw.org/)), sFFT-v3 \cite{Haitham2012} (its code was downloaded from http://spiral.net/software/sfft.html), GFFT (using the plan of GFFT-Fast-Rand, which is an implementation of \cite{Iwen2010} and is discussed in \cite{Segal2012} in detail (its code was downloaded from http://sourceforge.net/projects/gopherfft/)), and Ghazi {\em et al.}'s sFFT \cite{Ghazi2013} for exactly $K$-sparse signals. The simulations for sFFT-DT, FFTW, GFFT, and Ghazi {\em et al.}'s sFFT were conducted with an Intel CPU Q6600 and $2.99$ GB RAM under Win 7. sFFT-v3 was run in Linux because the source code was released in Linux's platform. The signal $\bm{x}$ in time domain was produced as follows: 1) Generate a $K$-sparse signal $\bm{\hat{x}}_{ori}$ and 2) $\bm{x}$ is obtained by inverse FFT of $\bm{\hat{x}_{ori}}$. For sFFT-DT, the initial $d$ is set according to $ d=\frac{N}{4K}$, based on Theorem \ref{theorem:probability of sfftdt v2}. For sFFT-v3, $d$ was automatically assigned, according to the source code. For Ghazi {\em et al.}'s sFFT, $ d=\frac{N}{K} 2^{\lfloor \log\log K \rfloor}$ and $a_{m}=2\log K$, where $2^{\lfloor \log\log K \rfloor}$ is involved to enforce $ \frac{N}{d}$ being an integer. If $\log\log K$ is an integer, $ d=\frac{N}{K} 2^{\lfloor \log\log K \rfloor}= \frac{N\log K}{K}$. The comparison of computational time is illustrated in Fig. \ref{fig:Computation Time}. Fig. \ref{fig:Computation Time}(a) shows the results of computational time versus sparsity under $N=2^{24}$. For $ K\leq\frac{N}{2^{4}}$, our algorithm outperforms FFTW. Moreover, sFFT-v3 \cite{Haitham2012}\cite{Haitham2012_1} is only faster than FFTW when $ K\leq\frac{N}{2^{6}}$ and is comparable to Ghazi {\em et al.}'s sFFT. We can also observe from Fig. \ref{fig:Computation Time}(a) that Ghazi {\em et al.}'s sFFT is slower than iterative sFFT-DT because the P2 cost of syndrome decoding in Ghazi {\em et al.}'s sFFT dominates the computation. Compared to sFFT-v3 and Ghazi {\em et al.}'s sFFT, our method, iterative sFFT-DT, is able to deal with FFT of signals with large $K$. GFFT demonstrates the worst results as it crashes when $K>2^{12}$ under $N=2^{24}$. Fig. \ref{fig:Computation Time}(b) shows the results of computational time versus signal dimension under fixed $K$. It is observed that the computational time of iterative sFFT and Ghazi {\em et al.}'s sFFT is invariant to $N$, but our method is the fastest. \begin{figure*}[!t] \begin{minipage}[b]{.48\linewidth} \centering{\epsfig{figure=Computation.eps,width=3.55in}} \centerline{(a)} \end{minipage} \begin{minipage}[b]{.48\linewidth} \centering{\epsfig{figure=ComutationFixedK.eps,width=3.55in}} \centerline{(b)} \end{minipage} \hfill \caption{Comparison of computational time for exact K-sparse signals. (a) Computational time vs. sparsity under $N=2^{24}$. (b) Computational time vs. signal dimension under $K=2^{16}$ and $a_{m}=4$.} \label{fig:Computation Time} \end{figure*} Moreover, according to Theorem \ref{theorem:probability of sfftdt v1}, the performance of non-iterative sFFT-DT seems to be inferior to that of Ghazi {\em et al.}'s sFFT. Nevertheless, the successful probability described in Theorem \ref{theorem:probability of sfftdt v1} is merely a lower bound. In our simulations, we compare the recovery performance among three approaches: non-iterative sFFT-DT, iterative sFFT-DT, and Ghazi {\em et al.}'s sFFT \cite{Ghazi2013}. The parameters for both proposed approaches and Ghazi {\em et al.}'s sFFT were set based on Theorem \ref{theorem:probability of sfftdt v1}. We have the following observations from Fig. \ref{fig:Performance}, where signal length is $N=2^{20}$. First, although the theoretical result derived in Theorem \ref{theorem:probability of sfftdt v1} indicates that the performance decreases along with the increase of $K$, it is often better than Ghazi {\em et al.}'s sFFT \cite{Ghazi2013}. In fact, it is observed that the performance of Ghazi {\em et al.}'s sFFT oscillates. The oscillation is due to the fact that the floor operation in $2^{\lfloor \log\log K \rfloor}$ (from $ d=\frac{N}{K} 2^{\lfloor \log\log K \rfloor}$) acts like a discontinuous function and leads to large variations of setting $d$. The recovery performance would benefit by setting small $d$ at the expense of requiring greater computational cost. Second, iterative sFFT-DT degrades the recovery performance gradually as $K$ increases while, at the same time, the number of collisions ($0 \leq a \leq d$) decreases as well. That is the reason the performance returns to $100\%$ when $K=2^{16}$ under the case that $ d = \frac{N}{4K}$. \begin{figure}[t] \begin{minipage}[b]{.98\linewidth} \centering{\epsfig{figure=sFFTPerformance.eps,width=3.55in}} \end{minipage} \hfill \caption{Recovery performance comparison among non-iterative sFFT-DT, iterative sFFT-DT, and Ghazi {\em et al.}'s sFFT \cite{Ghazi2013} for exact $K$-sparse signal. The signal length is $N=2^{20}$.} \label{fig:Performance} \end{figure} \section{(Non-Iterative) sFFT-DT for Generally $K$-Sparse Signals}\label{Sec: sFFT-DT: General K-Sparse} For sparse FFT of a generally $K$-sparse signal $\bm{x}$, the goal is to compute an approximate transform $\bm{\hat{x}}_{out}$ satisfying: \small \begin{equation} \bm{\hat{x}}_{out}= \arg \min_{\bm{\hat{x}}^{'}} \| \bm{\hat{x}}-\bm{\hat{x}}^{'} \|_{2}, \label{eq:general K-sparse signal} \end{equation} \normalsize where $\bm{\hat{x}}_{out}$ is exactly $K$-sparse and $\bm{\hat{x}}$ is generally $K$-sparse. Without loss of generality, we assume that all frequencies in $\bm{\hat{x}}$ are non-zero. Similar to exactly $K$-sparse signals, we assume that $K$ significant frequencies (with the first $K$ largest magnitudes) of $\bm{\hat{x}}$ distribute uniformly. Due to generally $K$-sparsity of $\bm{\hat{x}}$, the right-hand side of Eq. (\ref{eq:xd}) will contain $d$ terms. When solving syndrome decoding, the remaining insignificant terms will perturb the coefficients of polynomial in Eq. (\ref{eq:poly fun of MPT}). In addition, how to estimate the roots for perturbed polynomial is an ill-conditioned problem ({\em i.e.}, Wilkinson's polynomial \cite{Wilkinson1959}). Thus, instead of directly estimating roots by syndrome decoding, we reformulate the aliasing problem in terms of an emerging methodology, called Compressive Sensing (CS) \cite{Donoho2006}\cite{Candes2008}, that has been received much attention recently. Compressive sensing (CS) is originally proposed for sampling signals under the well-known Nyquist rate. If the signal follows the assumption that it is sparse in some transformed domain, CS shows that the signal can be recovered from fewer samples, even though the signal is interfered by noises. The model of CS is formulated as: \begin{equation} \bm{y}=\Phi (\bm{s}+\bm{\eta})+\bm{e}, \label{Eq: Random Projection} \end{equation} where $\bm{s}$ is a sparse signal, $\Phi$ is a sensing matrix, $\bm{y}$ is the samples (also called measurements), $\bm{\eta}$ is a signal noise, and $\bm{e}$ is a measurement noise. It should be noted that $\Phi$ must satisfy either the restricted isometry property (RIP) \cite{Candes2005}\cite{Gan2009} or mutual incoherence property (MIP) \cite{Donoho2001}\cite{Welch1974} for successful recovery with high probability. It has been shown that Gaussian random matrix and partial Fourier matrix \cite{Candes2006-F} are good candidates to be $\Phi$. For sFFT-DT of a generally $K$-sparse signal, we formulate the aliasing problem as the CS problem shown in Eq. (\ref{Eq: Random Projection}). The strategy based on CS is motivated by the following facts: 1) The magnitudes of significant terms must be larger than those of insignificant terms. 2) The number of significant terms is less than that of insignificant terms. Thus, estimating the locations and values of significant terms is consistent with the basic assumption in the context of CS. Unlike iterative sFFT-DT for exactly $K$-sparse signals, the iterative approach cannot work for generally $K$-sparse signals since one cannot guarantee that an exact solution can be attained at each iteration without propagating recovery errors for subsequent iterations. Therefore, we only study non-iterative sFFT-DT for generally $K$-sparse signals. In this section, how to formulate the aliasing problem as the CS problem is described in Sec. \ref{Sec: Refinement}. We discuss CS-based performance along with the sufficient conditions for CS successful recovery in Sec. \ref{Sec: Analysis CS}. In Sec. \ref{Sec: decide a}, we propose a pruning strategy along with proofs to improve the recovery performance and reduce the computational cost. The detailed algorithm is described in Sec. \ref{Sec: algorithm for general K sparse}. The computational time analysis and simulations are, respectively, described in Sec. \ref{Sec: Complexity for General Ksparse Signal} and Sec. \ref{Sec: experimental result of General}. \subsection{Problem Formulation}\label{Sec: Refinement} Recall the BCH codes in Eq. (\ref{eq:MPT obejective fun}), where the locations ($z_j^l$) and values ($p_j$) as variables. Since all candidate locations are known and belong to $S_{k}=\{ k , \ k+\frac{N}{d} \ , ...\ , k+(d-1)\frac{N}{d}\}$, instead of considering both $z_j^l$ and $p_j$ as variables in Eq. (\ref{eq:MPT obejective fun}), only $p_{j}$ are thought of as unknown variables here. Then, we reformulate the aliasing problem in terms of the CS model as: \small \begin{equation} {\underbrace{\begin{bmatrix} m_{n_{0}}\\ m_{n_{1}}\\ \vdots \\ m_{n_{r-1}} \end{bmatrix}}_{\bm{y}} = \underbrace{\begin{bmatrix} F_{k,n_{0}}^{-1} & \cdots & F_{k+(d-1)\frac{N}{d},n_{0}}^{-1} \\ F_{k,n_{1}}^{-1} & \cdots & F_{k+(d-1)\frac{N}{d},n_{1}}^{-1} \\ \vdots & \ddots &\\ F_{k,n_{r-1}}^{-1} & \cdots &F_{k+(d-1)\frac{N}{d},n_{r-1}}^{-1} \end{bmatrix} }_{\Phi} \underbrace{ \begin{bmatrix} b_{0} \\ b_{1} \\ \vdots\\ b_{d-1} \end{bmatrix}}_{\bm{s}+\bm{\eta}}}, \label{eq:CS Formulation} \end{equation} \normalsize where $b_{t}$ is the value at ($k+t\frac{N}{d}$)'th frequency for $t \in [0,d-1]$ and $n_{j}$ is the shift factor for $j \in [0,r-1]$. Let the left-hand side in Eq. (\ref{eq:CS Formulation}) be $\bm{y}$ as in Eq. (\ref{Eq: Random Projection}) and let the right-hand side be $\Phi (\bm{s}+\bm{\eta})$ with $\bm{e}=\bm{0}$. It should be noted that $\bm{b} = [b_{0},b_{1},...,b_{d-1}]$ is composed of $\bm{s}$ (significant terms with $a$ non-zero frequencies) and $\bm{\eta}$ (insignificant terms with $d-a$ non-zero frequencies). Therefore, $\bm{y} \in \mathbb{C}^{r}$, $\Phi \in \mathbb{C}^{r \times d}$, and $\bm{s}$ and $\bm{\eta} \in \mathbb{C}^{d}$. In fact, Eq. (\ref{eq:CS Formulation}) can degenerate to Eq. (\ref{eq:MPT obejective fun}). For example, Eq. (\ref{eq:MPT obejective fun}) is expressed as $\bm{m}=\bm{Z}\bm{p}$, where $\bm{p}=[p_{0},p_{1},...,p_{a-1} ]^{T}$ and $\bm{Z}$ is a matrix in which $(i,j)$'th entry is $z^{i}_{j}$. If $\Phi_{p}$ is the matrix by pruning the columns of $\Phi$ corresponding to insignificant terms, then $\bm{Z}=\Phi_{p}$. To solve $\bm{s}$ given $\bm{y}$, Eq. (\ref{eq:CS Formulation}) have infinite solutions since $r < d$. Conventionally, two strategies \cite{Donoho2006}, $\ell_{1}$-minimization and greedy approaches, are popularly used for sparse signal recovery in CS. Among them, Subspace Pursuit (SP) \cite{Dai2009} is one of the greedy algorithms and requires $O(ard)$ for solving Eq. (\ref{eq:CS Formulation}). SP runs at most $\frac{N}{d}$ times, leading to the total cost of SP being $O(arN)$. Similar to exactly $K$-sparse signal, we choose $a_{m}$ as the maximum number of collisions for all downsampled frequencies. Thus, the maximum cost of solving SP is $O(a_{m}rN)$. Since $a_{m}$ can be chosen as a constant to ensure that most of downsampled frequencies satisfy $a \leq a_{m}$ by tuning an appropriate $d$ shown in Theorem \ref{theorem:probability of sfftdt v2}, the cost of SP finally is simplified into $O(rN)$. The next step is how to set $r$, which is very important and related to computational complexity and recovery performance. In fact, $r$ is directly related to the sampling rate in CS. Candes and Wakin \cite{Candes2008} pointed out that $r$ must satisfy $r \geq O(a \log \frac{d}{a})$ to recover $\bm{s}$ given $\bm{y}$ and $\Phi$. If $ d=O(\frac{N}{K})$, then $r \geq O(a \log \frac{N}{aK})$. In other words, $N$ is also a parameter that impacts the size of $r$. This will make the cost of solving Eq. (\ref{eq:CS Formulation}) related to $N$ and lead to massive computational overhead, which is unacceptable as sFFT-DT must be faster than FFT. Thus, in sFFT-DT, $r$ is forced to be $3a_{m}$ and the total cost of SP becomes $O(N)$. In other words, we generate at most $r=3a_{m}$ syndromes for solving Eq. (\ref{eq:CS Formulation}). Since $r$ is fixed, it is expected to degrade performance when $d$ becomes large. We will discuss the recovery performance in Sec. \ref{Sec: Analysis CS} under this setting. Finally, we discuss the relationship between shift factors $n_{j}$'s and $\Phi$, in which both affect the recovery performance in CS. From the theory of CS, the performance also depends on mutual coherence of $\Phi$, which is defined as: \small \begin{equation} \theta = \max_{i,j, i\neq j} \langle \Phi_{i},\Phi_{j}\rangle. \label{eq:mutual incoherence} \end{equation} \normalsize In this case, the phase difference between $F_{k,n_{j}}^{-1}$ and $F_{k+\frac{N}{d},n_{j}}^{-1}$ is $2\pi\frac{n_{j}}{d}$, as defined in Eq. (\ref{eq:CS Formulation}). Recall $l \in \{ n_{0},n_{1},...,n_{r-1} \}$ ($0\leq j < r$). If we set $n_{j}\in [0,2a-1]$, the maximum shift $2a-1$ is encountered and the phase difference between $F_{k,n_{j}}^{-1}$ and $F_{k+\frac{N}{d},n_{j}}^{-1}$ still approaches $0$ with $ 2\pi\frac{2a-1}{d} \rightarrow 0$ ($d \gg a$). Under this circumstance, $\theta \rightarrow 1$ and perfect sparse recovery will become impossible. Thus, $n_{j}$'s are uniformly drawn from $[0,d-1]$. This makes $\Phi$, in fact, be a partial Fourier random matrix and its mutual coherence will be small, as shown in \cite{Candes2006-F}. In sum, sFFT-DT for generally $K$-sparse signals first performs FFTs of downsampled signals with random shift factors and then for each downsampled frequency, the aliasing problem is reformulated in terms of CS model solved by subspace pursuit. \subsection{Analysis of CS-based Approach}\label{Sec: Analysis CS} In this section, we describe the recovery performance and computational cost based on the CS model-based solver, indicated in Eq. (\ref{eq:CS Formulation}). For subsequent discussions, we let $\bm{\hat{x}}= \bm{\hat{x}_{s}} +\bm{\hat{x}_{ns} }$, where $\bm{\hat{x}_{s}}$ and $\bm{\hat{x}_{ns}} $ represent vectors keeping significant and insignificant terms, respectively. First, we introduce the definition of Restricted Isometric Property (RIP) for performance analysis as: \begin{definition} \label{definition:RIP} Let $\Phi \in \mathbb{C}^{r \times d}$ and $a_{m} \leq d$. Suppose there exists a restricted isometry constant (RIC) $\delta_{a_{m}}$ of a matrix $\Phi$ such that for each $r \times a$ submatrix $\Phi_{a_{m}}$ of $\Phi$ and for every $\bm{s}$ we have: $$ (1-\delta_{a_{m}})\| \bm{s} \|^{2} \leq \| \bm{\Phi_{a_{m}} s} \|^{2} \leq (1+\delta_{a_{m}})\| \bm{s} \|^{2}. $$ The matrix $\Phi$ is said to satisfy the $a_{m}$-restricted isometry property. \end{definition} In addition, the performance analysis of SP \cite{Dai2009} is shown in Theorem \ref{theorem:sp performance}. \begin{theorem} \label{theorem:sp performance} Let $\bm{s} \in \mathbb{C}^{d}$ be generally $a_{m}$-sparse and let $\bm{y}=\Phi (\bm{s}+\bm{\eta})+\bm{e}$. Suppose that the sampling matrix satisfies RIP with parameter $\delta_{6a_{m}}<0.083$. Then, \small \begin{equation} \| \bm{s} - \bm{s}_{out} \|_2 \leq \frac{1 + \delta_{6a_{m}}}{\delta_{6a_{m}} (1 - \delta_{6a_{m}})}\left( \| \bm{e} \|_2 +\sqrt{\frac{1+\delta_{6a_{m}}}{a_{m}}}\| \bm{s} - \bm{s}_{a_{m}} \|_1 \right), \label{Eq: SP error} \end{equation} \normalsize where $\bm{s}_{out}$ is the output of SP and $\bm{s}_{a_{m}}$ is an $a_{m}$-sparse vector minimizing $\| \bm{s} - \bm{s}_{a_{m}} \|_{2}$. \end{theorem} It should be noted that, in our case, we formulate the aliasing problem at each downsampled frequency as CS problem solved by SP. Thus, Theorem \ref{theorem:sp performance} is applied to analyze reconstruction error at each downsampled frequency. By summing the errors with respect to all downsampled frequencies, we show the total error is still bounded. \begin{theorem} \label{theorem:sFFT performance without no pruning} Let $\bm{\hat{x}} \in \mathbb{C}^{N}$ be generally $K$-sparse. Given $a_{m}$, $r=O(a_{m})$, $d=\frac{N}{\mu K}$, and $\bm{\hat{x}}_{out}$ is the output of sFFT-DT. If $\bm{\Phi}$ in Eq. (\ref{eq:CS Formulation}) satisfies RIP with parameter $\delta_{6a_{m}}<0.083$, then we obtain recovery error $$\| \bm{\hat{x}} - \bm{\hat{x}}_{out} \|_2 \leq C_{\delta_{6a_{m}}}\sqrt{ \| \bm{\hat{x}}_{ns}\|_2^2 + \tau( \frac{N}{\mu} -Ka_{m})\| \bm{\hat{x}} \|_\infty^{2} } ,$$ where $$C_{\delta_{6a_{m}}} = \frac{1 + \delta_{6a_{m}}}{\delta_{6a_{m}} (1 -\delta_{6a_{m}})}\sqrt{\frac{d(1+\delta_{6a_{m})}}{a_{m}}},$$ with probability at least $1-\left(\frac{d^{a_{m}}K^{a_{m}} e^{a_{m}+2}}{\tau N^{a_{m}} (a_{m}+1)^{a_{m}+1}}\right)^{\tau K} $ and computational complexity $\max \left( O(a_{m}\frac{N}{d} \log \frac{N}{d} ), O(a_{m}^2 N) \right)$ by solving the aliasing problem in sFFT-DT with SP. \end{theorem} \begin{proof} First, we relax the term $\| \bm{s} - \bm{s}_{a_{m}} \|_1$ in Eq. (\ref{Eq: SP error}) as $\sqrt{d}\| \bm{s} - \bm{s}_{a_{m}} \|_2$. Let $\bm{s}^{i}$, $\bm{\eta}^{i}$, and $a^{i}$ represent the significant terms, insignificant terms, and number of collisions at $i$'th downsampled frequency, respectively. Thus, $\bm{s}^{i}- \bm{s}^{i}_{out}$ is the reconstruction error at $i$'th downsampled frequency. It should be noted that, in our case, $\bm{e}=\bm{0}$ for all downsampled frequencies. The total error is derived as: \begin{equation} \begin{aligned} \| \bm{\hat{x}} - \bm{\hat{x}}_{out} \|_2^{2} = \sum_{i=0}^{d-1} \| \bm{s}^{i}- \bm{s}^{i}_{out} \|_2^2 \leq \left( \frac{1 + \delta_{6a_{m}}}{\delta_{6a_{m}} (1 - \delta_{6a_{m}})}\sqrt{\frac{d(1+\delta_{6a_{m})}}{a_{m}}} \right)^{2} \sum_{i=0}^{d-1} \| \bm{s}^{i}- \bm{s}^{i}_{a_{m}} \|_2^2. \end{aligned} \label{eq:derivation of sFFT error} \end{equation} For each downsampled frequency labeled $i$, we have (1) if $a^{i} \leq a_{m}$, then $\| \bm{s}^{i} - \bm{s}_{a_{m}}^{i} \|_2 \leq \| \bm{\eta}^{i} \|_2$ and (2) if $a^{i} > a_{m}$, then $\bm{s}^{i} - \bm{s}_{a_{m}}^{i} = \bm{s}^{i}+\bm{\eta}^{i}-\mathcal{T}_{a_{m}}(\bm{s}^{i})$, where $\mathcal{T}_{a_{m}}(\cdot)$ is a soft-thresholding operator keeping the first $a_{m}$ largest entries in magnitude and setting the others to zero. Based on the above conditions, we can derive \begin{equation} \begin{aligned} &\sum_{i=0}^{d-1} \| \bm{s}^{i}- \bm{s}^{i}_{a_{m}} \|_2^2\\ &= \sum_{ \{i | a^{i} \leq a_m\} } \| \bm{\eta}^{i} \|_{2}^{2}+ \sum_{ \{i | a^{i} > a_m\} } \| \bm{s}^{i}+\bm{\eta}^{i}-\mathcal{T}_{a_{m}}(\bm{s}^{i}) \|_{2}^{2} \\ &\leq \sum_{ \{i | a^{i} \leq a_m\} } \| \bm{\eta}^{i} \|_{2}^{2} + \sum_{ \{i | a^{i} > a_m\} } \| \bm{\eta}^{i} \|_{2}^{2} + \| \bm{s}^{i}-\mathcal{T}_{a_{m}}(\bm{s}^{i}) \|_{2}^{2}\\ &= \sum_{i=0}^{d-1} \| \bm{\eta}^{i} \|_{2}^{2} + \sum_{ \{i | a^{i} > a_m\} } \| \bm{s}^{i}-\mathcal{T}_{a_{m}}(\bm{s}^{i}) \|_{2}^{2} \\ &\leq \| \bm{\hat{x}}_{ns} \|_{2}^{2} + \tau(\frac{N}{\mu}-Ka_{m})\| \bm{\hat{x}} \|_{\infty}^{2}. \end{aligned} \label{Eq: Derive the error based on am} \end{equation} The last inequality is due to the fact that $\bm{\eta}^{i}$ is the vector keeping the insignificant terms such that $ \sum_{i=0}^{d-1} \| \bm{\eta}^{i} \|_2^2 = \| \bm{\hat{x}}_{ns}\|$. In addition, for $\bm{s}^{i}$ with $a^{i} > a_m$, it contains at most $d$ significant frequencies in the worst case. Thus, $\bm{s}^{i}-\mathcal{T}_{a_{m}}(\bm{s}^{i})$ leaves $d-a_{m}$ significant frequencies and $\| \bm{s}^{i}-\mathcal{T}_{a_{m}}(\bm{s}^{i}) \|_2^2 \leq (d-a_{m})\| \bm{s}^{i} \|_{\infty}^2 \leq (d-a_{m})\| \bm{\hat{x}} \|_{\infty}^2 $ always holds. On the other hand, when Theorem \ref{theorem:probability of sfftdt v2} holds, it implies at most $\tau K -1$ downsampled frequencies with number of collisions larger than $a_m$. Then, the cardinality of $\{i | a^{i} > a_m\}$ is $\tau K -1$ and $\sum_{ \{i | a^{i} > a_m\} } \| \mathcal{T}_{a_{m}}(\bm{s}) \|_2^2 \leq (\tau K -1)(d-a_{m})\| \bm{\hat{x}} \|_\infty^2 \leq \tau K(d-a_{m})\| \bm{\hat{x}} \|_\infty^2 \leq \tau(\frac{N}{\mu}-Ka_{m})\| \bm{\hat{x}} \|_\infty^2$. Finally, the computational cost consists of the costs of generating the required syndromes and running SP. In similar to exactly-$K$ sparse case, given $a_{m}$ and $d=O(\frac{N}{K})$, FFTs for downsampled signals totally cost $O(a_{m} \frac{N}{d} \log \frac{N}{d})$ and the computational cost of SP discussed in Sec. \ref{Sec: Refinement} is $O(a_{m}^2 N)$. Thus, we complete this proof. \end{proof} It is important to check if the sufficient condition $\delta_{6a}<0.083$ holds. How to compute RIC for a matrix, however, is a NP-hard problem. But we can know that RIC is actually related to $a_{m}$, $r$, and $d$. When fixing $r = 3a_{m}$, $d$ must satisfy $O(a_{m})$ such that $\delta_{6a}<0.083$ holds with high probability, implying that sFFT-DT works well under $K=\Theta(N)$. The term, $\tau( \frac{N}{\mu} -Ka_{m})\| \bm{\hat{x}} \|_\infty^{2}$, in Theorem \ref{theorem:sFFT performance without no pruning} also reveals that $K=\Theta(N)$ results in better performance. To further improve this result in Theorem \ref{theorem:sFFT performance without no pruning}, we propose a pruning strategy to prune $\Phi \in \mathbb{C}^{r \times d}$ into $\Phi_{p} \in \mathbb{C}^{r \times O(a)}$, which benefits the recovery performance and computational cost. Specifically, we are able to reduce recovery errors and easily achieve the sufficient condition if $d$ is replaced by $O(a)$ and reduce the computational cost of SP to become $O(K)$. \subsection{Pruning Strategy}\label{Sec: decide a} One can observe from Eq. (\ref{eq:CS Formulation}) that the $j$'th column of $\Phi$ corresponds to the location $k+(j-1)\frac{N}{d}$ and the root $e^{\frac{-i2\pi (k+(j-1)\frac{N}{d})l}{N}}$. The basic idea of pruning is to prune as many locations/roots corresponding to insignificant terms as possible. Here, the pruning strategy contains three steps: \begin{itemize} \item[1.] Estimate the number of collisions, $a$, for each downsampled frequency by singular value decomposition (SVD) for the matrix $\bm{M}$ presented in Eq. (\ref{eq:auxiliary fun of MPT}). \item[2.] Form the polynomial presented in Step (ii) of syndrome decoding, and substitute all roots in $U_{k}$ into the polynomial and reserve the locations with the first $O(a)$ smallest errors in $U_{k}$. \item[3.] According to reserved locations, prune $\Phi$ to yield $\Phi_{p}$. \end{itemize} \subsubsection{Step 1 of Pruning} In Step 1 of the pruning strategy, we estimate $a$'s for all downsampled frequencies. By doing SVD for the matrix in Eq. (\ref{eq:auxiliary fun of MPT}), there are $a_{m}$ singular values for each downsampled frequency. Collect all $\frac{N}{d}a_{m}$ singular values from all downsampled frequencies and index each singular value according to which downsampled frequency it is from. The first $K$ largest singular values will vote which downsampled frequency includes the significant term. Now, we show why the strategy is effective. We redefine the problem in Eq. (\ref{eq:auxiliary fun of MPT}) for generally $K$-sparse signals. Let $S_{s}$ be a set containing all indices of significant terms and let $S_{ns}$ be the one defined for insignificant terms, where $S_{s} \cap S_{ns} = \{ \}$, $S_{s} \cup S_{ns} = \{ 0,1, \ ... \ N -1 \}$, $|S_{s}| = a$ and $|S_{ns}| = d-a$. Thus, the syndrome in Eq. (\ref{eq:MPT obejective fun}) can be rewritten as $ m_{i} = p_{0}z_{0}^{i}+p_{1}z_{1}^{i}+...+p_{N-1}z_{N-1}^{i} = m_{s,i}+m_{ns,i}$, where $ m_{s,i} = \sum_{j \in S_{s} } p_{j}z_{j}^{i}$ and $ m_{ns,i} = \sum_{k \in S_{ns} } p_{k}z_{k}^{i}$. Now, the matrix $\bm{M}$ in Eq. (\ref{eq:auxiliary fun of MPT}) can be rewritten as: \small \begin{equation} \begin{aligned} \bm{M}= \begin{bmatrix} m_{0} & \cdots & m_{a_{m}-1} \\ m_{1} & \cdots & m_{a_{m}} \\ \vdots & \ddots &\\ m_{a_{m}-1} & \cdots & m_{2a_{m}-2} \end{bmatrix}=\bm{M}_{s}+\bm{M}_{ns}= \begin{bmatrix} m_{s,0}+m_{ns,0} & \cdots & m_{s,a_{m}-1}+m_{ns,a_{m}-1} \\ m_{s,1}+m_{ns,1} & \cdots & m_{s,a_{m}}+m_{ns,a_{m}} \\ \vdots & \ddots &\\ m_{s,a_{m}-1}+m_{ns,a_{m}-1} & \cdots & m_{s,2a_{m}-2}+m_{ns,2a_{m}-2} \end{bmatrix}, \end{aligned} \label{eq:formulation of M for general } \end{equation} \normalsize where $\bm{M}_{ns}$ acts like a ``noise'' matrix produced by insignificant components and $\bm{M}_{s}$ comes from significant terms. $\bm{M}$ can also be expressed as: \small \begin{equation} \begin{aligned} \bm{M}=\sum_{i \in S_{s}\cup S_{ns}}p_{i}\bm{z}_{i}\bm{z}_{i}^{T}= \bm{M}_{s}+\bm{M}_{ns}=\sum_{j \in S_s} p_{j}\bm{z}_{j}\bm{z}_{j}^{T} +\sum_{k \in S_{ns}} p_{k}\bm{z}_{k}\bm{z}_{k}^{T}, \label{eq:formulation of another M for general} \end{aligned} \end{equation} \normalsize where $ \bm{z}_{i} = [ z_{i}^{0} \ z_{i}^{1} \ ... \ z_{i}^{a_{m}-1} ]^{T}$ is a column vector, as defined in Eq. (\ref{eq:MPT obejective fun}). It is worth noting that Eq. (\ref{eq:formulation of another M for general}) is similar to SVD. Nevertheless, there are some differences between them: (1) $p_{i}$'s are complex but not real and $\|\bm{z}_{i}\|_{2}$'s are not normalized; (2) $\bm{z}_{i}$'s are not orthogonal vectors; and (3) The actual SVD of $\bm{M}$ is $\bm{M}=\sum_{i \in S_{s}\cup S_{ns}}p_{i}\bm{z}_{i}\bm{z}_{i}^{*}$, where $*$ denotes a conjugate transpose. To alleviate the difference (1), Eq. (\ref{eq:formulation of another M for general}) is rewritten as: \small \begin{equation} \bm{M}=\sum_{j \in S_s} a_{m}|\hat{p}_{j}|\hat{\bm{z}}_{j}\hat{\bm{z}}_{j}^{T}+\sum_{k \in S_{ns}} a_{m}|\hat{p}_{k}|\hat{\bm{z}}_{k}\hat{\bm{z}}_{k}^{T}, \label{eq:transformed formulation of another M for general} \end{equation} \normalsize where $ \hat{\bm{z}}_{i} = \frac{1}{\sqrt{a_{m}}}e^{\sqrt{-1}\theta_{i}}[ z_{i}^{0} \ z_{i}^{1} \ ... \ z_{i}^{a_{m}-1} ]^{T}$ and $\hat{p}_{i}= |p_{i}|e^{-\sqrt{-1}\theta_{i}}$ for $i \in S_{s}\cup S_{ns}$. Thus, we have $\| \hat{\bm{z}}_{i} \|_{2} =1$. As for the difference (3), it can be solved by symmetric SVD (SSVD) \cite{Angelika1988} instead of SVD. However, the singular values of SSVD have been proven to be the same as those of SVD for the same matrix. Thus, Eq. (\ref{eq:transformed formulation of another M for general}) can directly use SVD for matrix $\bm{M}$ to obtain singular values. On the other hand, the difference (2) is inevitable since $\hat{\bm{z}}_{i}$'s are not orthogonal, leading to the fact that the singular values of $\bm{M}$ are not directly equal to the magnitudes of frequencies $|p_{i}|$'s. However, they are actually related. In \cite{Takos2008}, Takos and Hadjicostis actually explore the relationship between the eigenvalues of $\bm{M}$ and signal values. But their proofs are based on real BCH codes, implying $\bm{M}$ is a Hermitian matrix. It is not appropriate for our case because $\bm{M}$ is, in fact, a complex symmetric matrix. Thus, we develop another theorem illustrating the relationship between singular value and signal values. First, Lemma \ref{lemma:singular value of sum of two matrices} in \cite{Hogben2007} illustrates the singular values of sum of matrices. \begin{lemma} \label{lemma:singular value of sum of two matrices} For any matrices $\bm{A} \in \mathbb{C}^{n \times n}$ and $\bm{B}\in \mathbb{C}^{n \times n}$, let $\bm{C}=\bm{A}+\bm{B}$ and let $\sigma_{j}(\cdot)$ be a function returning the $j$'th largest singular value with $\sigma_{1}(\bm{C})\geq \sigma_{2}(\bm{C}) \geq ... \geq \sigma_{n}(\bm{C})$. Then, \begin{equation} \begin{aligned} \sigma_{j}(\bm{A})-\sigma_{1}(\bm{B}) \leq \sigma_{j}(\bm{C}) \leq \sigma_{j}(\bm{A})+\sigma_{1}(\bm{B}), \label{eq:singular value formula} \end{aligned} \end{equation} holds for $1\leq j\leq n$. \end{lemma} Second, for both matrices $\bm{M}_s$ and $\bm{M}_{ns}$ given in Eq. (\ref{eq:formulation of another M for general}), we explore the upper bound of singular values of $\bm{M}_{ns}$ and the lower bound of singular values of $\bm{M}_{s}$, where both bounds are used as the sufficient condition of correctly determining the number $a$ of collisions in aliasing. Specifically, Lemma \ref{lemma:singular value of sum of two matrices} is used to derive the upper bound of singular values of $\bm{M}_{ns}$ whatever $a$ is. But the lower bound of singular values of $\bm{M}_{s}$ is non-trivial only when $a=1$ because it becomes 0 for $a>1$. \begin{lemma} \label{lemma:singular value and M} For any $a$, the singular values of $\bm{M}_{ns}$ satisfy $$ \sigma_{1}(\bm{M}_{ns}) \leq a_{m}dq_{max},$$ where $q_{max} = \max_{k \in S_{ns}} |\bm{\hat{x}}[k]|$. In addition, for $a=1$, the singular values of $\bm{M}_{s}$ satisfy $$ \sigma_{1}(\bm{M_{s}}) \geq a_{m}\epsilon_{min},$$ where $\epsilon_{min} = \min_{j \in S_{s}} |\bm{\hat{x}}[j]|$. \end{lemma} \begin{proof} Since $\bm{M}_{ns}=\sum_{k \in S_{ns} } a_{m}|p_{k}|\hat{\bm{z}}_{k}\hat{\bm{z}}_{k}^{T}$, we have \begin{equation} \begin{aligned} &\sigma_{1}(\bm{M}_{ns}) = \sigma_{1}( \sum_{k \in S_{ns} } a_{m}|p_{k}|\hat{\bm{z}}_{k}\hat{\bm{z}}_{k}^{T})\\ &\leq \sum_{k \in S_{ns} } \sigma_{1}( a_{m}|p_{k}|\hat{\bm{z}}_{k}\hat{\bm{z}}_{k}^{T}) = \sum_{k \in S_{ns} } a_{m}|p_{k}| \\ &\leq a_{m}(d-a)q_{max} \leq a_{m}dq_{max}. \label{eq:max singular value of insignificant term} \end{aligned} \end{equation} Similarity, for $a=1$, $\bm{M}_{s}= a_{m}|p_{j}|\hat{\bm{z}}_{j}\hat{\bm{z}}_{j}^{T}$ with $j \in S_{s}$. Then, $\sigma_{1}(\bm{M}_{s})=a_{m}|p_{j}| \geq a_{m}\epsilon_{min}$. We complete this proof. \end{proof} Combined with Lemma \ref{lemma:singular value of sum of two matrices} and Lemma \ref{lemma:singular value and M}, we can derive the following theorem. \begin{theorem} \label{theorem:successfuly determine a} If $ \epsilon_{min} > 2dq_{max}$ and all downsampled frequencies satisfy $a \leq 1$, then sFFT-DT correctly decides the number of collisions. \end{theorem} \begin{proof} For all downsampled frequencies satisfying $a = 1$, Lemma \ref{lemma:singular value of sum of two matrices} and Lemma \ref{lemma:singular value and M} induce the fact: $$a_{m}\epsilon_{min}- a_{m}dq_{max} \leq \sigma_{1}(\bm{M}_{s})-\sigma_{1}(\bm{M}_{ns}) \leq \sigma_{1}(\bm{M}).$$ In addition, for all downsampled frequencies with $a=0$, $$ \sigma_{1}(\bm{M})= \sigma_{1}(\bm{M}_{ns}) \leq a_{m}dq_{max}.$$ As a result, if $a_{m}dq_{max} < a_{m}\epsilon_{min}- a_{m}dq_{max}$, it implies that sFFT-DT can correctly determine the number of collisions, ({\em i.e.}, distinguish the downsampled frequencies with $a=0$ and those with $a=1$, by finding the first $K$ largest singular values). \end{proof} Remark: It should be noted that Theorem \ref{theorem:successfuly determine a} only holds for all downsampled frequencies with $a \leq 1$. The probability that there is no downsampled frequency with $a > 1$ shown in Lemma \ref{lemma:probability of bin} is at most $Pr(d,1)$. By setting $d$ larger, it means that Theorem \ref{theorem:successfuly determine a} holds with higher probability as $1-Pr(d,1)$. In fact, Theorem \ref{theorem:successfuly determine a} also reveals that fact that it is more difficult to satisfy $\epsilon_{min} > 2dq_{max} $ when $d$ becomes large enough. In other words, one needs to force $K=\Theta(N)$ such that $d=O(\frac{N}{K})=O(1)$ in order to correctly determine $a$. \subsubsection{Step 2 of Pruning} After determining $a$'s for all downsampled frequencies, Step 2 of the pruning strategy runs the following procedure to know which locations should be pruned: \begin{itemize} \item[(a).] Solve $ \tilde{c} = (\bm{M}_{s}+\bm{M}_{ns})^{-1}(\bm{m}_{s}+\bm{m}_{s})$. \item[(b).] Let $\tilde{P}(z)=z^{a}+\tilde{c}[a-1]\tilde{z}^{a-1}+...+\tilde{c}[1]z+\tilde{c}[0].$ \item[(c).] $\tilde{Z}$ is the set of collecting all $z \in U_{k}$ with the first $O(a)$ smallest $|\tilde{P}(z)|$. \end{itemize} This procedure is similar to syndrome decoding except that Step (ii) in Sec. \ref{ssec:MPT} is changed. As mentioned above, due to the ill-conditioned problem such as Wilkinson's polynomial, the problem of approximating the roots, given the coefficients with noisy perturbation, is ill-conditioned. Instead of finding roots by solving the polynomial, since the set including all candidate roots, $U_{k}$, is finite, we substitute all candidate roots in $U_{k}$ into the polynomial and store the roots with the first $O(a)$ smallest errors in the set $\tilde{Z}$, as also adopted in \cite{Takos2008}. \subsubsection{Step 3 of Pruning} By feeding $\tilde{Z}$ into Step 3 of the pruning strategy, we can decide which columns of $\bm{\Phi}$ should be pruned according to the following criterion. If the root belongs to $\tilde{Z}$, its corresponding column is preserved; otherwise, it is pruned. Finally, let $\Phi_{p}$ be the outcome after pruning and let it be used to replace $\Phi$ in Eq. (\ref{eq:CS Formulation}). \subsection{Non-iterative sFFT-DT: Algorithm for Generally K-Sparse Signals}\label{Sec: algorithm for general K sparse} For generally $K$-sparse signals, sFFT-DT solves the aliasing problem once, as shown in Algorithm 2, which integrates the pruning strategy and CS-based approach. The function \textbf{main} contains four parts. For clarity, Fig. \ref{fig:flowchart} illustrates the flowchart of sFFT-DT for generally $K$-sparse signals and we describe each part as follows. Part 1: In Lines 2-9, several downsampled signals are generated for performing FFTs with different shift factors. Specifically, the downsampled signals in Lines 2-5 are prepared for the pruning strategy and those in Lines 6-9 are used for CS recovery problem. To distinguish between these two, the signals for Lines 2-5 are represented by $x_{d}$ and those for Lines 6-9 are represented by $x_{s}$. Part 2: Lines 11-21 run the Step 1 of the pruning strategy and decide the number of significant terms in the downsampled frequencies. $V_{sin}$ is a set used to save all singular values of $\bm{M}$'s (defined in Eq. (\ref{eq:formulation of M for general })) corresponding to frequencies. Part 3: Lines 23-25 run the Step 2 and Step 3 of the pruning strategy, where $\tilde{Z}$ collects the roots corresponding to insignificant terms. According to $\tilde{Z}$, we can prune $\Phi$ and output $\Phi_{p}$. Part 4: Given $\Phi_{p}$, Lines 26-28 solve the CS recovery problem by Subspace Pursuit, as mentioned in Sec. \ref{Sec: Refinement}. \begin{figure}[t] \begin{minipage}[b]{.98\linewidth} \centering{\epsfig{figure=flowchart_G.eps,width=5.0 in}} \end{minipage} \hfill \caption{Flowchart of sFFT-DT for generally $K$-sparse signals.} \label{fig:flowchart} \end{figure} \begin{algorithm}[h] \fontsize{11pt}{0.9em}\selectfont \setlength{\abovecaptionskip}{0pt} \setlength{\belowcaptionskip}{0pt} \caption{sFFT-DT for generally $K$-sparse signals.} \label{Table:our algorithm for general K-sparse signal} \begin{tabular}[t]{p{17.7cm}l} \textbf{Input:} $\bm{x}$, $K$;\quad \textbf{Output:} $\bm{\hat{x}}_{out}$; \\ \textbf{Initialization:} $\bm{\hat{x}}_{out}=\mathbf{0}$, $ d=O(\frac{N}{K})$, $R=\{ \}$, $V_{sin}=\{ \}$, $a_{m}$; \\ \hline\hline 01. \textbf{function} \textbf{main}()\\ 02. \quad\textbf{for} $l = 0$ to $a_{m} -1$ \\ 03. \quad\quad $x_{d,2l}[k]=x[dk+2l]$ for $ k\in [0,\frac{N}{d}-1]$;\\ 04. \quad\quad $x_{d,2l+1}[k]=x[dk+2l+1]$ for $ k\in [0,\frac{N}{d}-1]$;\\ 05. \quad\textbf{end for}\\ 06. \quad Generate $\{n_{0},n_{1},...n_{3a_{m}-1} \}$ in Sec. \ref{Sec: Refinement};\\ 07. \quad\textbf{for} $l = 0$ to $3a_{m} -1$ \\ 08. \quad\quad $x_{s,l}[k]=x[dk+n_{l}]$ for $ k\in [0,\frac{N}{d}-1]$;\\ 09. \quad\textbf{end for}\\ 10. \quad Do FFT of all $\bm{x}_{d}$'s, $\bm{x}_{s}$'s to obtain $\bm{\hat{x}}_{d}$'s and $\bm{\hat{x}}_{s}$'s.\\ 11. \quad \textbf{for} $k = 0$ to $ \frac{N}{d}-1$\\ 12. \quad\quad \quad $m_{j}= \hat{x}_{d,j}[k]$ for $j \in [0,2a_{m}-1]$; \\ 13. \quad\quad \quad Use $m_{j}$'s to form $\bm{M}$ defined in Sec. \ref{Sec: decide a}; \\ 14. \quad\quad \quad Do SVD of $\bm{M}$ and put singular values into \\ \quad\quad\quad\quad \quad the set $V_{sin}$; \\ 15. \quad \textbf{end for} \\ 16. \quad Find the first $K$ largest singular values from \\ \quad\quad\quad $V_{sin}$ and save them as $\sigma_{1}, \sigma_{2},...,\sigma_{K}$.\\ 17. \quad \textbf{for} $l = 1$ to $K$\\ 18. \quad\quad \textbf{if} ($\sigma_{l}$ originates from the $k$'th frequency) \\ 19. \quad \quad \quad $a$ of the $k$'th frequency increases by 1;\\ 20. \quad \quad \textbf{end if}\\ 21. \quad \textbf{end for} \\ 22. \quad \textbf{for} $k = 0$ to $ \frac{N}{d}-1$\\ 23. \quad \quad $m_{j}= \hat{x}_{d,j}[k]$ for $j \in [0,2a_{m}-1]$; \\ 24. \quad \quad Run Step 2 and 3 of pruning strategy in Sec. \ref{Sec: decide a};\\ 25. \quad \quad and output $\Phi_{p}$.\\ 26. \quad \quad $m_{j}= \hat{x}_{s,j}[k]$ for $j \in [0,3a_{m}-1]$; \\ 27. \quad \quad Solve Eq. (\ref{eq:CS Formulation}) given $\Phi_{p}$ by SP and assign \\ 28. \quad \quad $\bm{\hat{x}}_{out}[k+j\frac{N}{d}]=$$\bm{s}_{out}[j]$ for $j \in [0,d-1]$. \\ 29. \quad \textbf{end for} \\ 30. \textbf{end} \textbf{function}\\ \hline \end{tabular} \end{algorithm} \renewcommand\arraystretch{1} \begin{table}[t] \fontsize{7.5pt}{1em}\selectfont \centering \setlength{\abovecaptionskip}{0pt} \setlength{\belowcaptionskip}{4pt} \caption{The effect of pruning in terms of computational cost and recovery performance under $N=2^{24}$ and $SNR(\bm{\hat{x}}_{s})=30$ $dB$.} \label{Table: pruning comparision} \doublerulesep=2pt \begin{tabular}[tc]{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|} \hline {\LARGE \textcolor{white}{o}}K& $2^{8}$& $2^{9}$& $2^{10}$ & $2^{11}$& $2^{12}$ & $2^{13}$ & $2^{14}$ & $2^{15}$ & $2^{16}$ & $2^{17}$ & $2^{18}$ & $2^{19}$ & $2^{20}$ \\ \hline Time Cost without Pruning (Sec)& 5.731& 4.287& 3.315 & 3.813 & 4.459 & 8.681 & 15.10 & 23.61 & 50.27 & 101.22 & 217.28 & 463.21 & 989.41 \\ \hline Time Cost with Pruning (Sec)& 0.021& 0.022 & 0.033 & 0.053 & 0.101 & 0.211 & 0.321 & 0.674 & 1.237 & 2.524 & 5.138 & 9.918 &19.539 \\ \hline $SNR(\bm{\hat{x}}_{out})$ without Pruning (dB)& -66.1& -51.9& -36.4 & -24.6 & -13.9 & -2.37 & 11.34 & 21.6 & 28.7 & 29.3 & 29.7 & 29.9 & 29.9 \\ \hline $SNR(\bm{\hat{x}}_{out})$ with Pruning (dB)& 4.67& 10.1& 14.8 & 20.1 & 23.1 & 24.9 & 27.7 & 29.7 & 29.9 & 29.9 & 29.9 & 29.9 & 29.9 \\ \hline \end{tabular} \end{table} \begin{table}[t] \fontsize{7.5pt}{1em}\selectfont \centering \setlength{\abovecaptionskip}{0pt} \setlength{\belowcaptionskip}{4pt} \caption{The effect of pruning in terms of computational cost and recovery performance under $N=2^{24}$ and $SNR(\bm{\hat{x}}_{s})=20$ $dB$.} \label{Table: pruning comparision 2} \doublerulesep=2pt \begin{tabular}[tc]{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|} \hline {\LARGE \textcolor{white}{o}}K& $2^{8}$& $2^{9}$& $2^{10}$ & $2^{11}$& $2^{12}$ & $2^{13}$ & $2^{14}$ & $2^{15}$ & $2^{16}$ & $2^{17}$ & $2^{18}$ & $2^{19}$ & $2^{20}$\\ \hline Time Cost without Pruning (Sec)& 5.693& 4.436& 3.761 & 3.903 & 4.634 & 8.511 & 16.20 & 31.61 & 51.92 & 108.49 & 229.31 & 492.01 &1032.94 \\ \hline Time Cost with Pruning (Sec)& 0.021& 0.023 & 0.031 & 0.056 & 0.097 & 0.187 & 0.335 & 0.622 & 1.343 & 2.724 & 5.605 & 10.492 &20.034 \\ \hline $SNR(\bm{\hat{x}}_{out})$ without Pruning (dB)& -66.4& -53.3& -40.4 & -28.2 & -15.9 & -4.97 & 9.19 & 19.3 & 19.9& 19.9& 19.9& 19.9& 19.9 \\ \hline $SNR(\bm{\hat{x}}_{out})$ with Pruning (dB)& 0.04& 1.56 & 6.78 & 12.1 & 16.4 & 18.1 & 19.3 & 19.7 & 19.9& 19.9& 19.9& 19.9& 19.9 \\ \hline \end{tabular} \end{table} \begin{table}[t] \fontsize{7.5pt}{1em}\selectfont \centering \setlength{\abovecaptionskip}{0pt} \setlength{\belowcaptionskip}{4pt} \caption{The effect of pruning in terms of computational cost and recovery performance under $N=2^{24}$ and $SNR(\bm{\hat{x}}_{s})=10$ $dB$.} \label{Table: pruning comparision 3} \doublerulesep=2pt \begin{tabular}[tc]{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|} \hline {\LARGE \textcolor{white}{o}}K& $2^{8}$& $2^{9}$& $2^{10}$ & $2^{11}$& $2^{12}$ & $2^{13}$ & $2^{14}$ & $2^{15}$ & $2^{16}$ & $2^{17}$ & $2^{18}$ & $2^{19}$ & $2^{20}$ \\ \hline Time Cost without Pruning (Sec)& 5.611& 4.627& 3.802 & 3.892 & 4.561 & 8.639 & 16.39 & 30.32 & 59.14& 124.12 & 273.21 & 522.52& 1095.42 \\ \hline Time Cost with Pruning (Sec)& 0.023& 0.029 & 0.038 & 0.052 & 0.125 & 0.212 & 0.326 & 0.644 & 1.227 & 2.321 & 4.732 & 9.327 & 19.394\\ \hline $SNR(\bm{\hat{x}}_{out})$ without Pruning (dB)& -73.1& -60.6& -48.5 & -36.3 & -24.3 & -11.6 & 2.27 & 9.53 & 9.97 & 9.98 & 9.99 & 9.99 & 9.99\\ \hline $SNR(\bm{\hat{x}}_{out})$ with Pruning (dB)& -1.19& -0.41& 0.85 & 2.59 & 6.03 & 8.83 & 9.69 & 9.94 & 9.98 & 9.99 & 9.99 & 9.99 & 9.99 \\ \hline \end{tabular} \end{table} \begin{figure*}[!t] \begin{minipage}[b]{.48\linewidth} \centering{\epsfig{figure=ComputationNoise.eps,width=3.45in}} \centerline{(a)} \end{minipage} \begin{minipage}[b]{.48\linewidth} \centering{\epsfig{figure=ComutationFixedK_General.eps,width=3.45in}} \centerline{(b)} \end{minipage} \hfill \caption{Comparison between non-iterative sFFT-DT and FFTW for generally $K$-sparse signals. (a) Computational time vs. sparsity under $N=2^{24}$ and $a_{m}=3$. (b) Computational time vs. signal dimension under $K=2^{12}$ and $a_{m}=3$. } \label{fig:general computational time} \end{figure*} \subsection{Computational Complexity of sFFT-DT for Generally $K$-Sparse Signals}\label{Sec: Complexity for General Ksparse Signal} In this section, we analyze the computational cost of sFFT-DT for generally K-sparse signals based on Theorem \ref{theorem:probability of sfftdt v2} for the four parts of the Main function. Part 1 is to do FFT for downsampled signals, and it costs $ O( a_{m} \frac{N}{d}\log \frac{N}{d})$. Part 2 solves SVD of $\bm{M} \in \mathbb{C}^{a_{m}\times a_{m}}$ for each downsampled frequency. Since SVD will totally run $ O(\frac{N}{d})$ times, Part 2 will cost $ O( \frac{N}{d} a_{m}^{3})$, according to \cite{Angelika1988}. Part 3 costs $O(\frac{N}{d} a_{m}^2)$ for computing coefficients of polynomial and $O(N)$ for estimating $|\tilde{P}(z)|$ for all $z \in U_{k}$ in Sec. \ref{Sec: decide a}. Finally, CS recovery problem in Part 4 depends on the cost of SP. With the pruning strategy, SP costs $O(a_{m}rd)=O(a_{m}^{3})$. Thus, the total cost in Part 4 is $O(\frac{N}{d}a_{m}^{3})$ since SP runs $O(\frac{N}{d})$ times, as described in Sec. \ref{Sec: Refinement}. Thus, the total computational cost of sFFT-DT is bounded by $\max(O( a_{m} \frac{N}{d}\log \frac{N}{d}),O(N))$. Consequently, the computational cost of sFFT-DT for generally $K$-sparse signals still is impacted by $a_{m}$ and $d$ as in the exactly-$K$ sparse case. If significant frequencies distribute uniformly, both $a_{m}$ and $d$ can be set based on Theorem \ref{theorem:probability of sfftdt v2}. In this case, since $a_{m}$ is a constant, the computational cost is bounded by Part 1 and Part 3, which is $\max(O(K \log K),O(N))$. It should be noted that the Big-O constant of $O(N)$ is very small because only Step 2 of pruning in Line 24 involves $O(N)$ and the operation of estimating $|\tilde{P}(z)|$ for all $z \in U_{k}$ is simple. Thus, as shown in our experimental results, $O(N)$ does not dominate the computational cost of sFFT-DT. But the Big-O constants of the generally $K$-sparse case are still larger than those of the exactly $K$-sparse case because the former needs more syndromes. \subsection{Simulation Results for Generally $K$-Sparse Signals}\label{Sec: experimental result of General} The simulation environment is similar to the one described in Sec. \ref{Sec: Experimental Results}. We only compare sFFT-DT with FFTW because sFFT \cite{Haitham2012}\cite{Haitham2012_1} does not release the code and the code of sFFT for the generally $K$-sparse case is difficult to implement (as mentioned in the footnote on Page 3). Therefore, no experimental results for generally $K$-sparse signals were shown in their papers or websites. Here, the test signals were generated from the mixture Gaussian model as: \small \begin{equation} \hat{x} \sim p\mathcal{N}\left( 0,\sigma_{on}^{2} \right)+\left( 1-p \right) \mathcal{N} \left( 0,\sigma_{off}^{2} \right), \label{eq:signalproduce} \end{equation} \normalsize where $ p=\frac{K}{N}$ is the active probability that decides which Gaussian model is used and $\sigma_{on}>\sigma_{off}$. For each test signal, its significant terms is defined as $\bm{\hat{x}}_{s}$, as described in Sec. \ref{Sec: sFFT-DT: General K-Sparse}, and $\bm{\hat{x}}_{out}$ is the output signal obtained from sFFT-DT. We also define $SNR(\cdot)$ as: \small \begin{equation} SNR(\bm{\bar{x}})=10 \log_{10} \frac{MSE(\bm{\bar{x}})}{MSE(\bm{\hat{x}}-\bm{\bar{x}})}, \label{Eq: SNR_ori} \end{equation} \normalsize where $MSE( \cdot )$ is the function of calculating the mean squared error. If $\bm{\bar{x}}=\bm{\hat{x}}_{s}$, then $SNR(\bm{\hat{x}}_{s})$ means the signal-to-noise ratio between significant terms and insignificant terms. In our simulations, the parameter setting was $d=\frac{N}{32K}$, $a_{m}=3$, and $SNR(\bm{\hat{x}}_{s})$ ranges from $10$ to $30$ dB. Tables \ref{Table: pruning comparision}, \ref{Table: pruning comparision 2}, and \ref{Table: pruning comparision 3} show the efficiency of pruning. We can see that sFFT-DT with pruning outperforms its counterpart without pruning in terms of computational cost and recovery performance. The performance degrades when $\frac{N}{K}$ becomes larger as predicted in Theorem \ref{theorem:sFFT performance without no pruning}. Moreover, we can observe from Table \ref{Table: pruning comparision} $\sim$ Table \ref{Table: pruning comparision 3} that no matter $SNR(\bm{\hat{x}}_{out})$ is, the condition for achieving perfect approximation in sFFT-DT, {\em i.e.}, $SNR(\bm{\hat{x}}_{out})\approx SNR(\bm{\hat{x}}_s)$, is always $\frac{N}{K} \leq 2^9$. The phenomenon is consistent with the reconstruction error bound in Theorem \ref{theorem:sFFT performance without no pruning}. Specifically, the reconstruction error bound, $ C_{\delta_{6a_{m}}}\sqrt{ \| \bm{\hat{x}}_{ns}\|_2^2 + \tau( \frac{N}{\mu} -Ka_{m})\| \bm{\hat{x}} \|_\infty^{2} }$, is affected by $ \|\bm{\hat{x}}_{ns}\|_2^2 $ and $\tau( \frac{N}{\mu} -Ka_{m})\| \bm{\hat{x}} \|_\infty^{2}$. However, when $ \frac{N}{K}$ is small, $\tau( \frac{N}{\mu} -Ka_{m})\| \bm{\hat{x}} \|_\infty^{2} \rightarrow 0$ and thus $\| \bm{\hat{x}}-\bm{\hat{x}}_{out} \|_2$ is equal to $C_{\delta_{6a_{m}}} \| \bm{\hat{x}}_{ns}\|_2 $. In other words, the reconstruction error bound is linear to $\| \bm{\hat{x}}_{ns}\|_2 $. This is a good property as the reconstruction quality of sFFT-DT is inversely proportional to the energy of insignificant terms, $ \| \bm{\hat{x}}_{ns}\|_2 $. The comparison of computational time between sFFT-DT and FFTW is depicted in Fig. \ref{fig:general computational time}. Fig. \ref{fig:general computational time}(a) shows the results of computational time versus signal sparsity under fixed $N$. It is observed that sFFT-DT is remarkably faster than FFTW, except for the cases with $K \geq 2^{15}$. Fig. \ref{fig:general computational time}(b) shows the results of computational time versus signal dimension under fixed $K$. It is apparent that the computational time of sFFT-DT is not related to $N$. In sum, compared with \cite{Haitham2012}\cite{Haitham2012_1}, the proposed sFFT-DT for generally $K$-sparse signals is the first algorithm with the reasonable Big-O constants and is verified to be faster than FFTW. \section{Conclusions}\label{Sec: Conclusions} We have presented new sparse Fast Fourier Transform methods based on downsampling in the time domain (sFFT-DT) for both exactly $K$-sparse and generally $K$-sparse signals in this paper. The accurate computational cost and theoretical performance lower bound of sFFT-DT are proven for exactly $K$-sparse signals. We also derive the Big-O constants of computational complexity of sFFT-DT and show that they are smaller than those of MIT's methods \cite{Haitham2012}\cite{Haitham2012_1}\cite{Ghazi2013}. In addition, sFFT-DT is more hardware-friendly, compared with other algorithms, since all operations of sFFT-DT are linear and involved in an analytical solution. On the other hand, previous works, such as \cite{Haitham2012}\cite{Haitham2012_1}\cite{Ghazi2013}, are based on the assumption that sparsity $K$ is known in advance. To address this issue, we proposed a simple solution to estimate $K$ and relax this impractical assumption. We show that the extra cost for deciding $K$ is the same as that required for sFFT-DT with known $K$. Moreover, we extend sFFT-DT to generally $K$-sparse signals in this paper. To solve the interference from insignificant frequencies in aliasing, we first reformulate the aliasing problem as CS-based model solved by subspace pursuit and present a pruning strategy to further improve the recovery performance and computational cost. Overall, theoretical complexity analyses and simulation results demonstrate that our sFFT-DT outperforms the state-of-the-art. \section{Acknowledgment} This work was supported by National Science Council under grants NSC 100-2628-E-001-005-MY2 and NSC 102-2221-E-001-022-MY2. \section{Appendix}\label{Sec: Appendix} \footnotesize The analytical solution of solving Step (ii) in syndrome decoding with $a=2$ is \begin{equation} \begin{aligned} &c_{d}= \left| \begin{array}{cc} m_{0} & m_{1} \\ m_{1} & m_{2} \\ \end{array} \right|,\\ \displaystyle &c_{0}= (\frac{1}{c_{d}})\left| \begin{array}{cc} -m_{2} & m_{1} \\ -m_{3} & m_{2} \\ \end{array} \right|,\ \displaystyle c_{1}= (\frac{1}{c_{d}})\left| \begin{array}{cc} m_{0} & -m_{2} \\ m_{1} & m_{3} \\ \end{array} \right|,\\ \displaystyle &z_{0}=\frac{1}{2}[-c_{1}-(c_{1}^{2}-4c_{0})^{\frac{1}{2}}], \ \displaystyle z_{1}=\frac{1}{2}[-c_{1}+(c_{1}^{2}-4c_{0})^{\frac{1}{2}}],\\ &p_{d}=z_{1}-z_{0},\\ \displaystyle &p_{0}= (\frac{1}{p_{d}})\left| \begin{array}{cc} m_{0} & 1 \\ m_{1} & z_{1} \\ \end{array} \right|,\ p_{1}= m_{0}-p_{0}. \end{aligned} \label{eq:MPT analytic solutions} \end{equation} Similarly, the solution with $a=3$ is \begin{equation} \begin{aligned} \displaystyle&c_{d}= \left| \begin{array}{ccc} m_{0} & m_{1} & m_{2} \\ m_{1} & m_{2} & m_{3}\\ m_{2} & m_{3} & m_{4}\\ \end{array} \right|,\\ \displaystyle&c_{0}= (\frac{1}{c_{d}})\left| \begin{array}{ccc} -m_{3} & m_{1} & m_{2} \\ -m_{4} & m_{2} & m_{3} \\ -m_{5} & m_{3} & m_{4} \\ \end{array} \right|,\ c_{1}= (\frac{1}{c_{d}})\left| \begin{array}{ccc} m_{0} & -m_{3} & m_{1} \\ m_{1} & -m_{4} & m_{2} \\ m_{2} & -m_{5} & m_{3} \\ \end{array} \right|, c_{2}= (\frac{1}{c_{d}})\left| \begin{array}{ccc} m_{0} & m_{1} & -m_{3} \\ m_{1} & m_{2} & -m_{4} \\ m_{2} & m_{3} & -m_{5} \\ \end{array} \right|,\\ \displaystyle&z_{0}=-\frac{c_{2}}{3}-A-B, z_{1}=-\frac{c_{2}}{3}-W_{1}A-W_{2}B, z_{2}=-\frac{c_{2}}{3}-W_{2}A-W_{1}B,\\ \displaystyle&A=\{ (\frac{c_{0}}{2} - \frac{c_{1}c_{2}}{6}+\frac{c^{3}_{2}}{27})-[ (\frac{c_{0}}{2}-\frac{c_{1}c_{2}}{6}+\frac{c_{2}^{3}}{27} )^{2} + (\frac{c{1}}{3} - \frac{c_{2}^{2}}{9})^{3} ]^{\frac{1}{2}} \}^{\frac{1}{3}},\\ \displaystyle&B=\frac{-(\frac{c_{1}}{3}-\frac{c_{2}^{2}}{9})}{A},\\ \displaystyle&W_{1}=\frac{-1}{2}+\frac{\sqrt{-3}}{2}, W_{2}=\frac{-1}{2}-\frac{\sqrt{-3}}{2},\\ \displaystyle&p_{d}=\left| \begin{array}{ccc} 1 & 1 & 1 \\ z_{0} & z_{1} & z_{2}\\ z_{0}^{2} & z_{1}^{2} & z_{2}^{2}\\ \end{array} \right|, p_{0}= (\frac{1}{p_{d}})\left| \begin{array}{ccc} m_{0} & 1 & 1 \\ m_{1} & z_{1} & z_{2}\\ m_{2} & z_{1}^{2} & z_{2}^{2}\\ \end{array} \right|, p_{1}= (\frac{1}{p_{d}})\left| \begin{array}{ccc} 1 & m_{0} & 1 \\ z_{0} & m_{1} & z_{2}\\ z_{0}^{2} & m_{2} & z_{2}^{2}\\ \end{array} \right|, p_{2}= 1-p_{0}-p_{1}. \end{aligned} \label{eq:MPT analytic solutions with a3} \end{equation} Then, the solution with $a=4$ is \begin{equation*} \begin{aligned} \displaystyle&c_{d}= \left| \begin{array}{cccc} m_{0} & m_{1} & m_{2} & m_{3} \\ m_{1} & m_{2} & m_{3} & m_{4}\\ m_{2} & m_{3} & m_{4} & m_{5}\\ m_{3} & m_{4} & m_{5} & m_{6}\\ \end{array} \right|,\\ \displaystyle&c_{0}= (\frac{1}{c_{d}})\left| \begin{array}{cccc} -m_{4} & m_{1} & m_{2} & m_{3}\\ -m_{5} & m_{2} & m_{3} & m_{4}\\ -m_{6} & m_{3} & m_{4} & m_{5}\\ -m_{7} & m_{3} & m_{5} & m_{6}\\ \end{array} \right|,\ c_{1}= (\frac{1}{c_{d}})\left| \begin{array}{cccc} m_{0} & -m_{4} & m_{2} & m_{3}\\ m_{1} & -m_{5} & m_{3} & m_{4}\\ m_{2} & -m_{6} & m_{4} & m_{5}\\ m_{3} & -m_{7} & m_{5} & m_{6}\\ \end{array} \right|,\\ \displaystyle&c_{2}= (\frac{1}{c_{d}})\left| \begin{array}{cccc} m_{0} & m_{1} & -m_{4} & m_{3} \\ m_{1} & m_{2} & -m_{5} & m_{4}\\ m_{2} & m_{3} & -m_{6} & m_{5}\\ m_{3} & m_{4} & -m_{7} & m_{6}\\ \end{array} \right|,\ c_{3}= (\frac{1}{c_{d}})\left| \begin{array}{cccc} m_{0} & m_{1} & m_{2} & -m_{4} \\ m_{1} & m_{2} & m_{3} & -m_{5}\\ m_{2} & m_{3} & m_{4} & -m_{6}\\ m_{3} & m_{4} & m_{5} & -m_{7}\\ \end{array} \right|, \end{aligned} \end{equation*} \begin{equation} \begin{aligned} \displaystyle&z_{0}=\frac{1}{2}\{ -(\frac{c_{3}}{2}+A) - [ (\frac{c_{3}}{2}+A)^{2}-4(Y+B) ]^{\frac{1}{2}} \}, z_{1}=\frac{1}{2}\{ -(\frac{c_{3}}{2}+A) + [ (\frac{c_{3}}{2}+A)^{2}-4(Y+B) ]^{\frac{1}{2}} \},\\ \displaystyle&z_{2}=\frac{1}{2}\{ -(\frac{c_{3}}{2}-A) - [ (\frac{c_{3}}{2}-A)^{2}-4(Y-B) ]^{\frac{1}{2}} \}, z_{3}=\frac{1}{2}\{ -(\frac{c_{3}}{2}-A) + [ (\frac{c_{3}}{2}-A)^{2}-4(Y-B) ]^{\frac{1}{2}} \},\\ \displaystyle&A=\frac{1}{2}(c_{3}^2-4c_{2}+8Y)^{\frac{1}{2}},\ B=\frac{c_{3}Y-c_{1}}{A},\ Y=\frac{c_{2}}{6}-C-D,\\ \displaystyle&C=[G+(G^{2}+H^{3})^{\frac{1}{2}}]^{\frac{1}{3}},\ D=\frac{-H}{C},\ G=\frac{1}{432}(72c_{0}c_{2}+9c_{1}c_{2}c_{3}-27c_{1}^{2}-27c_{0}c_{3}^2-2c_{2}^{3}),\\ \displaystyle&H=\frac{1}{36}(3c_{1}c_{3}-12c_{0}-c_{2}^{2}),\\ \displaystyle&p_{d}=\left| \begin{array}{cccc} 1 & 1 & 1 & 1 \\ z_{0} & z_{1} & z_{2} & z_{3}\\ z_{0}^{2} & z_{1}^{2} & z_{2}^{2} & z_{3}^{2}\\ z_{0}^{3} & z_{1}^{3} & z_{2}^{3} & z_{3}^{3}\\ \end{array} \right|, p_{0}= (\frac{1}{p_{d}})\left| \begin{array}{cccc} 1 & 1 & 1 & 1\\ m_{1} & z_{1} & z_{2} & z_{3}\\ m_{2} & z_{1}^{2} & z_{2}^{2} & z_{3}^{2}\\ m_{3} & z_{1}^{3} & z_{2}^{3} & z_{3}^{3}\\ \end{array} \right|, p_{1}= (\frac{1}{p_{d}})\left| \begin{array}{cccc} 1 & 1 & 1 & 1 \\ z_{0} & m_{1} & z_{2} & z_{3}\\ z_{0}^{2} & m_{2} & z_{2}^{2} & z_{3}^{2}\\ z_{0}^{3} & m_{3} & z_{2}^{3} & z_{3}^{3}\\ \end{array} \right|,\\ \displaystyle&p_{2}= (\frac{1}{p_{d}})\left| \begin{array}{cccc} 1 & 1 & 1 & 1 \\ z_{0} & z_{1} & m_{1} & z_{3}\\ z_{0}^{2} & z_{1}^{2} & m_{2} & z_{3}^{2}\\ z_{0}^{3} & z_{1}^{3} & m_{3} & z_{3}^{3}\\ \end{array} \right|, p_{3}= 1-p_{0}-p_{1}-p_{2}. \end{aligned} \label{eq:MPT analytic solutions with a4} \end{equation} \ifCLASSOPTIONcaptionsoff \newpage \fi \bibliographystyle{IEEEbib}
{'timestamp': '2015-05-25T02:05:34', 'yymm': '1407', 'arxiv_id': '1407.8315', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8315'}
arxiv
\section*{Abstract} Activity in the human brain moves between diverse functional states to meet the demands of our dynamic environment, but fundamental principles guiding these transitions remain poorly understood. Here, we capitalize on recent advances in network science to analyze patterns of functional interactions between brain regions. We use dynamic network representations to probe the landscape of brain reconfigurations that accompany task performance both within and between four cognitive states: a task-free resting state, an attention-demanding state, and two memory-demanding states. Using the formalism of hypergraphs, we identify the presence of groups of functional interactions that fluctuate coherently in strength over time both within (task-specific) and across (task-general) brain states. In contrast to prior emphases on the complexity of many dyadic (region-to-region) relationships, these results demonstrate that brain adaptability can be described by common processes that drive the dynamic integration of cognitive systems. Moreover, our results establish the hypergraph as an effective measure for understanding functional brain dynamics, which may also prove useful in examining cross-task, cross-age, and cross-cohort functional change. \section*{Author Summary} The human brain is a complex system in which the interactions of many billions of neurons give rise to a fascinating range of human behaviors. In response to its changing environment -- for example, in situations involving rest, memory, focused attention, or learning -- the brain dynamically switches between distinct patterns of functional activation. Despite the wealth of neuroimaging data available, the immense complexity of the brain makes the identification of fundamental principles guiding this task-based organization of neural activity a distinct challenge. Here, we apply new techniques from dynamic network theory to describe interactions between brain regions as an evolving network; this provides a framework for understanding these time-dependent interactions in terms of organizing characteristics of the whole network. We examine patterns of correlated neural activity during four states: a resting state, an attention-demanding state, and two memory-demanding states. Using network science techniques, we identify groups of brain network interactions that change cohesively together over time, both within individual tasks and across all tasks. By developing tools to analyze the size and spatial distributions of these groups, we quantify significant differences between properties of brain network dynamics in different tasks. This work demonstrates that these techniques quantitatively characterize evolving task-based organization of neural activity and provide a promising method for investigating how brain network properties of individuals correspond to performance on cognitive tasks. \section*{Introduction} An essential characteristic of the human brain is the ability to transition between functional states in synchrony with changing demand. A central focus in neuroscience involves quantifying this adaptability by delineating changes in regional blood-oxygen-level-dependent (BOLD) signal associated with different cognitive tasks, or between task states and task-free (resting \cite{Raichle2001, Damoiseux2006}) states \cite{Fox2005,Hampson2010}. However, this approach, which examines the magnitude of brain activity alone, is unable to completely describe the correlation structure linking spatially segregated neural circuits. Recent advances in network science provide tools to represent and characterize the functional interactions between brain regions forming cognitive systems. In this formalism, brain regions are represented as network nodes and functional connections (estimated by statistical similarities between BOLD signals \cite{friston_functional_2011}) are represented as network edges \cite{Bassett2006a,Bullmore2009}. These approaches enable the statistically principled examination of large-scale neural circuits underlying cognitive processes. Moreover, they have enabled quantitative comparisons \emph{between} circuits \cite{Mennes2010,Cole2013}. A critical open question remains: Do functional correlations evolve independently within and across brain states? Or do they evolve in sets, each set controlled by a common regulatory driver? To answer this question, we estimate brain functional networks in one minute time intervals as 86 participants engaged in four task states: a task-free resting state, an attention-demanding state, and two memory-demanding states. We treat the evolving patterns of functional connectivity as temporal networks \cite{Bassett2011b,Bassett2012b,Bassett2013a,mantzaris_dynamic_2013,Doron2012,Sieben2013a} and estimate the pairwise correlation between the strengths of functional interactions over time. We demonstrate the existence of groups of functional interactions (\emph{hyperedges} \cite{bassett_cross-linked_2013}) which display similar changes in strength within and across task states. We characterize hyperedges within and across task states according to their structure, anatomy, and task specificity. These analyses provide a unique and novel window into the adaptability of the brain as it transitions between states and offer quantitative statistics for the comparison of such adaptability across subject cohorts. \section*{Methods} \subsection*{Imaging} MRI data was acquired at the UCSB Brain Imaging Center from 116 healthy adult participants using a phased array 3T Siemens TIM Trio with a 12 channel head coil. Functional MRI data was taken while each participant engaged in the following four tasks: rest (task-free), two separate functional runs of the same attention-demanding task, a memory task with lexical stimuli, and a memory task with face stimuli. In both memory tasks, 180 previously studied stimuli and 180 novel stimuli were presented to the subjects, who were asked to determine whether each stimulus was ``old" or ``new" -- i.e., whether it had been previously studied. This analysis combines two separate functional runs of the same attention task, which required the subjects to detect the presence or absence of a target stimulus \cite{Hermundstad2013a}. During the resting state, participants were asked to lie still and look at a blank screen. The sampling period (TR) was 2s for the rest and attention tasks and 2.5s for both memory tasks. In addition to functional data, a three dimensional high-resolution T1-weighted structural image of the whole brain was obtained for each participant. For additional experimental details, see \cite{Hermundstad2013a},\cite{aminoff_individual_2012}, and supplemental information therein. \subsection*{Image Analysis} \subsubsection*{Structural MRI acquisition and pre-processing} Structural scans were intensity-corrected, skull-stripped, normalized, segmented and parcellated using Freesurfer v.5.0.0 cortical reconstruction all with default settings, accessed via the Connectome Mapping Toolkit v.1.2.0 \cite{daducci2012connectome}. The starting atlas was the updated Lausanne2008 multi-scale atlas \cite{hagmann2008mapping}. For each subject, parcellations containing 83, 129, 234, 463 and 1015 regions were generated, covering cortical grey-matter regions, the thalamus, caudate, putamen, pallidum, accumbens area, hippocampus, amygdala and brainstem. The highest-resolution parcellation of 1015 regions was not investigated further, since a large number of regions contained very few or no voxels when the atlas was downsampled into fMRI space. \subsubsection*{Functional MRI pre-processing and time series analysis} Preprocessing was performed using FSL v5.0 \cite{smith2004advances,woolrich2009bayesian,jenkinson2012fsl}, AFNI v. 2011 12 21 1014 http://afni. nimh.nih.gov \cite{cox1996anfi} and Matlab (2013, The Mathworks, Natick, MA). Functional MRI scans were preprocessed as follows. FSL programs MCFLIRT \cite{jenkinson2002improved} and fsl motion outliers were used to correct for head motion and derive a volume-by-volume measure of head motion: framewise displacement. Framewise displacement (FD) is calculated as the sum (in mm) of rotational and translational displacements from volume N to N+1 \cite{power2012spurious}. Next, we performed slice timing correction (AFNI 3dTshift), auto-masked to obtain a brain-only fMRI image (AFNI 3dAutomask), and smoothed the time series at each voxel (AFNI 3dDespike with default parameter settings). Despiking has been shown to reduce the motion-related distance dependent bias in correlation estimates \cite{jo2013effective}. Each voxel's time series was then detrended with respect to framewise displacement using AFNI 3dDetrend. This uses linear regression to remove variability related to the nuisance regressor, framewise displacement, at each voxel. Runs were only included in the analysis if mean framewise displacement for the run was less than 0.25mm per frame; this led to 73 fMRI runs (of 763 total runs) being excluded from this analysis. Registration proceeded as follows: a participant's time-averaged fMRI image was aligned to their structural T1 scan using FSL FLIRT boundary-based registration \cite{greve2009accurate,jenkinson2002improved}, and the inverse of this transformation was applied to all subjects’ parcellation scales (generated in structural space). Parcellations were downsampled into EPI (AFNI 3dfractionize, voxel centroid voting, requiring 60\% overlap), and the mean signal across all the voxels within a given brain region was calculated to produce a single representative time series. The data was not spatially smoothed at any stage. \subsubsection*{Creation of a hybrid atlas} We sought to create an atlas with low inter-individual and cross-brain variability in the amount of fMRI data acquired per region. Many existing atlases use parcellations that have roughly equal region sizes as measured on structural MRI scans \cite{zalesky2010whole}. However, downsampling the atlas from structural MRI voxels to fMRI voxels, along with inhomogeneous fMRI signal-loss, mean that this does not produce equally sized regions in functional MRI space. To mitigate this, we generated a `hybrid', atlas by choosing those regions from various scales of the Lausanne2008 atlas that minimized cross-brain and intra-subject variability in region size. Starting with the scale 234 atlas, an iterative process was used to decrease intra- and intersubject variability in region size. Where a region had very few voxels (mean size $<$ 25th percentile), or high variability in size across subjects (coefficient of variation $>$ 30\%), it was tentatively exchanged for a region from the next highest resolution atlas, effectively combining the initial region with other higher-resolution regions subsumed under the same anatomical heading. If this combination of regions decreased the inter-subject or within-subject variability in region size, the combined region was retained. If not, the initial poor quality region was rejected from the ``hybrid atlas''. This was repeated until no further combinations of regions could decrease intra- and inter-subject variability while retaining neuroanatomically sensible groupings. Regions were excluded from the analysis altogether if there were fMRI runs in which no data was acquired in that region (frontal pole, entorhinal cortex and temporal pole), or if the inter-subject coefficient of variation was greater than 30\% (this applied to 7 of the 8 inferior temporal regions; 1 of the 8 middle temporal regions; 2 of 8 fusiform regions; 1 of the 6 caudal middle frontal regions, and 1 of the 14 precentral regions). Table \ref{Table 1} lists the 194 regions identified by this hybrid atlas. This approach considerably reduced intra-subject variability in region size as well as reducing the inter-subject variability at problematic outlier regions, while minimizing the amount of data that had to be excluded from analysis. \begin{table}[!ht] \vspace{5 mm} \begin{center} \begin{tabular}{ | l | l | l | p |} \hline \textbf{Region Name} & \textbf{L} & \textbf{R} \\ \hline lateralorbitofrontal & 2 & 2\\ \hline parsorbitalis & 1 & 1 \\ \hline medialorbitofrontal & 1 & 1\\ \hline parstriangularis & 1 & 1\\ \hline parsopercularis & 2 & 2 \\ \hline rostralmiddlefrontal & 5 & 6 \\ \hline superiorfrontal & 9 & 8 \\ \hline caudalmiddlefrontal & 3 & 2 \\ \hline precentral & 7 & 6 \\ \hline paracentral & 1 & 1 \\ \hline rostralanteriorcingulate & 1 & 1 \\ \hline caudalanteriorcingulate & 0 & 1 \\ \hline posteriorcingulate & 2 & 2 \\ \hline isthmuscingulate & 1 & 1 \\ \hline postcentral & 7 & 5 \\ \hline supramarginal & 5 & 4 \\ \hline superiorparietal & 7 & 7 \\ \hline inferiorparietal & 5 & 6 \\ \hline precuneus & 5 & 5 \\ \hline \end{tabular} \hspace{1cm} \begin{tabular}{ | l | l | l | p |} \hline \textbf{Region Name} & \textbf{L} & \textbf{R} \\ \hline cuneus & 1 & 1 \\ \hline pericalcarine & 1 & 1 \\ \hline lateraloccipital & 5 & 5 \\ \hline lingual & 2 & 3 \\ \hline fusiform & 3 & 3 \\ \hline parahippocampal & 1 & 1 \\ \hline inferiortemporal & 1 & 0 \\ \hline middletemporal & 3 & 4 \\ \hline bankssts & 1 & 1 \\ \hline superiortemporal & 5 & 5 \\ \hline transversetemporal & 1 & 1 \\ \hline insula & 2 & 2 \\ \hline thalamusproper & 1 & 1 \\ \hline caudate & 1 & 1 \\ \hline putamen & 1 & 1 \\ \hline pallidum & 1 & 1 \\ \hline accumbensarea & 1 & 1 \\ \hline hippocampus & 1 & 1 \\ \hline amygdala & 1 & 1 \\ \hline \end{tabular} \end{center} \caption{ {\bf Brain Regions} The 194 regions used in the hyperedge analysis, listed in order and including the number of regions in left and right hemispheres.} \label{Table 1} \end{table} \subsection*{Functional Connectivity} Specific frequencies of oscillations in the BOLD signal have been associated with different cognitive functions. We focus our investigation on low frequency (0.06-0.125 Hz) oscillations in the BOLD signal that have proven useful for examining resting \cite{Lynall2010,Bassett2012a} and task-based functional connectivity \cite{Bassett2011b}. The task-related oscillations are posited to be specific to this frequency range, possibly due to a bandpass-filter-like effect from the hemodynamic response function \cite{sun_measuring_2004}. We apply a Butterworth bandpass filter to isolate frequencies in the (0.06-0.125 Hz) range \cite{cadzow_discrete-time_????}. To construct a functional brain network, we use the 194 region hybrid atlas, where each region contains a roughly equal number of voxels. These 194 regions represent the network nodes. The $x$, $y$, and $z$ positions of each node are given by the centroid of the voxels which comprise the node. Edge weights in the functional brain network are computed by taking Pearson's correlations between the filtered time series within a defined time period for each pair of nodes \cite{fornito_network_2010}. \subsection*{Time Windows for Temporal Network Construction} Dynamic networks are constructed by taking the filtered time series in temporal windows of 60 seconds and computing a $N \times N$ adjacency matrix of nodal correlations for each time window, where $N=194$ is the number of nodes. Each of these $N\times N$ adjacency matrices represents the functional network over the 60 seconds in question. From this set of networks, we extract the edge weight time series by considering the correlation strength in each sequential network. We let $E = N(N-1)/2=18721$ be the total number of edges between the 194 nodes and construct an $E \times E$ adjacency matrix \textbf{X}, where $X_{ab}$ gives the Pearson correlation coefficient between the time series of edge weight for edges $a$ and $b$. The entries of the $E\times E$ adjacency matrix represent pairs of edges with correlated weight time series \cite{bassett_cross-linked_2013}. We consider a range of temporal window lengths from 40 to 120 seconds and find that our results for hyperedge size and spatial distributions are robust to changes in window length in this range. \subsection*{Hyperedge Construction} The cross-linked network structure, which contains information about groups of edges with similar time series (hyperedges), is extracted from the edge-edge correlation matrix \textbf{X} \cite{bassett_cross-linked_2013}. Figure \ref{Figure 1} provides a schematic illustration of the process of determining the cross-linked structure of a network. To exclude entries of \textbf{X} that are not statistically significant, we threshold \textbf{X} by evaluating the $p$-values for the Pearson coefficient $R$ for each edge-edge correlation using a false discovery rate correction for false positives due to multiple comparisons \cite{FDR}. If the $p$-value for an entry $X_{ij}$ satisfies the false discovery rate correction threshold, we set $\xi_{ij} = R(i,j)$ for our thresholded matrix $\xi$. We set the thresholded entry of all other elements $X_{ij}$ to zero. We binarize this thresholded matrix and obtain $\xi_{ij}^\prime$, where \begin{align} \xi_{ij}^\prime = \begin{cases} 1, & \text{if} \;\;\xi_{ij} >0 ;\\ 0, & \text{if} \;\;\xi_{ij} = 0. \end{cases} \end{align} \begin{figure}[!ht] \centering \includegraphics[width = 0.75\textwidth]{Figure1.jpg} \caption{\textbf{Hyperedge Construction:} A schematic illustration of the method used to identify hyperedges. We begin with a set of node-node edges (A) and their time series (B), of which three [green, pink and orange traces, (B)] exhibit strong pairwise temporal correlations. These edges are cross-linked (C) by temporal covariance in edge weight time series, and thereby form a hyperedge (D) of size three on six nodes. The final [blue] edge forms a singleton, an edge which is not significantly correlated with any other edges.} \label{Figure 1} \end{figure} Each connected component in $\xi$ represents a hyperedge, a set of edges that have significantly correlated temporal profiles. The groups of nodes in Figure \ref{Figure 1} (D) are examples of such connected components. The set of all hyperedges defined in $\xi$ produces an individual hypergraph, illustrated for one subject in Figure \ref{HI}. These hyperedges contain information about edge dynamics without restricting the analysis to edges with strong weights. \begin{figure}[!ht] \centering \includegraphics[width = 0.5\textwidth]{Figure2.jpg} \caption{\textbf{Individual Hypergraph:} Hypergraph for Subject 68, chosen for visualization due to the relatively small maximum hyperedge size of 256. In this representation, different colors represent separate hyperedges, and only edges of size four or greater are shown. A hypergraph with maximum hyperedge size of thousands of edges is difficult to visualize because it obscures any structure attributed to the smaller hyperedges.} \label{HI} \end{figure} \subsection*{Hypergraph Diagnostics} We use several methods to extract statistical features from individual hypergraphs and across the set of subjects. {\it Hyperedge size:} We define the size, $s(h)$, of a hyperedge $h$, as the number of edges contained in it, \begin{align}\label{eq:1} s(h) = \sum_{i,j \in h} \xi^\prime_{i,j}, \end{align} where the sum is performed over the upper triangular elements of $\xi^\prime$, and $\xi^\prime$ is the binarized edge-edge adjacency matrix defined above. Hyperedges with $s(h) = 1$ are singletons, which display no significant correlation between that edge and any other in the network. These singletons are excluded from further analyses. Additionally, we compute the cumulative hyperedge size distribution across all subjects in the study. {\it Hyperedge node degree:} We define the hyperedge degree of a node to be the number of hyperedges that contain that node. We examine the hyperedge node degree distribution as a spatial distribution over the subjects as a group to understand characteristic hyperedge properties. {\it Co-Evolution Network:} We construct a ``co-evolution network" to consolidate hypergraph results into a single graph that illustrates where hyperedges are most likely to be physically located over an ensemble of individuals. Figure \ref{construct} illustrates a schematic of our construction. We begin by defining the matrix, $\textbf{C}$, of probabilities that edges are included in a hyperedge over a set of hypergraphs. Again, nodes correspond to brain regions and connections correspond to inter-region associations, but here the weight of a connection joining nodes $i$ and $j$ is the matrix entry $\textbf{C}_{i,j}$. The resulting static network encompasses the dynamics of hyperedge activity, with connection weight corresponding to the probability that the two nodes are co-evolving over all of the hypergraphs considered. In later sections, we refer to co-evolution connection ``strength," which we define as the magnitude of the probability matrix entry corresponding to that connection. \begin{figure}[!ht] \centering \includegraphics[width = 0.75\textwidth]{Figure3.jpg} \caption{\textbf{Schematic Construction of the Hyperedge Co-Evolution Network:} In (A), we analyze edge time series and group edges exhibiting similar temporal profiles into a hyperedge (as in Figure 1). Here, node colors are used to indicate individual nodes and the edge color indicates distinct edges. We construct hypergraphs for each subject and find the matrix $\textbf{C}$ of probabilities that two nodes are in the same hyperedge over all subjects and hyperedges. In (B), this matrix is used to create a co-evolution network, where the weight for an edge connecting nodes $i$ and $j$ corresponds to the entry $\textbf{C}_{i,j}$.} \label{construct} \end{figure} \subsection*{Task-Specific Classification} Previous work identified regions with task-specific activity in rest, attention, and memory tasks \cite{Hermundstad2013a}. Further understanding of the regions that have a correlation structure unique to one task provides insight into network structure differences between tasks. To investigate the task-specific hyperedge structure, we first group hyperedges that exhibit a significantly higher correlation within one task into task-specific sets. If a hyperedge is significantly correlated in two or more tasks, it is excluded from the task-specific hypergraphs. The task-specificity of hyperedges is calculated by comparing the correlation within a single task to the correlation over the same time length with time points chosen randomly from other tasks. This permutation test uses a Bonferroni correction for false positives due to multiple comparisons \cite{hochberg_sharper_1988}. Task-specific hypergraphs are then used to construct task-specific hyperedge size distributions, hyperedge node degree distributions, and co-evolution networks. To quantitatively probe the differences in spatial organization of dynamic functional co-evolution networks for the four tasks, we investigate two summary metrics that show significant variation across tasks. Choice of these measures is primarily motivated by observed coarse differences in co-evolution network structure. The first ``length-strength" metric is the Pearson correlation coefficient, $R$, between the strength of a connection in the co-evolution network and Cartesian distance between the two nodes linked by the connection (physical length). The Cartesian distance is computed by taking the $x$, $y$, and $z$ coordinates of each node and calculating the square root of the differences squared. The length-strength metric identifies a geometric property of the network, as well as a coarse estimate of the length of the strongest connections. Furthermore, connection length is related to network efficiency \cite{sporns_small_2004, heuvel_efficiency_2009}, so differences in this measure could indicate varying levels of functional network efficiency corresponding to task states. The second ``position-strength" metric is the Pearson correlation coefficient, $R$, between the strength of the co-evolution network connection with the average anterior-posterior position of the two nodes. A measure of anterior-posterior position for each connection was found by taking the average $y$ position of the two nodes in the connection. Identifying the location of strong co-evolution network connections along the anterior-posterior $y$ axis provides a measure of where hyperedges are physically present in task states. Both the structural core \cite{hagmann2008mapping} and a dynamic functional core area, comprised of sensorimotor and visual processing areas \cite{Bassett2013a}, are located in the posterior, so nodes in these regions have negative $y$ values. A larger negative position-strength value corresponds to a higher probability that hyperedges are active in these core areas. The length-strength and position-strength metrics are evaluated for significance by comparing the correlation between length or position and connection strength to the same correlation performed on randomly chosen co-evolution connections. Again, the Bonferroni correction is performed to eliminate false positives due to multiple comparisons. In Results, we discuss how these metrics reveal quantitative differences between task-specific networks. A more detailed analysis of the overlap between hyperedge co-evolution networks and relevant cognitive processing regions is also presented. In this analysis, we describe how delineated areas of higher hyperedge activity consistently correspond to recognized centers of task-specific activity. \subsection*{Null Models} In this analysis, we compare our results with two statistical null models based on measures for dynamic networks \cite{Bassett2012b}. Hyperedges are formed from correlated edge time series; consequentially the null overall model randomly shuffles each edge time series over all experiments. This null model is designed to ensure that the hyperedges identified in our analysis can be attributed to the dynamics of the system, rather than some overall statistical property of the data set. The other null test we perform, which we will refer to as the null within-task model, reorders each edge time series within each task, keeping tasks distinct. This is constructed in order to determine whether there are specific differences in the data between tasks. \section*{Results} We compile the results from the hypergraph analysis for each of the subjects and combine these results to obtain a size distribution, anatomical node degree distribution, and co-evolution network for the group. We then divide the data into task-specific hypergraphs and perform the previously mentioned analyses on the task-specific hypergraphs. \subsection*{Hypergraph Analysis and Statistics} We construct a hypergraph for each individual and examine the cumulative distribution of hyperedge sizes ($s(h)$ from Equation \ref{eq:1}), shown in Figure \ref{Figure 2}. There is a distinct break in the slope between two branches of the distribution occurring at a size of approximately 100 edges, which we use to distinguish between ``large" and ``small" hyperedges. The total number of small hyperedges appears to roughly follow a power law with an exponent of approximately $-2.5$. The number of large hyperedges peaks around the maximum size, with relatively few in the middle range from 100 to 1000 edges. In Figure \ref{Figure 2}, the sharp drop off in the distribution at large hyperedge sizes reflects the system size limitation on hyperedge cardinality. \begin{figure}[!ht] \centering \includegraphics[width = 0.5\textwidth]{Figure4.jpg} \caption{\textbf{Hyperedge Size Distribution:} In the cumulative frequency distribution of hyperedge sizes, the small hyperedges appear to roughly follow a power law with an exponent of approximately $-2.5$, while the large group is concentrated near the maximum size. In the null overall model, there are no non-singleton hyperedges. Results for the null within-task model, where the data is shuffled within each task, are in green.} \label{Figure 2} \end{figure} There is a distinct partition in all individual frequency versus sizes distributions; one or two ``large" hyperedges ($s(h) > 100$), and many ``small" hyperedges that peak at the smallest size ($s(h) < 100$). For purposes of illustration, the individual hypergraph of a subject with a relatively small maximum hyperedge size is shown in Figure \ref{HI}. The corresponding hypergraph of a subject with a maximum hyperedge near the system size is strongly dominated by the largest hyperedge, which obscures the smaller hyperedges. The null overall model shuffles the data over all tasks. There are no hyperedges greater than size one, so the results from this null model are not depicted in Figure \ref{Figure 2}. These singletons signify no significant correlation with other edges. As a result, we performed no further analysis on this null model. The fact that no significant hyperedges were found in the null overall model validates the statistical significance of our results. The null within-task model shuffles the data but ensures that task data stays within the same task. The size distribution of hyperedges from the null within-task model is shown in Figure \ref{Figure 2}. The shape of the two distributions is similar, although the null within-task model has fewer hyperedges in the large regime and there are more singletons than in the original data. This indicates there is co-evolution structure across tasks because this structure corresponds to changes in edge states between two or more tasks. For example, if groups of edges have an overall high correlation in one task and a significantly lower correlation in another, it would induce a hyperedge across the tasks regardless of how the within-task time series are shuffled. Examining the cumulative hyperedge size distribution provides information about the network topology but does not supply descriptive spatial information. Next, we quantify which anatomical locations in the brain participate in hyperedges, identifying differential roles in task-induced co-evolution. Figure \ref{Figure 4}A depicts the hyperedge node degree on a natural log scale. The densest regions are located in posterior portions of the cortex, primarily in visual areas, while a second set of dense regions is located in the prefrontal cortex. \begin{figure}[!ht] \begin{center} \includegraphics[width = 0.5\textwidth]{Figure5.jpg} \end{center} \caption{ {\bf Hyperedge Node Degree and Co-Evolution Network:} In (A), we show hyperedge node degree on a natural log scale. The cumulative number of hyperedges at each vertex over all individuals is plotted on the brain, where higher values at a node correspond to more hyperedges that include the node. (B) depicts a sagittal view of the co-evolution network. The edge strength represents the probability that the edge will be in a hyperedge over all individuals. Edge color corresponds to threshold percentage value, where only the top 1\% of co-evolution probabilities are shown. Within this 1\%, brown connections correspond to the highest 0.2\% of probabilities, red connections correspond to 0.2\% to 0.4\%, orange connections correspond to 0.4\% to 0.6\%, gold connections correspond to 0.6\% to 0.8\%, and yellow connections correspond to 0.8\% to 1\%.} \label{Figure 4} \end{figure} We construct a co-evolution network, as illustrated schematically in Figure \ref{construct}, where connection weight corresponds to the probability that two nodes participate in the same hyperedge. In Figure \ref{Figure 4}B we present this co-evolution network over all individuals and all tasks. The graph includes sparse long-range connections between regions that are densely connected. Within the strongest 1\% of connections, the high degree of bilateral symmetry indicates that corresponding nodes in the left and right hemispheres have a high likelihood of being placed together in a hyperedge. Dense areas of the graph include primary visual areas, portions of prefrontal cortex, and primary motor cortex. \subsection*{Task-Specific Hyperedges} The hypergraph algorithm groups together edges with significantly similar temporal behavior. However, this basic classification does not distinguish whether the correlation is present throughout the edge time series, or whether highly correlated sections of the time series drive the selection. We compute the average within-task edge correlation for each hyperedge and find that in some cases, strong edge correlation spans the tasks, while in other hyperedges, a strong correlation between edges within one task drives the hyperedge. An example of this task-specific correlation structure can be seen in Figure \ref{tasksp}. In the average within-task correlation on the left, there is a stronger average correlation in the word memory task than in any other task. Furthermore, the edge time series in the first hyperedge indicates it is driven mainly by a correlation within the word memory task. \begin{figure}[!ht] \begin{center} \includegraphics[width = 0.75\textwidth]{Figure6.jpg} \end{center} \caption{ {\bf Left:} Average hyperedge correlation in each task for three hyperedges (where hyperedges with small sizes are chosen for illustrative purposes). {\bf Right:} Correlation (absolute value) time series for the same three hyperedges. The colored lines represent each edge, while the black line is the average edge time series. Each time point represents the static network over 60 seconds, and the attention task is broken into two sections because two separate iterations of the same task were combined in this analysis. These results display the task-specificity of hyperedges, where significant correlations in the hyperedge are restricted to one task. For example, the first hyperedge is word-specific because there is a much stronger average correlation in the word task than in any other task.} \label{tasksp} \end{figure} To investigate this further, we construct task-specific co-evolution networks, composed of hyperedges with significantly stronger average correlation in one task than the others (see Methods). To identify these task-specific hyperedges for each task, we perform a permutation test on the edge weight time series, as described in Methods, and compare the total correlation within the task to the expected values. If a hyperedge displays significant edge correlation (determined by the Bonferroni correction on the $p$-values from the permutation test) in only one task, we label it as a task-specific hyperedge. Hyperedges with two or more tasks exhibiting significant correlation are not included in the task-specific hypergraphs. Figure \ref{Figure 5} illustrates the size distributions of all the task-specific results alongside the overall hyperedge size distribution. The sizes and spatial distributions of single task-driven hyperedges vary across tasks and incorporate significant information about functional network organization with respect to changing cognitive states. Attention has the greatest number of task-specific hyperedges, followed by face memory, word memory, and rest. In the small regime, the tasks follow a similar distribution. There are fewer large attention and rest hyperedges, while the face memory task closely mimics the overall distribution. The distinction in the distributions indicates that the tasks can be characterized by differing complexities of edge co-variations. \begin{figure}[!ht] \begin{center} \includegraphics[width = 0.75\textwidth]{Figure7.jpg} \end{center} \caption{ {\bf Task Specific Hyperedge Size Distributions:} Cumulative frequency distribution as a function of hyperedge size for all task-specific groups. The results are compared to the overall distribution of hyperedges (dark blue), previously illustrated in Figure \ref{Figure 2}. There are fewer large hyperedges attributed to attention and rest tasks, while the memory tasks have a greater number of large task-specific hyperedges.} \label{Figure 5} \end{figure} The spatial distributions of hyperedge node degree in each task, along with task-specific co-evolution networks, are shown in Figure \ref{Figure 6}. The rest hypergraph has the least activity in posterior regions of the cortex, both in the hyperedge node degree plot and co-evolution network. In the attention network, long connections connecting the front and back of the brain distinguish it from the rest network. Furthermore, the concentration in the occipital lobe is larger in the memory co-evolution networks than in the rest or attention networks. We characterize these observed differences with two statistics, which are described in more detail in Methods. The length-strength metric is a correlation between connection length and strength in the co-evolution network. The position-strength metric is a correlation between connection position (anterior-posterior) and strength. The results of this analysis over the full unthresholded co-evolution network are in Figure \ref{Figure 7}. All correlation values are negative, indicating that, in all tasks, stronger connections in the co-evolution network are located in posterior portions of cortex and are physically shorter. \begin{figure*}[!ht] \begin{center} \includegraphics[width=\textwidth]{Figure8.jpg} \end{center} \caption{ {\bf Task-specific Co-Evolution Networks and Hyperedge Node Degrees:} \\ (A): Distribution of task-specific hyperedge node degree on the brain. Here, the log of the total number of hyperedges containing each node is represented on the brain. The color scale represents the log of hyperedge node degree as in \ref{Figure 4}A, although here the range of values is from 0 to 4.8. (B): Co-evolution networks for each task. Edge strength corresponds to the probability that a hyperedge will contain the edge over all individual hypergraphs. Color represents a threshold in percentage value, with the scale given in Figure \ref{Figure 4}B, and the top 1\% of co-evolution probabilities are shown. Once again, the top 2 \% of probabilities are brown, red indicates the top 0.2\% to 0.4\% of connections, orange indicates the top 0.4\% to 0.6\% of probabilities, gold indicates the top 0.6\% to 0.8\% of probabilities, and yellow indicates the top 0.8\% to 1\% of probabilities.} \label{Figure 6} \end{figure*} \begin{figure}[!ht] \begin{center} \includegraphics[width = 0.75\textwidth]{Figure9.jpg} \end{center} \caption{ {\bf Task-specific network statistics:} Values for the position-strength metric (blue) and the length-strength metric (red) for the four tasks are depicted in (A). (B) shows $p$-values for the pairwise statistical permutation test between tasks, where black denotes a significant value after a Bonferroni correction for multiple comparisons. Values are obtained for length-strength and position-strength metric. For example, on the $y$ position plot in (B), attention-word is significant. Referring back to (A), we see that this implies the difference in the $y$ position-strength correlation between the attention and word tasks is statistically significant.} \label{Figure 7} \end{figure} We compare these values across tasks by performing pairwise permutation tests to determine which networks have statistically different properties. Figure \ref{Figure 7} depicts the $p$-values from these tests, where the horizontal axis represents the statistic being tested and the vertical axis corresponds to the task being tested against. The black squares in this figure represent significant values, which are summarized in the following list: \begin{enumerate} \item The rest task has a significantly less strong position-strength correlation than the word and face memory tasks. This confirms the observation that the rest co-evolution network is less likely than the memory networks to have strong connections in posterior regions of the cortex. \item The attention task is less strongly correlated than the word memory task, as measured by the position-strength metric and the rest task in terms of the length-strength metric. Thus, the attention co-evolution network is less likely than word memory to have strong connections in the posterior, and less likely than the rest network to have strong connections that are short. \item The word memory task has a weaker length-strength correlation than the rest and attention tasks. Thus, strong connections in the word memory co-evolution network are less likely be short than they are in attention and rest networks. \end{enumerate} These results delineate significant differences in co-evolution network structure between the tasks, confirming that the hypergraph analysis is a useful method for distinguishing between task states. Additional features of the task-specific co-evolution networks are described in more detail below. \subsubsection*{Rest} Rest-specific hyperedges are primarily represented in the ``small" range of the size distribution in Figure \ref{Figure 5}. Additionally, the rest task has the lowest number of task-specific hyperedges, but it is difficult to distinguish this in Figure \ref{Figure 5} due to the proximity on the logarithmic scale. The result that fewer groups of nodes share similar co-evolution properties could be a result of the specificity of correlated resting state regions, or a simplicity intrinsic to resting state function that does not necessitate more concerted efforts involving numerous brain regions \cite{cole_intrinsic_2014}. There are fewer rest-specific hyperedges than in any other task, so the hyperedge node degree plot in Figure \ref{Figure 6}A has the lowest overall magnitude across task states. The areas with the highest degree of hyperedge activity are in the posterior portions of the brain, a configuration that is consistent across tasks. This suggests there is an underlying pattern of hyperedge generation centered in the occipital lobe. The rest co-evolution network is highly clustered in the most probable 0.2\% of co-evolution pairs, but lower thresholds show very little structure, as visualized in Figure \ref{Figure 6}B. These high probability clusters are centered in previously mentioned regions, but the top 1\% of connections is far more randomized in rest than any other task-specific co-evolution network we have observed. There is relatively little lateral symmetry and few visible ``core" areas with high hyperedge node degree. We find the negative length-strength correlation is significantly stronger for the rest task than the word memory task. This indicates that the strongest connections in the co-evolution network for the rest task are short, reflecting the initial observations in Figure \ref{Figure 6}B. The rest co-evolution network has the smallest negative correlation between connection position and strength, which the permutation test (Figure \ref {Figure 7}B) confirmed to be significantly smaller than the word or face memory tasks. This relative lack of long, strong connections may correspond to a diminished need for efficient processing in a task-free environment. Resting-state brain activity contains correlated patterns that comprise a default mode network, a system that is engaged during internal cognition \cite{long_default_2008,albert_resting_2009}. Certain brain regions active at rest are consistently deactivated during goal-oriented tasks, indicating that they comprise a functional mode that is rest-specific \cite{Raichle2001}. Our analysis returns a spatial co-evolution distribution with structures of higher probability in brain regions traditionally associated with the resting state. Dense areas of the network with high probabilities of being in the same hyperedge include the inferior parietal lobule, superior frontal gyrus, precuneus, and posterior cingulate cortex. These regions have been identified as integral components of the default mode network; the posteromedial cortex includes the precuneus and posterior cingulate cortex and performs a particularly pivotal role in awareness and memory retrieval \cite{dastjerdi_differential_2011,fransson_precuneus/posterior_2008,cauda_functional_2010}. Moreover, as in all of the tasks, the rest task has the greatest concentration of hyperedges in the posterior of the brain. This may overlap with previously located structural and functional core areas and is an avenue for further investigation. \subsubsection*{Attention} The attention-specific network primarily consists of small hyperedges. Overall, there are more hyperedges associated with attention than any other task, but this is difficult to visualize in Figure \ref{Figure 5}. This composition of many small hyperedges may account for the increased disorganization in the co-evolution structure at lower probability thresholds. In Figure \ref{Figure 6}A, the hyperedge node degree plot for the attention task appears qualitatively similar to the rest task, with a few areas of increased degree in the occipital lobe. The hyperedge node degree values are larger here, corresponding to the greater number of hyperedges that are present in the attention task. In Figure \ref{Figure 6}B, the co-evolution structure specific to the attention task is depicted. The structure of the attention network has a higher degree of bilateral symmetry than the rest network, but has significantly fewer connections in the occipital lobe than either memory task. There are multiple prefrontal cortical regions that are likely to cohesively evolve with several other nodes. Numerous links between rostral and caudal brain regions are another unique feature of the attention network. The negative length-strength correlation in the attention co-evolution network is significantly less strong than in the rest task, as we can verify in Figure \ref{Figure 6}B by observing that the attention co-evolution network has strong connections that reach across the brain. Additionally, the attention task has a weaker position-strength correlation than the word memory task. It is likely that the strong connections in the prefrontal cortex are driving this feature, which could indicate that the attention task state has less reliance on core visual regions than the word memory task. Two attention systems exist in the human brain: a ``top-down" network controls goal-directed attention, while a ``bottom-up" group of brain regions detect and orient attention to relevant sensory stimuli that are generally novel or unexpected \cite{corbetta_control_2002, fox_spontaneous_2006}. Our task probes the former, as subjects are asked to focus on repetitive stimuli in a controlled environment. This requires an ``executive control network," a bilateral dorsal system that governs guided attention and working memory \cite{seeley_dissociable_2007}. Regions of high clustering in the most probable threshold include the lateral parietal occipital lobe, the superior frontal cortex, and dorsal parietal cortex. The parietal and frontal areas are involved in attention control and localization, specifically in visual attention tasks \cite{corbetta_control_2002,nobre_functional_1997}. Activation of the superior frontal cortex occurs in attention tasks, but a significant increase in activity occurs during tasks where peripheral attention is required \cite{corbetta_pet_1993, hopfinger_neural_2000}. The dorsal parietal cortex also performs a central role in the executive control network; patients with lesions in the dorsal parietal cortex have shown significant impairment in goal-directed attention tasks \cite{shomstein_goal-directed_2005}. \subsubsection*{Memory for Words} The word memory-specific hyperedge size distribution includes numerous large hyperedges, but is not as close to the overall distribution as the face memory distribution. Together, the memory tasks contain many more large hyperedges than the rest and attention tasks. This indicates some aspect of the memory tasks requires dynamically coherent evolution over much of the brain. The word memory hyperedge node degree distribution has high node degrees in similar areas to the other task-specific hypergraphs. There is a marked increase in node degree of regions in the parietal lobe from rest and a decrease in degree of regions in the occipital lobe from attention (seen in Figure \ref{Figure 6}A). Visual orthographic and face processing have a common reliance on central vision \cite{levy_center-periphery_2001} and share neural circuitry \cite{nestor_neural_2013}. The resemblance of the co-evolution networks for the two tasks, especially when compared with the very different graph structure of the attention and rest networks, indicates a similarity in the hypergraph representation of the memory tasks. This in turn signifies a correspondence in brain dynamics specific to memory. The task-specific analysis requires hyperedges to show a significant correlation in only one task, so there is no overlap in these co-evolution networks. The negative length-strength correlation is the weakest for the word memory network. We find that these two variables are significantly less correlated than in the rest or face memory tasks. This indicated that the many connections from the occipital to frontal lobes are a distinguishing characteristic of the word co-evolution network. Existence of a dedicated visual word processing network has been a topic of frequent discussion in neuroscience. The visual word form area (vWFA), located in the occipito-temporal cortex, is consistently activated by orthographic stimuli \cite{turkeltaub_meta-analysis_2002} and is invariant to changes in case, size, font, or type of visual stimulation \cite{polk_functional_2002,rauschecker_visual_2011}. The vWFA has also been shown as functionally linked to the dorsal attention network in resting state fMRI data, indicating that it fulfills a complex cognitive role \cite{vogel_putative_2011}. In the word memory co-evolution network in Figure \ref{Figure 6}B, low strength co-evolution pairs are more broadly distributed throughout the brain, while the strength and number of bilateral links is diminished. This is consistent with the understood activation structure of working memory tasks \cite{klingberg_bilateral_1997}. The vWFA is highly connected in the co-evolution network, but there is minimal strong structure in dorsal attention areas, which we would expect to see in a functional connectivity analysis \cite{vogel_putative_2011}. This can be explained by our methodology of selecting task-specific hyperedges. If edges in the dorsal attention network have similar co-evolution properties within the word memory and attention tasks, they will not be identified as task-specific edges. \subsubsection*{Memory for Faces} There are more large hyperedges significantly correlated in the face memory task than any other task-specific group. The distribution closely resembles the overall distribution in the large regime, indicating that a significant portion of these large hyperedges are driven by correlations in the face memory task. The face memory-specific hyperedge node degree values are consistently the largest across the brain. In the word memory and attention degree distributions, there are areas of higher hyperedge node degree in the parietal lobe and occipital lobe, respectively, but the face memory degree distribution is more evenly dispersed over the brain. This is primarily due to the many large hyperedges specific to the face memory recognition task. The structure of the co-evolution network, in Figure \ref{Figure 6}B, is most dense in the occipital lobe, which corresponds to the visual nature of the task. There are several strong connections from the occipital lobe to other brain regions, specifically in the frontal lobe. While the structure looks similar to the word memory task, the strong cluster of connections in the occipital lobe have fewer strong connections and less nodes reached overall, but more strong connections to a few particular nodes in the face memory task, and there are fewer strong connections in the frontal lobe but more strong connections among regions in the dorsal attention network. In addition to the properties discussed in previous sections, the face memory co-evolution network has a strong negative position-strength correlation. The structure at the highest probability levels of the co-evolution network is primarily contained in the prefrontal cortex and areas known to be structural and functional core regions \cite{hagmann2008mapping, Bassett2013a}. Face recognition in humans requires a complex network distributed throughout the visual cortex that includes extended connections branching to other cortical regions \cite{haxby_human_2002}. The majority of visual processing occurs in the occipital lobe, located in the posterior of the brain. Functional MRI studies have identified multiple regions in the occipital cortex that respond more strongly to faces than other visual stimuli, indicating that the cognitive processes involving facial recognition are highly specialized \cite{kanwisher_fusiform_1997,gauthier_fusiform_2000}. A region in the fusiform gyrus, the fusiform face area (FFA), is selectively active in whole human facial perception \cite{mccarthy_face-specific_1997,saygin_anatomical_2012}. The face perception system is composed of multiple bilateral regions; lateral symmetry in the co-evolution network is consistent with this structure \cite{haxby_human_2002}. An aspect of the network that breaks this symmetry is the right fusiform gyrus, which is strongly connected to other areas in the occipital lobe by high probability co-evolution pairs. In agreement with evidence that many aspects of facial perception are right-hemisphere dominant, the right FFA has the most salient response to faces; damage to the region severely impairs face recognition \cite{saygin_anatomical_2012}. \section*{Discussion} Progress in understanding functional brain network topology provides significant insight into broad neuroscience questions regarding the brain's organization and ability to effectively transition between cognitive states. Quantifying complex network dynamics in the brain will further understanding in these areas and has promising applications to behavioral adaptation and learning \cite{Bassett2011b, mantzaris_dynamic_2013,Bassett2013a}. We apply hypergraph analysis, a tool from dynamic network science, to functional brain imaging data in order to determine co-evolution properties of the brain as subjects perform a series of tasks. A previous application of this method to neuroscience uses hypergraphs to analyze how functional network structure changes over a long term learning task \cite{Bassett2013a}. The learning experiment considers hypergraphs constructed over 6 weeks of training while subjects acquire a new motor skill, while our analysis compares hypergraphs over three different tasks performed within an interval of hours. Our analysis shows that hypergraphs are a useful tool for investigating shorter time scales and differentiating between task-specific networks. Instead of analyzing the time-dependent behavior of groups of nodes, the hypergraph investigation considers the edge weight time series, where edges with statistically significant similarities in their temporal profiles are grouped into hyperedges. This approach is advantageous because it considers all edges, regardless of correlation strength, unlike previous methods which focus exclusively on strong correlations \cite{Hermundstad2013a}. The use of a data-driven analysis allows us to investigate the dynamic changes in brain function over a series of tasks without prior assumptions of the structure of the connectivity network. This is a significant advantage over methods that characterize task states based on their differences with respect to the resting network \cite{Fox2005,Hampson2010}. A comparison between the hypergraph analysis and these methods in a future analysis could reveal how the concentration of hyperedges varies in known task-positive or task-negative areas and determine whether this variation has an effect on task performance. \subsection*{Hypergraph Statistics and Structural Metrics} We demonstrate the existence of hypergraph structure in functional brain dynamics and statistically characterize the hyperedge distributions in comparison to appropriate null models. Shuffling the time series over all time produces no significant hyperedges, while shuffling within each task results in a size distribution that resembles the overall size statistics with far fewer hyperedges. The distinct differences between the two null models and our results based on the original time series establish the significance of our findings. Furthermore, the existence of hyperedges after the within-task shuffling indicates the presence of activity in some edges that is differentiated between tasks. Since there are fewer large hyperedges after the within-task shuffling, we can also confirm that there are hyperedges caused by edge dynamics within tasks. This work primarily concentrates on hyperedges correlated within a particular task, but future analyses to understand the properties of hyperedges that are grouped due to other general properties would supplement our results. The hyperedge size distribution is comprised of ``small" and ``large" hyperedges, where the size distribution of the small hyperedges follows a power law and the large hyperedges peak at the system size. We explore the overall spatial hyperedge distribution by constructing a hyperedge node degree plot, and find that the majority of the most densely connected nodes lie in the posterior portions of the brain. To better observe spatial hyperedge properties, we develop a co-evolution network, where connection weights correspond to the probability that a hyperedge will include the connection. The top 1\% of connections in the network with the highest probability of inclusion in a hyperedge are most concentrated in the occipital lobe and prefrontal cortex. These are expected areas of hyperedge concentration, consistent with the visual nature of the tasks, as well as the coordination of quick decision making and the selection of specific motor responses. \subsection{Task Specificity and Anatomical Placement} We find there are hyperedges that are more correlated in one task and hyperedges that have a distinct profile across the tasks. Our results suggest that edges with a high probability of inclusion in task-specific hyperedges are often found in previously identified brain areas associated with the corresponding tasks, confirming that the approach captures relevant information about task networks. In some networks, brain regions expected to show strong co-variation in a certain task are not present in the co-evolution networks. Repeating the analysis and grouping edges that are significantly correlated in two tasks might lend insight into whether brain systems relevant to a certain task contain hyperedges that are correlated in another task and thus are rejected from our task-specific analysis. In all tasks, stronger connections in the co-evolution network tend to be located in posterior portions of cortex and to be physically shorter. The higher probability of posterior edges to be included in hyperedges is consistent with the identification of a core set of highly structurally connected regions centered in the posterior of the brain, thought to play an important role in integrating large-scale functional connectivity \cite{hagmann2008mapping}. The tendency of strong connections to be physically shorter suggests high efficiency in task-specific co-evolution networks. This may reflect efficient wiring properties associated with minimal wiring for rapid processing and low energy expenditures found in structural brain networks and shared by some other biological and technological networked systems \cite{Bassett2010}. The co-evolution networks for memory tasks show a significantly higher hyperedge probability in visual areas than the attention and rest tasks, and the differences in structure indicate that the hypergraph representation of memory tasks is significantly different from rest or attention. The marked differences in hyperedge statistics in our task-specific analysis suggest hypergraphs as a measure of functional network changes due to task states. With measures derived from the hyperedge analysis, we can begin to quantitatively probe the mechanisms of functional switching between tasks and gain insight into how distinct features of the network evolve in synchronized patterns. \subsection*{Final Remarks} Efforts to make quantitative comparisons between the hypergraph analysis and other dynamic graph theoretical methods in the context of the human brain are ongoing. We are investigating whether dynamic community detection, a node-based analysis, can provide complementary information to the edge-based hypergraph analysis. Throughout this work, we also observe a significant amount of individual variability in the hypergraph properties of interest. This variability may be related to differences in cognitive ability, which is an avenue we are investigating further. In this paper, we use hypergraph analysis to identify significant co-evolution between brain regions in task-based functional activity and develop new tools to summarize the spatial patterns of these co-evolution dynamics over the group of subjects. By isolating task-specific hyperedges, we quantify significant differences between the spatial organization of co-evolution dynamics within different tasks. This hypergraph analysis adds a crucial perspective to previous treatments of task-based brain function, describing temporal similarities between spatially segregated neural circuits by specifically examining the organization of connections that co-evolve in time. It provides a promising approach for understanding fundamental properties of task-based functional brain dynamics, and how individual variation in these properties may correspond to differences in behavior and task performance. \section*{Acknowledgments} We would like to thank John Bushnell for technical support and Ben Turner for invaluable help with visualization. This work was supported by the David and Lucile Packard Foundation and the Institute for Collaborative Biotechnologies through grant W911NF-09-0001 from the U.S. Army Research Office. K.J.S. was supported by the National Science Foundation Graduate Research Fellowship Program under Grant No. DGE-1144085. E.N.D. and K.J.S. were additionally supported by the Worster Fellowship. D.S.B. was supported by the Alfred P. Sloan Foundation, the Institute for Translational Medicine and Therapeutics at Penn, and the Army Research Laboratory through contract number W911NF-10-2-0022. The content of the information does not necessarily reflect the position or the policy of the Government, and no official endorsement should be inferred.
{'timestamp': '2014-08-01T02:03:06', 'yymm': '1407', 'arxiv_id': '1407.8234', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8234'}
arxiv
\section{ADMM-Based Distributed Algorithms}\label{sec:algorithm} In this section, we will present two ADMM-based distributed algorithms that are well suited for the multi-facility resource allocation problem, with a particular focus on their convergence rates as well as their advantages over other ADMM-based algorithms. \subsection{A Primer on ADMM} We begin with some basics of ADMM and its connection to dual decomposition. Dual decomposition is a standard approach to solving large-scale convex problems, which has been widely used in the networking research. By forming the Lagrangian for problem \eqref{opt:form1} (with the Lagrange multiplies $\lambda \in \mathbb{R}^n$) and applying the dual decomposition method, one arrives at the following algorithm: \begin{alg}\label{alg:dual} Initialize $\{x_{i}^0 \}$, $\{y_j^0 \}$, $\{ \lambda_j^0 \}$. For $k=0,1,\ldots,$ repeat \begin{enumerate} \item {\bf $x$-update:} Each user $i$ solves the following sub-problem for $x_i^{k+1}$: \begin{align*} \text{min} &\quad -f_i(x_i) + (\lambda^k)^T x_i\\ \text{s.t. } &\quad x_i \in \mathcal{X}_i. \end{align*} \item {\bf $y$-update:} Each facility $j$ solves the following sub-problem for $y_j^{k+1}$: \begin{align*} \text{min} &\quad g_j(y_j) - \lambda_j^k y_j\\ \text{s.t. } &\quad y_j \in \mathcal{Y}_j. \end{align*} \item {\bf Dual update:} Each facility $j$ updates $\lambda_j^{k+1}$: \begin{equation* \lambda_j^{k+1} := \lambda_j^k + \rho^k \left(\sum_{i=1}^N x_{ij}^{k+1} - y_j^{k+1} \right), \end{equation*} where $\rho^k$ is the step-size for the $k$th iteration. \end{enumerate} \end{alg} The following assumption is valid throughout the paper: \begin{assum}\label{ass:ass1} The optimal solution set of problem \eqref{opt:form1} is non-empty, and the optimal value $p^*$ is finite. \end{assum} It is known that Algorithm~\ref{alg:dual} is convergent under Assumption~\ref{ass:ass1} and the assumption that the utility functions $f_i(\cdot)$ are strictly concave and the cost functions $g_j(\cdot)$ are strictly convex \cite{BT97}. However, as we have shown in Sec.~\ref{sec:app}, for many interesting problems of form \eqref{opt:form1}, either $f_i(\cdot)$ are \emph{non-strictly} concave or $g_j(\cdot)$ are \emph{non-strictly} convex, making conventional dual decomposition unsuitable for such applications. Alternating direction method of multipliers (ADMM) is a decomposition method that does not require strict convexity. It solves convex optimization problems in the form \begin{align}\label{opt:admm} \text{minimize} &\quad f(x) + g(y)\\ \text{subject to} &\quad Ax + By = c, \nonumber \\ &\quad x \in \mathcal{X}, \ y \in \mathcal{Y}, \nonumber \end{align} with variables $x \in \mathbb{R}^n$ and $y \in \mathbb{R}^m$, where $f: \mathbb{R}^n \to \mathbb{R}$ and $g: \mathbb{R}^m \to \mathbb{R}$ are convex functions, $A \in \mathbb{R}^{p\times n}$ and $B \in \mathbb{R}^{p \times m}$ are matrices, $\mathcal{X}$ and $\mathcal{Y}$ are nonempty compact convex subsets of $\mathbb{R}^n$ and $\mathbb{R}^m$, respectively. Note that $f(\cdot)$ and/or $g(\cdot)$ are \emph{not} assumed to be strictly convex. The \emph{augmented Lagrangian} \cite{H69} for problem \eqref{opt:admm} is \begin{multline* L_\rho(x, y, \lambda) = f(x) + g(y) +\lambda^T(Ax + By - c)\\+(\rho/2)\|Ax + By - c\|^2_2, \end{multline*} where $\lambda \in \mathbb{R}^p$ is the Lagrange multiplier (or the dual variable) for the equality constraint, and $\rho>0$ is the \emph{penalty parameter}. Clearly, $L_0$ is the (standard) Lagrangian for \eqref{opt:admm}, and $L_\rho$ is the sum of $L_0$ and a \emph{penalty term} $(\rho/2)\|Ax + By - c\|^2_2$. The standard ADMM algorithm solves problem \eqref{opt:admm} with the iterations \cite{BPCP10}: \begin{align*} x^{k+1} &:= \operatornamewithlimits{argmin}_{x\in \mathcal{X}} L_\rho(x, y^k, \lambda^k), \\ y^{k+1} &:= \operatornamewithlimits{argmin}_{y \in \mathcal{Y}} L_\rho(x^{k+1}, y, \lambda^k), \\ \lambda^{k+1} &:= \lambda^k + \rho( A x^{k+1} + B y^{k+1} - c), \end{align*} where the penalty parameter $\rho$ can be viewed as the step size for the update of the dual variable $\lambda$. Note that the primal variables $x$ and $y$ are updated in an alternating fashion, which accounts for the term \emph{alternating direction}. The standard ADMM algorithm has a \emph{scaled form}, which is often more convenient (and will be used in this paper). Introducing $u = (1/\rho) \lambda$ and combining the linear and quadratic terms in the augmented Lagrangian, we can express the ADMM algorithm as \begin{align*} x^{k+1} &:= \operatornamewithlimits{argmin}_{x\in \mathcal{X}} \left( f(x) + (\rho/2) \| Ax + B y^k - c + u^k \|_2^2 \right), \\ y^{k+1} &:= \operatornamewithlimits{argmin}_{y \in \mathcal{Y}} \left( g(y) + (\rho/2) \| A x^{k+1} + B y - c + u^k \|_2^2 \right), \\ u^{k+1} &:= u^k + A x^{k+1} + B y^{k+1} - c. \end{align*} Applying this algorithm to problem \eqref{opt:form1}, we obtain the following algorithm: \begin{alg}\label{alg:admm} Initialize $\{x_{i}^0 \}$, $\{y_j^0 \}$, $\{ u_j^0 \}$. For $k=0,1,\ldots,$ repeat \begin{enumerate} \item {\bf $x$-update:} The users jointly solve the following problem for $\{ x_i^{k+1} \}$: \begin{align*} \text{min} &\quad -\sum_{i=1}^N f_i(x_i) + (\rho/2) \| \sum_i x_i - y^k + u^k \|_2^2\\ \text{s.t. } &\quad \forall i: x_i \in \mathcal{X}_i. \end{align*} \item {\bf $y$-update:} Each facility $j$ solves the following sub-problem for $y_j^{k+1}$: \begin{align*} \text{min} &\quad g_j(y_j) + (\rho/2) \left( \sum_{i=1}^N x_{ij}^{k+1} - y_j + u_j^k \right)^2\\ \text{s.t. } &\quad y_j \in \mathcal{Y}_j. \end{align*} \item {\bf Dual update:} Each facility $j$ updates $u_j^{k+1}$: \begin{equation*} u_j^{k+1} := u_j^k + \sum_{i=1}^N x_{ij}^{k+1} - y_j^{k+1}. \end{equation*} \end{enumerate} \end{alg} It is known that Algorithm~\ref{alg:admm} is convergent under Assumption~\ref{ass:ass1} \cite{BT97}. However, the $x$-update requires all the users to solve a joint optimization due to the penalty term $(\rho/2) \| \sum_i x_i - y^k + u^k \|_2^2$, which is undesirable for large-scale systems. \subsection{Distributed ADMM Algorithms} Here, we present two distributed ADMM algorithms, as well as their convergence analysis. The first algorithm is essentially the same as the ADMM-based method for the sharing problem \cite[Chapter~7]{BPCP10}. The second algorithm is a variation of the first one by switching the order of $x$-update and $y$-update. \begin{alg}\cite[Chapter~7]{BPCP10}\label{alg:admm1} Initialize $\{x_{i}^0 \}$, $\{y_j^0 \}$, $\{ u_j^0 \}$. For $k=0,1,\ldots,$ repeat \begin{enumerate} \item {\bf $x$-update:} Each user $i$ solves the following sub-problem for $x_i^{k+1}$: \begin{align*} \text{min} &\quad -f_i(x_i) + (\rho/2) \| x_i - x_i^k + d^k \|_2^2\\ \text{s.t. } &\quad x_i \in \mathcal{X}_i, \end{align*} where $d^k \triangleq (1/N)\left( u^k + \sum_{i=1}^N x_{i}^k - y^k \right)$. \item {\bf $y$-update:} Each facility $j$ solves the following sub-problem for $y_j^{k+1}$: \begin{align*} \text{min} &\quad g_j(y_j) + (\rho/2N) \left(y_j - \sum_{i=1}^N {x}_{ij}^{k+1} - u_j^k \right)^2\\ \text{s.t. } &\quad y_j \in \mathcal{Y}_j. \end{align*} \item {\bf Dual update:} Each facility $j$ updates $u_j^{k+1}$: \begin{equation*} u_j^{k+1} := {u}_j^k + \sum_{i=1}^N x_{ij}^{k+1} - y_{j}^{k+1}. \end{equation*} \end{enumerate} \end{alg} \begin{alg}\label{alg:admm2} Initialize $\{x_{i}^0 \}$, $\{y_j^0 \}$, $\{ u_j^0 \}$. For $k=0,1,\ldots,$ repeat \begin{enumerate} \item {\bf $y$-update:} Each facility $j$ solves the following sub-problem for $y_j^{k+1}$: \begin{align*} \text{min} &\quad g_j(y_j) + (\rho/2N) \left(y_j - \sum_{i=1}^N {x}_{ij}^k - u_j^k \right)^2\\ \text{s.t. } &\quad y_j \in \mathcal{Y}_j. \end{align*} \item {\bf $x$-update:} Each user $i$ solves the following sub-problem for $x_i^{k+1}$: \begin{align*} \text{min} &\quad -f_i(x_i) + (\rho/2) \| x_i - x_i^k + d^k \|_2^2\\ \text{s.t. } &\quad x_i \in \mathcal{X}_i, \end{align*} where $d^k \triangleq (1/N) \left( u^k + \sum_{i=1}^N x_{i}^k - y^{k+1} \right)$. \item {\bf Dual update:} Each facility $j$ updates $u_j^{k+1}$: \begin{equation* u_j^{k+1} := u_j^k + \sum_{i=1}^N x_{ij}^{k+1} - y_{j}^{k+1}. \end{equation*} \end{enumerate} \end{alg} Clearly, both algorithms preserve the separability of the problem. Moreover, both algorithms have the same number of dual variables as dual decomposition and the standard ADMM algorithm. The convergence of Algorithm~\ref{alg:admm1} is established in \cite[Chapter~7]{BPCP10} by showing that it is a variant of the standard ADMM algorithm. The convergence of Algorithm~\ref{alg:admm2} follows immediately from the convergence of Algorithm~\ref{alg:admm1}. The connection between these two algorithms and the standard ADMM is provided in the Appendix. More interestingly, by combining the above convergence result with several very recent results \cite{HeYuan12,HeY12,DY12} on ADMM, we can characterize the convergence rates of Algorithms~\ref{alg:admm1} and \ref{alg:admm2}, which are absent in \cite[Chapter~7]{BPCP10}. It turns out that both algorithms have an $\mathcal{O}(1/k)$ rate of convergence for the general case. Moreover, if the cost functions $g_j(\cdot)$ are strictly convex and their gradients $\nabla g_j(\cdot)$ are Lipschitz continuous, Algorithm~\ref{alg:admm1} achieves linear convergence, i.e., convergence at rate $\mathcal{O}(1/a^k)$ for some $a > 1$. Similarly, if the utility functions $f_i(\cdot)$ are strictly concave and their gradients $\nabla f_i(\cdot)$ are Lipschitz continuous, Algorithm~\ref{alg:admm2} achieves linear convergence. Hence, Algorithms~\ref{alg:admm1} and \ref{alg:admm2} naturally complement each other, as summarized in Table~\ref{table:twoalgs}. Finally, we elaborate on the convergence rates presented in Table~\ref{table:twoalgs}, since some of these results will be useful for our simulations. Without loss of generality, we only focus on Algorithm~\ref{alg:admm1}. Let $\left(\{x_i^*\}, \{z_i^*\} \right)$ be a primal optimal solution to problem \eqref{opt:form3} (in particular, we have $x_i^* = z_i^*$), and $\{\lambda_i^*\}$ be a dual optimal solution. Let $v_i^* = \lambda_i^*/\rho$. (The existence of $\{\lambda_i^*\}$ follows from the strong duality theorem.) \begin{prop}\label{thm:sublinear1} Let $\{ \{x_i^k\}, y^k, u^k \}$ be any sequence generated by Algorithm~\ref{alg:admm1}. Let $v^k = u^k / N$ and $z_i^k = x_i^k + v^{k-1} - v^k$. Let \begin{equation}\label{eq:Vk1} V^k = \sum_{i = 1}^N \left( \|z_i^k - z_i^*\|_2^2 + \| v^k - v_i^*\|_2^2 \right), \end{equation} and \begin{equation}\label{eq:Dk1} D^k = \sum_{i = 1}^N \left( \|z_i^{k+1} - z_i^k\|_2^2 + \| v^{k+1} - v^k\|_2^2 \right). \end{equation} Then starting with any initial point $\{ \{x_i^0\}, y^0, u^0 \}$, $D^k$ is non-increasing, and $D^k \le {V^0}/{(k+1)}$ for all $k$. \end{prop} \begin{table}[tp] \centering \caption{Convergence rates of Algorithms~\ref{alg:admm1} and \ref{alg:admm2}.} \vspace{0.5em} \small { \renewcommand{\arraystretch}{1.2} \begin{tabular}{|c|c|c|c|c|} \hline & & Lipschitz & Recommended & \\ \raisebox{0.6em}{Case} & \raisebox{0.6em}{Strictly convex} & continuous & {algorithms} & \raisebox{0.6em}{Rate}\\ \hline \hline 1 & none & none & Alg.~\ref{alg:admm1} or \ref{alg:admm2} & $\mathcal{O}(1/k)$\\ \hline 2 & $\{ g_j\}$ & $\{ \nabla g_j\}$ & Alg.~\ref{alg:admm1} & $\mathcal{O}(1/a^k)$\\ \hline 3 & $\{-f_i\}$ & $\{\nabla f_i\}$ & Alg.~\ref{alg:admm2} & $\mathcal{O}(1/a^k)$\\ \hline 4 & $\{-f_i\}$, $\{ g_j\}$ & $\{\nabla f_i\}$, $\{ \nabla g_j\}$ & Alg.~\ref{alg:admm1} or \ref{alg:admm2} & $\mathcal{O}(1/a^k)$\\ \hline \end{tabular} } \label{table:twoalgs} \end{table} \begin{rem} Proposition~\ref{thm:sublinear1} suggests that the sequence $\{D^k\}$ can be used as a natural stopping rule for Algorithm~\ref{alg:admm1}, which decreases at rate $1/k$. This stopping rule is more rigorous compared to that in \cite[Chapter~7]{BPCP10}, since their stopping rule is based on heuristic principles. For example, their stopping-rule sequence does not have the non-increasing property and may fluctuate over iterations. \end{rem} \begin{prop}\label{thm:linear1} Let $\{ \{x_i^k\}, y^k, u^k \}$ be any sequence generated by Algorithm~\ref{alg:admm1}. Let $V^k$ be the Lyapunov function defined in \eqref{eq:Vk1}. Assume that the cost functions $g_j(\cdot)$ are strictly convex with Lipschitz continuous gradients. Then starting with any initial point $\{ \{x_i^0\}, y^0, u^0 \}$, there exists some $\delta > 0$ such that $V^k \le V^0/ (1+ \delta)^k$ for all $k$. \end{prop} \begin{rem} Proposition~\ref{thm:linear1} provides a guideline for choosing the penalty parameter $\rho$. In particular, one can show that the parameter $\delta = \min\{ c_9/\rho, c_{11} \rho \}$, where $c_9$ and $c_{11}$ are given in \cite{DY12}. Hence, $\rho$ can be chosen such that the parameter $\delta$ is maximized. \end{rem} The proofs of Propositions~\ref{thm:linear1} and \ref{thm:sublinear1} are slight modifications of those presented in \cite{HeYuan12,HeY12,DY12}\footnote{We do not provide the proofs here, but could include them upon editor's request.}. Note that both algorithms use a \emph{single} parameter $\rho$, which is easier to tune compared to dual decomposition. This is desirable for parallel implementation. \subsection{Parallel Implementation} Here, we discuss how the above two algorithms can be effectively implemented on parallel processors in a cloud environment. with a particular focus on Algorithm~\ref{alg:admm1}, since the same discussion applies to Algorithm~\ref{alg:admm2}. We associate each user a type-1 processor, which stores and maintains two states $(x_i^k, d^k)$. Similarly, we associate each facility a type-2 processor, which stores and maintains $(u_j^k, \sum_i x_{ij}^{k+1})$. At the $k$-th iteration, each type-1 processor solves a small-scale convex problem (in $n$ variables), and then reports the updated $x_{ij}^{k+1}$ to facility $j$. Each facility $j$ collects $x_{ij}^{k+1}$ from all type-1 processors, and then computes the sum $\sum_i x_{ij}^{k+1}$. This is called a \emph{reduce} step in parallel computing \cite{DG04}. After the reduce step, each type-2 processor solves a single-variable convex problem for $y_j^{k+1}$ and updates $u_j^{k+1}$. Then, each type-2 processor sends the value of $d_j^{k+1} \triangleq (1/N) \left( u_j^{k+1} + \sum_i x_{ij}^{k+1} - y_j^{k+1} \right)$ to all type-1 processors, which is called a \emph{broadcast} step. Hence, each iteration consists of a reduce step and a broadcast step, performing message-passing between different types of processors. An alternative and perhaps simpler method to implement Algorithm~\ref{alg:admm1} is based on the MPI \emph{Allreduce} operation \cite{MPI96}, which computes the global sum over all processors and distributes the result to every processor. Although the Allreduce operation can be achieved by a reduce step followed by a broadcast step, an efficient implementation (for example, via butterfly mixing) often leads to much better performance. With the help of Allreduce, we only need $N$ processors of the same type, with each storing and maintaining three states $(x_i^k, u^k, \sum_i x_i^k)$. At the $k$-th iteration, each processor solves a small convex problem and updates $x_i^{k+1}$. Then, all the processors perform an Allreduce operation so that all of them (redundantly) obtain $\sum_i x_i^{k+1}$. After this Allreduce step, each processor solves $n$ single-variable convex problems and (redundantly) computes $u^{k+1}$. Clearly, this method simplifies the implementation and can potentially increase the speed. \subsection{Comparisons with Other Algorithms}\label{sec:compare} In this section, we compare Algorithms~\ref{alg:admm1} and \ref{alg:admm2} with dual decomposition and other ADMM-based algorithms. Algorithm~\ref{alg:dual} is the dual-decomposition algorithm for problem \eqref{opt:form1}. Clearly, at each iteration, it has essentially the same complexity as Algorithms~\ref{alg:admm1} and \ref{alg:admm2}. However, Algorithm~\ref{alg:dual} requires delicate adjustments of step sizes $\rho^k$, often resulting in slow convergence. For instance, as we will show in Sec.~\ref{sec:sim_dual}, for solving the geographical load balancing problem \eqref{opt:basic}, Algorithm~\ref{alg:dual} does not converge after hundreds of iterations with a diminishing step-size rule \cite{BM}, while Algorithm~\ref{alg:admm1} converges after 50 iterations. Moreover, Algorithm~\ref{alg:dual} requires the cost functions $g_j(\cdot)$ to be strictly convex and the utility functions $f_i(\cdot)$ to be strictly concave to ensure convergence. In contrast, Algorithms~\ref{alg:admm1} and \ref{alg:admm2} do not make these assumptions. There are some other ADMM-type distributed algorithms in the literature, such as linearized ADMM \cite{HeY12} and multi-block ADMM \cite{HY12, HL12}. However, they are not particularly suitable for the multi-facility resource allocation problem \eqref{opt:form1}. For example, applying linearized ADMM to problem \eqref{opt:form1} gives the following iterations: \begin{align*} x_i^{k+1} &:= \operatornamewithlimits{argmin}_{x_i \in \mathcal{X}_i} \left( -f_i(x_i) + x_i^T g^k + (r/2) \| x_i - x_i^k \|_2^2 \right)\\ y_j^{k+1} &:= \operatornamewithlimits{argmin}_{y_j \in \mathcal{Y}_j} \left( g_j(y_j) + (\rho/2) ( y_j - \sum_{i = 1}^N x_{ij}^{k+1} - u_j^k )^2 \right)\\ u_j^{k+1} &:= u_j^k + \sum_{i = 1}^N x_{ij}^{k+1} - y_j^{k+1}, \end{align*} where $g^k = \rho(\sum_{i} x_i^k - y^{k} + u^k)$ \emph{linearizes} the penalty term $(\rho/2) \| \sum_{i} x_i - y\|_2^2$, and $(r/2) \| x_i - x_i^k \|_2^2$ is a \emph{proximal term}. Although the above algorithm preserves separability of the problem, its convergence requires $r > \rho N$. When $N$ is sufficiently large, the $x$-update in each iteration just slightly changes $x_i$ (due to a large $r$), making the convergence slow. Hence, linearized ADMM is not well suited for large-scale problems. Multi-block ADMM is another candidate for solving problem \eqref{opt:form1}. However, it generally requires users to solve their subproblems sequentially rather than in parallel. Moreover, it still lacks theoretical convergence guarantees for the general case. Indeed, a counter-example has recently been reported showing the impossibility of convergence of multi-block ADMM for the general case \cite{CHYY13}. The algorithms presented in \cite{WHML13} are most similar to ours. Their basic idea is also to apply variants of the standard ADMM algorithm to solve separable convex problems. However, their algorithms require the utility functions to be strictly concave \emph{and} the cost functions to be strictly convex in order to achieve $\mathcal{O}(1/a^k)$ rate of convergence. Such requirements cannot be met in some application scenarios. One such example is backbone traffic engineering, as we will discuss in Sec.~\ref{sec:app}. Compared to our previous ADMM-based algorithms \cite{XL13,Henry-sig,icac13}, our algorithms proposed in this paper enjoy a number of advantages. First, they assume weaker technical assumptions to ensure convergence. Second, they have lower computational complexity and lower message-passing overhead. For example, the algorithms in \cite{icac13,Henry-sig} require strictly convex objective functions and bounded level sets to achieve convergence. In contrast, our new algorithms converge with \emph{non-strictly} convex objective functions. As another example, the algorithm in \cite{XL13} needs each datacenter (facility) to solve a large-scale quadratic problem at each iteration, whereas our new algorithms only require each facility to solve a single-variable convex problem at each iteration. \subsection{Dual variables are equal for all the users}\label{app:dual} \section{Applications to Cloud Traffic Management} \label{sec:app} In this section, we will show that a large variety of optimization problems in the context of cloud traffic management are indeed instances of the multi-facility resource allocation problem \eqref{opt:form1}. In particular, we will illustrate the inherent large scale of these problems for production systems, and explain why the utility function is non-strictly concave and the cost function is non-strictly convex for some applications. \subsection{Geographical Load Balancing} \subsubsection{Background} Cloud services, such as search, social networking, etc., are often deployed on a geographically distributed infrastructure, i.e. data centers located in different regions as shown in Fig. 1, for better performance and reliability. A natural question is then how to direct the workload from users among the set of geo-distributed data centers in order to achieve a desired trade-off between performance and cost, since the energy price exhibits a significant degree of geographical diversity as seminally pointed out by \cite{QWBG09}. This question has attracted much attention recently \cite{LCBW12,icac13,Henry-sig,QWBG09,LLWL11,XL13,GCWK12}, and is generally referred to as geographical load balancing. \begin{figure}[htp] \centering \includegraphics[width=0.47\textwidth]{figures/showcase} \caption{A cloud service running on geographically distributed data centers.} \label{fig:showcase} \end{figure} \subsubsection{Basic Model} We now introduce a formulation for the basic geographical load balancing problem, which captures the essential performance-cost trade-off and covers many existing works \cite{icac13,Henry-sig,QWBG09,LLWL11,XL13,GCWK12}. Here, we define a user to be an group of customers aggregated from a common geographical region sharing a unique IP prefix, as is often done in practice to reduce complexity \cite{NSS10}. We use $x_{ij}$ to denote the amount of workload coming from user $i$ and directed to data center $j$. We use $t_i$ to denote the total workload of each user. We use $f_i(\cdot)$ to represent the utility of user $i$, and use $g_j(\cdot)$ to represent the cost of data center $j$. These functions can take various forms depending on the scenario as we will elaborate soon. With these notations, we formulate the basic geographical load balancing problem: \begin{align} \text{maximize} &\quad \sum_{i} f_i(x_{i}) - \sum_{j} g_j\left(y_j\right) \label{opt:basic} \\ \text{subject to} &\quad \forall i: \ \sum_{j} x_{ij} = t_i, x_i \in \mathbb{R}_{+}^n, \label{con:conservation} \\ &\quad \forall j: \ y_j = \sum_{i} x_{ij} \le c_j, \label{con:capacity} \end{align} where \eqref{con:conservation} describes the workload conservation and non-negativity constraint, and \eqref{con:capacity} is the capacity constraint at data centers. Since the constraint \eqref{con:conservation} can be rewritten as $\forall i: x_i \in \mathcal{X}_i$, where $\mathcal{X}_i$ is a convex set, problem \eqref{opt:basic} is an instance of problem \eqref{opt:form1}. Now, let us consider the utility function $f_i(\cdot)$. Latency is arguably the most important performance metric for most interactive services: A small increase in the user-perceived latency can cause substantial utility loss for the users \cite{KHS07}. The user-perceived latency largely depends on the end-to-end propagation latency \cite{FMLC03,NJRC12}, which can be obtained through active measurements. Let $l_{ij}$ denote the end-to-end propagation latency between user~$i$ and data center~$j$. The following utility function $f_i$ has been used in \cite{Henry-sig,icac13} \begin{equation} \label{eqn:f_glb} f_i(x_i) = -q t_i \left( \sum_j x_{ij} l_{ij}/t_i \right)^2. \end{equation} Here, $q$ is the weight factor that captures the relative importance of performance compared to cost in monetary terms. Clearly, the utility function $f_i(\cdot)$ achieves its maximum value when latency is zero. Also, the function $f_i(\cdot)$ depends on the \emph{average latency} $\sum_j x_{ij} l_{ij}/t_i$. For different applications, $f_i$ may depend on other aggregate statistics of the latency, such as the maximum latency or the 99-th percentile latency, which may be modeled after a norm function. For the cost function $g_j(\cdot)$, many existing works consider the following \cite{QWBG09,LLWL11,XL13,GCWK12} \begin{equation} \label{eqn:g_glb} g_j(y_j) = P^E_j\cdot \text{PUE} \cdot E(y_j). \end{equation} Here, $P^E_j$ denotes the energy price in terms of \$/KWh at data center $j$. PUE, power usage effectiveness, is the ratio between total infrastructure power and server power. Since total infrastructure power mainly consists of server power and cooling power, PUE is commonly used as a measure of data center energy efficiency. Finally, $E(y_j)$ represents the server power at data center~$j$, which is a function of the total workload $y_j$ and can be obtained empirically. A commonly used server power function is from a measurement study of Google \cite{FWB07}: \begin{equation}\label{eqn:dcpower} E(y_j) = c_j P_{\text{idle}}+\left( P_{\text{peak}} - P_{\text{idle}} \right)y_j, \end{equation} where $P_{\text{idle}}$ is server idle power and $P_{\text{peak}}$ peak power. \subsubsection{Problem Scale} The geographical load balancing problem \eqref{opt:basic} would be easy to solve, if its scale is small with, say, hundreds of variables. However, for a production cloud, \eqref{opt:basic} is inherently an extremely large-scale optimization. In practice, the number of users $N$ (unique IP prefixes) is on the order of $\mathcal{O}(10^5)$ \cite{NSS10}. Thus the number of variables $\{x_{ij}\}$ is $\mathcal{O}(10^6)$. The load balancing decision usually needs to be updated on a hourly basis, or even more frequently, as demand varies dynamically. The conventional dual decomposition approach suffers from many performance issues for solving such large-scale problems, as we argued in Sec.~\ref{sec:intro}. Thus we are motivated to consider new distributed optimization algorithms. \subsubsection{Extensions} In this section, we provide some additional extensions of the basic model \eqref{opt:basic} from the literature to demonstrate its importance and generality. \textbf{Minimizing Carbon Footprint.} In \eqref{opt:basic}, the monetary cost of energy is modeled. The environmental cost of energy, i.e., the carbon footprint of energy can also be taken into account. Carbon footprint also has geographical diversity due to different sources of electricity generation in different locations \cite{GCWK12}. Hence, it can be readily modeled by having an additional carbon cost $P^C_j$ in terms of average carbon emission per KWh in the objective function of \eqref{opt:basic} following \cite{GCWK12,LLWL11}. \textbf{Joint Optimization with Batch Workloads.} There are also efforts \cite{LCBW12,icac13,Henry-sig} that consider the delay-tolerant batch workloads in addition to interactive requests, and the integrated workload management problem. Examples of batch workloads include MapReduce jobs, data mining tasks, etc. Batch workloads provides additional flexibility for geographical load balancing: Since their resource allocation is elastic, when the demand spikes we can allocate more capacity to run interactive workloads by reducing the resources for batch workloads. To incorporate batch workloads, we introduce $n$ ``virtual'' users, where user $j$ generates batch workloads running on data center $j$. Let $w_j$ be the amount of resource used for batch workloads on data center $j$, and let $\tilde{f}_j(w_j)$ be the utility of these batch workloads. Then the joint optimization can be formulated as follows: \begin{align*} \text{maximize} &\quad \sum_{i}f_i(x_i) + \sum_{j} \tilde{f}_j(w_j) - \sum_{j} g_j(y_j)\\ \text{subject to} &\quad \forall i: \ \sum_j x_{ij} = t_i, \ x_i \in \mathbb{R}_{+}^n; w \in \mathbb{R}_{+}^n\\ &\quad \forall j: \ y_j = \sum_{i} x_{ij} + w_j \le c_j. \nonumber \end{align*} The utility function $\tilde{f}_j(\cdot)$ depends only on $w_j$ but not on latency, due to its elastic nature. In general, $\tilde{f}_j(\cdot)$ is an increasing and concave function, such as the log function used in \cite{icac13,Henry-sig}. Clearly, this is still an instance of \eqref{opt:form1}. \subsection{Backbone Traffic Engineering} \subsubsection{Background} Large cloud service providers, such as Google and Microsoft, usually interconnect their geo-distributed data centers with a private backbone wide-area networks (WANs). Compared to ISP WANs, data center backbone WANs exhibit unique characteristics \cite{JKMO13,GHCR13}. First, they are increasingly taking advantage of the software-defined networking (SDN) architecture, where a logically centralized controller has global knowledge and coordinates all transmissions \cite{GHMM05,CCFR05}. SDN paves the way for implementing logically centralized traffic engineering. In addition, the majority of the backbone traffic, such as copying user data to remote data centers and synchronizing large data sets across data centers, is elastic. Thus, since the cloud service provider controls both the applications at the edge and the routers in the network, in addition to routing, it can perform application rate control, i.e., allocate the aggregated sending rate of each application, according to the current network state. These characteristics open up the opportunity to perform joint rate control and traffic engineering in backbone WANs, which is starting to receive attention in the networking community \cite{JKMO13,HKMZ13,GHCR13}. \subsubsection{Basic Model} We model the backbone WAN as a set $\mathcal{J}$ of interconnecting links. Conceptually, each cloud application generates a \emph{flow} between a source-destination pair of data centers. We index the flows by $i$, and denote by $\mathcal{I}$ the set of all flows. We assume that each flow can use multiple paths from its source to destination. This is because multi-path routing is relatively easy to implement (e.g., using MPLS \cite{HKMZ13,JKMO13,EJLW01}) and offers many benefits. For each flow $i$, we denote by $\mathcal{P}_i$ the set of its available paths and define a \emph{topology matrix} $A_i$ of size $|\mathcal{J}| \times |\mathcal{P}_i|$ as follows: \[ A_i[j, p] = \begin{cases} 1, &\mbox{if link } j \mbox{ lies on path } p \\ 0, &\mbox{otherwise.} \end{cases} \] \vspace{-4mm} \begin{figure}[htp] \centering \includegraphics[width=0.26\textwidth]{figures/small} \caption{An illustration of three data centers with 3 links.} \label{fig:illustration} \end{figure} For example, consider a network with three data centers and 3 links as illustrated in Fig.~\ref{fig:illustration}. A flow (say, flow $1$) from data center~1 to data center~3 has two paths: $\{ \mbox{link 1}, \mbox{link 2} \}$ and $\{\mbox{link 3}\}$. In this case, $|\mathcal{J}| = 3$, $|\mathcal{P}_1| = 2$, and the topology matrix $A_1$ is \[ A_1 = \begin{bmatrix} 1 & 0\\1 & 0\\0 &1 \end{bmatrix}. \] Clearly, the topology matrix $A_i$ provides a mapping from paths to links. Let $w_{ip}$ denote the amount of traffic of flow $i$ on path $p$, and let $x_{ij}$ denote the amount of traffic of flow $i$ on link $j$. Then we have $x_i = A_i w_i$, where $w_i = (w_{i1}, \ldots, w_{i|\mathcal{P}_i|})^T$. Since $A_i$ is always full column-rank (otherwise some path must be redundant), $A_i$ has a left-inverse $A_i^{-1}$ such that $w_i = A_i^{-1} x_i$. For instance, a left-inverse of $A_1$ in the previous example is \[ A_1^{-1} = \begin{bmatrix} 1 & 0 & 0\\0 & 0 &1 \end{bmatrix}. \] Note that $w_i$ models the rate control decision for each application flow. A flow corresponds to potentially many TCP connections between a particular source-destination pair of data centers, carrying traffic for this particular application. We choose to model rate control at the application flow level because the latest data center backbone architectures \cite{HKMZ13,JKMO13} are designed to control the aggregated sending rates of applications across data centers. The aggregated rate can be readily apportioned among different connections following some notion of fairness, and rate control can be enforced by adding a shim layer in the servers' operating system and using a per-destination token bucket \cite{BCKR11a}. We use $f_i(w_i)$ to represent the utility of flow $i$, and $g_j(y_j)$ to represent the congestion cost of link $j$, where $y_j = \sum_i x_{ij}$ is the total traffic on link $j$. The joint rate control and traffic engineering problem can be formulated as \begin{align} \text{maximize} &\quad \sum_{i} f_i(A_i^{-1}x_{i}) - \sum_{j} g_j\left(y_j\right) \label{opt:basic2} \\ \text{subject to} &\quad \forall i: \ x_i \in \mathbb{R}_{+}^n, \label{con:non-negative2} \\ &\quad \forall j: \ y_j = \sum_{i} x_{ij} \le c_j, \label{con:capacity2} \end{align} where \eqref{con:non-negative2} describes the non-negativity constraint, and \eqref{con:capacity2} says that the total traffic on link $j$ cannot exceed the capacity $c_j$. Clearly, problem \eqref{opt:basic2} is again an instance of problem \eqref{opt:form1}. The utility function $f_i(w_i)$ should be concave, such as the $\log$ function $f_i(w_i) = \log(\sum_p w_{ip})$, or a more general ``rate-fairness'' function used for Internet TCP congestion control \cite{MW00}. It is worth noting that even if $f_i(w_i)$ is strictly concave (with respect to $w_i$), $f_i(A_i^{-1} x_i)$ is \emph{not} strictly concave (with respect to $x_i$) in general. This important fact has been used in Sec.~\ref{sec:compare} to demonstrate the advantages of our distributed algorithms. The cost function $g_j(y_j)$ is convex and non-decreasing. For example, the function can be a piece-wise linear function with increasing slopes, which is used in \cite{GHCR13}. Finally, note that the topology matrix $A_i$ only depends on the source-destination pair. Hence, for a given source data center, the number of all possible topology matrices is bounded by the number of all other data centers, which is typically less than $30$. In other words, the topology matrices are easy to store and maintain in practice. Note also that all the inverse matrices can be computed before the algorithm runs. That is, there is no need to calculate any $A_i^{-1}$ on the fly. \subsubsection{Problem Scale} Similar to the geographical load balancing problem, backbone traffic engineering is also a large-scale optimization problem for a production data center backbone WAN. In practice, a provider runs hundreds to thousands of applications with around ten data centers \cite{HKMZ13,JKMO13}. Thus the number of application flows is $\mathcal{O}(10^5)$ to $\mathcal{O}(10^6)$. For a WAN with tens of links, we potentially have tens of millions of variables $\{ x_{ij} \}$. Compared to geographical load balancing, the traffic engineering decisions need to be updated over a very small time window (say, every 5 or 10 minutes as in \cite{HKMZ13,JKMO13}) to cope with traffic dynamics. This further motivates us to derive a fast distributed solution. \subsubsection{Extensions} We present some possible extensions of the basic model. \textbf{Minimizing Bandwidth Costs.} Unlike big players like Google and Microsoft, small cloud providers often rely on ISPs to interconnect their data centers. In this case, bandwidth costs become one of the most important operating expenses. Although many ISPs adopt the 95-percentile charging scheme in reality, the link bandwidth cost is often assumed to be linear with the link traffic, because optimizing a linear cost in each interval can reduce the monthly 95-percentile bill \cite{ZZGH10}. Hence, the bandwidth cost can be easily incorporated by adding these linear functions to \eqref{opt:basic2}. \textbf{Incrementally Deployed SDN.} Instead of upgrading all routers to be SDN-capable with a daunting bill, cloud providers could deploy SDN incrementally \cite{AKL13}. In such a scenario, some routers still use standard routing protocols such as OSPF, while other routers have the flexibility to choose the next hop. This scenario can be easily handled by imposing additional constraints on the set $\mathcal{P}_i$ of available paths such that $\mathcal{P}_i$ only contains \emph{admissible} paths. (See Definition~1 in \cite{AKL13} for details.) Clearly, with some routers restricted to standard protocols, the number $|\mathcal{P}_i|$ of available paths for flow $i$ is reduced, resulting in a smaller-scale optimization problem. \section{Conclusion}\label{sec:conclusion} In this work, we have introduced a general framework for studying various cloud traffic management problems. We have abstracted these problems as a multi-facility resource allocation problem and presented two distributed algorithms based on ADMM that are amenable to parallel implementation. We have provided the convergence rates of our algorithms under various scenarios. When the utility functions are non-strictly concave and the cost functions are non-strictly convex, our algorithms achieve $\mathcal{O}(1/k)$ rate of convergence. When the utility functions are strictly concave \emph{or} the cost functions are strictly convex, our algorithms achieve $\mathcal{O}(1/a^k)$ rate of convergence. We have shown that, compared to dual decomposition and other ADMM-type distributed solutions, our algorithms have a number of unique advantages, such as achieving faster convergence under weaker assumptions, and enjoying lower computational complexity and lower message-passing overhead. These advantages are further confirmed by our extensive empirical studies. Moreover, our simulation results demonstrate some additional advantages of our algorithms, including the scalability and fault-tolerance, which we believe are highly desirable for large-scale cloud systems. \section{Introduction} \label{sec:intro} Cloud services (such as search, social networking, etc.) are often deployed on a geographically distributed infrastructure, i.e., data centers located in different regions. In order to optimize the efficiency of these data centers, how to orchestrate the data transmission, including traffic flowing from users to the infrastructure to access the cloud services, and traffic flowing across these data centers for back-end services, has started to receive an increasing amount of attention. We refer to these problems generally as \emph{cloud traffic management} herein. In this paper, we introduce a unified framework for studying various cloud traffic management problems, ranging from geographical load balancing to backbone traffic engineering. As we will see in Sec.~\ref{sec:app}, a large variety of cloud traffic management problems can be abstracted into the following form: \begin{align}\label{opt:form1} \text{maximize} &\quad \sum_{i = 1}^N f_i(x_{i1}, \ldots, x_{in}) - \sum_{j=1}^n g_j(y_j) \\ \text{subject to} &\quad \forall j: \sum_{i = 1}^N x_{ij} = y_j \nonumber \\ &\quad \forall i: x_i=(x_{i1}, \ldots, x_{in})^T \in \mathcal{X}_i \subseteq \mathbb{R}^n \nonumber\\ &\quad \forall j: y_j \in \mathcal{Y}_j \subseteq \mathbb{R}. \nonumber \end{align} Generically, the problem \eqref{opt:form1} amounts to allocating resources from $n$ facilities to $N$ users such that the ``social welfare'' (i.e., utility minus cost) is maximized. The utility function $f_i(x_i)$ represents the performance, or the level of satisfaction, of user $i$ when she receives an amount $x_{ij}$ of resources from each facility $j$, where $x_i = (x_{i1}, \ldots, x_{in})^T$. In practice, this performance measure can be in terms of revenue, throughput, or average latency, depending on the problem setup. We assume throughout the paper that $f_i(\cdot)$ are concave. The cost function $g_j(y_j)$ represents the operational expense or congestion cost when facility $j$ allocates an amount $y_j$ of resources to all the users. Note that $y_j$ is the sum of $x_{ij}$ (over $i$), since each facility often cares about the total amount of allocated resources. We assume that $g_j(\cdot)$ are convex. The constraint sets $\{\mathcal{X}_i\}$ and $\{\mathcal{Y}_j\}$ are used to model the additional constraints, which are assumed to be compact convex sets. We refer to problem \eqref{opt:form1} as the \emph{multi-facility resource allocation problem}. We are particularly interested in solutions that are amenable to \emph{parallel} implementations, since a cloud provider usually has abundant servers for parallel computing. For a production cloud, \eqref{opt:form1} is inherently a large-scale convex optimization problem, with millions of variables, or even more. The standard approach to constructing parallel algorithms is dual decomposition with (sub)gradient methods. However, it suffers from several difficulties for problem \eqref{opt:form1}. First, dual decomposition requires a delicate adjustment of the step-size parameters, which have a strong influence on the convergence rate. Second, dual decomposition requires the utility functions $f_i(\cdot)$ to be strictly concave \emph{and} the cost functions $g_j(\cdot)$ to be strictly convex to achieve convergence. These requirements cannot be met in many problem settings of \eqref{opt:form1} we will demonstrate in Sec.~\ref{sec:app}. To overcome these difficulties, we develop a new decomposition method for the multi-facility resource allocation problem. Unlike dual decomposition, our method uses a \emph{single} parameter, which is much easier to tune and often leads to fast convergence. More importantly, our method converges with \emph{non-strictly} concave utility functions and \emph{non-strictly} convex cost functions. Our decomposition method is based on \emph{alternating direction method of multipliers} (ADMM), a simple yet powerful method that has recently found practical use in many large-scale convex optimization problems \cite{BPCP10}. Although ADMM has been widely applied to areas of machine learning and signal processing, its application to networking research is still in an early stage. To the best of our knowledge, our previous work \cite{XL13, Henry-sig, icac13} represents one of the first such applications. Very recently, interesting applications to radio-access networks and fuel cell generation in geo-distributed cloud have been proposed in \cite{LHFLLZ14} and \cite{ZLLLJZL14}, respectively. Compared to these previous algorithms, the algorithms developed in this paper require much weaker technical assumptions to ensure convergence, and, at the same time, enjoy much lower computational complexity and message-passing overhead. Finally, we present an extensive empirical study of our algorithms. Our simulation results reveal some additional advantages of our algorithms, including their scalability to a large number of users and their fault-tolerance with respect to updating failures. The main contributions of this paper are as follows: \begin{enumerate} \item We identify several cloud traffic management problems as instances of the multi-facility resource allocation problem \eqref{opt:form1}. \item We develop two distributed algorithms for problem \eqref{opt:form1}, which enjoy a number of unique advantages over dual decomposition and previous ADMM-based algorithms. \item We present extensive simulation results, which further demonstrate the scalability and fault-tolerance of our algorithms. \end{enumerate} \section{Related Work}\label{sec:related} \subsection{Network Utility Maximization} Network utility maximization (NUM) \cite{Bertsekas98,Srikant04} is closely related to our multi-facility resource allocation problem. A standard technique for solving NUM problems is dual decomposition. Dual decomposition was first applied to the NUM problem in \cite{KMT98}, and has lead to a rich literature on distributed algorithms for network rate control \cite{LL99,PC06,CLCD07} and new understandings of existing network protocols \cite{L03}. Despite its popularity, dual decomposition requires a delicate adjustment of the step-size parameters, which are often difficult to tune. In addition, dual decomposition requires the utility functions to be strictly concave and the cost functions to be strictly convex. Our ADMM-type algorithms overcome these difficulties, achieving faster convergence under weaker assumptions as discussed in Sec.~\ref{sec:compare} in detail. \subsection{ADMM and Its Variations} Originally proposed in the 1970s, ADMM has recently received much research attention and found practical use in many areas, due to its superior empirical performance in solving large-scale convex optimization problems \cite{BPCP10}. While the convergence of ADMM is well known in the literature (see, e.g., \cite{BT97,BPCP10}), its rate of convergence has only been established very recently. \cite{HeY12,HeYuan12} prove rate-$\mathcal{O}(1/k)$ of convergence for the general case. \cite{DY12} proves rate-$\mathcal{O}(1/a^k)$ of convergence under the additional assumptions that the objective function is strongly convex and its gradient is Lipschitz continuous in at least one block of variables. These results provide theoretical foundation for our algorithm design and analysis. ADMM has two important variations: linearized ADMM \cite{HeY12} and multi-block ADMM \cite{HY12, HL12}. However, they are not particularly suitable for problem \eqref{opt:form1}, as discussed thoroughly in Section~\ref{sec:compare}. In contrast, our ADMM-type algorithms exploit the special structure of problem \eqref{opt:form1}, thereby enjoying a number of unique advantages. \subsection{Cloud Traffic Management} Cloud service providers operate two distinct types of WANs: user-facing WANs and backbone WANs \cite{JKMO13}. The user-facing WAN connects cloud users and data centers by peering and exchanging traffic with ISPs. Through optimized load balancing, this type of networks can achieve a desired trade-off between performance and cost \cite{LCBW12,icac13,Henry-sig,QWBG09,LLWL11,XL13,GCWK12}. The backbone WAN provides connectivity among data centers for data replication and synchronization. Rate control and multi-path routing \cite{JKMO13,GHCR13,HKMZ13} can significantly increase link utilization and reduce operational costs of the network. Previous work developed different optimization methods for each application scenario separately, whereas our work provides a unified framework well suited to a wide range of network scenarios. \section{Empirical Study}\label{sec:simulation} We present our empirical study of the performance of the distributed ADMM algorithms. For this purpose, it suffices to choose one of the two cloud traffic management problems since they are equivalent in nature. We use the geographical load balancing problem \eqref{opt:basic} with the utility and cost functions \eqref{eqn:f_glb} and \eqref{eqn:g_glb} as the concrete context of the performance evaluation. This problem corresponds to the most general case (i.e., case~1 in Table~\ref{table:twoalgs}), since \eqref{eqn:f_glb} is non-strictly concave and \eqref{eqn:g_glb} is non-strictly convex. Thus it can be solved using either Algorithm~\ref{alg:admm1} or Algorithm~\ref{alg:admm2}. We use Algorithm~\ref{alg:admm1} in all of our simulations. Note that if the objective function exhibits strict convexity, better simulation results can be obtained according to Proposition~\ref{thm:linear1}. In other words, we mainly focus on the ``worse-case'' performance of the algorithms in this section. We plan to make all our simulation codes publicly available after the review cycle. \subsection{Setup} \label{sec:setup} We randomly generate each user's request demand $t_i$, with an average of $9\times 10^4$. We then normalize the workloads to the number of servers, assuming each request requires 10\% of a server's CPU. We assume the prediction of request demand is done accurately since prediction error is immaterial to performance of the optimization algorithms. The latency $l_{ij}$ between an arbitrary pair of user and data center is randomly generated between 50~ms and 100~ms. We set the number of data centers (facilities) $n=10$. Each data center's capacity $c_j$ is randomly generated so that the total capacity $\sum_j c_j$ is 1.4x the total demand. We use the 2011 annual average day-ahead on peak prices \cite{F11} at 10 different local markets as the power prices $P_j$ for data centers. The servers have peak power $P_{\text{peak}}=200$~W, and consume 50\% power at idle. The PUE is 1.5. These numbers represent state-of-the-art data center hardware \cite{FWB07,QWBG09}. We set the penalty parameter $\rho$ of the ADMM algorithm to $\rho=10^{-3}$ after an empirical sweep of $\rho \in \{ 10^{-4}, 10^{-3}, \ldots, 10^{3}, 10^{4} \}$. Although a more fine-grained search for $\rho$ can further improve the performance of our algorithms, we confine ourselves to the above $9$ choices to demonstrate the practicality. \begin{figure*}[htbp] \begin{minipage}[ht]{0.33\linewidth} \centering \includegraphics[width=1\linewidth]{figures/scenario1-obj} \caption{Objective value. $N=10^2$.} \label{fig:obj} \end{minipage} \begin{minipage}[ht]{0.33\linewidth} \centering \includegraphics[width=1\linewidth]{figures/scenario1-Dk} \caption{$D^k$. $N=10^2$.} \label{fig:Dk} \end{minipage} \begin{minipage}[ht]{0.33\linewidth} \centering \includegraphics[width=1\linewidth]{figures/scenario1-primal} \caption{Primal residual. $N=10^2$.} \label{fig:primal} \end{minipage} \end{figure*} \begin{figure*}[htbp] \begin{minipage}[ht]{0.33\linewidth} \centering \includegraphics[width=1\linewidth]{figures/scenario1-obj-1e4} \caption{Objective value. $N=10^4$.} \label{fig:obj-1e4} \end{minipage} \begin{minipage}[ht]{0.33\linewidth} \centering \includegraphics[width=1\linewidth]{figures/scenario1-Dk-1e4} \caption{$D^k$. $N=10^4$.} \label{fig:Dk-1e4} \end{minipage} \begin{minipage}[ht]{0.33\linewidth} \centering \includegraphics[width=1\linewidth]{figures/scenario1-primal-1e4} \caption{Primal residual. $N=10^4$.} \label{fig:primal-1e4} \end{minipage} \end{figure*} \subsection{Convergence and Scalability} We evaluate the convergence of Algorithm~1 under the previous setup. We vary the problem size by changing the number of users $N \in \{ 10^2,10^3,10^4,10^5 \}$ and scaling data center capacities linearly with $N$. We observe that our algorithm converges quickly after $50$ iterations in all cases, \emph{independent} of the problem size. {\bf Convergence of objective functions.} Figure~\ref{fig:obj} and \ref{fig:obj-1e4} plot the convergence of objective values for $N=10^2$ and $N = 10^4$, respectively. Notice that the objective values for $N = 10^4$ are roughly $100$ times the corresponding values for $N = 10^2$ at each iteration. This means that our algorithm has excellent scalability, which is very helpful in practice. Since the number of iterations is independent of the problem size, it suggests that our algorithm can solve a large-scale problem with (almost) the same running time by simply scaling the amount of computing resources linearly with the number of users. {\bf Convergence of $D^k$.} Figure~\ref{fig:Dk} and \ref{fig:Dk-1e4} show the trajectory of $D^k$ as defined in \eqref{eq:Dk1} for $N=10^2$ and $N = 10^4$, respectively. We observe that $D^k$ is indeed non-increasing in both cases. Further, the two figures are in log scale, implying that $D^k$ decreases sublinearly, which confirms Proposition~\ref{thm:sublinear1} for the $\mathcal{O}(1/k)$ convergence rate. In addition, one can see that $D^k$ scales linearly with $N$ as expected from its definition. This implies that $D^k$ is an ideal candidate for the stopping rule: the algorithm can be terminated when $D^k/N$ is below a certain threshold. {\bf Convergence of primal residuals.} Figure~\ref{fig:primal} and \ref{fig:primal-1e4} show the trajectory of the primal residual, which is defined as $\sum_i^N \| x_i-z_i \|_2^2$ here. It reflects how well the constraints $\{ x_i = z_i \}$ are satisfied, and is sometimes called the primal feasibility gap. For example, if the primal residual is $10^4$ for $N = 10^2$ (or, $10^6$ for $N=10^4$), then on average each $\| x_i - z_i \|$ is around $10$, which is already small enough since $x_i$ is in the order of $10^4$. Hence, we conclude that the constraints are well satisfied after $50$ iterations in both cases. \begin{figure*}[htbp] \begin{minipage}[ht]{0.33\linewidth} \centering \includegraphics[width=1\linewidth]{figures/scenario2-obj-relative} \vspace{-5mm} \caption{Relative errors in objective value. $N=10^2$.} \label{fig:obj-relative} \end{minipage} \begin{minipage}[ht]{0.33\linewidth} \centering \includegraphics[width=1\linewidth]{figures/scenario2-Dk} \vspace{-5mm} \caption{$D^k$. $N=10^2$.} \label{fig:Dk-pf} \end{minipage} \begin{minipage}[ht]{0.33\linewidth} \centering \includegraphics[width=1\linewidth]{figures/scenario2-primal} \vspace{-5mm} \caption{Primal residual. $N=10^2$.} \label{fig:primal-pf} \end{minipage} \end{figure*} \begin{figure*}[htbp] \begin{minipage}[ht]{0.33\linewidth} \centering \includegraphics[width=1\linewidth]{figures/scenario2-1e4-obj-relative} \vspace{-5mm} \caption{Relative errors in objective value. $N=10^4$.} \label{fig:obj-relative-1e4} \end{minipage} \begin{minipage}[ht]{0.33\linewidth} \centering \includegraphics[width=1\linewidth]{figures/scenario2-1e4-Dk} \vspace{-5mm} \caption{$D^k$. $N=10^4$.} \label{fig:Dk-pf-1e4} \end{minipage} \begin{minipage}[ht]{0.33\linewidth} \centering \includegraphics[width=1\linewidth]{figures/scenario2-1e4-primal} \vspace{-5mm} \caption{Primal residual. $N=10^4$.} \label{fig:primal-pf-1e4} \end{minipage} \end{figure*} \subsection{Fault-tolerance} We have observed that our algorithms converge fast to the optimal solution for large-scale problems. Yet, because failures are the norm rather than the exception, fault-tolerance is arguably the most important design objective for parallel computing frameworks that involve a large number of servers currently \cite{DG04}. A parallel algorithm that is inherently robust against failures in the intermediate steps is highly desirable for practical deployment. To investigate the fault-tolerance of our algorithm, we carry out a new set of simulations where each user fails to update $x_i^k$ with a probability $p$ at each iteration (independent of each other). Whenever a failure happens, user $i$ simply reuses its previous solution by setting $x^{k+1}_i := x^k_i$. Figure~\ref{fig:obj-relative}--\ref{fig:primal-pf} plot the convergence with different failure probabilities for $N=10^2$, and Figure~\ref{fig:obj-relative-1e4}--\ref{fig:primal-pf-1e4} for $N=10^4$. Specifically, Figure~\ref{fig:obj-relative} and \ref{fig:obj-relative-1e4} plot the relative error in objective value with failures (i.e. $\textsc{obj\_fail}/\textsc{obj}-1$, where $\textsc{obj\_fail}$ is the objective value with failures, and $\textsc{obj}$ is the objective value when every step is solved correctly). We observe that increasing the failure probability from 5\% to 10\% increases the relative error, causing the solution quality to degrade at the early stage. Yet surprisingly, the impact is very insignificant: The relative error is at most 1.5\%, and ceases to 0 after 100 iterations. In fact, after 50 iterations the relative error is only around 0.2\% for both problem sizes. Moreover, failures do not affect the convergence of the algorithm at all. This is indicated by the relative error plots, and further illustrated by the overlapping curves in Figure~\ref{fig:Dk-pf}, \ref{fig:primal-pf}, \ref{fig:Dk-pf-1e4}, and \ref{fig:primal-pf-1e4} for $D^k$ and primal residual. Thus, we find that our distributed ADMM algorithms are inherently fault-tolerant, with less than 1\% optimality loss and essentially the same convergence speed for up to 10\% failure rate. They are robust enough to handle temporary failures that commonly occur in production systems. \subsection{Comparison with Dual Decomposition} \label{sec:sim_dual} We also simulate the conventional dual decomposition approach with subgradient methods as explained in Sec.~\ref{sec:compare} to solve problem \eqref{opt:basic}. The step size $\rho^k$ is chosen following the commonly accepted diminishing step size rule \cite{BM}, with $\rho^k = 10^{-5}/\sqrt{k}$. We plot the trajectory of objective values in Figure~\ref{fig:obj-sm}, and that of primal residuals in Figure~\ref{fig:primal-sm}. Compare to Algorithm~1, dual decomposition yields wildly fluctuating results. Though the objective value decreases to the same level as Algorithm~1 after about 200 iterations, the more meaningful primal variables $\{x_i\}$ never converge even after 400 iterations. One can see from Figure~\ref{fig:primal-sm} that the primal residual does not decrease below $10^7$. This implies that the equality constraints $\{x_i=z_i\}$ are not well-satisfied during the entire course, and the primal variables $\{x_i\}$ still violate the capacity constraints after 400 iterations. \begin{figure}[htbp] \begin{minipage}[ht]{0.49\linewidth} \centering \includegraphics[width=1\linewidth]{figures/scenario3-obj} \caption{Objective value. $N=10^2$.} \label{fig:obj-sm} \end{minipage} \begin{minipage}[ht]{0.49\linewidth} \centering \includegraphics[width=1\linewidth]{figures/scenario3-primal} \caption{Primal residual. $N=10^2$.} \label{fig:primal-sm} \end{minipage} \end{figure} This phenomenon is due to the \emph{oscillation problem} \cite{LS06} when dual decomposition method is applied to non-strictly convex objective functions. To mitigate this problem, one can make the objective function strictly convex by adding a small penalty term, e.g., $\rho_1 \| x \|_2^2 + \rho_2 \| z \|_2^2$). Nevertheless, we found that the primal variables $\{x_i\}$ still converge very slowly after an extensive trial of different $(\rho_1, \rho_2)$. To summarize, our simulation results confirm our theoretical analysis, demonstrate fast convergence of our algorithms in various settings, and highlight several additional advantages, especially the scalability and fault-tolerance.
{'timestamp': '2016-02-04T02:03:30', 'yymm': '1407', 'arxiv_id': '1407.8309', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8309'}
arxiv
\section{Introduction} \label{sec:introd} Market equilibrium is a classical problem arising in Economics, with applications ranging from the analysis of market power to the simulation of new types of regulation. The most studied versions involve agents that choose a (continuous) variable; a Nash equilibrium occurs when no firm can do better by unilaterally changing its strategy. When the variable being played is the quantity, this is usually called a Cournot equilibrium when all firms play simultaneously; when a leader firm moves first, and follower firms move afterwords, this is called a Stackelberg equilibrium (see e.g.~\cite{Osborne1994} for an introduction). Much less attention has been drawn to those games where some variables in this competition are discrete. In this case, the computation of equilibria is a much harder task; actually, determining the optimal strategy for a single player is itself an NP-complete problem in many situations. Let us start with the description of the market we will deal with in this paper. The demand is forecast with complete certainty for a number of coming periods. A firm has the possibility of producing in a given period or not; demand is met in each period with goods either produced or existing in inventory. There are fixed (setup) and inventory costs, and the production capacity is limited. The variables for each firm are, thus: \begin{itemize} \item decide whether to produce or not, for each period in the planning horizon; \item choose the quantity to place in the market in each period. \end{itemize} If the demand is independent of the price (i.e. it is a fixed amount) and there is only one firm, this leads to the well known lot-sizing problem~\cite{Bitran1982}. We are more interested in the case where demand is dependent of the price; this dependence will be captured by modelling demand as a linear function of the price (or, equivalently, price as a linear function of the quantity put in the market). This leads to a lot-sizing variant where the firm, instead of simply meeting the demand, must decide what quantity to put in the market. Price is, thus, a function of the total quantity, i.e., the quantity played summed for all the firms. \section{Some interesting markets} \subsection{Example} \label{sec:data} For the sake of clarity, we will use an example throughout this paper. Demand is different from period to period, and is modelled by: \begin{equation} \label{eq:demand} P_t(Q_t) = \max(a_t - b_t Q_t, 0), \;\;\; \textrm{for } t=1,\ldots,T, \end{equation} where $t$ is the period, $T$ is the total number of periods, $a_t$, $b_t$ are parameters of the model, and $Q_t \geq 0$ is the total quantity placed in the market in period~$t$. The decision variables concern producing or not in each period, as well as the amount to produce, and the amount to place in the market. Let $y$ be the vector of setup, binary variables, where $y_{t}$ is 1 if there is production during period $t$, and $0$ otherwise. Variables $x_{t}$ and $q_t$ are, respectively, the corresponding manufactured amount and the quantity placed in the market in $t$, and the quantity held in inventory at the end of the period $t$ is $h_t$; these are non-negative, continuous variables. The bill of materials can be written as: \begin{equation} \label{eq:bom} h_{t-1} + x_t = q_t + h_t, \;\;\; \textrm{for } t=1,\ldots,T. \end{equation} We assume that there is a limit $K$ on the capacity available on each period, and production can only occur if machines have been setup; this implies that \begin{equation} \label{eq:setup} x_{t} \leq K y_{t}, \;\;\; \textrm{for } t=1,\ldots,T. \end{equation} Let us denote the fixed production costs by $F$ and the unit inventory costs by $H$. For a given production plan the total costs are: $$C(y,h) = \sum_{t=1}^{T} (F y_t + H h_t).$$ We will provide a numerical example, allowing to draw conclusions for simple situations. Demand is enough for at least one firm to be able to produce with profit on the first half of the horizon, and larger for the second half. Inventory costs are such that it is worthy to produce some periods in advance (when demand justifies it), but too early production is discouraged by them. We assume throughout this paper that firms know each others' costs and capacities (i.e., technology is known). \subsection{Monopoly} \label{sec:monopoly} In the monopoly case, all the variables are under the control of the firm. In this case, market quantities are those decided by the monopolist, $Q_t = q^M_t$, and the corresponding price is given by Equation~\ref{eq:demand}. The profit is therefore given by \begin{equation} \label{eq:monopoly} \Pi = \sum_{t=1}^{T} \left[q^M_t P_t(q^M_t) - (F y_t + H h_t)\right]. \end{equation} For a single period, the optimal result for this model is well known; maximum profit is obtained when the derivatives with respect to the quantity are zero, which for linear demand leads to optimal quantities $$q^{*M} = \frac{a}{2 b}.$$ The firm will produce if the corresponding profit is positive, i.e., if the revenue is larger than the fixed cost~$F$. When there are several periods, the situation is more complex; an illustration is provided for our example in Table~\ref{tab:monopoly}. The firm produces a small quantity for the initial periods, and produces at full capacity after the demand raises. Notice that this problem is NP-hard even when the quantities are fixed~\cite{garey79} (this is the ``standard'' lot-sizing problem, i.e., all that the firm has to do is to meet demand at minimal cost), so for more realistic examples the computation of the optimum is not trivial. For obtaining the results presented in this paper we used the software Couenne~\cite{BelottiCouMan09}, which is based on the latest developments in mixed-integer nonlinear programming~\cite{Hemmecke2010}. \begin{table}[htbp] \centering \begin{scriptsize} \begin{tabular}{|c|c|c||c|r|r|r||c|r|r|r|} \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c||}{$F=10, H=1, K=10$} & \multicolumn{4}{|c|}{$F=10, H=1, K=25$}\\\hline Period (t) & ~$a_t$~ & ~$b_t$~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ \\\hline 1 & 10 & 1 & 1 & 5.00 & 0.00 & 5.00 & 1 & 13.49 & 8.49 & 4.99\\ 2 & 10 & 1 & 1 & 9.50 & 4.50 & 5.00 & 0 & 0.00 & 4.00 & 4.50\\ 3 & 10 & 1 & 0 & 0.00 & 0.00 & 4.50 & 0 & 0.00 & 0.00 & 4.00\\ 4 & 10 & 0.5 & 1 & 10.00 & 0.00 & 10.00 & 1 & 10.00 & 0.00 & 10.00\\ 5 & 10 & 0.5 & 1 & 10.00 & 0.00 & 10.00 & 1 & 19.00 & 9.00 & 10.00\\ 6 & 10 & 0.5 & 1 & 10.00 & 0.00 & 10.00 & 0 & 0.00 & 0.00 & 9.00\\ \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c|}{$\Pi = 170.25$} & \multicolumn{4}{|c||}{$\Pi = 171.75$} \\\hline\hline 1 & 10 & 0.25 & 1 & 10.00 & 0.00 & 10.00 & 1 & 20.00 & 0.00 & 20.00\\ 2 & 10 & 0.25 & 1 & 10.00 & 0.00 & 10.00 & 1 & 23.01 & 3.01 & 20.00\\ 3 & 10 & 0.25 & 1 & 10.00 & 2.00 & 8.00 & 1 & 25.00 & 10.01 & 18.00\\ 4 & 10 & 0.125 & 1 & 10.00 & 0.00 & 12.00 & 1 & 25.00 & 3.00 & 32.01\\ 5 & 10 & 0.125 & 1 & 10.00 & 0.00 & 10.00 & 1 & 25.00 & 0.00 & 28.00\\ 6 & 10 & 0.125 & 1 & 10.00 & 0.00 & 10.00 & 1 & 25.00 & 0.00 & 25.00\\ \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c|}{$\Pi = 429.00$} & \multicolumn{4}{|c||}{$\Pi = 768.875$} \\\hline \end{tabular} \end{scriptsize} \caption{Optimal results for the monopoly situation, under four parameter sets.} \label{tab:monopoly} \end{table} \subsection{Oligopoly} \label{sec:olipoly} Let us now consider the case of several firms operating in the market, an oligopoly. The difference between the monopoly and the current situation is that now the total quantity put in the market is no longer the decision of a single firm. This can be written in the profit for each firm $i$ as: \begin{equation} \label{eq:oligopoly} \Pi^i = \sum_{t=1}^{T} \left[q^i_t P_t(\sum_{j=1}^{N}q^j_t) - (F^i y^i_t + H^i h^i_t)\right]. \end{equation} where $N$ is the number of firms operating. \subsubsection{One-period games.} For a single period, an equilibrium for this model can again be derived analytically, and is well known: it is the Cournot equilibrium. Assuming that the fixed costs are null or low enough, maximum profit is obtained when the partial derivatives of the profit with respect to the quantity are zero, for each firm, leading to the system of equations $$q^i = \frac{a + b \sum_{j\neq i}q^j}{2 b}.$$ At this point, no firm has incentive to deviate; any unilateral variation will lead to a smaller profit. The solution is more complex in the presence of fixed costs. The previous equilibrium may be a solution with positive profit for all firms in this case too. When not all firms can produce with profit, i.e., fixed costs~$F^i$ are larger than the revenue at the Cournot equilibrium, there may be the case that one firm can produce with profit, but if any other enters the market, all will have losses. Another potential equilibrium, seldom analysed, occurs when one firm plays a large quantity, in order to try to put the others out of the market; this ``aggressive'' firm plays a large quantity, in such a way that the other companies' profit is zero (or negative, if they produce a positive amount). Clearly, if all firms play this large amount, they all will be worse off; but if one of them succeeds imposing this quantity, as in a Stackelberg equilibrium, the others' optimal strategy is no production. Yet another possibility in this game occurs when the firms coalesce and maximise the sum of the profits of all firms, deciding in another stance how to share them. This situation is quite similar to the monopoly case. The multi-period situation is considerably more complex. We present next some results for equilibria with a single move for all periods; an \emph{iterated} version will be developed in section~\ref{sec:iterated}. \subsubsection{Multi-period duopoly: a case study.} For illustrating the duopoly case we take the same production and demand parameters used for the monopoly example, and analyse the behaviour of a market with two firms. For the following results we use fixed-point iteration, and the software Couenne for optimisation. In each iteration, Firm 1 optimises its quantities based on the previous output of Firm 2, and vice-versa; details are available in Algorithm~\ref{alg:FPI}, where $\bar{q}^i$ are initial values for the quantities played, $\bar{q}^{*i}$ are the corresponding values optimised for the competitor's current value, and $q^i$ the decision variables in each optimization problem; $\epsilon$~is a convergence criterion. Initial quantities for Firm 2 are zero for all periods, except if otherwise stated. \begin{algorithm} initialise $\bar{q}^1$ and $\bar{q}^2$\; \SetKwRepeat{Repeat}{repeat}{until} \Repeat{$\Delta < \epsilon$} { $\bar{q}^{*1} \leftarrow \argmax(\Pi^1(q^1, \bar{q}^2))$\; $\bar{q}^{*2} \leftarrow \argmax(\Pi^2(\bar{q}^{*1}, q^2))$\; $\Delta \leftarrow |\bar{q}^{*1} - \bar{q}^1| + |\bar{q}^{*2} - \bar{q}^2|$\; $\bar{q}^1 \leftarrow \bar{q}^{*1}$\; $\bar{q}^2 \leftarrow \bar{q}^{*2}$\; } \caption{A fix-point iteration for the duopoly equilibrium\label{alg:FPI}} \end{algorithm} Let us first analyse the case where firms are symmetric, as in the results presented in Table~\ref{tab:duopoly}. The first observation is that when the setup decisions are important, even though the profits at equilibrium are roughly the same, the quantities played in each period by each of the firms may be considerably different. \begin{table}[htbp] \centering \begin{scriptsize} \begin{tabular}{|c|c|c||c|r|r|r||c|r|r|r|} \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c||}{Firm 1} & \multicolumn{4}{|c|}{Firm 2}\\\hline \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c||}{$F=10, H=1, K=10$} & \multicolumn{4}{|c|}{$F=10, H=1, K=10$}\\\hline Period (t) & ~$a_t$~ & ~$b_t$~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ \\\hline 1 & 10 & 1& 1 & 8.37 & 5.04 & 3.33 & 1 & 6.33 & 3.00 & 3.34 \\ 2 & 10 & 1& 0 & 0.00 & 2.04 & 3.00 & 0 & 0.00 & 0.00 & 3.00 \\ 3 & 10 & 1& 0 & 0.00 & 0.00 & 2.04 & 1 & 10.00 & 6.08 & 3.92 \\ 4 & 10 & 0.5& 1 & 10.00 & 4.41 & 5.59 & 0 & 0.00 & 0.00 & 6.08 \\ 5 & 10 & 0.5& 0 & 0.00 & 0.00 & 4.41 & 1 & 10.00 & 3.54 & 6.46 \\ 6 & 10 & 0.5& 1 & 8.22 & 0.00 & 8.22 & 0 & 0.00 & 0.00 & 3.54 \\ \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c|}{$\Pi^1 = 67.13$} & \multicolumn{4}{|c||}{$\Pi^2 = 65.72$} \\\hline\hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c||}{$F=10, H=1, K=25$} & \multicolumn{4}{|c|}{$F=10, H=1, K=25$}\\\hline Period (t) & ~$a_t$~ & ~$b_t$~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ \\\hline 1 & 10 & 1& 1 & 8.33 & 5.00 & 3.34 & 1 & 6.33 & 3.00 & 3.34 \\ 2 & 10 & 1& 0 & 0.00 & 2.00 & 3.00 & 0 & 0.00 & 0.00 & 3.00 \\ 3 & 10 & 1& 0 & 0.00 & 0.00 & 2.00 & 1 & 9.33 & 5.33 & 4.00 \\ 4 & 10 & 0.5& 1 & 12.67 & 5.33 & 7.34 & 0 & 0.00 & 0.00 & 5.33 \\ 5 & 10 & 0.5& 0 & 0.00 & 0.00 & 5.33 & 1 & 12.66 & 5.33 & 7.33 \\ 6 & 10 & 0.5& 1 & 7.34 & 0.00 & 7.34 & 0 & 0.00 & 0.00 & 5.33 \\ \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c|}{$\Pi^1 = 62.15$} & \multicolumn{4}{|c||}{$\Pi^2 = 61.43$} \\\hline\hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c||}{$F=10, H=1, K=10$} & \multicolumn{4}{|c|}{$F=10, H=1, K=10$}\\\hline Period (t) & ~$a_t$~ & ~$b_t$~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ \\\hline 1 & 10 & 0.25& 1 & 10.00 & 0.00 & 10.00 & 1 & 10.00 & 0.00 & 10.00 \\ 2 & 10 & 0.25& 1 & 10.00 & 0.89 & 9.11 & 1 & 10.00 & 0.90 & 9.10 \\ 3 & 10 & 0.25& 1 & 10.00 & 3.11 & 7.78 & 1 & 10.00 & 3.11 & 7.78 \\ 4 & 10 & 0.125& 1 & 10.00 & 0.22 & 12.89 & 1 & 10.00 & 0.23 & 12.89 \\ 5 & 10 & 0.125& 1 & 10.00 & 0.00 & 10.22 & 1 & 10.00 & 0.00 & 10.23 \\ 6 & 10 & 0.125& 1 & 10.00 & 0.00 & 10.00 & 1 & 10.00 & 0.00 & 10.00 \\ \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c|}{$\Pi^1 = 321.375$} & \multicolumn{4}{|c||}{$\Pi^2 = 321.368$} \\\hline\hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c||}{$F=10, H=1, K=25$} & \multicolumn{4}{|c|}{$F=10, H=1, K=25$}\\\hline Period (t) & ~$a_t$~ & ~$b_t$~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ \\\hline 1 & 10 & 0.25& 1 & 13.34 & 0.00 & 13.34 & 1 & 13.34 & 0.00 & 13.34 \\ 2 & 10 & 0.25& 1 & 13.34 & 0.00 & 13.34 & 1 & 13.34 & 0.00 & 13.34 \\ 3 & 10 & 0.25& 1 & 13.34 & 0.00 & 13.34 & 1 & 13.34 & 0.00 & 13.34 \\ 4 & 10 & 0.125& 1 & 25.00 & 0.00 & 25.00 & 1 & 25.00 & 0.00 & 25.00 \\ 5 & 10 & 0.125& 1 & 25.00 & 0.00 & 25.00 & 1 & 25.00 & 0.00 & 25.00 \\ 6 & 10 & 0.125& 1 & 25.00 & 0.00 & 25.00 & 1 & 25.00 & 0.00 & 25.00 \\ \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c|}{$\Pi^1 = 354.558$} & \multicolumn{4}{|c||}{$\Pi^2 = 354.55$} \\\hline \end{tabular} \end{scriptsize} \caption{Results for a duopoly: Cournot equilibria for the lot-sizing problem.} \label{tab:duopoly} \end{table} Notice that for small demand, when capacities increase, both firms may become worse off even if the costs are unchanged; this has occurred from the topmost to the second situations in Table~\ref{tab:duopoly}. When demand is large enough, this no longer occurs (third and fourth entries in the table). It is common to have several equilibria on games with discrete variables; an illustration with our example is presented in Table~\ref{tab:manyeq}. This tables shows two different outcomes of the fixed-point iteration, obtained using different starting solutions. Both firms are better off in the top scenario, even though no one has incentive to deviate from the situation in the bottom. \begin{table}[htbp] \centering \begin{scriptsize} \begin{tabular}{|c|c|c||c|r|r|r||c|r|r|r|} \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c||}{Firm 1} & \multicolumn{4}{|c|}{Firm 2}\\\hline \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c||}{$F=10, H=1, K=10$} & \multicolumn{4}{|c|}{$F=10, H=1, K=10$}\\\hline Period (t) & ~$a_t$~ & ~$b_t$~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ \\\hline 1 & 10 & 1& 1 & 8.37 & 5.04 & 3.33 & 1 & 6.33 & 3.00 & 3.34 \\ 2 & 10 & 1& 0 & 0.00 & 2.04 & 3.00 & 0 & 0.00 & 0.00 & 3.00 \\ 3 & 10 & 1& 0 & 0.00 & 0.00 & 2.04 & 1 & 10.00 & 6.08 & 3.92 \\ 4 & 10 & 0.5& 1 & 10.00 & 4.41 & 5.59 & 0 & 0.00 & 0.00 & 6.08 \\ 5 & 10 & 0.5& 0 & 0.00 & 0.00 & 4.41 & 1 & 10.00 & 3.54 & 6.46 \\ 6 & 10 & 0.5& 1 & 8.22 & 0.00 & 8.22 & 0 & 0.00 & 0.00 & 3.54 \\ \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c|}{$\Pi^1 = 67.13$} & \multicolumn{4}{|c||}{$\Pi^2 = 65.72$} \\\hline 1 & 10 & 1& 1 & 9.00 & 5.67 & 3.33 & 1 & 9.01 & 5.67 & 3.34 \\ 2 & 10 & 1& 0 & 0.00 & 2.67 & 3.00 & 0 & 0.00 & 2.67 & 3.00 \\ 3 & 10 & 1& 0 & 0.00 & 0.00 & 2.67 & 0 & 0.00 & 0.00 & 2.67 \\ 4 & 10 & 0.5& 1 & 8.00 & 0.66 & 7.34 & 1 & 10.00 & 4.67 & 5.33 \\ 5 & 10 & 0.5& 1 & 10.00 & 4.00 & 6.67 & 0 & 0.00 & 0.00 & 4.67 \\ 6 & 10 & 0.5& 0 & 0.00 & 0.00 & 4.00 & 1 & 8.00 & 0.00 & 8.00 \\ \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c|}{$\Pi^1 = 64.30$} & \multicolumn{4}{|c||}{$\Pi^2 = 64.34$} \\\hline \end{tabular} \end{scriptsize} \caption{Different equilibria obtained for the same parameter set.} \label{tab:manyeq} \end{table} There may also be the case that the capacities are asymmetric; in this case the firm with larger capacity has a competitive advantage, as shown in Table~\ref{tab:asymmetric}. \begin{table}[htbp] \centering \begin{scriptsize} \begin{tabular}{|c|c|c||c|r|r|r||c|r|r|r|} \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c||}{Firm 1} & \multicolumn{4}{|c|}{Firm 2}\\\hline \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c||}{$F=10, H=1, K=10$} & \multicolumn{4}{|c|}{$F=10, H=1, K=25$}\\\hline Period (t) & ~$a_t$~ & ~$b_t$~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ \\\hline 1 & 10 & 1& 1 & 8.33 & 5.00 & 3.33 & 1 & 6.33 & 3.00 & 3.33 \\ 2 & 10 & 1& 0 & 0.00 & 2.00 & 3.00 & 0 & 0.00 & 0.00 & 3.00 \\ 3 & 10 & 1& 0 & 0.00 & 0.00 & 2.00 & 1 & 9.34 & 5.34 & 3.99 \\ 4 & 10 & 0.5& 1 & 7.33 & 0.00 & 7.32 & 0 & 0.00 & 0.00 & 5.34 \\ 5 & 10 & 0.5& 1 & 10.00 & 4.67 & 5.34 & 1 & 13.99 & 6.67 & 7.32 \\ 6 & 10 & 0.5& 0 & 0.00 & 0.00 & 4.67 & 0 & 0.00 & 0.00 & 6.67 \\ \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c|}{$\Pi^1 = 56.11$} & \multicolumn{4}{|c||}{$\Pi^2 = 69.46$} \\\hline \end{tabular} \end{scriptsize} \caption{Equilibrium with asymmetric capacities.} \label{tab:asymmetric} \end{table} Let us now turn to the case where one firm decides to play a quantity such that the other is put out of the market, as in a Stackelberg equilibrium. The problem of optimally determining that (leader's) quantity is not trivial, as a sub-problem of this is to determine the point where profit becomes non-null in a minimum cost production plan (this is the follower's problem). Empirically, this equilibrium can be determined by increasing the quantity put into the market by one firm, until the optimal response of the opponents be to produce zero. Results for this case are presented in Table~\ref{tab:deter}. Note that we are unsure if this is an equilibrium; we just verified that any slight reduction in Firm 2's quantities induce Firm 1 to play, resulting in a large decrease on Firm 2's profit. In the situation presented, Firm 1 has no incentive to play a positive amount, as it would result in losses. \begin{table}[htbp] \centering \begin{scriptsize} \begin{tabular}{|c|c|c||c|r|r|r||c|r|r|r|} \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c||}{Firm 1} & \multicolumn{4}{|c|}{Firm 2}\\\hline \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c||}{$F=10, H=1, K=25$} & \multicolumn{4}{|c|}{$F=10, H=1, K=25$}\\\hline Period (t) & ~$a_t$~ & ~$b_t$~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ \\\hline 1 & 10 & 1& 0 & 0.000 & 0.000 & 0.000 & 1 & 10.888 & 5.449 & 5.439 \\ 2 & 10 & 1& 0 & 0.000 & 0.000 & 0.000 & 0 & 0.000 & 0.000 & 5.449 \\ 3 & 10 & 1& 0 & 0.000 & 0.000 & 0.000 & 1 & 5.469 & 0.000 & 5.469 \\ 4 & 10 & 0.5& 0 & 0.000 & 0.000 & 0.000 & 1 & 13.409 & 0.000 & 13.409 \\ 5 & 10 & 0.5& 0 & 0.000 & 0.000 & 0.000 & 1 & 12.889 & 0.000 & 12.889 \\ 6 & 10 & 0.5& 0 & 0.000 & 0.000 & 0.000 & 1 & 12.769 & 0.000 & 12.769 \\ \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c|}{$\Pi^1 = 0$} & \multicolumn{4}{|c||}{$\Pi^2 = 155.119$} \\\hline \end{tabular} \end{scriptsize} \caption{Equilibrium when firm 2 defects (plays a quantity such that firm 1's optimal response is to play zero).} \label{tab:deter} \end{table} Clearly, if Firm 1 would play the same quantities as a Firm 2, it would result in large losses for both firms. This example serves as an introduction to a different type of game, where firms may collaborate (play Cournot's quantities) or defect. This makes a bridge between games in market equilibria and 2-person games like the Prisoner's Dilemma. In this context, due to the existence of several periods, repeated games are particularly interesting; we will turn to their analysis in the next section. \section{Iterated games} \label{sec:iterated} One may consider that the decisions for all the periods have to be taken in advance, and the corresponding quantities fixed for all the planning horizon. However, it is much more natural to consider that at the begin of each period there is a commitment only regarding the quantity to produce on that period, and that the moves concerning later periods remain open. This situation leads to an interesting game between the firms, where in each period a firm may decide to cooperate with the others, or to defect. In many situations, the computation of a Nash equilibrium in the presence of discrete variables is NP-hard~\cite{Papadimitriou2001,Daskalakis2009}. As for our problem, even the monopoly case is NP-hard. The equilibria computed in the previous section for the duopoly case are based on the assumption that each firm knows the production decisions of the other for the whole planning horizon. If that information is not available (as usual in real-world cases), the problem becomes more complicated. As we have seen, the solutions are many times asymmetric; there is no easy strategy for deciding on the role of each firm if the future periods' moves are not known. Indeed, we are not aware of an optimal strategy for this general case. In order to complete the illustration, we go back to the example and provide results for a simple strategy, on a two-firm game, equivalent of a well known strategy in the iterated Prisoners' Dilemma~\cite{Rapoport1965}: \begin{enumerate} \item On the first period cooperate: play an optimal (non-defecting) quantity given by equation~\ref{eq:oligopoly} if it leads to a positive profit, or null quantity otherwise. \item On the subsequent periods: \begin{enumerate} \item if in the previous period the opponent cooperated, cooperate too: play a Cournot's quantity; \item otherwise, retaliate: play a large quantity, such that the other firms' optimal reaction would be producing zero quantity. \end{enumerate} \end{enumerate} Notice that, as in some instances there are several possibilities for Cournot equilibria, the above strategy may be ambiguous. This can be observed on Table~\ref{tab:cooperate}. Even though in the best situation the Cournot equilibrium with future information is obtained (top), other (inferior) situations may also arise (middle and bottom); firms have no information to decide which plays what in asymmetric moves. \begin{table}[htbp] \centering \begin{scriptsize} \begin{tabular}{|c|c|c||c|r|r|r||c|r|r|r|} \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c||}{Firm 1} & \multicolumn{4}{|c|}{Firm 2}\\\hline \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c||}{$F=10, H=1, K=25$} & \multicolumn{4}{|c|}{$F=10, H=1, K=25$}\\\hline Period (t) & ~$a_t$~ & ~$b_t$~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ \\\hline 1 & 10 & 1& 1 & 8.33 & 5.00 & 3.34 & 1 & 6.33 & 3.00 & 3.34 \\ 2 & 10 & 1& 0 & 0.00 & 2.00 & 3.00 & 0 & 0.00 & 0.00 & 3.00 \\ 3 & 10 & 1& 0 & 0.00 & 0.00 & 2.00 & 1 & 9.33 & 5.33 & 4.00 \\ 4 & 10 & 0.5& 1 & 12.67 & 5.33 & 7.34 & 0 & 0.00 & 0.00 & 5.33 \\ 5 & 10 & 0.5& 0 & 0.00 & 0.00 & 5.33 & 1 & 12.66 & 5.33 & 7.33 \\ 6 & 10 & 0.5& 1 & 7.34 & 0.00 & 7.34 & 0 & 0.00 & 0.00 & 5.33 \\ \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c|}{$\Pi^1 = 62.15$} & \multicolumn{4}{|c||}{$\Pi^2 = 61.43$} \\\hline\hline 1 & 10 & 1 & 1 & 6.33 & 3.00 & 3.34 & 1 & 6.33 & 3.00 & 3.34 \\ 2 & 10 & 1 & 0 & 0.00 & 0.00 & 3.00 & 0 & 0.00 & 0.00 & 3.00 \\ 3 & 10 & 1 & 1 & 9.33 & 5.33 & 4.00 & 1 & 9.33 & 5.33 & 4.00 \\ 4 & 10 & 0.5 & 0 & 0.00 & 0.00 & 5.33 & 0 & 0.00 & 0.00 & 5.33 \\ 5 & 10 & 0.5 & 1 & 12.66 & 5.33 & 7.33 & 1 & 12.66 & 5.33 & 7.33 \\ 6 & 10 & 0.5 & 0 & 0.00 & 0.00 & 5.33 & 0 & 0.00 & 0.00 & 5.33 \\ \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c|}{$\Pi^1 = 56.70$} & \multicolumn{4}{|c||}{$\Pi^2 = 56.70$} \\\hline\hline 1 & 10 & 1& 1 & 8.33 & 5.00 & 3.34 & 1 & 8.33 & 5.00 & 3.34 \\ 2 & 10 & 1& 0 & 0.00 & 2.00 & 3.00 & 0 & 0.00 & 2.00 & 3.00 \\ 3 & 10 & 1& 0 & 0.00 & 0.00 & 2.00 & 0 & 0.00 & 0.00 & 2.00 \\ 4 & 10 & 0.5& 1 & 12.67 & 5.33 & 7.34 & 1 & 12.67 & 5.33 & 7.34 \\ 5 & 10 & 0.5& 0 & 0.00 & 0.00 & 5.33 & 0 & 0.00 & 0.00 & 5.33 \\ 6 & 10 & 0.5& 1 & 7.34 & 0.00 & 7.34 & 1 & 7.34 & 0.00 & 7.34 \\ \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c|}{$\Pi^1 = 56.78$} & \multicolumn{4}{|c||}{$\Pi^2 = 56.78$} \\\hline \end{tabular} \end{scriptsize} \caption{Results for repeated games: both firms cooperate.} \label{tab:cooperate} \end{table} Much inferior outcomes are obtained if one of the firms decides to defect. A firm might be tempted to impose a large move; but, as the other firm has no information about this, it will play either the ``cooperate'' or the ``defect'' move, resulting in large losses for both. Table~\ref{tab:defect} presents these situations. It should be noted that, in the cases presented, the last firm defecting is worse off at the end. This encourages firms to defect, trying to make the other firms drop out of the market, and have the large profits of Table~\ref{tab:deter}. \begin{table}[htbp] \centering \begin{scriptsize} \begin{tabular}{|c|c|c||c|r|r|r||c|r|r|r|} \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c||}{Firm 1} & \multicolumn{4}{|c|}{Firm 2}\\\hline \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c||}{$F=10, H=1, K=25$} & \multicolumn{4}{|c|}{$F=10, H=1, K=25$}\\\hline Period (t) & ~$a_t$~ & ~$b_t$~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ & ~~$y_t$~~ & ~~$x_t$~~ & ~~$h_t$~~ & ~~$q_t$~~ \\\hline 1 & 10 & 1& 1 & 10.88 & 5.44 & 5.44 & 1 & 10.88 & 5.44 & 5.44 \\ 2 & 10 & 1& 1 & 0.00 & 0.00 & 5.44 & 0 & 0.00 & 0.00 & 5.44 \\ 3 & 10 & 1& 0 & 5.47 & 0.00 & 5.47 & 1 & 5.47 & 0.00 & 5.47 \\ 4 & 10 & 0.5& 1 & 13.41 & 0.00 & 13.41 & 1 & 13.41 & 0.00 & 13.41 \\ 5 & 10 & 0.5& 1 & 12.89 & 0.00 & 12.89 & 1 & 12.89 & 0.00 & 12.89 \\ 6 & 10 & 0.5& 1 & 12.78 & 0.00 & 12.78 & 1 & 12.78 & 0.00 & 12.78 \\ \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c|}{$\Pi^1 = -55.44$} & \multicolumn{4}{|c||}{$\Pi^2 = -55.44$} \\\hline\hline 1 & 10 & 1 & 1 & 6.33 & 3.00 & 3.34 & 1 & 10.88 & 5.44 & 5.44 \\ 2 & 10 & 1 & 0 & 0.00 & 0.00 & 3.00 & 0 & 0.00 & 0.00 & 5.44 \\ 3 & 10 & 1 & 1 & 9.33 & 5.33 & 4.00 & 1 & 5.47 & 0.00 & 5.47 \\ 4 & 10 & 0.5 & 0 & 0.00 & 0.00 & 5.33 & 1 & 13.41 & 0.00 & 13.41 \\ 5 & 10 & 0.5 & 1 & 12.66 & 5.33 & 7.33 & 1 & 12.89 & 0.00 & 12.89 \\ 6 & 10 & 0.5 & 0 & 0.00 & 0.00 & 5.33 & 1 & 12.78 & 0.00 & 12.78 \\ \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c|}{$\Pi^1 = -23.77$} & \multicolumn{4}{|c||}{$\Pi^2 = -15.01$} \\\hline\hline 1 & 10 & 1& 1 & 8.33 & 4.99 & 3.34 & 1 & 10.88 & 5.44 & 5.44 \\ 2 & 10 & 1& 1 & 5.89 & 5.44 & 5.44 & 0 & 0.00 & 2.10 & 3.34 \\ 3 & 10 & 1& 0 & 0.00 & 2.10 & 3.34 & 1 & 3.37 & 0.00 & 5.47 \\ 4 & 10 & 0.5& 1 & 11.31 & 0.00 & 13.41 & 1 & 12.67 & 5.33 & 7.34 \\ 5 & 10 & 0.5& 1 & 12.67 & 5.33 & 7.34 & 1 & 7.56 & 0.00 & 12.89\\ 6 & 10 & 0.5& 1 & 7.45 & 0.00 & 12.78 & 1 & 7.34 & 0.00 & 7.34 \\ \hline \multicolumn{3}{|c||}{~} & \multicolumn{4}{|c|}{$\Pi^1 = -53.17$} & \multicolumn{4}{|c||}{$\Pi^2 = -45.65$} \\\hline \end{tabular} \end{scriptsize} \caption{Results for repeated games: both firms defect (top), Firm 2 defects and Firm 1 cooperates (middle), or play other firm's last move (bottom; Firm 2 starts defecting).} \label{tab:defect} \end{table} \section{Conclusions} \label{sec:conclusions} Recent advances in mixed-integer nonlinear programming software allow the straightforward computation of optimal solution for problems which were very difficult to solve some years ago. This allowed us to compute equilibria in a simple but very interesting market, where a lot-sizing problem is setup in a competitive context. The analysis of a simple example puts in evidence that the solution of a lot-sizing problem may be very different of its usual, constant demand version. This also extends, in a somewhat different way, recent work on agent-based approaches for computational equilibria~\cite{Kimbrough2008} to a recurring, dynamic environment. When several firms play, the existence of several periods in the lot-sizing problem makes it natural to have an iterated game where each firm plays one move per period. We proposed a very simple strategy; more sophisticated ones, e.g. mixed strategies, are an interesting subject for further research in this topic. Another direction concerns the analysis of real-world problems under this background; many markets have points in common with this model (for example, energy markets, often tackled as equilibrium models~\cite{Ehrenmann2008}). A scenario which is worthy studying is the one where firms with consecutive losses drop out of the market, as happens in most real-world cases. The illustration presented in this paper is also interesting for broadening the range of situations analysed in the study of equilibria in Economics, putting in close relation economic equilibrium and computational complexity, two subjects seldom studied together. Iterated games are often considered excellent teaching tools~\cite{Resler1996}; we hope that the one described here will also make a contribution in this regard. \paragraph*{Acknowledgment.} This research was supported in part by FCT -- Funda{\c c}{\~a}o para a Ci{\^e}ncia e a Tecnologia (Project **PTDC/GES/73801/2006) and by an European project under Framework Programme 7 (CIVITAS-ELAN: Mobilising citizens for vital cities). \bibliographystyle{splncs}
{'timestamp': '2016-04-28T02:13:52', 'yymm': '1407', 'arxiv_id': '1407.8394', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8394'}
arxiv
\section{Our Approach} In this section we describe our approach. It relies on a statistical segmentation method that can take as input the original image and the results of the previous segmentation steps. In practice we use the KernelBoost method~\cite{Becker13b}, which we improved for this work. We therefore describe it in Section~\ref{sec:KB_and_IKB} for completeness, along with our modifications. \subsection{Knotting Branches for Segmentation} In our approach, as illustrated in Fig.~\ref{fig:scheme}(c), we first segment the input image using a classifier that predicts for each image location to which class the location belongs, together with a confidence measure about this prediction. In general this first segmentation has margins for improvement, and we perform subsequent segmentations that rely not only on the original image but also on the output of previous steps. This is similar to what Auto-Context does, but differs in a critical way: we separate image locations into a ``positive set'' made of the ones classified as positives, and a ``negative set'' made of the ones classified as negatives. Each set is then processed independently by a new classifier. We iterate this process until convergence on the training set. The output of the different classifiers are then fed to a final classifier to produce the final segmentation. \newcommand{\mathcal{T}}{\mathcal{T}} \newcommand{{\bf X}}{{\bf X}} \newcommand{{\bf Y}}{{\bf Y}} \newcommand{\varphi}{\varphi} \newcommand{\wh}[1]{\widehat{#1}} \newcommand{\wb}[1]{\overline{#1}} \newcommand{L}{L} \newcommand{P}{P} \newcommand{N}{N} More formally, let $\mathcal{T} = \{({\bf X}_i, {\bf Y}_i)\}_i$ be a set of training images ${\bf X}_i$ together with the corresponding ground truth labels ${\bf Y}_i$. We write \begin{equation} {\bf Y}_i(u,v) = \left\{ \begin{array}{cc} +1 & \text{ if } (u,v) \text{ in }{\bf X}_i\text{ belongs to foreground,}\\ -1 & \text{ otherwise.}\\ \end{array} \right. \end{equation} We train a first classifier \begin{equation} \varphi^0 = \argmin_\varphi \sum_i \sum_{(u,v)} L\big({\bf Y}_i(u,v),\varphi({\bf X}_i)(u,v)\big) \> , \end{equation} where $L$ is a loss function. $\varphi^0({\bf X})$ can be seen as a confidence map: $|\varphi^0({\bf X})(u,v)|$ is a confidence measure for location $(u,v)$ in ${\bf X}$. However, to avoid locations with large absolute values bias the further steps, we use instead a version normalized to lie in the $[-1,+1]$ by considering \begin{equation} \wb{\varphi}^0({\bf X}) = 2p\left( {\bf Y}_i = 1 \left|\right.{\bf X}_i\right) -1, \label{eq:normalisation} \end{equation} where $p\left( {\bf Y}_i = 1 \left|\right.{\bf X}_i\right)$ is the probability of a pixel of being in the positive class. We use \begin{equation} p\left( {\bf Y}_i = 1 \left|\right.{\bf X}_i\right) = \frac{1}{1+\exp(-2\varphi^0({\bf X}))} \label{eq:prob_norm} \end{equation} as in~\cite{Hastie01}. We then define the positive $P_i^0$ and negative $N_i^0$ sets for each training image ${\bf X}_i$ as \begin{equation} \begin{array}{ll} P_i^0 & = \left\{ (u,v) \> | \> \wb{\varphi}^0({\bf X}_i)(u,v) > -\varepsilon \right\} \> , \text{ and}\\ N_i^0 & = \left\{ (u,v) \> | \> \wb{\varphi}^0({\bf X}_i)(u,v) < +\varepsilon \right\} \> .\\ \end{array} \end{equation} Because we use $\varepsilon > 0$, the positive sets $\{P_i^0\}_i$ contain locations that are classified by $\wb{\varphi}^0$ as positive but also locations classified as negative but with low confidence. In practice, we use $\varepsilon = \frac{1}{2}$. Similarly, the negative sets $\{ N_i^0 \}_i$ contain locations classified as positive with low confidence. Both the positive and negative sets therefore contain all the difficult-to-classify samples, which will be treated by two new classifiers $\varphi_P^1$ and $\varphi_N^1$. The first is taken to be \begin{equation} \begin{array}{ll} \varphi_P^1 = & \argmin \limits_\varphi \sum\limits_i \sum\limits_{(u,v)\inP_i^0} L\big({\bf Y}_i(u,v),\varphi({\bf X}_i^1)(u,v)\big) \> ,\\ \end{array} \end{equation} where ${\bf X}_i^1 = \big({\bf X}_i,\wb{\varphi}^0({\bf X}_i)\big)$. $\varphi_P^1$ is therefore trained on the locations in the positive sets only, and has access to the normalized confidence maps $\wb{\varphi}^0({\bf X}_i)$ in addition to the training images. Its task is thus simpler than that of the first classifier. The $\varphi_N^1$ classifier is defined in a similar way. New positive and negative sets, respectively noted $P_i^1$ and $N_i^1$, are computed as before from the output of the two classifiers $\varphi_P^1$ and $\varphi_N^1$. Next, we train a second pair of classifiers $\varphi_P^2$ and $\varphi_N^2$. The $\varphi_P^2$ classifier is taken as: \begin{equation} \begin{array}{ll} \varphi_P^2 = & \argmin \limits_\varphi \sum\limits_i \sum\limits_{(u,v)\inP_i^1} L\big({\bf Y}_i(u,v),\varphi({\bf X}_i^{2,P})(u,v)\big) \> ,\\ \end{array} \end{equation} where ${\bf X}_i^{2,P}$ is made of image ${\bf X}_i$, and all the corresponding confidence maps computed up to this point: ${\bf X}_i^{2,P} = \big({\bf X}_i,\wb{\varphi}^0({\bf X}_i), \wb{\varphi}_P^1({\bf X}_i^1) \big)$. Similarly, \begin{equation} \begin{array}{ll} \varphi_N^2 = & \argmin \limits_\varphi \sum\limits_i \sum\limits_{(u,v)\inN_i^1} L\big({\bf Y}_i(u,v),\varphi({\bf X}_i^{2,N})(u,v)\big) \> ,\\ \end{array} \end{equation} This process is iterated as long as the numbers of misclassified samples in both branches of our ``tree'' remain above a threshold. Finally we train a Randomized Forest to predict the locations labels based on all the available data, including the input image, feeding the classifier with a feature descriptor \begin{equation} \Delta = \Big\{\Big(\big({\bf X}_i, \wb{\varphi}^0({\bf X}_i), \wb{\varphi}_P^1({\bf X}_i^1), \wb{\varphi}_N^1({\bf X}_i^1), \cdots \big), {\bf Y}_i\Big)\Big\}_i. \end{equation} To incorporate additional information about a pixel's neighborhood, we also consider the values located on the corners and on the middle of the side of two nested squares centred on the point, with side of 5 and 10 pixels respectively, in a stylized snowflake configuration. In the case of a multi-label segmentation problem, we proceed as described above for each label in a 1-versus-all scheme. Again, a final Randomized Forest is trained to predict the label based on all the intermediate data created for all the labels. At run-time, we simply have to apply to the input image ${\bf X}$ the successive classifiers $\varphi^0$, $\varphi_P^0$, $\varphi_N^1$, $\cdots$ to compute the normalized confidence maps, which are then fed to the final Randomized Forest to obtain a final confidence map. \subsection{Expanded Trees} In the case of the ideal structure of Fig.~\ref{fig:scheme}(b), we proceed as explained above for what concerns the splitting criteria, but instead of sending samples to the parallel branch when they meet the criteria to switch branch, we simply continue the splitting process. When the number of samples in a node falls below a critical threshold, we stop the growing of that branch. \section{Conclusion} We have introduced a novel approach to exploiting context in a way to capture complex interactions between neighboring image pixels. Our method outperforms current state-of-the-art segmentation algorithms, obtaining results which exhibit accurate boundaries between the different image regions. In future work we plan to operate directly on 3D data, a natural extension of our approach, to exploit context across slices in image stacks, and to consider different imaging types, such as Magnetic Resonance Imaging (MRI) scans. \section{KernelBoost, Improved KernelBoost, and extensions} \label{sec:KB_and_IKB} KernelBoost (KB) is a statistical method that segments an image by classifying each pixel independently into two classes. It has the key advantage of not requiring to hand-design the kernels it operates with, and that of having very few, easily tunable parameters. The training data is a set of training samples $\{({\bf x}_i,y_i)\}_{i=1 ... N}$, where ${\bf x}_i \in {\mathbb{R}}^n$ is an image patch and $y_i \in \{-1,1\}$ its corresponding label. From this set, KernelBoost first generates a bank of discriminative kernels, and then builds a binary GradientBoost classifier, with weak learners of the form of regression trees. Each node of these trees contains a test selected from the kernel bank. At run-time, the selected kernels ${\bf k}_j$ can simply be used as convolutional filters applied to the image to segment, which makes the approach efficient. \subsection{Pooling and training sample clustering} While obtaining excellent performances in the delineation of curvilinear structures~\cite{Becker13b}, the original KernelBoost method lacks a mechanism for dealing with more complex patterns, such as the ones that typically appear in medical images. To highlight this deficiency, we applied the original KernelBoost to a texture segmentation problem. As shown in Fig.~\ref{fig:texture}(c), the quality of the segmentation is quite poor. \begin{figure}[t] \centering \begin{tabular}{ccc} \includegraphics[width=0.3\columnwidth]{img_texture} & \hspace{1em} & \includegraphics[width=0.3\columnwidth]{gt_texture} \\ {\bf (a)} & \hspace{1em} & {\bf (b)} \\ \includegraphics[width=0.3\columnwidth]{kb_nopool_texture} & \hspace{1em} & \includegraphics[width=0.3\columnwidth]{kb_pool_texture} \\ {\bf (c)} & \hspace{1em} & {\bf (d)} \\ \end{tabular} \caption{Texture experiment. The segmented image is a mosaic of Brodatz images, created at USC-SIPI for research on texture segmentation. The dataset is available at the address~\url{http://sipi.usc.edu/database/?volume=textures}. {\bf(a)} Original test pattern. {\bf(b)} Ground-truth for the selected material. {\bf(c)} Segmentation obtained by the KernelBoost algorithm~\cite{Becker13b}. {\bf(d)} Segmentation obtained by the KernelBoost algorithm coupled with the POSNEG/MAX-pooling scheme.} \label{fig:texture} \end{figure} This is because, for texture recognition problems, the filter responses should be made robust to slight shifts in the images. We therefore introduce a pooling mechanism~\cite{Boureau10b} over the filter responses. We evaluated several possible mechanisms, and we empirically noticed that keeping the maximum value of the responses of the POSNEG operator~\cite{Rigamonti11b} over a region performed best. The POSNEG operator transforms the result of a convolution $C$ into two images, one made of the positive values of $C$, the other one made of the opposite of the negative values of $C$. The optimization over each node finds which filter and which of these two images should be used for best performances. Moreover, the kernels learned by the original KernelBoost filters are not always optimal. This is because they are learned in a discriminative fashion in the attempt to distinguish all the positive samples from the negative ones. However, this leads to suboptimal performances because positive samples can be very different from each other, for example in presence of texture. We therefore cluster the positive samples based on their appearances, and each kernel is generated by classifying the positive samples of one cluster randomly chosen against all the negative samples. We empirically observed that this second modification also improves the results compared to the original KernelBoost. However, even with these improvements, KernelBoost can make significant mistakes if not incorporated in the framework we propose, as shown in Fig.~\ref{fig:comparisons1}. In the following we will refer to KernelBoost, when both pooling and clustering are used, as \emph{Improved KernelBoost\xspace} (IKB\xspace for short). \subsection{Superpixel pooling and superpixel features} Superpixels~\cite{Felzenszwalb04} emerged as an efficient way of dealing with large images and image stacks, while at the same time improving the performances by averaging the results of pixel-based approaches over small, homogeneous image regions. The idea behind them is to group meaningful regions and to use them as a substitute of the regular grid structures imposed by pixels~\cite{Achanta12}. The same pixel-based regular grid is used by traditional pooling operators available in literature, we have therefore considered replacing it with a structure based on superpixels. However, given the homogeneity of the pixels captured inside each superpixel, pooling the feature values inside each superpixel would be of little use. Indeed, the main goal of the pooling step is to introduce robustness against small distortions, translations and rotations, and this requires the pooling scheme to be independent from the underlying data. The idea of analyzing filter responses over structures whose shapes are not imposed by rigid rules, but by the image itself, is nonetheless appealing. We have therefore considered not the superpixels extracted from the images, but the regions which can be computed from them by erosion and dilation by a given amount of pixels. If we consider, for instance, the superpixel segmentation of Fig.~\ref{fig:mito_sp}(a), we can observe that it is able to group interesting regions, such as the membranes of the mitochondria. While pooling directly on them would simply average very similar filter responses on an homogeneous region, if we consider smaller and larger regions we can hope that, for instance, the classifier gets fed with the border of each membrane, easing its recognition. As an example, this can happen by considering the two regions, outlined in green and blue respectively, of Fig.~\ref{fig:mito_sp}(b). We have dubbed this approach \emph{superpixel pooling}. \begin{figure}[t] \centering \begin{tabular}{cc} \includegraphics[width=0.4\columnwidth]{mito_sp} & \includegraphics[width=0.4\columnwidth]{mito_focus} \\ {\bf (a)} & {\bf (b)} \\ \end{tabular} \caption{Analysis of the regions identified by SLIC superpixels~\cite{Achanta12} on a fragment of a medical image. {\bf(a)} SLIC superpixels extracted by the code provided by~\cite{Achanta12}. Notice that they accurately distinguish different regions, such as the membranes of the mitochondria. {\bf(a)} Example extended/shrinked regions --- in blue and green respectively --- where pooling can be performed to extract meaningful information about the mitochondrion's membrane.} \label{fig:mito_sp} \end{figure} In the KernelBoost context we can go even further and perform operations over different regions computed from the individual superpixels. The classifier present in each weak learner will be fed with a set of features resulting from potentially nonlinear operations over multiple regions --- for instance the difference of the absolute values of the negative parts of the two regions in Fig.~\ref{fig:mito_sp}(b) --- and will then be able to select the most discriminative combinations for a given training set. Among the different approaches available in literature, SLIC superpixels~\cite{Achanta12} emerged for their simplicity and their capability to adhere to image boundaries. We have therefore based our proposal on the superpixels extracted by this approach. \subsection{External features} KernelBoost is particularly well suited to exploit the power of external hand-crafted or learned features. It can indeed load them as additional channels, and perform filter learning on them, thus empowering them by building a two-level architecture. A particularly interesting example of features is constituted by Ilastik features~\cite{Sommer10}. They are constituted by multiple hand-crafted features --- such as Gaussians, Structure Tensor, \ldots --- computed with different parameter settings, for instance different Gaussian smoothing. They are used in many state-of-the-art segmentation tools used by practitioners. The features that can be used are usually dataset-dependent. For instance, in one dataset where the task is the segmentation of mitochondria, we have included as an additional channel the mitochondria membranes obtained by the algorithm of~\cite{Sironi14}, and this proved to significantly improve the final performance, as shown in Section~\ref{sec:ress}. \subsection{Multiple scales} When dealing with medical images, the structures of interest commonly appear at very different scales or occupy relevant portions of the images. In typical EM images of mitochondria, for example, a single mitochondrion might be several hundreds pixels in length. For this reason, learning filters from data at full image scale might lead to a set of filters which are able to capture only small fractions of the objects, engendering errors in a pixel-level segmentation. The KernelBoost approach can be easily extended to deal with multiple scales, given its ability to operate on separate input channels. We just have to incorporate the notion of scale in the sampling scheme, to ensure that the same sample is collected over the different scales considered. The filter learning process is then performed independently for each individual channel at the proper scale, and the regression tree learning scheme will then be in charge of selecting which filter and which scale are more discriminative. \subsection{Fake-3D} EM imagery often produces complete, anisotropic image stacks. Full 3D information can be very useful in discriminating the different components of the scene, but it is usually computationally expensive and memory intensive to deal with. Moreover, the anisotropicity of the data might result in degenerate filters and therefore poor performance. For these reasons, while KernelBoost could in principle operate on N-D data --- experiments with 3D image stacks are presented in~\cite{Becker13b} --- we have chosen to operate on 2D data but incorporating data from multiple neighboring slices. In particular, the whole segmentation scheme operates on individual slices until it reaches the final classifier stage. At that point the classifier is fed not only with the features extracted on the considered slice, but also with the features extracted on a slice $D$ steps before and on a slice $D$ steps after it. Padding is performed to deal with stack's boundaries. We have considered in our experiments $D=3$, but its exact value has to be tuned according to the size of the structures of interest and the inter-slice distance. \subsection{Z-cut} Biomedical image stacks usually contain components with no predominant orientation. The choice of the axes is therefore arbitary. When enough slices are available, it might be interesting to consider not only the images in the traditional X-Y plane, but also in the X-Z and Y-Z ones. This is particularly useful in the context of an architecture such as those presented in the previous chapter, where different levels of recursion can focus on different image planes. Indeed, if the anisotropicity is not too elevated, filters can impose a regularity on the structures found in these planes, giving a final 3D result which is smoother and less noisy. \section{Introduction} Many recent papers~\cite{Tu09,Munoz10,Montillo11,Kontschieder13} have shown the importance of using {\it context} when segmenting biomedical images. It helps avoid large segmentation errors without having to rely on \emph{ad hoc} regularization priors~\cite{Rao10,Lucchi13a}, which are commonly used but can only improve results to a limited extent. Using context in this manner can therefore be understood as learning to capture more complex interactions to better regularize the segmented regions. \begin{figure}[th] \centering \begin{tabular}{ccc} \includegraphics[width=0.36\linewidth]{jurkat_0008_img_overlay} & \hspace{1em} & \includegraphics[width=0.36\linewidth]{jurkat_0008_gt} \\ {\bf Original image} & \hspace{1em} & {\bf Ground-truth} \\ \includegraphics[width=0.36\linewidth]{jurkat_0008_WRF_segm_ERR} & \hspace{1em} & \includegraphics[width=0.36\linewidth]{jurkat_0008_kb_segm_ERR} \\ {\bf Random Forests} & \hspace{1em} & {\bf Improved KernelBoost\xspace} \\ \includegraphics[width=0.36\linewidth]{jurkat_0008_ac4_segm_ERR} & \hspace{1em} & \includegraphics[width=0.36\linewidth]{jurkat_0008_zm_segm_ERR} \\ {\bf Auto-Context~\cite{Tu09}} & \hspace{1em} & {\bf Our approach} \\ \end{tabular} \caption{Segmentation example for a test image from the Jurkat dataset~\cite{Morath13} (the area highlighted in orange is ignored during training/testing, as it includes cells that do not appear in the ground truth). The thresholds were selected to give, for each method, the highest accuracy. Note that our approach finds accurate boundaries between the different regions, and that it avoids the errors made by the other methods especially in the light gray region. Red overlays in the segmentations are used to mark the mistakes. Best viewed in color.} \label{fig:comparisons1} \end{figure} \begin{figure}[th] \begin{center} \includegraphics[width=0.98\linewidth]{diagrams} \end{center} \hspace{0.7cm} {\bf (a)} \hspace{3.4cm} {\bf (b)} \hspace{4.75cm} {\bf (c)} \caption{{\bf (a)} Schematic representation of the Auto-Context approach~\cite{Tu09}. At each iteration, the segmentation results from the previous iterations are taken into account in addition to the input image. {\bf (b)} Ideal structure of our system, which we have dubbed \emph{Expanded Trees}. The output of the first segmentation ({\it Sc}) is split between positive and negative samples, and two separate classifiers are trained. The procedure is iterated for the desired number of levels, and finally a classifier collects the different output to produce the final segmentation. Since we use powerful classifiers, many training samples are required, otherwise we would quickly run out of samples and therefore overfit after few iterations. Also, the number of classifiers to train -- and therefore the computational costs -- grows exponentially with the depth of the structure. {\bf (c)} The approach we propose. We ``knot'' some branches together, and the classifiers in charge of a specific class at each level are now the same. This avoids overfitting, as the classifiers are trained with larger training sets, while retaining most of the classification power of the tree structure and keeping the computational effort limited. Again, the output of all the intermediate steps is fed to a classifier that produces the final segmentation. } \label{fig:scheme} \end{figure} In this paper, we go one step further by showing that we can use context not only to avoid segmentation errors but also to accurately find region boundaries. This is challenging for several reasons. First, in most kinds of images, classifiers trained to differentiate locations belonging to one kind of region from those belonging to another may struggle near boundaries. This is because locations on both sides of the boundaries can be hard to distinguish, especially when using feature vectors computed using filters having a substantial spatial extent. Second, in biomedical images in general and particularly in those at the scale of living cells, boundaries can have arbitrarily complex shapes. To overcome these difficulties we propose an approach that is inspired by the popular Auto-Context algorithm~\cite{Tu09} but, unlike it, progressively focuses more and more on \emph{difficult-to-classify} samples. More specifically, for foreground/background segmentation purposes, Auto-Context trains a chain of classifiers as depicted by Fig.~\ref{fig:scheme}(a): The input to the first classifier is simply the image data but the next classifiers also have access to the segmentation results produced by previous stages. To achieve our goal of focusing on difficult-to-classify samples, we could instead leverage the powerful decision tree strategy~\cite{Breiman84}. This would mean recursively splitting the pixels into those that are classified as foreground and background and train a new classifier for each subset, as depicted by Fig.~\ref{fig:scheme}(b). Unfortunately, unless the training set is sufficiently large, that would be suboptimal because each subsequent classifier would have to be trained on an ever smaller fraction of it, to the point where the training would become ineffective. This is particularly true in the biomedical field, where often the amount of training data is limited because it is cumbersome to label. Also, this would require the training of an exponentially growing number of classifier, and therefore a considerable computational effort. We will refer to this approach in the following as \emph{Expanded Trees}. As shown in Fig.~\ref{fig:scheme}(c), our solution is to train only two classifiers at each stage. The first operates on the samples that are classified as potential foreground ones by {\it either} classifiers at the previous stage, and the second one on samples classified as potential negatives. In this way, the number of training examples used to train the classifiers can be kept roughly constant at all stages, which avoids overfitting. Since we ``knot'' the two branches of the tree, we have dubbed this approach \emph{Knotted Trees}. To focus on the difficult-to-classify examples, we use permissive bounds to decide if a sample is potentially foreground or background. For example, a sample classified as negative but with a low confidence score is a difficult-to-classify sample, and it is sent to the two classifiers at the next stage. In this way, both classifiers will have access to these important samples. A final classifier collects the partial results from the different branches and outputs the final segmentation. In the evaluation of the schemes we presented, we use in each node a KernelBoost classifier~\cite{Becker13b}. However, other classifiers can be used as long as they are powerful enough, at least in the earlier stages. Our approach naturally extends to multi-label segmentation problems. We simply train our approach for each label in a 1-versus-1 scheme, where separate binary problem are set up for each pair of classes. Again, a final classifier collects the partial results from the different branches and outputs the final segmentation. We use four different datasets to demonstrate that our approach outperforms both Auto-Context~\cite{Tu09} and a recent CRF-based method~\cite{Lucchi13a}, and to assess the strengths and weaknesses of the methods we propose. \section{Related Work} Image segmentation algorithms typically rely on local image cues combined with spatial constraints. For example, Markov Random Fields~(MRFs) use unary terms that depend on image features together with pairwise potentials that enforce simple smoothness priors~\cite{Li95,Perez98}. With Conditional Random Fields~(CRFs), the smoothness terms can also be made dependent on the image cues~\cite{Sutton07,Plath09}. This can exploit the fact that boundaries between image regions have specific image appearance, and significantly improves the quality of the resulting segmentation. However it is not entirely clear that simple spatial features truly make a difference when powerful image features are used, and several authors report good results even without spatial constraints~\cite{Ramanan06b,Verbeek07,Shotton09,Lucchi11a}. Higher orders terms~\cite{Kohli08} or hierarchical approaches~\cite{Ladicky09} have therefore been introduced to capture more global constraints. Unfortunately, optimizing the parameters of such complex models in CRFs quickly becomes intractable. \cite{Nowozin13a} shows that decision trees can be used in Decision Tree Fields to model both the unary and the pairwise terms. This makes the parameter estimation problem much more tractable. \cite{Lucchi13a} relies on subgradient descent to efficiently learn CRF models for segmentation using a working set of constraints in a Structured SVM formulation. This method obtains state-of-the-art results on medical data, and we compare against it in the Experimental Results section. However despite the widespread interest in them, CRFs are still computationally expensive at run-time. A more efficient approach to enforcing spatial constraints was introduced in~\cite{Tu09} under the name of Auto-Context. In Auto-Context, a first segmentation is obtained by simple pixel-wise segmentation, followed by a second segmentation obtained by combining image features with ``context features''. They are similar to image features but are computed on the output of the first iteration. This process can be iterated until convergence. This scheme was inspired by~\cite{Loog06}. A similar approach was also developed in~\cite{Shotton09} together with a CRF model. Entangled Forests~\cite{Montillo11} use similar features in the nodes of Random Forests, applied to the output of previous nodes. Geodesic Forests~\cite{Kontschieder13} extend these features to depend on geodesic distances between pairs of locations to exploit long-distance correlations. However using the geodesic distances assumes that strong image gradients are highly correlated with boundaries between regions, which is often not true in medical images, as shown in Figs.~\ref{fig:comparisons1},~\ref{fig:texture}, and~\ref{fig:data_dna}. We also use features computed from previous segmentations. However we show how to leverage this general approach to significantly improve the quality of the final segmentation, by focusing on the difficult-to-classify locations. The idea of splitting samples according to the estimated probabilities was already proposed in~\cite{Tu05}, but they adopt a traditional binary tree structure, they do not pass the estimated probabilities down the tree to enrich the input features -- therefore they lack context information --, they do not learn features on the newly estimated probabilities, and they do not have a final classification stage. \section{Experimental Results} \label{sec:ress} To validate our approach we performed extensive experiments on four very different medical image datasets. \subsection{The Human T-Cell Line Jurkat Dataset~\cite{Morath13}} \label{sec:t_cell} The first dataset we consider is composed by Transmission Electron Microscopy (TEM) images of the human T-cell line Jurkat~\cite{Morath13}. We randomly selected 10 training images and 4 test images, each with size $1024\times 1024$ pixels. We then created a set of masks to ignore, both in training and in testing, the components that are not considered in the available ground-truth images. The particularity of this dataset is that it contains three different classes, for the background, the cytoplasm, and the nuclei. A sample training image, along with the corresponding ground-truth, is depicted by Fig.~\ref{fig:comparisons1}. The goal of the final user of this data is to estimate, with the higher accuracy possible, the areas of the different components of the cells, in order to use these values to tune numerical models of the response of illnesses to different treatments. The main challenge of this dataset is the fact that the cytoplasm and the cell's nucleus look very similar. The results obtained by the different approaches are given in Table~\ref{tab:jurkat}. Our proposal significantly outperforms the other methods, including that of~\cite{Lucchi11b}. Visual inspection of our approach, as seen in Fig.~\ref{fig:comparisons1}, shows that not only the accuracy score is higher, but also the contours are significantly better delineated and macroscopic mistakes get fixed. \begin{table}[t] \caption{ Results for the Jurkat dataset~\cite{Morath13}. The segmentation accuracy is computed as the fraction of pixels whose label match the ground-truth data. See Section~\ref{sec:t_cell} for more details.} \label{tab:jurkat} \centering \begin{tabular}{@{}lc@{}} \toprule[0.1em] \textbf{Method} & {\bf Accuracy}\\ \midrule Random Forests & 0.753 \\ Lucchi~\emph{et al.}~\cite{Lucchi11b} & 0.836 \\ Improved KernelBoost\xspace & 0.929 \\ Auto-Context~\cite{Tu09} (on Improved KernelBoost\xspace) & 0.956 \\ {\it our approach} (on Improved KernelBoost\xspace), no norm. & 0.941 \\ {\it our approach} (on Improved KernelBoost\xspace) & {\bf 0.973} \\ \bottomrule[0.1em] \end{tabular} \end{table} Table~\ref{tab:jurkat} also shows that normalization of the classifiers' output as expressed by Eq.~\eqref{eq:normalisation} is an important step, as the results without it are not significantly better than the ones obtained with the original Improved KernelBoost\xspace method on this dataset. Finally, we have applied the Auto-Context approach~\cite{Tu09} on the output of the Improved KernelBoost\xspace method. While Auto-Context improves the segmentation results for this dataset, the improvement is smaller than that achieved by our strategy. Fig.~\ref{fig:jurkat_errors} shows how errors are distributed for different approaches on a test image. Note also that what we have labeled \textit{Auto-Context} is an improved version of the algorithm of~\cite{Tu09}, since filters are learned at each stage on the newly added score images, and the final set of score maps is used to feed a Random Forest classifier instead of simply relying on the last score map. In our tests with methods that do not learn filters on the feature maps, for instance~\cite{Becker12}, the improvements linked with the use of Auto-Context are negligible. \begin{figure*}[ht] \centering \begin{tabular}{ccc} \includegraphics[width=0.32\linewidth]{jurkat_99} & \includegraphics[width=0.32\linewidth]{jurkat_ac4_99_ERR} & \includegraphics[width=0.32\linewidth]{jurkat_fzm_99_ERR} \\ {\bf Original image} & {\bf Auto-Context~\cite{Tu09}} & {\bf Our approach} \\ \end{tabular} \caption{Segmentation errors for a test image from the Jurkat dataset~\cite{Morath13}. The errors are highlighted in red in the images. Our approach significantly reduces the mistakes --- the accuracy for our approach is 0.972, while it is 0.956 for Auto-Context. Best viewed in color.} \label{fig:jurkat_errors} \end{figure*} To validate our results, we have randomly selected another set of 10 training and 6 testing images --- denoted here as \emph{Jurkat-B dataset} ---, and we have reported the results obtained by the three methods of Fig.~\ref{fig:scheme} in Table~\ref{tab:jurkatB}. As it can be seen, our approach performs better then Auto-Context --- which is reasonable and confirms the results obtained in the other random split --- but also the Expanded Trees, since the amount of training images is limited and therefore the system might suffer because of that. \begin{table}[t] \caption{ Results for the Jurkat-B dataset~\cite{Morath13}. } \label{tab:jurkatB} \centering \begin{tabular}{@{}lc@{}} \toprule[0.1em] \textbf{Method} & {\bf Accuracy} \\ \midrule KernelBoost & 0.909 \\ Auto-Context~\cite{Tu09} (on KernelBoost) & 0.922 \\ Expanded Trees (on KernelBoost) & 0.934 \\ {\it Knotted Trees} (on KernelBoost) & {\bf 0.948} \\ \bottomrule[0.1em] \end{tabular} \end{table} \subsection{NIH-3T3 Fibroblast Cells Dataset~\cite{Coelho09}} \label{sec:fibroblast} The second dataset we consider is constituted by 2D fluorescence microscopy images of Hoechst 33342-stained NIH-3T3 mouse embryonic fibroblast cells~\cite{Coelho09}. As it can be seen in the sample test image depicted by Fig.~\ref{fig:data_dna}, the images often contain debris and the nuclei vary greatly in brightness, making their segmentation challenging. For these reasons, this dataset was chosen for one of the competitions in the ISBI2009 challenge. The training set is composed by 4 randomly chosen test images with size $1344\times 1024$ pixels, while the test set contains the remaining 45 images. \begin{figure}[t] \centering \begin{tabular}{ccc} \includegraphics[width=0.38\columnwidth]{dna_test_37} & \hspace{1em} & \includegraphics[width=0.38\columnwidth]{dna_test_37_gt} \\ {\bf (a)} & \hspace{1em} & {\bf (b)} \\ \includegraphics[width=0.38\columnwidth]{dna_0037_altered_img} & \hspace{1em} & \includegraphics[width=0.38\columnwidth]{dna_0037_kb} \\ {\bf (c)} & \hspace{1em} & {\bf (d)} \\ \includegraphics[width=0.38\columnwidth]{dna_0037_fifty} & \hspace{1em} & \includegraphics[width=0.38\columnwidth]{dna_0037_ibbcf} \\ {\bf (e)} & \hspace{1em} & {\bf (f)} \\ \end{tabular} \caption{Segmentation results for a randomly-selected test image from the NIH-3T3 fibroblast cells dataset~\cite{Coelho09}. The thresholds used to obtain the segmentations from the score images are given by the values that maximize the VOC score for the given image. {\bf(a)} Original test image. The poor contrast exhibited by the images is one of the characteristics that make this dataset difficult. {\bf(b)} Ground-truth for the selected image. {\bf(c)} Original test image, after being manually altered to improve the visual quality. Best viewed in colors. {\bf(d)} Segmentation obtained with Improved KernelBoost\xspace. The VOC score is 0.7243. {\bf(e)} Segmentation obtained by our approach except that the samples are split into two balanced sets instead of a positive and negative sets. The VOC score is 0.8024. {\bf(f)} Segmentation obtained by our approach. The VOC score is 0.8160. } \label{fig:data_dna} \end{figure} Table~\ref{tab:DNA} shows that our approach, using our Improved KernelBoost\xspace for the $\varphi$ classifiers, significantly outperforms the state-of-the-art algorithm for this dataset~\cite{Song13}, as well as the other methods we evaluated. Our approach improves on the starting point, given by Improved KernelBoost\xspace, which in turn is better than the original KernelBoost\xspace classifier. It is also better than Auto-Context, which does not bring a significative improvement over the starting point. \begin{table}[t] \caption{ Segmentation accuracy for the NIH-3T3 fibroblast cells dataset~\cite{Coelho09}. The results for the human expert were obtained by a second human expert on a subset of 5 images of the test set, and are given only to demonstrate the complexity of the task. See Section~\ref{sec:fibroblast} for more details.} \label{tab:DNA} \centering \begin{tabular}{@{}lccc@{}} \toprule[0.1em] \textbf{Method} & {\bf VOC} & {\bf RI} & {\bf DI} \\ \midrule Human expert~\cite{Coelho09} & - & 0.93 & - \\ Song~\emph{et al.}~\cite{Song13} & 0.852 & 0.932 & 0.906 \\ KernelBoost\xspace & 0.817 & 0.921 & 0.899 \\ Improved KernelBoost\xspace & 0.833 & 0.929 & 0.909 \\ Auto-Context (on Improved KernelBoost\xspace) & 0.842 & 0.920 & 0.914 \\ {\it our approach (on Improved KernelBoost\xspace)} & {\bf 0.874} & {\bf 0.946} & {\bf 0.932} \\ same, but with 50\%-50\% split & 0.842 & 0.906 & 0.914 \\ \bottomrule[0.1em] \end{tabular} \end{table} We also investigated the impact of splitting the samples in two \emph{balanced} sets rather than splitting the samples classified as positives from the ones classified as negatives. As shown in the last row of Table~\ref{tab:DNA}, this gives results very similar to those of Auto-Context, demonstrating again the advantages of splitting the samples according to the scheme we propose. \subsection{3D Electron Microscopy Stacks~\cite{Lucchi13a}} \label{sec:hippocampus} Our third dataset is composed by two 3D Electron Microscopy~(EM) stacks of the CA1 hippocampus region of a rodent brain~\cite{Lucchi13a}. The training volume contains 165 slices with size $1024 \times 653$ pixels, while the test volume has the same number of slices but with size $1024 \times 883$ pixels. A sample slice, along with its corresponding ground-truth, is depicted by Fig.~\ref{fig:hippocampus}. The goal is to segment the mitochondria. \begin{figure}[t] \centering \begin{tabular}{ccc} \includegraphics[width=0.35\linewidth]{hipp_0032_img} & \hspace{1em} & \includegraphics[width=0.35\linewidth]{hipp_0032_gt} \\ {\bf (a)} & \hspace{1em} & {\bf (b)} \\ \includegraphics[width=0.35\linewidth]{hipp_0032_kb} & \hspace{1em} & \includegraphics[width=0.35\linewidth]{hipp_0032_ikb} \\ {\bf (c)} & \hspace{1em} & {\bf (d)} \\ \includegraphics[width=0.35\linewidth]{hipp_0032_lucchi} & \hspace{1em} & \includegraphics[width=0.35\linewidth]{hipp_0032_ibbcf} \\ {\bf (e)} & \hspace{1em} & {\bf (f)} \\ \end{tabular} \caption{Segmentation results for a test image from the CA1 Hippocampus dataset~\cite{Lucchi13a}. The image has been randomly selected, but taken away from the stack's borders to avoid penalizing the method of~\cite{Lucchi13a} which otherwise could not exploit neighboring slices to improve its result. The thresholds used to obtain the segmentations from the score images are given by the values that maximize the VOC score for the given image. {\bf(a)} Original test image. {\bf(b)} Ground-truth outlining the mitochondria in the selected image. {\bf(c)} Segmentation obtained by KernelBoost. The VOC score on this image is 0.567. {\bf(d)} Segmentation obtained by KernelBoost + pooling + clustering. The VOC score on this image is 0.632. {\bf(e)} Segmentation obtained by the approach of~\cite{Lucchi13a}. The VOC score on this image is 0.679. {\bf(f)} Segmentation obtained by our approach. The VOC score on this image is 0.719. } \label{fig:hippocampus} \end{figure} As Table~\ref{tab:mitochondria} shows, we outperform the state-of-the-art algorithm~\cite{Lucchi13a}, even though we operate on 2D slices only for simplicity, without enforcing any consistency between consecutive slices, while the approach of~\cite{Lucchi13a} relies on a 3D CRF. \begin{table}[t] \caption{ Results for the CA1 Hippocampus dataset~\cite{Lucchi13a}. The values have been computed by ignoring a 1-pixel width region around the mitochondria to account for imprecisions in the manual segmentations. See Section~\ref{sec:hippocampus} for more details.} \label{tab:mitochondria} \centering \begin{tabular}{@{}lcc@{}} \toprule[0.1em] \textbf{Method} & {\bf VOC} & {\bf F-measure} \\ \midrule Lucchi~\emph{et al.}~\cite{Lucchi13a} & 0.722 & 0.839 \\ KernelBoost\xspace & 0.625 & 0.769 \\ KernelBoost\xspace + pooling only & 0.649 & 0.787 \\ Improved KernelBoost\xspace & 0.711 & 0.831 \\ {\it our approach (on Improved KernelBoost\xspace)} & {\bf 0.776} & {\bf 0.874} \\ \bottomrule[0.1em] \end{tabular} \end{table} From the table, it is also possible to appreciate the contribution given by the pooling and sample selection steps as explained in Section~\ref{sec:KB_and_IKB} with respect to the original KernelBoost\xspace method. A visual analysis of the segmentation mistakes is given in Fig.~\ref{fig:hippocampus_errors}. \begin{figure*}[t] \centering \begin{tabular}{ccc} \includegraphics[width=0.38\linewidth]{hipp_img_slice_39} & \hspace{1em} & \includegraphics[width=0.38\linewidth]{hipp_overlay_slice_39_letters} \\ {\bf (a)} & \hspace{1em} & {\bf (b)} \\ \end{tabular} \caption{Analysis of the major segmentation mistakes made by our algorithm on a test image from the CA1 Hippocampus dataset~\cite{Lucchi13a}. {\bf(a)} Original image. {\bf(b)} Original image with the segmentation we have obtained overlayed. We have selected this image because the segmentation presents several mistakes, affecting significantly the final score. (A) The strong background difference in the mitochondrion makes our algorithm prematurely end the segmentation. (B) The two mitochondria are very close, and the texture between them mislead our algorithm. (C) {\it Error in the ground-truth}: the component identified by our algorithm is indeed a mitochondrion. (D) Two shadowed parts of the image are incorrectly identified as mitochondria, probably due to the borders on both sides (such structures are not present in the training data). (E,F) Minor mistakes due to shadows in the image. (G) {\it Error in the ground-truth}: a component is incorrectly identified as a mitochondrion, while it is not. (H) Dark element on the image's border incorrectly identified as a mitochondrion. Best viewed in color. } \label{fig:hippocampus_errors} \end{figure*} Furthermore, we have randomly chosen a small subset of this dataset --- 9 training and 6 test images --- to perform an in-depth analysis of the performance of the different KernelBoost components listed in Section~\ref{sec:KB_and_IKB}. The results are presented in Table~\ref{tab:hipp_ikb}. \begin{table}[t] \caption{Comparison of the effectiveness of the different KernelBoost components on a subset of the CA1 Hippocampus dataset~\cite{Lucchi13a}. } \label{tab:hipp_ikb} \centering \begin{tabular}{@{}lc@{}} \toprule[0.1em] \textbf{Method} & {\bf VOC} \\ \midrule KB & 0.592 \\ KB + pooling & 0.638 \\ KB + clustering & 0.599 \\ KB + pooling + clustering & 0.638 \\ KB + Ilastik features & 0.667 \\ KB + Ilastik features + pooling & 0.673 \\ KB + superpixel pooling & 0.653 \\ KB + superpixel pooling + superpixel features & 0.660 \\ KB + Ilastik features + superpixel pooling & 0.683 \\ \bottomrule[0.1em] \end{tabular} \end{table} In the case of this subset clustering does not seem to be that relevant. This might be due to the size of the dataset, as categorizing the positive samples might overly reduce the pool of samples used for the filter learning step. Pairing the input image channel with Ilastik features seems to be an interesting opportunity, as this allows to achieve very good performance. However, adding a pooling step on top of this does not increase significantly the performance. This can be explained by the fact that the smoothed images that are included in the Ilastik features can partially compensate for the lack of a pooling step. Superpixel pooling represents an effective strategy to improve the performance of the system, although computationally expensive. Adding on the top of it superpixel features does not significantly improve the final result. Finally, the pair superpixel pooling/Ilastik features performed best, achieving a VOC score that is almost 10\% higher than the original KernelBoost score. From the insights given by these experiments, we performed extensive tests on the architectures presented in Section~\ref{sec:KB_and_IKB}. The results are given in Table~\ref{tab:hipp_arch}. \begin{table}[t] \caption{Comparison of the architectures of Section~\ref{sec:KB_and_IKB} on the CA1 Hippocampus dataset~\cite{Lucchi13a}. The base result is given by KernelBoost with Ilastik features, and all the subsequent processing starts from the score maps this method produces. Although very effective, we have skipped superpixel pooling because of its high computational costs. } \label{tab:hipp_arch} \centering \begin{tabular}{@{}lc@{}} \toprule[0.1em] \textbf{Method} & {\bf VOC} \\ \midrule \emph{KernelBoost\xspace + Ilastik features} & 0.654 \\ Auto-Context & 0.701 \\ Auto-Context + pooling (on image channel only) & 0.704 \\ Auto-Context + pooling (on all channels) & 0.714 \\ Auto-Context + pooling (on image channel only) + fake3D & 0.735 \\ Expanded Trees + pooling (on image channel only) & 0.720 \\ Expanded Trees + pooling (on image channel only) + fake3D & 0.746 \\ Knotted Trees + pooling (on image channel only) & 0.717 \\ Knotted Trees + pooling (on image channel only) + fake3D & 0.743 \\ Knotted Trees + pooling (on image channel only) + fake3D + Z-cut & 0.762 \\ \bottomrule[0.1em] \end{tabular} \end{table} The results show that pooling on all the channels --- thus including the score images from the previous iterations --- slightly improves the segmentation results. A more significative contribution comes, as expected, from the fake3D approach and the Z-cut. In this experiment the Expanded Trees performed 0.3\% better than Knotted Trees --- a negligible difference that shows that in presence of enough training samples the two architectures are equivalent, while the experiments on the Jurkat dataset show the superiority of Knotted Trees when few training samples are available. \subsection{2D Electron Microscopy Cell dataset} The last dataset is composed by 2D EM images of cells. The images are high-dimensional (4096 $\times$ 4224), and we randomly selected 8 images for training and 4 for testing. The goal is to segment the mitochondria inside the cell, when masks excluding the outside of the cell and the nuclei are provided. An example image is given in Fig.~\ref{fig:BG}, along with the corresponding ground-truth. Without additional information some structures appearing in the images are not clearly categorizable by a human expert. We have therefore introduced a third class, depicted in gray in the ground-truth, to account for these elements. This makes the problem more complex, but allows the final user to individually select whether these elements have to be included in the final result or not. We have experimented with multiple scales, to deal with the different size of the mitochondria present in the images. Also, we have used as additional channel the membranes extracted by the approach of~\cite{Sironi14}. Note that, fed with the appropriate ground-truth, KernelBoost is capable of extracting membranes with an accuracy close to that of~\cite{Sironi14}, making the approach self-contained. From the results, presented in Table~\ref{tab:cell2D}, we can deduce that, while both multiple scales and membranes contribute to the final result, they work best when combined together. Auto-Context, preferred over Knotted Trees for its speed, significantly contributes to the final segmentation when few weak learners are used in the original KernelBoost classifier, while its impact is less relevant when a large number of weak learners is used. A visual example of the quality of the final segmentation is given in Fig.~\ref{fig:BG_res} \begin{figure}[t] \centering \begin{tabular}{ccc} \includegraphics[width=0.45\columnwidth]{BG_img_cell09} & \hspace{1em} & \includegraphics[width=0.45\columnwidth]{BG_gt_cell09} \\ {\bf (a)} & \hspace{1em} & {\bf (b)} \\ \end{tabular} \caption{Example test image from the 2D Electron Microscopy Cell dataset, along with the corresponding ground-truth. Gray elements in the ground-truth indicate parts whose label can not be decided with certainty by a human expert.} \label{fig:BG} \end{figure} \begin{figure}[t] \centering \begin{tabular}{ccc} \includegraphics[width=0.45\columnwidth]{BG_segm_cell09} & \hspace{1em} & \includegraphics[width=0.45\columnwidth]{BG_segm_gt_cell09} \\ {\bf (a)} & \hspace{1em} & {\bf (b)} \\ \end{tabular} \caption{Segmentation of the image in Fig.~\ref{fig:BG}. {\bf(a)} In red, segmented mitochondria overlayed to the input image. {\bf(b)} Overlay with both the segmentation (red) and the ground-truth (green), which outlines the system's mistakes.} \label{fig:BG_res} \end{figure} \begin{table}[t] \caption{Evaluation of different KernelBoost components on the 2D Electron Microscopy Cell dataset. } \label{tab:cell2D} \centering \begin{tabular}{@{}lc@{}} \toprule[0.1em] \textbf{Method} & {\bf VOC} \\ \midrule KB + multiscale, 200 weak learners & 0.659 \\ KB + membranes, 200 weak learners & 0.706 \\ KB + multiscale + membranes, 200 weak learners & 0.762 \\ Auto-Context (on KB + multiscale + membranes, 200 weak learners) & 0.799 \\ KB + multiscale + membranes, 1000 weak learners & 0.790 \\ Auto-Context on (KB + multiscale + membranes, 1000 weak learners) & 0.805 \\ \bottomrule[0.1em] \end{tabular} \end{table} \section{Knotting Branches for Accurate Medical Image Segmentation} \input{kt_introduction} \input{kt_related} \input{kt_approach} \input{kt_ikb} \input{kt_results} \input{kt_conclusion}
{'timestamp': '2014-08-01T02:12:27', 'yymm': '1407', 'arxiv_id': '1407.8518', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8518'}
arxiv
\section{Introduction} \xdef\@thefnmark{}\@footnotetext{Copyright (c) 2014 IEEE. Personal use of this material is permitted. However, permission to use this material for any other purposes must be obtained from the IEEE by sending a request to [email protected].} \xdef\@thefnmark{}\@footnotetext{This work has been partially supported by Junta de Andalucia under project P11-TIC-7109, the Spanish Government and FEDER under projects TEC2013-44442-P and COFUND2013-40259, the University of Malaga and the European Union under Marie-Curie COFUND U-mobility program (ref. 246550). The work of D. Morales-Jimenez and M. R. McKay was supported by the Hong Kong Research Grants Council under grant number 616713. \\ \indent G. Gomez and F.J. Lopez-Martinez are with Dpto. Ingenieria de Comunicaciones, University of Malaga, 29071 Malaga, Spain. (email \{ggomez,fjlopezm\}@ic.uma.es). D. Morales-Jimenez and M. R. McKay are with Dept. Electronic and Computer Engineering, Hong Kong University of Science and Technology, Clear Water Bay, Kowloon, Hong Kong. (email \{eedmorales, eemckay\}@ust.hk) } The characterization of the performance of wireless communication systems in the presence of co-channel interference (CCI) has been a matter of intense research for more than 20 years \cite{Abu1991}, due to the advent of digital cellular communication standards whose performance is limited by the effect of such interference. Many authors have dealt with the effects of CCI in a plethora of scenarios, considering different numbers of interfering signals that can be independent or correlated, terminals equipped with one or more receive antennas, as well as considering diverse families of distributions to characterize the fading in the desired and the interfering links, in the presence or absence of background noise (BN). Some examples can be found in classical references in communication theory \cite{Tellambura1999,Tellambura1999b,Annamalai2001,Kang2004}, as well as in more contemporary works \cite{Romero2007,Romero2008,Morales2012,Paris2013,Ermolova2014}. In a different context, an apparently unrelated problem is the characterization of the secure communication between two legitimate peers (usually referred to as Alice and Bob) through a wireless link in the presence of an eavesdropper (referred to as Eve), that observes this communication through a different link. In contrast to what is known for the Gaussian wiretap channel \cite{Leung1978}, fading allows for a secure communication between Alice and Bob even in the case when the SNR observed at Eve is larger than the SNR at the legimitate receiver \cite{Barros2006,Bloch2008}. In the last few years, many researchers have worked in the characterization of the physical layer security in this scenario, using the secrecy outage probability and the probability of strictly positive secrecy capacity as performance metrics. Analytical results are available for some of the most usual fading distributions: Rayleigh \cite{Bloch2008}, Nakagami-$m$ \cite{Sarkar2009}, Rician \cite{Liu2013}, Hoyt \cite{Romero2014}, lognormal \cite{Liu2013b} or two-wave with diffuse power \cite{Wang2014} fading models, where the effect of having additional antennas at the eavesdropper has been also investigated. The first of the aforementioned problems can be seen as a transmitter $A$ willing to communicate with the receiver $B$ in the presence of an external interferer $E$, which accounts for the effect of aggregate CCI. Hence, we observe \textit{two transmitters} and \textit{one receiver}, as depicted in \mbox{Fig. \ref{fig1}a)}. Conversely, in the second problem we see a transmitter $A$ willing to communicate with the receiver $B$ in the presence of an external observer $E$. Therefore, we can identify \textit{one transmitter} and \textit{two receivers}, as shown in Fig. \ref{fig1}b). \begin{figure}[t] \begin{center} \includegraphics[width=.9\columnwidth]{fig1.eps} \caption{A typical wireless communication scenario in the presence of: a) an interferer, b) an eavesdropper.} \label{fig1} \end{center} \end{figure} Motivated by this duality, we wonder whether there is any connection between both scenarios that facilitates the analysis of the latter using the extensive knowledge available for the former. In this paper, we show that \textit{both problems are in fact mathematically equivalent}; this relevant connection has not been reported in the literature before, to the best of our knowledge. We also show that the duality between both scenarios holds not only when using the classical definition of secrecy capacity \cite{Barros2006} but also with the alternative formulation in \cite{Zhou2011}, which is more suitable for adaptive scenarios in which channel state information (CSI) of Bob is available at the transmitter. From this duality, we show that the calculation of the outage probability (OP) with CCI and BN in the presence of $L_e$ interferers is equivalent to the calculation of the secrecy capacity OP in the presence of an eavesdropper equipped with $L_e$ antennas and performing maximal ratio combining (MRC), up to a simple scaling of the underlying random variables. Similarly, the calculation of the OP in interference-limited scenarios (i.e. neglecting the BN) is equivalent to the problem of computing the probability of strictly positive secrecy capacity. \section{System Model I: CCI and BN} \label{Scenario I} Let us first consider the case where all the agents are single antenna transceivers, and there is only one interfering signal. We characterize the communication links in Fig. \ref{fig1}a) in terms of two instantaneous power ratios at the receiver side (B), the SNR ${\gamma_d=P_T\left|h_d\right|^2/N_0}$ and the interference-to-noise ratio (INR) ${\gamma_i=P_I\left|h_{i}\right|^2/N_0}$, where $P_T$ and $P_I$ indicate the transmission power of A and the interferer I, respectively, $N_0$ denotes the noise power at B, whilst $h_d$ and $h_i$ represent the complex fading channel gain for the desired and interfering links respectively, which incorporate the effects of attenuation due to path loss (i.e. proportional to $d^{-\alpha}$, where $d$ is the distance between transmitter and receiver, and $\alpha$ is the path loss exponent \cite{Barros2006}). In the most general scenario with both CCI and BN, the usual performance metric is the OP of the signal-to-interference-plus-noise ratio (SINR), defined as the probability of the instantaneous SINR falling below a given threshold $\gamma$, i.e.: \begin{equation} \label{eq1} OP_{NI} (\gamma) = \Pr \left\{ {\frac{{P_T\left|h_d\right|^2 }}{{P_I\left|h_i\right|^2 {\rm{ + }}N_0}}{\rm{ < }}\gamma } \right\} = \Pr \left\{ {{{\gamma_d }}{\rm{ < }}\gamma {{(\gamma_i {\rm{ + }}1)}}} \right\} . \end{equation} In case of interference-limited scenarios (i.e. $N_0=0$), the previous expression reduces to \begin{equation} \label{eq2} OP_{I} (\gamma) = \Pr \left\{ {\frac{{P_T\left|h_d\right|^2 }}{{P_I\left|h_i\right|^2 }}{\rm{ < }}\gamma } \right\} = \Pr \left\{ {{{\gamma_d }}{\rm{ < }}(\gamma \cdot {{\gamma_i}}}) \right\}. \end{equation} Note that since we are neglecting the BN in (\ref{eq2}), ${{P_T\left|h_d\right|^2 }}/{{P_I\left|h_i\right|^2 }}$ represents now a signal-to-interference ratio (SIR). For simplicity we still use the same nomenclature as in (\ref{eq1}), where the variables $\gamma_d$ and $\gamma_i$ now represent the received instantaneous power for the desired and interfering links, respectively. Finally, in noise-limited scenarios (i.e. where the interference can be neglected), the OP is given by $OP_{N} (\gamma) = \Pr \left\{ \gamma_d{\rm{ < }}\gamma \right\}$. \section{System Model II: Wireless Information-Theoretic Security} \label{Scenario II} \subsection{Classical definition} As in the previous subsection, we consider all the agents to be single antenna transceivers. Using the standing nomenclature in the physical layer security literature \cite{Prabhu2011}, this corresponds to a SISOSE scenario (single-input single-output single eavesdropper). Analogously, we characterize the communication links in Fig. \ref{fig1}b) in terms of their equivalent SNRs, ${\gamma_d=P_T\left|h_d\right|^2/N_0}$ for the \textit{desired} link and ${\gamma_e=P_T\left|h_e\right|^2/N_0}$ for the \textit{eavesdropper} link. Without loss of generality, we assume that the noise power at B and E are equal. The performance in this scenario is usually characterized by the secrecy capacity $C_s$, defined as \begin{equation} C_s \triangleq C_d - C_e > 0, \end{equation} \noindent where $C_d = \log \left( {1 + \gamma_d } \right)$ is the instantaneous capacity of the desired channel and $C_e = \log \left( {1 + \gamma_e } \right)$ is the instantaneous capacity of the eavesdropper's channel. Secure transmission is achievable provided that ${C_s>0}$ and assuming proper wiretap codes, for which perfect knowledge of both Bob's and Eve's CSI is required at Alice. The probability of strictly positive secrecy capacity is \begin{align} \label{eq_Rout_r=0} P_{s}^{+} &=\Pr \left\{ {C_s > 0} \right\} = \Pr \left\{ {\log_2 \left( {\frac{{1 + \gamma_d }}{{1 + \gamma_e }}} \right) > 0} \right\} \nonumber \\& = \Pr \left\{ {\gamma_d > \gamma_e} \right\}. \end{align} When Eve's CSI is not available at Alice, perfect secrecy cannot always be achieved and secrecy is often analyzed in terms of the secrecy outage probability $P_s$, defined as the probability that communication at a secrecy rate $R_s>0$ cannot be securely achieved \cite{Barros2006,Bloch2008}, i.e., \begin{align} \label{eq_Rout_r} P_s & = \Pr \left\{ {C_s < R_s } \right\} = \Pr \left\{ {\log_2 \left( {\frac{{1 + \gamma_d }}{{1 + \gamma_e }}} \right) < R_s } \right\} \nonumber \\& = \Pr \left\{ {{{\gamma_d }}{\rm{ < }} (2^{R_s}-1) {{\left(\tfrac{2^{R_s}}{2^{R_s}-1}\gamma_e {\rm{ + }}1\right)}}} \right\}. \end{align} To compute this quantity, Eve's channel statistics (i.e., fading distribution and average SNR) are needed. Whether this information should be available at Alice or not depends on the particular design of the transmission scheme. For instance, Eve's average SNR would be needed at Alice if an adaptive-$R_s$ transmission is implemented so that the outage probability is maintained below a required target. We do not explicitly take this assumption here since other (non-adaptive) schemes could be considered such as, e.g., an offline design of $R_s$ based on worst-case assumptions on Eve's average SNR. \subsection{Alternative definition} Although the previous definition of secrecy has been extensively used in the literature, it does not distinguish whether a message transmission is unreliable (i.e., $C_d < R_s$) or not perfectly secure (i.e., $C_s < R_s$). As pointed out in \cite{Zhou2011}, this can be seen from the fact that the event $C_d < R_s$ falls within the secrecy outage event $C_s < R_s$, but the first does not necessarily imply a failure in achieving perfect secrecy. Moreover, if Alice knows that Bob's channel fails to support the secrecy rate, $C_d < R_s$, then transmission should be suspended. Therefore, an alternative outage formulation is presented in \cite{Zhou2011}, in which the secrecy outage probability is conditioned on the fact that a message is actually being sent, i.e. whenever $\gamma_d$ exceeds some SNR threshold $\mu$: \begin{align} \label{eq_PsoAdaptive} P_{so} & =\Pr \left\{ {C_s < R_s } | \gamma_d > \mu \right\} \nonumber \\& = \Pr \left\{ {\gamma_d < 2^{R_s} (1+\gamma_e)-1 } | \gamma_d > \mu \right\} \nonumber \\ &= \frac{1}{ \Pr \left\{ \gamma_d > \mu \right\} } \Pr \left\{ {\mu < \gamma_d < 2^{R_s} (1+\gamma_e)-1 } \right\}. \end{align} \section{Equivalencies between both scenarios} \label{sec:equiv} \subsection{Single antenna transceivers} From the previous expressions, it becomes evident that the secrecy outage probability (with $R_s>0$) defined in (\ref{eq_Rout_r}) is an \textit{equivalent} expression to the one obtained for the wireless system with CCI and BN in (\ref{eq1}); in fact, up to a simple scaling of the underlying random variables, $P_s=OP_{NI}$. For the alternative secrecy formulation in (\ref{eq_PsoAdaptive}), a similar connection can be inferred including some correction terms that are related to the OP without interference, i.e. $OP_N(\gamma)$. Analogously, we observe that the (complementary) probability of strictly positive secrecy capacity, i.e. $R_s=0$, also follows an \textit{equivalent} expression to the one obtained for the wireless system in interference-limited scenarios, i.e. $P_s^{+}=1-OP_{I}$. Interestingly, we see how doubling the threshold value in the interference setup approximately translates into a 1 bit increase in the secrecy threshold $R_s$. We also see how neglecting the effect of background noise in the interference problem is equivalent to setting the secrecy rate $R_s$ to zero. The connections among these scenarios are summarized in Table \ref{table1}. Note that we do not take any assumption regarding the distribution of $\gamma_d$, $\gamma_e$ and $\gamma_i$; hence, they can follow arbitrary distributions, and they can also be correlated. A direct implication of the connection unveiled herein is that outage analysis in information-theoretic security problems can be immediately characterized by leveraging the available analytical results for the CCI+BN equivalent problem. \begin{table*} \centering \caption{Connection between Scenarios I and II} \renewcommand{\arraystretch}{1.4} \begin{tabular}{|l|l|c|} \hline \textsc{Secrecy Metric}&\textsc{Connection CCI+BN}& \textsc{Parameters} \\[0.5ex] \hline $P_s\triangleq\Pr \left\{ {C_s<R_s }\right\}$& $P_s=OP_{NI}(\gamma)$ & $ \gamma= 2^{R_s} - 1, \,\,\,\,\,\,\,\,\, {\gamma_i} = \frac{{2^{R_s}}}{2^{R_s} - 1} \gamma_e $\\ [4pt] \hline $P_{so}\triangleq\Pr \left\{ {C_s < R_s } | \gamma_d > \mu \right\}$& $P_{so}= \frac{OP_{NI}(\gamma) - OP_{N} (\mu)}{1 - OP_{N}(\mu) }$ & $ \gamma= 2^{R_s} - 1, \,\,\,\,\,\,\,\,\, {\gamma_i} = \frac{{2^{R_s}}}{2^{R_s} - 1} \gamma_e$\\[4pt] \hline $P_s^{+}\triangleq\Pr\{C_s>0\}$& $P_s^{+}=1-OP_{I}(\gamma)$ & $\gamma= 1, \,\,\,\,\,\,\,\,\, {\gamma_i} = \gamma_e$\\ [4pt] \hline \end{tabular} \label{table1} \end{table*} Our approach is thus useful from an analytical point of view: in order to calculate the secrecy outage probability in a new scenario, there is no need to redo the calculations if there is a solution available for the equivalent CCI+BN problem. This is the case for the scenarios investigated in \cite{Ermolova2014}; therefore, a direct application of the secrecy-interference equivalence allows obtaining the secrecy OP in the following cases for which no results are currently available: (i) $\eta$-$\mu$ fading for the A-B link, and $\eta$-$\mu$ fading for the A-E link, (ii) $\eta$-$\mu$ fading for the A-B link, and $\kappa$-$\mu$ fading for the A-E link, (iii) $\kappa$-$\mu$ fading for the A-B link, and $\eta$-$\mu$ fading for the A-E link. In addition, the new expressions can be used to optimize the system under secrecy constraints. For example, in \cite{Zhou2011}, for Rayleigh fading channels and under the ``alternative formulation'', the OP expressions were used to design transmission strategies with optimized transmission thresholds and optimized wiretap coding rates. By virtue of the interference-secrecy equivalence, optimized strategies can be designed for more general fading models as mentioned above. \subsection{Multiple antenna transceivers} For notational simplicity, we started our analysis with the simplest setup: a scenario where all Alice, Bob, and Eve are equipped with a single antenna. This scenario is referred to as SISOSE (single-input single-output single-eavesdropper) in the literature (see, e.g., \cite{Prabhu2011}). We see that this problem is dual to an interference problem in a SISO setup with a single interferer. The extension to a SISOME (single-input single-output multiple-eavesdroppers) scenario is direct, since using $L$ antennas at Eve with maximal ratio combining (MRC) reception, which yields ${\gamma_e=\sum_{k=1}^{L} \gamma_{e_k}}$, is equivalent to considering $L$ interfering signals in the dual interference problem \cite{Annamalai2001}, yielding ${\gamma_i=\sum_{k=1}^{L} \gamma_{i_k}}$. If we now consider multiple antennas at Bob, then the scenario under analysis is denoted as SIMOME (single-input multiple-output multiple-eavesdroppers). In this case, the SNR at Eve is unaltered and the SNR at Bob is that of a multiantenna receiver, which depends on the implemented combining strategy. It is straightforward to see that the duality also holds in this scenario when having MRC reception: the dual interference problem would be comprised of a receiver with multiple antennas under the effect of multiple interferers. This is a well-investigated problem in the interference-related literature \cite{Cui1999,Aalo2000,Pena2004} when assuming Rayleigh fading channels, whereas the SIMOME counterpart was analyzed in \cite{He2011}. When considering multiple antennas at Alice and a single antenna at Bob, the scenario is referred to as MISOME (multiple-input single-output multiple-eavesdroppers). In this case, different mechanisms for transmission (e.g. beamforming, transmit antenna selection, space-time block coding) \cite{Khisti2010,Bashar2011,Alves2012} imply different distributions of the effective SNRs and the problem formulation needs some notational changes, but the duality still holds. The dual problem in this case is a MISO communication system affected by multiple interferers\footnote{However, we must note that some of the schemes for multiple antenna transmitters under the presence of eavesdroppers are different that the conventional schemes out of the context of physical layer security; for instance, a masked beamforming technique has been proposed in the context of physical layer security as an improvement over conventional (or naive) beamforming \cite{Khisti2010}.}. Finally, we consider the more general case where all terminals in the network are equipped with multiple antennas, i.e., MIMOME (multiple-input multiple-output multiple-eavesdroppers). For those schemes that involve rank-1 signaling, i.e., those not involving spatial multiplexing (e.g. beamforming, transmit antenna selection, space-time block coding) \cite{Yang2013,Ferdinand2013}, the channel can be effectively seen as a SISO channel with an underlying SNR distribution possibly more complex. In these cases, the MIMOME problem is equivalent to a MIMO communication system with multiple interferers. A good example can be found in the OP analysis of a MIMO-MRC system affected by interference \cite{Ahn2009}; the OP expressions in \cite{Ahn2009} are a generalization of those for single-antenna transmitters in \cite{Aalo2000}. By virtue of the equivalence unveiled in this paper, the same generalization applies to the MIMOME scenario (in the secrecy context) when a MIMO-MRC configuration is employed in the desired link. As we have seen, the interference-eavesdropping connection holds for all the multiple-antenna scenarios described above, i.e., SISOME, SIMOME, MISOME, and MIMOME, provided that rank-1 signaling (without spatial multiplexing) is employed. A generalization to spatial multiplexing schemes is not evident \cite{Lin2014}, and this is indeed an interesting direction for future research. \section{Application Example: Secrecy analysis in SISOME mixed fading } Having established the equivalence between these scenarios, we now aim at illustrating how well-known results for cellular systems affected by interference can be translated into analytical results for their wireless information-theoretic counterparts. As an example of application, we investigate the scenario where the fading channel between Alice and Bob is Nakagami-$m$ distributed, whereas the fading experienced by Eve follows an \textit{arbitrary} distribution. Assume that the eavesdropper is equipped with $L_e$ antennas; this is equivalent to consider a set of $L_e$ single-antenna colluding eavesdroppers \cite{Goel2005}, that cooperate to intercept and decode the message. The instantaneous SNR $\gamma_{e_k}$ per receive branch ($k=1\ldots L_e$) is modeled as a random variable with mean $\overline{\gamma}_{e_k}$. Furthermore, we assume MRC multichannel reception so that the output SNR $\gamma_e$ is expressed as the sum of the individual per-branch SNRs, i.e. $\gamma_e = \sum\nolimits_{k = 1}^{L_e} \gamma_{e_k}$. According to Section \ref{sec:equiv}, this problem is equivalent to a wireless system with CCI and BN (System Model I) in which a set of $L_e$ users interfere the desired signal at the receiver B. In this case, the equivalent INR in (\ref{eq1}) is $\gamma_i = \sum\nolimits_{k = 1}^{L_e} \gamma_{i_k}$, where $\gamma_{i_k}$ represents the SNR of each interfering signal and is (up to a scale factor) directly related to $\gamma_{e_k}$ according to Table \ref{table1}. Having established this connection, we can now invoke the results in \cite{Annamalai2001} for the OP under CCI and BN, where we just need to replace $\gamma_i$ with the scaled version of $\gamma_e$. For the specific scenario where the desired link undergoes Nakagami-$m$ fading, the OP is directly given in terms of the moment generating function (MGF) of $\gamma_e$, which fortunately can be expressed in closed-form for most common fading distributions. Hence, under the assumptions above, the OP of the secrecy capacity is given by \begin{equation} \label{eq_Ps} {P_s} = 1 - {e^{ - p}}\sum\limits_{i = 0}^{m - 1} {\frac{1}{{i!}}\sum\limits_{j = 0}^i {{C_{i,j}}{p^i}} } \frac{{{d^j}}}{{d{p^j}}}{\left. {\left[ {\prod\limits_{k = 1}^{L_e} {{\Phi _k}\left( -p \right)} } \right]} \right|_{p = \tfrac{{m({2^{R_s}} - 1)}}{{{{\bar \gamma }_d}}}}} \end{equation} \noindent where $C_{i,j}={{\left( { - 1} \right)}^j}i!/(j!(i-j)!)$ and $\Phi_k(\cdot)$ represents the MGF of $\gamma_{e_k}$, $k=1,\ldots,L_e$, which are assumed to be independen but can be arbitrarily distributed. Similarly, the probability of strictly positive secrecy capacity is given by \begin{equation} \label{eq_Cs_Generic} P_s^{+} = \sum\limits_{i = 0}^{m - 1} {\frac{{{(-p)^i}}}{{i!}}} \frac{{{d^i}}}{{d{p^i}}}{\left. {\left[ {\prod\limits_{k = 1}^{L_e} {{\Phi _k}\left( -p \right)} } \right]} \right|_{p = \tfrac{m}{{{{\bar \gamma }_d}}}}}. \end{equation} Finally, the secrecy outage probability using the alternative definition in \cite{Zhou2011} can be compactly expressed as \begin{equation} \label{eq_Rout} {P_{so}} = \frac{1}{1-F_{\gamma_d}(\mu)} \left[ P_s-F_{\gamma_d}(\mu) \right]^+, \end{equation} where $\left[ a \right]^+ = \max (0, a)$, $F_{\gamma_d}(\cdot)$ is the cumulative distribution function of $\gamma_d$ (Nakagami-$m$ distributed in this example) and $P_s$ is given by (\ref{eq_Ps}). Note that the above expressions are given as an example of application, and other scenarios with the desired link arbitrarily distributed can be also analyzed by exploiting the results in \cite{Annamalai2001} along with the equivalences between the interference and secrecy problems. In this case, the analytical results would be given in terms of the MGF of the SNR at Bob. Closed-form expressions for the MGF $\Phi(p)$ and $n$th-order derivative of the MGF $\Phi^{(n)}(p)$ of the signal power in a variety of fading channel models can be easily computed; expressions for the most common fading models are given in Table \ref{table2}. \begin{table*} \centering \caption{PDF, MGF and $n$th-order derivative of the MGF of signal power for fading models} \renewcommand{\arraystretch}{1.4} \begin{tabular}{|l|l|l|} \hline \textsc{Fading Model} \textsc{MGF, $\Phi(p)$} & \textsc{$n$th-order derivative of the MGF, $\Phi^{(n)}(p)$}\\ \hline Rayleigh & ${\left( {1 - p\bar \gamma } \right)^{^{ - 1}}}$ &$\frac{{{{\bar \gamma }^n}n!}}{{{{\left( {1 - p\bar \gamma } \right)}^{n + 1}}}}$ \\ [4pt] \hline Nakagami-$m$ & ${ (1-p\bar \gamma /m)^{-m} }$ &$\frac{{{{\bar \gamma }^n}{m^m}\Gamma \left( {m + n} \right)}}{{{{\left( {m - p\bar \gamma } \right)}^{n + m}}\Gamma \left( m \right)}}$ \\[4pt] \hline Rice & $\left( \frac{1+K} {1+K-p \bar \gamma} \right) \exp \left( \frac{pK\bar \gamma} {1+K-p \bar \gamma} \right)$ & $ \frac{{{{\bar \gamma }^n}{{\left( {n!} \right)}^2}\left( {1 + K} \right)}}{{{{\left( {1 + K - p\bar \gamma } \right)}^{n + 1}}}}\exp \left( {\frac{{pK\bar \gamma }}{{1 + K - p\bar \gamma }}} \right)\sum\limits_{i = 0}^n {\frac{1}{{{{\left( {i!} \right)}^2}\left( {n - i} \right)!}}} {\left( {\frac{{K\left( {1 + K} \right)}}{{1 + K - p\bar \gamma }}} \right)^i}$ \\ [4pt] \hline \end{tabular} \label{table2} \end{table*} \section{Numerical Results} \label{numerical} We have presented a simple approach for the characterization of the wireless information-theoretic security in terms of the MGF of the SNRs at Eve (or Bob). Next, the derived expressions are evaluated numerically to discuss the main implications that arise in practical scenarios of interest. Let us assume a normalized secrecy rate $R_s=1$ and that Eve supports MRC reception. First, we evaluate the effect of considering a different fading severity for the communication links. The distribution of all links is Nakagami-$m$ with fading severity index $m$ (for the direct link) and $m_k$ (for the $k$th eavesdropper's link). In Fig. \ref{fig2}, the OP of the secrecy capacity derived in (\ref{eq_Ps}) and (\ref{eq_Rout}) are represented as a function of the average SNR at Bob ${\bar \gamma }_{d}$ whereas the average SNR at the eavesdropper links ($\overline{\gamma}_{e_k}$ with $k=1\ldots L_e$) is kept fixed to 5 dB. We also set $\mu=\gamma=2^{R_s}-1$, which is the value of $\mu$ that maximizes the throughput \cite{Zhou2011}. \begin{figure}[t] \begin{center} \includegraphics[width=1\columnwidth]{fig2.eps} \caption{OP of secrecy capacity vs $\bar\gamma_d$, for different values of the fading severity index and numbers of receive branches $L_e$. Parameter values are $\overline{\gamma}_{e_k}=5$ dB ($k=1\ldots L_e$) and $R_s=1$.} \label{fig2} \end{center} \end{figure} The number $L_e$ of antennas in the eavesdropper has an important impact on the secrecy capacity outages for both definitions of secrecy; this is expected since a higher number of antennas allows for an increased equivalent SNR after MRC. Therefore, using more antennas at Eve decreases the rate at which secure communication can be established, when the rest of parameters remain fixed; this is in agreement with \cite{Wang2014}. We observe that $P_{so}$ is always lower than the classical definition ($P_{s}$) as the former is conditioned to the fact that a message is being sent ($\gamma_d > \mu$) and it includes the latter for $\mu=0$. The gap between both definitions is reduced as $L_e$ increases since that implies that the effective SNR at Eve (after MRC) gets higher and, consequently, that both $P_{s}$ and $P_{so}$ increase; it is then clear from (\ref{eq_Rout}) that the difference between $P_{so}$ and $P_{s}$ shrinks. We now aim at analyzing the impact of different fading conditions in the secrecy capacity, which is also shown in Fig. \ref{fig2}. To that end, we vary the fading severity index $m$ for the legitimate communication (between Alice and Bob), while keeping the fading parameter for Eve's link fixed to $m_k=1$, $k=1\ldots L_e$. In the low SNR regime, changing the distribution of the desired link has little effect since in this region the behavior of $P_s$ is dominated by the distribution of $\gamma_{e_k}$. Conversely, in the high SNR regime we see that the down-slope of $P_s$ is proportional to $m$. If we now consider a different fading severity $m_k$ at the eavesdropper link (while keeping $m=1$ for the legitimate communication), we observe a dual effect as compared to the previous case. In the low SNR regime, increasing $m_k$ causes that $\Pr(C_s<R_s)$ grows for a given $\bar\gamma_d$, since the eavesdropper experiences a less severe fading than the legitimate receiver. However, in the high SNR regime the secrecy capacity is practically agnostic to the distribution of $\gamma_{e_k}$. This is explained by the fact that in this region the OP of the secrecy capacity is dominated by the distribution of the desired link, whose average power is much larger than $\bar\gamma_{e_k}$. Fig. \ref{fig3} shows $P_{s}^{+}$, as defined in (\ref{eq_Cs_Generic}), when assuming Rician fading for Eve's link (with different $K$ factors), and Rayleigh fading for the legitimate link. This setup may represent a scenario in which Eve is positioned with a direct line of sight (LoS) to Alice, while Bob is only able to receive the non-LoS component \cite{Prabhu2011}\footnote{This also represents the complementary OP in an interference-limited scenario, i.e. $1-OP_{I}(\gamma)$, with $\gamma_i=\gamma_e$ according to the Table I. In this setting, we are assuming Rician fading for the interferer's link (with different $K$ factors), and Rayleigh fading for the legitimate link. Analogously, this setup may represent a scenario in which the propagation for the signal of interest is non-LoS, whereas the propagation for the interfering signals arriving at the receiver can be modeled as LoS \cite{Annamalai2001}.}. We see that the probability of secure transmission between Alice and Bob is lower as the equivalent average SNR of Eve increases, either after MRC technique (for $L_e>1$) or by increasing the SNR $\overline{\gamma}_{e}$ of its unique channel (for $L_e=1$). Additionally, higher values of the Rician $K$ factor have a negative impact on $P_{s}^{+}$. \begin{figure}[t] \begin{center} \includegraphics[width=1\columnwidth]{fig3.eps} \caption{Strictly positive secrecy capacity vs $\bar\gamma_d$, for different Rician $K$ values for the eavesdropper link and numbers of receive branches $L_e$; $R_s=1$.} \label{fig3} \end{center} \end{figure} Finally, Fig. \ref{fig4} represents the secrecy outage probability as a function of the secrecy rate $R_s$, comparing the original formulation ($P_s$) with the alternative formulation ($P_{so}$) and assuming the same value of $\mu$ as previously. We consider different fading distributions at the eavesdropper link and Rayleigh fading at the desired link. We see from the figure that the outage probabilities predicted by the two formulations differ significantly. To understand such a difference we should recall that $P_{so}$ considers an adaptive transmission scheme based on Bob's CSI. \begin{figure}[t] \begin{center} \includegraphics[width=1\columnwidth]{fig4.eps} \caption{Comparison between existing secrecy outage formulations vs $R_s$ for different fading distributions at the eavesdropper link and Rayleigh fading at the desired link. Parameter value $\bar{\gamma}_d=5$ dB, $\bar{\gamma}_e=0$ dB, $m_k=5$, $K=5$.} \label{fig4} \end{center} \end{figure} \section{Conclusion} \label{Conclusion} We showed that two relevant yet apparently unrelated problems in information and communication theory are in fact mathematically equivalent. Specifically, we have shown that the problem of calculating the OP with CCI and BN in the presence of $L_e$ interferers is equivalent to the calculation of the OP of the secrecy capacity in the presence of an eavesdropper equipped with $L_e$ antennas. Similarly, we have also shown that the calculation of the OP in interference-limited scenarios is equivalent to the problem of computing the probability of strictly positive secrecy capacity. Despite their simplicity, these connections have not been previously identified in the literature, and they pave the way towards new results for physical layer security in more general fading models for which the problem of the OP with CCI and BN is well-understood. The equivalence here unveiled has the potential to be extended to other scenarios in wireless communications, and is an avenue for future research. For instance, the effect of artificial-noise-aided beamforming techniques \cite{Xi2013} in generalized fading scenarios can also be seen as an underlying interference-related problem. Similarly, the coverage probability in wireless cellular networks where the interference is modeled using spatial random models \cite{Andrews2010} could be linked to the information-theoretic characterization in a field of colluding eavesdroppers \cite{Pinto2009}. \bibliographystyle{ieeetr}
{'timestamp': '2015-02-26T02:13:28', 'yymm': '1407', 'arxiv_id': '1407.8469', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8469'}
arxiv
\section{Introduction}\label{sintro} With the advances in high-throughput experimental technology in the past decade, the production of genomic data has become affordable and thus prevalent in biomedical research. Accumulation of experimental data in the public domain has grown rapidly, particularly of microarray data for gene expression analysis and single nucleotide polymorphism (SNP) genotyping data for genome-wide association studies (GWAS). For example, the Gene Expression Omnibus (GEO; \url{http://www.ncbi.nlm.nih.gov/geo/}) from the National \mbox{Center} for Biotechnology Information (NCBI) and the Gene Expression Atlas (\url{http://www.ebi.ac.uk/gxa/}) from the European Bioinformatics Institute (EBI) are the~two largest public depository websites for gene expression data and the database of Genotypes and Phenotypes (dbGaP, \url{http://www.ncbi.nlm.nih.gov/gap/}) has the largest collection of genotype data. Because individual studies usually contain limited numbers of samples and the reproducibility of genomic studies is relatively low, the generalizability of their conclusions is often criticized. Therefore, combining multiple studies to improve statistical power and to provide validated conclusions has emerged as a common practice [see recent review papers by \citet{tseng2012comprehensive} and \citet{begum2012comprehensive}]. Such genomic meta-analysis is particularly useful in microarray analysis and GWAS. In this paper we focus on microarray meta-analysis while the proposed methodology can be applied to the traditional ``univariate'' meta-analysis or other types of genomic meta-analysis. Microarray experiments measure transcriptional activities of thousands of genes simultaneously. One commonly seen application of microarray data is to detect differentially expressed (DE) genes in samples labeled with two conditions (e.g., tumor recurrence versus nonrecurrence), multiple conditions (e.g., multiple tumor subtypes), survival information or time series. In the literature, microarray meta-analysis usually refers to combining multiple studies of related hypotheses or \mbox{conditions} to better detect DE genes (also called candidate biomarkers). For this problem, two major types of statistical procedures have been used: combining effect sizes or combining $p$-values. Generally speaking, no single method performs uniformly better than the others in all data sets for various biological objectives, both from a theoretical point of view [\citeauthor{littell1971asymptotic} (\citeyear{littell1971asymptotic,littell1973asymptotic})] and from empirical experiences. In combining effect sizes, the fixed effects model and the random effects model are the most popular methods [\citet{cooper2009handbook}]. These methods are usually more straightforward and powerful to directly synthesize information of the effect size estimates, compared to $p$-value combination methods. They are, however, only applicable to samples with two conditions when the effect sizes can be defined and combined. On the other hand, methods combining $p$-values provide better flexibility for various outcome conditions as long as $p$-values can be assessed for integration. Fisher's method is among the earliest $p$-value methods applied to microarray meta-analysis [\citet{rhodes2002meta}]. It sums the log-transformed $p$-values to aggregate statistical significance across studies. Under the null hypothesis, assuming that the studies are independent and the hypothesis testing procedure correctly fits the observed data, Fisher's statistic follows a chi-squared distribution with degrees of freedom $2K$, where $K$ is the number of studies combined. Other methods such as Stouffer's method [\citet{stouffer1949american}], the minP method [\citet{tippett1931methods}] and the maxP method [\citet{wilkinson1951statistical}] have also been widely used in microarray meta-analysis. It can be shown that these test statistics have simple analytical forms of null distributions and, thus, they are easy to apply to the genomic settings. The assumptions and hypothesis settings behind these methods are, however, very different and have not been carefully considered in most microarray meta-analysis applications so far. In Fisher, Stouffer and minP, the methods detect markers that are differentially expressed in ``one or more'' studies (see the definition of $\mathrm{HS}_B$ in Section~\ref{shs}). In other words, an extremely small $p$-value in one study is usually enough to impact the meta-analysis and cause statistical significance. On the contrary, methods like maxP tend to detect markers that are differentially expressed in ``all'' studies (called $\mathrm{HS}_A$ in Section~\ref{shs}) since maxP requires that all combined $p$-values are small for a marker to be detected. In this paper, we begin in Section~\ref{shs} to elucidate the hypothesis settings and biological implications behind these methods. In many meta-analysis applications, detecting markers differentially expressed in all studies is more appealing. The requirement of DE in ``all'' studies, however, is too stringent when $K$ is large and in light of the fact that experimental data are peppered with noisy measurements from probe design, sample collection, data generation and analysis. Thus, we describe in Section~\ref{shs} a robust hypothesis setting (called $\mathrm{HS}_r$) that detects biomarkers differentially expressed ``in the majority of'' studies (e.g., $>$70\% of the studies) and we propose a robust order statistic, the $r$th ordered $p$-value (rOP), for this hypothesis setting. The remainder of this paper is structured as follows to develop the rOP method. In Section~\ref{srop} the rationale and algorithm of rOP are outlined, and the methods for parameter estimation are described in Section~\ref{sselectr}. Section~\ref{srop1side} extends rOP with a one-sided test correction to avoid detection of DE genes with discordant fold change directions across studies. Section~\ref {sapplication} demonstrates applications of rOP to three examples in brain cancer, major depressive disorder (MDD) and diabetes, and compares the result with other classical meta-analysis methods. We further explore power calculation and asymptotic properties of rOP in Section~\ref{spowcalc}, and evaluate rOP in genomic settings by simulation in Section~\ref{ssimu}. We also establish an unexpected but insightful connection of rOP with the classical na\"ive vote counting method in Section~\ref{svc}. Section~\ref{sconclusion} contains final conclusions and discussions. \section{$r$th ordered $p$-value (rOP)}\label{srOP} \subsection{Hypothesis settings and motivation}\label{shs} We consider the situation when $K$ transcriptomic studies are combined for a meta-analysis where each study contains $G$ genes for information integration. Denote by $\theta_{gk}$ the underlying true effect size for gene $g$ and study $k$ ($1\le g\le G$, $1\le k\le K$). For a given gene $g$, we follow the convention of \citet{birnbaum1954combining} and \citet{li2011adaptively} to consider two complementary hypothesis settings, depending on the pursuit of different types of targeted markers: \begin{eqnarray*} && \mathrm{HS}_A\dvtx \biggl\{H_0\dvtx \bigcap _k\{\theta_{gk}=0\}\mbox{ versus } H_a^{(A)}\dvtx \bigcap_k\{ \theta_{gk}\ne0\} \biggr\}, \\ && \mathrm{HS}_B\dvtx \biggl\{H_0\dvtx \bigcap _k\{\theta_{gk}=0\}\mbox{ versus } H_a^{(B)}\dvtx \bigcup_k\{ \theta_{gk}\ne0\} \biggr\}. \end{eqnarray*} In $\mathrm{HS}_A$, the targeted biomarkers are those differentially expressed in all studies (i.e., the alternative hypothesis is the intersection event that effect sizes of all $K$ studies are nonzero), while $\mathrm{HS}_B$ pursues biomarkers differentially expressed in one or more studies (the alternative hypothesis is the union event instead of the intersection in $\mathrm{HS}_A$). Biologically speaking, $\mathrm{HS}_A$ is more stringent and more desirable to identify consistent biomarkers across all studies if the studies are homogeneous. $\mathrm{HS}_B$, however, is useful when heterogeneity is expected. For example, if studies analyzing different tissues are combined (e.g., study 1 uses epithelial tissues and study 2 uses blood samples), it is reasonable to identify tissue-specific biomarkers detected by $\mathrm{HS}_B$. We note that $\mathrm{HS}_B$ is identical to the classical union-intersection test (UIT) [\citet{roy1953heuristic}] but $\mathrm{HS}_A$ is different from the intersection-union test (IUT) [\citet{berger1982multiparameter}, \citet{berger1996bioequivalence}]. In IUT, the statistical \mbox{hypothesis} is in a complementary form between the null and alternative hypotheses $ \{H_0\dvtx \bigcup_k\{\theta_{gk}=0\}$ versus $H_a^{(A)}\dvtx \bigcap_k\{\theta_{gk}\ne0\} \}$. Solutions for IUT require a more sophisticated mixture or Bayesian modeling to accommodate the composite null hypothesis and are not the focus of this paper [for more details, see \citet{erickson2009meta}]. As discussed in \citet{tseng2012comprehensive}, most existing genomic meta-analysis methods target on $\mathrm{HS}_B$. Popular methods include classical Fisher's method [sum of minus log-transformed $p$-values; \citet{fisher1925statistical}], Stouffer's method [sum of inverse-normal-transformed $p$-values; \citet{stouffer1949american}], minP [minimum of combined $p$-values; \citet{tippett1931methods}] and a recently proposed adaptively weighted (AW) Fisher's method [\citet{li2011adaptively}]. The random effects model targets on a slight variation of $\mathrm{HS}_A$, where the effect sizes in the alternative hypothesis are random effects drawn from a Gaussian distribution centered away from zero (but are not guaranteed to be all nonzero). The maximum $p$-value method (maxP) is probably the only method available to specifically target on $\mathrm{HS}_A$ so far. By taking the maximum of $p$-values from combined studies as the test statistic, the method requires that all $p$-values be small for a gene to be detected. Assuming independence across studies and that the inferences to generate $p$-values in single studies are correctly specified, $p$-values ($p_k$ as the $p$-value of study $k$) are\vspace*{1.5pt} i.i.d. uniformly distributed in $[0,1]$. Fisher's statistic ($S^{\mathrm{Fisher}}=-2\sum\log p_k$) follows a\vspace*{1.5pt} chi-squared distribution with degree of freedom $2K$ [i.e., $S^{\mathrm{Fisher}}\sim\chi^2(2K)$] under\vspace*{1pt} null hypothesis $H_0$; Stouffer's statistic [$S^{\mathrm{Stouffer}}=\sum\Phi ^{-1}(1-p_k)$, where $\Phi^{-1}(\cdot)$ is the quantile function of a standard normal distribution] follows\vspace*{1pt} a normal distribution with variance $K$ [i.e., $S^{\mathrm{Stouffer}}\sim N(0, K)$]; minP statistic ($S^{\mathrm{minP}}=\min\{p_k\}$) follows a Beta distribution with parameters 1 and $K$ [i.e., $S^{\mathrm{minP}}\sim \operatorname{Beta}(1, K)$]; and maxP statistic ($S^{\mathrm{maxP}}=\max\{p_k\}$) follows a Beta distribution with parameters $K$ and 1 [i.e., $S^{\mathrm{maxP}}\sim \operatorname{Beta}(K, 1)$]. The $\mathrm{HS}_A$ hypothesis setting and maxP method are obviously too stringent in light of the generally noisy nature of microarray experiments. When $K$ is large, $\mathrm{HS}_A$ is not robust and inevitably detects very few genes. Instead of requiring differential expression in all studies, biologists are more interested in, for example, ``biomarkers that are differentially expressed in more than 70\% of the combined studies.'' Denote by $\Theta_h= \{\sum_{k=1}^K I(\theta_{gk}\ne0)=h \}$ the situation that exactly $h$ out of~$K$ studies are differentially expressed. The new robust hypothesis setting becomes \[ \mathrm{HS}_r\dvtx \Biggl\{H_0\dvtx \bigcap _k\{\theta_{gk}=0\}\mbox{ versus } H_a^{(r)}\dvtx \bigcup_{h=r}^K \Theta_h \Biggr\}, \] where $r=\lceil p\cdot K\rceil$, $\lceil x\rceil$ is the smallest integer no less than $x$ and $p$ ($0<p\le1$) is the minimal percentage of studies required to call differential expression (e.g., $p=70\%$). We note that $\mathrm{HS}_A$ and $\mathrm{HS}_B$ are both special cases of the extended $\mathrm{HS}_r$ class (i.e., $\mathrm {HS}_A=\mathrm{HS}_K$ and $\mathrm{HS}_B=\mathrm{HS}_1$), but we will focus on large $r$ (i.e., $p>50\%$) in this paper and view $\mathrm{HS}_r$ as a relaxed and robust form of $\mathrm{HS}_A$. \begin{table} \tabcolsep=0pt \tablewidth=250pt \caption{Four hypothetical genes to compare different meta-analysis methods and to illustrate the motivation of rOP}\label{tsamplegenes} \begin{tabular*}{\tablewidth}{@{\extracolsep{\fill}}@{}ld{1.4}d{1.3}d{1.4}d{1.4}@{}} \hline & \multicolumn{1}{c}{\textbf{Gene A}} & \multicolumn{1}{c}{\textbf{Gene B}} & \multicolumn{1}{c}{\textbf{Gene C}} & \multicolumn{1}{c@{}}{\textbf{Gene D}}\\ \hline Study 1 & 0.1 & \multicolumn{1}{c}{1e--20\tabnoteref[*]{tt}} & 0.25 & 0.15\\ Study 2 & 0.1 & 0.9 & 0.25 & 0.15\\ Study 3 & 0.1 & 0.9 & 0.25 & 0.15\\ Study 4 & 0.1 & 0.9 & 0.25 & 0.15\\ Study 5 & 0.1 & 0.9 & 0.25 & 0.9\\ Fisher ($\mathrm{HS}_B$) & 0.01\tabnoteref[*]{tt} & \multicolumn{1}{c}{1e--15\tabnoteref[*]{tt}} & 0.18 & 0.12\\ Stouffer ($\mathrm{HS}_B$) & 0.002\tabnoteref[*]{tt} & 0.03\tabnoteref[*]{tt} & 0.07 & 0.10\\ minP ($\mathrm{HS}_B$) & 0.41 & \multicolumn{1}{c}{5e--20\tabnoteref[*]{tt}} & 0.76 & 0.56\\ maxP ($\mathrm{HS}_A$) & \multicolumn{1}{c}{1e--5\tabnoteref[*]{tt}} & 0.59 & 0.001\tabnoteref[*]{tt} & 0.59\\ rOP ($r=4$) ($\mathrm{HS}_r$) & \multicolumn{1}{c}{5e--4\tabnoteref[*]{tt}} & 0.92 & 0.015\tabnoteref[*]{tt} & 0.002\tabnoteref[*]{tt}\\ \hline \end{tabular*} \tabnotetext[*]{tt}{$p$-values smaller than 0.05.} \end{table} In the literature, maxP has been used for $\mathrm{HS}_A$ and minP has been used for~$\mathrm{HS}_B$. An intuitive extension of these two methods for $\mathrm{HS}_r$ is to use the $r$th ordered \mbox{$p$-}value (rOP). Before introducing the algorithm and properties of rOP, we illustrate the motivation of it by the following example. Suppose we consider four genes in five studies: gene A has marginally significant $p$-values ($p=0.1$) in all five studies; gene B has a strong $p$-value in study 1 ($p={}$1e--20) but $p=0.9$ in the other four studies; gene C is similar to gene~A but has much weaker statistical significance ($p=0.25$ in all five studies); gene D differs from gene C in that studies 1--4 have small $p$-values ($p=0.15$) but study 5 has a large $p$-value ($p=0.9$). Table~\ref{tsamplegenes} shows the resulting $p$-values from five meta-analysis methods that are derived from classical parametric inference in Section~\ref{sintro}. Comparing Fisher and minP in $\mathrm{HS}_B$, minP is sensitive to a study that has a very small $p$-value (see gene B) while Fisher, as an evidence aggregation method, is more sensitive when all or most studies are marginally statistically significant (e.g., gene A). Stouffer behaves similarly to Fisher except that it is less sensitive to the extremely small $p$-value in gene B. When we turn our attention to $\mathrm {HS}_A$, gene C and gene D cannot be detected by all three of the Fisher, Stouffer and minP methods. Gene C can be detected by both maxP and rOP as expected ($p=0.001$ and $0.015$, resp.). For gene D, it cannot be identified by the maxP method ($p=0.59$) but can be detected by rOP at $r=4$ ($p=0.002$). Gene D gives a good motivating example that maxP may be too stringent when many studies are combined and rOP provides additional robustness when one or a small portion of studies are not statistically significant. In genomic meta-analysis, genes similar to gene D are common due to the noisy nature of high-throughput genomic experiments or when a low-quality study is accidentally included in the meta-analysis. Although the types of desired markers (under $\mathrm{HS}_A$, $\mathrm{HS}_B$ or $\mathrm {HS}_r$) depend on the biological goal of a specific application, genes A, C and D are normally desirable marker candidates that researchers wish to detect in most situations while gene B is not (unless study-specific markers are expected as mentioned in Section~\ref {sintro}). This toy example motivates the development of a robust order statistic of rOP below. \subsection{The rOP method} \label{srop} Below is the algorithm for rOP when the parameter $r$ is fixed. For a given gene $g$, without loss of generality, we ignore the subscript $g$ and denote by $S_{r}=p_{(r)}$, where $p_{(r)}$ is the $r$th order statistic of $p$-values $\{p_{1},p_{2},\ldots,p_{K}\}$. Under the null hypothesis $H_0$, $S_{r}$ follows a beta distribution with shape parameters $r$ and $K-r+1$, assuming that the model to generate $p$-values under the null hypothesis is correctly specified and all studies are independent. To implement rOP, one may apply this parametric null distribution to calculate the $p$-values for all genes and perform a Benjamini--Hochberg (BH) correction\vadjust{\goodbreak} [\citet{benjamini1995controlling}] to control the false discovery rate (FDR) under the general dependence structure. The Benjamini--Hochberg procedure can control the FDR at the nominal level or less when the multiple comparisons are independent or positively dependent. Although the Benjamini--Yekutieli (BY) procedure can be applied to a more general dependence structure of the comparisons, it is often too conservative and unnecessary [\citet{benjamini2001control}], especially in gene expression analysis where the comparisons are more likely to be positively dependent and the effect sizes are usually small to moderate (also see Section~\ref{ssimu} for simulation results). As a result, we will not consider the BY procedure in this paper. The parametric BH approach has the advantage of fast computation, but in many situations the parametric beta null distribution may be violated because the assumptions to obtain $p$-values from each single study are not met and the null distributions of $p$-values are not uniformly distributed. When such violations of assumptions are suspected, we alternatively recommend a conventional permutation analysis (PA) instead. Class labels of the samples in each study are randomly permuted and the entire DE and meta-analysis procedures are followed. The permutation is repeated for $B$ times ($B=500$ in this paper) to simulate the null distribution and assess the $p$-values and $q$-values. The permutation analysis is used for all meta-analysis methods (including rOP, Fisher, Stouffer, minP and maxP) in this paper unless otherwise stated. We note that both minP and maxP are special cases of rOP, but in this paper we mainly consider properties of rOP as a robust form of maxP (specifically, $K/2\le r\le K$). \subsection{Selection of $r$ in an application} \label{sselectr} The best selection of $r$ should depend on the biological interests. Ideally, $r$ is a tuning parameter that is selected by the biologists based on the biological questions asked and the experimental designs of the studies. However, in many cases, biologists may not have a strong prior knowledge for the selection of $r$ and data-driven methods for estimating $r$ may provide additional guidance in applications. The purpose of selecting $r<K$ is to tolerate potentially outlying studies and noises in the data. The noises may come from experimental limitations (e.g., failure in probe design, erroneous gene annotation or bias from experimental protocol) or heterogeneous patient cohorts in different studies. Another extreme case may come from inappropriate inclusion of a low-quality study into the genomic meta-analysis. Below we introduce two complementary guidelines to help select $r$ for rOP. The first method comes from the adjusted number of detected DE genes and the second is based on pathway association (a.k.a. gene set analysis), incorporating external biological knowledge.\looseness=-1 \subsubsection{Evaluation based on the number of detected DE genes} \label{sndet} In the first method, we use a heuristic criterion to find the best $r$ such that the number\vadjust{\goodbreak} of detected DE genes is the largest. The dashed line in Figure~\ref{fbrain}(a) shows the number of detected DE genes using different $r$ in rOP in a brain cancer application. The result shows a general decreasing trend in the number of detected DE genes when $r$ increases. However, when we randomly permute the $p$-values across genes within each study, the detected number of DE genes also shows a bias toward small $r$'s (dotted line). It shows that a large number of DE genes can be detected by a small~$r$ (e.g., $r=1$ or 2) simply by chance. To eliminate this artifact, we apply a detrending method by subtracting the dotted permuted baseline from the dashed line. The resulting adjusted number of DE genes (solid line) is then used to seek the maximum that correspond to the suggested $r$. This detrend adjustment is similar to what was used in the GAP statistic [\citet{tibshirani2001estimating}] when estimating the number of clusters in cluster analysis. In such a scenario, the curve of number of clusters (on $x$-axis) versus sum of squared within-cluster dispersions is used to estimate the number of clusters. The curve always has a decreasing trend even in random data sets and the goal is usually to find an ``elbow-like'' turning point. The GAP statistic permutes the data to generate a baseline curve and subtract it from the observed curve. The problem becomes finding the maximum point in the detrended curve, a setting very similar to ours. \begin{figure \includegraphics{683f01.eps} \caption{Results of brain cancer data set applying rOP. \textup{(a)}\label{fbraina}~Adjusted and unadjusted number of detected DE genes using different $r$. \textup{(b)}\label{fbrainb}~Boxplots of $-\log(p)$ for the biological association evaluation. $p$-values for Wilcoxon signed-rank tests are shown on the top. Black filled rectangles represent a $p$-value smaller than 0.05. \textup{(c)}\label{fbrainc}~Heatmap to show effective studies of rOP in each gene. Effective studies are shown in black and noneffective ones are in light gray.}\label{fbrain} \end{figure} Below we describe the algorithm for the first criterion. Using the original $K$ studies, the number of DE genes detected by rOP using different $r$ ($1\le r\le K$) is first calculated as $N_r$ [under the certain false discovery rate threshold, e.g., \mbox{$\mathrm{FDR}=5\%$}; see dashed line in Figure~\ref{fbrain}(a)]. We then randomly permute $p$-values in each study independently and recalculate the number of DE genes as $N_r^{(b)}$ in the $b$th permutation. The permutation is repeated for $B$ times ($B=100$ in this paper) and the adjusted number of detected DE genes is defined as $N'_r=N_r-\sum_{b=1}^B N_r^{(b)}/B$ [see\vspace*{1pt} solid line in Figure~\ref{fbrain}(a)]. In other words, the adjusted number of DE genes is detrended so that it is purely contributed by the consistent DE information among studies. The parameter $r$ is selected so that $N'_r$ is maximized (or we manually select $r$ as large as possible when $N'_r$ reaches among the largest). \begin{remark} Note that $N'_r$ could sometimes be negative. This happens mostly when the signal in a single study is strong and $r$ is small. However, since we usually apply rOP for relatively large $K$ and $r$, the negative value is usually not an issue. We also note that, unlike the GAP statistic, the criterion to choose $r$ with the maximal adjusted number of detected DE genes is heuristic and has no theoretical guarantee. In simulations and real applications to be shown later, this method performs well and provides results consistent with the second criterion described below. \end{remark} \subsubsection{Evaluation based on biological association} Pathway analysis (a.k.a. gene set analysis) is a statistical\vadjust{\goodbreak} tool to infer the correlation of differential expression evidence in the data with pathway knowledge (usually sets of genes with known common biological function or interactions) from established databases. In this approach, we hypothesize that the best selection of $r$ will produce a DE analysis result that generates the strongest statistical association with ``important'' (i.e., disease-related) pathways. Such pathways can be provided by biologists or obtained from pathway databases. However, it is well recognized that our understanding of biological and disease-related pathways are relatively poor and subject to change every few years. This is especially true for many complex diseases, such as cancers, psychiatric disorders and diabetes. In this case, it is more practical to use computational methods to generate ``pseudo'' disease-related pathways that are further reviewed by biologists before being utilized to estimate $r$. Below, we develop a computational procedure for selecting disease-related pathways. We perform pathway analysis using a large pathway database (e.g., GO, KEGG or \mbox{BioCarta}) and select pathways that are top ranked by aggregated committee decision of different $r$ from rOP. The detailed algorithm is as follows: \renewcommand{\thestep}{\Roman{step}} \begin{step} Identification of disease-related pathways (committee decision by $[K/2]+1\le r\le K$): \begin{enumerate}[3.] \item Apply rOP method to combine studies and generate $p$-values for each gene. Run through different $r$, $[K/2]+1\le r\le K$. \item For a given pathway $m$, apply Kolmogorov--Smirnov test to compare the \mbox{$p$-}values of genes in the pathway and those outside the pathway. The pathway enrichment $p$-values are generated as $p_{r,m}$. Its rank among all pathways for a given $r$ is calculated as $R_{r,m}=\rank _m(p_{r,m})$. Small ranks suggest strong pathway enrichment for pathway $m$. \item The\vspace*{1pt} sums of ranks of different $r$ are calculated as $S_m=\sum _{r=[K/2]+1}^K R_{r,m}$. The top $U=100$ pathways with the smallest $S_m$ scores are selected and denoted as~$M$. We treat $M$ as the ``pseudo'' disease-related pathway set. \end{enumerate} \end{step} \begin{step} Sequential testing of improved pathway enrichment significance: \begin{enumerate}[2.] \item We perform sequential hypothesis testing that starts from $r'=K$ since conceptually we would like to pick $r$ as large as possible. We first perform a Wilcoxon signed-rank test to test for difference of pathway enrichment significance for $r'=K$ and $r'=K-1$. In other words, we perform a two-sample test on the paired vectors of $(p_{K,m}; m\in M)$ and $(p_{K-1,m};m\in M)$ and record the $p$-value as $\tilde {p}_{K,K-1}$. \item If the test is rejected (using the conventional type I error of 0.05), it indicates that reducing from $r=K$ to $r=K-1$ can generate a DE gene list that produce more significant pathway enrichment in $M$. We will continue to reduce $r'$ by one (i.e., $r'=K-1$) and repeat the test between $(p_{r',m};m\in M)$ and $(p_{r'-1,m};m\in M)$. Similarly, the resulting $p$-values are recorded as $\tilde{p}_{r',r'-1}$. The procedure is repeated until the test from $r'$ is not rejected. The final $r'$ is selected for rOP. \end{enumerate} \end{step} \begin{remark} Note that for simplicity and since this evaluation should be examined together with the first criterion in Section~\ref{sndet}, we will not perform $p$-value correction for multiple comparison or sequentially dependent hypothesis testings here. Practically, we suggest to select $r$ based on the diagnostic plots of the two criteria simultaneously. Examples of the selection will be shown in Section~\ref{sapplication}. \end{remark} \begin{remark} We have tested different $U$ in real applications. As can be expected, the selection of $U$ did not affect the result much. In supplement Figure~7 [\citet{ST2014d}], we show that the ranks for rOP with different selection of $r$ as well as other methods become stable enough when $U=100$ for all our applications. \end{remark} \subsection{One-sided test modification to avoid discordant effect sizes}\label{srop1side} Methods combining effect sizes (e.g., random or fixed effects models) are suitable to combine studies with binary outcome, in which case the effect sizes are well defined as the standardized mean differences or odds ratios. Methods combining $p$-values, however, have advantages in combining studies with nonbinary outcomes (e.g., multi-class, continuous or censored data), in which case the F-test, simple linear regression or the Cox proportional hazard model can be used to generate $p$-values for integration. On the other hand, $p$-value combination methods usually combine two-sided $p$-values in binary outcome data. A gene may be found statistically significant with up-regulation in one study and down-regulation in another study. Such a confusing discordance, although sometimes a reflection of the biological truth, is often undesirable in most applications. Therefore, we make a one-sided test modification to the rOP method similar to the modification that \citet{owen2009karl} and \citet {pearson1934new} applied on Fisher's method. The modified rOP statistic is defined as the minimum of the two rOP statistics combining the one-sided tests of both tails. Details of this test statistic can be found in the supplementary material [\citet{ST2014a}]. \section{Applications}\label{sapplication} We applied rOP as well as other meta-analysis methods to three microarray meta-analysis applications with different strengths of DE signal and different degrees of heterogeneity. Supplement Table 1A--C\vadjust{\goodbreak} [\citet{ST2014c}] list the detailed information on seven brain cancer studies, nine major depressive disorder (MDD) studies and 16 diabetes studies for meta-analysis. Data were preprocessed and normalized by standard procedures in each array platform. Affymetrix data sets were processed by the RMA method and Illumina data sets were processed by manufacturer's software with quantile normalization for probe analysis. Probes were matched to the same gene symbols. When multiple probes (or probe sets) matched to one gene symbol, the probe that contained the largest variability (i.e., inter-quartile range) was used to represent the gene. After gene matching and filtering, 5836, 7577 and 6645 genes remained in the brain cancer, MDD and diabetes data sets, respectively. The brain cancer studies were collected from the GEO database. The MDD studies were obtained from Dr. Etienne Sibille's lab. A random intercept model adjusted for potential confounders was applied to each MDD study to obtain $p$-values [\citet{wang2012detecting}]. Preprocessed data of 16 diabetes studies described by \citet {park2009integration} were obtained from the authors. For studies with multiple groups, we followed the procedure of Park et~al. by taking the minimum $p$-value of all the pairwise comparisons and adjusted for multiple tests. All the pathways used in this paper were downloaded from the Molecular Signatures Database [MSigDB, \citet{subramanian2005gene}]. Pathway collections c2, c3 and c5 were used for the $r$ selection purpose. \subsection{Application of rOP}\label{sapprop} In all three applications, we demonstrate the estimation of $r$ for rOP using the two evaluation criteria in Section~\ref{sselectr}. In the first data set, two important subtypes of brain tumors---anaplastic astrocytoma (AA) and glioblastoma multiforme (GBM)---were compared in seven microarray studies. To estimate an adequate $r$ for the rOP application, we calculated the unadjusted number, the baseline number from permutation and the adjusted number of detected DE genes using $1\le r\le7$ under FDR${}=5\%$ [Figure~\ref{fbrain}(a)]. The result showed a peak at $r=5$. For the second estimation method by pathway analysis, boxplots of $-\log_{10}(p)$ ($p$-values calculated from association of DE gene list with top pathways) versus $r$ were plotted [Figure~\ref{fbrain}(b)]. The Wilcoxon signed-rank tests showed that the result from $r=6$ is significantly more associated with pathways than that from $r=7$ ($p={}$2.7e--11) and similarly for $r=5$ versus $r=6$ ($p={}$4.4e--9). Combining the results from Figure~\ref{fbrain}(a)~and~(b), we decided to choose $r=5$ for this application. Figure~\ref{fbrain}(c) shows the heatmap of studies effective in rOP (when $r=5$) for each detected DE gene (a total of 1469 DE genes on the rows and seven studies on the columns). For example, if $p$-values for the seven studies are $(0.13, 0.11, 0.03, 0.001, 0.4, 0.7, 0.15)$, the test statistic for rOP is $S^{\mathrm{rOP}}=0.15$ and the five effective studies that contribute to rOP are indicated as $(1,1,1,1,0,0,1)$. In the heatmap, effective studies were indicated by black color and noneffective studies were in light gray. As shown in Figure~\ref{fbrain}(c), Paugh and Yamanaka were noneffective studies in almost all detected DE genes, suggesting that the two studies did not contribute to the meta-analysis and may potentially be problematic studies. This finding agrees with a recent MetaQC assessment result using the same seven studies [\citet{kang2012metaqc}]. In our application, AA and GBM patients were compared in all seven studies. We expected to detect biomarkers that have consistent fold-change direction across studies and the one-sided corrected rOP method was more preferable. Supplement Figure~1 [\citet{ST2014d}] showed plots similar to Figure~\ref{fbrain} for one-sided corrected rOP. The result similarly concluded that $r=5$ was the most suitable choice for this application. For the second application, nine microarray studies used different areas of post-mortem brain tissues from MDD patients and control samples (supplement Table~1B [\citet{ST2014c}]). MDD is a complex genetic disease with largely unknown disease mechanism and gene regulatory networks. The postmortem brain tissues usually result in weak signals, compared to blood or tumor tissues, which makes meta-analysis an appealing approach. In supplement Figure~2(a) [\citet{ST2014d}], the maximizer of adjusted DE gene detection was at $r=6$ ($r=7$ or $8$ is also a good choice). For supplement Figure~2(b), the statistical significance improved ``from $r=9$ to $r=8$'' ($p={}$5.6e--14), ``from $r=8$ to $r=7$'' \mbox{($p={}$8.7e--7)} and ``from $r=7$ to $r=6$'' ($p=0.045$). We also obtained 98 pathways that were potentially related to MDD from Dr. Etienne Sibille. As shown in supplement Figure~2(c), the statistical significance improved ``from $r=8$ to $r=7$'' using the 98 expert selected pathways. Combining the results, we decided to choose $r=7$ (since $r=6$ only provided marginal improvement in both criteria and we preferred $r$ as large as possible) for the rOP method in this application. Supplement Figure~2(d) showed the heatmap of effective studies in rOP. No obvious problematic study was observed. The one-sided rOP was also applied (results not shown); good selection of $r$ appeared to be between 5 and 7. In the last application, 16 diabetes microarray studies were combined. These 16 studies were very heterogeneous in terms of the organisms, tissues and experimental design (supplement Table 1C [\citet{ST2014c}]). Supplement Figure~7 [\citet{ST2014d}] showed diagnostic plots to estimate $r$. Although the number of studies and heterogeneity across data sets were relatively larger than the previous two examples, we could still observe similar trends in supplement Figure~7. Specifically, for supplement Figure~3(a), it was shown that $r=7$--12 detected a higher adjusted number of DE genes. For pathway analysis, results from $r=12$ were more associated with the top pathways. As a result, we decided to use $r=12$ in this application. It was noticeable that the $r$ selection in this diabetes example was relatively vague compared to the previous examples. Supplement Figure~3(c) showed the heatmap of effective studies in rOP. Two to four studies (s01, s05, s08 and s14) appeared to be candidates of problematic studies, but the evidence was not as clear as the brain cancer example in Figure~\ref{fbrain}(c). It should be noted that the results of supplement Figure~3 used the beta null distribution inference and Benjamini--Hochberg correction. Permutation analysis generated a relatively unstable result (supplement Figure~4), although it suggested a similar selection of $r$. This was possibly due to the unusual \textit{ad hoc} DE analysis from minimum $p$-values of all possible pairs of comparisons [procedures that were used in the original paper \citet{park2009integration}]. Next, we explored the robustness of rOP by mixing a randomly chosen MDD study into seven brain cancer studies as an outlier. The results in supplement Figure~5 [\citet{ST2014d}] showed that $r=5$ or $6$ may be a good choice [supplement Figure~5(a)~and~(b)]. We used $r=6$ in rOP for this application. Supplement Figure~5(c) interestingly showed that the mixed MDD study, together with the Paugh and Yamanaka studies, was a potentially problematic study in the rOP meta-analysis. This result verified our intuition that rOP is robust to outlying studies and the $p$-values of the outlying studies minimally contribute to the rOP \mbox{statistic.} \subsection{Comparison of rOP with other meta-analysis methods} $\!\!$We performed rOP using $r$ determined from Section~\ref{sapprop} in four applications (brain cancer, MDD, diabetes and brain cancer $+$\,1 random MDD) and compared to Fisher's method, Stouffer's method, minP, maxP and vote counting. The vote counting method will be discussed in greater detail in Section~\ref{svc}. Two quantitative measures were used to compare the methods. The first measure compared the number of detected DE genes from each method as a surrogate of sensitivity (although the true list of DE genes is unknown and sensitivity cannot be calculated). The second approach was by pathway analysis, very similar to the method we introduced to select parameter~$r$. However, in order to avoid bias in top pathway selection, single study analysis results were used as the committee to select disease-related pathways. KEGG, BioCarta, Reactome and GO pathways were used in the pathway analysis. The Wilcoxon signed-rank test was then used to test if two methods detected DE genes with differential association with disease-related pathways. \begin{table} \tabcolsep=3pt \caption{Number of DE genes detected by different methods under FDR${}=5\%$}\label{tndet} \begin{tabular*}{\tablewidth}{@{\extracolsep{\fill}}@{}lccccd{4.0}d{3.0}d{3.0}@{}} \hline & \multicolumn{2}{c}{\textbf{rOP}}\\[-6pt] & \multicolumn{2}{c}{\hrulefill}\\ & \textbf{Two-sided} & \textbf{One-sided} & \textbf{Fisher} & \textbf{Stouffer} & \multicolumn{1}{c}{\textbf{minP}} & \multicolumn{1}{c}{\textbf{maxP}} & \multicolumn{1}{c@{}}{\textbf{VC}}\\ \hline Brain cancer & 1469 ($r=5$) & 1625 ($r=5$) & 2918 & 2449 & 2380 & 273 & 328\\ & \multicolumn{2}{c}{Overlap${}={}$1139}\\[3pt] MDD & \phantom{0}617 ($r=7$) & \phantom{00}86 ($r=7$) & 1124 & 1423 & 0 & 310 & 0\\ & \multicolumn{2}{c}{Overlap${}={}$48}\\[3pt] Diabetes & \phantom{10}636 ($r=12$) & Not applicable & 1698 & 1492 & 1 & 85 & 0\\ Brain${}+{}$1 MDD & \phantom{0}751 ($r=6$) & Not applicable & 2081 & 1773 & 1648 & 132 & 64\\ \hline \end{tabular*} \end{table} \begin{figure} \includegraphics{683f02.eps} \caption{Comparison of different meta-analysis methods using pathway analysis. \textup{(a)}\label{fbraincomp}~Brain cancer. \textup{(b)}\label{fmddcomp}~MDD. \textup{(c)}\label{fdiabcomp}~Diabetes. \textup{(d)}\label{fartcomp}~Brain cancer and 1 random MDD.}\label{fcomp} \end{figure} Table~\ref{tndet} showed the number of detected DE genes under FDR${}=5\%$. We can immediately observe that Fisher and Stouffer generally detected many more biomarkers because they targeted on $\mathrm{HS}_B$ (genes differentially expressed in one or more studies). Although minP also targeted on $\mathrm{HS}_B$, it sometimes detected extremely small numbers of DE genes in weak-signal data such as the MDD and diabetes examples. This is reasonable because minP has very weak power to detect consistent but weak signals across studies [e.g., $p$-values${}=(0.1, 0.1, \ldots, 0.1)$]. The stringent maxP method detected few numbers of DE genes in general. Vote counting detected very few genes especially when the effect sizes were moderate (in~the MDD and diabetes examples). rOP detected more DE genes than maxP because of its relaxed $\mathrm{HS}_r$ hypothesis setting. It identified about 50--65\% fewer DE genes than Fisher's and Stouffer's methods, but guaranteed that the genes detected were differentially expressed in the majority of the studies. We also performed the one-sided corrected rOP for comparison. This method detected similar numbers of DE genes compared to two-sided rOP, and the majority of detected DE genes in two-sided and one-sided rOP were overlapped in the brain cancer example. The result showed that almost all DE genes detected by two-sided rOP had a consistent fold-change direction across studies. In MDD, the one-sided rOP detected much fewer genes than the two-sided method. This implied that many genes related to MDD acted differently in different brain regions and in different cohorts. Figure~\ref{fcomp} showed the results of biological association from pathway analysis that were similarly shown in Figure~\ref{fbrain}(b). The result showed that the DE gene lists generated by Fisher and Stouffer were more associated with biological pathways. The rOP method generally performed better than maxP and minP and had similar biological association performance to Fisher's and Stouffer's methods. \section{Statistical properties of rOP} \label{sstat} \subsection{Power calculation of rOP and asymptotic properties} \label{spowcalc} When $K$ studies are combined, suppose $r_0$ of the $K$ studies have equal nonzero effect sizes and the rest of the ($K-r_0$) studies have zero effect sizes. That is, \begin{eqnarray*} H_0\dvtx \theta_1&=&\cdots=\theta_K=0, \\ H_a\dvtx \theta_1&=&\cdots=\theta_{r_0}=\theta \ne0,\qquad \theta_{r_0+1}=\cdots=\theta_K=0. \end{eqnarray*} For a single study, the power function given effect size $\theta$ is known as $\Pr(p_i\le\alpha_0|\theta)$. We will derive the statistical power of rOP under this simplified hypothesis setting when $r_0$ and $r$ for rOP are given. Under $H_0$, the rejection threshold for the rOP statistic is $\beta=B_\alpha(r,K-r+1)$ (the $\alpha$ quantile of a beta distribution with shape parameters $r$ and $K-r+1$), where the significance level of the meta-analysis is set at $\alpha$. The power of rejection threshold $\beta$ under $H_a$ is $\Pr (p_{(r)}\le\beta|H_a )=\Pr(\sum_{i=1}^K I(p_i\le\beta )\ge r|H_a )$. By definition, $\Pr(p_i\le\beta|\theta _i=0)=\beta$ and we further denote $\beta'=\Pr(p_i\le\beta|\theta _i=\theta)$. The power calculation of interest is equivalent to finding the probabilities of having at least $r$ successes in $K$ independent Bernoulli trials, among which $r_0$ have success probabilities $\beta'$, and $K-r_0$ have success probabilities $\beta$: \begin{eqnarray*} \Pr(p_{(r)}\le\beta|H_a )&=&\sum _{i=r}^K\sum_{j=\max (0,i-K+r_0)}^{\min(i,r_0)}\pmatrix{r_0 \cr j}\beta'^j\bigl(1-\beta' \bigr)^{r_0-j} \\ &&\hspace*{84pt}{}\times \pmatrix{K-r_0 \cr i-j}\beta^{i-j}(1-\beta)^{K-r_0-i+j}. \end{eqnarray*} \begin{remark} We note that the assumption of $r_0$ equal nonzero effect sizes can be relaxed. When the nonzero effects are not equal, the power calculation can be done in polynomial time using dynamic programming. \end{remark} Below we demonstrate some asymptotic properties of rOP \begin{theorem} \label{tpow1} Assume $r_0$ is fixed. When the effect size $\theta$ and $K$ are fixed and the sample size of study $k$ $N_k\rightarrow\infty$, $\Pr (p_{(r)}\le\beta|H_a )\rightarrow1$ if $r\le r_0$. When $r>r_0$, $\Pr(p_{(r)}\le\beta|H_a )\rightarrow c(r)<1$ and $c(r)$ is a decreasing function in $r$. \end{theorem} \begin{pf} When $N_k\rightarrow\infty$, $\beta'\rightarrow1$. The theorem easily follows from the power calculation formulae. \end{pf} Theorem \ref{tpow1} states that, asymptotically, if the parameter $r$ in rOP is specified less or equal to the true $r_0$, the statistical power converges to 1 as intuitively expected. When specifying $r$ greater than $r_0$, the statistical power is weakened with increasing $r$. Particularly, maxP will have weak power. In contrast to Theorem~\ref{tpow1}, for methods designed for $\mathrm{HS}_B$ (e.g., Fisher's method, Stouffer's method and minP), the power always converges to 1 if $N_k\rightarrow\infty$ and $r_0>0$. Figure~\ref{fpow}(a) shows the power curve of rOP for different $r$ when $K=10$, $r_0=6$ and $N_k\rightarrow\infty$. \begin{figure \includegraphics{683f03.eps} \caption{Power of rOP method when $N_k\rightarrow\infty$, $K=10$. \textup{(a)}\label{fpowr}~$r_0=6$, $r=1$--10. \textup{(b)}\label{fpowr0}~$r=6$, $r_0=0$--10.}\label{fpow} \end{figure} \begin{lemma} \label{lpow1} Assume the parameter $r$ used in rOP is fixed. When the effect size $\theta$ and $K$ are fixed and the sample sizes $N_k\rightarrow\infty $, $\Pr(p_{(r)}\le\beta|H_a )\rightarrow1$ if $r_0\ge r$. When $r_0<r$, $\Pr(p_{(r)}\le\beta|H_a )\rightarrow c(r_0)<1$ and $c(r_0)$ is an increasing function in $r_0$. \end{lemma} Lemma \ref{lpow1} takes a different angle from Theorem \ref{tpow1}. When the parameter $r$ used in rOP is fixed, it asymptotically has perfect power to detect all genes that are differentially expressed in $r$ or more studies. It then does not have strong power to detect genes that are differentially expressed in less than $r$ studies. Figure~\ref{fpow}(b) shows a power curve of rOP for $K=10$, $r=6$ and $N_k\rightarrow\infty$ (solid line). We note that the dashed line [$f(r)=0$ when $0\le r_0<6$ and $f(r)=1$ when $6\le r_0\le10$] is the ideal power curve for $\mathrm{HS}_r$ (i.e., it detects all genes that are differentially expressed in $r$ or more studies but does not detect any genes that are differentially expressed in less than $r$ studies). Methods like Fisher, Stouffer and minP target on $\mathrm{HS}_B$ and their power is always 1 asymptotically when $r_0>0$. The maxP method has perfect asymptotic power when $r_0=K=10$ but has relatively weak power when $r_0<K$. The rOP method lies between maxP and the methods designed for~$\mathrm{HS}_B$. The power of rOP for $r_0\ge6$ converges to 1, and for $r_0\le5$, the power is always smaller than 1 as the sample sizes in single studies go to infinity. Although the asymptotic powers of rOP for $r_0=4$ and $r_0=5$ are not too small, we are less concerned about these genes because they are still very likely to be important biomarkers. \subsection{Power comparison in simulated studies} \label{ssimu} To evaluate the performance of rOP in the genomic setting, we simulated a data set using the following procedure. \setcounter{step}{0} \begin{step} Sample 200 gene clusters, with 20 genes in each and another 6000 genes that do not belong to any cluster. Denote $C_g\in\{0, 1, 2, \ldots, 200\}$ as the cluster membership of gene $g$, where $C_g=0$ means that gene $g$ is not in a gene cluster. \end{step} \begin{step} Sample the covariance matrix $\Sigma_{ck}$ for genes in cluster $c$ and in study~$k$, where $1\le c \le200$ and $1\le k\le10$. First, sample $\Sigma'_{ck}\sim W^{-1}(\Psi, 60)$, where $\Psi =0.5I_{20\times20}+0.5J_{20\times20}$, $W^{-1}$ denotes the inverse Wishart distribution, $I$ is the identity matrix and $J$ is the matrix with all the elements equal 1. Then $\Sigma_{ck}$ is calculated by standardizing $\Sigma'_{ck}$ such that the diagonal elements are all 1's. \end{step} \begin{step} Denote $g_{c1},\ldots,g_{c20}$ as the indices for the 20 genes in cluster $c$, that is, $C_{g_{cj}}=c$, where $1\le c\le200$ and $1\le j\le20$. Assuming the effect sizes are all zeros, sample gene expression levels of genes in cluster $c$ for sample $n$ as $(X'_{g_{c1}nk},\ldots,X'_{g_{c20}nk})^T\sim \mathit{MVN}(0, \Sigma_{ck})$, where\vspace*{2pt} $1\le n\le100$ and $1\le k \le10$, and sample expression level for gene $g$ which is not in a cluster (i.e., $C_g=0$) for sample $n$ as $X'_{gnk}\sim N(0, 1)$, where $1\le n\le100$ and $1\le k\le10$. \end{step} \begin{step} Sample the true number of studies that gene $g$ is DE, $t_g$, from a~discrete uniform distribution that takes values on $1,2,\ldots,10$, for $1\le g\le 1000$; and set $t_g=0$ for $1001\le g\le{}$10,000. \end{step} \begin{step} Sample $\delta_{gk}$, which indicates whether gene $g$ is DE in study $k$, from a discrete uniform distribution that takes values on 0 or 1 and with the constraint that $\sum_k \delta_{gk}=t_g$, where $1\le g\le1000$ and $1\le k\le10$. For $1001\le g\le{}$10,000 and $1\le k\le10$, set $\delta_{gk}=0$. \end{step} \begin{step} Sample the effect size $\mu_{gk}$ uniformly from $[-1,-0.5]\cup[0.5,1]$. For control samples, set the expression levels as $X_{gnk}=X'_{gnk}$; for case samples, set the expression levels as $Y_{gnk}=X'_{g(n+50)k}+\mu_{gk}\cdot\delta_{gk}$, for $1\le g\le{}$10,000, $1\le n\le50$ and $1\le k\le10$. \end{step} \begin{table \tabcolsep=0pt \caption{Mean FDRs for different methods in $\mathrm{HS}_r$ with $r=6$ by simulation analysis with correlated genes. The standard deviations of the FDRs in using 100 simulations are shown in the parentheses}\label{tfdr12} \begin{tabular*}{\tablewidth}{@{\extracolsep{\fill}}lccc@{}} \hline & $\mathbf{FDR_1}$ & $\mathbf{FDR_2}$ & \textbf{\# of detected genes}\\ \hline rOP ($r=6$, PA) & 0.0439 ($\pm$\,0.0106) & 0.1818 ($\pm$\,0.0179) & 620.16\\ rOP ($r=6$, BH) & 0.0472 ($\pm$\,0.0094) & 0.2029 ($\pm$\,0.0184) & 617.53\\ rOP ($r=6$, BY) & 0.0043 ($\pm$\,0.0031) & 0.1044 ($\pm$\,0.0139) & 539.85\\ Fisher & 0.0441 ($\pm$\,0.0090) & 0.4186 ($\pm$\,0.0212) & 934.91\\ Stouffer & 0.0440 ($\pm$\,0.0089) & 0.3623 ($\pm$\,0.0217) & 858.86\\ minP & 0.0466 ($\pm$\,0.0103) & 0.4567 ($\pm$\,0.0207) & 958.26\\ maxP & 0.0459 ($\pm$\,0.0199) & 0.0729 ($\pm$\,0.0251) & 201.02\\ Vote counting & 0.0000 ($\pm$\,0.0000) & 0.0003 ($\pm$\,0.0016) & 234.43\\ \hline \end{tabular*} \end{table} \begin{figure}[t] \includegraphics{683f04.eps} \caption{Simulation results for rOP and other methods with correlated genes. \textup{(a)}\label{fsimundet}~Number of genes detected by difference methods. The detected genes are binned according to their $t_g$'s. \textup{(b)}\label{fsimupow}~Power of different methods for genes with $r_0$ nonzero effect sizes.}\vspace*{-2pt}\label{fsimures} \end{figure} In the simulated data set, 10 studies with 10,000 genes were simulated. Within each study, there were 50 cases and 50 controls. The first 1000 genes were DE in~1 to 10 studies with equal probabilities; and the rest of the 9000 genes were DE in none of the studies. We denoted $t_g$ as the true number of studies where gene $g$ was~DE. To mimic the gene dependencies in a real gene expression data set, within the 10,000 genes, we drew 200 gene clusters with 20 genes in each. We sampled the data such that the genes within the same cluster were correlated. The correlation matrices for different studies and different gene clusters were sampled from an inverse Wishart distribution. Suppose the goal of the meta-analysis was to obtain biomarkers differentially expressed in at least 60\% (6 out of 10) of the studies (i.e., $\mathrm{HS}_r$ with $r=6$). We performed two sample $t$-tests in each study and combined the $p$-values using rOP with $r=6$. $\mathrm{FDR}\le5\%$ was controlled using the permutation analysis. To compare rOP with other methods in the $\mathrm{HS}_r$ setting, we defined two FDR criteria as follows. Note that $\mathrm{FDR}_1$ targets on $H_0\dvtx t_g=0$ and $\mathrm {FDR}_2$ targets on $H_0\dvtx t_g<r$: \begin{eqnarray*} \mathrm{FDR}_1&=&\frac{\sum_gI(t_g=0 \mbox{ and gene $g$ is detected})}{\#\{\mbox{genes detected}\}}, \\ \mathrm{FDR}_2&=&\frac{\sum_gI(t_g<r \mbox{ and gene $g$ is detected})}{\#\{\mbox{genes detected}\}}. \end{eqnarray*} Table~\ref{tfdr12} listed the average $\mathrm{FDR}_1$ and $\mathrm {FDR}_2$ for different methods calculated using 100 simulations. We can see that although $\mathrm{FDR}_1$ was well controlled, all the methods were anti-conservative in terms of $\mathrm{FDR}_2$, since the inference of the five methods was based on $H_0\dvtx t_g=0$ while genes with $1\le t_g\le5$ existed and were calculated toward $\mathrm{FDR}_2$. To compare different FDR control methods, we also included the results of the Benjamini--Hochberg and Benjamini--Yekutieli procedures. According to the simulation, the Benjamini--Hochberg procedure controlled FDR similarly to the permutation test. The Benjamini--Yekutieli procedure, on the other hand, was too conservative that the $\mathrm{FDR}_1$ was controlled at about $1/10$ of the nominal FDR level. Figure~\ref {fsimures} showed the number of detected DE genes and the statistical power of different methods for genes with $t_g$ from 1 to 10. From Figure~\ref{fsimures}(a), we noticed that Fisher, Stouffer and minP methods detected many genes with $1\le t_g\le5$, which violated our targeted $\mathrm{HS}_r$ with $r=6$. MaxP detected very few genes and missed many targeted markers with $6\le t_g\le9$. Only rOP generated the result most compatible with $\mathrm{HS}_r$ ($r=6$). Most genes with $6\le t_g\le10$ were detected. The high $\mathrm {FDR}_2=18.2\%$ mostly came from genes with $4\le t_g\le5$, genes that were very likely important markers and were minor mistakes. Vote counting detected genes with $t_g\ge6$ but was less powerful. The relationship of vote counting and rOP will be further discussed in Section~\ref{svc}. We also performed rOP ($r=5$) and rOP ($r=7$) to compare the robustness of slightly different selections of $r$. Among the 620.16 DE genes (averaged over 100 simulations) detected by rOP ($r=6$), 594.15 (95.8\%) of them were also detected by rOP ($r=5$) and 516.28 (83.3\%) of them were also detected by rOP ($r=7$). The result of Figure~\ref{fsimures}(b) was consistent with the theoretical power calculation as shown in Figure~\ref{fpow}(b). We also performed the simulation without correlated genes. The results were shown in the supplement Table~2 [\citet{ST2014c}] and supplement Figure~6 [\citet{ST2014d}]. We noticed that the FDRs were controlled well in both correlated and uncorrelated cases. However, the standard deviations of FDRs with correlated genes were higher than the FDRs with only independent genes, which indicated some instability of the FDR control with correlated genes reported by \citet{qiu2006some}. \subsection{Connection with vote counting}\label{svc} Vote counting has been used in many meta-analysis applications due to its simplicity, while it has been criticized as being problematic and statistically inefficient. \citet{hedges1980vote} showed that the power of vote counting converges to 0 when many studies of moderate effect sizes are combined (see supplement Theorem 1 [\citet{ST2014b}]). We, however, surprisingly found that rOP has a close connection with vote counting, and rOP can be viewed as a generalized vote counting with better statistical properties. There are many variations of vote counting in the literature. One popular approach is to count the number of studies that have $p$-values smaller than a prespecified threshold, $\alpha$. We define this quantity as \begin{equation} \label{ervc} r=f(\alpha)=\sum_{k=1}^KI \{p_k<\alpha\} \end{equation} and define its related proportion as $\pi=E(r)/K$. The test hypothesis is \[ \cases{ H_0\dvtx \pi=\pi_0, \vspace*{2pt}\cr H_a\dvtx \pi> \pi_0,} \] where $\pi_0=0.5$ is often used in the applications. Under the null hypothesis, $r\sim \mathit{BIN}(K, \alpha)$ and $\pi=\alpha$, so the rejection region can be established. In the vote counting procedure, $\alpha$ and $\pi_0$ are two preset parameters and the inference is made on the test statistic $r$.\vadjust{\goodbreak} In the rOP method, we view equation (\ref{ervc}) from another direction. We can easily show that if we solve equation (\ref{ervc}) to obtain $\alpha=f^{-1}(r)$, the solution will be $\alpha\in [p_{(r)},p_{(r+1)} )$, and one may choose $\alpha=p_{(r)}$ as the solution. In other words, rOP presets $r$ as a given parameter, and the inference is based on the test statistic \mbox{$\alpha=p_{(r)}$}. It is widely criticized that vote counting is powerless because when the effect sizes are moderate and the power of single studies is lower than $\pi_0$, as $K$ increases, the percentage of significant studies will converge to the single study power. However, in the rOP method, because the $r$th quantile is used, tests of the top $r$ studies are combined, which helps the rejection probability of rOP achieve 1 as $K\rightarrow\infty$. It should be noted that the major difference between rOP and vote counting is that the test statistic $\alpha =p_{(r)}$ in rOP increases as $K$ and $r=K\cdot c$ increase, which keeps information of the $r$ smallest $p$-values. On the contrary, for vote counting, $\alpha$ is often chosen small and fixed when $K$ increases. In supplement Theorem 1 [\citet{ST2014b}], the power of vote counting converges to 0 as $K\rightarrow\infty$, while the power of rOP converges to 1 asymptotically as proved in supplement Theorem~2 [\citet{ST2014b}]. \section{Conclusion}\label{sconclusion} In this paper we proposed a general class of order statistics of $p$-values, called $r$th ordered $p$-value (rOP), for genomic meta-analysis. This family of statistics included the traditional maximum $p$-value (maxP) and minimum $p$-value (minP) statistics that target on DE genes in ``all studies'' ($\mathrm{HS}_A$) or ``one or more studies'' ($\mathrm{HS}_B$). We extended $\mathrm{HS}_A$ to a robust form that detected DE genes ``in the majority of studies'' ($\mathrm{HS}_r$) and developed the rOP method for this purpose. The new robust hypothesis setting has an intuitive interpretation and is more adequate in genomic applications where unexpected noise is common in the data. We developed the algorithm of rOP for microarray meta-analysis and proposed two methods to estimate $r$ in real applications. Under ``two-class'' comparisons, we proposed a one-sided corrected form of rOP to avoid detection of discordant expression change across studies (i.e., significant up-regulation in some studies but down-regulation in other studies). Finally, we performed power analysis and examined asymptotic properties of rOP to demonstrate appropriateness of rOP for $\mathrm{HS}_r$ over existing methods such as Fisher, Stouffer, minP and maxP. We further showed a surprising connection between vote counting and rOP that rOP can be viewed as a generalized vote counting with better statistical property. Applications of rOP to three examples of brain cancer, major depressive disorder (MDD) and diabetes showed better performance of rOP over maxP in terms of detection power (number of detected markers) and biological association by pathway analysis. There are two major limitations of rOP. First, rOP is for $\mathrm {HS}_r$, but the null and alternative hypotheses are not complementary\vadjust{\goodbreak} (see Section~\ref{shs}). Thus, it has weaker ability to exclude markers that are differentially expressed in ``less than $r$'' studies since the null of $\mathrm{HS}_r$ is ``differentially expressed in none of the studies.'' One solution to improve the anti-conservative inference (which is also our future work) is by Bayesian modeling of $p$-values with a family of beta distributions [\citet{erickson2009meta}]. Second, selection of $r$ may not always be conclusive from the two methods we proposed; the external pathway information may especially be prone to errors and may not be informative to the data. But since choosing slightly different $r$ usually gives similar results, this is not a severe problem in most applications. We have tested a different approach by adaptively choosing the best gene-specific $r$ that generates the best $p$-value. The result is, however, not stable and the gene-specific parameter $r$ is hard to interpret in applications. Although many meta-analysis methods have been proposed and applied to microarray applications, it is still not clear which method enjoys better performance under what condition. The selection of an adequate (or best) method heavily depends on the biological goal (as illustrated by the hypothesis settings in this paper) and the data structure. In this paper, we stated a robust hypothesis setting ($\mathrm{HS}_r$) that is commonly targeted in biological applications (i.e., identify markers statistically significant in the majority of studies) and developed an order statistic method (rOP) as a solution. The three applications covered ``cleaner'' data (brain cancer) to ``noisier'' data (complex genetics in MDD and diabetes), and rOP performed well in all three examples. We expect that the robust hypothesis setting and the order statistic methodology will find many more applications in genomic research and traditional univariate meta-analysis in the future. For multiple comparison control, we propose to either apply the parametric beta null distribution to assess the $p$-value and perform the Benjamini--Hochberg (BH) procedure for $p$-value adjustment or conduct a conventional permutation analysis by permuting class labels in each study. The former approach is easy to implement, and the latter approach better preserves the gene correlation structure in the inference. Instead of the BH procedure, we also tested the Benjamini--Yekutieli (BY) procedure which is applicable to the general dependence structure but found that it is overly conservative for genomic applications. The problem of FDR control under general high-dimensional dependence structures is beyond the scope of this paper but is critical in applications and deserves future research. Implementation of rOP is available in the ``MetaDE'' package in R together with over 12 microarray meta-analysis methods in the package.\break MetaDE has been integrated with other quality control methods [``MetaQC'' package, \citet{kang2012metaqc}] and pathway enrichment analysis methods [``MetaPath'' package, \citet{shen2010meta}]. The future plan is to integrate the three packages with other genomic meta-analysis tools into a ``MetaOmics'' software suite [\citet{wang2012r}]. \section*{Acknowledgments} The authors would like to thank Etienne Sibille and Peter Park for providing the organized major depressive disorder and diabetes data. We would also like to thank the anonymous Associate Editor and Editor Karen Kafadar for many suggestions and critiques to improve the paper. \begin{supplement}[id=supptext] \sname{Supplement Text} \stitle{Supplement Text\\} \slink[doi]{10.1214/13-AOAS683SUPPA} \sdatatype{.pdf} \sfilename{aoas683\_suppa.pdf} \sdescription{Details of one-sided test modification to avoid discordant effect sizes.} \end{supplement} \begin{supplement}[id=suppthe] \sname{Supplement Theorems} \stitle{Supplement Theorems 1 and 2\\} \slink[doi]{10.1214/13-AOAS683SUPPB} \sdatatype{.pdf} \sfilename{aoas683\_suppb.pdf} \sdescription{Theorem 1---Asymptotic property of vote counting as $K\rightarrow\infty$. Theorem 2---Asymptotic property of rOP as $K\rightarrow\infty$.} \end{supplement} \begin{supplement}[id=supptab] \sname{Supplement Tables} \stitle{Supplement Tables~1 and 2\\} \slink[doi,text={10.1214/13-\break AOAS683SUPPC}]{10.1214/13-AOAS683SUPPC} \sdatatype{.pdf} \sfilename{aoas683\_suppc.pdf} \sdescription{Table~1---Detail information of combined data sets. Table~2---FDRs for simulation analysis without correlated genes.} \end{supplement} \begin{supplement}[id=suppfig] \sname{Supplement Figures} \stitle{Supplement Figures~1 to 7\\} \slink[doi,text={10.1214/13-\break AOAS683SUPPD}]{10.1214/13-AOAS683SUPPD} \sdatatype{.pdf} \sfilename{aoas683\_suppd.pdf} \sdescription{Figure~1---Results of brain cancer data set using one-sided corrected rOP. Figure~2---Results of MDD data set. Figure~3---Results of diabetes data set. Figure~4---Permutation results of diabetes data set. Figure~5---Results of brain cancer and 1 random MDD data set. Figure~6---Simulation results without correlated genes. Figure~7---Mean rank of different methods for the top $U$ pathways.} \end{supplement}
{'timestamp': '2014-08-01T02:08:57', 'yymm': '1407', 'arxiv_id': '1407.8376', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8376'}
arxiv
\section{Introduction} \label{sec:introduction} \PARstart{I}n this paper, we consider the problem of detecting, localizing and tracking people not wearing/ carrying an electronic device, thus not actively participating in the localization effort, in large and heavily obstructed outdoor environments. To this purpose, we use an RF sensor network, \emph{i.e.}, a wireless system composed of low-power, inexpensive commercial of-the-shelf radio transceivers operating in the $2.4$ GHz ISM band \cite{RFSensNet_Proc_IEEE}. These devices form a wireless mesh network by continuously broadcasting packets and measuring the received signal strength (RSS) of the links of the network. Radio tomographic imaging (RTI) \cite{RTI_Wilson_TMC_2010} is applied to process the RSS measurements collected by the RF sensors on multiple frequency channels \cite{ChannelDiv_MASS_2012} and estimate 2D images of the change in the electromagnetic field of the deployment area due to the presence and movements of animates (\emph{e.g.}, people, large animals) or metallic objects (\emph{e.g.}, cars \cite{roadside_surv}). By further processing these images, the targets can be accurately detected and tracked \cite{MTT_Bocca_2013}. Our work introduces an accurate and energy-efficient RTI method that successfully deals with the nonstationary noise introduced in the RSS measurements by environmental factors, such as rainfalls or wind-driven foliage, tipically encountered in real-world outdoor environments. RF sensor networks represent an appealing technology for detecting and tracking people outdoors: due to the small size and low cost of the RF units, they are less invasive and better conceivable than video camera networks, and considerably less expensive than ultra-wideband (UWB) transceivers. They also work in the dark and through smoke and non-metallic walls. However, an RF sensor network deployed outdoors faces challenging conditions, different from the more static ones typically found in real-world indoor environments \cite{Grandma_2012}. The main challenges encountered in outdoor environments are: \begin{itemize} \item The presence of what we refer to as \emph{environmental noise}, \emph{i.e.}, the significant variation in RSS observed when no person is located in the monitored area due to the time-varying multipath introduced by \emph{e.g.} wind-driven foliage, rainfalls or snow. In homes and buildings, on the contrary, the RSS measured in quasi stationary conditions does not vary significantly with time: the spurious variation observed in stationary conditions can be introduced by overlapping Wi-Fi networks increasing the floor noise level of the radio channel \cite{srinivasan2006}. \item The lack of an initial calibration of the system performed in stationary conditions. Due to the intrinsic nonstationarity of the monitored environment, RTI methods to be applied for outdoor localization can not rely on an initial calibration to estimate the average RSS of the links of the network, which is then used as a reference to calculate the change in the electromagnetic field introduced by the presence of people in the monitored area. \item The need to address the energy efficiency of the system. The remote locations and harsh weather conditions drive the need for a battery powered capability of the RF sensors, which, in turn, requires the adoption of an adaptive radio duty cycling mechanism to extend the lifetime of the system or, when energy harvesting systems are enforced \cite{Basagni_NRGHarvesting}, reduce their cost and size. \end{itemize} Several application scenarios could take advantage of an RF sensor network for outdoor people detection and localization. For example, in natural parks populated by protected animal species, a system composed of small and covert devices could be used to detect and locate poachers even in areas characterized by a dense canopy, which can not be monitored \emph{e.g.} with air surveillance \cite{drones_poachers}. An outdoor RTI system could be used to monitor long international borders running across heavily forested areas from people trying to \emph{e.g.} smuggle drugs or weapons, to protect large vineyards from vandalism or theft, or to create a virtual fence at a pasture site \cite{Corke_VirtualFence} that would not require the cattle to wear GPS collars. Besides security and perimeter surveillance applications, an RTI system would greatly extend the capabilities of \emph{smart spaces} such as university campuses, malls and hospitals. In this work, we introduce a novel RTI method for outdoor environments achieving high detection and localization accuracy and improving the overall system's energy efficiency. The main contributions of our work can be summarized as follows: \begin{itemize} \item We characterize the relationship existing in nonstationary outdoor environments between the variation in RSS due to environmental noise and the link's \emph{fade level} \cite{wilson11fade}, \emph{i.e.}, the difference between the measured and theoretical RSS of a link. \item We propose a method for selecting those link-frequency channel combinations (which we refer to as \emph{link-channel pairs}) that, even in nonstationary environmental conditions, appear to be the most reliable for detecting the presence of a person on the link line, \emph{i.e.}, the imaginary straight line connecting transmitter and receiver. We verify that this selection method allows enhancing both the detection and localization accuracy while simultaneously reducing the system's energy consumption. \item We introduce an adaptive method to recalibrate on-line the reference RSS of the selected link-channel pairs, even in presence of environmental noise and people in the monitored area, and apply background subtraction on the estimated radio tomographic images to further increase the robustness of the system to the time-varying environmental noise. \end{itemize} The performance of the outdoor RTI method was evaluated in a set of experiments carried out in a challenging outdoor environment, \emph{i.e}, a $35m \times 60m$ heavily forested area with trees and bushes of various height, shape and size. Tests were performed in different environmental conditions (\emph{e.g.}, with no wind, light breeze, or gusts of wind). False alarm rate, localization accuracy and energy efficiency associated with the novel method are compared to those of the RTI methods originally introduced in \cite{MTT_Bocca_2013,MultiScale_2013}, to date the most accurate RTI methods used in indoor environments, which we suitably adapt to the considered outdoor scenario in order to make a fair comparison. Experimental results demonstrate that the novel outdoor RTI method keeps under control the false positive and negative rates ($0.04$\% and $0$\%, respectively), and reduces both the localization error (from $20$\% to $46$\%) and the energy consumption of the whole system (from $62$\% to $87$\%) compared to state-of-the-art methods. The paper is organized as follows. In Section \ref{sec:related_literature}, we survey the related literature on people detection and localization in outdoor environments and on state-of-the-art RTI methods. The novel outdoor RTI method is presented in Section \ref{sec:multichannel_RTI}, while the experimental setup is described in Section \ref{sec:setup}. Section \ref{sec:eval_metrics} lists the metrics used to evaluate the performance of the system. The results of the tests are presented in Section \ref{sec:results}. Conclusions are given in Section \ref{sec:conclusion}. \section{Related Literature} \label{sec:related_literature} The problem of localizing and tracking people in large outdoor areas has been addressed by several works. The system in \cite{RFIDs_system} was composed of spatially distributed RFID readers measuring the RSS of RFID tags carried by people moving in the monitored area. The position of the targets was estimated by using a RSS-distance model whose parameters were calibrated on-line to make the system more robust to environmental changes. The work in \cite{CamerasRFID_system} presented a heterogeneous system composed of low-quality wireless camera nodes devoted to people localization and RFID readers devoted to identification. Both the systems in \cite{RFIDs_system} and \cite{CamerasRFID_system} assumed that the targets to be located were carrying an RFID tag. Device-free localization and tracking of people has often been carried out by using visual sensor networks \cite{VisSensNet_2009}, \emph{i.e.}, wireless systems composed of a large number of low-power camera nodes. However, cameras produce a large amount of image data for the limited network's resources. In addition, cameras suffer from poor light conditions and occlusions in cluttered outdoor environments (such as \emph{e.g.} forested areas). For these reasons, other works have proposed using radars to detect personnel in heavily wooded areas. In \cite{Tahmoush_2009,Tahmoush_2013}, micro-Doppler signals, \emph{i.e.}, Doppler scattering returns not due to gross translation of the target but are instead produced by the periodic movements (\emph{e.g.}, of legs or arms) of a walking human target, are exploited for detecting humans and distinguishing them from other animals. However, stand-alone low-frequency radars have a poor angular resolution. To overcome this limitation, the work in \cite{MIMO_radar} proposes a multiple-input multiple-output (MIMO) radar exploiting the angular diversity of spaced antennas to detect the changes in the RF channel due to personnel in the deployment area. In this work, we present an energy-efficient RTI method that enables device-free detection, localization and tracking of people in large and cluttered outdoor areas covered by a small number of low-cost and low-power RF sensors. The impact of environmental factors on wireless sensor networks deployed outdoors has been previously investigated. The works in \cite{bannister2008wireless,DISI_outdoor_2013} analyze how the density and seasonal variations of vegetation, and daily temperature/humidity fluctuations affect the RSS and the links connectivity. The work in \cite{wind_radio_2006} studies how wind, \emph{i.e.}, wind-driven vegetation movement, affects the propagation of radio signals at different frequencies ($0.9$, $2$, $12$, and $17$ GHz). Experimental data demonstrate that the variation in RSS increases with the wind speed (more consistently at higher frequencies) and that the fade distribution goes from being Rician to being Rayleigh with an increasing wind speed. However, these works did not consider the combined effect of environmental factors and animates on the measured RSS. Different RTI methods were introduced in \cite{RTI_Wilson_TMC_2010,wilson10see,Kaltiokallio_RTCSA_2011,Zhao_kernel_2013}. In \cite{ChannelDiv_MASS_2012}, frequency diversity was exploited to improve the localization accuracy. The same principle was later applied in \cite{MTT_Bocca_2013,MultiScale_2013}. In all these works, the RTI systems were deployed in stationary indoor environments (\emph{i.e.}, no changes in the environment nor time-varying environmental noise). The system described in \cite{Grandma_2012} was deployed in a real-world domestic environment over a three months period. To recalibrate in an on-line fashion the reference RSS values of the links of the network, the RSS signals were low-pass filtered. By doing this, the system maintained an high localization accuracy ($0.3$ m approximately) despite the frequent changes in the environment. In \cite{Zhao_noise_2011}, the authors carried out tests in a through-wall scenario having some of the RF sensors located in the proximity of trees whose branches were swaying in the wind. They proposed a subspace decomposition method to separate the change in RSS due to human motion from that introduced by environmental noise. However, the amount of variation in the RSS signals due to the environment was estimated during an initial calibration performed with no person in the deployment area. Thus, the method assumed that the spatial and temporal characteristics of the environmental noise were constant. Such an assumption can not be made in a forested outdoor environment, where the environmental noise is highly time-varying. The RTI methods described above did not consider the issue of energy efficiency: the nodes radio, \emph{i.e.}, the most energy-hungry component, was always on, being the nodes in receive mode at all times, except for when they were transmitting a packet. Energy efficient methods were presented in \cite{kanso09b,Kaltiokallio_RTCSA_2011,Khaledi_SECON_2014}. In \cite{kanso09b}, the authors apply compressed sensing techniques to RTI, reducing the number of links that have to be sampled in order to reconstruct the whole image. In \cite{Kaltiokallio_RTCSA_2011}, an accurate time synchronization protocol is used to enable radio duty cycling. In \cite{Khaledi_SECON_2014}, only the links near the current location of the tracked targets are measured. In our work, we present a method to select those link-channel pairs that are robust to environmental noise (thus, the most informative and reliable for RTI). This approach allows increasing the energy efficiency of the system while simultaneously improving its detection and localization performance. \section{Outdoor RTI} \label{sec:multichannel_RTI} This section describes the novel outdoor RTI method. We provide the basics of RTI, focusing on the solutions developed to address the challenges posed by multipath-rich and time-varying outdoor environments. The reader is invited to refer to \cite{RTI_Wilson_TMC_2010,ChannelDiv_MASS_2012,MultiScale_2013,wilson10see,patwari08b,agrawal09} for a detailed description of the principles of RTI. Algorithm \ref{alg:outdoor_RTI_algorithm} details the novel outdoor RTI method. \begin{algorithm}[t!] \SetKwInOut{Input}{input} \SetKwInOut{Output}{output} \Input{$N$ static RF sensors located at (estimated) positions $\{x_n,y_n\}_{n=1,...,N}$\newline Communicating on a set of different frequency channels $\mathcal{C}$\newline Measuring the RSS on the link-channel pairs of the network.} \Output{$\hat{\mathcal{P}}(k)$ (estimated positions of the people found in the monitored area at time $k$)} Calculate the projection matrix $\mathbf{\Pi}$\newline \While{(1)}{ \textbf{At the completion of each full TDMA cycle:}\newline{ Update the reference RSS $\bar{r}_{l,c}(k)$ of the selected link-channel pairs\newline Estimate the change in RSS $y_l$ of the selected link-channel pairs\newline Estimate the radio tomographic image $\mathbf{\hat{x}}$ = $\mathbf{\Pi}$$\mathbf{y}$\newline Apply background subtraction to $\mathbf{\hat{x}}$ and update the background image\newline Apply target detection and tracking method to estimate $\hat{\mathcal{P}}(k)$} \textbf{Every $\mathbf{\Delta}\mathbf{T_N}$ hours:} (\emph{e.g.}, $\mathbf{\Delta}\mathbf{T_N}$ = 2)\newline{ Measure the RSS of all link-channel pairs $\{l,c\}$ of the network for $\Delta T_c$ minutes (\emph{e.g.}, $\Delta T_c$ = 5)\newline Estimate fade level, $F_{l,c}$, and RSS variance, $\sigma^2_{l,c}$, of the link-channel pairs\newline Select the most reliable link-channel pairs to be used for RTI } \caption{Outdoor RTI method}\label{alg:outdoor_RTI_algorithm} \end{algorithm} \subsection{Links Characteristics in Nonstationary Environments} \label{fadeLevel_Noise} \begin{figure*}[t] \begin{center} \mbox{ \subfigure[]{\epsfig{figure=FL_Var_distrib.eps,width=\columnwidth}} \quad \subfigure[]{\epsfig{figure=FL_Var_plot.eps,width=\columnwidth}} } \caption{Fade level \emph{vs.} RSS variance due to environmental noise. The points in Figure (a) are obtained by measuring the RSS of all the link-channel pairs of the network during four intervals of $15$ minutes with wind of varying intensity blowing in the deployment area. Figure (b) shows the boxplots of the distribution of the RSS variance of the link-channel pairs divided in sub-groups (A-F in Figure (a)) based on their fade level. On each box, the central bar represents the median of the distribution, the edges are the $25$th and $75$th percentiles, and the external poinnts are meant to identify outliers, which are plotted individually.} \label{fig:FL_var_stationary} \end{center} \end{figure*} First, we analyze the characteristics of the links in nonstationary outdoor environments. To do this, we use the concept of fade level introduced in \cite{wilson11fade}, which defines the relationship between steady-state, narrow-band fading and the changes in RSS due to a person crossing the link line. The fade level of link $l$ on channel $c$, $F_{l,c}$, can be estimated as: \begin{equation} \label{eq:fade_level} F_{l,c} = \bar{r}_{l,c} - P(d_l), \end{equation} where: \begin{equation} \label{eq:Pd} P(d_l) = P_0^n - 10 \eta_n \log_{10} \left(\frac{d_l}{d_0^n}\right). \end{equation} In (\ref{eq:fade_level}), $\bar{r}_{l,c}$ is the average RSS of link $l$ on channel $c$ measured with no person in the proximity of the link line, and $P(d_l)$ is the theoretical RSS, predicted by using the log-distance path loss model \cite{rappaport96}, for two nodes at distance $d_l$. The equation in (\ref{eq:Pd}) represents a \emph{node-specific} log-distance path loss model whose parameters $\eta_n$, $P_0^n$ and $d_0^n$ (\emph{i.e.}, the path loss exponent, reference path loss, and reference distance, respectively), are derived by fitting the average RSS of those links having node $n$ as transmitter. In other works, \emph{e.g.}, \cite{MultiScale_2013}, a global path loss exponent was estimated by fitting the average RSS of all the links of the network. In this work, by generating for each RF sensor an individual distance-RSS model, hardware variability factors (such as \emph{e.g.} antenna impedance matching or relative antenna orientation between transmitter and receiver \cite{HW_RSS_var_2006}) and local environmental differences (such as \emph{e.g.} the proximity to the node of dense foliage) are taken into consideration \cite{Vallet_model}. In Section \ref{sec:results}, we show that, by deriving an individual model for each node instead of a global one, the system achieves better detection and localization performance. The fade level can be interpreted as a measure of whether a link-channel pair is experiencing destructive or constructive multipath interference (or not): in the first case, the fade level is negative and the link-channel pair is said to be in \emph{deep fade}; in the latter case, the fade level is positive and the link-channel pair is said to be in \emph{anti-fade}. However, even in multipath-rich indoor environments, the measured RSS does not vary significantly unless, \emph{e.g.}, a human body affects the propagation of one (or more) of the multipath components. On the contrary, outdoor environmental factors, such as wind, rainfall or snow, introduce a significant variation in RSS even when no person is found in the deployment area. We measure the effect of the environmental noise on a link-channel pair as the variance of the RSS measurements collected when no person is in the proximity of the link line. The relationship between fade level and environmental noise is depicted in Figure \ref{fig:FL_var_stationary}. The points in Figure \ref{fig:FL_var_stationary}(a) are obtained by measuring the RSS of all the link-channel pairs of the system described in Section \ref{sec:setup} during four different intervals of $15$ minutes with wind of varying intensity blowing in the deployment area. Figure \ref{fig:FL_var_stationary}(b) shows the boxplot of the RSS variance of all the link-channel pairs, divided in six sub-groups (A-F) based on their fade level. The data show that link-channel pairs in deep fade, \emph{i.e.}, those having negative fade level, have a higher RSS variance when the wind becomes stronger. Thus, those links hardly contribute to the detection and localization problems. Data in Figure \ref{fig:FL_var_stationary} show that link-channel pairs with a positive fade level (\emph{i.e.}, in anti-fade) are more robust to environmental noise. Moreover, link-channel pairs in anti-fade are characterized by a smaller sensitivity area \cite{wilson11fade,MultiScale_2013}, \emph{i.e.}, the area where a person affects the RSS. This area is modeled as an ellipse having transmitter and receiver at the foci \cite{patwari08b}: for link-channel pairs in anti-fade, it can be modeled as a \emph{narrow} ellipse around the link line. Thus, link-channel pairs with a positive fade level are not only more robust to environmental noise but can also be considered more reliable indicators of the presence of a person in the proximity of the link line. We provide an example of this in Figure \ref{fig:link_example}, which shows the RSS, measured on different frequency channels, of a $25$ m link cutting through several branches of the trees found in the area. During the test, carried out in a day with wind of moderate intensity, a person crossed the link line at $t = 282$ s. The only channel in anti-fade, \emph{i.e.}, channel $16$ having $F_{l,c} = 2.1$ dBm, measured a consistent attenuation ($12$ dBm) in RSS at the crossing event, while exhibiting small variation in RSS due to the movements of the wind-driven foliage. On the contrary, the other two channels in deep fade show a continuous, significant variation in RSS due to the action of the wind, and this does not allow to unequivocally detect the crossing event. \subsection{Link-Channel Pairs Selection} \label{links_sel_weighting} We now present a method to select a subset of link-channel pairs to be used for RTI. The reason for doing this is twofold: on one hand, we want to select link-channel pairs that are more robust to environmental noise and, at the same time, more informative about the position of the targets in order to enhance the detection and localization performance of the system. On the other, we want to increase the energy efficiency of the system, since the radio of the RF sensors can be turned off during the TDMA slots originally allocated to the discarded link-channel pairs. Define $\mathcal{L}_p$ to be the set of link-channel pairs with positive fade level \begin{equation} \label{eq:anti-fade_set} \mathcal{L}_p = \left\{ \left( l,c \right) : F_{l,c} > 0 \right\}, \end{equation} where $l$ is the link and $c$ the frequency channel. Due to the low nodes density typical of outdoor deployments and the presence of several obstructions, some link-channel pairs may measure a RSS close to the sensitivity threshold of the radio modules ($-97$ dBm at typical ambient temperatures for the radios described in Section \ref{hardware_protocol}). Links with an average RSS close to the sensitivity threshold belong to a \emph{grey region} \cite{RSSI_underappreciated} in which their connectivity performance becomes highly unpredictable and their RSS measurements include noise and interference due to very weak signals. Moreover, the connectivity of these links is highly affected by changes in the environment \cite{Ceriotti_jungle}. Thus, we discard all link-channel pairs with an average RSS lower than a pre-defined threshold $\Upsilon_r$ (we set $\Upsilon_r = -90$ dBm). Define $\mathcal{L}_r$ to be the set of link-channel pairs with average RSS higher than $\Upsilon_r$ \begin{equation} \label{eq:high_average_set} \mathcal{L}_r = \left\{ \left( l,c \right) : \bar{r}_{l,c} > \Upsilon_r \right\}. \end{equation} Now define $\mathcal{L}_s = (\mathcal{L}_p \cap \mathcal{L}_r)$ to be the set of link-channel pairs to be considered. Both the fade level and the average RSS of the link-channel pairs are estimated when no person is found in the deployment area. For each link-channel pair, we calculate a weight $\rho_{l,c}$ as follows \begin{equation}\label{eq:weight_link_channel} \rho_{l,c} = \begin{cases} F_{l,c} / \sigma^2_{l,c} & \text{if } \left( l,c \right) \in \mathcal{L}_s\\ 0 & \text{otherwise} \end{cases}, \end{equation} where $\sigma^2_{l,c}$ is the RSS variance measured when no person is found in the deployment area. Consequently, link-channel pairs having low RSS variance are assigned a higher weight, since the variations in RSS measured on such links have a higher probability of being human-induced. Finally, define the set $\mathcal{L}$ as \begin{equation} \label{eq:final_set} \mathcal{L} = \left\{ \left( l,c \right) : \left( l,c \right) \in \mathcal{L}_s \land c = \max_{j \in \mathcal{C}} \rho_{l,j} \right\}, \end{equation} \emph{i.e.}, as the set in which, for each link in $\mathcal{L}_s$, only the frequency channel in $\mathcal{C}$ (where $\mathcal{C}$ represents the set of measured frequency channels) characterized by the largest weight is included. \begin{figure}[t] \begin{center} \epsfig{figure=link_example.eps,width=\columnwidth} \caption{The RSS, measured on different frequency channels, of a $25$ m link cutting through several branches of trees found in the area of the test. During the test, carried out in a day with wind of moderate intensity, a person crossed the link line at $t = 282$ s.} \label{fig:link_example} \end{center} \end{figure} \begin{figure}[t] \begin{center} \epsfig{figure=sens_area.eps,width=0.8\columnwidth} \caption{At time $k$, the FIFO buffers of the selected link-channel pairs whose sensitivity areas (red ellipses) include a person's estimated position are not updated. The FIFO buffers of the other selected link-channel pairs are instead updated. For each link-channel pair in $\mathcal{L}$, the reference RSS is calculated as the average of the RSS measurements contained in its FIFO buffer.} \label{fig:sens_area} \end{center} \end{figure} \subsection{RSS Change Estimation} \label{online_RSS_change} The change in RSS at time $k$ for each link-channel pair in $\mathcal{L}$ is estimated as: \begin{equation} \label{eq:RSS_change} y_{l,c} = | r_{l,c}(k) - \bar{r}_{l,c}(k) |, \end{equation} where $r_{l,c}(k)$ and $\bar{r}_{l,c}(k)$ are the \emph{measured} and \emph{reference} RSS of the link-channel pair $(l,c)$, both considered at time $k$, respectively. In most of the previous works (\emph{e.g.}, \cite{RTI_Wilson_TMC_2010,MTT_Bocca_2013,MultiScale_2013}), the reference RSS was calculated as the average RSS measured during an initial calibration of the system carried out in absence of people in the monitored area. This approach showed to be effective in time invariant indoor environments. In \cite{Grandma_2012}, the reference RSS was estimated in real-time by low-pass filtering the measured RSS. This approach was effective in a dynamic domestic environment characterized by frequent, bursty events modifying the attenuation field of the deployment area. However, this approach was not effective when the person to be localized was not moving for an extended period of time (\emph{e.g.}, sleeping): in that case, the reference RSS quickly converged to the measured RSS, bringing the corresponding change in RSS to zero despite the presence of the person in the deployment area. Due to the presence of a time-varying environmental noise affecting the RSS measurements, an outdoor RTI system must continuously update the reference RSS of the selected link-channel pairs, even when people are not moving inside the deployment area. To estimate the reference RSS in real-time without losing people who stop moving, we use the following procedure. We first create, for each selected link-channel pair, a FIFO buffer of $N_w = \lfloor {T_w}/{T_s} \rfloor$ elements. $T_w$ is the length of the considered time window (\emph{e.g.}, $T_w = 5$ s) and $T_s$ is the sampling interval of the RTI system, \emph{i.e.}, the interval of time required by the system to complete all the TDMA rounds of communication on the frequency channels in $\mathcal{C}$ (see Section \ref{hardware_protocol}). Define $\mathcal{\hat{P}}(k)$ to be the set of estimated positions at time $k$ of the people located in the deployment area ($\mathcal{\hat{P}}(k) = \emptyset$ if no person is in the deployment area). Since the change in RSS of a link is assumed to be a spatial integral of the attenuation field of the monitored area, only the attenuation in the elliptical sensitivity area of the link will affect its RSS. Thus, at time $k$, only the FIFO buffers of link-channel pairs whose sensitivity areas do not include one of the positions in $\mathcal{\hat{P}}(k)$ are updated. For each link-channel pair in $\mathcal{L}$, the reference RSS $\bar{r}_{l,c}(k)$ is calculated as the average of the RSS measurements contained in its FIFO buffer. In this way, the system does not require an initial calibration to calculate the reference RSS. Moreover, the reference RSS does not converge to the measured RSS even when the person stops moving for an extended period of time. \subsection{Radio Tomographic Image Estimation} \label{image_estimation} When we consider all the $N(N-1)$ links of the network, the change in the electromagnetic field of the deployment area $\mathbf{x}$ is estimated as: \begin{equation} \label{eq:matrix_RTI} \mathbf{y} = \mathbf{W}\mathbf{x} + \mathbf{n}, \end{equation} where $\mathbf{y}$ and $\mathbf{n}$ are vector of size $N(N-1)$ of the RSS change and noise of the links of the network, respectively. For the links belonging to $\mathcal{L}$, the RSS change is calculated as in (\ref{eq:RSS_change}). For all the others, the RSS change is zero. Vector $\mathbf{x}$ represents the change in the \emph{discretized} electromagnetic field of the monitored area, \emph{i.e.}, the intensity of each pixel of the radio tomographic image to be estimated. Thus, $\mathbf{x}$ is a vector of size $P$, where $P$ is the total number of pixels of the radio tomographic image. Element $w_{l,q}$ of the weight matrix $\mathbf{W}$ indicates how pixel $q$ affects the change in RSS of link $l$. Since the sensitivity area of a link is modeled as an ellipse \cite{patwari08b}, $w_{l,q}$ is computed as: \begin{equation} \label{eq:weight model} w_{l,q} = \begin{cases} \frac{1}{A_l} & \text{if } d_{l,q}^{TX}+d_{l,q}^{RX}<d_{l}+\lambda\\ 0 & \text{otherwise} \end{cases}, \end{equation} where $A_l$ is the area of the ellipse, \emph{i.e.}, the sensitivity area, of link $l$, $d_{l,q}^{TX}$ and $d_{l,q}^{RX}$ are the distances of pixel $q$ from the transmitter and receiver, respectively, and $\lambda$ is the parameter defining the width of the sensitivity area. The linear model in (\ref{eq:matrix_RTI}) is based on the correlated shadowing models in \cite{RTI_Wilson_TMC_2010,patwari08b,agrawal09}. Regularization \cite{Vogel_book} is required to solve the ill-posed problem of estimating the intensity of the \emph{many} pixels in $\mathbf{x}$ from the \emph{few} links' measurements in $\mathbf{y}$. We apply the regularized least square approach used also in \cite{MTT_Bocca_2013,MultiScale_2013}: \begin{equation} \label{eq:linear_transformation} \hat{\mathbf{x}} = \mathbf{\Pi}\mathbf{y}. \end{equation} where: \begin{equation} \label{eq:tikhonov} {\mathbf{\Pi}} = {(\mathbf{W}^T\mathbf{W}+\mathbf{C}_{x}^{-1}\alpha_r)}^{-1}\mathbf{W}^T. \end{equation} $\alpha_r$ is the regularization parameter (\emph{e.g.}, $\alpha_r = 0.1$). The a priori covariance matrix $\mathbf{C}_{x}$ is calculated using an exponential spatial decay model \cite{patwari08b}: \begin{equation} \label{eq:cov_matrix} \mathbf{C}_{x}[i,j]=\sigma_{x}^{2}e^{-d_{i,j} /\delta_{c}}, \end{equation} where $\sigma_{x}^{2}$ is the variance at each pixel, $d_{i,j}$ is the Euclidean distance between pixels $i$ and $j$, and $\delta_{c}$ is a pixels' correlation distance parameter. The inversion matrix $\mathbf{\Pi}$, of size $P \times N(N-1)$, has to be calculated only once after the deployment of the RF sensors, so that $\hat{\mathbf{x}}$ in (\ref{eq:linear_transformation}) can be estimated in real-time. \subsection{Background Subtraction} \label{sec:background_sub} Background subtraction is often used in machine vision in order to detect moving objects in videos recorded by static cameras. By iterating the process described in Section \ref{image_estimation} and exploiting the temporal continuity of the estimated images, these can be considered as the \emph{frames} of a video in which the targets to be detected and tracked are the blobs corresponding to people entering and moving in the monitored area. Over the years, several background subtraction methods have been proposed \cite{Piccardi_back_sub,Benezeth_back_sub}. Motion detection is performed by calculating the pixel-wise difference between the current frame and a reference (or background) image, which in our case is the estimated electromagnetic field of the monitored area when no person is found in it. Only the pixels whose intensity is significantly different from that of the background image are labeled as \emph{foreground} pixels, thus considered as potential moving objects, \emph{i.e.}, people. In a RTI system deployed outdoor, the background image can change, gradually or suddenly, due to the environmental noise in the RSS signals. Thus, it must be continuously updated to increase the robustness of the motion detection process. We model each pixel of the background image as a realization of a Gaussian distribution $\mathcal{N}(\mu_p(k),\sigma_p^2(k))$, where $\mu_p(k)$ and $\sigma_p(k)$ are the expectation and standard deviation of the intensity of pixel $p$ at time $k$. These parameters are computed using the corresponding FIFO buffers containing $N_b = \lfloor {T_b}/{T_s} \rfloor$ elements for each pixel. The set of background pixels $\mathcal{B}(k)$ is defined as: \begin{equation} \label{eq:back_foreground} \mathcal{B}(k) = \left\{q : \frac{|\hat{\mathbf{x}}_q(k) - \mu_q(k-1)|}{\sigma_q(k-1)} \le K_b\right\}, \end{equation} where $K_b$ is a threshold defining the confidence interval of the intensity of the pixels (we set $K_b = 1$) and $\mu_q(k-1)$ and $\sigma_q(k-1)$ are the mean and standard deviation of the Gaussian distribution of pixel $q$ estimated at time $k-1$, respectively. At time $k$, only the FIFO buffers of the pixels in the background are updated with the current intensity value. At time $k$, the background image $\mathbf{M}(k)$ is calculated as a $P \times 1$ vector whose elements are the mean of the pixels' FIFO buffers: \begin{equation} \label{eq:background_image} \mathbf{M}(k) = \left[ \mu_1(k),...,\mu_P(k) \right]. \end{equation} Finally, the background subtracted radio tomographic image, $\hat{\mathbf{x}}_b$, is calculated as: \begin{equation} \label{eq:back_sub_RTI} \hat{\mathbf{x}}_b(k) = \hat{\mathbf{x}}(k) - \mathbf{M}(k). \end{equation} The background subtraction allows increasing the difference in intensity between the pixels of the blobs corresponding to real people and those of the blobs introduced by the environmental noise, making the blobs tracking more accurate. \subsection{People Detection and Tracking} \label{MTT_subsection} To detect and track the blobs corresponding to real people, we apply on $\hat{\mathbf{x}}_b$ the method in \cite{MTT_Bocca_2013}, providing high accuracy ($0.5$ m tracking error approximately) and real-time performance with multiple people even when these have intersecting trajectories. We refer the reader to \cite{MTT_Bocca_2013} for a detailed description of the applied multiple target tracking method. By applying the same detection and tracking methods, we can fairly evaluate the performance of the novel outdoor RTI method presented in this work and compare it to previous works. The parameters of the method presented in Section \ref{sec:multichannel_RTI} are summarized in table \ref{t:table_parameters}. \begin{table}[t!] \caption{RTI parameters (default values)} \centering \footnotesize \begin{tabular}{c c c} \hline\hline\ Parameter & Value & Description \\ \hline $\Upsilon_r$ & $-90$ & Link connectivity threshold [dBm]\\ $T_w$ & $5$ & Link RSS FIFO buffer length [s]\\ $\lambda$ & $2$ & Link ellipse (sensitivity area) width\\ $T_b$ & $5$ & Background image training period [s]\\ $K_b$ & $1$ & Background/Foreground pixel threshold\\ $\alpha_r$ & $0.1$ & Regularization parameter\\ $\sigma_{x}^{2}$ & $0.001$ & Pixels' intensity variance\\ $\delta_{c}$ & $1$ & Pixels' correlation distance\\ $p$ & $0.65$ & Pixel width [m]\\ \hline \end{tabular} \label{t:table_parameters} \end{table} \section{Experimental Setup} \label{sec:setup} \subsection{Hardware and Communication Protocol} \label{hardware_protocol} In our experiments, we use TI CC2531 nodes \cite{TI_CC2531}, equipped with a SWRU120b antenna \cite{antenna_nodes}. The CC2531 has a nominal maximum transmit power of $4.5$ dBm, and can transmit on one of $16$ frequency channels, which are $5$ MHz apart, in the $2.4$ GHz ISM band. Other frequency bands, \emph{e.g.}, $900$ MHz and $433$ MHz, could be similarly used for outdoor RTI. An analysis of the performance of different frequency bands for RF-based people localization in outdoor environments is outside the scope of this paper and is left for future research. The nodes used in the experiments drain approximately $35$ mA when the radio is on, and $20$ $\mu$A when off. The RF sensors run a multi-channel TDMA communication protocol, described in detail in \cite{RTI_book}, in which each node has a unique slot number, and transmits only during its slot. Differently than in typical indoor environments where the mesh network formed by the RF sensors is fully connected, in outdoor deployments some nodes may not receive packets transmitted by other nodes, and the connectivity of links (particularly those in the grey region \cite{RSSI_underappreciated}) may vary significantly over time. The nodes use the information included in the received packets, \emph{i.e.}, ID of the transmitting node and total number of nodes in the network, to synchronize their TX/RX schedules and synchronously switch on the next frequency channel in $\mathcal{C}$. This mechanism does not require a command from a central coordinating unit, making the system robust to lossy links and nodes' failure. The transmitted packets contain also the RSS of the most recent packets received from the other nodes. In our experimental setup, a sink node listens to all the packets transmitted by the nodes. The sink node is connected to a laptop where the RSS measurements are stored for post-processing. \subsection{Experiments} \label{experiments} \begin{figure}[t] \begin{center} \epsfig{figure=forest_deployment2.eps,width=0.8\columnwidth} \caption{Aerial view of the forested area where the experiments were carried out. The yellow circles represent the $20$ RF sensors composing the RTI system, in the positions estimated by using the procedure described in Section \ref{coord_system}.} \label{fig:forest_deployment} \end{center} \end{figure} We perform experiments in a $35m \times 60m$ heavily forested area, shown in Figure \ref{fig:forest_deployment}. The $20$ battery-powered RF sensors composing the system are attached using tape to the trunks of the trees found in the area, at different heights from the ground. The nodes communicate on four frequency channels, specifically $\mathcal{C} = \{11,16,21,26\}$. The center frequency of a 802.15.4 channel is calculated as $f_c = 2400 + 5(c-10)$ MHz, where $c$ is the channel number. Each selected link-channel pair is measured every $T_s = 0.34$ s (\emph{i.e.}, an approximate sampling frequency of $3$ Hz). To estimate the position of the nodes, we measure at least two length-angle tuples from each sensor. Similarly, we estimate the position of other reference points throughout the deployment area. These points are used to control the movements of the person to be localized and estimate his true position during the tests. The system run for several hours, during which we collected RSS measurements with no people in the monitored area and carried out several tests in different environmental conditions (\emph{i.e.}, absence of wind, presence of a light breeze, with moderately strong gusts of wind). In each test, a person walks in the deployment area carrying an audio recorder. The person moves along straight lines connecting the reference points and the RF sensors. Each time the person passes nearby a reference point or a sensor, he speaks into the audio recorder its ID number. In addition, the person stands without moving for some time (\emph{e.g.}, 20 s) at various spots inside the deployment area. By interpolating the time stamps in the audio recording, we are able to always derive the true position of the person. In section \ref{sec:results}, we present the results of tests in which only one person at a time is located in the monitored area. However, the outdoor RTI method presented in this work can be applied to localize and track multiple people \subsection{RF Sensors' Position Estimation} \label{coord_system} A RTI system is composed of $N$ static RF sensors located at estimated positions $\{\hat{p}^n_x,\hat{p}^n_y\}_{n=1,...,N}$. In indoor environments, the availability of a blueprint and structural reference points enables a more precise estimation of the sensors' position. In outdoor environments, the lack of a blueprint and other reference points, the uneven terrain, and the eventual presence of trees and bushes affecting the intra-node distance measuring process increase the error in the sensors' position estimates. In a forested environment, a GPS could be used to locate the RF sensors. However, trees' canopy, trunks and dense foliage near the receiving antenna can interfere with the reception of the signals broadcasted by the satellites, causing huge positional errors, or totally block these signals, making the positioning impossible \cite{GPS_forest,GPS_forest2}. We now present a method to estimate the position of the RF sensors in a forested environment in which GPS measurements are not available. The $N$ RF sensors are deployed at different heights from the ground, creating a mesh of link lines that conforms to the terrain undulation and capable of intersecting a human body (contrary to what happens in indoor deployments, in this case the sensors are not on the same 2D plane). We choose one sensor to be the reference one, having coordinates $(0,0)$ in the 2D space. We proceed by manually measuring the \emph{length} and the \emph{angle} (relative to the North geomagnetic pole) of a limited number of links (measuring all the links would be incredibly time consuming), making sure that the measured links connect all the deployed sensors. The initial position estimates are determined by considering only the measurements of links which sequentially connect all the deployed sensors. Starting from the initial position estimates so derived, we iteratively find the maximum likelihood estimate (MLE) of the position of each sensor by taking into consideration also the other measured links. The final position estimates of the sensors are calculated as: \begin{equation} \operatornamewithlimits{argmin}_{\{\hat{p}^n_x,\hat{p}^n_y\}} \left( \frac{\sum_{l \in \mathcal{T}} \left( d_l - \hat{d}_l \right)^2}{\sigma^2_d} + \frac{\sum_{l \in \mathcal{T}} \left( \alpha_l - \hat{\alpha}_l \right)^2}{\sigma^2_{\alpha}} \right), \end{equation} where $\mathcal{T}$ is the set of links manually measured, $d_l$ and $\alpha_l$ are the measured length and angle of the links in $\mathcal{T}$, respectively, and $\hat{d}_l$ and $\hat{\alpha}_l$ are the estimated length and angle of the links in $\mathcal{T}$, respectively, which change at each iteration depending on the estimated positions of the RF sensors. $\sigma^2_d$ and $\sigma^2_{\alpha}$ are the variance of the length and angle measurement process, respectively (we set $\sigma^2_d = 0.5$ m and $\sigma^2_{\alpha} = 5^{\circ}$ after collecting multiple consecutive measurements for the same links). Other methods can be considered to provide an estimate of the spatial coordinates of the sensing units, \emph{e.g.}, see \cite{Alippi_book} for a review. \section{Evaluation Metrics} \label{sec:eval_metrics} To evaluate the performance of the outdoor RTI method and of the previous methods here discussed, we use three figures of merit: \begin{inparadesc} \item[Energy efficiency coefficient:]measured as the ratio of link-channel pairs that are not selected to be used for RTI, \emph{i.e.}, the ratio of TDMA slots the nodes remain in energy-saving mode, with the radio off: \begin{equation} \label{eq:nrg_eff} \vartheta_e = 1- \frac{\left|\mathcal{L}\right|}{N(N-1)\left|\mathcal{C}\right|}. \end{equation} \item[False alarm rate:]the system triggers a false alarm whenever it wrongly detects at least a person in the monitored area. We measure the false alarm rate as the percentage of radio tomographic images where the real and estimated number of people in the monitored area differ. \item[Localization accuracy:] measured as the root mean squared error (RMSE) of the position estimates, $\hat{z}(k)$, provided by the RTI system: \begin{equation} \label{eq:RMSE} \bar{e} = \left( \frac{1}{K} \sum_{k=1}^K{\left( \hat{z}(k)-z(k) \right)}^2 \right)^{1/2}, \end{equation} where $K$ is the total number of position estimates provided by the system during the deployment and $z(k)$ the true position of the person at time $k$. We calculate the RMSE both when the person is moving, $\bar{e}_m$, or standing, $\bar{e}_s$. \end{inparadesc} \section{Experimental Results} \label{sec:results} \begin{center} \begin{table*}[t!] \caption{Summary of the performance of outdoor RTI methods} \centering \footnotesize \begin{tabular}{c | c c | c c | c c c c} \hline\hline & \multicolumn{2}{c|}{PATH LOSS EXPONENT} & \multicolumn{2}{c|}{LINK-CHANNEL SELECTION} & \multicolumn{4}{c}{PERFORMANCE}\\ \hline METHOD & Node-specific & Global & Heaviest channel & Weighted average & $\vartheta_e$ & False alarm rate [\%] & $\bar{e}_m$ [m] & $\bar{e}_s$ [m]\\ \hline \emph{$OUT^{+}$} & \checkmark & & \checkmark & & 87.2 & 0.04 & 3.8 & 3.2\\ \hline \emph{$OUT^{w}$} & \checkmark & & & \checkmark & 67.2 & 0.07 & 3.7 & 3.2\\ \hline \emph{$COM^{+}$} & & \checkmark & \checkmark & & 88.3 & 0.06 & 5.0 & 4.2\\ \hline \emph{$COM^{w}$} & & \checkmark & & \checkmark & 68.7 & 0.07 & 4.9 & 4.1\\ \hline \end{tabular} \label{t:RTI_methods_table} \end{table*} \end{center} In this section, we first present the experimental results of the outdoor RTI method. We also consider modified versions of the original algorithm, and demonstrate that the method we propose outperforms the modified versions in terms of false alarm rate, energy efficiency and localization accuracy. Then, we evaluate previous indoor RTI methods, which we suitably adapt to the considered outdoor scenario in order to make a fair comparison. Finally, we analyze the sensitivity of the outdoor RTI method to the parameters in Table \ref{t:table_parameters}. \subsection{Outdoor RTI Method Performance} \label{new_methods_results} We evaluate the performance of the outdoor RTI method by post-processing all the RSS measurements collected during the deployment of the system. The system operated for approximately $8$ hours in a day with wind of varying intensity. During this time, the deployment area remained empty approximately $90$\% of times, while in the remaining $10$\% a person was present. The set $\mathcal{L}$ of the link-channel pairs selected and used for RTI is updated every two hours. Thus, $\mathcal{L}$ is updated a total of four times during the deployment. Each time, the system measures the RSS of all the link-channel pairs of the network for $5$ minutes. At the end of this interval, the link-channel pairs of the network are weighted and the most reliable selected. First, we evaluate the performance of the novel outdoor RTI method described in Section \ref{sec:multichannel_RTI}. We name the method \emph{$OUT^{+}$}. On average, only $12.8$\% of the link-channel pairs are selected, \emph{i.e.}, $\vartheta_e = 87.2$\%. When the deployment area is empty, the RTI system triggers two false alarms, detecting the presence of a person in the monitored area for $12$ s, \emph{i.e.}, a $0.04$\% false alarm rate. Instead, when a person is located in the monitored area area, the RMSE is $\bar{e}_m = 3.8$ m when the person is moving and $\bar{e}_s = 3.2$ m when the person does not move. \subsection{Modified Outdoor RTI Methods} \label{sec:OUT_modVersions} We now evaluate the performance of modified versions of the original outdoor RTI method \emph{$OUT^{+}$}. First, we extend the set of selected link-channel pairs $\mathcal{L}$ by considering for each link $l \in \mathcal{L}_s$ the RSS measurements collected on all the selected frequency channels (instead of considering only the frequency channel having the highest weight $\rho_{l,c}$). In this version of the outdoor RTI method (which we name \emph{$OUT^{w}$}), the change in RSS for link $l$ at time $k$ is calculated as: \begin{equation} \label{eq:weighted_RSSchange} y_l(k) = \frac{\sum_{c \in \mathcal{L}_s} \rho_{l,c} | r_{l,c}(k) - \bar{r}_{l,c}(k) |}{\sum_{c \in \mathcal{L}_s} \rho_{l,c}}, \end{equation} \emph{i.e.}, as the weighted average of the change in RSS measured on the selected frequency channels. This method that merges the RSS data collected for the same link on different frequency channels was originally introduced in \cite{MTT_Bocca_2013}. With \emph{$OUT^{w}$}, the system selects on average $32.8$\% of the link-channel pairs, \emph{i.e.}, $\vartheta_e = 67.2$\%, and has a $0.07$\% false alarm rate (two triggered false alarms, person detected in the deployment area for $18$ s). The RMSEs are $\bar{e}_m = 3.7$ m and $\bar{e}_m = 3.2$ m. Thus, the neglectable $0.1$ m improvement in $\bar{e}_m$ of \emph{$OUT^{w}$} over \emph{$OUT^{+}$} comes at 3the cost of a $20$\% higher energy consumption. Now, instead of deriving a node-specific path loss exponent, $\eta_n$ in (\ref{eq:Pd}), to estimate the fade level of the link-channel pairs, we derive a global path loss exponent for all the nodes, and we still apply the link-channel pairs selection procedure in Section \ref{links_sel_weighting}. This approach was applied in \cite{MultiScale_2013}. We name this modified version of the outdoor RTI method \emph{$COM^{+}$}. With \emph{$COM^{+}$}, $11.7$\% of the link-channel pairs are selected, \emph{i.e.}, $\vartheta_e = 88.3$\%, and the false alarm rate is $0.06$\% (two triggered false alarms, person detected in the deployment area for $16$ s). The RMSEs are $\bar{e}_m = 5.0$ m and $\bar{e}_m = 4.2$ m. Thus, deriving a global path loss exponent decreases the localization accuracy of the system by approximately $30$\% compared to deriving one for each node. Finally, in a version we name \emph{$COM^{w}$}, we still derive a global path loss exponent (as in \emph{$COM^{+}$}), but this time we apply the weighted average approach in (\ref{eq:weighted_RSSchange}) for estimating the change in RSS of the links. With \emph{$COM^{w}$}, the false alarm rate is $0.07$\% (two triggered false alarms, person detected in the deployment area for $17$ s), the percentage of selected link-channel pairs is $31.3$\%, \emph{i.e.}, $\vartheta_e = 68.7$\%, and the RMSEs are $\bar{e}_m = 4.9$ m and $\bar{e}_m = 4.1$ m. Results and characteristics of the outdoor RTI methods discussed above are summarized in Table \ref{t:RTI_methods_table} \subsection{Comparison with Previous RTI Methods} \label{comparison_results} We now evaluate the performance of the RTI methods in \cite{MTT_Bocca_2013} and \cite{MultiScale_2013} on the same RSS measurements used to derive the results in Section \ref{new_methods_results}. Both methods were developed for time invariant indoor environments. Thus, in order to fairly evaluate their performance, we adapt both methods to nonstationary outdoor environments by applying the reference RSS estimation method in Section \ref{online_RSS_change} and the people detection and tracking method in Section \ref{MTT_subsection}. Consider the method in \cite{MultiScale_2013}. The width $\lambda$ of the elliptical sensitivity area of the link-channel pairs of the network depends on both the fade level and the sign of the measured change in RSS. The fade level is estimated by deriving a global path loss exponent for all the nodes. The RSS variance of the link-channel pairs estimated in stationary conditions is not taken into consideration. We refer to this method as \emph{fade level-based}, or \emph{$FLB$}, and consider three different versions: \begin{itemize} \item[\emph{$FLB^U$}:]all the link-channel pairs are selected. \item[\emph{$FLB^w$}:] the link-channel pairs with an average RSS, estimated in stationary conditions, lower than $\Upsilon_r$ are discarded. Among the remaining ones, only the link-channel pairs having positive fade level are selected. The weighted average approach in (\ref{eq:weighted_RSSchange}) is applied. \item[\emph{$FLB^+$}:] the link-channel pairs with an average RSS, estimated in stationary conditions, lower than $\Upsilon_r$ are discarded. For each link, only the frequency channel with the maximum fade level is selected. \end{itemize} The results are listed in Table \ref{t:indoor_RTI_methods}. Differently than with the outdoor RTI method, the localization accuracy of the \emph{$FLB$} method in \cite{MultiScale_2013} decreases when fewer link-channel pairs are selected. This makes the \emph{$FLB$} method less energy-efficient than the proposed outdoor RTI method. Moreover, even when all the link-channel pairs are considered, as with \emph{$FLB^U$}, the localization accuracy is approximately $20$\% lower than with \emph{$OUT^+$}, which uses only $12.8$\% of the link-channel pairs. In comparison, with \emph{$FLB^+$}, \emph{i.e.}, the most energy efficient version using only $16.9$\% of the link-channel pairs, the localization accuracy is approximately $125$\% worse than with the corresponding outdoor method \emph{$OUT^+$}. As far as the false alarm rate is concerned, the three considered versions of the method in \cite{MultiScale_2013} have a considerably worse performance than the proposed outdoor RTI method: the false alarm rate is $0.74$\% with \emph{$FLB^U$} ($12$ triggered false alarms, person detected in the monitored area for more than three minutes), and $1.41$\% with \emph{$FLB^+$} ($27$ triggered false alarms, person detected in the monitored area for approximately six minutes). These results demonstrate that the method in \cite{MultiScale_2013} is prone to trigger several false alarms in a time-varying and multipath-rich outdoor environment due to the significant noise in the RSS measurements introduced by environmental factors. \begin{center} \begin{table}[t!] \caption{Summary of the performance of previous RTI methods} \centering \footnotesize \begin{tabular}{c | c c c c} \hline\hline METHOD & $\vartheta_e$ & False alarm rate [\%] & $\bar{e}_m$ [m] & $\bar{e}_s$ [m]\\ \hline \emph{$FLB^U$} & 0.0 & 0.74 & 4.3 & 4.1 \\ \hline \emph{$FLB^w$} & 55.0 & 0.89 & 6.1 & 7.2 \\ \hline \emph{$FLB^+$} & 83.1 & 1.41 & 7.2 & 8.6 \\ \hline \emph{$RFL^p$} & 25.0 & 0.92 & 5.6 & 6.9 \\ \hline \emph{$RFL^f$} & 50.0 & 0.95 & 5.6 & 6.5 \\ \hline \emph{$RFL^+$} & 78.8 & 1.19 & 6.1 & 7.3 \\ \hline \end{tabular} \label{t:indoor_RTI_methods} \end{table} \end{center} \begin{figure}[t!] \begin{center} \epsfig{figure=results_comparison.eps,width=\columnwidth} \caption{Comparison of the performance of the considered RTI methods, in terms of localization accuracy and energy efficiency. The RMSE reported in the plot is computed as the average of $\bar{e}_s$ and $\bar{e}_m$.} \label{fig:results_comparison} \end{center} \end{figure} We now consider the RTI method in \cite{MTT_Bocca_2013}. There, the \emph{relative} fade level of a link-channel pair $\{l,c\}$ is estimated as the difference between its average RSS estimated in stationary conditions, $\bar{r}_{l,c}$ and the lowest average RSS measured on the frequency channels in $\mathcal{C}$: \begin{equation} \label{eq:fade_level_MTT} F_{l,c} = \bar{r}_{l,c} - \min_{c \in \mathcal{C}} \bar{r}_{l,c}. \end{equation} Thus, $F_{l,c} \ge 0$, and $F_{l,c} = 0$ for one channel on each link. The RSS variance of the link-channel pairs estimated in stationary conditions is not taken into consideration. We refer to the RTI method in \cite{MTT_Bocca_2013} as \emph{relative fade level}, or \emph{RFL}, and consider three different versions: \begin{itemize} \item[\emph{$RFL^p$}:]the link-channel pairs with $F_{l,c} > 0$ are selected. The change in RSS of the links is estimated by applying the weighted average approach in (\ref{eq:weighted_RSSchange}). \item[\emph{$RFL^f$}:]the link-channel pairs with an average RSS, measured in stationary conditions, lower than $\Upsilon_r$ are discarded. Among the remaining ones, the link-channel pairs with $F_{l,c} > 0$ are selected. The weighted average approach in (\ref{eq:weighted_RSSchange}) is applied. \item[\emph{$RFL^+$}:] the link-channel pairs with an average RSS, measured in stationary conditions, lower than $\Upsilon_r$ are discarded. For each link, only the frequency channel with the maximum fade level is selected. \end{itemize} The results are summarized in Table \ref{t:indoor_RTI_methods}. Despite selecting more link-channel pairs, the three considered versions of the method in \cite{MTT_Bocca_2013} have a localization accuracy from $73$\% (with \emph{$RFL^f$}) to $91$\% (with \emph{$RFL^+$}) worse than that of the most energy efficient outdoor RTI method \emph{$OUT^{+}$}. In addition, the method in \cite{MTT_Bocca_2013} has a significantly higher false alarm rate ($0.92$\% with \emph{$RFL^p$}, $0.95$\% with \emph{$RFL^f$}, $1.19$\% with \emph{$RFL^+$}) than the proposed outdoor RTI method ($0.04$\% with \emph{$OUT^+$}). \subsection{Background Subtraction Contribution} \label{sec:back_sub_effect} \begin{figure}[t!] \begin{center} \epsfig{figure=back_sub.eps,width=\columnwidth} \caption{Cumulative distribution functions of $\bar{e}_s$ and $\bar{e}_m$ of the novel outdoor RTI method ($OUT^{+}$), both when the background subtraction algorithm detailed in Section \ref{sec:background_sub} is applied (solid lines) or not applied (dashed lines).} \label{fig:back_sub} \end{center} \end{figure} We now analyze the effects of the background subtraction algorithm detailed in Section \ref{sec:background_sub} on the localization accuracy of the outdoor RTI method (\emph{$OUT^{+}$}). Figure \ref{fig:back_sub} shows the cumulative distribution functions of $\bar{e}_s$ and $\bar{e}_m$, both when background subtraction is applied (solid lines) or not applied (dashed lines). Background subtraction increases the robustness of the motion detection and localization process to the RSS variation due to environmental factors, which would introduce spurious blobs in the estimated radio tomographic images. Consequently, by applying the background subtraction algorithm, the RTI system is overall more accurate, and does not incur in very high (\emph{i.e.}, above $10$ m) localization errors when links located far away from the current position of the target are affected by a consistent environmental noise. \begin{figure*}[t] \begin{center} \mbox{ \subfigure[]{\epsfig{figure=lambda_sens.eps,width=\columnwidth}} \quad \subfigure[]{\epsfig{figure=timeWindow_sens.eps,width=\columnwidth}} } \caption{Results of the sensitivity analysis of the energy-efficient outdoor RTI method (\emph{$OUT^{+}$}). In (a), the localization accuracy of the system with different values of $\lambda$, \emph{i.e.}, the width of the elliptical sensitivity area of the links. In (b), we modify the length of the time window used to determine the reference RSS of the links ($T_w$) and the length of the background image training period ($T_b$).} \label{fig:sens_analysis} \end{center} \end{figure*} \subsection{Sensitivity Analysis} \label{sens_analysis} We analyze the effect of three parameters in Table \ref{t:table_parameters} on the localization accuracy of the system. Figure \ref{fig:sens_analysis} shows how $\bar{e}_m$ and $\bar{e}_s$ are affected by $\lambda$, \emph{i.e.}, the width of the elliptical sensitivity area of the links, $T_w$, \emph{i.e.}, the length of the time window used to determine the reference RSS of the links, and $T_b$, \emph{i.e.}, the length of the background image training period. Simulations are performed by post-processing the RSS measurements collected during the deployment of the system when the person was located inside the monitored area. In the simulations, we set $T_w = T_b$. The results in Figure \ref{fig:sens_analysis} indicate that the proposed outdoor RTI method is robust to variations of the three considered parameters, as both $\bar{e}_m$ and $\bar{e}_s$ have a $12$\% maximum variation from the values reported in table \ref{t:RTI_methods_table}. \section{Conclusion} \label{sec:conclusion} In this paper, we present and evaluate a novel RTI method for accurately detecting and tracking people in nonstationary outdoor environments. An RTI system is composed of static RF sensors, communicating on multiple frequency channels in the $2.4$ GHz ISM band, which continuously measure the RSS of the links of the mesh network to estimate the change in the electromagnetic field of the monitored area introduced by the presence and movements of people. The outdoor RTI method described in this work makes the system robust to the time-varying environmental noise typical of harsh outdoor environments, \emph{i.e.}, the variation in RSS introduced by environmental factors such as wind-driven foliage, rainfalls, or snow. In addition, the proposed method improves the energy efficiency of the system by selecting only link-channel pairs which are reliable indicators of the presence of a person on the link line. To experimentally verify the performance of the outdoor RTI method, we deploy a RTI system in a large forested area. The results demonstrate that the novel outdoor RTI method minimizes the false alarm rate and reduces significantly the localization error (from $20$\% to $46$\%) and energy consumption (from $62$\% to $87$\%) compared to already existing indoor RTI methods, which we suitably adapted to the considered outdoor scenario to grant a fair comparison. In future works, we will focus on improving the energy efficiency of the RTI system by applying area coverage criteria to further reduce the set of selected link-channel pairs and by adaptively tuning the sampling frequency of the system based on the observed environmental conditions. In addition, we will investigate the robustness to environmental noise of other frequency bands (\emph{e.g.}, $433$ MHz and $900$ MHz).
{'timestamp': '2014-08-01T02:12:21', 'yymm': '1407', 'arxiv_id': '1407.8509', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8509'}
arxiv
\section{Introduction}\label{intro} Before the recent world economic crisis, the goal of a 23\% maximum global poverty rate established in the United Nations Millennium Development Goals for the year 2015 seemed to be easy to achieve and there was also a clear indication of progress in all the other goals. However, after the crisis and also due to the late environmental disasters such as the drought in East Africa, the situation regarding poverty is getting worse. A~reliable and detailed statistical measurement is certainly essential in the assessment of the well being of different regions, which will lead to the design of effective developmental policies. Often, national surveys are not designed to give reliable statistics at the local level. This is the case of the Spanish Survey on Income and Living Conditions (SILC), which is planned to produce estimates for poverty incidence at the Spanish Autonomous Communities (large regions), but it cannot provide estimates for Spanish provinces due to the small SILC sample sizes for some of the provinces. The population subdivisions, not necessarily geographical, which constitute the estimation domains, will be called in general ``areas.'' When estimating some aggregate characteristic of an area, a ``direct'' estimator is the one that uses solely the data from that area. These estimators are often design unbiased, at least approximately. However, they have overly large sampling errors for areas with small sample sizes. The areas with inadequate sample sizes are labeled as ``small areas.'' This problem has given rise to the development of the scientific field called small area estimation, which studies ``indirect'' estimation methods that ``borrow strength'' from related areas. Some of these methods are based on explicit models that link all areas through common parameters and making use of auxiliary information. Such model-based techniques are appealing because they provide estimators with high efficiency even under very small area-specific sample sizes. The monograph of \citet{Rao03} contains a comprehensive account of small area estimation techniques that appeared until the publication date; see \citet {JiaLah06}, \citet{Dat09} and \citet{Pfe13} for reviews of the more recent work. Small area models may be classified into two broad types: (i)~Area-level models that relate small area direct estimates to area-specific covariates, and (ii) Unit-level models that relate the unit values of a study variable to associated unit-specific covariates and possibly also area-specific covariates. So far, most of the model-based small area methods have focused on the estimation of totals and means, and nonlinear parameters have not received much attention. However, many poverty and inequality indicators are rather complex nonlinear functions of the income or other welfare measures of individuals; see, for example, \citet {NerBalBet05}. The main purpose of this paper is to develop a suitable method, based on the hierarchical Bayes approach, to handle general nonlinear parameters. We, however, focus on poverty indicators as particular cases due to the important socio-economic impact of this application. Hierarchical Bayesian models have been extensively used in small area estimation; see \citet{Rao03}, Chapter~10 and \citet{Dat09}. A~hierarchical Bayesian model can accommodate very complex models for the data based on very simple models as building blocks. For example, within the Bayesian paradigm, by making parameters stochastic, one can introduce an intracluster correlation and different sources of variability can be also incorporated. In small area estimation, the hierarchical Bayesian model provides the much needed ``borrowing of strength'' in a simple manner; see, for example, Nandram and Choi (\citeyear{autokey22}, \citeyear{NanCho10}), where hierarchical Bayesian models are used to study body mass index on the continuous scale. \citet{YouZho11} use a spatial hierarchical Bayes model in an application to health survey data. Finally, \citet{Mohetal12} study small area estimation of adult literacy in the U.S. using unmatched sampling and linking models, using hierarchical Bayes methods. In the context of poverty estimation, area-level models have been used to estimate the proportion of school age children under poverty at the county level under the SAIPE program (Small Area Income and Poverty Estimates) of the U.S. Census Bureau; for more details, see, for example, \citet{Bel} or the program webpage \url{http://www.census.gov/did/www/saipe/}. Using the Spanish SILC data, \citet{MolMor09} used an area-level model relating direct estimates of poverty proportions and poverty gaps (defined in Section~\ref{povindic}) to area covariates obtained from a much larger survey, the Labor Force Survey (LFS). In this application, the areas are the Spanish provinces. Results based on the empirical best (or Bayes) approach for this area-level model indicated only marginal gains in efficiency over direct estimates. Few approaches have appeared in the literature for efficient estimation of general nonlinear indicators using unit-level models. Here we discuss the most popular ones. The first one, due to \citet{ElbLanLan03}, is the method used by the World Bank (WB). This method was designed specially to deal with complex nonlinear poverty indicators. It assumes that the log incomes of the individuals in the population follow a unit-level model similar to the nested error linear regression model of \citet{BatHarFul88}, but including random effects for sampling clusters instead of area effects. After fitting the model to survey data, the WB method generates by bootstrap resampling a number of synthetic censuses making use of census auxiliary data and the fitted model. From each synthetic census, a poverty indicator of interest is computed for each small area. The average of the estimates over simulated censuses is then taken as the point estimate of the poverty indicator, and the variance of the estimates is taken as a measure of variability. The WB used the above simple method to produce poverty maps for many countries, by securing census auxiliary data and income data from a sample survey. In European countries, registers that provide unit-level population data may be obtained through collaboration with statistical offices. In Scandinavian countries and in Switzerland, continuously updated census auxiliary unit-level data are available through statistical offices. We emphasize that unit level auxiliary data for the population is needed to implement the WB method, based on a unit-level model, to estimate small area poverty indicators or other complex parameters; area means of the auxiliary variables would be sufficient in the case of estimating area means of a variable of interest. The second approach for estimation of general small area parameters, based on the empirical best/Bayes (EB) method, was recently introduced by \citet{MolRao10}. This method gives estimators with minimum mean squared error called best predictors or, more exactly, Monte Carlo approximations to the best predictors. This is done under the assumption that there exists a transformation of the incomes of individuals or another welfare variable used to measure poverty such that the transformed incomes follow the nested error regression model of \citet{BatHarFul88}. Mean squared errors of the EB estimators are estimated by a parametric bootstrap method. The method of \citet{MolRao10} also requires unit-level auxiliary data for the population. Both methods approximate an expected value by Monte Carlo, which requires generation of many full synthetic censuses that might be of huge size (e.g., over 43 million in the Spanish application of Section~\ref{FreVal}). In addition, the mean squared error is estimated using the bootstrap (or double bootstrap) in which the expected values need to be approximated for each bootstrap (or double bootstrap) replicate. The full procedure might be very intensive computationally and even may not be feasible for very complex poverty indicators such as those requiring sorting population elements or for very large populations such as Brazil or India. The hierarchical Bayes method is a good alternative to EB because it does not require the use of bootstrap for mean squared error estimation and it provides credible intervals and other useful summaries from the posterior distributions with practically no additional effort. We propose a very simple hierarchical Bayes (HB) approach that is computationally much more efficient than the alternative EB procedure. Only noninformative priors are considered to save us from the introduction of subjective information which might be controversial in official statistics applications. Moreover, using a particular reparameterization of the model and noninformative priors, we avoid the use of Markov chain Monte Carlo (MCMC) methods and therefore also the need for monitoring convergence of the Markov chains for each generated sample in the simulation studies, but ensuring propriety of the posterior under general conditions. In our simulations, this HB method provides point estimates that are practically the same as EB estimates and inferences that have frequentist validity. This frequentist validity gives a strong support to the use of the proposed HB method in practice. \section{Poverty indicators}\label{povindic} Certainly, poverty and income inequality are broad and complex concepts which cannot be easily summarized in one measure or indicator. In the literature there are many different indicators intending to summarize poverty or income inequality in one measure, each of them focusing on the measurement of particular aspects of poverty. For a summary of poverty and inequality indicators see, for example, \citet{NerBalBet05}. Basic poverty indicators are the head count ratio, referred to here as poverty incidence, which is simply the proportion of individuals with welfare measure under the poverty line, and the poverty gap, measuring the mean relative distance to the poverty line of the individuals with welfare measure under the poverty line. The class of poverty indicators introduced by \citet{FosGreTho84} contains the previous two as particular cases. Other measures include the Sen Index, the Fuzzy monetary and the Fuzzy supplementary poverty indicators [\citet{Betetal06}]. Practically all poverty measures are rather complex nonlinear functions of the income or some other welfare measure of individuals. We will introduce HB methodology that is suitable for the estimation of general nonlinear parameters, but we illustrate the procedure by applying it to particular indicators of interest, namely, the poverty incidence and the poverty gap as in \citet{MolRao10}. This will allow comparison with the EB method introduced in that paper.\looseness=-1 Let us consider a population of size $N$ that is partitioned into $D$ subpopulations of sizes $N_1,\ldots,N_D$ and called small areas. Let $E_{di}$ be a suitable quantitative measure of welfare for individual $i$ in small area $d$, such as income or expenditure, and let $z$ be the poverty line, that is, the threshold for $E_{di}$ under which a person is considered as ``under poverty.'' The family of poverty measures of \citet{FosGreTho84} for a small area $d$ may be expressed as \[ F_{\alpha d} =\frac{1}{N_d}\sum_{i=1}^{N_d} \biggl(\frac{z-E_{di}}{z} \biggr)^{\alpha }I(E_{di}<z),\qquad\alpha \geq0, d=1,\ldots,D, \] where $I(E_{di}<z)=1$ if $E_{di}<z$ or the person is under poverty and\break \mbox{$I(E_{di}<z)=0$} if $E_{di}\geq z$ or the person is not under poverty. Taking $\alpha=0$, we obtain the area poverty incidence, which measures the frequency of the poverty, and $\alpha=1$ leads to the area poverty gap, which quantifies the intensity of the poverty. \section{Hierarchical Bayes predictors of poverty indicators}\label{HBmethod} Estimation of the target area characteristics is based on a random sample drawn from the finite population according to a specified sampling design. Let $P$ denote the set of indices of the population units, $s$ be the set of units selected in the sample, of size $n<N$, and $r=P-s$ be the set of the units, with size $N-n$, that are not selected. Let $P_d$, $s_d$, $r_d$, $N_d$ and $n_d$ be, respectively, the set of population units, sample, sample complement, population size and sample size, restricted to area $d$. We allow zero sample sizes for some of the areas. Without loss of generality, we assume that those areas are the last $D-D^*$ areas, that is, $n_d>0$, for $d=1,\ldots,D^*$, where $D^*\leq D$, and $n_d=0$ for $d=D^*+1,\ldots,D$. Then the overall sample size is $n=n_1+\cdots+n_{D^*}$. For $d=D^*+1,\ldots,D$ with $n_d=0$, we have $s_d=\varnothing$ and $r_d=P_d$. To estimate $F_{\alpha d}$ efficiently for each area $d$, we assume that there are $p$ auxiliary variables related linearly to some one-to-one transformation $Y_{di}=T(E_{di})$ of the welfare variables. More concretely, we assume that the transformed population values $\{Y_{di};i=1,\ldots,N_d\}$ follow the nested error model \begin{equation} \label{origNEmodel} Y_{di}=\x_{di}'\bolds{ \beta}+u_d+e_{di},\qquad i=1,\ldots,N_d, d=1,\ldots,D, \end{equation} introduced by \citet{BatHarFul88}, where $\x_{di}$ is the $p\times1$ vector of auxiliary variables for unit $i$ within area $d$, $\bolds {\beta}$ is the $p\times1$ (constant) vector of regression coefficients associated with $\x_{di}$, $u_d$ is a random effect of area $d$, which models the unexplained between area variation, and $e_{di}$ is the individual model error. Area effects $u_d$ and errors $e_{di}$ given all parameters are independent and satisfy, respectively, $u_d|\sigma_u^2\stackrel{\mathrm{i.i.d.}}\sim N(0,\sigma _u^2)$ and $e_{di}|\sigma^2\stackrel{\mathrm{i.i.d.}}\sim N(0,\sigma ^2w_{di}^{-1})$, where $w_{di}>0$ is a known heteroscedasticity weight. In practice, these weights can be obtained from a preliminary modeling of error variances using variables different from those considered in the mean model as done in the WB method. We assume that the values of the auxiliary variables are known for all population units. {MCMC is a popular tool used to implement the HB method and software such as WinBUGS is readily available. However, running the Gibbs sampler requires monitoring the convergence by making a long run, thinning and performing convergence tests. In simulation studies, this monitoring process must be done for each simulated data set. Failing to do this carefully might lead to gross approximation of the desired quantities. Instead, making random draws directly from the posterior whenever possible avoids the need for monitoring the convergence and can therefore save a considerable amount of time.} Here we consider a particular reparameterization of the model which, together with noninformative priors, provides a generally proper posterior, and at the same time a way to skip MCMC procedures by randomly drawing from the posterior distribution using the chain rule of probability. The new reparameterization is based on expressing the model in terms of the intra-class correlation $\rho=\sigma_u^2/(\sigma_u^2+\sigma^2)$ as \begin{eqnarray} Y_{di}|u_d,\bolds{\beta},\sigma^2 &\stackrel{\mathrm{ind}}\sim& N\bigl(\x_{di}'\bolds{ \beta}+u_d,\sigma^2w_{di}^{-1}\bigr), \label{condit} \\ u_d|\rho,\sigma^2 &\stackrel{\mathrm{ind}}\sim& N \biggl(0, \frac{\rho}{1-\rho} \sigma^2 \biggr), \qquad i=1,\ldots, N_d, d=1,\ldots,D, \label{ud} \end{eqnarray} see, for example, \citet{TotNan10} for a similar formulation of the nested error model (\ref{origNEmodel}). We assume that the population model given by (\ref{condit}) and (\ref {ud}) holds for the sample units $s_d$ and for the out-of-sample units $r_d$; that is, the sampling design is noninformative and therefore sample selection bias is absent. We may also point out that the WB method implicitly assumes that the model fitted for the sample data also holds for the population in order to generate synthetic censuses of the variable of interest. \citet{PfeSve07} considered the estimation of small area means under informative sampling in the context of two-stage sampling. This method requires the modeling of sampling weights in terms of the variable of interest and auxiliary variables. It is not clear how this method may be extended to handle complex parameters such as poverty indicators and to other sampling designs. In the application with data from the Spanish SILC described in Section~\ref{applic}, we provide graphical diagnostics to check for informative sampling. Note that the untransformed welfare variables $E_{di}$ can be obtained from the model responses as $E_{di}=T^{-1}(Y_{di})$, where $T^{-1}(\cdot)$ denotes the inverse transformation of $T(\cdot)$. Then, the FGT poverty indicator $F_{\alpha d}$ is a nonlinear function of the vector $\y_d=(Y_{d1},\ldots,Y_{dN_d})'$ of response variables for area $d$. Thus, more generally, our aim is to estimate through the HB approach a general area parameter $\delta_d=h(\y_d)$, where $h(\cdot)$ is a measurable function. In the case of estimating particular area parameters $\delta_d$ that have social relevance such as poverty indicators or when the results are going to aid political decisions, the introduction of subjective informative priors might not be acceptable. For this reason, here we consider only noninformative priors for the unknown model parameters $(\bolds{\beta}',\sigma^2,\rho)$. Consider the following simpler situation, without covariates and with only one observation: \[ Y | \mu\sim N\bigl(\mu, \sigma^2\bigr),\qquad \mu\sim N\bigl(\theta, \delta^2\bigr). \] Now, let us define the intraclass correlation $\rho= \delta^2/(\delta^2 + \sigma^2)\in(0,1)$. By Bayes' theorem, the posterior density of $\mu$ is $\mu| Y \sim N\{\rho Y + (1-\rho)\theta, \rho\sigma^2\}$, which leads to the shrinkage or reference prior for $\rho$ given by $\rho\sim U(0,1)$; see \citet{NatKas00}. Shrinkage priors lead to good frequentist properties of HB inferences. In our model, to ensure propriety of the posterior of $\rho=\sigma_u^2/(\sigma_u^2+\sigma^2)$, we consider a uniform prior for $\rho$ in any closed interval of $(0,1)$, that is, in $[\varepsilon,1-\varepsilon]$, $\varepsilon>0$. In practice, taking $\varepsilon=0.0001$ should suffice; see, for example, Figure~\ref{PostRhoMales}. Next, consider the simpler model \[ Y | \sigma^2 \sim N\bigl(\mu, \sigma^2\bigr). \] Under this model, Jeffreys' reference prior for $\sigma^2$ is $\pi(\sigma^2) \propto1/\sigma^2$, $\sigma^2 > 0$. {Jeffreys' prior is said to be objective because it is the square root of Fisher's information. It has three important properties. First, it is invariant to one-to-one \mbox{transformations} of the parameter, which makes it convenient for scale parameters. Second, it is constructed using only the likelihood function and no other subjective judgement is needed. Third, it typically does not involve other hyperparameters requiring the specification of further priors. For these reasons, Jeffreys' prior is widely accepted in the literature.} Thus, for the unknown parameters $(\bolds{\beta}',\sigma^2,\rho)$ in~model (\ref{condit})--(\ref{ud}), we consider the noninformative prior \begin{equation} \label{prior} \pi\bigl(\bolds{\beta},\sigma^2,\rho\bigr) \propto \frac{1}{\sigma^2},\qquad{\varepsilon\leq\rho\leq1-\varepsilon, \sigma^2>0, \bolds{\beta} \in\RR^p}. \end{equation} Let $\mathbf{u}=(u_1,\ldots,u_D)'$ be the vector of random area effects and $\y=(\y_1',\ldots,\break \y_D')'$ the vector containing all the population response variables. Sorting by sample and out-of-sample units, this vector can be expressed as $\y=(\y_s',\y_r')'$, where $\y_s$ contains the elements of $\y$ corresponding to sample units and $\y_r$ to out-of-sample units. For convenience, we will use the notation $\btheta=(\mathbf{u}',\bolds {\beta}',\sigma^2,\rho)$. The above choice of priors allows us to avoid MCMC by using the chain rule of probability to represent the joint posterior density of $\btheta$ as follows: \begin{eqnarray}\label{post} && \pi\bigl(\mathbf{u},\bolds{\beta},\sigma^2,\rho|\y_s\bigr) \nonumber\\[-8pt]\\[-8pt] &&\qquad =\pi_1\bigl(\mathbf{u}|\bolds{\beta},\sigma^2,\rho,\y_s\bigr) \pi_2\bigl(\bolds{\beta}|\sigma^2,\rho,\y_s \bigr) \pi_3\bigl(\sigma^2|\rho,\y_s\bigr) \pi_4(\rho|\y_s).\nonumber \end{eqnarray} Here, $\pi_1(\mathbf{u}|\bolds{\beta},\sigma^2,\rho,\y_s)$, $\pi _2(\bolds{\beta}|\sigma^2,\rho,\y_s)$ and $\pi_3(\sigma^2|\rho,\y_s)$ in (\ref{post}) have simple closed forms, but $\pi_4(\rho|\y_s)$ is not simple; see Appendix~\ref{posterior}. However, random values from $\pi_4(\rho|\y_s)$ can be drawn using a grid method or an accept--reject algorithm; see Section~\ref{FreVal}. A similar drawing procedure using the chain rule was mentioned in \citet{Ber85}, Section~4.6. \citet{DatGho91} also used this analytical approach for HB estimation of small area means under linear mixed models, but employing gamma priors on the reciprocals of variance components. Lemma~\ref{le1app2} in Appendix~\ref{propriety} states that the posterior density in (\ref{post}) is proper provided that the matrix $X=\mathrm{col}_{1\leq d\leq D}\mathrm{col}_{i\in s_d} (\x_{di}')$ has full column rank and $\varepsilon\leq\rho\leq1-\varepsilon$, $\varepsilon>0$. Now since the model (\ref{condit}) holds for all the population units, given the vector of parameters $\btheta$ which includes area effects, out-of-sample responses $\{ Y_{di},i\in r_d\}$ are independent of sample responses $\y_s$ with \begin{equation} \label{predfdi} Y_{di}|\btheta\stackrel{\mathrm{ind}}\sim N\bigl( \x_{di}'\bolds{\beta}+u_d, \sigma^2w_{di}^{-1}\bigr),\qquad i\in r_d, d=1,\ldots,D. \end{equation} Consider the sample and out-of-sample decomposition of the area vector $\y_d=(\y_{ds}',\y_{dr}')'$. The posterior predictive density of $\y_{dr}$ is given by \[ f(\y_{dr}|\y_s)=\int\prod_{i\in r_d} f(Y_{di}|\btheta)\pi(\btheta|\y_s)\,d\btheta. \] The HB estimator of the target parameter $\delta_d=h(\y_d)$ is then given by the posterior mean \[ \hat\delta_d^{\mathrm{HB}} =E(\delta_d| \y_s)=\int h(\y_{ds},\y_{dr})f(\y_{dr}| \y_s)\,d \y_{dr}, \] which can be approximated by Monte Carlo. This approximation is obtained by first generating samples from the posterior $\pi(\btheta|\y_s)$. For this, we first draw $\rho$ from $\pi_4(\rho|\y_s)$, then $\sigma^2$ from $\pi_3(\sigma^2|\rho,\y_s)$, then $\bolds{\beta}$ from $\pi_2(\bolds{\beta}|\sigma^2,\rho,\y_s)$ and finally $\mathbf{u}$ from $\pi_1(\mathbf{u}|\bolds{\beta},\sigma^2,\rho,\y_s)$. We can repeat this procedure a large number, $H$, of times to get a random sample $\btheta^{(h)}$, $h=1,\ldots,H$ from $\pi(\btheta|\y_s)$. Then, for each generated $\btheta^{(h)}$, $h=1,\ldots, H$, from $\pi(\btheta|\y_s)$, we draw out-of-sample values $Y_{di}^{(h)}$, $i\in r_d$, $d=1,\ldots,D$, from the distribution in (\ref{predfdi}). Thus, for each sampled area $d=1,\ldots,D^*$, we have generated an out-of-sample vector $\y_{dr}^{(h)}=\{Y_{di}^{(h)}, i\in r_d\}$ and we have also the sample data $\y_{ds}$ available. Thus, we construct the full population vector $\y_d^{(h)}=(\y_{ds}',(\y_{dr}^{(h)})')'$. For each nonsampled area $d=D^*+1,\ldots,D$, the whole vector $\y _d^{(h)}=\y_{dr}^{(h)}$ is generated from (\ref{predfdi}) since in that case $r_d=P_d$. Using $\y_d^{(h)}$, we compute the area parameter $\delta_d^{(h)}=h(\y _d^{(h)})$, $d=1,\ldots,D$. In the particular case of estimating the FGT poverty measure $\delta _d=F_{\alpha d}$, using $\y_d^{(h)}$, we calculate \begin{equation} \label{MCF} F_{\alpha d}^{(h)} =\frac{1}{N_d} \biggl[\sum _{i\in s_d} \biggl(\frac{z-E_{di}}{z} \biggr)^{\alpha}I(E_{di}<z) + \sum_{i\in r_d} \biggl(\frac{z-E_{di}^{(h)}}{z} \biggr)^{\alpha }I\bigl(E_{di}^{(h)}<z\bigr) \biggr],\hspace*{-35pt} \end{equation} where $E_{di}=T^{-1}(Y_{di})$, $i\in s_d$ and $E_{di}^{(h)}=T^{-1}(Y_{di}^{(h)})$, $i\in r_d$, $d=1,\ldots,D$. Thus, in this way we have a random sample $\delta_d^{(h)}$, $h=1,\ldots,H$, from the posterior density of the target parameter $\delta_d$. Finally, the HB estimator $\hat \delta_d^{\mathrm{HB}}$, under squared loss, is the\vadjust{\goodbreak} posterior mean obtained by averaging $\delta_d^{(h)}$ over $h=1,\ldots,H$. As an uncertainty measure, we consider the posterior variance obtained as the variance of the $\delta_d^{(h)}$ values. Thus, \begin{equation} \label{MCest} \hat\delta_d^{\mathrm{HB}}=E(\delta_d| \y_s)\approx\frac{1}{H}\sum_{h=1}^H \delta_d^{(h)}, \qquad V(\delta_d| \y_s)\approx\frac{1}{H}\sum_{h=1}^H \bigl(\delta_d^{(h)}-\hat\delta_d^{\mathrm{HB}} \bigr)^2. \end{equation} Other useful posterior summaries such as credible intervals can be computed in a~straightforward manner. \begin{remark} When the target area parameter is computationally complex, such as indicators based on pairwise comparisons or sorting area elements, or when the population is too large, a faster HB approach can be implemented analogously to the fast EB\vadjust{\goodbreak} approach introduced in \citet{FerMol12}. For this, from each Monte Carlo population vector $\y_d^{(h)}$ we draw a sample $s_d^{(h)}$ using the original sampling design and, with this sample, we obtain a design-based estimator $\hat\delta_d^{(h)}$ of~$\delta_d^{(h)}$. This value would replace $\delta_d^{(h)}$ in (\ref{MCest}), that is, the estimator would be given by $\hat\delta_d^{\mathrm{FHB}}=H^{-1}\sum_{h=1}^H \hat\delta_d^{(h)}$. The posterior variance can be approximated similarly by $H^{-1}\sum_{h=1}^H (\hat\delta _d^{(h)}-\hat\delta_d^{\mathrm{FHB}} )^2$. \end{remark} \section{Model validation} In practice, results based on a model should be validated by analyzing how good the assumed model fits our data. Under the HB setup, several validation measures have been proposed in the literature. Here we consider the cross-validation approach advocated by \citet{GelDeyCha92}, based on looking at the predictive distribution of each observation when that observation has been deleted from the sample. As validation statistics, we consider the standardized cross-validation residuals used in a similar model to ours by \citet{NanSedPic00} and the conditional predictive ordinates defined by \citet{B80} and studied under normal distributions by \citet{Pet90}. Standardized cross-validation residuals are defined as \begin{equation} \label{delres} r_{di}=\frac{Y_{di}-E (Y_{di}|\y_{s(di)} )}{\sqrt {V(Y_{di}|\y _{s(di)})}}, \qquad i\in s_d, d=1,\ldots,D, \end{equation} where $\y_{s(di)}$ is the data vector excluding observation $Y_{di}$. Recently, \citet{Wanetal12} used these residuals for a similar assessment on an agricultural application. Interpretation of diagnostic plots obtained using these residuals needs to be cautious because by construction they are correlated. However, in the application of Section~\ref{applic}, diagnostic plots using these residuals look practically the same as those obtained from the usual frequentist residuals delivered by a maximum likelihood fit of the original nested error regression model (\ref{origNEmodel}). In the remainder of this section we explain how to obtain Monte Carlo approximations of the expected value and variance in (\ref{delres}). Following \citet{GelDeyCha92}, if we generate $H$ independent values $\btheta^{(h)}= ((\mathbf{u}^{(h)})',(\bolds{\beta}^{(h)})',\sigma ^{2(h)},\rho^{(h)})'$, $h=1,\ldots,H$, from the posterior density given all the data, $\pi(\btheta|\y_s)$, the posterior expectation in (\ref{delres}) can be approximated by a weighted average as \begin{eqnarray*} E (Y_{di}|\y_{s(di)} ) &=& \int E (Y_{di}|\y _{s(di)},\btheta)\pi(\btheta|\y_{s(di)}) \,d\btheta \\ &=& \int\bigl\{\x_{di}'\bolds{\beta}+u_d \bigr\}\pi(\btheta|\y_{s(di)}) \,d\btheta \\ &\approx& \sum_{h=1}^H \bigl\{ \x_{di}'\bolds{\beta}^{(h)}+u_d^{(h)} \bigr\} v_{di}^{(h)},\qquad i\in s_d, d=1,\ldots,D. \end{eqnarray*} Here, the weights $v_{di}^{(h)}$ are given by \begin{equation} \label{vdi} v_{di}^{(h)}= \Biggl[f\bigl(Y_{di}| \btheta^{(h)}\bigr)\sum_{k=1}^H \bigl\{ f\bigl(Y_{di}|\btheta^{(k)}\bigr) \bigr \}^{-1} \Biggr]^{-1}, \end{equation} where $f(Y_{di}|\btheta)$ is the normal density indicated in (\ref{condit}). This has been obtained from the fact that, given $\btheta$, all observations are independent and distributed as indicated in (\ref{predfdi}), using Bayes' theorem and taking into account that $f(\y_s|\btheta)=f(\y_{s(di)}|\btheta)f(Y_{di}|\btheta)$; for more details see Appendix~\ref{Appendix3}. To obtain the posterior variance $V(Y_{di}|\y _{s(di)})=E(Y_{di}^2|\y_{s(di)})-E^2(Y_{di}|\y_{s(di)})$, the expectation $E(Y_{di}^2|\y_{s(di)})$ can be approximated similarly, by \begin{eqnarray*} E \bigl(Y_{di}^2|\y_{s(di)} \bigr) &=& \int E \bigl(Y_{di}^2|\y_{s(di)},\btheta\bigr)\pi(\btheta| \y_{s(di)}) \,d\btheta \\ &=& \int\bigl\{\sigma^2w_{di}^{-1}+\bigl( \x_{di}'\bolds{\beta}+u_d\bigr)^2 \bigr\}\pi(\btheta|\y_{s(di)}) \,d\btheta \\ &\approx& \sum_{h=1}^H \bigl\{ \sigma^{2(h)}w_{di}^{-1}+\bigl(\x_{di}' \bolds{\beta}^{(h)}+u_d^{(h)}\bigr)^2 \bigr\} v_{di}^{(h)},\qquad i\in s_d. \end{eqnarray*} To further assess the model, we use the conditional predictive ordinates (CPOs). For observation $Y_{di}$, the CPO is defined as the predictive density of $Y_{di}$ given the sample data with that observation deleted, that is, \[ \mathrm{CPO}_{di}=f(Y_{di}|\y_{s(di)})=\int f(Y_{di}|\y_{s(di)},\btheta)\pi(\btheta|\y_{s(di)}) \,d \btheta. \] Using similar arguments as those in Appendix~\ref{Appendix3}, it is easy to see that the CPO can be obtained as \[ \mathrm{CPO}_{di}= \biggl\{\int\frac{\pi(\btheta|\y _{s(di)})}{f(Y_{di}|\btheta)} \,d\btheta\biggr \}^{-1}\approx\Biggl\{\frac{1}{H}\sum _{h=1}^H \frac {1}{f(Y_{di}|\btheta^{(h)})} \Biggr\}^{-1}. \] Small values of $\mathrm{CPO}_{di}$ point out to observations that are surprising in light of the knowledge of the other observations [\citet{Pet90}; \citet{Ntz09}]. \section{Simulation study}\label{FreVal} The great social relevance of poverty estimation obliges us to use methods that are widely accepted beyond the Bayesian community. The EB estimators introduced in \citet{MolRao10} are highly efficient (approximately the ``best'' according to mean squared error) under the assumed \mbox{frequentist} model. It raises the question whether the HB procedure introduced in Section~\ref{HBmethod} also offers good frequentist properties. To answer this question, a simulation experiment was conducted under the frequentist setup. In this simulation study, HB \mbox{estimators} of poverty incidence and gap are compared with the alternative EB estimators of \citet{MolRao10}. For this, unit level data were generated similarly as in \citet{MolRao10}. The population was composed of $N={}$20,000 units distributed in $D=80$ areas with $N_d=250$ units in each area, $d=1,\ldots,D$. Imitating a situation in which only categorical auxiliary variables are available, as in the application with Spanish data described in Section~\ref{applic}, we considered two dummies $X_1$ and $X_2$ as explanatory variables in the model, apart from the intercept. The population values of these variables were generated as $X_k\sim \operatorname{Bin}(1,p_{kd})$, $k=1,2$, with success probabilities $p_{1d}=0.3+0.5 d/D$ and $p_{2d}=0.2$, $d=1,\ldots,D$, and held fixed. We took $\bolds{\beta }=(3,0.03,-0.04)'$, $\sigma^2=0.5^2$ and $\rho=0.82$, so that $\sigma_u^2=0.15^2$ as in \citet{MolRao10}. Then, using the population values of the auxiliary variables, population responses were generated from (\ref {condit})--(\ref{ud}) with $w_{di}=1$ for all $i$ and $d$. The poverty line is taken as $z=12$. This value is roughly equal to 0.6 times the median welfare for a population generated as described before, which is the official poverty line used in EU countries. With this poverty line, the population poverty incidence is about 16\%. A sample $s_d$ of size $n_d=50$ is drawn by simple random sampling without replacement from area~$d$, for $d=1,\ldots,D$, independently for all areas. Let $s=\bigcup_{d=1}^D s_d$ be the whole sample and let $(\y _s,\X_s)$ be the sample data. For a given population and sample generated as described above, HB estimates were computed as follows. Generate $H=1000$ independent samples from the posterior predictive distribution of $F_{\alpha d}$ by implementing the following steps, where new notation is defined in Appendix~\ref{posterior}: \begin{longlist}[(3)] \item[(1)] \textit{Generation of intra-class correlation coefficient} $\rho^{(h)}$: Take a grid of \mbox{$R=1000$} points in the interval $[\varepsilon,1-\varepsilon]$, for $\varepsilon=0.0005$, \[ \rho_r=(r-0.5)/R,\qquad r=1,\ldots,R-1. \] Let us define the kernel of the posterior density of $\rho$ as \[ k_4(\rho)= \biggl(\frac{1-\rho}{\rho} \biggr)^{D/2}\bigl| \mathbf{Q}(\rho)\bigr|^{-1/2}\gamma(\rho)^{-(n-p)/2}\prod _{d=1}^D \lambda_d^{1/2}( \rho). \] Calculate $k_4(\rho_r)$, $r=1,2,\ldots,R-1$ and take \[ \pi_4(\rho_r)=\frac{k_4(\rho_r)}{\sum_{r=1}^R k_4(\rho_r)},\qquad r=1,2,\ldots,R-1. \] Then generate $\rho^{(h)}$ from the discrete distribution $\{\rho_r,\pi_4(\rho_r)\}_{r=1}^{R-1}$. Since these generated values are discrete, jitter each generated value by adding to it a uniform random number in the interval $(0,1/R)$. \item[(2)] \textit{Generation of error variance}: First draw $\sigma^{-2(h)}$ from the distribution \[ \sigma^{-2(h)}|\rho,\y_s \sim\operatorname{Gamma} \biggl( \frac{n-p}{2}, \frac{\gamma^{(h)}}{2} \biggr), \] where $\gamma^{(h)}=\gamma(\rho^{(h)})$. Then, take $\sigma^{2(h)}=1/\sigma^{-2(h)}$. \item[(3)] \textit{Generation of regression coefficients}: Draw $\bolds {\beta}^{(h)}$ from the distribution \[ \bolds{\beta}^{(h)}|\sigma^{2(h)},\rho^{(h)}, \y_s\sim N \bigl(\hat{\bolds{\beta}}^{(h)}, \sigma^{2(h)}\bigl(\mathbf{Q}^{(h)}\bigr)^{-1} \bigr), \] where $\hat{\bolds{\beta}}^{(h)}=\hat{\bolds{\beta}}(\rho^{(h)})$ and $\mathbf{Q}^{(h)}=\mathbf{Q}(\rho^{(h)})$. \item[(4)] \textit{Generation of random area effects}: Draw $\{u_d^{(h)};d=1,\ldots,D\}$ from \[ u_d^{(h)}|\bolds{\beta}^{(h)}, \sigma^{2(h)},\rho^{(h)},\y_s \stackrel{\mathrm{ind}}\sim N \biggl[\lambda_d^{(h)}\bigl(\bar y_d-\bar \x_d'\bolds{\beta}^{(h)}\bigr),\bigl(1- \lambda_d^{(h)}\bigr)\frac{\sigma ^{2(h)}\rho^{(h)}}{1-\rho^{(h)}} \biggr], \] where $\lambda_d^{(h)}=\lambda_d(\rho^{(h)})$, $d=1,\ldots,D$. \item[(5)] \textit{Generation of out-of-sample elements}: Draw $Y_{di}^{(h)}$, $i\in r_d$, from their distribution given all parameters $\btheta^{(h)}=(u_1^{(h)},\ldots,u_D^{(h)},\bolds{\beta}^{(h)},\sigma ^{2(h)}\rho^{(h)})'$, given by \[ Y_{di}^{(h)}|\y_s,\btheta^{(h)}\sim N \bigl(\x_{di}'\bolds{\beta}^{(h)}+u_d^{(h)}, \sigma^{2(h)}\bigr),\qquad i\in r_d. \] Then $\y_{rd}^{(h)}=\{Y_{di}^{(h)}; i\in r_d\}$ is the vector containing all generated out-of-sample elements from domain $d$, $d=1,\ldots,D$. \item[(6)] \textit{Calculation of poverty indicator}: Consider the vector with sample elements attached to generated out-of-sample elements from domain $d$, $\y_d^{(h)}=(\y_{sd}',(\y_{rd}^{(h)})')'$. Calculate the poverty indicator for domain $d$ as in (\ref{MCF}) using $\y_d^{(h)}$, $d=1,\ldots,D$. \end{longlist} At the end of steps (1)--(6), we get a sample of independent values $F_{\alpha d}^{(h)}$, $h=1,\ldots,H$. Finally, compute the posterior mean and the posterior variance as indicated in (\ref{MCest}). A total of $I=1000$ population vectors $\y^{(i)}$ were generated from the true model described above. For each population $i=1,\ldots,I$, the following process was repeated: first, we calculated true area poverty incidences and gaps; then, we selected the population elements corresponding to the sample indices, assuming that those sample indices are constant over Monte Carlo simulations, that is, following a strictly model-based approach. Using the sample elements, we computed EB estimates following the procedure in \citet{MolRao10}, and HB estimates using the approach described in (1)--(6). \begin{figure \includegraphics{702f01.eps} \caption{On the left, means $\times$100 over simulated populations of HB estimates of poverty incidence $F_{0 d}$ against the analogous means for EB estimates, for each area $d$. On the right, mean squared errors ${\times}$10$^4$ of HB estimators against those of EB estimators.}\label{plotDispPI} \end{figure} The left panel of Figure~\ref{plotDispPI} displays means over Monte Carlo replicates of HB estimates of poverty incidences for each area against corresponding means of EB estimates. The right panel gives the frequentist mean squared errors of HB\vadjust{\goodbreak} estimates against those of EB estimates for each area. Thus, from a frequentist point of view, we can see that the two estimators are practically the same, probably because only noninformative priors have been considered. The true mean squared errors of EB estimators are slightly smaller than those of HB estimates, which is somewhat sensible since the EB estimates are approximately the best under the frequentist paradigm. Figure~\ref{plotDispPG} shows similar results for the poverty gap. Both figures show that the HB estimates display good frequentist properties. In addition to point estimates, the HB approach can also deliver credible intervals. It is interesting to see whether these intervals satisfy the basic frequentist property of covering the true value. The left panel of Figure~\ref{plotCoverPI} displays the frequentist coverage of 95\% credible intervals for the area poverty incidences, calculated as a percentage of Monte Carlo replicates in which credible intervals contain true values. We have plotted the coverages of equal tails credible intervals together with those of highest probability density intervals [\citet{CheSha99}]. This figure reveals a slight undercoverage of less than 1\% for the two types of intervals. The estimated coverage of credible intervals with only $H=1000$ replicates might not be very accurate, so we guess that a larger $H$ could show a smaller undercoverage. On the right panel of the same figure we report the mean widths of the two types of intervals. As expected, the highest posterior density intervals are clearly narrower. Similar conclusions can be drawn from Figure~\ref{plotCoverPG} for the poverty gap. \begin{figure}[t] \includegraphics{702f02.eps} \caption{On the left, means $\times$100 over simulated populations of HB estimators of the poverty gap $F_{1 d}$ against the analogous means for EB estimators, for each area $d$. On the right, mean squared errors ${\times}$10$^4$ of HB estimators against those of EB estimators.}\label{plotDispPG} \end{figure} \begin{figure}[b] \includegraphics{702f03.eps} \caption{Percent coverage, left panel, and mean widths, right panel, over Monte Carlo populations of equal tails and highest posterior density intervals for poverty incidence $F_{0 d}$ for each area $d$.}\label{plotCoverPI} \end{figure} \begin{figure}[t] \includegraphics{702f04.eps} \caption{Percent coverage, left panel, and mean widths, right panel, over Monte Carlo populations of equal tails and highest posterior density credible intervals for poverty gap $F_{1 d}$ for each area $d$.}\label{plotCoverPG} \end{figure} \begin{figure}[b] \includegraphics{702f05.eps} \caption{Mean over Monte Carlo simulations of CVs of HB estimators of poverty incidence (left panel) and poverty gap (right panel).}\label{plotCVPIPG} \end{figure} Finally, to analyze the effect of the sample size on the performance of the HB estimators, a new simulation experiment was conducted with increasing area sample sizes $n_d$ in the set $\{20, 30, 40, 50\}$, with each value repeated for 20 areas and with a total number of areas $D=20\times4=80$ as before. In this experiment we omitted the covariates that could distort the results and consider only a mean model with intercept $\bolds{\beta}_0=3$ as before. Figure~\ref{plotCVPIPG} plots the mean coefficients of variation (CVs) of HB estimators of poverty incidences and poverty gaps. The estimated CV of an HB estimator is taken as the square root of the posterior variance divided by the estimate. Observe that, on average, the CVs increase about 3\% when decreasing the area sample size in 10 units. Moreover, in this simulated example, it turns out that at least $n_d=50$ units need to be observed in area $d$ to keep the CV of HB estimators of poverty incidences below 20\%. For the poverty gap, which is more difficult to estimate, the same sample size ensures a maximum CV of~25\%. \section{Poverty mapping in Spain}\label{applic} This section describes an application of the proposed HB method to poverty mapping in Spanish provinces by gender. The data come from the SILC conducted in Spain in year 2006 and is the same used by \citet{MolRao10}. The SILC collects microdata on income, poverty, social exclusion and living conditions, in a timely and comparable way across European Union (EU) countries. The results of this survey are then used for the structural indicators of social cohesion such as poverty incidence, income quintile share ratio and gender pay gap. Indeed, equality between women and men is one of the EU's founding values; see, for example, \url{http://ec.europa.eu/justice/gender-equality/}. Thus, the EU is especially concerned about gender issues, fostering research devoted to the quantification or measurement of equality. For example, one of the commitments of the SAMPLE project funded by the European Commission (\url{http://www.sample-project.eu/}) was to obtain poverty indicators in Spanish provinces by gender. The Spanish SILC survey design is as follows. An independent sample is drawn from each of the Spanish Autonomous Communities using a two-stage design with stratification of the first stage units. The first stage or primary sampling units are census tracks and they are grouped into strata according to the size of the municipality where the census track is located. Census tracks are drawn within each stratum with probability proportional to their size. The secondary sampling units are main family dwellings, which are selected with equal probability and with random start systematic sampling. Within those last stage units, all individuals with usual residence in the dwelling are interviewed. This procedure results in self-weighted samples within each stratum. This survey is planned to provide reliable estimates only for the overall Spain and for the Autonomous Communities which are large Spanish regions, but it cannot deliver efficient estimates for the Spanish provinces disaggregated by gender due to the small sample size (provinces are nested within Autonomous Communities). Therefore, small area estimation techniques that ``borrow strength'' from other provinces are needed. The HB methodology proposed in this paper allows us to produce efficient estimates of practically any poverty indicator for the Spanish provinces by gender, using a computationally fast procedure, and provides at the same time all pertinent output such as uncertainty measures and credible intervals.\looseness=-1 In this application, the target domains are the $D=52$ Spanish provinces. Since many studies on poverty in developing countries point to more severe levels of poverty for females than for males, it is very important to analyze if this happens in Spain as well. Thus, we are interested in giving estimates also by gender. To this end, we applied the HB procedure described in Section~\ref{FreVal} separately for each gender, obtaining estimates of poverty incidences and gaps for the Spanish provinces, together with 95\% highest posterior density intervals. The HB procedure was applied with a grid of $R=1000$ values of $\rho$ and $H=1000$ Monte Carlo replicates. For comparison, the EB method of \citet{MolRao10} was also applied separately for each gender. Since this method is computationally slower, we considered only $L=50$ Monte Carlo simulations as in \citet{MolRao10}. The parametric bootstrap approach proposed in the same paper for mean squared error (MSE) estimation of EB estimates was applied with $B=200$ bootstrap replicates. The overall sample size is 16,650 for males and 17,739 for females. The population size is 21,285,431 for males and 21,876,953 for females, with a total population size of over 43 million. We considered the same auxiliary variables as in \citet{MolRao10}, namely, the indicators of five quinquennial age groups, of having Spanish nationality, of the three levels of the variable education level, and of the three categories of the variable labor force status, ``unemployed,'' ``employed'' and ``inactive.'' For each auxiliary variable, one of the categories was considered as base reference, omitting the corresponding indicator and including an intercept in the model. When making use of continuous covariates, all the methods (HB, EB and WB) require a full census of those covariates. In this application, however, only dummy indicators were included in the model and, therefore, only the counts of people with the same vector of $x$-values are needed. However, to make the computations as general as possible, we imitated the case of having continuous covariates by constructing the full census matrices $\X_d=(\x_{d1},\ldots,\x_{dN_d})'$. This was done using the data from the Spanish Labour Force Survey (LFS), which has a much larger sample size than the SILC (155,333 as compared with 34,389) and therefore offers information with much better quality. Each LFS vector $\x_{di}'$ was replicated a number of times equal to its corresponding LFS sampling weight; the resulting matrix $\X_d$ may be treated as a proxy of the true census matrix. As noted in Section~\ref{intro}, the WB was able to secure true census matrices $\X_d$ from statistical offices of many countries. The welfare variable provided by the SILC for each individual and used to measure poverty by the Spanish Statistical Institute (INE in Spanish) and also by the European Statistical Office Eurostat is the so-called equivalized annual net income, which is the household annual net income, divided by a measure of household size calculated according to the scale defined by the OCDE. The resulting quantity can be interpreted as a kind of per capita income and for this reason it is assigned to each household member. Using instead the total household income would require the definition of a different poverty line for each possible household size and would not allow us to estimate by gender. For this reason, in this application we consider that the units are the individuals and, as welfare measure $E_{di}$, we consider the equivalized annual net income. Due to the clear right skewness of the histogram of $E_{di}$ values, we consider the transformation $Y_{di}=T(E_{di})=\log(E_{di}+c)$, where $c\geq\max\{0,-\min(E_{dj})+1\}$ is a constant selected in such a way that all shifted incomes $E_{di}+c$ are positive (there are few negative $E_{di}$) and for which the distribution of model residuals is closest to being symmetric. To select $c$, we took a grid of points in the range of income values and the model was fitted for each point in the grid. Then $c$ was selected as the point in this grid for which Fisher's asymmetry coefficient of model residuals (third order centered sample moment divided by the cube standard deviation) was closest to zero. It turned out to be exactly the same value in the two models for Males and Females. \begin{figure} \includegraphics{702f06.eps} \caption{Posterior density of $\rho$ in the model for males, left panel, and females, right panel, obtained drawing from a grid in $[\varepsilon,1-\varepsilon]$ with $\varepsilon =0.0001$.}\label{PostRhoMales} \end{figure} \begin{figure} \includegraphics{702f07.eps} \caption{Histograms of posterior distributions of poverty incidences, upper panel, and poverty gaps, lower panel, for areas $d=1,2,3,4$, respectively, in columns, for females.}\label{HistPostDist} \end{figure} Since samples are drawn independently for each of the 18 Autonomous Communities and these regions might have different socio-economic levels, trying to accommodate the sampling design, we also fitted a model with Autonomous Community effects. However, the goodness of fit of the model including these effects, as measured by AIC and BIC, became worse for the two genders. Thus, we consider a more parsimonious model without Autonomous Community effects. Figure~\ref{PostRhoMales} shows the posterior density of the intraclass correlation $\rho$ obtained in the models for males and females, using a grid of 5000 values of $\rho$ in the interval $[0.0001,0.9999]$. The two plots show that the mass of the posterior density of $\rho$ is mostly concentrated in $[0.04,0.1]$ and, therefore, the use of the truncation point $\varepsilon =0.0001$ in the two extremes of the range of $\rho$ to ensure a proper posterior does not have any effect in this application. In fact, trying to analyze the sensitivity to varying $\varepsilon$, we also used $\varepsilon=0.001$ and $\varepsilon=0.005$ and we found virtually no difference in the resulting posterior densities of $\rho$. \begin{figure \includegraphics{702f08.eps} \caption{Hierarchical Bayes estimates of poverty incidences with highest posterior density intervals for each gender and for each area $d$. Areas are sorted by increasing sample size.}\label{plotHPDintprop} \end{figure} \begin{figure \includegraphics{702f09.eps} \caption{Hierarchical Bayes estimates of poverty gaps with highest posterior density intervals for each gender and for each area $d$. Areas are sorted by increasing sample size.}\label{plotHPDintgap} \end{figure} \begin{figure \includegraphics{702f10.eps} \caption{Hierarchical Bayes estimates of poverty incidence $F_{0 d}$, left panel, and of poverty gap $F_{1 d}$, right panel, against direct estimates for each province $d$.}\label{plotDispHBdir} \end{figure} Figure~\ref{HistPostDist} shows the histograms of the posterior distributions of poverty incidences, upper panel, and poverty gaps, lower panel, for the first 4 provinces in the alphabetical order, in the model for females. Note that these histograms are slightly skewed. Therefore, we considered highest posterior density intervals instead of credible intervals with equal probability tails. These intervals were computed as described in \citet{CheSha99}. Figure~\ref{plotHPDintprop} plots HB estimates of poverty incidences together with their corresponding 95\% highest posterior density intervals for each gender and for each province, with areas sorted by increasing sample size. This figure shows that the length of the intervals decreases as the area sample sizes increase, as expected. It also shows that the estimated poverty incidences for males are smaller than for females for most provinces, although the two corresponding intervals cross each other for practically all provinces. Concerning the poverty gap, which measures the degree of poverty instead of the frequency of poor, Figure~\ref{plotHPDintgap} shows a very similar pattern, with point estimates for females larger than for males in most provinces. \begin{figure}[t] \includegraphics{702f11.eps} \caption{Hierarchical Bayes estimates of poverty incidence $F_{0 d}$, left panel, and of poverty gap $F_{1 d}$, right panel, against EB estimates for each province $d$.}\label{plotDispHBEB} \end{figure} \begin{figure}[b] \includegraphics{702f12.eps} \caption{Posterior variances of HB estimators and bootstrap mean squared errors of EB estimators of poverty incidence for each province for males, left panel, and females, right panel. Provinces sorted by increasing sample size.}\label{ErrorMeasure} \end{figure} \begin{figure} \includegraphics{702f13.eps} \caption{Coefficients of variation of direct estimates of poverty incidence $F_{0 d}$, left panel, and of poverty gap $F_{1 d}$, right panel, against coefficients of variation of HB estimates for each province $d$.}\label{plotCVDirecHB} \end{figure} Figure~\ref{plotDispHBdir} plots HB estimates of poverty incidence, left panel, and of poverty gap, right panel, against direct estimates for each area $d$, using separate plotting symbols for each gender. Observe that all points lie around the line, except for one of them corresponding to the poverty gap for women. This point is separated from the line because its direct estimate is much larger than the HB estimate. This occurs because HB estimates shrink extreme direct estimates toward synthetic regression ones for areas with small sample size. Figure~\ref{plotDispHBEB} plots HB estimates of poverty incidence, left panel, and of poverty gap, right panel, against EB estimates for each gender and for each province. Observe that HB estimates are practically equal to the corresponding EB estimates. Thus, in this application the point estimates obtained by the HB method proposed in this paper agree to a great extent with those obtained by the EB method. Turning to the measures of variability of EB and HB estimators, Figure~\ref{ErrorMeasure} compares the estimated MSEs of the EB estimators obtained by the parametric bootstrap described in \citet{MolRao10}, with the posterior variances. Although in principle these measures are not strictly comparable, it is interesting to see their similarity, and this similarity increases for areas with larger sample sizes. Concerning computational efficiency, in this application, the full EB procedure consisting in the Monte Carlo approximation of the EB estimator with $L=50$ Monte Carlo replicates and the bootstrap method for MSE estimation with $B=200$ bootstrap replicates took 44.2 hours in a 2.67~GHz PC, whereas the HB procedure takes 3.7 hours. If we wanted the bootstrap MSE estimates to have comparable precision as the HB posterior variances and take $B=H=1000$ bootstrap replicates, the computational time of the full EB method in this application would be over 9 nonstop days on the same computer. Use of double bootstrap for bias reduction of the bootstrap MSE estimator would increase the computational complexity manyfold. Thus, for a larger number of auxiliary variables $p$, larger population size or a more complex indicator, computational times might be considerable for the EB method and in those cases the HB method represents a much faster alternative. To see more clearly the efficiency gain of the HB estimates over direct estimates, in Figure~\ref{plotCVDirecHB} we plot the estimated CVs of direct estimators against those of HB estimators for all provinces. Observe that the CVs of direct estimators are above the 45$^\circ$ line for all the provinces, indicating that HB estimates are more precise than direct estimates for all the provinces. Moreover, the gains are larger for provinces with smaller sample sizes and can be considerably large for some of the provinces. In contrast, the results obtained by \citet{MolMor09} under an area-level model using the aggregated values of the same covariates provided only marginal reductions in the CVs over direct estimates. \begin{figure}[t] \includegraphics{702f14.eps} \caption{Index plot of standardized residuals for males, left panel, and females, right panel.}\label{StdDelRes} \end{figure} \begin{figure}[b] \includegraphics{702f15.eps} \caption{Standardized residuals against predicted values by cross-validation, for males, left panel, and females, right panel.}\label{StdDelResPred} \end{figure} We have also done some diagnostic checks of the model assumptions using the cross-validation residuals $r_{di}$ introduced in (\ref{delres}). Index plots of residuals for males and females are included in Figure~\ref{StdDelRes}. In Figure~\ref{StdDelResPred} we show the plots of standardized cross-validation residuals against predicted values. The points that appear aligned at the bottom correspond to a number of zero incomes. Apart from this fact, we can see that the plots look acceptable without any visible pattern. Concerning CPOs, Figure~\ref{CPOobs} plots these validation measures against observed values $Y_{di}$ for males and females. As expected, there is high predicted power near the center of the data. The percentage of observations with CPO values below 0.025 turns out to be 1.5\% for females and 1.2\% for males, and the percentage below 0.014 (extreme outliers) is 0.9\% for females and 0.8\% for males. These results do not show any indication of serious departure from model assumptions; see \citet{Ntz09}. \begin{figure}[t] \includegraphics{702f16.eps} \caption{CPOs against observed values $Y_{di}$ for males, left panel, and females, right panel.}\label{CPOobs} \end{figure} \begin{figure} \includegraphics{702f17.eps} \caption{Standardized residuals against sampling weights in the range 0--2000, for males, left panel, and females, right panel.}\label{ResidSamplingWeights} \end{figure} Note that in this method, as in any other small area estimation procedure based on a unit-level model, the model is assumed not only for the sample units but also for the out-of-sample units. This assumption is reasonable as long as the design is noninformative, that is, the inclusion probabilities of the units in the sample are not related to the study variable (income) after accounting for the auxiliary variables. The SILC data contains the sampling weights or inverses of inclusion probabilities corrected for calibration and nonresponse. If the design is informative, model residuals should be related somehow with sampling weights. Thus, to analyze whether there is any evidence of informative sampling, in Figure~\ref{ResidSamplingWeights} we have plotted cross-validation residuals $r_{di}$ versus sampling weights for males (left) and females (right) in the range 0--2000. There are sampling weights greater than 2000, but since the distribution is clearly right skewed with less large weights, for clarity of the plots we have plotted here the main part of the distribution. The null pattern of these plots indicate no evidence of informative sampling in this application. Table~\ref{TablePI} reports results obtained from the estimation of the poverty incidence, for provinces with sample sizes closest to minimum, first quartile, median, third quartile and maximum, for females and males. See that the posterior coefficient of variation is below 20\% even for the area with smallest sample size, the province of Soria. Table~\ref{TablePG} shows the corresponding results for the poverty gap, where the maximum coefficient of variation is below 25\%. \begin{sidewaystable \tablewidth=\textheight \tablewidth=\textwidth \caption{Sample size, HB estimates of poverty incidence $\times$100, lower and upper limits of highest posterior density intervals and coefficients of variation of HB estimates for the Spanish provinces with sample size closest to minimum, first quartile, median, third quartile and maximum, for each gender}\label{TablePI} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}@{}ld{4.0}d{2.1}d{2.1}d{2.1}d{2.1}ld{4.0}d{2.1}d{2.1}d{2.1}d{2.1}@{}} \hline & \multicolumn{5}{c}{\textbf{Males}} & & \multicolumn{5}{c}{\textbf{Females}}\\[-6pt] & \multicolumn{5}{c}{\hrulefill} & & \multicolumn{5}{c@{}}{\hrulefill}\\ \textbf{Province} & \multicolumn{1}{c}{$\bolds{n_d}$} & \multicolumn{1}{c}{$\bolds{\hat F_{0 d}^{\mathrm{HB}}}$} & \multicolumn{1}{c}{$\bolds{\mathrm{ll}(F_{0 d})}$} & \multicolumn{1}{c}{$\bolds{\mathrm{ul}(F_{0 d})}$} & \multicolumn{1}{c}{$\bolds{\mathrm{cv}(\hat F_{0 d}^{\mathrm{HB}})}$} & \textbf{Province} & \multicolumn{1}{c}{$\bolds{n_d}$} & \multicolumn{1}{c}{$\bolds{\hat F_{0 d}^{\mathrm{HB}}}$} & \multicolumn{1}{c}{$\bolds{\mathrm{ll}(F_{0 d})}$} & \multicolumn{1}{c}{$\bolds{\mathrm{ul}(F_{0 d})}$} & \multicolumn{1}{c@{}}{$\bolds{\mathrm{cv}(\hat F_{0 d}^{\mathrm{HB}})}$} \\ \hline Soria & 24 & 24.4 & 15.7 & 33.2 & 19.1 & Soria & 17 & 33.2 & 21.0 & 43.8 & 17.9 \\ L\'erida & 127 & 24.8 & 20.3 & 29.8 & 9.9 & Gerona & 138 & 17.4 & 14.1 & 21.2 & 10.7 \\ Ja\'en & 233 & 28.8 & 25.1 & 33.0 & 7.1 & Ciudad Real & 239 & 30.5 & 26.4 & 34.4 & 6.7 \\ Las Palmas & 458 & 25.0 & 22.4 & 27.7 & 5.4 & Sevilla & 491 & 24.4 & 22.0 & 27.0 & 5.4 \\ Barcelona & 1358 & 11.1 & 10.2 & 12.1 & 4.5 & Barcelona & 1483 & 13.8 & 12.8 & 14.8 & 3.8 \\ \hline \end{tabular*}\vspace*{30pt} \tablewidth=\textheight \tablewidth=\textwidth \caption{Sample size, HB estimates of poverty gap $\times$100, lower and upper limits of highest posterior density intervals and coefficients of variation of HB estimates for the Spanish provinces with sample size closest to minimum, first quartile, median, third quartile and maximum, for each gender}\label{TablePG} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}@{}ld{4.0}d{2.1}d{1.1}d{2.1}d{2.1}ld{4.0}d{2.1}d{1.1}d{2.1}d{2.1}@{}} \hline & \multicolumn{5}{c}{\textbf{Males}} & & \multicolumn{5}{c}{\textbf{Females}}\\[-6pt] & \multicolumn{5}{c}{\hrulefill} & & \multicolumn{5}{c@{}}{\hrulefill}\\ \textbf{Province} & \multicolumn{1}{c}{$\bolds{n_d}$} & \multicolumn{1}{c}{$\bolds{\hat F_{1 d}^{\mathrm{HB}}}$} & \multicolumn{1}{c}{$\bolds{\mathrm{ll}(F_{1 d})}$} & \multicolumn{1}{c}{$\bolds{\mathrm{ul}(F_{1 d})}$} & \multicolumn{1}{c}{$\bolds{\mathrm{cv}(\hat F_{1 d}^{\mathrm{HB}})}$} & \textbf{Province} & \multicolumn{1}{c}{$\bolds{n_d}$} & \multicolumn{1}{c}{$\bolds{\hat F_{1 d}^{\mathrm{HB}}}$} & \multicolumn{1}{c}{$\bolds{\mathrm{ll}(F_{1 d})}$} & \multicolumn{1}{c}{$\bolds{\mathrm{ul}(F_{1 d})}$} & \multicolumn{1}{c@{}}{$\bolds{\mathrm{cv}(\hat F_{1 d}^{\mathrm{HB}})}$} \\ \hline Soria & 24 & 8.7 & 4.9 & 12.8 & 24.5 & Soria & 17 & 12.5 & 6.6 & 17.9 & 24.0 \\ L\'erida & 127 & 8.8 & 6.6 & 10.9 & 12.7 & Gerona & 138 & 5.6 & 4.3 &7.2 & 13.3 \\ Ja\'en & 233 & 10.5 & 8.4 & 12.2 & 9.3 & Ciudad Real & 239 & 10.9 & 9.1& 12.8 & 8.9 \\ Las Palmas & 458 & 8.8 & 7.6 & 10.0 & 7.0 & Sevilla & 491 & 8.2 & 7.1 &9.3 & 7.0 \\ Barcelona & 1358 & 3.3 & 2.9 & 3.7 & 5.5 & Barcelona & 1483 & 4.1 & 3.7& 4.5 & 4.8 \\ \hline \end{tabular*} \end{sidewaystable} Finally, the point estimates of poverty incidence and poverty gap obtained using the HB procedure are plotted in the cartograms of Figures~\ref{MapHBPI} and \ref{MapHBPG}, for females and males. Although the method has been applied separately for each gender in contrast to the application done in \citet{MolRao10} which treats provinces crossed with gender as domains, we can see that the maps are very similar. \section{Discussion}\label{conclusions} The proposed HB procedure {gives efficient estimates} of general {nonlinear} parameters in small areas using a model for unit-level data. It is a computationally faster alternative to the EB method of \citet{MolRao10} and at the same time it provides a full description of the posterior distribution of the target parameters, making it very easy to construct credible intervals or to obtain other posterior summaries. The frequentist simulation study described in Section~\ref{FreVal} and the application with Spanish SILC data given in Section~\ref{applic} indicate that HB point estimates agree to a great extent with EB estimates and that posterior variances are also comparable with frequentist MSEs. This good property arises from the fact of using only noninformative priors. Thus, the proposed HB method is in practice more feasible than the EB method for the estimation of general nonlinear indicators under large populations. \begin{figure}[t] \includegraphics{702f18.eps} \caption{Cartograms of estimated percent poverty incidences in Spanish provinces for men and women, obtained using the HB method. Canary islands have been moved to the bottom-right corner.}\label{MapHBPI} \end{figure} \begin{figure}[b] \includegraphics{702f19.eps} \caption{Cartograms of estimated percent poverty gaps in Spanish provinces for men and women, obtained using the HB method. Canary islands have been moved to the bottom-right corner.}\label{MapHBPG} \end{figure} {In addition, the proposed HB approach provides estimators of poverty indicators in Spanish provinces that are considerably more efficient than direct estimators}; see Figure~\ref{plotCVDirecHB}. Results highlight larger point estimates of poverty incidence and poverty gap for females in almost all provinces although credible intervals for the two genders cross each other. According to the resulting poverty maps, poverty (both in frequency and intensity) is mainly concentrated in the south and west of Spain. Provinces with critical estimated poverty incidences for men, with at least 30\% of people under the poverty line, are Almer\'{\i}a, Badajoz, Albacete, Cuenca, \'{A}vila and Zamora. For women, almost all provinces get a larger point estimate of poverty incidence. In particular, many more provinces join the set of provinces with critical values, namely, practically all provinces in the region of Andaluc\'{\i}a except for Sevilla and C\'{a}diz, all the provinces in Castilla la Mancha region except for Toledo and two more provinces in Castilla Le\'{o}n. Lleida in the north--east (region of Catalonia) obtains a worrying poverty incidence for women as compared with the rest of the provinces in the same region. In Spain the frequency of poverty as measured by the poverty incidence seems to be very much related with the intensity of poverty as measured by the poverty gap, with maps for the poverty gaps showing a similar distribution of the poverty across provinces. In contrast to the case of estimating area means or totals, the proposed method, as any other unit-level method for estimating nonlinear parameters, requires the values of the auxiliary variables for each population unit instead of area aggregates. These data can be obtained from the last census or from administrative registers. But due to confidentiality issues and depending on the particular regulation of each country, census data might not be easily available for practitioners beyond statistical offices personnel. In some other countries, access to census data can be obtained by prior signature of strict data protection contracts. In other small area applications, such as, for example, agriculture or forest research, the population of $x$-values is fully available to the researcher from satellite or laser sensors images [\citet{BatHarFul88}; \citet{BreAst12}]. A model with spatial correlation among provinces might be considered, but there are serious difficulties in defining boundary conditions, especially for several provinces such as islands. Even if spatial correlation could be considered for a subset of the provinces, the number of provinces left is not large enough to estimate accurately the spatial correlation, leading to weak significance of this parameter. An area-level model with spatial correlation among Spanish provinces is studied by \citet{MarMolMor13}, and their results for the SILC data indicated very mild gains in efficiency due to the introduction of the spatial correlation in the model. In any case, we leave this for further research. \begin{appendix} \section{Derivation of posterior densities}\label{posterior} Here we derive the conditional distributions appearing on the right-hand side of the chain rule in (\ref{post}). By Bayes' theorem and using model assumptions (\ref{condit})--(\ref{ud}) together with the prior (\ref{prior}), the posterior distribution is given by \begin{eqnarray}\label{postden} &&\pi\bigl(\mathbf{u},\bolds{\beta},\sigma^2,\rho|\y_s \bigr)\nonumber \\ &&\qquad \propto\Biggl\{\prod_{d=D^*+1}^D \pi \bigl(u_d|\bolds{\beta},\sigma^2,\rho\bigr) \Biggr\} \biggl(\frac{1-\rho}{\rho} \biggr)^{D^*/2} \bigl(\sigma^2 \bigr)^{- (((D^*+n)/2)+1)} \\ &&\quad\qquad{}\times\exp\Biggl\{-\frac{1}{2\sigma^2}\sum _{d=1}^{D^*} \biggl[ \sum_{i\in s_d}w_{di} \bigl(Y_{di}-\x_{di}'\bolds{ \beta}-u_d\bigr)^2+\frac{1-\rho}{\rho}u_d^2 \biggr] \Biggr\},\nonumber \end{eqnarray} where $\pi(u_d|\bolds{\beta},\sigma^2,\rho)$ is the normal prior of $u_d$ given in (\ref{ud}). Let us define the weighted sample means \[ \bar\x_d=\frac{1}{w_{d\cdot}}\sum_{i\in s_d}w_{di} \x_{di},\qquad\bar y_d=\frac{1}{w_{d\cdot}}\sum _{i\in s_d}w_{di}Y_{di}, \] where $w_{d\cdot}=\sum_{i\in s_d}w_{di}$, $d=1,\ldots,D^*$. Integrating out $\mathbf{u}$ in (\ref{postden}), we obtain $\pi(\bolds {\beta},\sigma^2,\rho|\y_s)$. Now dividing $\pi(\mathbf{u},\bolds{\beta},\sigma^2,\rho|\y_s)$ by $\pi(\bolds{\beta},\sigma^2,\rho|\y_s)$, we obtain \[ \pi\bigl(\mathbf{u}|\bolds{\beta},\sigma^2,\rho,\y_s \bigr)= \Biggl\{\prod_{d=D^*+1}^D \pi \bigl(u_d|\bolds{\beta},\sigma^2,\rho\bigr) \Biggr\} \Biggl\{\prod_{d=1}^{D^*} \pi \bigl(u_d|\bolds{\beta},\sigma^2,\rho,\y_s \bigr) \Biggr\}, \] where \begin{equation} \label{postud} u_d|\bolds{\beta},\sigma^2,\rho, \y_s \stackrel{\mathrm{ind}}\sim N \biggl[\lambda_d(\rho) \bigl( \bar y_d-\bar\x_d'\bolds{\beta}\bigr),\bigl \{1-\lambda_d(\rho)\bigr\}\frac{\rho}{1-\rho} \sigma^2 \biggr] \end{equation} for $\lambda_d(\rho)=w_{d\cdot}[w_{d\cdot}+(1-\rho)/\rho]^{-1}$, $d=1,\ldots, D^*$. The second conditional density $\pi_2(\bolds{\beta }|\sigma^2,\rho,\y_s)$ in (\ref{post}) is obtained by integrating out $\bolds{\beta}$ in $\pi (\bolds{\beta},\sigma^2,\rho|\y_s)$ and then dividing $\pi(\bolds{\beta},\sigma^2,\rho|\y_s)$ by $\pi(\sigma^2,\rho|\y_s)$. Let \begin{eqnarray*} \mathbf{Q}(\rho)&=& \sum_{d=1}^{D^*}\sum _{i\in s_d}w_{di}(\x_{di}-\bar \x_d) (\x_{di}-\bar\x_d)' + \frac{1-\rho}{\rho}\sum_{d=1}^{D^*} \lambda_d \bar\x_d\bar\x_d', \\ \mathbf{p}(\rho)&=& \sum_{d=1}^{D^*}\sum _{i\in s_d}w_{di}(\x_{di}-\bar \x_d) (Y_{di}-\bar y_d) +\frac{1-\rho}{\rho} \sum_{d=1}^{D^*}\lambda_d \bar \x_d\bar y_d \end{eqnarray*} and $\hat{\bolds{\beta}}(\rho) = \mathbf{Q}^{-1}(\rho)\mathbf{p}(\rho )$. Then, it follows that \begin{equation} \label{postbeta} \bolds{\beta}|\sigma^2,\rho,\y_s\sim N \bigl\{\hat{\bolds{\beta}}(\rho),\sigma^2\mathbf{Q}^{-1}( \rho) \bigr\}. \end{equation} Finally, integrating out $\sigma^2$ in $\pi(\sigma^2,\rho|\y_s)$, we obtain \begin{eqnarray}\label{postrho} \pi_4(\rho|\y_s)\propto\biggl(\frac{1-\rho}{\rho} \biggr)^{D^*/2}\bigl|\mathbf{Q}(\rho)\bigr|^{-1/2}\gamma( \rho)^{-(n-p)/2}\prod_{d=1}^{D^*} \lambda_d^{1/2}(\rho), \nonumber\\[-12pt]\\[-4pt] \eqntext{\varepsilon\leq\rho\leq1-\varepsilon,} \end{eqnarray} where \begin{eqnarray*} \gamma(\rho)&=&\sum_{d=1}^{D^*} \sum _{i\in s_d}w_{di} \bigl\{Y_{di}-\bar y_d-(\x_{di}-\bar\x_d)'\hat{ \bolds{\beta}}(\rho) \bigr\}^2 \\ &&{}+\frac{1-\rho}{\rho}\sum_{d=1}^{D^*} \lambda_d(\rho) \bigl\{\bar y_d-\bar \x_d'\hat{\bolds{\beta}}(\rho) \bigr\}^2. \end{eqnarray*} Dividing $\pi(\sigma^2,\rho|\y_s)$ by $\pi_4(\rho|\y_s)$ and making a change of variable, we finally obtain \begin{equation} \label{postsigmam2} \sigma^{-2}|\rho,\y_s \sim\operatorname{Gamma} \biggl( \frac{n-p}{2}, \frac{\gamma(\rho)}{2} \biggr). \end{equation} \section{Propriety of the posterior distribution}\label{propriety} \begin{Lemma}\label{le1app2} Under the model defined by (\ref{condit}), (\ref{ud}) and (\ref{prior}), the posterior density $\pi(\mathbf{u}, \bolds{\beta}, \sigma^2, \rho\mid\y_s)$ is proper provided that the matrix defined by stacking the rows~$\x_{di}'$ in columns, $X=\mathrm{col}_{1\leq d\leq D}\mathrm{col}_{i\in s_d} (\x_{di}')$, has full column rank and $\varepsilon\leq\rho\leq1-\varepsilon, \varepsilon>0$. \end{Lemma} \begin{pf} We need to show that $\int\!\!\int\!\!\int\!\!\int\pi(\mathbf{u},\bolds{\beta },\sigma^2,\rho|\y_s) \,d\mathbf{u} \,d\bolds{\beta} \,d\sigma^2\,\mathbf{d}\rho$ is finite, where the posterior $\pi(\mathbf{u},\bolds{\beta},\sigma^2,\rho|\y_s)$ is given in (\ref{post}); see also Appendix~\ref{posterior}. Now, using the expression for the posterior given in (\ref{post}), the integral of the posterior distribution is given by \begin{eqnarray*} && \int\!\!\int\!\!\int\!\!\int\pi\bigl(\mathbf{u},\bolds{\beta}, \sigma^2,\rho|\y_s\bigr) \,d\mathbf{u} \,d\bolds{\beta}\,\mathbf{d}\sigma^2\,\mathbf{d}\rho \\ &&\qquad = \int\biggl[\int\biggl\{\int\biggl(\int\pi_1 \bigl(\mathbf{u}|\bolds{\beta},\sigma^2,\rho,\y_s\bigr)\,d \mathbf{u} \biggr) \pi_2\bigl(\bolds{\beta}|\sigma^2,\rho, \y_s\bigr)\,d\bolds{\beta} \biggr\} \\ &&\hspace*{192pt}{}\times \pi_3\bigl(\sigma^2|\rho,\y_s\bigr)\,d\sigma^2 \biggr] \pi_4(\rho|\y_s) \,d\rho. \end{eqnarray*} Here $\pi_1(\mathbf{u}|\bolds{\beta},\sigma^2,\rho,\y_s)=\prod_{d=1}^D \pi_{1d}(u_d|\bolds{\beta},\sigma^2,\rho,\y_s)$, and the distribution of $u_d|\bolds{\beta},\sigma^2,\rho,\y_s$ is given by (\ref{postud}), which is proper (integrates to one), because $\rho\in [\varepsilon,1-\varepsilon]$ for $\varepsilon>0$. Similarly, the distribution of $\bolds{\beta}|\sigma^2,\rho,\y_s$ is given in (\ref{postbeta}), where the inverse of $Q(\rho)$ exists whenever $\rho\in[\varepsilon,1-\varepsilon]$ for $\varepsilon>0$ and $X$ has full column rank. Concerning $\sigma^2$, the density of $\sigma^{-2}|\rho,\y _s$ is given in (\ref{postsigmam2}). Making the change of variable $v=\sigma^{-2}$, we obtain $\int \pi_3(\sigma^2|\rho,\y_s)\,d\sigma^2=1$. Finally, we note that $\rho$ cannot be integrated out analytically because the posterior of $\rho$ is given up to a constant by (\ref{postrho}). However, \[ \int_{\varepsilon}^{1-\varepsilon} \biggl(\frac{1-\rho}{\rho} \biggr)^{D^*/2}\bigl|\mathbf{Q}(\rho)\bigr|^{-1/2}\gamma(\rho)^{-(n-p)/2} \prod_{d=1}^{D^*} \lambda_d^{1/2}( \rho)\,d\rho<\infty, \] because the integrand is continuous for $\rho\in[\varepsilon,1-\varepsilon]$ provided that $X$ has full column rank. \end{pf} \section{Computation of standardized cross-validation~residuals}\label{Appendix3} Following \citet{GelDeyCha92}, the expectation of any function $g(Y_{di})$ can be expressed as \begin{eqnarray}\label{expgy} && E \bigl[g(Y_{di})|\y_{s(di)} \bigr]\nonumber \\ &&\qquad = \int E \bigl[g(Y_{di})|\y_{s(di)},\btheta\bigr]\pi(\btheta| \y_{s(di)}) \,d\btheta \\ &&\qquad\quad = \frac{\int E [g(Y_{di})|\y_{s(di)},\btheta ]((\pi(\btheta|\y_{s(di)}))/(\pi(\btheta|\y_s))) \pi(\btheta|\y_s) \,d\btheta}{\int ((\pi(\btheta|\y_{s(di)}))/(\pi(\btheta|\y_s))) \pi(\btheta|\y _s)\,d\btheta}.\nonumber \end{eqnarray} Now, to obtain the expectation $E (Y_{di}|\y_{s(di)} )$, consider $g(x)=x$. The expectation within the integral in (\ref{expgy}) is simply \[ E (Y_{di}|\y_{s(di)},\btheta)=E (Y_{di}|\btheta)=\x _{di}'\bolds{\beta}+u_d, \] because, given $\btheta$, all observations are independent and distributed as indicated in (\ref{predfdi}). Thus, if we generate $H$ values $\btheta^{(h)}= ((\mathbf{u}^{(h)})',(\bolds{\beta}^{(h)})',\sigma ^{2(h)},\rho^{(h)})'$, $h=1,\ldots,H$, from the posterior density with all the data, $\pi(\btheta|\y_s)$, then the desired expectation would be obtained as \[ E (Y_{di}|\y_{s(di)} )\approx\sum_{h=1}^H \bigl(\x_{di}'\bolds{\beta}^{(h)}+u_d^{(h)} \bigr)v_{di}^{(h)},\qquad i\in s_d, d=1,\ldots,D, \] where \[ v_{di}^{(h)}= \Biggl\{\sum_{k=1}^H \frac{\pi(\btheta^{(k)}|\y _{s(di)})}{\pi(\btheta^{(k)}|\y_s)} \Biggr\}^{-1} \frac{\pi(\btheta ^{(h)}|\y_{s(di)})}{\pi(\btheta^{(h)}|\y_s)}.\vadjust{\goodbreak} \] But by Bayes' theorem, we have \[ \frac{\pi(\btheta^{(h)}|\y_{s(di)})}{\pi(\btheta^{(h)}|\y_s)}=\frac{f(\y _{s(di)}|\btheta^{(h)})}{f(\y_s|\btheta^{(h)})}\frac{f(\y_s)}{f(\y_{s(di)})}. \] Therefore, \begin{eqnarray*} v_{di}^{(h)}&=&\frac{((f(\y_{s(di)}|\btheta^{(h)}))/(f(\y _s|\btheta^{(h)})))((f(\y_s))/(f(\y_{s(di)})))}{\sum _{k=1}^H ((f(\y_{s(di)}|\btheta^{(k)}))/(f(\y_s|\btheta^{(k)}))) ((f(\y_s))/(f(\y_{s(di)})))} \\ &=& \frac{f(\y_{s(di)}|\btheta^{(h)}) \{f(\y _{s}|\btheta^{(h)}) \}^{-1}}{\sum_{k=1}^H f(\y_{s(di)}|\btheta^{(k)}) \{ f(\y_{s}|\btheta^{(k)}) \}^{-1}}. \end{eqnarray*} Now since, given $\btheta$, all observations are independent, we have $f(\y_s|\btheta)=f(\y_{s(di)}|\btheta)f(Y_{di}|\btheta)$. Replacing this relation in $v_{di}^{(h)}$, we obtain the expression in~(\ref{vdi}). \end{appendix} \section*{Acknowledgments} We thank the referees and the Associate Editor for constructive comments and suggestions.
{'timestamp': '2014-08-01T02:09:06', 'yymm': '1407', 'arxiv_id': '1407.8384', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8384'}
arxiv
\section{Introduction}\label{sec1} Diabetes mellitus is a chronic metabolic disease associated with abnormalities in glucose metabolism that affect the uptake of glucose by tissues and causes abnormal glucose excursions in the blood. Type 1 diabetes mellitus (T1DM) is characterized by total insulin deficiency. In insulin-deficient persons, the blood glucose levels have been roughly controlled using insulin alone. Insulin can be injected (multiple daily injection) or infused (continuous intravenous or subcutaneous insulin infusion). Glucose levels of hospitalized diabetic patients are usually managed with intravenous insulin infusions guided by glucose readings either from a lab-based blood sample assay or point of care glucose meter. However, infrequent testing of blood glucose levels does not provide sufficient trend information to achieve the desired goals of near-normal glucose control. Better glycemic control in T1DM in-hospital patients may be achieved utilizing the continuous intravenous (IV) insulin infusion or insulin pump delivering rapid-acting insulin continuously through a subcutaneous tissue catheter, but automated regulation of the insulin delivery requires constantly updated information about the blood glucose levels and appropriate algorithms. Recently developed continuous glucose monitoring sensors continuously measure the concentration of glucose in the blood or interstitial fluid and display an averaged glucose value every one to five minutes. However, there is no commonly accepted algorithm available for controllers to allow automated regulation of the insulin delivery based on the sensor feedback. Such an algorithm requires a relatively simple parsimonious model for glucose--insulin dynamics validated using real patient data. We propose a parsimonious model, which builds upon previously considered models of glucose--insulin dynamics and may be estimated using a moderate number of plasma glucose and insulin measures and further used for designing algorithms for an automated insulin delivery system. The motivating glucose--insulin dynamics data for four T1DM subjects were collected as a part of the VIA Blood Glucose Monitor Study conducted at the Jefferson Artificial Pancreas Center of Thomas Jefferson University, Philadelphia, PA. The VIA Blood Glucose Monitor (currently GlucoScout, International Biomedical, Austin, TX) is an FDA approved device that can be connected to an existing catheter inserted in a peripheral vein. Samples of blood are automatically transported from the bloodstream into the flow-through sensor. The concentration of glucose is measured using an enzyme-based electrochemical method. This self-calibrating device can perform measurements as frequently as every five minutes. Blood glucose samples were collected during an 8.5-hour protocol with breakfast at 30 minutes, lunch at 240 minutes and exercise at 450 minutes for 30 minutes. Respectively, the first 7.5 hours (450 minutes) were used to fit the proposed model of physiological regulation of glycemia in response to meals and insulin infusion. The measurements collected included blood glucose every 5 minutes with VIA Blood Glucose Analyzer and plasma insulin levels every 10 minutes. The insulin infusion protocol provided for a 120-minute square-wave bolus starting simultaneously with ingestion of the meal. The initial dose was based upon a preprandial blood glucose measurement (capillary blood sample tested on a commercial glucometer). Sixty minutes after the beginning of the meal, the square-wave insulin bolus was adjusted based on a second capillary blood measurement. The basal infusion rate (0.5 U/hr) of insulin was added to the bolus dose over the 120-minute meal period. After 120 minutes, the bolus dose was completed, and the infusion rate returned to the original basal level. Glucose and insulin concentrations and IV insulin infusion rates as a function of study time as well as the times of the meals for one T1DM subject are shown in Figure~\ref{Fig1}. \begin{figure} \includegraphics{706f01.eps} \caption{Glucose concentration, insulin concentration and intravenous insulin infusion rates and meal times as a function of study time in one T1DM subject.}\label{Fig1} \end{figure} Many mathematical models of glucose--insulin dynamics in humans and animals have been proposed to date [e.g., \citet{Sheetal}; \citet{Beretal79}; \citet{Fisetal84}; \citet{Sor85}; \citet{CobBieFer90}; \citet{LehDeu92}; \citet{Traetal93}; \citet{Shietal97}; \citet{Wor97}; \citet{Leh}; \citet{DeGAri00}; \citet{Wiletal05}]. All existing models describe glucose--insulin dynamics in terms of a system of nonlinear ordinary differential equations (ODE). It is not feasible to convert most of these models directly into estimable statistical models because of the large number of latent (mostly not measurable) variables describing the time-dependent levels of glucose, insulin, free fatty acids and glucagon in internal physiological compartments, such as heart, liver etc. The validation of these models consist of finding a subset of parameters that produce predicted glucose profiles closest to the observed data in a least squares sense using an iterative curve-fitting algorithm and exhaustive grid search. Other parameters are fixed at known biologically plausible levels. In this work, a relatively simple model of glucose--insulin dynamics is developed for physiological regulation of glycemia in response to meals and IV insulin infusion in T1DM subjects. The model is validated using the real data collected from four T1DM subjects studied in the clinical research unit. To our knowledge, models of glucose dynamics in response to meals and insulin infusion in T1DM subjects have not been reported in the literature before. It is understood that the proposed model is a simplified approximation of the true glucose--insulin dynamics. It is expected that exact numeric solution of the estimated ODE model would capture global dynamics of the physiological process, but not necessarily provide good fit to observed data in all time subintervals. Therefore, we adapt the generalized smoothing (generalized profiling) approach of \citet{Rametal07}, which is designed to handle data that may be viewed as an approximate rather than precise solution of the postulated ODE model. Section~\ref{sec3} provides a short formal description of the generalized profiling approach. Some alternative smoothing-based methods of ODE model estimation [e.g., \citet{Var82}; \citet{Bru08}; \citet{CheWu08}] proceed with first finding a nonparametric smoother of the data and then considering this smoother to be a solution of the ODE model in order to estimate ODE parameters. Nonlinear least squares [e.g., \citet{LiOsbPrv05}; \citet{XueMiaWu10}] and Bayesian methods [e.g., \citet{HuaLiuWu06}; \citet{DonSam07}] are other approaches for estimating parameters of the ODE models. Implementation of the generalized smoothing approach requires selecting the basis for representing the ODE solution and the penalty weight(s). Here, we propose to optimize the generalized smoothing solutions of nonlinear and nonhomogeneous ODEs by selecting the penalty weight(s) so that the estimated prediction error is minimized. As an unbiased estimate of the prediction error, we adapt the covariance penalty [\citet{Efr04}], which is suitable for nonlinear prediction rules. In the context of generalized profiling, the penalty is used to express the difference between the derivative of the ODE solution approximation and the right-hand side of the ODE model and does not serve the usual purpose of regularization. Therefore, for regularization and performance optimization, it is proposed to use B-spline bases with optimized number and location of the knots using the knot selection methodology and software recently developed by \citet{Spietal13}. In Section~\ref{sec2} we develop a parsimonious model of glucose--insulin dynamics in T1DM patients. Generalized profile estimation methodology is summarized in Section~\ref{sec3}. Section~\ref{sec4} describes the proposed optimization for generalized profile estimation of nonlinear and/or nonhomogeneous ODE models. The optimized generalized profiling is applied to estimate the new model of glucose--insulin dynamics using real data collected from T1DM patients in Section~\ref{sec5}. A simulation study is presented in Section~\ref{sec6}. Section~\ref{sec7} concludes with discussion. \section{Model of glucose--insulin dynamics in T1DM patients}\label{sec2} A comprehensive glucose--insulin dynamics model in T1DM patients may be viewed as comprised of three components: a glucose metabolism model, a meal model, and an insulin kinetics model. The model of glucose metabolism describes the regulation of glucose uptake and production in the body---primarily controlled by the concentrations of glucose and insulin. The meal model describes the rate of glucose absorption from the intestine. The model of insulin kinetics is required to describe the rate at which insulin diffuses into, and is eliminated from, the systemic circulation. Most of the glucose--insulin dynamics models developed to date focus on nondiabetic or type 2 diabetic patients, for whom the plasma glucose concentration affects the insulin production. In T1DM patients, the pancreas does not release insulin, and the model has to incorporate an exogenous insulin input. Meanwhile, it is plausible to assume that plasma insulin concentration affects the glucose concentration similarly in diabetic and nondiabetic patients. Recently proposed models for glucose and insulin dynamics after an IV glucose tolerance test (IVGTT) [\citet{DeGAri00};\vspace*{-2pt} \citet{Mukhopadhyay.etal2004}] assume the following model for the derivative $\overset{\bullet}{G}(t)$ of plasma glucose concentration $G(t)$ [mg/dl] as a function of the plasma insulin concentration $I(t)$ [mU/l] \begin{equation} \overset{\bullet} {G}(t)=b_{0}-b_{1}G(t)-b_{2}G(t)I(t), \label{IVGTT} \end{equation} where $b_{0}$ [(mg/dl)~min$^{-1}]$ is the constant increase in plasma glucose concentration due to constant baseline liver glucose release, $b_{1}$ [min$^{-1}$] is the spontaneous glucose 1st order disappearance rate, and b_{2}$ [min$^{-1}$ (l/mU)] is the insulin-dependent glucose disappearance rate. This model has to be extended to incorporate the terms describing the external glucose absorption from the meals. In this work, we adapt one of the most parsimonious meal absorption models, which assumes that the rate of glucose appearance in the blood follows the model $\mu (t-t_{M})_{+}\exp ( \nu(t-t_{M})_{+} )$, where $t_{M}$ is the starting time of the meal, $\nu$ is the parameter related to the rate of glucose absorption from the gut and $\mu$ is the product of the distribution volume and the constant related to the total amount of carbohydrates consumed [\citet{Mon}]. With IV insulin infusion, the kinetics of plasma insulin concentration $I(t)$ [mU/l] is described by the\vspace*{-1pt} one-compartment model [e.g., \citet{Steetal03}; \citet{HipJosKam05}] $\overset{\bullet}{I}(t)=-c_{1}I(t)+c_{2}r(t)$, where $c_{1}$ [min$^{-1}$] is the insulin 1st order disappearance rate, c_{2}$ [l$^{-1}]$ is the reciprocal of the volume of the insulin distribution space, and $r(t)$ [mU/min] is the IV insulin\vspace*{-1pt} infusion rate. For nondiabetic and type 2 diabetic patients, $\overset{\bullet}{I}(t)$ also depends on the glucose concentration $G(t)$, but for T1DM patients, the pancreas does not release insulin, and insulin concentration $I(t)$ is independent of $G(t)$. Thus, we consider the following nonhomogeneous nonlinear ODE model for an individual T1DM subject on IV insulin delivery and consuming $L$ meals at times $t_{M_{1}},\ldots, t_{M_{L}}$ \begin{eqnarray} \overset{\bullet} {G}(t)&=&b_{0}-b_{1}G(t)-b_{2}G(t)I(t) \nonumber\\[-8pt] \label{mainODE} \\[-8pt] &&{} + \sum_{i=1}^{L}\mu _{i}(t-t_{M_{i}})_{+} \exp \bigl( \nu_{i}(t-t_{M_{i}})_{+} \bigr),\nonumber \\ \label{Ht} \overset{\bullet} {I}(t)&=&-c_{1}I(t)+c_{2}r(t). \end{eqnarray} For nonlinear ODE systems, identifiability of all parameters is not a trivial issue. In our models, the second differential equation (\ref{Ht}) is independent of $G(t)$, linear and has a closed-form solution. Hence, parameters $c_{1}$ and $c_{2}$ are identifiable based on measured $I(t)$ and known $r(t)$. Identifiability of parameters in (\ref{mainODE}) is straightforward to show using the multiple time points method of \citet{Wuetal08}. \section{Generalized profiling estimation of ODE models}\label{sec3} Following \citet{Rametal07}, it is assumed that a vector of $d$ output functions or states $\mathbf{x}(t)= [ x_{1}(t),\ldots,x_{d}(t) ], t\in[0,T]$ depends on a vector of $g $ input functions $\mathbf {u}(t)= [ u_{1}(t),\ldots,u_{g}(t) ] $. The ODE model is written for the derivative vector $\overset{\bullet}{\mathbf{x}}(t)$ as a known vector function $\mathbf{f}$ of $t, \mathbf{x}(t)$, $\mathbf{u}(t)$, and unknown p\times1$ parameter vector $\bolds{\theta}$, \begin{equation} \overset{\bullet} {\mathbf{x}}(t)=\mathbf{f} \bigl( \mathbf{x}(t),\mathbf {u}(t),t,\bolds{\theta} \bigr),\qquad t\in [0,T]. \label{ssODE} \end{equation} It is assumed that a subset of $m\leq d$ output functions is measured with error on some grid of points $0\leq t_{jl}\leq T, j\in\mathcal {I}\subset \{1,\ldots,d\}, 1\leq l\leq N_{j}$ (possibly different grids for different j $). The measurement error model is $y_{jl}=x_{j}(t_{jl})+\varepsilon _{jl}$, where $y_{jl}=y ( t_{jl} ) $ are observed values and $ \varepsilon_{jl}\sim \mbox{i.i.d. } N(0,\sigma_{j}^{2})$. Each state $x_{j}(t), j=1,\ldots,d$, is approximated by an expansion with respect to some basis $ B_{j}= \{ \psi_{jk}(t),1\leq k\leq K_{j} \}$, \begin{equation} \tilde{x}_{j}(t)=\sum_{k=1}^{K_{j}} \alpha_{jk}\psi_{jk}(t)=\bolds {\alpha}_{j}^{\prime} \bolds{\psi}_{j}(t)=\bolds{\psi}_{j}^{\prime }(t \bolds{\alpha}_{j}, \label{predY} \end{equation} where $\bolds{\alpha}_{j}= [ \alpha_{j1},\ldots,\alpha _{jK_{j}} ] ^{\prime}$ and $\bolds{\psi}_{j}(t)= [ \psi_{j1}(t),\ldots,\psi _{jK_{j}}(t) ] ^{\prime}$. The data fitting criterion is defined as a negative log-likelihood \begin{equation} \mathbf{H}(\bolds{\sigma},\bolds{\alpha})=-\sum_{j=1}^{m} \ln \bigl\{ g ( \mathbf{e}_{j}|\sigma_{j},\bolds{ \alpha}_{j} ) \bigr\} \label{Hdtf} \end{equation} of the error terms vectors $\mathbf{e}_{j}=\mathbf{y}_{j}-\bolds{\Psi}_{j}\bolds{\alpha}_{j}$, where $\mathbf{y}_{j}= [ y_{j1},\ldots,y_{jN_{j}} ]$, $\bolds{\Psi}_{j}$ is the $N_{j}\times K_{j}$ matrix of basis functions $\psi_{j1}(t),\ldots,\psi_{jK_{j}}(t)$ evaluated at $N_{j}$ time points, $\bolds{\alpha}= [ \bolds{\alpha}_{1}^{\prime },\ldots,\bolds{\alpha}_{m}^{\prime} ] ^{\prime}, \bolds {\sigma}= [ \sigma _{1},\ldots,\sigma_{m} ] ^{\prime}$, and $g ( \mathbf {e}_{j}|\sigma _{j},\bolds{\alpha}_{j} ) $ is the density of the error terms. The estimate $\hat{\bolds{\alpha}}$ of the parameter $\bolds{\alpha}$ is computed by minimizing the penalized criterio \begin{equation} \mathbf{J}(\bolds{\alpha},\bolds{\theta},\bolds{\lambda})=\mathbf {H}(\bolds{\sigma}, \bolds{\alpha})+\sum_{j=1}^{d}\lambda _{j}\mathrm{PEN}_{j}(\tilde{\mathbf{x}}|\bolds{\theta}), \label{penJ} \end{equation} where $\bolds{\lambda}= [ \lambda_{1},\ldots,\lambda_{d} ] ^{\prime}$ and the penalty for the $j$th output function is defined b \begin{equation} \mathrm{PEN}_{j}(\tilde{\mathbf{x}}|\bolds{\theta})=\int \biggl\{ \frac {d}{dt}\tilde{x}_{j}(t)-f_{j} \bigl( \tilde{\mathbf {x}}(t),\mathbf{u}(t),t \bolds{\theta} \bigr) \biggr\} ^{2}\,dt. \label{PEN} \end{equation} The composite penalty $\sum_{j=1}^{m}\lambda_{j}\mathrm{PEN}_{j}(\tilde {\mathbf{ }}|\bolds{\theta})$ measures the closeness of $\tilde{\mathbf{x}}(t)$ to the solution of (\ref{ssODE}). Parameter $\bolds{\alpha}$ is considered a nuisance parameter, which depends on the structural parameter \bolds{\theta}$ and smoothing parameter $\bolds{\lambda}$, with function $\bolds{\alpha}=\bolds{\alpha} ( \bolds{\theta},\bolds {\lambda} ) $ defined implicitly (under the assumptions of the implicit function theorem) b \begin{equation} \frac{\partial\mathbf{J}(\bolds{\alpha},\bolds{\theta},\bolds{\lambda})}{\partial\bolds{\alpha}}=\mathbf{0} \label{impFun} \end{equation} in some open neighborhood of the minimum of the penalized criterion (\re {penJ}). The generalized profiling approach (a.k.a. generalized smoothing) estimates the structural parameter vector $\bolds{\theta}$ by minimizing (\re {Hdtf}) with respect to $\bolds{\theta}$ using the Gauss--Newton algorithm. The necessary gradient vector is \[ \frac{d\mathbf{H}(\bolds{\alpha} ( \bolds{\theta} ) )}{d\bolds{\theta}^{\prime}}=\frac{\partial\mathbf{H}(\bolds {\alpha} ( \bolds{\theta} ) )}{\partial\bolds{\alpha}^{\prime}}\frac{d\bolds{\alpha} ( \bolds{\theta} ) }{d\bolds{\theta}^{\prime}}, \] where $d\bolds{\alpha} ( \bolds{\theta},\bolds{\lambda} )/d \bolds{\theta}^{\prime}$ is computed using the implicit function theorem, \begin{equation} \frac{d\bolds{\alpha} ( \bolds{\theta} ) }{d\bolds{\theta}^{\prime}}=- \biggl( \frac{\partial^{2}\mathbf{J}(\bolds{\alpha},\bolds{\theta},\bolds{\lambda})}{\partial\bolds{\alpha}^{\prime}\,\partial\bolds {\alpha}} \biggr) ^{-1} \frac{\partial^{2}\mathbf{J}(\bolds{\alpha},\bolds{\theta},\bolds{\lambda})}{d\bolds{\theta}^{\prime}\,\partial\bolds{\alpha}}. \label{dadg} \end{equation} After each update of $\bolds{\theta}$, parameter $\bolds{\alpha}$ is updated by minimizing (\ref{penJ}) conditionally on the current value of \bolds{\theta}$ and a priori chosen $\bolds{\lambda}$. Representation of $\tilde{x}_{j}(t)$ through the basis expansion (\ref{predY}) automatically yields the derivative needed to evaluate (\ref{PEN}), \[ \frac{d}{dt}\tilde{x}_{j}(t)=\sum _{k_{0}}^{K_{j}}\alpha_{jk}\frac {d}{dt} \psi_{jk}(t)=\bolds{\alpha}_{j}^{\prime}\overset{ \bullet } {\bolds{\psi}}_{j}(t)=\overset{\bullet} {\bolds{\psi }}_{j}(t)^{\prime}\bolds{\alpha}_{j}. \] Notably, the penalized criterion (\ref{penJ}) is not minimized jointly with respect to~$\bolds{\theta}$~and~$\bolds{\alpha}$ because joint minimization yielded unsatisfactory estimates [\citet{HecRam00}]. When $e_{jl}\sim \mbox{i.i.d. }N(0,\sigma_{j}^{2})$, minimizing (\ref{Hdtf}) is equivalent to minimizin \begin{equation} \mathbf{H}(\bolds{\alpha},\bolds{\sigma})=\sum_{j=1}^{m}w_{j} ( \mathbf {y}_{j}-\bolds{\Psi}_{j}\bolds{ \alpha}_{j} ) ^{\prime} ( \mathbf{ }_{j}- \bolds{\Psi}_{j}\bolds{\alpha}_{j} ), \label{Hdtf2} \end{equation} where\vspace*{-1pt} $w_{j}=\sigma_{j}^{-2}$ [\citet{Rametal07} mention other alternatives for $w_{j}$]. We use~(\ref{Hdtf2}) with weights $w_{j}=\sigma _{j}^{-2} $ estimated prior to the generalized profile estimation along with the starting values and drop dependence of $\mathbf{H}$ on $\bolds {\sigma}$ from further notation. In the original profiled estimation work, \citet{Rametal07} assume that \bolds{\lambda}$ is fixed a priori. \citet{CaoRam09} view $\bolds{\lambda}$ as a complexity parameter and propose optimization with respect to $\bolds{\lambda}$ as the third outer level of optimization. Denoting a suitable outer optimization criterion by $\mathbf{F}(\bolds{\lambda},\bolds{\theta} (\bolds{\lambda}),\bolds{\alpha} ( \bolds{\theta},\bolds{\lambda} ) )$, they propose to optimize $\mathbf{F}(\bolds{\lambda},\bolds{\theta}(\bolds{\lambda}),\bolds{\alpha} ( \bolds{\theta},\bolds{\lambda} ) )$ as a function of $\bolds{\lambda}$, so that every time $\bolds{\lambda}$ is changed, $\bolds{\theta}$ is updated by minimizing $\mathbf{H}(\bolds{\alpha} ( \bolds{\theta}, \bolds{\lambda} ) )$ as described above. Respectively, for every change in $\bolds{\theta}$, the estimates of the nuisance parameters $ \bolds{\alpha} ( \bolds{\theta},\bolds{\lambda} ) $ are updated by minimizing $\mathbf{J}(\bolds{\alpha},\bolds{\theta},\bolds{\lambda})$. Thus, the overall (outer) optimization is carried on with respect to $\bolds{\lambda}$, the middle level of optimization of $\mathbf{H}( \bolds{\alpha} ( \bolds{\theta},\bolds{\lambda} ) )$ is nested within the outer level optimization, and the inner level of optimization of $\mathbf{J} \bolds{\alpha},\bolds{\theta},\bolds{\lambda})$ is nested within the middle level optimization. The term ``parameter cascade'' was introduced to reflect this multistage optimization with respect to $\mathbf{F}$, $\mathbf{H}$ and $\mathbf{J}$. \section{Optimization of generalized profiling estimation}\label{sec4} For generalized\break smoothing, the most important question is the choice of the penalty weights $\bolds{\lambda}$. \citet{CaoRam09} adapted the generalized cross-validation (GCV) criterion [\citet{CraWah78}] to select the weights for the penalties that may be represented as a quadratic form in the spline coefficients, which corresponds to linear differential operators defined by the ODE model. For the models with nonlinear and/or nonhomogeneous ODEs, this approach is not appropriate because there is no associated smoothing matrix that would linearly transform data into spline coefficients. On the other hand, a direct implementation of leave-one-out cross-validation to minimize the prediction error would be extremely computationally intense for nonsparse functional data and nonlinear ODE models. The GCV criterion provides an estimate of the prediction error for linear estimation rules. In particular, the GCV criterion is an unbiased estimate of the prediction error for penalized splines [e.g., \citet{Gu2002}]. Optimization of the tuning parameter $\bolds{\lambda}= [ \lambda _{1},\ldots,\lambda_{m} ] ^{\prime}$ for the generalized smoothing of nonlinear and/or nonhomogeneous ODEs may be based on an estimate of the prediction error, which would be suitable for nonlinear estimation rules as well as for the linear ones. The covariance penalties\vadjust{\goodbreak} approach [\citet{Efr04}] provides such an estimate of the prediction error. Following \citet{Efr04}, let us denote the mean function by $\bolds{\mu}$ and corresponding prediction by $\hat{\bolds{\mu}}=m ( \mathbf{y} ) $, where m ( \mathbf{y} ) $ is a nonlinear estimation rule. An unbiased estimate of the prediction error is given by \[ \widehat{\mathrm{Err}}=\sum_{j=1}^{m}w_{j} \biggl\{ \sum_{1\leq l\leq N_{j}} ( y_{jl}-\hat{ \mu}_{jl} ) ^{2}+2\sum_{1\leq l\leq N_{j}}\operatorname{cov}( \hat{\mu}_{jl},y_{jl}) \biggr\}. \] \citet{Efr04} used the parametric bootstrap to estimate $2\sum_{1\leq l\leq N_{j}}\operatorname{cov}(\hat{\mu}_{jl},y_{jl})$ (covariance penalty) in the general case. In the case of Gaussian errors and a differentiable mapping $\hat{\bolds{\mu}}=m ( \mathbf{y} ) $, $\operatorname{cov}(\hat{\mu }_{jl},y_{jl})$ may be estimated by $\sigma_{j}^{2} ( \partial\hat{\mu }_{jl}/\partial y_{jl} ) $ [\citet{Ste81}; \citet{Ye98}; \citet{Efr04}], so that with $w_{j}=\sigma_{j}^{-2}$, one obtains \[ \widehat{\mathrm{Err}}=\sum_{j=1}^{m} \biggl\{ \sum _{1\leq l\leq N_{j}}w_{j} ( y_{jl}-\hat{ \mu}_{jl} ) ^{2}+2\sum_{1\leq l\leq N_{j}} \frac {\partial\hat{\mu}_{jl}}{\partial y_{jl}} \biggr\}. \] For linear prediction rules, using the covariance penalties is asymptotically equivalent to using the GCV criterion [\citet{Efr04}]. If $ \{ \hat{\bolds{\theta}},\hat{\bolds{\alpha}} ( \hat{\bolds{\theta}},\bolds{\lambda} ) \} $ is the generalized smoothing solution computed for fixed \bolds{\lambda}$, then the predicted mean function for state $x_{j}(t)$ is $\hat{\bolds{\mu}}_{j}=\bolds{\Psi}_{j}\hat{\bolds{\alpha}}_{j}$. Respectively, $\hat{\mu}_{jl}=\bolds{\psi }_{j}(t_{jl})^{\prime }\hat{\bolds{\alpha}}_{j}$ and (\ref{Hdtf2}) implies that \sum_{j=1}^{m}\sum_{1\leq l\leq N_{j}}w_{j} ( y_{jl}-\hat{\mu }_{jl} ) ^{2}=\mathbf{H} ( \hat{\bolds{\alpha}} ( \hat{\bolds{\theta}},\bolds{\lambda}) )$. Further, \frac{\partial}{\partial y_{jl}}\bolds{\psi}_{j}(t_{jl})^{\prime }\hat{\bolds{\alpha}}_{j}=\bolds{\psi}_{j}(t_{jl})^{\prime }\frac{\partial}{\partial y_{jl}}\hat{\bolds{\alpha}}_{j}$ and the covariance penalties criterion for the generalized profiling may be written as \[ \mathbf{F} ( \bolds{\lambda},\hat{\bolds{\theta}} \hat{\bolds{\alpha}} ) =\mathbf{H} \bigl( \hat{\bolds{\alpha}} ( \hat{\bolds{\theta}},\bolds{\lambda} ) \bigr) +4\sum _{j=1}^{m}\sum_{1\leq l\leq N_{j}} \bolds{\psi }_{j}(t_{jl})^{\prime}\frac{\partial}{\partial y_{jl}} \hat{\bolds{\alpha}}_{j}. \] Since equation $\partial\mathbf{J}(\bolds{\alpha},\bolds{\theta},\bolds{\lambda })/\partial\bolds{\alpha}=\mathbf{0 }$ is satisfied by $\hat {\bolds{\alpha}}$, the derivatives $\partial\hat{\bolds{\alpha}}_{j}/\partial y_{jl}$ may be computed using the inverse function theorem, \[ \frac{\partial\hat{\bolds{\alpha}}_{j}}{\partial y_{jl}}= - \biggl( \frac{\partial^{2}\mathbf{J}(\bolds{\alpha},\bolds{\theta}, \bolds{\lambda})}{\partial\bolds{\alpha}_{j}^{\prime}\,\partial\bolds{\alpha}_{j}} \biggr) ^{-1} \frac{\partial^{2}\mathbf{J}(\bolds{\alpha},\bolds{\theta} \bolds{\lambda})}{\partial y_{jl}\,\partial\bolds{\alpha}_{j}} \biggl\vert _{\bolds{\alpha}=\hat{\bolds{\alpha}}}, \] where $\partial^{2}\mathbf{J}(\bolds{\alpha},\bolds{\theta},\bolds{\lambda})/ \partial y_{jl}\,\partial\bolds{\alpha}_{j}=-2w_{j}\bolds{\psi }_{j}(t_{jl})$ and expression for $\partial^{2}\mathbf{J}(\bolds{\alpha},\bolds{\theta},\bolds{\lambda})/\break \partial\bolds{\alpha}_{j}^{\prime }\,\partial\bolds{\alpha}_{j}$ is given in the \hyperref[app]{Appendix}. Hence, the covariance penalties criterion is \begin{eqnarray}\label{outerF} && \mathbf{F}(\bolds{\lambda},\hat{\bolds{\theta}},\hat{\bolds { \alpha}}) \nonumber\\[-8pt]\\[-8pt] &&\qquad =\mathbf{H}(\hat{\bolds{\alpha}})+4\sum _{j=1}^{m}w_{j}\sum_{1\leq l\leq N_{j}} \bolds{\psi }_{j}(t_{jl})^{\prime} \biggl( \frac{\partial^{2}\mathbf{J}(\bolds{\alpha},\bolds{\theta},\bolds{\lambda})}{\partial\bolds{\alpha}_{j}^{\prime }\,\partial\bolds{\alpha}_{j}} \biggr) ^{-1} \Biggl\vert \mathop{_{\bolds{\theta}=\hat{\bolds{\theta}}}}_{\bolds{\alpha}=\hat{\bolds{\alpha}}}\bolds{\psi }_{j}(t_{jl}).\nonumber\hspace*{-30pt} \end{eqnarray} It is proposed to compute $\bolds{\lambda}=\arg\min_{\bolds{\lambda}} \mathbf{F} (\bolds{\lambda},\hat{\bolds{\theta}}, \hat{\bolds{\alpha}} ) $ using the Gauss--Newton optimization to find a point of minimum, such that at every iteration step, the profiled solution $ \{ \hat{\bolds{\theta}},\hat{\bolds{\alpha}} ( \hat{\bolds{\theta}}, \bolds{\lambda } ) \} $ is updated conditionally on $\bolds{\lambda}$ as described in Section~\ref{sec3}.\vadjust{\goodbreak} The Gauss--Newton optimization requires the gradient $\frac{d\mathbf{F} \bolds{\lambda},\hat{\bolds{\theta}},\hat{\bolds{\alpha}})}{d\bolds{\lambda}^{\prime}}$. Assuming that differentiation under the integral is appropriate, this gradient is computed as \[ \frac{d}{d\bolds{\lambda}^{\prime}}\mathbf{F} ( \bolds{\lambda},\hat{\bolds{\theta}},\hat{\bolds{\alpha}} ) =\frac{\partial\mathbf{F}}{\partial\bolds{\lambda}^{\prime}}+ \frac{\partial\mathbf{F}}{\partial\bolds{\alpha}^{\prime}} \frac {d\bolds{\alpha}}{d\bolds{\lambda}^{\prime}} \biggl\vert_{\bolds{\theta}=\hat{\bolds{\theta}},\bolds{\alpha} \hat{\bolds{\alpha}}}, \] where $d\bolds{\alpha}/d\bolds{\lambda}^{\prime}$ may be computed the same way as $d\bolds{\alpha}/d\bolds{\theta}^{\prime }$ in (\ref{dadg}), \[ \frac{\partial\bolds{\alpha}}{\partial\bolds{\lambda}^{\prime }}=- \biggl( \frac{\partial^{2}\mathbf{J}(\bolds{\alpha},\bolds{\theta },\bolds{\lambda})}{\partial\bolds{\alpha}^{\prime}\,\partial \bolds{\alpha}} \biggr) ^{-1} \frac{\partial^{2}\mathbf{J}(\bolds{\alpha},\bolds{\theta},\bolds{\lambda})}{\partial\bolds{\lambda}^{\prime }\,\partial\bolds{\alpha}}, \] with $ \partial^{2}\mathbf{J}(\bolds{\alpha},\bolds{\theta},\bolds{\lambda})/\partial\lambda_{k}\,\partial\bolds{\alpha}^{\prime}$ given in the \hyperref[app]{Appendix}, and \begin{eqnarray*} \frac{\partial\mathbf{F}}{\partial\lambda_{k}} &=&\sum_{j=1}^{m}4w_{j} \sum_{1\leq l\leq N_{j}}\frac{\partial}{\partial \lambda_{k}}\operatorname{trace} \biggl( \biggl( \frac{\partial^{2}\mathbf{J}(\bolds{\alpha},\hat {\bolds{\theta}},\bolds{\lambda})}{\partial\bolds{\alpha}_{j}^{\prime }\,\partial\bolds{\alpha}_{j}} \biggr) ^{-1} \bigg\vert_{\bolds{\alpha} \hat{\bolds{\alpha}}}\bolds{\psi}_{j}(t_{jl})\bolds{\psi }_{j}(t_{jl})^{\prime} \biggr) \\ &=&\sum_{j=1}^{m}4w_{j}\sum _{1\leq l\leq N_{j}} \biggl[ \operatorname{Vec} \biggl\{ \biggl( \frac{\partial^{3}\mathbf{J}(\bolds{\alpha},\hat{\bolds{\theta}},\bolds{\lambda})}{\partial\lambda_{k}\,\partial \bolds{\alpha}_{j}^{\prime}\,\partial\bolds{\alpha}_{j}} \biggr) ^{-T} \bigg\vert_{\bolds{\alpha}=\hat{\bolds{\alpha}}} \biggr\} ^{T}\operatorname{Vec} \bigl( \bolds{\psi}_{j}(t_{jl})\bolds{\psi }_{j}(t_{jl})^{\prime} \bigr) \biggr], \\ \frac{\partial\mathbf{F}}{\partial\bolds{\alpha}_{k}^{\prime}} &=&-2w_{k} ( \mathbf{y}_{k}-\bolds{\Psi}_{k}\bolds{\alpha}_{k} ) ^{\prime} \bolds{\Psi}_{k} \\ &&{}+\sum_{j=1}^{m}4w_{j}\sum _{1\leq l\leq N_{j}}\frac{\partial}{\partial \bolds{\alpha}_{k}^{\prime}} \biggl[ \operatorname{Vec} \biggl\{ \biggl( \frac{\partial^{2}\mathbf{J}(\bolds{\alpha},\hat{\bolds{\theta}},\bolds{\lambda})}{\partial\bolds{\alpha}_{j}^{\prime}\,\partial \bolds{\alpha}_{j}} \biggr) ^{-T} \bigg\vert_{\bolds{\alpha}=\hat{\bolds{\alpha}}} \biggr\} ^{T} \\ &&\hspace*{140pt}{}\times \operatorname{Vec} \bigl( \bolds{\psi }_{j}(t_{jl})\bolds{\psi}_{j}(t_{jl})^{\prime} \bigr) \biggr], \end{eqnarray*} with $\frac{\partial^{2}\mathbf{J}(\bolds{\alpha},\bolds{\theta} \bolds{\lambda})}{\partial\bolds{\alpha}_{j}^{\prime}\,\partial \bolds{\alpha}_{j}} $ and $\frac{\partial^{3}\mathbf{J}(\bolds{\alpha},\bolds{\theta} \bolds{\lambda})}{\partial\lambda_{k}\,\partial\bolds{\alpha}_{j}^{\prime}\,\partial\bolds{\alpha}_{j}}$ also given in the \hyperref[app]{Appendix}. For generalized profile estimation, it is standard to use B-spline bases with equally spaced knots. By analogy with penalized splines, it is expected that a sufficiently large number of basis vectors $K$ (e.g., $n/2$, where $n$ is the number of data points) would be appropriate to minimize the bias [\citet{Rametal07}]. However, the results of \citet{ClaKriOps09} imply that with a large number of equally spaced knots, penalty weight is the only effective smoothing parameter for penalized splines. Thus, if nonsmooth input functions are present in the ODE model, then penalty (\ref{PEN}) may not serve the \mbox{purpose} of regularization as a roughness penalty. In particular, this is the case in our data with insulin infusion rate being a piecewise constant step function. Therefore, it is proposed to optimize the number and location of knots for B-spline bases. With a small number of knots, penalized splines behave asymptotically as least-squares splines and the knots become operative smoothing parameters [\citet{ClaKriOps09}]. Optimizing the number and/or location of knots has been previously considered in the context of free-knot splines [e.g., \citet{Jup78}; \citet{Hu93}; \citet{Lin99}]. It may be performed using the standard model \mbox{selection} criteria such as the Akaike information criterion (AIC), the Bayesian information criterion (BIC) and GCV, but it is known to be very computationally intensive and often intractable using derivative-based optimization methodology. \mbox{Recently,} \citet{Spietal13} developed two stochastic search algorithms for selecting both the number and location of knots. The algorithms combined with adjusted GCV, AIC or BIC optimization criteria are implemented in the R package \texttt{freeknotsplines} available at the Comprehensive R Archive Network (CRAN) \mbox{(\url{http://cran.r-project.org/})}. \citet{Spietal13} report excellent numerical performance of the new algorithms at producing knot locations that are near optimal in the sense of average squared error loss. We propose to adapt this state-of-the-art methodology for selection of free knots for B-spline bases representing the ODE solution(s) for generalized smoothing. Knots selection is optimized using only the observed data, without taking into account the ODE model. This allows using the standard penalization of the first or second derivative for the purpose of selecting the knots for penalized spline optimally smoothing the data. Then the optimized sequence of knots is used to construct the corresponding B-spline basis for representing the ODE solution for generalized profiling estimation, which can be performed using the R package \texttt{CollocInfer} or \mbox{Matlab} software functions for profiled estimation of differential equations available at \url{http://faculty.bscb.cornell.edu/~hooker/profile\_webpages/}. To obtain the starting values and weights for the error sum-of-squares required for implementation of the generalized profile estimation, we first smooth the data points nonparametrically and optimally in the classic sense of cross-validation and then use the standard nonlinear regression methods to estimate the structural parameters of ODEs. The resulting estimates serve as the starting values for the generalized profile estimation. The necessary weights are the reciprocals of the \mbox{cross-}validation estimates for the standard deviation of the errors, $w_{j}=\hat{\sigma}_{j}^{-2}$. \section{Application to glucose--insulin dynamics in T1DM subjects}\label{sec5} For parameter estimation, model (\ref{mainODE}) was reparameterized as the following to impose physiologically meaningful signs of the original parameters \begin{eqnarray}\label{reparODE} \overset{\bullet} {G}(t) &=&\theta_{1}-e^{\theta_{2}}G(t)-e^{\theta _{3}}G(t)I(t)\nonumber \\ &&{}+\llvert \theta_{6}\rrvert (t-t_{M_{1}})_{+}e^{-\llvert \theta_{7}\rrvert (t-t_{M_{1}})_{+}} \nonumber\\[-8pt]\\[-8pt] &&{}+\llvert \theta_{8}\rrvert (t-t_{M_{2}})_{+}e^{-\llvert \theta_{9}\rrvert (t-t_{M_{2}})_{+}},\nonumber \\ \overset{\bullet} {I}(t) &=&-e^{\theta_{4}}I(t)+\theta_{5}r(t), \nonumber \end{eqnarray} so that $b_{0}=\theta_{1}, b_{1}=e^{\theta_{2}}, b_{2}=e^{\theta _{3}}$, $c_{1}=e^{\theta_{4}}, c_{2}=\theta_{5}, \mu_{1}=\llvert \theta_{6}\rrvert, \nu_{1}=-\llvert \theta_{7}\rrvert, \mu_{2}=\llvert \theta_{8}\rrvert, \nu_{2}=-\llvert \theta _{9}\rrvert$, and a $9\times1$ vector of all structural parameters is \bolds{\theta}= [ \theta_{1},\ldots,\theta_{9} ] $. System (\ref{reparODE}) may be written in the general form (\ref{ssODE}) with $\mathbf{x}(t)= [ x_{1}(t),x_{2}(t) ] ^{\prime}$ and \begin{eqnarray*} f_{1} \bigl( \mathbf{x}(t),\mathbf{u}(t),t,\bolds{\theta} \bigr) &=& \theta _{1}-e^{\theta_{2}}x_{1}(t)-e^{\theta_{3}}x_{1}(t)x_{2}(t) \\ &&{}+\llvert \theta_{6}\rrvert u_{1}(t)\exp \bigl\{ -\llvert \theta _{7}\rrvert u_{1}(t) \bigr\} +\llvert \theta_{8}\rrvert u_{2}(t)\exp \bigl\{ -\llvert \theta_{9}\rrvert u_{2}(t) \bigr\}, \\ f_{2} \bigl( \mathbf{x}(t),\mathbf{u}(t),t,\bolds{\theta} \bigr) &=&-e^{\theta_{4}}x_{2}(t)+\theta_{5}u_{3}(t), \end{eqnarray*} where $x_{1}(t)=G(t)$, $x_{2}(t)=I(t)$, $u_{1}(t)=(t-t_{M_{1}})_{+}$, $u_{2}(t)=(t-t_{M_{2}})_{+}$, $u_{3}(t)=r(t)$, $\mathbf{u}(t)= [ u_{1}(t),u_{2}(t),u_{3}(t) ] ^{\prime}$. The number and locations of knots were optimized separately for glucose and insulin in each T1DM subject using the corrected Akaike information criterion (AICc) as implemented in R package \texttt{freeknotsplines}. The resulting numbers of optimized knots ranged between 12 and 18 for the glucose component and between 6 and 13 for the insulin component. Using these small numbers of knots resulted in good nonparametric smoothing of observed values, but ODE parameter estimates were not as physiologically plausible as using 30--40 equally spaced knots. Therefore, for each subject, the sets of optimal nodes for the glucose and insulin components were pooled into one set of 15--23 knots (dropping one of the knots from resulting pairs of knots with the distance of less than 5 min). Figure~\ref{Fig2} shows the resulting B-spline approximations of the ODE solutions for all subjects. It is clear that the approximate ODE solutions track well the global trends in the observed data. Parameter estimates from the fitted ODE model were used to compute most important physiologically meaningful quantities, for which the ranges were previously described in the diabetes research literature. This serves as an additional validation step for the models fitted to the real data. The metabolic clearance rate (MCR) [(min$^{-1}$)~ml/kg] is the product of the fractional clearance rate and distribution volume in ml of insulin normalized by the subject's weight. The fractional clearance rate and distribution volume are $c_{1}$ and $1000c_{2}^{-1}$, respectively, where c_{1}$ and $c_{2}$ are parameters in (\ref{Ht}). Thus, the metabolic clearance rate is computed as $\mathrm{MCR}=1000c_{2}^{-1}c_{1}/\mathrm{weight}$. The basal insulin infusion rate ($r_{b}$) required to maintain euglycemia was calculated to investigate the physiological validity of the parameters in equation (\ref{mainODE}). By setting to 0 the glucose derivative and glucose appearance from a meal (steady-state conditions), and setting the glucose concentration to the euglycemic value of $G_{b}=80$ [mg/dl] in (\ref{mainODE}), it is possible to compute the basal insulin value required to achieve a euglycemic value of 80 mg/dl as $I_{b}= ( b_{0}-b_{1}G_{b} ) /b_{2}G_{b}$. Then the infusion rate required to achieve $I_{b}$ is computed from (\ref{Ht}) by setting $\overset {\bullet}{I}(t)=0$ ($r_{b}=c_{2}^{-1}c_{1}I_{b})$. Table~\ref{tab1} presents the estimates of parameters in model (\ref{mainODE}), computed from the optimized generalized profiling estimates of structural parameters in (\ref{reparODE}), subject weights and computed MCR and~$r_{b}$. The estimated values of MCR fall within the range [\mbox{7.5--35.2 (min$^{-1}$)~ml/kg}] previously reported in the literature [\citet{Tho90}]. The computed $r_{b}$ values range from 0.22 to 0.34 U/hr (3.7 to 5.7 mU/min). These estimates are feasible for T1DM patients with low to normal basal insulin requirements [\citet{SchBoy05}]. \begin{figure} \includegraphics{706f02.eps} \caption{Fitted ODE solutions for 4 T1DM subjects.}\label{Fig2} \end{figure} \begin{table}[b] \tabcolsep=0pt \caption{The estimates of the ODE parameters and corresponding metabolic clearance rate (MCR) and basal insulin infusion rate ($r_{b}$) for all T1DM subjects}\label{tab1} \begin{tabular*}{\tablewidth}{@{\extracolsep{\fill}}@{}lcccccccc@{}} \hline \textbf{Subject} & $\bolds{b_{0}}$ & $\bolds{b_{1}}$ & $\bolds{b_{2}}$ & $\bolds{c_{1}}$ & $\bolds{c_{2}}$ & \textbf{Weight} & \textbf{MCR} & $\bolds{r_{b}}$\\ \hline 1 & 0.95 & 0.001 & 0.0002 & 0.05 & 0.04 & 73.5 & 20.9 & 0.30 \\ 2 & 0.46 & 0.001 & 0.0001 & 0.25 & 0.17 & 65.8 & 23.2 & 0.29 \\ 3 & 1.94 & 0.001 & 0.0002 & 0.03 & 0.04 & 61.3 & 13.4 & 0.34 \\ 4 & 1.24 & 0.005 & 0.0003 & 0.11 & 0.06 & 74.9 & 23.5 & 0.22 \\ \hline \end{tabular*} \end{table} \begin{figure} \includegraphics{706f03.eps} \caption{Sample simulated data (blue points) with the true ODE solution (blue line) and generalized profile solution (red line). Locations of optimized knots for B-spline basis shown as vertical green lines (47 knots for glucose and 54 knots for insulin).}\label{Fig3} \end{figure} \begin{figure} \includegraphics{706f04.eps} \caption{Error distribution of ODE parameter estimates. The errors corresponding to ODE solutions represented by B-splines with fixed a priori chosen number K of basis functions ($K={}$10, 20, 30, 40, 50, 60) are shown with $x$-coordinate equal to $K$. The errors corresponding to ODE solutions represented by B-splines with equally spaced knots and the number of basis functions K that minimizes the outer optimization criterion over the grid {10, 20, 30, 40, 50, 60} are shown with $x$-coordinate zero. The errors corresponding to ODE solutions using B-splines with optimized number and location of knots are shown with $x$-coordinate $-$10.}\label{Fig4} \end{figure} \section{Simulation study}\label{sec6} A small simulation study was conducted to evaluate performance of the proposed optimization for a nonlinear and nonhomogeneous ODE model (\ref {mainODE}). The input functions used in the model were \mbox{generated} separately according to the study protocol for IV insulin and Monks' (1990) model of glucose appearance in the blood. Then exact numeric solutions were computed for the postulated ODE model (\ref{mainODE}) with known parameters $\bolds{\theta}\,{=}\, [2.08,-4.60,-7.99,-2.91,0.08,2.15,-0.07, 0.39,-0.03 ] $ (similar to parameters estimated from real data) and input functions. Finally, 100 data sets with $N=61$ observations each (corresponds to sampling every 10 minutes during 6 hours) were generated according to the measurement error model with exact numeric ODE solution as the mean function and independent Gaussian errors with mean zero and variance $25$. The optimized generalized profiling estimation was performed as described in Sections~\ref{sec3}--\ref{sec4} using B-spline bases with (i) equally spaced knots a priori chosen from the set $\bolds{\Omega}= \{ 10,20,30,40,50,60 \}$, (ii) equally spaced knots with the number of basis functions $K$ that minimizes (\ref{outerF}) over $K\in \bolds{\Omega}$, and (iii) optimized number and location of knots in the range 5--60 as described in Section~\ref{sec4}. Option (ii) corresponds to optimizing the number of equally spaced knots using a sparse full-search algorithm similar to the one described in \citet{Rup02}. Figure~\ref{Fig3} shows a sample simulated data set (blue points) with the true ODE solution (blue line), generalized profile solution (red line) and locations of optimized knots (47 knots for glucose and 54 knots for insulin with locations shown by vertical green lines). As expected for optimized knot selection, more knots are placed in the intervals of rapid change of output functions as compared to the intervals with small gradients. Figure~\ref{Fig4} shows the error distributions of the resulting ODE parameter estimates. The errors corresponding to ODE solutions represented by B-splines with fixed a priori chosen number $K\in\bolds{\Omega}$ of basis functions are shown with the $x$-coordinate equal to $K$. The errors corresponding to equally spaced knots\vadjust{\goodbreak} and $K$ minimizing~(\ref{outerF}) over $K\in\bolds{\Omega}$ are shown with $x$-coordinate zero. The errors corresponding to optimized number and location of knots are shown with $x$-coordinate $-$10. None of the a priori chosen values of $K$ yields accuracy of estimating ODE parameters comparable to the accuracy achieved using equally spaced knots with $K$ minimizing (\ref{outerF}) over $K\in \bolds{\Omega}$ or optimized unequally spaced knots. For each \theta_{i}$, some values of a priori chosen $K$ yielded similar error distributions, however, such values of $K$ are different for different ODE parameters, which does not allow selecting a common fixed optimal $K$. For majority of $\theta_{i}$, the optimized generalized profiling with unequally spaced knots yields the smallest estimation errors. Figure~\ref{Fig5} shows the distribution of root mean prediction errors of approximated ODE solutions. For each simulated data set, the mean prediction error was computed on the same grid as original data points using the true values x_{j}(t_{jl})$, which are known for the simulated data. Optimizing both the number and location of knots provides dramatic reduction in the root mean prediction error of ODE solutions as compared to using an a priori chosen $K$ and substantial reduction as compared to optimizing just the number of equally spaced knots. Also, optimizing just the number of equally spaced knots provides large reduction in root mean prediction error of ODE solution as compared to using an a priori chosen $K$. In conclusion, optimizing the number and location of knots for B-spline approximating the ODE solution provides the most accurate estimates of the ODE parameters and solution. The improvement well justifies additional computational cost for such optimization. Meanwhile, computational costs of repeated optimized generalized smoothing for multiple numbers of equally spaced knots are substantially higher than optimizing the number and location of knots once. \begin{figure} \includegraphics{706f05.eps} \caption{Distribution of root mean prediction error of ODE solutions estimated on the same grid as original data points. The prediction errors of ODE solutions represented by B-splines with fixed a priori chosen number K of basis functions ($K={}$10, 20, 30, 40, 50, 60) are shown with $x$-coordinate equal to $K$. The prediction errors of ODE solutions represented by B-splines with equally spaced knots and the number of basis functions $K$ that minimizes the outer optimization criterion over the grid {10, 20, 30, 40, 50, 60} are shown with $x$-coordinate zero. The prediction errors of ODE solutions using B-splines with optimized number and location of knots are shown with $x$-coordinate $-$10.}\label{Fig5} \end{figure} \section{Discussion}\label{sec7} In this work we proposed an approach for optimizing the generalized profiling estimation of models defined by nonlinear and/or nonhomogeneous ODE systems. Our approach includes optimization with respect to the penalty parameters and with respect to the number and location of knots for \mbox{B-}spline basis used to approximate the ODE solution. Additional regularization from optimizing the knots for the \mbox{B-}spline basis is especially important in the case of discontinuous input functions. The covariance penalties criterion for outer optimization of penalty weights is equivalent to the generalized cross-validation criterion in the case of linear prediction rules, but it is applicable to a much wider range of nonlinear and/or nonhomogeneous ODE models that result in nonlinear prediction rules. Applying the optimized generalized profiling to glucose and insulin concentration data in T1DM patients, we obtained physiologically plausible results for the proposed parsimonious model of glucose--insulin dynamics. Thus, unlike the majority of existing mathematical models of glucose--insulin dynamics, our model is estimable from a relatively small number of noisy observations of glucose and insulin concentrations. Our approach renders the proposed model an attractive candidate for developing automated algorithms of IV insulin delivery for in-hospital glucose management of TIDM patients, as well as for other scenarios involving medical management of chronic conditions. \begin{appendix} \section*{Appendix: Derivatives}\label{app} Assuming that it is appropriate to integrate under the integral in the penalty function, omitting the limits of integration and dropping the explicit dependence on $t$, derivatives for Gauss--Newton optimization are \begin{eqnarray*} \frac{\partial\mathbf{J}(\bolds{\alpha}|\bolds{\theta},\bolds{\lambda })}{\partial\bolds{\alpha}_{j}} &=&-2w_{j}\bolds{\Psi}_{j}^{\prime } ( \mathbf{y}_{j}-\bolds{\Psi}_{j}\bolds{\alpha}_{j} ) \\ &&{}+\sum_{k=1}^{d}2\lambda_{k} \int \bigl( {\overset{\bullet}{\bolds{\psi}}}{}_{k}^{\prime} \bolds{\alpha}_{k}-f_{k} ( \tilde { \mathbf{x}},\mathbf{u},s,\bolds{\theta} ) \bigr) \biggl( \delta_{kj}{\overset {\bullet}{\bolds{\psi}}}_{k}- \frac{\partial f_{k} ( \tilde {\mathbf{ }},\mathbf{u},s,\bolds{\theta} ) }{\partial\bolds{\alpha}_{j}} \biggr) \,ds, \end{eqnarray*} where $\delta_{kj}=1$, if $k=j$, and $\delta_{kj}=0$, if $k\neq j$. Then, \begin{eqnarray*} \frac{\partial\mathbf{J}(\bolds{\alpha}|\bolds{\theta},\bolds{\lambda })}{\partial\lambda_{k}\,\partial\bolds{\alpha}_{j}} &=& 2\int \bigl( {\overset{\bullet} {\bolds{\psi}}}{}_{k}^{\prime} \bolds{\alpha}_{k}-f_{k} ( \tilde{\mathbf{x}}, \mathbf{u},s,\bolds{\theta} ) \bigr) \biggl( \delta_{kj}{\overset{ \bullet} {\bolds{\psi}}}_{k}-\frac{\partial f_{k} ( \tilde{\mathbf{x}},\mathbf{u},s,\bolds{\theta} ) }{\partial\bolds{\alpha}_{j}} \biggr) \,ds, \\ \frac{\partial^{2}\mathbf{J}(\bolds{\alpha}|\bolds{\theta},\bolds{\sigma}, \bolds{\lambda})}{\partial\bolds{\alpha}_{i}'\,\partial \bolds{\alpha}_{j}} &=&\delta_{ij}2w_{j}\bolds{\Psi}_{j}^{\prime }\bolds{\Psi}_{j} \\ && {}+\sum_{k=1}^{d}2\lambda_{k} \int \biggl( \delta_{ki}{\overset{\bullet } {\bolds{\psi}}}_{k}-\frac{\partial f_{k} ( \tilde{\mathbf{x}}, \mathbf{u},s,\bolds{\theta} ) }{\partial\bolds{\alpha}_{i}} \biggr) \\ &&\hspace*{55pt}{}\times \biggl( \delta_{kj} {\overset{\bullet} {\bolds{\psi}}}_{k}-\frac{\partial f_{k} ( \tilde{\mathbf{x}},\mathbf{u},s,\bolds{\theta} ) }{\partial\bolds{\alpha}_{j}} \biggr) ^{\prime}\,ds \\ &&{}+\sum_{k=1}^{d}2\lambda_{k} \int \bigl( {\overset{\bullet} {\bolds{\psi}}}{}_{k}^{\prime} \bolds{\alpha}_{k}-f_{k} ( \tilde { \mathbf{x}} \mathbf{u},s,\bolds{\theta} ) \bigr) \biggl( - \frac{\partial ^{2}f_{k} ( \tilde{\mathbf{x}},\mathbf{u},s,\bolds{\theta} ) }{\partial\bolds{\alpha}_{i}'\,\partial\bolds{\alpha}_{j}} \biggr) \,ds, \\ \frac{\partial^{3}\mathbf{J}(\bolds{\alpha}_{j}|\bolds{\theta},\bolds{\sigma},\bolds{\lambda})}{\partial\lambda_{k}\,\partial \bolds{\alpha}_{i}'\,\partial\bolds{\alpha}_{j}} &=&2\int \biggl( \delta_{ki}{\overset{\bullet} { \bolds{\psi}}}_{k}-\frac {\partial f_{k} ( \tilde{\mathbf{x}},\mathbf{u},s,\bolds{\theta} ) }{\partial\bolds{\alpha}_{i}} \biggr) \biggl( \delta _{kj}{\overset{\bullet} {\bolds{\psi}}}_{k}- \frac{\partial f_{k} ( \tilde{\mathbf{x}},\mathbf{u},s,\bolds{\theta})}{\partial\bolds{\alpha}_{j}}\biggr)^{\prime}\,ds \\ &&{}+2\int \bigl( {\overset{\bullet} {\bolds{\psi}}}{}_{k}^{\prime} \bolds{\alpha}_{k}-f_{k} ( \tilde{\mathbf{x}}, \mathbf{u},s,\bolds{\theta} ) \bigr) \biggl( -\frac{\partial^{2}f_{k} ( \tilde{\mathbf{x}},\mathbf{u},s,\bolds{\theta} ) }{\partial \bolds{\alpha}_{i}'\,\partial\bolds{\alpha}_{j}} \biggr) \,ds. \end{eqnarray*} \end{appendix} \section*{Acknowledgments} The authors are grateful to the Editor and reviewers for constructive comments that helped to improve the quality and accessibility of this manuscript.
{'timestamp': '2014-08-01T02:09:08', 'yymm': '1407', 'arxiv_id': '1407.8386', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8386'}
arxiv
\section{Introduction} We consider a simple auction environment: the auctioneer has certain amount of divisible good to be distributed among a number of $n$ agents. Since the good is divisible, without loss of generality, we can always assume that it is of one unit. Each agent $i\in [n]$ has a valuation function $v_i(\cdot)$ for the good (willingness-to-pay) and a budget $B_i$ to indicate the maximum amount of money she/he is able to pay to the auctioneer (ability-to-pay). We always assume that the valuation $v_i(\cdot)$ is private information for agent $i$ and we shall study both public budget model where the budgets are public knowledge to the auctioneer and private budget model where budget $B_i$ is also private information for agent $i$. Upon receiving the bids, the auction allocates $x_i\geq 0$ unit of the good to agent $i$ and charge her/him $p_i\geq 0$ amount of money. Then the utility of agent $i$ is $v_i(x_i) -p_i$ if $p_i\leq B_i$; otherwise her/his utility is $-\infty$ since she/he does not have enough money to pay. We call an auction \emph{truthful} or \emph{incentive compatible} if it is always a dominant strategy for every bidder $i$ to submit her/his true private information. We say a randomized auction is \emph{universally truthful} if it is a probabilistic distribution over deterministic truthful auctions. The auction is budget feasible if we always have $p_i\leq B_i$ for a truth-telling agent $i$. If there is no budget constraint, the remarkable VCG auction~\cite{Vickrey1961,Clarke1971,Groves1973} is a truthful auction to achieve optimal social welfare. However, budget constraints for agents are very common in real life. For high value items such as spectrum, this is due to the ability-to-pay: an agent who values the item very high may not have enough money to pay it; even for relatively low value items such as key words auction for search engine, budget is also the first thing to concern for advertisers, since the volume for the auction could be very large, and a budget is used for risk control. The existence of budget brings in a huge challenge to the design of auctions and even theoretical impossibility results especially when social warfare is the objective. In particular, no truthful auction can approximate social welfare by a better factor than the number of agents even with publicly known budget constraints and linear valuation functions. The main reason is that we cannot truthfully allocate a significant amount of good to agents with very high values but small budgets. To give a more realistic benchmark for social welfare, a new notion called \emph{liquid welfare} was proposed by Dobzinski and Leme~\cite{DBLP:conf/icalp/DobzinskiL14} as an alternative quantifiable measure for social efficiency. It is defined to be $$\overline{W}(\mathbf{x}) = \sum_i \min\{v_i(x_i), B_i\}.$$ Basically, each agent's utility is capped by her/his budget. Therefore, an agent with high value but small budget cannot contribute much to liquid welfare. This is a reasonable measure as argued in the paper~\cite{DBLP:conf/icalp/DobzinskiL14}: ``efficiency should be measured only with respect to the funds available to the bidder at the time of the auction, and not the additional liquidity he might gain after receiving the goods in the auction''. This is also the maximum amount of revenue an omniscient seller would be able to extract from a certain instance. More justification for this measure can be found in the paper~\cite{DBLP:conf/icalp/DobzinskiL14}. With respect to this optimal liquid welfare objective, their paper gave two truthful auctions both with approximation ratio of $2$ in the public budget model with linear (additive) valuation functions and proved a lower bound of $\frac{4}{3}$ in this same setting. They explicitly asked whether one can have a truthful auction that provides an approximation ratio better than $2$ in this simple setting. For the more challenging private budget model, they provided an $O(\log n)$ approximation truthful auction for linear and decreasing marginal (concave) valuations, and an $O(\log^2 n)$ approximation auction for sub-additive valuations. The main open question is whether a constant approximation exists or not. This was not known even for simple linear valuation functions. \subsection{Our Results and Techniques} In this paper, we answer both of their open questions affirmatively. For the public budget setting and linear valuations, we design a new truthful auction with an approximation ratio of $\varphi=\frac{\sqrt{5}+1}{2}\approx 1.618$, where $\varphi$ is the golden ratio (i.e. the positive solution for the equation $t^2=t+1$). For the private budget setting, we design the first constant approximation auction with an approximation ratio of $34$. More importantly, our auction works for all valuation functions, not necessary linear, concave or sub-additive. This is a rather surprising result and this generality makes the auction applicable in many different scenarios. Our design techniques are also new. For the $2$ approximation auction proposed in~\cite{DBLP:conf/icalp/DobzinskiL14}, the rough idea is to use a uniform market clearing price to sell the item to agents. Their ratio of $2$ is tight for their mechanism even for two agents. The bad case happens when one agent has very high value but limited budget while the other agent has a relatively lower value but enough budget. In the optimal allocation, the first agent gets very little share of the good, but this cannot be archived by a uniform pricing scheme. The high level idea of our mechanism is that an agent can pay certain uniform price per unit but only use up certain fraction of her/his budget. In order to use up more of her/his budget, she/he needs to pay higher price per unit. By this mechanism, an agent with high value but limited budget will still use up all her/his budget but get less share of the good. Our above mechanism crucially uses the fact that the auctioneer knows the budget for each agent. For the private budget setting, we go back to the uniform pricing scheme. However, we do not know how to compute a good global uniform price truthfully in private budget setting. To overcome this, we make use of random sampling, one of the most powerful techniques in truthful mechanism design~\cite{Goldberg2006,BeiCGL12,GravinL13}. We randomly divide the agents into two groups, compute the optimal liquid welfare for one group and use this as a guide to charge agents in the other group. In order to make this random sampling auction work, the contribution in an optimal solution from different groups should be relatively balanced. In particular, if most of the contribution is from one single agent, random sampling does not work. Therefore, random sampling is usually combined with a Vickrey auction~\cite{BeiCGL12,ChenGL13} which works well in this unbalanced case. We also combine a Vickrey auction here for the modified valuation $\min\{v_i(1), B_i\}$. This Vickrey auction was also mentioned in~\cite{DBLP:conf/icalp/DobzinskiL14} and was claimed to be truthful there. However, we notice that there is a subtle issue due to budget constraint and tie-breaking which makes the auction not truthful. To overcome this, we modify the Vickrey auction in which the winner (with highest value) need to pay a bit higher than the second highest value. In the case that the two highest values of the agents are very close to each other, the auction simply refuse to sell the item. We also design another version of modified Vickrey auction which works well when the two highest values are very close to each other. We think that this observation of untruthfulness and these modifications of Vickrey auction are of independent interest. \subsection{Related Work} Due to its practical relevance, many theoretical investigations have been devoted to analyzing auctions for budget constrained agents, especially in direction of optimal auction design which tries to maximize the revenue for the auctioneer~\cite{BorgsCIMS05,ChawlaMM11,FeldmanFLS12,DevanurHH13}. For social efficiency, a number of previous works focus on the solution concept of Pareto Efficiency, which exist for the public budget model but not for private budget model~\cite{DobzinskiLN12,FiatLSS11}. Similar alternative quantifiable measures for efficiency for budget constrained agents were also studied in~\cite{DevanurHH13,SyrgkanisT13} but for different solution concepts. Another related topic is to study budget feasible mechanism design for reversal auction where the budget constrained buyer is the auctioneer rather than a bidder. This model was first proposed and studied by Singer~\cite{Singer10}. Since then, several improvements have been obtained~\cite{ChenGL11,DobzinskiPS11,BeiCGL12}. \section{Public Budgets} In this section, we consider the setting that agents' budgets are public information to the auctioneer, and the valuation function for each agent is linear. To simplify the notations, in this section we will use $v_i$ to denote value per unit for agent $i$ and thus $v_i(x_i) = v_i x_i$. Without loss of generality, we assume that there are $n$ agents with values $v_1 \geq \ldots \geq v_n$ and corresponding budgets $B_1, \ldots, B_n$. Let $\varphi = \frac{\sqrt{5}+1}{2}$ which is the golden ratio (i.e. the positive solution for the equation $t^2=t+1$). For public budget and linear valuations model, it becomes a single dimensional parameter mechanism design problem with parameter $\mathbf{v} = (v_1, v_2, \ldots, v_n)$, thus an auction can be characterized by allocation rule $\mathbf{x} : \mathbb{R}^n_+ \rightarrow \mathbb{R}^n_+$ and payment rule $\mathbf{p}: \mathbb{R}^n_+ \rightarrow \mathbb{R}^n_+$ that maps $\mathbf{v}$ to a vector of allocations $\mathbf{x}(\mathbf{v})$ and a vector of payments $\mathbf{p}(\mathbf{v})$. We present the Myerson's Lemma \cite{myerson1981optimal}, which is a powerful tool in these settings. \begin{lemma} \label{lemmyerson} A deterministic mechanism, with allocation and payment rule $\mathbf{x}$,$\mathbf{p}$ respectively, is truthful if and only if for each bidder $i$ and each $v_{-i}$, the following conditions hold: \begin{enumerate} \item Monotone Allocation: $x_i(v_i, v_{-i})\leq x_i(v'_i, v_{-i})$ for all $v'_i \geq v_i$; \item The payments are such that: $p_i(v_i, v_{-i})= v_i \cdot x_i(v_i,v_{-i})- \int_0^{v_i}x_i(u, v_{-i})du$. \end{enumerate} \end{lemma} Our new auction for public budget model is presented in Auction~\ref{GSUPA}. Here we assume that $v_{n+1} = 0$ if occurs. \IncMargin{1em} \begin{algorithm}[h] \SetKwInOut{Input}{input}\SetKwInOut{Output}{output} \Input{$n $ agents with valuations $v_1\geq \ldots \geq v_n$ and corresponding budgets $B_1, \ldots, B_n$} \Output{An allocation $(x_1, \ldots, x_n)$ and corresponding payments $(p_1, \ldots, p_n)$} \BlankLine \Begin{ Let $k\in [n]$ be the maximum integer s.t. $\frac{1}{\varphi} \sum_{j=1}^k B_j \leq v_k$\; \If{$\frac{1}{\varphi}\sum_{j=1}^k B_j\geq v_{k+1}$}{ \For{$i = 1$ \emph{\KwTo} $k$}{ $\hat{v}_i \leftarrow \frac{v_i}{\sum_{j=1}^k B_j}$\; $x_i \leftarrow \frac{B_i}{\sum_{j=1}^k B_j}\min\{\hat{v}_i,1\}$\; } \For{$i = k+1$ \emph{\KwTo} $n$}{ $x_i \leftarrow 0$\; } } \Else { \For{$i = 1$ \emph{\KwTo} $k$}{ $\hat{v}_i \leftarrow \frac{ v_i}{\varphi v_{k+1}}$\; $x_i \leftarrow \frac{B_i}{\varphi v_{k+1}}\min\{\hat{v}_i,1\}$\; } $x_{k+1} \leftarrow \frac{1}{\varphi} - \sum_{i = 1}^k \frac{ B_i}{\varphi^2 v_{k+1}}$\; \For{$i = k+2$ \emph{\KwTo} $n$}{ $x_i \leftarrow 0$\; } } \For{$i=1$ \emph{\KwTo} $n$}{ $p_i \leftarrow v_i \cdot x_i(v_i,v_{-i})- \int_0^{v_i}x_i(u, v_{-i})du$;\quad\quad\quad// Myerson's Payment Rule\ } } \caption{Auction for Public Budgets}\label{GSUPA} \end{algorithm} \DecMargin{1em} Firstly, we verify that this is indeed a well-defined auction, namely the total amount of good it allocates does not exceed one unit. If $\frac{1}{\varphi}\sum_{j=1}^k B_j\geq v_{k+1}$, \[\sum_{i=1}^n x_i = \sum_{i=1}^k x_i = \sum_{i=1}^k \frac{B_i}{\sum_{j=1}^k B_j}\min\{\hat{v}_i,1\} \leq \sum_{i=1}^k \frac{B_i}{\sum_{j=1}^k B_j} = 1.\] If $\frac{1}{\varphi}\sum_{j=1}^k B_j< v_{k+1}$, \begin{align*} \sum_{i=1}^n x_i = \sum_{i=1}^{k} x_i + x_{k+1} &= \sum_{i=1}^k \frac{ B_i}{\varphi v_{k+1}}\min\{\hat{v}_i,1\} + \frac{1}{\varphi} - \sum_{i = 1}^k \frac{B_i}{\varphi^2 v_{k+1}} \\& \leq \sum_{i=1}^k \frac{ B_i}{\varphi v_{k+1}} + 1 - \sum_{i = 1}^k \frac{B_i}{\varphi v_{k+1}} = 1. \end{align*} \begin{theorem} \label{thmpubmain} For public budget model and linear valuations, Auction~\ref{GSUPA} is a truthful, budget feasible mechanism with approximation ratio of at most $\varphi$ for liquid welfare. \end{theorem} These properties shall be proved in the following two subsections. The following notations are used in the whole section. Let $k$ be as defined in Auction \ref{GSUPA}, $p_0 = \max\{\sum_{i=1}^kB_i, \varphi v_{k+1}\}$, and $k_1$ be the maximum integer s.t. $v_{k_1} \geq p_0$. For agent $i \in [n]$ let $\hat{v}_i = \frac{v_i}{p_0}$, which is as defined in Auction \ref{GSUPA}. We call instances with $\frac{1}{\varphi}\sum_{j=1}^k B_j\geq v_{k+1}$ of case I and instances with $\frac{1}{\varphi}\sum_{j=1}^k B_j< v_{k+1}$ of case II. In most of our analysis, we distinguish these two cases and prove them separately. We have the following facts by the rule of our auction: \begin{itemize} \item In case I, $v_1\geq \cdots \geq v_{k_1} \geq p_0 \geq v_{k_1+1} \geq \cdots \geq v_{k} \geq \frac{p_0}{\varphi} \geq v_{k+1} \geq \cdots \geq v_{n}$; \item In case II, $v_1\geq \cdots \geq v_{k_1} \geq p_0 \geq v_{k_1+1} \geq \cdots \geq v_{k+1} = \frac{p_0}{\varphi} \geq v_{k+2} \geq \cdots \geq v_{n}$. \end{itemize} Thus $\hat{v}_i\geq 1$ for $i=1,2,\ldots, k_1$ and $\hat{v}_i\in [\frac{1}{\varphi}, 1)$ for $i=k_1+1, k_1+2,\ldots, k$. \subsection{Truthfulness and Budget Feasibility} By Myerson's Lemma, we only need to verify that the allocation function in our auction is monotone as our payment is already determined by Myerson's integration. \begin{lemma}(Monotonicity) \label{lemmono} The allocation function in Auction~\ref{GSUPA} is monotone, i.e., $v_i \rightarrow x_i(v_i, v_{-i})$ is non-decreasing. \end{lemma} \begin{proof} For case I, only the first $k$ agents get non-zero unit of the item, thus we only need to prove that for these agents, one's share is non-decreasing if one increases her/his bid. This is obvious since allocation $x_i = \frac{B_i}{\sum_{j=1}^k B_j}\min\{\hat{v}_i,1\} = \frac{B_i}{\sum_{j=1}^k B_j}\min\{\frac{v_i}{\sum_{j=1}^k B_j},1\} $ of agent $i$ is a monotone non-decreasing function in $v_i$. Now we assume that we are in case II where only the first $k+1$ agents get non-zero unit of the item. By the same argument as above, the first $k$ agents get no less unit of the item if she/he increases her/his bid. We prove that this also holds for the $(k+1)$-th agent. For agent $k+1$, as she/he continues to increase her/his value and keep the $(k+1)$-th place, her/his allocation will increase, since it is $x_{k+1} = \frac{1}{\varphi} - \sum_{j=1}^k \frac{B_j}{\varphi^2 v_{k+1}}$. We consider the following two cases when $v_{k+1}$ increases further: \begin{itemize} \item $\frac{1}{\varphi}\sum_{j=1}^{k+1}B_j \leq v_k$. In this case, the value of $v_{k+1}$ first reaches $\frac{1}{\varphi}\sum_{j=1}^{k+1}B_j$ when increasing and her/his allocation is updated to $\frac{B_{k+1}}{\sum_{j=1}^{k+1}B_j}\min\{\hat{v}_{k+1}, 1\} = \frac{1}{\varphi} \cdot \frac{B_{k+1}}{\sum_{j=1}^{k+1}B_j} = \frac{1}{\varphi} - \frac{1}{\varphi^2} \sum_{j=1}^k \frac{B_j}{v_{k+1}}$. After that, this becomes an instance of case I and the allocation continues to increase as $v_{k+1}$ increases. \item $\frac{1}{\varphi}\sum_{j=1}^{k+1}B_j > v_k$. In this case, the value of $v_{k+1}$ first reaches $v_k$ when increasing, and displace player $k$ to be the $k$th highest value. Then one of the following things will happen: \begin{itemize} \item If $\frac{1}{\varphi}(\sum_{j=1}^{k-1}B_j + B_{k+1}) > v_k$, since $\frac{1}{\varphi}\sum_{j=1}^{k-1}B_j < \frac{1}{\varphi}\sum_{j=1}^k B_j < v_k$, it is still an instance of case II and this agent $k+1$ is still the last agent in the winner set. The only difference is that the agent $k$ is not longer in the winner set and therefore the allocation $x_{k+1}$ gets updated to $\frac{1}{\varphi}-\frac{1}{\varphi^2}\sum_{j=1}^{k-1}\frac{B_j}{v_k} \geq \frac{1}{\varphi} - \frac{1}{\varphi^2}\sum_{j=1}^k\frac{B_j}{v_k}$. \item If $\frac{1}{\varphi} (\sum_{j=1}^{k-1}B_j + B_{k+1}) \leq v_k$, then it is still an instance of case II but with agent $k$ as the last agent in the winner set. Agent $k+1$ become the second-to-last agent in the winner set and the allocation $x_{k+1}$ gets updated to $\frac{ B_{k+1}}{\varphi v_k}\min\{\hat{v}_{k+1},1\} \geq \frac{ B_{k+1}}{\varphi^2v_k}\geq \frac{1}{\varphi} - \frac{1}{\varphi^2} \sum_{j=1}^k \frac{B_j}{v_k}$. \end{itemize} In both cases, the allocation is non-decreasing. \end{itemize} This concludes the proof of truthfulness of our auction. \end{proof} \begin{lemma}(Budget feasibility) The payments defined in Auction~\ref{GSUPA} do not exceed the budgets. \end{lemma} \begin{proof} For agents $i > k$ in case I and agents $i > k+1$ in case II, this is trivial since they do not get any good and pay nothing. For first $k$ agents in both case I and case II, their allocation do not change when they increase their valuations beyond $v_i \geq p_0$. In other words, their allocation is a constant when $v_i \geq p_0$. Thus, their payments are bounded by $p_0 x_i = p_0 \frac{B_i}{p_0}\min\{\hat{v}_i,1\} \leq B_i$. The only remaining case is the $(k+1)$-th agent in case II. The payment is bounded by $v_{k+1}x_{k+1} = v_{k+1}( \frac{1}{\varphi} - \sum_{i = 1}^k \frac{ B_i}{\varphi^2 v_{k+1}}) \leq \frac{1}{\varphi} B_{k+1}$, where the inequality derives from the definition of $k$. This completes the proof. \end{proof} \subsection{Approximation Ratio Analysis} Before we prove the approximation ratio, we obtain some bounds for the optimal liquid welfare. We refer to the optimal liquid welfare as $OPT = \max_{\mathbf{x}}\overline{W}(\mathbf{x})$. If we know all the information, the optimal can be computed by a simple greedy. \begin{lemma}(\cite{DBLP:conf/icalp/DobzinskiL14}) \label{lemeasy} The optimal liquid welfare $OPT$ occurs at $\bar{x}^\ast_i = \min(\frac{B_i}{v_i}, [1- \sum_{j<i} \bar{x}^\ast_j]^+)$, where $[x]^+=\max(0,x)$. \end{lemma} From this, it is easy to verify that the following expression for any $j\in [n-1]$ gives upper bounds for $OPT$, which holds even if $1-\sum_{i=1}^j \frac{B_i}{v_i}<0$: \begin{equation}\label{bounds:OPT} OPT\leq \sum_{i=1}^j B_i + v_{j+1}(1-\sum_{i=1}^j \frac{B_i}{v_{i}}). \end{equation} We propose our analysis of approximation ratio by the following lemma: \begin{lemma} \label{thmratio} The liquid welfare achieved by Auction~\ref{GSUPA} is at least $\frac{1}{\varphi }\cdot OPT$. \end{lemma} \begin{proof} We prove for case I first. For $i \leq k_1$, since $v_i \ge p_0$, we have $v_i x_i = \frac{B_i v_i}{\sum_{j=1}^k B_j} \geq B_i$. For $k_1 < i \leq k$ we have $v_i x_i = \frac{B_i v_i}{\sum_{j=1}^k B_j} \min\{\hat{v}_i, 1\} \geq \hat{v}^2_i B_i$ as $\hat{v}_i\in [\frac{1}{\varphi}, 1)$ for $k_1 < i \leq k$. Thus $$ \overline{W}(\mathbf{x}) = \sum_{i=1}^{k_1} B_i + \sum_{i=k_1+1}^k B_i \hat{v}^2_i. $$ For optimal liquid welfare, we shall prove that $$OPT\leq \sum_{i=1}^{k}B_i + (1-\sum_{i=k_1+1}^k \frac{B_i}{v_i})\frac{1}{\varphi} p_0 = \varphi \sum_{i=1}^{k_1}B_i + \sum_{i=k_1+1}^k B_i (\varphi - \frac{1}{\varphi \hat{v}_i}). $$ The equality part is by substituting $p_0=\sum_{i=1}^kB_i$, $\hat{v}_i = \frac{v_i}{\sum_{j=1}^k B_j}$ and direct calculation. We prove the inequality by a case analysis in the following. \begin{itemize} \item $\sum_{i=k_1+1}^k \frac{B_i}{v_i} \leq \sum_{i=1}^k \frac{B_i}{v_i} \leq 1$. We use the bound (\ref{bounds:OPT}) for $OPT$ with $j=k$ and the fact that $v_{k+1}\leq \frac{1}{\varphi} p_0 $: \begin{align*} OPT \leq \sum_{i=1}^k B_i + v_{k+1}(1-\sum_{i=1}^k \frac{B_i}{v_i}) &\leq \sum_{i=1}^k B_i + v_{k+1}(1-\sum_{i=k_1+1}^k \frac{B_i}{v_i}) \\ & \leq \sum_{i=1}^{k}B_i + (1-\sum_{i=k_1+1}^k \frac{B_i}{v_i})\frac{1}{\varphi} p_0 \end{align*} \item $\sum_{i=k_1+1}^k \frac{B_i}{v_i} \leq 1< \sum_{i=1}^k \frac{B_i}{v_i}$. Then in the optimal solution, first $k$ agents are not fully occupied(which means in the optimal solution, agent $k$'s budget is not used up). Thus nothing is allocated for agents $i \geq k+1$. In this case, we have $OPT \leq \sum_{i = 1}^k B_i \leq \sum_{i = 1}^k B_i + (1-\sum_{i=k_1+1}^k \frac{B_i}{v_i})\frac{1}{\varphi} p_0$ as the last term is non-negative. \item $1<\sum_{i=k_1+1}^k \frac{B_i}{v_i} \leq \sum_{i=1}^k \frac{B_i}{v_i}$. We use the bound (\ref{bounds:OPT}) for $OPT$ with $j=k-1$: \begin{align*} OPT \leq \sum_{i=1}^{k-1} B_i + (1-\sum_{i=1}^{k-1} \frac{B_i}{v_i})v_k&= \sum_{i=1}^{k} B_i + (1-\sum_{i=1}^{k} \frac{B_i}{v_i})v_k \\&\leq \sum_{i=1}^{k} B_i + (1-\sum_{i=k_1+1}^{k} \frac{B_i}{v_i})v_k \\& \leq \sum_{i=1}^{k} B_i + (1-\sum_{i=k_1+1}^{k} \frac{B_i}{v_i})\frac{1}{\varphi} p_0. \end{align*} The last inequality uses the fact that $(1-\sum_{i=k_1+1}^{k} \frac{B_i}{v_i})<0$ and $v_k\geq \frac{1}{\varphi} p_0$. \end{itemize} To bound the liquid welfare of our auction, we need to give a good bound for $\hat{v}^2_i$ for agents $i\in [k_1+1, k]$. Noticing that for these agents, $\hat{v}_i \in [\frac{1}{\varphi}, 1]$, we shall prove that $\hat{v}^2_i \geq \frac{1}{\varphi} (\varphi-\frac{1}{\varphi \hat{v}_i})$. To prove this, consider the following function $$f(t) = \frac{\varphi - \frac{1}{\varphi t}}{t^2}, t\in [\frac{1}{\varphi} ,1].$$ The derivative of $f(t)$ is $$f'(t) = -2\frac{\varphi }{t^3}+3\frac{1}{\varphi t^4} = \frac{1}{t^4}[\frac{3}{\varphi} - 2\varphi t] \leq 0 \ \mbox{ when } \ t\in [\frac{1}{\varphi}, 1].$$ So $f(t)$ is monotone decreasing in interval $[\frac{1}{\varphi}, 1]$, and $f_{\max} = f(\frac{1}{\varphi}) = \varphi $. By the property of $f$ and the fact that $\hat{v}_i\in [\frac{1}{\varphi}, 1)$ for $i=k_1+1, k_1+2,\ldots, k$, it is obvious that $\forall i \in [k_1+1, k]$, $ \hat{v}^2_i\geq \frac{1}{\varphi} (\varphi-\frac{1}{\varphi \hat{v}_i})$. Thus \begin{align*} \overline{W}(\mathbf{x}) \geq \sum_{i=1}^{k_1}B_i + \sum_{i=k_1+1}^k B_i\hat{v}_i^2 &\geq \sum_{i=1}^{k_1}B_i + \sum_{i=k_1+1}^k B_i \frac{1}{\varphi}(\varphi - \frac{1}{\varphi \hat{v}_i})\\ &=\frac{1}{\varphi}(\varphi \sum_{i=1}^{k_1}B_i + \sum_{i=k_1+1}^k B_i (\varphi - \frac{1}{\varphi \hat{v}_i})) \\ &\geq \frac{1}{\varphi} OPT. \end{align*} This completes the proof for instances of case I and now we prove for instances of case II. For $i \leq k_1$ since $v_i \geq \varphi v_{k+1}$ we have $v_i x_i = v_i\frac{ B_i}{\varphi v_{k+1}}\min\{\hat{v}_i,1\}\geq B_i$. For $k_1 < i \leq k$ we have $v_i x_i = v_i\frac{ B_i}{\varphi v_{k+1}}\min\{\hat{v}_i,1\} = \frac{\hat{v}_i B_i }{\varphi v_{k+1}} \hat{v}_i\varphi v_{k+1} = \hat{v}^2_i B_i<B_i$. For $i = k+1$ we have $$v_{k+1}x_{k+1} = v_{k+1}( \frac{1}{\varphi} - \sum_{i = 1}^k \frac{ B_i}{\varphi^2 v_{k+1}}) \leq \frac{1}{\varphi^2} B_{k+1}<B_{k+1}.$$ where the first inequality derives from the definition of $k$. Thus, we can bound the liquid welfare as follows \begin{align*} \overline{W}(\mathbf{x})&= \sum_{i=1}^{k_1}B_i + \sum_{i=k_1+1}^k B_i\hat{v}^2_i+ v_{k+1}x_{k+1}\\ &= \sum_{i=1}^{k_1}B_i+ \sum_{i=k_1+1}^k B_i\hat{v}^2_i + \frac{1}{\varphi} v_{k+1} - \frac{1}{\varphi^2} \sum_{i=1}^{k_1}B_i - \frac{1}{\varphi^2}\sum_{i=k_1+1}^k B_i \\ &= (1-\frac{1}{\varphi^2}) \sum_{i=1}^{k_1}B_i + \frac{1}{\varphi} v_{k+1} + \sum_{i=k_1+1}^k B_i (\hat{v_i}^2 - \frac{1}{\varphi^2}). \end{align*} For optimal liquid welfare, we use our bound (\ref{bounds:OPT}) with $j=k$ to get $$OPT \leq \sum_{i=1}^{k}B_i+ (1-\sum_{i=k_1+1}^k \frac{B_i}{v_i})v_{k+1} = \sum_{i=1}^{k_1}B_i + v_{k+1} + \sum_{i = k_1+1}^k B_i(1-\frac{1}{\varphi\hat{v}_i}), $$ where the equality part is by substituting $\hat{v}_i = \frac{ v_i}{\varphi v_{k+1}}$ and direct calculation. To bound the liquid welfare of our auction, we need to give a good bound for $\hat{v}^2_i$ for agents $i\in [k_1+1, k]$. Noticing that for these agents, $\hat{v}_i \in [\frac{1}{\varphi}, 1]$, we shall prove that $\hat{v}^2_i - \frac{1}{\varphi^2} \geq \frac{1}{\varphi}(1-\frac{1}{\phi \hat{v}_i})$. To prove this, consider the following function $$g(t) = (t^2-\frac{1}{\varphi^2})/(1-\frac{1}{\varphi t})= (t+\frac{1}{\varphi})t, t\in[\frac{1}{\varphi},1].$$ It is clear that $g$ is monotone increasing on $t$ in the interval $[\frac{1}{\varphi},1]$, so $g_{\min} = g(\frac{1}{\varphi}) = 2\frac{1}{\varphi^2} > \frac{1}{\varphi}$. By the property of $g$ and the fact that $\hat{v}_i\in [\frac{1}{\varphi}, 1)$ for $i=k_1+1, k_1+2,\ldots, k$, it is obvious that $\forall i \in [k_1+1, k]$, $ \hat{v}^2_i - \frac{1}{\varphi^2} \geq \frac{1}{\varphi}(1-\frac{1}{\phi \hat{v}_i})$. Thus \begin{align*} \overline{W}(\mathbf{x})&= (1-\frac{1}{\varphi^2})\sum_{i=1}^{k_1}B_i + \frac{1}{\varphi} v_{k+1} + \sum_{i=k_1+1}^k B_i (\hat{v}^2_i-\frac{1}{\varphi^2}) \\ &> \frac{1}{\varphi} \sum_{i=1}^{k_1}B_i + \frac{1}{\varphi} v_{k+1} + \frac{1}{\varphi}\sum_{i=k_1+1}^k B_i (1-\frac{1}{\varphi \hat{v}_i}) \\ & \geq \frac{1}{\varphi} OPT. \end{align*} This completes the proof for approximation ratio. \end{proof} To conclude this section, here we provide the following example showing that the analysis of our auction is tight. \begin{exam}(Tightness) Consider two agents with profiles $v_1 = 1$, $B_1 = \epsilon$ and $v_2 = \frac{1}{\varphi}$, $B_2 = 1-\epsilon$ where $\epsilon \in (0,1)$. It is easy to verify that $OPT = \epsilon + (1-\epsilon)\frac{1}{\varphi}$. For Auction \ref{GSUPA}, $\overline{W}(\mathbf{x})= B_1 + B_2\frac{1}{\varphi^2} = \epsilon + (1-\epsilon)\frac{1}{\varphi^2}$. When $\epsilon \rightarrow 0$, $\overline{W}(\mathbf{x})= \frac{1}{\varphi} OPT$ \end{exam} \subsection{Robustness of the Auction} Our auction is rather robust in terms of the setting. We do not have any requirement about the valuation functions. Technically, in the presentation we still use the assumption that the valuation function is monotone. In most of the cases, this is true or without loss of generality since the agent can simply discard certain amount of the good. Even if this is not the case, we can also easily modify the auction to be compatible with possible non-monotone valuation functions. The only place we need to modify is that when the current auction assigns the total unit of the good to an agent, it assigns the most valuable fraction to her/him and discard the remaining. For the simplicity of the presentation, we assume that the good is divisible. Our auction is also good if the items are not continuously divisible. For example, the mechanism works for the multi-unit auction even if each unit of the good is not divisible. Another issue has not been discussed is the computational complexity of the auction as we mainly focus on the approximation ratio caused by the truthfulness and budget feasibility constrain. The computational complexity depends on how to represent the input valuation functions. If these are linear valuations and each can be simply represented by a single number, our auction is indeed efficient. If the valuation functions are given as generic value oracles, then it is even intractable to computable the most profitable fraction for an agent given a fixed price. So, a reasonable assumption is that valuation functions are given by demand oracles or in some concise representation. Then the main problematic step is to compute the optimal solution for an off line instance. This could be at least NP-hard even for some concise representations. For example, we can easily encode knapsack problem here. Then, another robustness of the auction is that it still works well when we replace the optimal solution with some constant approximation. Therefore, as long as we can design an polynomial time algorithm with constant approximation ratio for the off line optimization problem, we can design an auction, which is truthful, budget feasible, of constant approximation and polynomial time computable. \section{Private Budget} In this section, we deal with the setting that agents' budgets are private information that the auctioneer must design a mechanism which incentives agents to report their true values and budgets. We also study the general case that the valuation function $v_i(\cdot)$ for each agent $i$ could be any monotone non-decreasing function. For a subset of agents $Q \subseteq [n]$, let $OPT(Q)$ denote the optimal liquid welfare for agents in group $Q$. Formally $OPT(Q) = \max_{x} \sum_{i\in Q} \min\{v_i(x_i), B_i\}$. In particular, let $OPT = OPT([n])$ which is our objective in this setting. Our new auction for private budget model is presented in Auction~\ref{RS}, where the parameters $\gamma>1, 0<\beta<\frac{1}{2}$ and $0\leq \mu \leq 1$ shall be specified later. Basically, it is a combination of the following three basic auctions: \begin{itemize} \item With probability of $\frac{\mu}{3}$, we run the first modified Vickrey auction. Agent $i_1$ with highest $\bar{v}_i=\min\{v_i(1), B_i\}$ gets the total unit of the good and needs to pay $p_{i_1} = \gamma\bar{v}_{i_2}>\bar{v}_{i_2}$ , which is strictly higher than the second highest $\bar{v}_i$. If agent $i_1$ is not willing to pay ($v_{i_1}<\gamma\bar{v}_{i_2}$) or does not have enough budget to pay ($B_{i_1}<\gamma\bar{v}_{i_2}$), we simply refuse to sell the item to any one. \item With probability of $\frac{2\mu}{3}$, we run the second modified Vickrey auction. Agents are randomly divided into two groups $S$ and $T$. We only sell the total unit of the good to the first agent (with a prior fixed order) in group $S$ who is willing and able to pay the price $\frac{\max_{i\in T} \bar{v}_i}{\gamma}$. If there is no such agent in group $S$, we simply refuse to sell the item to any one. \item With the remaining probability of $1-\mu$, we run a random sampling auction. Agents are randomly divided into two groups $S$ and $T$. We sell half of the good to agents in group $S$ with fixed price $\beta OPT(T)$ per unit. More precisely, for each agent in group $S$ with a prior fixed order, we simply offer a price $\beta OPT(T)$ per unit and let the agent get the most profitable fraction of the good within the availability of the good and budget of the agent. This is precisely captured by the expression \[x_i \leftarrow \argmax \limits_{x\leq \min\{ x_S, \frac{B_i}{\beta OPT(T)}\} } \{v_i(x)-\beta OPT(T) x\}.\] If there are multiple $x$ that achieve the maximum, we choose the largest one. We do the same thing for agents in $T$ but with price $\beta OPT(S)$. \end{itemize} We call the combination of the first two auctions the modified Vickrey auction and the third part as the random sampling auction. \IncMargin{1em} \begin{algorithm}[h] \SetKwInOut{Input}{input}\SetKwInOut{Output}{output} \Input{$n $ agents with values $v_1, \ldots, v_n$ and budgets $B_1, \ldots, B_n$} \Output{An allocation $(x_1, \ldots, x_n)$ and corresponding payments $(p_1, \ldots, p_n)$\;} \BlankLine \Begin{ \For{$i = 1$ \emph{\KwTo} $n$}{ $x_i \leftarrow 0$, $p_i \leftarrow 0$, $\bar{v}_i \leftarrow \min\{v_i(1), B_i\}$\; } } With probability of $\frac{\mu}{3}$ \Begin{ $i_1 \leftarrow \arg \max_i \bar{v}_i $, $i_2 \leftarrow \arg \max_{i\ne i_1} \bar{v}_i$\; \If{$\bar{v}_{i_1} \geq \gamma \bar{v}_{i_2}$}{ $x_{i_1} \leftarrow 1$, $p_{i_1} \leftarrow \gamma\bar{v}_{i_2}$ } } With probability of $\frac{2\mu}{3}$ \Begin { Randomly divide all agents with equal probability into set $S$ and $T$\; $\bar{v}_T \leftarrow \max_{i\in T} \bar{v}_i$\; \ForAll{$i \in S$}{ \If{$\bar{v}_i \geq \frac{\bar{v}_T}{\gamma}$ } { $x_i \leftarrow 1, p_i \leftarrow \frac{\bar{v}_T}{\gamma}$\; Halt } } } With probability of $1-\mu$ \Begin{ Randomly divide all agents with equal probability into set $S$ and $T$, $x_S \leftarrow \frac{1}{2}$, $x_T \leftarrow \frac{1}{2}$\; \ForAll{$i \in S$}{ $x_i \leftarrow \argmax \limits_{x\leq \min\{ x_S, \frac{B_i}{\beta OPT(T)}\} } \{v_i(x)-\beta OPT(T) x\}$\; $p_i \leftarrow \beta OPT(T) x_i$\; $x_S \leftarrow x_S - x_i$ } \ForAll{$i \in T$}{ $x_i \leftarrow \argmax \limits_{x\leq \min\{ x_T, \frac{B_i}{\beta OPT(S)}\} } \{v_i(x)-\beta OPT(S) x \}$\; $p_i \leftarrow \beta OPT(S) x_i$\; $x_T \leftarrow x_T - x_i$ } } \caption{Random Sampling Auction for Private Budgets}\label{RS} \end{algorithm} \DecMargin{1em} \begin{theorem} \label{thmprimain} Choosing $\beta =\frac{3}{10}, \gamma=\sqrt{\frac{10}{9}}$ and $\mu=\frac{5}{7}$, Auction~\ref{RS} is a truthful, budget feasible mechanism which guarantees liquid welfare of at least $\frac{1}{34}OPT$. \end{theorem} \subsection{Truthfulness and Budget Feasibility} Before we prove that our auction is truthful, we first point out that the ordinarily Vickrey auction (i.e. $\gamma=1$) on $\bar{v}_i=\min \{v_i(1), B_i\}$ is not truthful. Here is an example in which the valuation function is additive (thus we use $v_i$ to denote price per unit to illustrate): two agents with profiles $(v_1,B_1)=(v_2,B_2)=(2,1)$. If both of the agents bid truthfully, whatever the tie-breaking rule the Vickrey auction uses (even if we allow randomness), at least for one of the agents, the probability she/he gets the total unit of good is strictly less than $1$. For symmetry, we assume that the probability agent $1$ gets the total unit of good is strictly less than $1$. When agent $1$ does get some fraction of the good, she/he needs to pay $1$ per unit according to the Vickrey's rule. As a result, the expected utility of agent $1$ is strictly less than $2-1=1$. However, if agent $1$ bids $(v'_1,B'_1)=(2,1.5)$, she/he will get the total unit of the good for sure based on Vickrey auction and the payment is still $1$, which does not exceed the budget. Therefore, her/his utility become $1$, which is strictly better than bidding truthfully. This is the reason why we need to modify the Vickrey auction. In the following, we prove that Auction~\ref{RS} in which our modification is applied, is universally truthful. \begin{lemma} Auction~\ref{RS} is universally truthful. \end{lemma} \begin{proof} The auction is a probabilistic combination of three auctions. For the second and third auctions, it also uses random bits to do the partition of $(S,T)$. We only need to prove that all of them are truthful when these partitions are fixed. For the first modified Vickrey auction on value $\bar{v}_i=\min \{v_i(1), B_i\}$, two cases may happen: \begin{itemize} \item $\bar{v}_{i_1} \geq \gamma \bar{v}_{i_2}$. In this case, for any agent $j$ other than $i_1$, $\bar{v}_j \leq \bar{v}_{i_1}< \bar{v}_{i_1}\gamma $. If $j$ wants to change her/his bid to become the winner, she/he needs to pay $\bar{v}_{i_1}\gamma$, which is strictly greater than either her/his true budget or true value. This leads to not enough budget or negative utility. For $i_1$, she/he does not have the incentive to change value or budget, since the payment is decided by $i_2$, which is no larger than her/his value and also within her/his budget. \item $\bar{v}_{i_1} < \gamma \bar{v}_{i_2}$. In this case, no one is the winner. For any agent $j$ other than $i_1$, it is the same argument as before. For $i_1$, if she/he wants to change her/his bid to become the winner, then she/he needs to pay $\gamma \bar{v}_{i_2}$, which is strictly greater than either her/his true budget or true value. This leads to not enough budget or negative utility. \end{itemize} Now we prove for the second modified Vickrey auction. For any agent in $T$, she/he does not get any fraction of the good regardingless of her/his bid. So, they do not have incentive to lie. For any agent in $S$, she/he cannot change the price per unit or her/his position in the order by changing her/his bid. When an agent in $S$ has chance to get the good, it is simply a take-it-or-leave-it offer with fixed price. So, they do not have incentive to lie. For the random sampling auction part, each agent cannot change her/his price per unit or position by changing her/his bid, and given a fixed price and position, a agent has already got the most profitable fraction of the good. Therefore, agents do not have incentive to change their bids. Thus, all the three auctions above are truthful. This concludes the proof for universally truthfulness. \end{proof} \begin{lemma} Auction~\ref{RS} is budget feasible. \end{lemma} \begin{proof} For the first modified Vickrey auction, if no one wins, everyone's payment is zero; if $i_1$ wins, then she/he pays $\gamma \bar{v}_{i_2}\leq \bar{v}_{i_1}= \min \{v_{i_1}(1), B_{i_1}\}\leq B_{i_1}$. For the second modified Vickrey auction, if no one wins, everyone's payment is zero; if $i^\ast$ wins, then she/he pays $\gamma \frac{\bar{v}_T}{\gamma}\leq \bar{v}_{i^\ast}= \min \{v_{i^\ast}(1), B_{i^\ast}\} \leq B_{i^\ast}$. For random sampling auction and agent $i\in S$, $p_i = x_i \cdot \beta OPT(T) \leq \min\{ x_S, \frac{B_i}{\beta OPT(T)}\} \cdot \beta OPT(T) \leq \frac{B_i}{\beta OPT(T)} \cdot \beta OPT(T) =B_i. $ Same thing also holds for agents in $T$. This concludes the proof for budget feasibility. \end{proof} \subsection{Approximation Ratio Analysis} We first prove the following lemma, which bounds the liquid welfare of the auction by its revenue. This is useful in our analysis. \begin{lemma} \label{l1} Liquid welfare produced by any truthful and budget feasible mechanism is at least the revenue of the auctioneer. \end{lemma} \begin{proof} For an allocation $\mathbf{x} = (x_1, x_2, \ldots, x_n)$ and payment $\mathbf{p} = (p_1, p_2, \ldots, p_n)$ given by such a mechanism, we have $v_i (x_i) \geq p_i$ by truthfulness and $B_i \geq p_i$ by budget feasibility. So the liquid welfare $\overline{W}(x) = \sum_i \min\{v_i (x_i), B_i\} \geq \sum_i p_i$. \end{proof} Based on Lemma~\ref{l1}, we prove that the modified Vickrey auction part performs well when $\max_i \bar{v}_i$ is large. \begin{lemma}\label{bound_vickrey} Let $\gamma=\sqrt{\frac{10}{9}}$. Then the modified Vickrey auction part get expect liquid welfare of $\frac{3\mu}{10} \max_i \bar{v}_i$. \end{lemma} We note that by choosing $\gamma$ arbitrarily close to $1$, we can get liquid welfare arbitrarily close to $\frac{\mu}{3} \max_i \bar{v}_i$. We choose the above value for the notational simplicity of the presentation. \begin{proof} If the highest two $\bar{v}_i$ are not relatively close to each other, namely $\bar{v}_{i_1} \geq \gamma \bar{v}_{i_2}$ ($i_1, i_2$ are as defined in Auction~\ref{RS}). Then the first modified Vickrey auction successes and gets expect liquid welfare of $\frac{\mu}{3} \max_i \bar{v}_i >\frac{3\mu}{10} \max_i \bar{v}_i$. If the highest two $\bar{v}_i$ are relatively close to each other, namely $\bar{v}_{i_1} < \gamma \bar{v}_{i_2}$. Then in the second modified Vickrey auction, with probability $\frac{1}{2}$ these two agents $i_1, i_2$ are put into different groups. When this event occurs, the second modified Vickrey successes and gains a revenue of at least $\frac{\max_i \bar{v}_i}{\gamma^2}$. According to Lemma~\ref{l1}, liquid welfare extract by the second modified auction is greater than this revenue, thus contributes at least $\frac{\max_i \bar{v}_i}{\gamma^2}$ liquid welfare. Therefore, the expect liquid welfare in this case is at least $\frac{2\mu}{3} \frac{1}{2} \frac{\max_i \bar{v}_i}{\gamma^2} =\frac{3\mu}{10} \max_i \bar{v}_i$. \end{proof} If $\max_i \bar{v}_i$ is already a significant fraction of the optimal solution, we are already done. In the following, we shall prove that the random sampling auction performs well when $\max_i \bar{v}_i$ is small. We first give some definitions. Let $\bar{v}_i(x)=\min\{v_i(x), B_i\}$ be the capped valuation for agent $i$. Then, for any allocation $\mathbf{x}=(x_1, \ldots, x_n)$ , we have $\overline{W}(\mathbf{x})=\sum_i \bar{v}_i(x_i)$. The following notion plays an important role in our analysis. We define \[D_i(p) = \argmax_{x\leq 1} \{\bar{v}_i(x)-x p \}. \] If there are multiple $x$ that achieve the maximum, we choose the largest one. It is very crucial that we use $\bar{v}_i(x)$ rather than $v_i(x)$ in the definition of $D_i(p)$. By this definition, we can directly see that for any $p>0$ and $x<D_i(p)$, we have $D_i(p)\leq \frac{B_i}{p}$ and $v_i(x)< B_i$. This $D_i(p)$ also gives a lower bound of agent $i$'s demand if there are enough availability of the good. Formally, we have the following lemma. \begin{lemma}\label{lemma:demand} Let $p > 0$ and $D_i(p) \leq X$. Then \[\argmax \limits_{x\leq \min\{ X, \frac{B_i}{p}\} } \{v(x)-xp \} \ge D_i(p) .\] \end{lemma} \begin{proof} The left hand side of the inequality is agent $i$'s most profitable fraction given price $p$ per unit and the total availability of good of $X$. For $x<D_i(p) \leq \min( X, \frac{B_i}{p}) $, we have \[ v(x)-xp = \bar{v}_i(x)-x p \leq \bar{v}_i(D_i(p))-D_i(p) p \leq v_i(D_i(p))-D_i(p) p.\] The first equality uses the fact that $v_i(x)< B_i$ for $x<D_i(p)$; the first inequality uses the definition of $D_i(p)$; and the last inequality uses the fact that $\bar{v}_i(x)\leq v_i(x)$ for any $x$. Since we always break ties in favor of larger $x$, the maximum of $v(x)-xp$ in the LHS is archived by $x\ge D_i(p)$. This completes the proof. \end{proof} Let $W(p) = \sum_i \bar{v}_i(D_i(p))$. The intuition for this notion is that with fixed price $p$, $W(p)$ gives the maximum liquid welfare from all agents. We present the following lemma giving an lower bound for this notion using $OPT$ and fixed price $p$. \begin{lemma}\label{lw} For any $p\geq 0$, $W(p) \geq OPT-p$. \end{lemma} \begin{proof} Let $(x_1, \ldots, x_n)$ be an instance of optimal allocation. By the definition of $D_i(p)$, we have $\bar{v}_i(D_i(p))-D_i(p) p \ge \bar{v}_i(x_i)-x_i p$ , and thus $\bar{v}_i(D_i(p)) \ge \bar{v}_i(x_i)-x_i p$. Sum up these inequalities for all $i\in [n]$, we get \[ \sum_i \bar{v}_i(D_i(p)) \ge \sum_i (\bar{v}_i(x_i)-x_i p) =OPT -p \sum_i x_i \ge OPT-p.\] \end{proof} The following facts on relationship between $OPT(S)$, $OPT(S)$ and $OPT$, are obvious. \begin{lemma} \label{l2} Let $(S,T)$ be a partition of $[n]$. Then $OPT(S)\leq OPT$, $OPT(T)\leq OPT$ and $OPT(S)+OPT(T)\geq OPT$. \end{lemma} By choosing $p=\beta OPT$ in Lemma \ref{lw}, we get that \[W(\beta OPT) = \sum_i \bar{v}_i(D_i(\beta OPT)) \geq OPT-\beta OPT=(1-\beta) OPT.\] This is a constant fraction of $OPT$. Since $OPT(S), OPT(T)\leq OPT$, the fraction of good demanded by agent $i$ in the random sampling auction is at least $D_i(\beta OPT)$ by Lemma \ref{lemma:demand} providing that there are enough fraction of the good remains. This is a good approximation of the optimal liquid welfare when each of $\bar{v}_i(D_i(\beta OPT))$ is small. Let $W = W(\beta OPT)$, $W_S=\sum_{i\in S} \bar{v}_i(D_i(\beta OPT))$ and $W_T=\sum_{i\in T} \bar{v}_i(D_i(\beta OPT))$. We first prove that both sets $S$ and $T$ get significant amount of demands at fixed price $\beta OPT$ with high probability in this case. \begin{lemma}\label{lemma:bound} If $\max_{i\in [n]} \bar{v}_i(D_i(\beta OPT)) \leq \alpha \cdot OPT $, then $$Pr(W_S, W_T \ge \frac{\beta}{2} OPT ) \geq 1-\frac{\alpha (1-\beta)}{(1-2 \beta )^2}.$$ \end{lemma} \begin{proof} Let $I_i$ to the random indicator variable for the event $i\in S$. Then $W_S = \sum_{i\in S}\bar{v}_i(D_i(\beta OPT))= \sum_{i\in [n]} \bar{v}_i(D_i(\beta OPT)) I_i$, ${\mathrm{E}}(W_S)=\frac{1}{2} W$ and \begin{align*} \begin{split} {\mathrm{Var}}(W_S) = \sum_{i\in S} {\mathrm{Var}}( \bar{v}_i(D_i(\beta OPT)) I_i) &= \sum_{i\in S} ({\mathrm{E}}((\bar{v}_i(D_i(\beta OPT)) I_i)^2) - {\mathrm{E}}(\bar{v}_i(D_i(\beta OPT)) I_i)^2)\\ &= \sum_{i\in S} \frac{1}{4} (\bar{v}_i(D_i(\beta OPT)))^2 \\ &\leq \frac{W}{\alpha OPT}\cdot \frac{1}{4} \cdot(\alpha OPT)^2 \\ &= \frac{1}{4} \alpha W OPT, \end{split} \end{align*} where the inequality uses the fact that $\max_{i\in V} \bar{v}_i(D_i(\beta OPT)) \leq \alpha OPT$. By Chebyshev's Inequality, we have: \begin{align*} Pr(\frac{\beta}{2} OPT \leq W_S \leq W-\frac{\beta}{2} OPT) & = Pr( |W_S - {\mathrm{E}}(W_S) | \leq \frac{W-\beta OPT}{2}) \\ &\geq 1- \frac{{\mathrm{Var}}(W_S)}{(\frac{W-\beta OPT}{2})^2} \\ &\geq 1-\frac{\alpha W OPT}{(W-\beta OPT)^2}\\ &\geq 1-\frac{\alpha (1-\beta)}{(1-2 \beta )^2}, \end{align*} where the last inequality uses the fact that $W\ge (1-\beta)OPT$. Since $W_S+W_T=W$, the event of $(\frac{\beta}{2} OPT \leq W_S \leq W-\frac{\beta}{2} OPT)$ is the same as the event of $(W_S, W_T \ge \frac{\beta}{2} opt)$. This completes the proof. \end{proof} The following lemma gives a bound of liquid welfare for the random sampling auction part. \begin{lemma}\label{bound_sampling} If $\max_i \bar{v}_i =\alpha \cdot OPT$, then the random sampling auction part gets at least expected liquid welfare of $(1-\mu) (1-\frac{\alpha (1-\beta)}{(1-2 \beta )^2}) (\frac{1}{2}-\frac{\alpha}{\beta})\beta OPT$. \end{lemma} \begin{proof} Since $\max_{i\in [n]} \bar{v}_i(D_i(\beta OPT)) \leq \max_i \bar{v}_i =\alpha \cdot OPT$, by Lemma \ref{lemma:bound} we know that $Pr(W_S, W_T \ge \frac{\beta}{2} OPT ) \geq 1-\frac{\alpha (1-\beta) }{(1-2\beta)^2}$ . We only bound the liquid welfare when this good event $(W_S, W_T \ge \frac{\beta}{2} OPT) $ occurs, which occurs with probability $(1-\frac{\alpha (1-\beta)}{(1-2 \beta )^2})$. Not only $ \bar{v}_i(D_i(\beta OPT))$ is bounded from above, $D_i(\beta OPT)$ is also bounded from above. From the definition of $D_i(\cdot)$, we know that $\bar{v}_i(D_i(\beta OPT)) - \beta OPT D_i(\beta OPT)\geq 0$. Therefore, \[D_i(\beta OPT) \leq \frac{\bar{v}_i(D_i(\beta OPT))}{\beta OPT} \leq \frac{\alpha}{\beta}.\] We first consider liquid welfare obtained by agents in $T$. If every agent $i \in T$ gets at least $v_i(D_i(\beta OPT))$ fraction of good, then the total liquid welfare of our auction is at least $W_T\geq \frac{\beta}{2} opt $. Otherwise, due to Lemma \ref{lemma:demand}, it must be the case that there is not enough good remains. Since $D_i(\beta OPT) \leq \frac{\alpha}{\beta}$, we know that at least $\frac{1}{2}-\frac{\alpha}{\beta}$ fraction of the good is sold. This extracts a revenue of $(\frac{1}{2}-\frac{\alpha}{\beta})\beta OPT(S)$ and thus also liquid welfare of this amount by Lemma \ref{l1}. Put these two cases together, the liquid welfare for group $T$ in our auction is at least $\min\{\frac{\beta}{2} OPT , (\frac{1}{2}-\frac{\alpha}{\beta})\beta OPT(S) \} = (\frac{1}{2}-\frac{\alpha}{\beta})\beta OPT(S)$. By similar argument, the liquid welfare from agents in group $S$ is at least $(\frac{1}{2}-\frac{\alpha}{\beta})\beta OPT(T)$. To sum up, the total expected liquid welfare is at least \[ (1-\mu) (1-\frac{\alpha (1-\beta)}{(1-2 \beta )^2}) (\frac{1}{2}-\frac{\alpha}{\beta})\beta ( OPT(S)+ OPT(T)) \geq (1-\mu) (1-\frac{\alpha (1-\beta)}{(1-2 \beta )^2}) (\frac{1}{2}-\frac{\alpha}{\beta})\beta OPT.\] \end{proof} Finally, we estimate the approximation ratio of Auction~\ref{RS}. \begin{lemma} \label{thmRS} Choosing $\beta=\frac{3}{10}, \gamma=\sqrt{\frac{10}{9}}$ and $\mu=\frac{5}{7}$, the approximation ratio of Auction~\ref{RS} is at most $34$. \end{lemma} \begin{proof} Assume that $\max_i \bar{v}_i =\alpha \cdot OPT$. By Lemma \ref{bound_vickrey} and Lemma \ref{bound_sampling}, the total expected liquid welfare is at least \[\left(\frac{3\mu}{10} \alpha + (1-\mu) (1-\frac{\alpha (1-\beta)}{(1-2 \beta )^2}) (\frac{1}{2}-\frac{\alpha}{\beta})\beta\right)OPT.\] Substitute $\beta$, $\mu$ with the above specified value and simplify, the above expression is $(\frac{5}{4}\alpha^2 -\frac{29}{112}\alpha + \frac{3}{70})OPT$. One can easily check that the minimum of this expression is greater than $\frac{1}{34}OPT$, thus our auction has an approximation ratio of at most $34$. \end{proof}
{'timestamp': '2015-02-16T02:05:38', 'yymm': '1407', 'arxiv_id': '1407.8325', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8325'}
arxiv
\section*{Appendix} \vspace*{-.05cm} \begin{table}[h!] \begin{minipage}{\textwidth} \begin{center} \begin{tabular}{c|c|c|c} $M_1$ & estimated \% & avg.\ \% & max.\ \%\\\hline 1 & 10.364 & 10.364 & 10.550\\ 2 & 7.333 & 7.346 & 7.380\\ 3 & 7.222 & 7.218 & 7.412\\ 4 & 7.774 & 7.740 & 7.870\\ 5 & 8.407 & 8.413 & 8.466\\ 10 & 10.745 & 10.732 & 10.860\\ 20 & 12.158 & 12.177 & 12.252\\ $\infty$ & 13.536 & & \end{tabular} \qquad \begin{tabular}{c|c|c|c} $M_1$ & estimated \% & avg.\ \% & max.\ \%\\\hline 1 & 2.334 & 2.333 & 2.465\\ 2 & 1.188 & 1.182 & 1.249\\ 3 & 1.125 & 1.131 & 1.228\\ 4 & 1.290 & 1.288 & 1.400\\ 5 & 1.546 & 1.549 & 1.678\\ 10 & 2.838 & 2.848 & 2.981\\ 20 & 3.876 & 3.878 & 4.007\\ $\infty$ & 4.978 & & \end{tabular} \end{center} \end{minipage} \caption{Remaining balls after one round, for $L_1=2$ (left) and $L_1=3$ (right), without ranks. 100 simulation runs were performed with $10^6$ balls each. The entry ``$\infty$'' gives the limit for $M_1\to \infty$.}\label{table:round_1} \end{table} \vspace*{-.05cm} \begin{table}[h!] \small \begin{minipage}{\textwidth} \begin{center} \begin{tabular}{c|c|c|c|c} $M_1$ & load & estimated \% & avg.\ \% & max.\ \%\\\hline \multirow{3}{*}{1} & 0 & 36.788 & 36.785 & 37.180\\ & 1 & 36.788 & 36.792 & 37.143\\ & 2 & 26.424 & 26.423 & 26.766\\ & & & & \\\hline \multirow{3}{*}{2} & 0 & 31.303 & 31.310 & 31.512\\ & 1 & 44.720 & 44.710 & 45.098\\ & 2 & 23.977 & 23.981 & 24.167\\ & & & & \\\hline \multirow{3}{*}{3} & 0 & 29.701 & 29.715 & 29.989\\ & 1 & 47.814 & 47.791 & 48.221\\ & 2 & 22.485 & 22.494 & 22.671\\ & & & & \\\hline \multirow{3}{*}{4} & 0 & 29.384 & 29.385 & 29.566\\ & 1 & 48.971 & 48.976 & 49.269\\ & 2 & 21.644 & 21.639 & 21.845\\ & & & & \\\hline \multirow{3}{*}{5} & 0 & 29.516 & 29.521 & 29.712\\ & 1 & 49.375 & 49.366 & 49.736\\ & 2 & 21.109 & 21.112 & 21.314\\ & & & & \\\hline \multirow{3}{*}{10} & 0 & 30.662 & 30.662 & 30.992\\ & 1 & 49.421 & 49.414 & 49.767\\ & 2 & 19.917 & 19.923 & 20.094\\ & & & & \\\hline \multirow{3}{*}{20} & 0 & 31.448 & 31.454 & 31.647\\ & 1 & 49.261 & 49.251 & 49.692\\ & 2 & 19.291 & 19.295 & 19.469\\ & & & & \\\hline \multirow{3}{*}{$\infty$} & 0 & 32.203 & & \\ & 1 & 49.089 & & \\ & 2 & 18.708 & & \\ & & & & \end{tabular} \qquad \begin{tabular}{c|c|c|c|c} $M_1$ & load & estimated \% & avg.\ \% & max.\ \%\\\hline \multirow{4}{*}{1} & 0 & 36.788 & 36.779 & 36.990\\ & 1 & 36.788 & 36.807 & 37.155\\ & 2 & 18.394 & 18.386 & 18.707\\ & 3 & 8.030 & 8.029 & 8.214\\\hline \multirow{4}{*}{2} & 0 & 33.822 & 33.814 & 34.151\\ & 1 & 39.056 & 39.067 & 39.473\\ & 2 & 21.609 & 21.606 & 21.877\\ & 3 & 5.513 & 5.513 & 5.635\\\hline \multirow{4}{*}{3} & 0 & 32.439 & 31.968 & 32.208\\ & 1 & 42.664 & 41.615 & 42.013\\ & 2 & 22.776 & 21.998 & 22.282\\ & 3 & 4.611 & 4.419 & 4.548\\\hline \multirow{4}{*}{4} & 0 & 31.057 & 31.055 & 31.250\\ & 1 & 43.105 & 43.122 & 43.584\\ & 2 & 21.910 & 21.881 & 22.174\\ & 3 & 3.993 & 3.942 & 4.037\\\hline \multirow{4}{*}{5} & 0 & 30.791 & 30.696 & 30.913\\ & 1 & 43.993 & 43.848 & 44.330\\ & 2 & 21.846 & 21.761 & 21.995\\ & 3 & 3.707 & 3.695 & 3.810\\\hline \multirow{4}{*}{10} & 0 & 30.913 & 30.919 & 31142\\ & 1 & 44.411 & 44.395 & 44.762\\ & 2 & 21.277 & 21.289 & 21.560\\ & 3 & 3.399 & 3.396 & 3.483\\\hline \multirow{4}{*}{20} & 0 & 31.386 & 31.383 & 31.600\\ & 1 & 44.394 & 44.391 & 44.932\\ & 2 & 20.931 & 20.937 & 21.280\\ & 3 & 3.290 & 3.289 & 3.443\\\hline \multirow{4}{*}{$\infty$} & 0 & 31.883 & & \\ & 1 & 44.362 & & \\ & 2 & 20.575 & & \\ & 3 & 3.181 & & \\ \end{tabular} \end{center} \end{minipage} \caption{Fractions of bins with a given load after round one, for $L_1=2$ (left) and $L_1=3$ (right), without ranks and 100 simulation runs with $n=10^6$. Entry ``$\infty$'' gives the limit for $M_1\to \infty$.}\label{table:round_1_loads} \end{table} \begin{table}[pb] \begin{minipage}{\textwidth} \begin{center} \begin{tabular}{c|c|c|c} $M_1$ & estimated \% & avg.\ \% & max.\ \%\\\hline 1 & 10.364 & 10.372 & 10.622\\ 2 & 4.536 & 4.542 & 4.703\\ 3 & 3.210 & 3.212 & 3.323\\ 4 & 2.764 & 2.760 & 2.858\\ 5 & 2.590 & 2.593 & 2.734\\ 10 & 2.471 & 2.471 & 2.608\\ 20 & 2.470 & 2.474 & 2.589\\ $\infty$ & 2.470 & & \end{tabular} \qquad \begin{tabular}{c|c|c|c} $M_1$ & estimated \% & avg.\ \% & max.\ \%\\\hline 1 & 2.334 & 2.340 & 2.434\\ 2 & 0.454 & 0.455 & 0.510\\ 3 & 0.206 & 0.205 & 0.234\\ 4 & 0.139 & 0.139 & 0.170\\ 5 & 0.115 & 0.115 & 0.138\\ 10 & 0.097 & 0.984 & 0.123\\ 20 & 0.096 & 0.974 & 0.123 \\ $\infty$ & 0.096 & & \end{tabular} \end{center} \end{minipage} \caption{Remaining balls at the end of the first round with ranking, for $L_1=2$ (left) and $L_1=3$ (right). 100 simulation runs were performed with $10^6$ balls each. The entry ``$\infty$'' gives the limit for $M_1\to \infty$.}\label{table:round_1_ranked} \end{table} \begin{table}[p] \small \begin{minipage}{\textwidth} \begin{center} \begin{tabular}{c|c|c|c|c} $M_1$ & load & estimated \% & avg.\ \% & max.\ \%\\\hline \multirow{3}{*}{1} & 0 & 36.788 & 36.794 & 37.014\\ & 1 & 36.788 & 36.771 & 37.203\\ & 2 & 26.424 & 26.435 & 26.591\\ & & & & \\\hline \multirow{3}{*}{2} & 0 & 33.475 & 33.484 & 33.739\\ & 1 & 37.585 & 35.576 & 37.881\\ & 2 & 28.939 & 28.940 & 29.128\\ & & & & \\\hline \multirow{3}{*}{3} & 0 & 32.584 & 32.578 & 32.816\\ & 1 & 38.042 & 38.045 & 38.415\\ & 2 & 29.374 & 29.377 & 29.572\\ & & & & \\\hline \multirow{3}{*}{4} & 0 & 32.255 & 32.239 & 32.408\\ & 1 & 38.253 & 38.279 & 38.603\\ & 2 & 29.492 & 29.482 & 29.660\\ & & & & \\\hline \multirow{3}{*}{5} & 0 & 32.112 & 32.112 & 32.300\\ & 1 & 38.350 & 38.357 & 38.726\\ & 2 & 29.530 & 29.531 & 29.700\\ & & & & \\\hline \multirow{3}{*}{10} & 0 & 32.022 & 32.026 & 32.265\\ & 1 & 38.427 & 38.418 & 38.770\\ & 2 & 29.551 & 29.556 & 29.696\\ & & & & \\\hline \multirow{3}{*}{20} & 0 & 32.021 & 32.037 & 32.245\\ & 1 & 38.428 & 38.394 & 38.822\\ & 2 & 29.551 & 29.569 & 29.732\\ & & & & \end{tabular} \qquad \begin{tabular}{c|c|c|c|c} $M_1$ & load & estimated \% & avg.\ \% & max.\ \%\\\hline \multirow{4}{*}{1} & 0 & 36.788 & 36.783 & 37.000\\ & 1 & 36.788 & 36.792 & 37.238\\ & 2 & 18.394 & 18.392 & 18.639\\ & 3 & 8.030 & 8.032 & 8.195\\\hline \multirow{4}{*}{2} & 0 & 35.958 & 35.957 & 36.256\\ & 1 & 36.845 & 36.843 & 37.179\\ & 2 & 18.890 & 18.898 & 19.200\\ & 3 & 8.307 & 8.301 & 8.501\\\hline \multirow{4}{*}{3} & 0 & 35.826 & 35.820 & 36.041\\ & 1 & 36.882 & 36.891 & 37.299\\ & 2 & 18.965 & 18.965 & 19.229\\ & 3 & 8.327 & 8.324 & 8.499\\\hline \multirow{4}{*}{4} & 0 & 35.785 & 35.790 & 36.064\\ & 1 & 36.900 & 36.894 & 37.226\\ & 2 & 18.984 & 18.982 & 19.292\\ & 3 & 8.330 & 8.335 & 8.484\\\hline \multirow{4}{*}{5} & 0 & 36.769 & 35.778 & 36.029\\ & 1 & 36.909 & 36.903 & 37.306\\ & 2 & 18.991 & 18.973 & 19.176\\ & 3 & 8.332 & 8.346 & 8.487\\\hline \multirow{4}{*}{10} & 0 & 35.755 & 35.747 & 35.949\\ & 1 & 36.918 & 36.934 & 37.295\\ & 2 & 18.995 & 18.986 & 19.245\\ & 3 & 8.332 & 8.333 & 8.494\\\hline \multirow{4}{*}{20} & 0 & 37.755 & 35.743 & 35.939\\ & 1 & 36.919 & 36.935 & 37.299\\ & 2 & 18.995 & 18.996 & 19.218\\ & 3 & 8.332 & 8.326 & 8.541 \end{tabular} \end{center} \end{minipage} \caption{Percentage of bins with a given load, for $L_1=2$ (left) and $L_1=3$ (right), with ranks. 100 simulation runs were performed with $10^6$ balls each.}\label{table:round_1_loads_ranked} \end{table} \section{Conclusion}\label{sec:conclusion} We presented a novel class of simple adaptive algorithms and an accompanying analysis technique for the parallel balls-into-bins problem. Analytical and experimental results show substantial improvements over previous algorithms. We hope that this work and the accompanying simulation code~\cite{scripts} provide tools for practitioners looking for a distributed balls-into-bins routine tailored to their needs. In this paper, we restricted our attention to the synchronous setting. However, we believe that the presented approach bears promise also for asynchronous systems. If bins process messages in the order of their arrival and message delays are independently and uniformly distributed, the resulting behavior of the algorithm would be identical if no messages from round $i+1$ arrive at a bin before all messages from round $i$ are processed. To handle this case, a bin can delay processing messages from rounds larger than $i$ until it is not expecting a response from a ball which it permitted to commit to it anymore. If a message from a later round is processed by a bin not awaiting any further responses, we argue that it is actually beneficial to favor the request over those of earlier rounds, since the respective ball is in greater need to commit to a bin. This reasoning suggests that the respective asynchronous variants of our algorithms provide promising heuristics for asynchronous systems; it also seems plausible that our analysis technique can be extended to establish worst-case bounds under asynchrony. Such hope does not exist for algorithms from the literature with low communication overhead, like H-{\scshape retry} or Stemann's collision algorithm, whose strategies cannot work without synchronization points. \section{Specific Results and Comparison to Other Algorithms}\label{sec:specific} Due to the sheer number of possible combinations of the parameters, we believe that an attempt to discuss the parameter space exhaustively would be fruitless. Therefore, in this section we discuss several combinations of parameters we consider of particular interest. To round off the presentation, we make a best effort at a fair comparison to algorithms from the literature; the relevant candidates here are variants of the Greedy algorithm~\cite{adler95,even09} and Stemann's collision algorithm~\cite{stemann96}. We will focus on choices of parameters that optimize for load, rounds, and the total number of messages, respectively, while not neglecting the other optimization criteria. We will constrain the number of bins a ball may contact in a given round to at most $5$; this more or less arbitrary choice serves to demonstrate that it is not necessary to enable balls to contact a very large number of bins concurrently. Given that the performance is strictly better with ranked messages, we examine only this case. We will keep the bin loads to a maximum of $2$ or $3$. Under this constraint, \tableref{table:round_1} and \tableref{table:round_1_ranked} show that there is little to gain in choosing $M_1>2$. Since a key advantage of adaptiveness is that it permits to keep the total number of messages small, we will hence keep $M_1\in \{1,2\}$. It turns out that even with these restrictions, we can do well in $3$ or even $2$ rounds. Given that $1$ round or maximum load $1$ are clearly insufficient, this leaves a reasonably small number of options to explore. The following results have been confirmed by simulations with $10^{6}$ and when necessary with $10^{7}$ balls to the extent possible; as observed in \sectionref{sec:preliminaries}, the computed expectations are close to the exact ones and the respective random variables are strongly concentrated. Spot checks confirmed that, as expected, standard deviations behave approximately as $\sqrt{n}$, i.e., for $10^4$ balls the relative deviations from expectations increase by factor $10$. Given the minuscule variations observed already for $10^6$ balls, we focus on this number in the following, with the goal of essentially eliminating one free parameter. We note that in most cases the expected number of remaining balls at the end of the experiment was far below $1$, so all balls were placed in the simulations. \textbf{Minimizing the Maximal Bin Load.} We use the following set of parameters: $3$ rounds, $L_1=L_2=L_3=2$, $M_1=2$, $M_2=5$, $M_3=5$. The computed fraction of remaining balls is $5.45\cdot 10^{-7}$.\footnote{Note that if the expected number of remaining balls is smaller than $1$, Markov's inequality gives a straightforward upper bound on the probability that not all balls commit. Because we apply Chernoff's bound only in rounds prior to the last when there are still sufficiently many balls, the computed expectations are still accurate.} The total number of messages sent is bounded from above by $n+2R$, where $R$ is the total number of requests sent, since each request receives a response and each ball sends a final message to commit. We compute $R\approx 2.23n$, implying that fewer than $5.5n$ messages are sent in total. The fractions of bins with loads $0$, $1$, and $2$ are approximately $31.4\%$, $37.3\%$, and $31.4\%$, respectively. \textbf{Minimizing the Number of Rounds.} Here, our goal is to place all balls in two rounds. We choose $M_1=2$ and $M_2=5$, and pick $L_1=2$ and $L_2=3$. Increasing the permitted load in the second round has the advantage that all bins still accept at least one ball, reducing the probability for a ball to have ``collisions'' for all requests. As a positive side effect, the load distribution improves compared to the case $L_1=L_2=3$, since fewer bins will have load $3$. An expected fraction of $5.7\cdot 10^{-10}$ of the balls remain, roughly $R\approx 2.23n$ messages are sent (i.e., fewer than $5.5n$ total messages), and the load distribution is about $31.98\%$, $37.37\%$, $29.32\%$, and $1.33\%$ for loads $0$, $1$, $2$, and $3$, respectively. \textbf{Minimizing Communication.} We choose $M_1=1$ and $M_2=M_3=2$. The load sequence is $(2,3,3)$; we note that compared to the sequence $(3,3,3)$, the expected number of remaining balls drop by a factor of roughly $250$. The expected fraction of remaining balls is roughly $4.88\cdot 10^{-8}$, $R\approx 1.21n$ (i.e., fewer than $3.5n$ messages are sent), and the load distribution is $33.12\%$, $36.60\%$, $27.45\%$, and $2.83\%$ for loads $0$ to $3$, respectively. \textbf{Maximizing the Probability to Terminate at Low Communication Overhead.} We choose $M_1=1$, $M_2=4$, and $M_3=5$. The load sequence is $(2,2,3)$; we note that compared to the sequence $(3,3,3)$, the expected number of remaining balls drops by a factor of roughly $10^7$. The expected fraction of remaining balls is roughly $5.9\cdot 10^{-19}$, $R\approx 1.41n$ (i.e., fewer than $3.85n$ messages in total), and the load distribution is $31.759\%$, $36.524\%$, $31.675\%$, and $0.042\%$ for loads $0$ to $3$, respectively. \textbf{Comparison to Variants of the Parallel Greedy Algorithm.} We simulated the simple (``one-shot'') Greedy algorithm~\cite{adler95} for $d=5$ contacted bins and $10^6$ balls and determined the fraction of balls that would be able to commit if we restricted the bin loads to $2$ and $3$, respectively. This requires roughly $11n$ messages and a fraction of $1.53\%$ and $2.21\cdot 10^{-4}$ of balls remained, respectively. The message complexity can be reduced by decreasing the number of bins contacted by each ball, but this would result in even fewer committing balls. For the multi-round version of Greedy~\cite{adler95} with $d=5$ and $n=10^7$, we determined the fraction of balls that could be placed in $3$ rounds (resulting in maximal load $3$). This also resulted in roughly $11n$ messages; after 2 rounds, a fraction $1.14\%$ of the balls remained, while all balls were placed in 3 rounds. In comparison, our algorithm with $L_1=2$, $L_2=3$, $M_1=1$, and $M_2=2$ retains a fraction of $6.1\cdot 10^{-5}$ of the balls after 2 rounds, i.e., performs notably better at lower communication complexity. In~\cite{even09}, the authors propose an adaptive variant of the multi-round Greedy algorithm called H-{\scshape retry} that runs for 3 rounds. After running an initial round of the multi-round Greedy algorithm with $d=2$ in the first round and trying to resolve conflicts in the second round, balls that are still unsuccessful contact 2 additional bins in the third round. The authors report simulation results. These indicate that the fraction of remaining balls after 3 rounds is slightly above $10^{-7}$ for bin loads of $3$; the number of messages is larger than $5n$. This is outperformed in all considered criteria by our algorithm for message and load sequences $(1,2,2)$ and $(2,3,3)$, respectively. In summary, we see that the Greedy algorithm compares unfavorably to our approach, even if we permit each ball to contact $4$ or $5$ different bins and send a substantially larger number of messages. \textbf{Comparison to Stemann's Collision Algorithm.} We ran Stemann's algorithm with accepted loads of $2$ and $3$, respectively. In Stemann's algorithm, each ball contacts 2 bins. In each round, the bins for which the accepted load threshold $L$ is large enough to accommodate all uncommitted balls that contacted them initially inform the respective balls, which then commit to (one of) the accepting bin(s). This process can be implemented by each ball (i) sending the initial requests, (ii) sending a commit message to the respective bin, and (iii) sending a ``will not commit'' message to the bin it initially contacted but does not commit to. Since there are $2n$ initial requests only, the total number of messages sent by bins will be at most $2n$. This results in a total of at most $6n$ messages. Roughly $n$ of these messages can be saved because balls do not need to send a ``will not commit'' message in case both of the bins they contacted accept them in the same round, and bins do not need to inform a ball that committed in an earlier round that it could be accepted. For load $2$ and $n=10^7$, after $3$ rounds the fraction of remaining balls is $2.09\%$, and $4.94n$ messages have been sent for the implementation described above. For load $3$, after $2$ rounds a fraction of $7.8\cdot 10^{-4}$ of the balls remained and $4.998n$ messages had been sent. In round $3$ the remaining balls all committed and the message total increased to $5n$. In comparison, for the parameters $M_1=1$, $M_2=M_3=2$, $L_1=2$, and $L_2=L_3=3$ we picked to minimize communication, after two rounds the fraction of remaining balls was $6.1\cdot 10^{-5}$; recall that the total number of messages sent was smaller than $3.5n$. We conclude that even under the constraint that balls send no more than $2$ messages in each round, our approach outperforms Stemann's algorithm in terms of the achievable trade-off between maximal load and communication. Moreover, since in Stemann's algorithm loads of $L$ are accepted right from the start, for $L=3$ a fraction of $5.51\%$ of the bins ended up with load $3$, whereas in our case only $2.83\%$ of the bins had this load. \section{The First Round}\label{sec:first} \subsection{Unranked Messages} In order to compute the (approximate) probability $p$ that a ball successfully commits in the first round, we need to determine how likely it is to receive a response to a message from a bin. To this end, we let all balls but one make their random choices and determine the expected number $\E[X_m]$ of bins with $m$ messages. As argued in \sectionref{sec:preliminaries}, the $X_m$ are sharply concentrated around their expectation, so this is sufficient for estimating $p$ with negligible error. Note also that, choosing $\gamma\in \Omega(\sqrt{\log n})$, we can apply the union bound over all $n$ balls to see that this estimate is accurate for \emph{all} balls concurrently. Since $M_1n$ messages are sent to u.i.r.\ bins in the first round, we have \begin{equation*} \E[X_m]= n\cdot \binom{M_1n}{m}\left(\frac{1}{n}\right)^m \left(1-\frac{1}{n}\right)^{M_1n-m} \approx n\cdot\frac{M_1^{m}}{m!} \left(1-\frac{1}{n}\right)^{M_1n} \approx n\cdot \frac{M_1^m}{e^{M_1}m!}. \end{equation*} Recall that each bin chooses a subset of at most $L_1$ received messages to respond to. The probability that a ball may commit is thus \begin{equation}\label{eq:p_round_1} p(M_1,L_1)\approx 1-(1-p_s(M_1,L_1))^{M_1}, \end{equation} where $p_s(M_1,L_1)$ is the probability that a single message does result in a response. Note that we ``held back'' the messages of the ball in question when approximating the number of bins with a given load. Hence we need to add one to the load of a contacted bin when determining the probability that it responds to a message. We compute \begin{equation*} p_s(M_1,L_1)\approx \sum_{m=0}^{L_1-2}\frac{M_1^m}{e^{M_1}m!} + \sum_{m=L_1-1}^{\infty} \frac{M_1^m}{e^{M_1}m!}\cdot \frac{L_1}{m+1} =\frac{1}{e^{M_1}}\sum_{m=0}^{L_1-2}\frac{M_1^m}{m!} + \frac{L_1}{M_1e^{M_1}}\sum_{m=L_1}^{\infty}\frac{M_1^m}{m!}. \end{equation*} Inserting these values into \equalityref{eq:p_round_1}, we obtain the (asymptotic) percentage of balls that will not commit in the first round, given in \tableref{table:round_1} in the appendix; simulation results from $100$ runs, each with $10^6$ balls and bins, confirm the tight concentration of the values. We see that increasing the number of messages beyond $2$ has little impact, with $M_1>3$ even being counterproductive. Intuitively, the congestion caused by many messages prevents bins from choosing the ``right'' ball to respond to. In the extreme case of each ball contacting each bin, the situation gets reversed: The bins ``throw'' $nL_1$ responses ``into $n$ balls'', and the probability for a ball to not receive a response is $(1-1/n)^{nL_1}\approx e^{-L_1}$. \textbf{Bin Loads.} To determine the load distribution after the first round, we compute the probability $p^{(k)}(M_1,L_1)$ that a given bin gets load $k\in\{0,\ldots,L_1\}$. To this end, we consider the number of messages $m$ it received and determine the probability that exactly $k$ out of $\min\{m,L_1\}$ (the number of responses the bin sent) balls will choose this bin. It holds that \begin{equation}\label{eq:p^k} p^{(k)}(M_1,L_1) \approx \sum_{m=k}^{L_1-1}\frac{\E[X_m]}{n}\cdot \binom{m}{k}p_c^k(1-p_c)^{m-k} +\sum_{m=L_1}^{\infty}\frac{\E[X_m]}{n}\cdot \binom{L_1}{k}p_c^k(1-p_c)^{L_1-k}, \end{equation} where $p_c=p_c(M_1,L_1)$ is the probability that one of the balls contacted by the bin indeed chooses the bin to commit to. As the ball picks uniformly from the responding bins, we can instead order the ball's messages' destinations randomly and pick the first responding bin according to this order. We know that the considered bin is among them and---up to negligible error---the other messages will be sent to different bins. Therefore, we can sum over all $M_1$ possible positions of the target bin and multiply $1/M_1$ (the probability that it is at this position) with the probability that all previous messages do not receive a response. Writing $p_s=p_s(M_1,L_1)$, we get \begin{equation}\label{eq:p_c} p_c\approx\sum_{i=0}^{M_1-1}\frac{(1-p_s)^i}{M_1} =\frac{1-(1-p_s)^{M_1}}{p_s M_1}. \end{equation} \tableref{table:round_1_loads} in the appendix lists, for varying $M_1$, the derived estimates of $p^{(k)}(M_1,2)$ and $p^{(k)}(M_1,3)$, respectively, and compares to results from simulations. \subsection{Ranked Messages} To avoid the issue that increasing $M_1$ is detrimental, we rank the messages of each node, and bins give preference to messages of small rank. We can immediately see that this guarantees that the number of allocated balls must increase with the number of sent messages, since messages of higher rank do not affect whether a bin responds to a message of small rank. We already computed the number of bins receiving a certain number of messages given $M_1$. We now reuse this information as follows, where $X_m(k)$ denotes the expected number of bins receiving $m$ messages given that each ball sends $k$ messages. The probability $p_i(L_1)$ that a message with rank $i\in \{1,\ldots,M_1\}$ receives a response can be inferred as \begin{equation*} p_i(L_1)\approx \sum_{m=0}^{L_1-1} \frac{\E[X_m(i-1)]}{n}\cdot \sum_{m'=0}^{\infty}\frac{\E[X_{m'}(1)]}{n} \cdot\min\left\{\frac{L_1-m}{m'+1},1\right\}, \end{equation*} where $\E[X_m(i-1)]/n$ is the probability of a bin to receive $m$ messages of rank smaller than $i$, $\E[X_{m'}(1)]/n$ is the probability to receive $m'$ messages of exactly rank $i$ (different from the considered message of rank $i$), and $\min\{L_1-m/(m'+1),1\}$ is the probability that a bin receiving these messages will choose to respond to the ball we consider. Here we exploit that all respective decisions are made independently and messages of rank larger than $i$ are of no concern. Observe that the inner sum equals $p_s(1,L_1-m)$. Inserting this and the values for $\E[X_m]$ with $M_1=i-1$ we computed before, we obtain\footnote{We use the convention that $0^0=1$ here to ensure that the terms are correct for $i=1$ as well.} \begin{equation*} p_i(L_1)\approx \sum_{m=0}^{L_1-1} \frac{(i-1)^m}{e^{i-1}m!}\,\cdot \, p_s(1,L_1-m). \end{equation*} We conclude that the probability $p_{\text{ranked}}(M_1,L_1)$ for a ball to commit in the first round using ranked messages is \begin{equation*} p_{\text{ranked}}(M_1,L_1)=1-\prod_{i=1}^{M_1}(1-p_i(L_1)). \end{equation*} Some values together with the results from 100 simulation runs with $10^6$ balls and bins each are given in \tableref{table:round_1_ranked} in the appendix. \textbf{Bin Loads.} Approximating the bin loads algebraically for the algorithm with ranking is tedious. Since the load is a function of the number of messages of each rank received, the number of summands increases rapidly with $M_1$. However, the associated terms decrease exponentially, implying that the number of summands that need to be considered can be reasonably bounded. To approximate the probability $p_{\text{ranked}}^{(k)}(M_1,L_1)$ that a bin has load $k\in \N$ at the end of the first round with ranking, we sum over all vectors $(k_1,\ldots,k_{M_1}),(m_1,\ldots,m_{M_1})\in \N_0^{M_1}$ that represent feasible combinations of the number of balls $m_i$ sending a rank $i$ message to the bin and the number $k_i$ of such balls that commit to the bin due to a response to such a message, respectively. Hence, the vectors must clearly satisfy that $m_i\geq k_i$ for all $i$ and that $k=\sum_{i=1}^{M_1}k_i$. However, it is also necessary that for each $i$ with $k_i\neq 0$, the bin actually responds to at least $k_i$ messages of rank $i$. This holds true if (and only if) for each $i$, $r_i:=\max\{\min\{m_i,L_1-\sum_{j=1}^{i-1}m_j\},0\}\geq k_i$. Out of the $r_i$ balls receiving a response, exactly $k_i$ need to commit to the bin. Overall, we have that \begin{equation*} p_{\text{ranked}}^{(k)}(M_1,L_1) \approx \sum_{\substack{(k_1,\ldots,k_{M_1})\in \N_0^{M_1}\\ k=\sum_{i=1}^{M_1}k_i}} \sum_{\substack{ (m_1,\ldots,m_{M_1})\in \N_0^{M_1}\\ \forall i\in\{1,\ldots,M_1\}:\;r_i\geq k_i}} \prod_{i=1}^{M_1}\frac{\E[X_{m_i}(1)]}{n}\cdot \binom{r_i}{k_i}\cdot p_c(i)^{k_i}(1-p_c(i))^{r_i-k_i}, \end{equation*} where \begin{equation*} p_c(i)=p_c(i,L_1)=\prod_{j=1}^{i-1}1-p_j(L_1) \end{equation*} is the probability that a ball receiving a response to its message of rank $i$ is committing to the respective bin (i.e., it did not receive a response to a message of smaller rank). Similar to the previous cases, this infinite sum can be transformed into a finite one, exploiting that we know the limit $\sum_{m_i=L_i-\sum_{j=1}^{i-1}m_j}^{\infty}\E[X_{m_i}(1)]$. A program can easily approximately compute $p_{\text{ranked}}^{(k)}(M_1,L_1)$.\footnote{As $L_i$ and thus $k$ is small, the exponential number of summands in $k$ does not result in prohibitive complexity.} \tableref{table:round_1_loads_ranked} in the appendix lists the computed bin loads and compares to the results from simulation. \section{Introduction \& Related Work} Consider a distributed system of $n$ anonymous balls and $n$ anonymous bins, each having access to (perfect) randomization. Communication proceeds in synchronous rounds, each of which consists of the following steps. \begin{compactenum} \item Balls perform computations and send messages to bins. \item Bins receive messages, perform computations, and respond to the received messages. \item Each ball may commit to a bin, inform it, and terminate.\footnote{Observe that this step can be safely merged with the first step of the subsequent round. Hence, the communication delay incurred by an $r$-round algorithm equals that of $r$ round trips plus the one of a final commit message.} \end{compactenum} The main goals are to minimize the maximal number of balls committing to the same bin, the number of communication rounds, and the number of messages. This fundamental load balancing problem has a wide range of applications, including job assignment tasks, scheduling, low-congestion routing, and hashing, cf.~\cite{mitzenmacher01}. The first distributed formulation of the problem was given in 1995~\cite{adler95}. Among other things, in this work it was shown that even a single round of communication permits an exponential reduction of the bin load compared to the trivial solution of each ball committing to a random bin, without increasing the number of messages bins and balls send by more than a constant factor. In the sequel, a number of publications established a clear picture of the asymptotics of the problem~\cite{even09,even10,lenzen11tight,stemann96}. Algorithms that run for $r$ rounds and are \emph{non-adaptive}---each ball chooses the bins it communicates with in advance---and \emph{symmetric}---contacted bins are chosen uniformly and independently at random (u.i.r.)---can obtain maximal bin load $\Theta((\log n/\log \log n)^{1/r})$~\cite{even10,stemann96}.\footnote{The lower bound applies for constant values of $r$ and the number of contacted bins only.} Symmetric algorithms sending $\BO(n)$ messages in total require at least $(1-o(1))\log^*n-\log^*L$ rounds to achieve bin load $L$, while $\log^* n+\BO(1)$ rounds are sufficient for bin load $2$~\cite{lenzen11tight}. Finally, without such constraints, a maximal bin load of $3$ can be guaranteed within $\BO(1)$ rounds~\cite{lenzen11tight}. Unfortunately, this information is of little help to a programmer or system designer in need of a distributed balls-into-bins subroutine. How should one decide which algorithm to pick? For a reasonable value of $n$, say $10^5$, the constants in the above bounds are decisive. For instance, $\log 10^5/\log \log 10^5\approx 4$, whereas $\log^* 10^5=5$. Moreover, some bounds are not very precise. For example, Stemann proves no results for maximal bin loads smaller than $32$~\cite{stemann96}. This is a constant, but arguably of little practical relevance: For $n=10^9$, letting each ball commit to a random bin results in maximal bin load smaller than $16$ with probability larger than $99.98\%$. Yet, our simulations show that Stemann's algorithm performs better than an adaptive variant of the multi-round Greedy algorithm, for which loads of 3-4 in 3 rounds are reported for $n\in[10^6,8\cdot 10^6]$~\cite{even09}. The symmetric algorithm from~\cite{lenzen11tight} guarantees an even better bin load of $2$, but, again, the asymptotic round complexity bound of $\log^* n+\BO(1)$ seems overly cautious: the corresponding lower bound basically just shows that a single round is insufficient to this end. In summary, the existing results are inconclusive for relevant parameter ranges: values of $n$ that may occur in practice admit very few rounds and small loads, even for symmetric algorithms. Hence, it seems natural to explore this region, aiming for accurate estimates and small loads. \textbf{Contribution.} We analyze two types of simple symmetric algorithms. The first class subsumes the symmetric algorithm from~\cite{lenzen11tight}. The second, novel class strictly improves on the first in terms of the number of balls that can be placed with the same maximal bin load, number of rounds, and message complexity. In each round $i\in\N$, our algorithms perform the following steps. \begin{compactenum} \item Each ball sends a number $M_i\in \N$ of messages to uniformly independently random (u.i.r.) bins. These messages are either identical or are ranked $1,\ldots,M_i$. \item A bin of current load $\ell$ responds to (up to) $L_i-\ell$ balls, where smaller ranks are preferred. Ties are broken by choosing uniformly at random. \item Each ball that receives at least one response commits, either to a random responding bin (for unranked messages), or the responding bin to which it sent the message of smallest rank. \end{compactenum} We further restrict that $L_{i+1}\geq L_i$ for all $i\in \N$, since there is little use in decreasing the accepted loads in a later round. An algorithm is thus described by the sequence $(M_i)_{i\in \N}$, the increasing sequence $(L_i)_{i\in \N}$, and whether messages are ranked or not. We provide an analytical iterative method for computing accurate estimates of the number of committed balls and the load distribution after each round. While no technical innovation is required to this end, finding accurate and simple expressions for the involved expectations proved challenging. Moreover, we devised a program that, given the above parameters, computes these values. Our approach extends to the general case where there is a different number of balls and bins. We complement our analysis by simulations, which serve to double-check the correctness of the analytical bounds and confirm that they are highly accurate for practical values of $n$. Furthermore, we compare to the algorithms from the literature by means of simulation.\footnote{The code is available online~\cite{scripts}.} \textbf{Main Results.} The derived bounds (confirmed by our simulations) show that symmetric algorithms can achieve bin loads of $2$ or $3$ within $2$ to $3$ rounds, using fewer than $6n$ messages.\footnote{Note that sending fewer than $3n$ messages implies that some balls commit without receiving any message.} Since we allow for arbitrary sequences $(M_i)_{i\in \N}$, we can also infer what can be achieved if the number of messages balls sent in each round is capped at a small value. For instance, with $M_1=1$ and $M_2=M_3=2$, $n=10^6$ balls can reliably placed within $3$ rounds, with a maximal bin load of $3$ and fewer than $3.5n$ messages in total. Here it proves useful to pick $L_1=2$ and increase the permitted load to $3$ only in later rounds, ensuring that balls can be placed reliably despite sending few messages. For all the choices of parameters we considered, previous algorithms are consistently outperformed by our approach. Due to the variety of parameters, algorithms, and optimization criteria, it is difficult to provide a general answer to the question which algorithm to use (with which parameters). Therefore, we consider the method by which we derive our bounds and the program code permitting their fast and simple evaluation to be of independent interest. In a practical setting, we expect that the available knowledge on constraints and optimization criteria will make the search space sufficiently small to tailor solutions with good performance using the toolbox we provide. \textbf{Paper Organization.} In \sectionref{sec:preliminaries}, we discuss why all random variables of interest are highly concentrated around their expectations and introduce notational conventions. In \sectionref{sec:first}, we analyze the first round of our algorithms. We discuss how to extend the approach inductively to rounds $2,3,\ldots$ in \sectionref{sec:later}, as well as how to apply it to the general case of $m\neq n$ balls. In \sectionref{sec:specific}, we evaluate a few choice sets of parameters to shed light on the performance of the resulting algorithms and, by means of simulation, compare to algorithms from the literature. Finally, in \sectionref{sec:conclusion} we draw some conclusions. \section{Later Rounds}\label{sec:later} Having determined the remaining balls and bin loads at the end of a given round $r-1$, we can compute these values for round $r$ in a similar fashion as we did for round $1$; for the considered class of algorithms, no other parameters are of relevance. We continue to exploit the strong concentration of these random variables, enabling us to base our computations on expected values without introducing substantial errors---as long as the number of balls does not become very small. Once, say $\polylog n$ balls remain, it is likely that all balls commit in the next round; the computed probability bounds for commitment and Markov's inequality then yield an estimate of the probability to terminate.\footnote{Note that our approximation introduces an error of up to $\polylog n/\sqrt{n}$ in the probability to receive a response to a message, which is to be taken into account in this bound.} To simplify the notation, we will use a generic notation with respect to some variables both for unranked and ranked messages. By $Y_{\ell}$ we denote the random variable counting the number of bins with load $\ell\in \{0,\ldots,L_{r-1}\}$ at the end of round $r-1$. Denote by $n_r$ the number of balls at the beginning of round $r$ and set $\alpha:=M_r\E[n_r]/n$. The expected number of bins receiving $m$ messages in round $r$ is approximately \begin{equation*} \E[X_m]= n\cdot \binom{M_r n_r}{m} \left(\frac{1}{n}\right)^m\left(1-\frac{1}{n}\right)^{M_r n_r-m} \approx n\cdot \frac{\alpha^m}{e^{\alpha}m!}. \end{equation*} As all random choices are made uniformly and independently, it follows that the expected number of bins $X_{\ell,m}$ of load $\ell$ that receive $m$ messages is roughly $\E[X_{\ell,m}]\approx \alpha^m\E[Y_{\ell}]/(e^{\alpha}m!)$. \subsection{Unranked Messages} To estimate the probability $p_s$ that a specific message receives a response in the unweighted case, we again fix all messages' destinations except for one. Now we simply sum over all combinations of $\ell$ and $m$, yielding \begin{equation*} p_s\approx \sum_{\ell=0}^{L_{r-1}}\sum_{m=0}^{\infty} \frac{\E[X_{\ell,m}]}{n}\cdot\min\left\{1,\frac{L_r-\ell}{m+1}\right\} \approx \sum_{\ell=0}^{L_{r-1}}\frac{\E[Y_{\ell}]}{n}\sum_{m=0}^{\infty} \frac{\alpha^m}{e^{\alpha}m!}\cdot\min\left\{1,\frac{L_r-\ell}{m+1}\right\}. \end{equation*} Analogously to \eqref{eq:p_round_1}, the probability that a ball commits is $p\approx 1-(1-p_s)^{M_r}$ and can thus be inferred easily from $p_s$. \textbf{Bin Loads.} To determine the probability $p^{(k)}$ for a bin to have load $k\in \{0,\ldots,L_r\}$ at the end of round $i+1$, we follow the same approach. We sum over the loads at the beginning of the round, where each summand is the probability to have load $\ell\in \{0,\ldots,L-{r-1}\}$ at the beginning of the round multiplied by the probability to have load $k$ at the end of the round conditional to this event. Note that having loads $\ell$ and $k$ at the beginning and end of the round, respectively, is equivalent to being empty, accepting up $L_r-\ell$ balls, and attaining load $k-\ell$. Using \eqref{eq:p^k} with these replacements, we obtain \begin{align*} p^{(k)}& \approx \sum_{\ell=0}^{L_{r-1}}\frac{\E[Y_{\ell}]}{n}\cdot\left( \sum_{m=k-\ell}^{L_r-\ell-1}\frac{\E[X_{m}]}{n}\cdot \binom{m}{k-\ell}p_c^{k-\ell}(1-p_c)^{m-k+\ell}\right.\\ &\qquad\qquad\qquad\left.+\sum_{m=L_r-\ell}^{\infty}\frac{\E[X_{m}]}{n} \cdot\binom{L_r-\ell}{k-\ell}p_c^{k-\ell}(1-p_c)^{L_r-k+\ell}\right), \end{align*} where \begin{equation*} p_c\approx\sum_{i=0}^{M_r-1}\frac{(1-p_s)^i}{M_r} =\frac{1-(1-p_s)^{M_r}}{p_s M_r} \end{equation*} as in \eqref{eq:p_c}. \subsection{Ranked Messages} Applying the same pattern, deriving the expressions for the algorithm with ranking is now straightforward. We sum over the possible bin loads $\ell\in \{0,\ldots,L_{r-1}\}$ from the previous round, weigh with the probability for a bin to have this load, and multiply with the probability for a bin with (effective) maximal bin load of $L_r-\ell$ in round $r$ to have $k-\ell$ balls commit to it. \begin{equation*} p_i\approx \sum_{\ell=0}^{L_{r-1}}\frac{\E[Y_{\ell}]}{n}\cdot \sum_{m=0}^{L_r-\ell-1} \frac{\E[X_{m}(i-1)]}{n}\cdot \sum_{m'=0}^{\infty}\frac{\E[X_{m'}(1)]}{n} \cdot\min\left\{\frac{L_r-\ell-m}{m'+1},1\right\}, \end{equation*} Here $X_m(i-1)$ and $X_{m'}(1)$ denote the variables counting the number of bins receiving $m$ messages of rank smaller than $i$ and $m'$ messages of rank $i$, respectively (i.e., $X_m$ when assuming that $i-1$ or $1$ messages are sent per ball, respectively). As in the first round, the probability for a ball to commit to some bin then is \begin{equation*} p_{\text{ranked}}=1-\prod_{i=1}^{M_r}(1-p_i). \end{equation*} \textbf{Bin Loads.} To determine the bin loads at the end of the round, we need to adjust $r_i:=\max\{\min\{m_i,L_r-\ell-\sum_{j=1}^{i-1}m_j\},0\}$, i.e., take into account the bin load $\ell\in \{0,\ldots,L_{r-1}\}$ carried over from the previous round, and obtain \begin{equation}\label{eq:p_k_general} p_{\text{ranked}}^{(k)}\approx \sum_{\ell=0}^{L_{r-1}}\frac{\E[Y_{\ell}]}{n} \sum_{\substack{(k_1,\ldots,k_{M_r})\in \N_0^{M_r}\\ k-\ell=\sum_{i=1}^{M_r}k_i}} \sum_{\substack{ (m_1,\ldots,m_{M_r})\in \N_0^{M_r}\\ \forall i\in\{1,\ldots,M_r\}:\;r_i\geq k_i}} \prod_{i=1}^{M_r}\frac{\E[X_{m_i}(1)]}{n}\cdot \binom{r_i}{k_i}\cdot p_c(i)^{k_i}(1-p_c(i))^{r_i-k_i}, \end{equation} where \begin{equation*} p_c(i)=\prod_{j=1}^{i-1}1-p_j. \end{equation*} Apart from $r_i$ and the weighted summation over $\ell\in \{0,\ldots,L_{r-1}\}$, the only other change here is that $\sum_{i=1}^{M_r}k_i=k-\ell$, since only $k-\ell$ additional balls need to commit to the bin to reach load $k$. \subsection{Different Numbers of Balls and Bins} Note that the expression we gave in this sections can also be applied to the first round, where we simply have that $Y_0=n$ and $Y_{\ell}=0$ for all $\ell \neq 0$. Setting $n_1\neq n$ merely changes $\alpha$, without affecting the expressions in any other way. Thus, our analysis can be applied to the general case of different numbers of balls and bins. However, if $n_1\gg n$, $L_i$ will have to be chosen fairly large. This will render computing the bin loads with ranked messages using \eqref{eq:p_k_general} problematic, since the number of summands with non-negligible contribution grows rapidly. This could be tackled by grouping them together into blocks and use approximate terms (with small error) to simplify the expressions. We note that $n_1\gg n$ also implies that even the trivial algorithm placing balls uniformly at random performs well, though, so we refrain from addressing this issue formally. \section{Preliminaries}\label{sec:preliminaries} \textbf{Concentration Bounds.} For the considered family of algorithms, sets of random variables like whether bins receive at least $m\in \N$ messages in a given round are not independent. However, they are \emph{negatively associated}, implying that Chernoff's bound is applicable \cite{dubhashi96}. Denoting for any constant $m$ by $X_{\geq m}$ ($X_m$) the number of bins receiving at least (exactly) $m$ messages in round $1$, it follows for any $\delta>0$ that \begin{align*} {}& P(|X_m-\E[X_m]|>\delta \E[X_m])\\ \leq {}& P\left(|X_{\geq m}-\E[X_{\geq m}]|>\frac{\delta \E[X_{\geq m}]}{2}\right) + P\left(|X_{\geq m+1}-\E[X_{\geq m+1}]|>\frac{\delta \E[X_{\geq m}]}{2}\right)\\ \leq {}& P\left(|X_{\geq m}-\E[X_{\geq m}]|>\frac{\delta \E[X_{\geq m}]}{2}\right) + P\left(|X_{\geq m+1}-\E[X_{\geq m+1}]|>\frac{\delta \E[X_{\geq m+1}]}{2}\right)\\ \leq {}& 4e^{-\delta^2\min\{\E[X_{\geq m}],\E[X_{\geq m+1}]\}/16}, \end{align*} where we applied Chernoff's bound to each of the random variables in the last step. Note that (i) trivially $\E[X_{m}]\in O(n)$ and (ii) $\E[X_{m}]$ decreases exponentially in $m$ for $m\geq M_1\in \BO(1)$, the expected number of messages a bin receives in round $1$, as messages are sent to u.i.r.\ bins. Hence, for any natural number $\gamma$, \begin{align*} {}& P\left(\sum_{m\in \N_0}|X_m-\E[X_m]|\leq \gamma^3\sqrt{n}\right)\\ \geq {}& 1-\sum_{m=0}^{\gamma^2-1}P\left(|X_m-\E[X_m]|> \gamma\sqrt{n}\right) -\sum_{m=\gamma^2}^{M_1n}P[X_m>0] \tag*{union bound}\\ \in {}& 1-\gamma^2e^{-\Omega(\gamma^2)}-\sum_{m>\gamma^2}^{M_1n}n\cdot e^{-\Omega(m/M_1)} \tag*{Chernoff (left), Markov + union bound (right)}\\ \subseteq {}& 1-e^{-\Omega(\gamma^2)+\BO(\log n)}.\tag*{$M_1$ constant} \end{align*} Put simply, assuming that the random variables $X_m$ attain their expected value in all computations introduces only a marginal error: The probability that, say, more than $\sqrt{n}\log^3 n$ bins receive a different number of messages than they would if we just ``assigned'' messages according to expecations is at most $n^{-\Omega(\log n)}$. Similar reasoning applies in case the algorithm utilizes ranks. \begin{corollary}[follows from \cite{dubhashi96} as shown above]\label{coro:concentration} For any $\gamma\in \N$, \begin{equation*} P\left(\sum_{m\in \N_0}|X_m-\E[X_m]|\leq \gamma^3\sqrt{n}\right)\in 1-e^{-\Omega(\gamma^2)+\BO(\log n)}. \end{equation*} \end{corollary} Once the message distribution is fixed, bins decide to which balls to respond. Since ties are broken by u.i.r.\ choices of the bins, the results from \cite{dubhashi96} show that the number of balls receiving a certain number of responses also obey Chernoff's bound. Finally, we conclude that the random variables counting the number of bins with a given load after the first round is subject to Chernoff's bound as well. In summary, all the variables we will consider are tightly concentrated. By induction, this reasoning extends to (a constant number of) subsequent rounds. When the total number of sent messages becomes smaller, also the deviation from the expected values we need to consider becomes smaller (i.e., we can replace the factor $\sqrt{n}$ above by the root of the largest considered expected value); concentration for the number of bins receiving no message follows from the bounds for the other variables. Overall, these considerations imply that for the purposes of this work, it is sufficient to assume that the aforementioned random variables match their expectation, as the induced error is negligible. Simulations will confirm this view; for the sake of a straightforward presentation, we hence refrain from phrasing statements analogous to Corollary~\ref{coro:concentration} for the random variables considered throughout this paper. \textbf{Notational Convention.} Given the above observations, we will base our analysis on expected values. This entails that we implicitly neglect terms of lower order, and it will be convenient to do so when computing probabilities as well. For instance, cleary \begin{equation*} \frac{\binom{n}{k}}{n^k/k!}=\prod_{i=1}^{k}\frac{n-(i-1)}{n} \geq \left(1-\frac{k}{n}\right)^k\geq 1-\frac{k^2}{n}. \end{equation*} Using the approximation $\binom{n}{k}\approx n^k/k!$ for $k\in \BO(n^{1/4})$ when computing a probability will thus not incur a total error of more than $\BO(\sqrt{n})$ when infering an expectation. Therefore, we adopt the convention of writing $x\approx y$ whenever $x\in (1\pm \polylog n / \sqrt{n})y$ (for probabilities or expectations).
{'timestamp': '2014-08-01T02:10:20', 'yymm': '1407', 'arxiv_id': '1407.8433', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8433'}
arxiv
\section{Introduction}\label{sec1} Genome-wide association studies (GWAS) aim to detect associated genetic factors by scanning up to several million genetic variants over the whole genome. Although many genetic factors have been successfully identified for human diseases, genes discovered to date account for only a small proportion of overall genetic contribution to many complex traits [\citet{Kraft2009,McCarthy2008}]. The remaining genetic factors to be detected likely have weak associations at the population level and are relatively rare among the huge number of candidates in the whole genome [\citet{Goldstein2009,Wade2009}]. Besides the efforts to increase sample size and improve disease classification, it is desirable to develop statistical methods that more effectively detect these rare and weak genetic signals not yet discovered. Two types of statistical association methods are commonly used to analyze GWAS data: (1) single-SNP methods that analyze the associations between a trait and individual SNPs, and (2) SNP-set methods that study the associations between a trait and sets of SNPs. SNP-set methods were expected to be more promising than single-SNP methods from a biological perspective. Since multiple SNPs within the same gene, pathway or other physical and functional genomic segment could jointly affect disease risk, joint analysis of a set of such SNPs may better reveal the underlying mechanisms of complex traits than individual SNPs do. In the past years, many SNP-set methods have been proposed [\citet{Ballard2010,Hoh2003,Hoh2001,Li2009,LuoXiong2010,Mukhopadhyay2010,Peng2010,Wang2008,Wang2007,Yang2008}]. Despite the encouraging progress in the literature, there lacks a statistical foundation for when and why the SNP-set methods would outperform single-SNP methods. In fact, some SNP-set methods are not automatically better, as we will show in this paper. At the same time, it is critical to know the limit of any statistical association methods, as well as the ``best'' of the methods, especially when genetic effects are rare and weak. In this paper, we approach these problems from a statistical perspective. For a set of $L$ SNPs of $n$ individuals, we consider an additive genetic model \begin{equation} \mathbf{Y}=\beta_{0}+\beta_{1}\mathbf{X}_{1}+ \beta_{2}\mathbf{X _{2}+\cdots+\beta_{L} \mathbf{X}_{L}+\bolds{\varepsilon}, \label{equ: genetic model} \end{equation} that is frequently used in GWAS [\citet{Kraft2009}]. The linear model is likely an oversimplification but we develop our ideas for this one first. See further comments in Section~\ref{Sect: Discu}. Here $\mathbf{Y =(Y_{1},\ldots,Y_{n})^{\prime}$ is the trait vector, and $\mathbf{X _{j}= ( X_{1j},\ldots,X_{nj} ) ^{\prime}$ is the genotype vector of the $j$th SNP, $1\leq j\leq L$. The error term $\bolds{\varepsilon}= ( \varepsilon _{1},\ldots,\varepsilon_{n} ) ^{\prime}\sim N ( \mathbf {0},\sigma ^{2}\mathbf{I} ) $ is independent of the genotypes and can be used to represent other genetic and environmental variations [\citet {Falconer1996}]. The variance parameter $\sigma^{2}$ is usually unknown and needs to be estimated. The coefficient vector $\beta =(\beta_{1},\beta_{2},\ldots,\beta_{L})^{\prime}$ is unknown to us, but is presumably rare in the sense that only a few of the coordinates of $\beta$ are nonzero. We call the $j$th coordinate of $\beta$ a ``signal'' if $\beta_{j}\neq0$ and otherwise a ``noise.'' The term ``rare signal'' should not be confused with ``rare genetic variation.'' Signal rarity is the sparsity among features, but rare genetic variation is the sparsity among samples. In the literature, while signal rarity is well defined, signal weakness is a much more vague notion. As we will show below, signal weakness may result from weak genetic effect, small sample size and/or small genetic variation. Signal weakness is one of the main challenges in analyzing big data, such as GWAS data: The signals are generally very subtle and hard to find, and it is easy to be fooled. Statistical literature on linear regression modeling has focused largely on the goal of separating the signals from the noise [\citet {Ayers2010,Guan2011,Hoggart2008,WuTT2009,Xie2011}]. While this goal may provide a perfect solution, it is hard to reach due to a high demand for strong signals and is often not necessary in GWAS practice either. Thus, in this paper, we are primarily interested in the problem of \textit{signal detection}, where the goal is to discover the associated SNP-sets rather than to identify the individually associated SNPs. To understand why signal detection is important, from a statistics point of view it can be shown that given a rarity level of the signals there is a threshold effect on the signal strength. That is, signals falling under such a threshold cannot be separated from noise: for any procedure the sum of the number of signals that are misclassified as noises and the number of noises that are misclassified as signals cannot get substantially smaller than the number of signals. Nonetheless, in many cases while signal rarity and signal strength prohibit us to separate the signals from the noise, the numerous \textit {rare and weak effects} can be combined and utilized in a meaningful way to solve many challenging problems including, but not limited to, signal detection, classification and clustering. This challenge has been successfully met, for example, in \citeauthor{Donoho2004} (\citeyear{Donoho2004,Donoho2008}), \citet{Jin2013}. From the genetics point of view, the signal detection problem is of major interest in the GWAS because the primary target of GWAS is to screen and allocate the informative genome regions, such as genes, which are more natural genomic functional units than individual SNPs. Furthermore, to validate associations, such positive regions will be further studied and individual SNP effects can still be discovered by refined and reliable experimental methods. The signal detection problem in the model (\ref{equ: genetic model}) can be reformulated as a joint hypothesis testing problem where $H_{0}$ is \[ H_{0}\dvtx\quad \beta_{j}=0,\qquad 1\leq j\leq L, \] that is, no association exists between the trait and the SNP sets, against an alternative hypothesis $H_{1}$ that the trait is associated with a small fraction of SNPs in the sets \[ H_{1}\dvtx\quad \mbox{$\beta_j \neq0$\qquad only for a small fraction of $j$, $1 \leq j \leq L$}. \] See \citet{Donoho2004} for the subtlety of this problem, where the focus was on a Stein's normal means model, which is much simpler than the model considered here. Our study contains two key components: the detection boundary for signal detection and the statistic of Higher Criticism. We now discuss two components separately. The detection boundary can be viewed as a way to address the fundamental capability and limit of SNP-set methods. In the two-dimensional phase space calibrating the signal rarity and signal strength, the detection boundary is a curve that separates the region of impossibility from the region of possibility. In the region of impossibility, the signals are so rare and weak that it is impossible to separate $H_{1}$ from $H_{0}$. That is, even for the most powerful method available, the signals are so rare and weak that it would have the sum of types I and~II error rates to be almost $1$. In the region of possibility, it is possible to separate $H_{1}$ from $H_{0}$, and there exists a procedure whose sum of types~I and~II error rates is approximately $0$. The study of the detection boundary has two merits. First, the detection boundary is provided as a function of the rarity and strength of genetic effects, the SNP-set size, the sample size, the error variance and the allele frequency, and thus simultaneously reveals the roles of these factors in gene-hunting. The result is applicable to genetic association studies of both common and rare genetic variants, the latter are the main target of finding the missing genetic factors using deep sequencing technologies [\citet{Ansorge2009,Mardis2008,Metzker2010}]. Second, the detection boundary can serve as a benchmark for evaluating different SNP-set methods. In particular, note that any procedure will partition the aforementioned phase spaces into two regions: a region of possibility and a region of impossibility. We say a method achieves the optimal phase diagram if it partitions the two-dimensional phase space in exactly the same way as the optimal procedure does. As a result, for any procedure we can assess its optimality by investigating whether it achieves the optimal phase diagram. Higher Criticism (HC) is a notion that goes back to \citet{Tukey1976}, and it was shown in \citet{Arias2010,Donoho2004}, \citeauthor{Hall2008} (\citeyear{Hall2008,Hall2010}), \citet{Ingster2010} that HC is useful in detecting very rare and weak effects. However, these works deal with models different from the genetic model (\ref{equ: genetic model}), and it is unclear whether the HC continues to behave well for the setting considered here. The genetic model is new in several aspects. First, the covariates are genotype data, rather than standardized or Gaussian variables. Second, the conditions for correlations among covariates, that is, the linkage disequilibrium structure, are better placed on the population correlations, rather than on the empirical correlations. Third, the error variance is realistically considered as unknown and needs to be estimated, rather than being assumed as known. In this paper we adapt the HC to detect rare and weak genetic effects in a SNP-set analysis context. With substantial efforts, we work out the exact detection boundary associated with the genetic model (\ref {equ: genetic model}). We propose a realistic HC procedure for analyzing real GWAS data and show that it achieves the optimal phase diagram in a rather broad context. We provide theoretical comparisons between HC and the several most commonly used SNP-set methods. Somewhat surprisingly, these well-known SNP-set methods do not achieve the optimal phase diagram for rare and weak signals. We further demonstrate the superiority of the HC-type methods with simulated data and real data. The paper is organized as follows. In Section~\ref{Sect: Genetic Model and Detection Boundary} we set up the genetic model and provide the detection boundary for rare and weak genetic effects. In Section~\ref{Sect: HC procedure} an HC procedure is proposed to reach the optimal detection boundary for rare and weak genetic signals. In Section~\ref{Sect: FDR vs HC} we discuss the connections of HC to False Discovery Rate (FDR) controlling methods. We show in Section~\ref{Sect: Other Methods} that some commonly used SNP-set based methods cannot reach the best detection boundary, and thus are not optimal. In Section~\ref{Sect: Nume} we compare various methods through numerical simulations and the analysis of a GWAS data of Crohn's disease. In Section~\ref{Sect: Discu} we discuss relevant theoretical and practical issues. The proofs of the main theoretical results, the fundamental lemmas and their proofs, as well as the supplementary figures and tables, are given in the online supplementary material [\citet{wuz2014suppl}]. \section{Genetic model and detection boundary} \label{Sect: Genetic Model and Detection Boundary} In this section we characterize the detection boundary by introducing a theoretical framework. We write in model (\ref{equ: genetic model}) \[ \mathbf{X}_{j}=(X_{1j},X_{2j}, \ldots,X_{nj})^{\prime}, \] so that $X_{kj}$ is the genotype of the $j$th SNP for the $k$th individual, where $1\leq j\leq L$, $1\leq k\leq n$. Let the minor allele $A_{j}$ of the $j$th SNP have a minor allele frequency (MAF) of $q_{j}$. We assume $q_{j}>q>0 $, $1\leq j\leq L$, for some constant $q$. We use the copy number of minor alleles to code the SNP genotype, which follows a binomial distribution under the Hardy--Weinberg equilibrium (HWE) [\citet {Mendel1866,Pearson1904,Yule1902}] \begin{equation} X_{kj}\sim\operatorname{Binomial} ( 2, q_{j} ). \label{equ: genotype} \end{equation} In some genetic association studies, the individuals are assumed to be independent, that is, $X_{k_{1}j}$ and $X_{k_{2}l}$ are independent for any $k_{1}\neq k_{2}$. However, the dependency among SNPs, called linkage disequilibrium (LD), is a critical feature in GWAS data. We characterize the LD structure by the correlation matrix $\bolds{\Sigma}=\bolds{\Sigma}_{L\times L} $ among $X_{k1},\ldots,X_{kL}$. For $\gamma>0$ and $\Delta>0$, let \begin{eqnarray}\label{equ. weak correlation} &&\mathcal{S}_{L}(\gamma,\Delta)= \{ \bolds{\Sigma}\dvtx \mbox{each row of } \bolds{\Sigma}\mbox{ has no more than } \nonumber \\[-8pt] \\[-8pt] \nonumber &&\hspace*{62pt}\Delta\mbox{ elements exceeding } \gamma\mbox{ in magnitude} \}. \end{eqnarray} With an appropriately small $\gamma$ and a moderately large $\Delta$, a matrix $\bolds{\Sigma}$ in $\mathcal{S}_{L}(\gamma,\Delta)$ can be interpreted as sparse, in the sense that each row of $\bolds{\Sigma}$ has relatively small coordinates. This setup has been studied in the theoretical statistics literature [\citet{Arias2010}], and is relatively general and flexible for GWAS because the large correlations are allowed between SNPs far from each other. In Section~\ref{Sect: Other Methods} we will also consider another setup for $\bolds{\Sigma}$, where the correlation decays polynomially as the SNP distance increases. We develop a theoretical framework where we use $L$ as the driving asymptotic parameter, and other parameters are tied to $L$ through fixed parameters. In particular, we model the sample size $n$ by \begin{equation} n=n_{L}=L^{a}\qquad\mbox{for some constant }a>0. \label{Definen} \end{equation} As $L$ grows to $\infty$, $n_{L}$ grows to $\infty$ as well. $n_{L}$ can be either larger than or smaller than $L$; both cases are common in recent GWAS. Next, fixing $1/2<\alpha<1$ which we call the \textit{rarity parameter}, we model the number of associated SNPs by \begin{equation} K=K_{L}=L^{1-\alpha}, \label{equ. K=L^(1-a)} \end{equation} so that the fraction of signals tends to $0$ as $L\rightarrow\infty$. In our calibrations, $K_{L}\ll\sqrt{L}$ and the signals are very rare. Seemingly, this is a very subtle situation. In contrast, the case $0<\alpha<1/2$ is both easier to analyze and less relevant to the major challenge of the genetic association study, so we omit the discussion on that. See, for example, \citet{Arias2010,Donoho2004}. At the same time, let $M^{\ast}\equiv \{ j_{1},\ldots,j_{K} \} $ be the support of $\beta$ (or, equivalently, the set of SNPs associated with $Y ), and let $b_{j}$ be the sign of $\beta_{j}$: \[ b_{j}=b_{j}(\beta)=\operatorname{sgn}(\beta_{j}),\qquad 1 \leq j\leq L, \] where $\operatorname{sgn}(x)=0,1,-1$ if $x=0$, $x>0$, and $x<0$, respectively. From a practical view, the locations and the directions of the genetic effects are usually unknown, so we assume the \textquotedblleft worst-case'' scenario and model $b_{j}$ and $M^{\ast }$ as completely random. In other words, for any fixed indices $i_{1}<i_{2}<\cdots <i_{K}$, we assume \begin{equation} P\bigl(M^{\ast}=(i_{1},i_{2},\ldots,i_{K}) \bigr)= \left[\pmatrix{L \cr K} \right]^{-1}, \label{DefineM} \end{equation} and that given $j\in M^{\ast}$, \begin{equation} b_{j}=\pm1 \qquad\mbox{with equal probabilities}, \label{Defineb} \end{equation} and $b_{j}=0$ if $j\notin M^{\ast}$. Moreover, let $\tau_{j}$ be the \textit{normalized strength of genetic effect} at index $j$ by \begin{equation} \tau_{j}=|\beta_{j}|\sqrt{2nq_{j}(1-q_{j})}/ \sigma, \label{Definetau} \end{equation} where we note $\sqrt{2nq_{j}(1-q_{j})}$ is approximately equal to the $L^{2}$-norm of $\mathbf{X}_{j}$, $1\leq j\leq p$. Together with the following results, the detection boundary illustrates how sample size $n$, group size $L$, error deviation $\sigma$, genetic effects $\beta _j$ and MAF $q_j$ simultaneously determine the detectability of the genetic signals through a specific function. For example, for rare variants with reduced $q_j$, the magnitude of their genetic effects $\beta_j$ need to increase in the same order of $\sqrt{q_j(1-q_j)}$ to keep the same level of detectability. This result is valuable for providing a guideline for gene detection in practice. In the literature [\citet{Arias2010,Donoho2004,Ingster2002}], it is understood that the most delicate case is for all $j\in M^{\ast}$, \[ \tau_{j}=O\bigl(\sqrt{2\log(L)}\bigr). \] In fact, if $\tau_{j}\gg\sqrt{2\log(L)}$ for all $j\in M^{\ast}$, then the detection problem is easy and many crude methods can give successful detection. On the other hand, if $\tau_{j}\ll\sqrt{2\log(L)}$ for all such $j$, then it is impossible to separate $H_{1}$ from $H_{0}$ and all methods must fail. In light of this, we recalibrate $\tau_{j}$ through a so-called \textit{strength parameter} $r_{j}$ by \begin{equation} \tau_{j}=\sqrt{2r_{j}\log(L)}, \label{Definer} \end{equation} where $r_{j}=O(1)$ if $j\in M^{\ast}$ and $r_{j}=0$ otherwise. Write $\mathbf{r}=(r_{1},r_{2},\ldots,r_{L})^{\prime}$. We have the following definition. \begin{definition*} We call (\ref{Definen})--(\ref{Definer}) the Asymptotic Rare and Weak model $\operatorname{ARW}(a,\alpha,\mathbf{r})$. \end{definition*} The following notation is frequently used in this paper. \begin{definition*} A test statistic is said to have \emph{asymptotically full power} if the sum of its type I and type II error rates converges to 0 for some critical value. A~test statistic is said to be \emph{asymptotically powerless} if the sum of its type I and type II error rates converges to 1 for any critical value. \end{definition*} We are now ready to spell out the precise expression of the detection boundary. The detectability of genetic association between a set of SNPs and a trait depends on both the proportion of associated SNPs and the strength of the genetic effects. The sharp detection boundary (i.e., with the exact constant) relates the rarity and the strength of the genetic effects by\vadjust{\goodbreak} the curve \[ r=r^{\ast}(\alpha) \] in the phase space, where \begin{equation} r^{\ast} ( \alpha ) =\cases{ \alpha-1/2, &\quad $1/2<\alpha<3/4,$ \vspace*{2pt}\cr ( 1-\sqrt{1-\alpha} ) ^{2}, &\quad $3/4 \leq\alpha<1.$} \label{equ. rho(alpha)} \end{equation} The first main conclusion of this paper is that for any fixed $\alpha \in (1/2,1)$, if \[ r_{j}<r^{\ast} ( \alpha )\qquad \mbox{for all $j\in M^{\ast }$}, \] then the genetic effects are merely so rare and weak that it is impossible to separate $H_{1}$ from $H_{0}$ asymptotically: all statistical tests are asymptotically powerless! Later in Section~\ref{Sect: HC procedure}, we show that if there are at least $L^{-\alpha}$ proportion of genetic effects having $r_{j}>r^{\ast } ( \alpha ) $, there exist statistical methods, such as the HC approach to be discussed, that can reliably detect the genetic signal with asymptotically full power. To rigorously describe our theoretical results, the technique conditions for asymptotic analysis are summarized as follows. These assumptions indicate that the SNP correlation matrix $\bolds{\Sigma}$ is sparse and guarantee that $\hat{\bolds{\Sigma}}$ has the same property as $\bolds{\Sigma}$: \begin{enumerate}[(A1)] \item[(A1)] The number of large correlations in each row of $\bolds{\Sigma} $ is assumed to be $\Delta=O ( L^{\varepsilon} ) $ for all \varepsilon>0$. \item[(A2)] The correlation $\gamma$ in (\ref{equ. weak correlation}) and the $L$--$n$ relative value $\gamma^{\prime}=\sqrt{\frac{\log L}{n}}$ satisfy some of the following conditions in different theorems for required levels of sparsity of $\bolds{\Sigma}$: \begin{enumerate}[(A2.1)] \item[(A2.1)] $ ( \gamma+\gamma^{\prime} ) L^{1-\alpha } ( \log L ) ^{4}\rightarrow0$. \item[(A2.2)] $ ( \gamma^{2}+\gamma^{\prime2} ) L^{1-\alpha } ( \log L ) ^{3}\rightarrow0$. \item[(A2.3)] $ ( \gamma+\gamma^{\prime} ) L^{1-\alpha }\rightarrow0$. \item[(A2.4)] $\gamma^{3}+\gamma^{\prime3}=O(L^{5\alpha -4+\varepsilon})$ for all $\varepsilon>0$. \item[(A2.5)] $\gamma+\gamma^{\prime}=O ( L^{-1/2+\varepsilon } ) $ for all $\varepsilon>0$. \end{enumerate} \end{enumerate} \begin{theorem} \label{Thm: all fails} Consider the genetic model setup in (\ref{equ: genetic model})--(\ref{Definer}). Under assumptions~\textup{(A1)} and \textup{(A2.1)}, all tests are asymptotically powerless if $r_{j}$ $<$ $r^{\ast} ( \alpha ) $, $j\in M^{\ast}$. \end{theorem} \begin{figure} \includegraphics{724f01.eps} \caption{Left: Detection boundary on the plane of the proportion of associated SNPs and the genetic effect. Right: Detection boundary on the plane of the proportion of associated SNPs and the heritability. Solid line: the optimal boundary (reached by HC procedure); Dashed line: the boundary of the minimal $p$-value method. Here $L=10\mbox{,}000$, $n=1000$, $\sigma=1$ and $q_{j}=0.3$ for all $j$.} \label{Figure_DetectionBoundaries} \end{figure} By equations (\ref{equ. K=L^(1-a)}) and (\ref{Definetau})--(\ref{Definer}), for a given proportion of true SNPs $L^{-\alpha}$, the detection boundary in (\ref{equ. rho(alpha)}) implies the boundaries of detectability for the genetic effects $\beta_{j}$, as well as for the genetic heritability of the trait---the proportion of total trait variation due to genetic variation: \begin{equation} \mathrm{Heritability}=\frac{\sum_{j=1}^{L}\beta_{j}^{2}2q_{j} ( 1-q_{j} ) }{\sum_{j=1}^{L}\beta_{j}^{2}2q_{j} ( 1-q_{j} ) +\sigma^{2}}. \label{equ. heritability} \end{equation} For easy visualization of these boundaries, consider a special case where \llvert \beta_{j}\rrvert =\beta$ for $j\in M^{\ast}$ and q_{j}=0.3$ for all $j$. The solid lines in Figure~\ref{Figure_DetectionBoundaries} illustrate the detection boundary regarding the genetic effect $\beta$ (left panel) and the detection boundary regarding the heritability (right penal) over a range of the proportion of associated SNPs corresponding to \alpha $from $0.999$ to $0.499$. \section{Higher Criticism procedures for gene detection} \label{Sect: HC procedure} The Higher Criticism (HC) procedure has been studied for the Gaussian mean model and regression model with Gaussian design matrix and known error variance [\citet{Arias2010,Donoho2004,Hall2010,Ingster2010}]. Under the genetic model setup in (\ref{equ: genetic model})--(\ref {Definer}), we adopt this procedure for gene detection based on the marginal associations between the trait and each SNP. We show that the HC procedure has asymptotically full power upon the rare and weak genetic effects exceeding the detection boundary. Let $p_{ ( 1 ) }\leq\cdots\leq p_{ ( L ) } $ be the increasingly ordered $p$-values of $L$ individual SNPs. The HC test statistic is \begin{equation} \mathrm{HC}_{L}=\max_{1 \leq j \leq L } \mathrm{HC}_{L, j}\qquad \mbox{where } \mathrm{HC}_{L, j} = \sqrt{L}\frac{(j/L) -p_{ ( j ) }}{\sqrt {p_{ ( j )} (1-p_{ ( j ) }) }}. \label{equ. HC} \end{equation} In contrast to considering the minimal $p$-value in a group of SNPs, the HC considers the maximum of the normalized differences between the empirical $p$-values $j/L$ and the observed $p$-values $p_{ ( j ) }$. Denote the survival function of $N(0,1)$ as $\bar{\Phi} ( \cdot ) $. If marginal test statistics $S_j \sim N(0, 1)$, $j=1, \ldots, L$, and the $p$-values are two-tailed, the HC statistic can be written as [\citet{Arias2010,Donoho2004}] \begin{equation} \mathrm{HC}_{L}=\max_{t} \mathrm{HC}_{L}(t)\qquad\mbox{where } \mathrm{HC}_{L}(t) = \frac{|\{j\dvtx | S_{j}| >t \}| - 2L\bar{\Phi}(t)} {\sqrt {2L\bar {\Phi}(t)(1-2\bar{\Phi}(t))}}. \label{equ. HC equivalent} \end{equation} To study the theoretical properties of the HC procedure, for technical simplification to obtain the upper bound, we follow \citet{Arias2010} to search for the maximum on a discrete grid and define an HC$^{\ast}$ procedure with statistic \begin{equation} \mathrm{HC}^{\ast}_{L}(s) = \max\bigl\{\mathrm{HC}_{L}(t) \dvtx t \in{}[ s,\sqrt{5\log L}] \cap\mathbb{N} \bigr\}. \label{equ. HC discretized} \end{equation} In practice, we recommend to still use the straight HC in (\ref{equ. HC}). To simplify discussion, we first consider the case where $\sigma^{2}$ is known. For the genetic model in (\ref{equ: genetic model}), let $\bar{\mathbf{Y}}= ( \bar{Y},\ldots,\bar{Y} ) ^{\prime}$ and $\bar{\mathbf{X}}_{j}= ( \bar{X}_{j},\ldots,\bar {X}_{j} ) ^{\prime}$, where $\bar{Y}=\frac{1}{n}\sum_{k=1}^{n}Y_{k}$ and $\bar {X}_{j}=\frac{1}{n} \sum_{k=1}^{n}X_{kj}$. The test statistic $S_j$ for the association between the trait and SNP $j$ is defined as the marginal correlation: \begin{equation} R_{j}^{\sigma}=\frac{ ( \mathbf{X}_{j}-\bar{\mathbf {X}}_{j} ) ^{\prime}\mathbf{Y}}{\sigma\llVert \mathbf{X}_{j}-\bar{\mathbf {X}}_{j}\rrVert }, \label{equ. R_sigma stat} \end{equation} where $\llVert \mathbf{x}\rrVert $ is the $L^{2}$-norm of a vector $\mathbf{x}$. When SNP $j$ is not associated, we have $R_{j}^{\sigma} \rightsquigarrow N(0, 1)$. Proposition~\ref{Thm: varianceknown} states that the HC$^{\ast}$ procedure reaches the optimal detection boundary. That is, for some well-controlled type I error rate converging to 0 slowly enough, the statistical power of the HC$^{\ast}$ procedure converges to 1 for detecting the genetic effects that fall above the detection boundary. \begin{prop} \label{Thm: varianceknown} Consider the genetic model setup in (\ref {equ: genetic model})--(\ref{Definer}). Let the marginal test statistic $S_j$ in (\ref{equ. HC equivalent}) be $R_{j}^{\sigma}$. Under assumptions \textup{(A1)}, \textup{(A2.2)} and \textup{(A2.4)}, $\mathrm{HC}^{\ast}_{L}(\sqrt{2\delta \log L})$ with $\delta= \min ( 1,4r^{\ast} ( \alpha ) ) $ has asymptotically full power if $r_{j}$ $>$ $r^{\ast} ( \alpha ) $, $j\in M^{\ast}$. Furthermore, under assumptions \textup{(A1)} and \textup{(A2.5)}, $\mathrm{HC}^{\ast}_{L}(1)$ has asymptotically full power if $r_{j}$ $>$ $r^{\ast} ( \alpha ) $, $j\in M^{\ast}$. \end{prop} Now we turn to a more realistic case where $\sigma$ is unknown and cannot be used in genetic association tests. We propose the following tests that incorporate $\sigma$ estimation. Specifically, the marginal association between the trait and SNP $j$ can be measured by either of the following two test statistics: \begin{equation} R_{j}=\sqrt{n-1}\rho_{j}\quad\mbox{and}\quad T_{j}= \sqrt{n-2}\rho_{j}/\sqrt {1-\rho _{j}}, \label{equ. R T stat} \end{equation} where $\rho_{j}$ is the Pearson correlation coefficient between the observed trait values and the genotypes of the $j$th SNP. $T_{j}$ is the standard $T$-test statistic when we regress the trait on the $j$th SNP. When SNP $j$ is not associated, both $R_{j}$ and $T_j \rightsquigarrow N(0, 1)$. Note that $R_{j}$ and $T_{j}$ are asymptotically equivalent because $\rho_{j}\rightarrow0$ under the $\operatorname{ASW}(a,\alpha ,\mathbf{r})$ model for both the null and the alternative hypotheses. The numerical results in Section~\ref{Sect: Nume} also show that their performances are very similar in simulations and real GWAS data analysis. When $\sigma$ is unknown, we need a slightly stronger condition than that in Proposition~\ref{Thm: varianceknown} to guarantee the proper behavior of the $\sigma$ estimation. The following theorem shows that the HC$^{\ast}$ procedure based on $R_{j}$ still reaches the detection boundary. \begin{theorem} \label{Thm: sigmaunknow} Consider the genetic model setup in (\ref{equ: genetic model})--(\ref{Definer}). Let the mar\-ginal test statistic $S_j$ in (\ref{equ. HC equivalent}) be $R_{j}$. Under assumptions \textup{(A1)}, \textup{(A2.3)} and \textup{(A2.4)}, $\mathrm{HC}^{\ast}_{L}(\sqrt{2\delta\log L})$ with $\delta= \min ( 1,4r^{\ast} ( \alpha ) ) $ has asymptotically full power if $r_{j}$ $>$ $r^{\ast} ( \alpha ) $, $j\in M^{\ast}$. Furthermore, under assumptions \textup{(A1)} and \textup{(A2.5)}, $\mathrm{HC}^{\ast}_{L}(1)$ has asymptotically full power if $r_{j}$ $>$ $r^{\ast} ( \alpha ) $, $j\in M^{\ast}$. \end{theorem} Figure~\ref{Figure_DetectionBoundaries} illustrates that the detection boundary for the HC$^{\ast}$ procedure is the same as the optimal detection boundary. \section{Connections to FDR-controlling methods} \label{Sect: FDR vs HC} Tukey's Higher Criticism (HC) is closely related to methods of controlling the False Discovery Rate (FDR) [e.g., \citet {benjamini1995controlling,efron2001empirical}], but is also different in important ways. While there is a long line of works on FDR controlling methods, for reasons of space, we focus our discussion on Benjamini and Hochberg's FDR-controlling method (BH), proposed in \citet {benjamini1995controlling}. The connection and difference between HC and BH can be briefly summarized as follows: \begin{itemize} \item Both BH and HC are \textit{$p$-value driven methods}, the use of which needs only the $p$-values associated with all SNPs. \item BH focuses on the regime where the signals are \textit{rare} but \textit{relatively strong}, and the goal is signal identification. \item HC focuses on the regime where the signals are so \textit{rare and weak} that signal identification is frequently impossible, but valid signal detection or screening is still possible and could be substantially helpful. \end{itemize} Let $p_{(1)} \leq p_{(2)} \leq\cdots\leq p_{(L)}$ be the sorted $p$-values associated with $L$ SNPs. The formulas of HC and BH are intimately connected. In detail, fix the FDR-control parameter $\alpha \in(0,1)$ (say, $\alpha= 5\%$). The goal of BH is usually to control the expected fraction of false discovered SNPs out of all discovered SNPs (i.e., the FDR) so that it does not exceed $\alpha$. The procedure selects the SNPs whose $p$-values are among the $k_{\alpha }^{\mathrm{FDR}}$-smallest as discoveries, where $k_{\alpha}^{\mathrm{FDR}}$ is the largest integer $k$ such that \[ Q_k \leq\alpha\qquad \mbox{where }Q_k = \frac{p_{(k)}}{k/L}. \] When $\min_{1 \leq k \leq L} \{ Q_k \} > \alpha$, BH reports an empty set of discoveries. $Q_k$ is a quantity that has been extensively studied in empirical processes. See, for example, \citet{wellner1978limit}. Following the same argument on page 975 of \citet{Donoho2004}, it can be shown that for any testing critical value $\sqrt{2 q \log(L)}$ with any $0 < q < 1$, the ratio between the expected number of recoveries under the alternative [with signal slightly above the detection boundary in (\ref{equ. rho(alpha)})] and the expected number of recoveries under the null is about 1. So the problem of BH for the rare and weak signal (which may be interesting targets in GWAS) is that \begin{equation} \label{DefineFDR} \min_{1 \leq k \leq L} \{ Q_k \} \approx1. \end{equation} As a result, for any $\alpha$ that is bounded away from $1$ (say, $\alpha\leq90\%$), the BH method reports an empty set of discoveries. The BH method could produce a nonempty set of discoveries if we let $\alpha$ get even closer to $1$, but the FDR is so high that the set of discoveries is no longer informative for signal identification. We will never know what was in Tukey's mind when he proposed the Higher Criticism in 1976 [\citet{Tukey1976}], but there is an interesting connection between HC and BH (which was proposed about 20 years later) as follows. Suppose we apply $Q_k$ to the HC statistic in (\ref{equ. HC}). Heuristically, if $k \ll L$ and (\ref{DefineFDR}) holds, \[ \mathrm{HC}_{L, k} \approx\sqrt{k} (1 - Q_k ). \] As before, think of the signal detection problem as testing a null hypothesis $H_0$ versus an alternative hypothesis $H_1^{(L)}$. In the null case where all $p$-values are i.i.d. from $U(0,1)$ and so that data contains no signal at all, then $\mathrm{HC}_{L, k} \approx N(0,1)$ for all $k$, and $\mathrm{HC}_{L, k}$ are uniformly bounded from above by a relatively small number, say, $3$. In the alternative case where the $p$-values come from rare and weak signals, even when $Q_k \approx1$ for all $k$, it is still possible that for some $k$, \[ \mathrm{HC}_{L, k} \approx\sqrt{k} (1 - Q_k) \gg1. \] This fact says that even when signals are so rare and weak that signal identification (say, by BH) is impossible, there could still be ample space for valid inference (e.g., screening or signal detection), and HC is such a tool. Partially, we guess, this is the reason why Tukey interprets HC as \textit{the second-level significance testing}. Denote the maximizing index $k$ for $\mathrm{HC}_{L, k}$ by \[ k^{\mathrm{HC}} = \margmax_{1 \leq k \leq L} \{ \mathrm{HC}_{L, k} \}. \] Such an index is very different from $k_{\alpha}^{\mathrm{FDR}}$. The index suggests a very interesting phenomenon that is frequently found for rare and weak signals (however, the phenomenon is not that frequently found when signals are rare and strong). Specifically, it is not always the case that $k^{\mathrm{HC}} = 1$; it could happen that the index is larger than $1$, say, $k^{\mathrm{HC}} = 50$. When this phenomenon happens, the interpretation is that the strongest evidence against the null is not necessarily the smallest $p$-value, but is the collection of moderately smallest $p$-values; see \citet{Donoho2004} for discussion on moderate significances. When moderate significances contain more information for inference than does the smallest $p$-value, the HC type methodology is frequently more appropriate than BH, where the goal is shifted from signal identification to detection, to accommodate the presence of weak signals. \section{Some other gene detection procedures} \label{Sect: Other Methods} With the genetic detection boundary we can show that many well-known SNP-set methods are not optimal for the rare and weak genetic effects. First, we consider the minimal $p$-value method that treats the smallest $p$-value in a SNP-set as the measurement for the association between the trait and the SNPs in the set. The following proposition considers the minimal $p$-value method under cases where $\sigma$ is either known or unknown. \begin{prop} \label{Thm: MinP} Consider the genetic model setup in (\ref{equ: genetic model})--(\ref{Definer}). Under the assumptions \textup{(A1)} and \textup{(A2.2)}, the minimal $p$-value procedure based on $R_{j}^{\sigma}$ has asymptotically full power if $r_{j}$ $>$ $r^{\mathrm{MP}} ( \alpha ) $, $j\in M^{\ast}$, and is asymptotically powerless if $r_{j}$ $<r^{\mathrm{MP}} ( \alpha ) $, $j\in M^{\ast}$, where \[ r^{\mathrm{MP}} ( \alpha ) \equiv ( 1-\sqrt{1-\alpha} ) ^{2},\qquad\alpha \in ( 1/2,1 ). \] Furthermore, under assumptions \textup{(A1)} and \textup{(A2.3)}, the minimal $p$-value procedure based on $R_{j}$ has asymptotically full power if $r_{j}$ $>$ r^{\mathrm{MP}} ( \alpha ) $, $j\in M^{\ast}$, and is asymptotically powerless if $r_{j}$ $<r^{\mathrm{MP}} ( \alpha ) $, $j\in M^{\ast}$. \end{prop} Proposition~\ref{Thm: MinP} shows that the minimal $p$-value method is not optimal because $r^{\mathrm{MP}} ( \alpha ) $ $>r^{\ast} ( \alpha ) $ for $\alpha\in(1/2,3/4)$. Figure~\ref{Figure_DetectionBoundaries} illustrates the comparison between the minimal $p$-value method (dashed curve) and the HC procedure (solid curve) regarding the genetic effect ($\beta_{j}=\beta$ for all $j\in M^{\ast}$) and the heritability. When the associated SNPs are extremely rare with $\alpha\in(3/4,1)$, the two methods have the same detection boundary. However, in a wide range of the proportion of associated SNPs corresponding to $\alpha\in(1/2,3/4)$, the HC procedure can detect significantly weaker genetic effects and heritability than the minimal $p$-value method does. This regime is more important in combating the detection of the undiscovered common and rare genetic variants that could number in the hundreds [\citet{Goldstein2009,Hall2009,Kraft2009,Wade2009}]. We further consider three commonly used SNP-set methods in the GWAS literature [\citet{LuoXiong2010}] and show that they are not as good as the minimal $p$-value method under our model setup. Let $\mathbf {S}= (S_{1},\ldots, S_{L} ) ^{\prime}$ be a vector of marginal test statistics and $\hat{\bolds{\Sigma}}$ be the Pearson correlation coefficients among the SNP genotypes, that is, $\hat{\bolds{\Sigma}} ( i,j ) =\frac{ ( \mathbf{X}_{i}-\bar{\mathbf{X}}_{i} ) ^{\prime } ( \mathbf{X}_{j}-\bar{\mathbf{X}}_{j} ) }{\llVert \mathbf {X}_{i}-\bar{\mathbf{X}}_{i}\rrVert \llVert \mathbf {X}_{j}-\bar{\mathbf{X}}_{j}\rrVert }$. First, the linear combination test (LCT) statistic is defined as \begin{equation} T^{L}=\mathbf{e}^{\prime}\mathbf{S}/\sqrt{\mathbf{e}^{\prime } \hat{\bolds{\Sigma}}\mathbf{e}}, \label{equ. TL-test} \end{equation} where $\mathbf{e}$ is the vector of 1s. Second, when $\hat{\bolds{\Sigma} ^{-1}$ exists, the quadratic test (QT) statistic is defined as \begin{equation} T^{Q}=\mathbf{S}^{\prime}\hat{\bolds{\Sigma}}^{-1} \mathbf{S}. \label{equ. TQ-test} \end{equation} Third, the decorrelation test (DT) statistic is the Fisher's combination test after the decorrelation generating independent $p$-values: \begin{equation} T^{D}=-2\sum_{j=1}^{L}\log p_{j}, \label{equ. TD-test} \end{equation} where the $p$-values $p_{j}=2\bar{\Phi} ( \llvert W_{j}\rrvert ) $ and $W_{j}$ is the $j$th element of $\mathbf{W}=\mathbf {D}^{-1}\mathbf{S}$, where $\mathbf{D}$ is a triangular matrix of Cholesky decomposition such that $\hat{\bolds{\Sigma}}= \mathbf{D}\mathbf{D}^{\prime} $. The following theorem says that LCT, QT and DT are not optimal for rare and weak effects when SNPs are independent or have a polynomially decaying correlation along the distance between the SNPs. Specifically, for the true correlation matrix among the SNPs $\bolds{\Sigma}$, we denote the operation norm as $\llVert \bolds{\Sigma}\rrVert =\sup_{ \{ \mathbf{a}\dvtx \llVert \mathbf{a}\rrVert _{2}=1 \} }\llVert \bolds{\Sigma} \mathbf{a}\rrVert _{2}$. $\bolds{\Sigma}$ has a polynomial off-diagnal decay if for positive constants $M$, $\lambda$ and $C$, the magnitude of the $ ( j,k ) $th element is upper bounded by a polynomial function \begin{equation} \bigl\llvert \bolds{\Sigma} ( j,k ) \bigr\rrvert \leq M \bigl( 1+\llvert j-k \rrvert \bigr) ^{-\lambda}\quad\mbox{and}\quad\llVert \bolds{\Sigma}\rrVert \geq C>0. \label{equ. poly decay} \end{equation} \begin{theorem} \label{Thm: others less powerful} Consider the genetic model setup in (\ref{equ: genetic model})--(\ref{equ: genotype}), (\ref {Definen})--(\ref{Definer}) and (\ref{equ. poly decay}). The three tests in (\ref{equ. TL-test})--(\ref{equ. TD-test}) correspond to $\mathbf{S}= ( R_{1},\ldots,R_{L} ) ^{\prime}$, where $R_{j}$ is defined in (\ref{equ. R T stat}). Let $\gamma^{\prime}=\sqrt{\frac {\log L}{n}}$. For any $\lambda\geq3$, $M\geq1$ and $\gamma^{\prime }L=o(1)$, LCT does not have asymptotically full power when $r_{j}$ $<1$, $j\in M^{\ast}$. For any $\lambda>1$ and $\gamma^{\prime}L^{d}=o(1)$ for some $d>1$, both QT and DT do not have asymptotically full power when $r_{j}<1$, $j\in M^{\ast}$. \end{theorem} Because the detection boundary $r^{\mathrm{MP}} ( \alpha ) $ of the minimal $p$-value method is always less than $1$ for each $\alpha\in(1/2,1)$, the SNP-set methods LCT, QT and DT have poorer performance than the minimal $p$-value method. In particular, this theorem indicates that Fisher's combination test (such as DT) is not a good choice for the rare and weak genetic effects considered here. \section{Simulations and Crohn's disease study} \label{Sect: Nume} Simulations and real GWAS analysis are conducted to evaluate the performance of HC-type methods and other traditional and newly proposed \textit{gene-based SNP-set methods}, in which SNP genotypes in genes form sets of covariates. Instead of finding individual causative SNPs, the goal of signal detection here is to test which genes may contain these causative SNPs. Although the above theoretical results focus on model (\ref{equ: genetic model}), in order to guide practical applications, we study both quantitative and binary traits in the following analysis of three types of data sets (Table~\ref{Table_DataList}): both simulated genotypes and phenotypes, real genotypes and simulated phenotypes, and both real genotypes and phenotypes for Crohn's disease study. The following summarizes the implementation of the methods to be compared: \begin{longlist}[1.] \item[1.] Higher Criticism method. The test statistic is given in (\ref {equ. HC}) for each gene. For quantitative traits, the $p$-values are calculated based on either $T_{j}$ (method denoted HC) or $R_{j}$ (denoted HCm) in (\ref{equ. R T stat}). For binary traits, we adopt a $Z$-statistic by \citet{Zuo2006} (denoted HC): \begin{equation} D_{j} = \sqrt{n}\frac{\hat{p}_{\mathrm{case}}-\hat{p}_{\mathrm{control}}}{\sqrt {2\hat {p}_{\mathrm{all}} ( 1-\hat{p}_{\mathrm{all}} ) }}, \label{equ. D stat} \end{equation} where $\hat{p}_{\mathrm{case}}$, $\hat{p}_{\mathrm{control}}$ and $\hat{p}_{\mathrm{all}}$ are the estimated MAF in cases, controls and the combined group, respectively. When the $j$th SNP is not associated, $D_{j} \rightsquigarrow N (0,1 ) $, the two-tailed $p$-values $p_{j}=2\bar{\Phi} ( \llvert D_{j}\rrvert ) $ are applied to (\ref{equ. HC}) to get the HC statistic. \item[2.] Minimal $p$-value method (denoted MinP). The association of a SNP set in a gene is determined by the smallest $p$-value $p_{(1)}$. This is the most commonly used method in GWAS practice. The $p$-values are obtained either based on $T_{j}$ in (\ref{equ. R T stat}) for quantitative traits or $D_{j}$ in (\ref{equ. D stat}) for binary traits. \item[3.] Principal Component Analysis (PCA) [\citet{Ballard2010,Wang2008}]. To measure the significance of a gene, a $p$-value is obtained by fitting a multiple regression for quantitative traits (or a logistic regression for binary traits) by using the least principal components that count over 85\% variation. \item[4.] Ridge regression (denoted Ridge) [\citet{He2011}]. SNP covariates in a gene are fitted with traits by ridge regression at the tuning parameter that minimizes the prediction error based on cross-validation (R function lm.ridge). The residual sum of squares describes the goodness of fit of the model, and thus is treated as the score for the SNP set. The same procedure is applied to both quantitative and binary traits for simplicity.\vadjust{\goodbreak} \item[5.] Linear combination test (LCT), quadratic test (QT) and decorrelation test (DT) [\citet{LuoXiong2010}]. To calculate the statistics in (\ref{equ. TL-test})--(\ref{equ. TD-test}), we apply $\mathbf{S}= ( T_{1},\ldots,T_{L} ) ^{\prime}$ with $T_{j}$ in (\ref{equ. R T stat}) for quantitative traits and $\mathbf{S}= (D_{1},\ldots,D_{L} ) ^{\prime}$ with $D_{j}$ in (\ref{equ. D stat}) for binary traits. \item[6.] Kernel-machine test [\citet{Wu2010}]. This is a SNP-set method that applies the generalized semiparametric models [\citet{Liu2007,Wu2010}] to detect the association of genes. For the additive genetic model defined in~(\ref{equ: genetic model}), the linear kernel function is recommended by the authors [\citet{Wu2010}]. So the semiparametric model is simplified to either a multiple regression model for quantitative traits (denoted KMT) or logistic regression for binary traits (denoted LKMT). The genetic association is measured by a variance-component score statistic [\citet{Zhang2003}]. We apply the R functions implemented by the authors of this method. \end{longlist} \begin{table}[b] \tabcolsep=0pt \caption{List of the data used for analysis. Genotypes are either simulated based on six Toeplitz correlation matrices (TCM) or from the true GWAS data of NIDDK--IBDGC. The number of SNPs per gene is either 100 or according to the true data. Phenotypes are either simulated based on the additive model ($\sigma^{2}=1$) or logistic regression model ($\beta_{0}=-2$) or the true Crohn's disease status. The locations of nonzero coefficients are always random and the values are either fixed or random, where $b_{1}$ ranges from 0.088 to 0.131 and $b_{2}$ ranges from 0.1 to 0.24}\label{Table_DataList} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccccccc@{}} \hline \textbf{Data} & \textbf{Genotype} & \textbf{Sample} & \textbf {SNPs/gene} & \textbf{LD} & \textbf{MAF} & \textbf{Phenotype} & \multicolumn{1}{c@{}}{\textbf{Nonzero coefficients}} \\ \hline \phantom{0}1 & Simulation & 1000 & 100 & 6 TCM & 0.4 & Additive & 3, $b_{1}$ \\ \phantom{0}2 & Simulation & 2000 & 100 & 6 TCM & 0.4 & Logit & 3, $b_{2}$ \\ \phantom{0}3 & Simulation & 1000 & 100 & 6 TCM & 0.4 & Additive & 3, $+$/$-b_{1}$ equal chance \\ \phantom{0}4 & Simulation & 1000 & 100 & 6 TCM & 0.4 & Additive & 3, $\operatorname{Unif}[b_{1}, 1.2b_{1}]$ \\ \phantom{0}5 & Simulation & 1000 & 100 & 6 TCM & 0.4 & Additive & 3, $\operatorname{Unif}[0.9b_{1}, 1.1b_{1}]$ \\ \phantom{0}6 & \textit{BCHE} & 851 Jew & 100 & real & real & Additive & 3, $b_{1}$ \\ \phantom{0}7 & \textit{BCHE} & 851 Jew & 100 & real & real & Logit & 3, $b_{2}$ \\ \phantom{0}8 & \textit{EXT1} & 851 Jew & 106 & real & real & Additive & 3, $b_{1}$ \\ \phantom{0}9 & \textit{EXT1} & 851 Jew & 106 & real & real & Logit & 3, $b_{2}$ \\ 10 & \textit{FSHR} & 851 Jew & 117 & real & real & Additive & 3, $b_{1}$ \\ 11 & \textit{FSHR} & 851 Jew & 117 & real & real & Logit & 3, $b_{2}$ \\ 12 & 15,860 genes & 851 Jew & vary & real & real & Additive & $\alpha =0.8$, $r=0.9$ \\ 13 & 15,860 genes & 1145 non-Jewish & vary & real & real & Additive & $\alpha=0.8$, $r=0.9$ \\ 14 & 15,860 genes & 851 Jew & vary & real & real & CD status & -- \\ 15 & 15,860 genes & 1145 non-Jewish & vary & real & real & CD status & -- \\ \hline \end{tabular*} \end{table} \subsection{Simulated genotypes and phenotypes} \label{Sect. SimuSNPdata} We simulated both genotype and phenotype data to fully control the data structure and genetic effect pattern. Data sets 1 and 2 in Table~\ref{Table_DataList} were obtained in the following. First, to simulate the genotype data, it was assumed that one gene unit contains $L=100$ SNPs, whose genotypes follow HWE in (\ref{equ: genotype}) with MAF $q=0.4$. To demonstrate how typical LD structures may affect these methods, six Toeplitz correlation matrices (TCM) were studied: (I) Independent SNPs, that is, the correlation matrix $\bolds{\Sigma}$ is the identity matrix. (II) SNPs in the first order neighborhoods are correlated, that is, $\bolds{\Sigma}$ has 1 in the main diagonal, 0.3 (or 0.25, or 0.2) in the first off-diagonals and 0 elsewhere. (III) SNPs are correlated with the nearest two neighbors, that is, $\bolds{\Sigma}$ has 1 in the main diagonal, 0.25 in the first off-diagonal, 0.3 (or 0.2) in the second off-diagonal and 0 elsewhere. The R package mvtBinaryEP [\citet{By2011,Emrich1991}] was used to generate the correlated genotype data. Second, to simulate the phenotype data, we considered the cases of rare and weak genetic effects based on the above theoretical results. Specifically, the rarity parameter was assumed $\alpha=0.76$, so $K=L^{1-\alpha}\approx3$ randomly picked SNPs were made causative. Quantitative traits were generated by model (\ref{equ: genetic model}) with error variance $\sigma^{2}=1$. The sample size was $n=1000$. We examined a series of strength parameters $r_{j}=r$ in (\ref{Definer}) from $0.4$ to $0.9$, which correspond to the genetic effects $\beta _{j}$ in (\ref{Definetau}) equals $b_{1}$ ranging from $0.088$ to $0.131$, and the heritability of trait ranging in (\ref{equ. heritability}) from $0.011$ to $0.024$. On the other hand, binary traits were generated by a logistic model \begin{equation} \operatorname{logit} \biggl( \frac{P ( Y=1|\mathbf{X} ) }{P ( Y=0|\mathbf{X} ) } \biggr) =\beta_{0}+ \beta_{1}X_{1}+\beta _{2}X_{2}+\cdots+ \beta_{L}X_{L}.\label{equ: genetic binary model} \end{equation} Conditional on the genotype data, many diseased ($Y=1$) and nondiseased outcomes ($Y=0$) were generated according to the genetic risk. Then the retrospective case--control data were collected by randomly sampling $1000$ cases and $1000$ controls. We considered the coefficient $\beta _{0}=-2$ and a sequence of nonzero coefficients $\beta_{j} = b_{2}$ ranging from $0.10$ to $0.24$, which correspond to the disease allele odds ratio ranging from $1.11$ to $1.27$. The empirical power was compared based on a well-controlled empirical type I error rate. Specifically, we ran 1000 simulations, each with newly generated genotypes, and then the phenotypes according to a specific genetic model with random locations of causative SNPs. For each simulation, we also permuted the phenotype responses and calculated the test statistics for the null hypothesis of no association. Over all simulations, the 95th percentile of the null statistics was used as the cutoffs to control the type I error rate at a level 0.05. The empirical power, that is, the true positive rate of tests, is the proportion of simulations where the test statistics exceeded the corresponding cutoff. Figures~\ref{Figure_Simu_Quanti} and \ref{Figure_Simu_Binary} show the comparisons of empirical power for data sets 1 and 2, respectively. In all the setups, the HC-type methods had the highest power. The comparisons were not significantly affected by these LD structures. \begin{figure}[t!] \includegraphics{724f02.eps} \caption{For quantitative traits under the fixed value of nonzero coefficients, HC and HCm have the highest power. X-axis: the strength parameter $r$ in equation (\protect\ref{Definer}), which corresponds to the nonzero coefficients $\beta_{j}=b_{1}$ in (\protect\ref{Definetau}). The six panels correspond to six correlation matrices of SNPs: (1) identity matrix, (2) the 1st off-diagonals equal 0.3, (3) the 1st off-diagonals equal 0.25, (4) the 1st off-diagonals equal 0.2, (5) the 1st off-diagonals equal 0.25 and the 2nd off-diagonals equal 0.3, (6) the 1st off-diagonals equal 0.25 and the 2nd off-diagonals equal 0.2.} \label{Figure_Simu_Quanti} \end{figure} \begin{figure}[t!] \includegraphics{724f03.eps} \caption{For binary traits from the fixed value of nonzero coefficients, HC has the highest power. X-axis: the nonzero coefficients $\beta_{j}=b_{2}$ in equation (\protect\ref{equ: genetic binary model}). The six panels correspond to the same six correlation matrices of SNPs as those in Figure \protect\ref{Figure_Simu_Quanti}.} \label{Figure_Simu_Binary}\vspace*{12pt} \end{figure} In reality, causative SNPs may not have homogenous contribution to the traits. We simulated data sets 3--5 described in Table~\ref{Table_DataList} for three scenarios of random genetic effects. First, the nonzero coefficients have the same magnitude $b_{1}$, but with random $+$/$-$ signs of equal probabilities. Second, the nonzero coefficients are uniformly distributed in $[b_{1}, 1.2b_{1}]$. Third, the nonzero coefficients are uniformly distributed in $[0.9b_{1}, 1.1b_{1}]$. Figure~\ref{Figure_Simu_Quanti_RandomSign} shows the comparisons of the methods under random nonzero coefficients $\pm b_{1}$ with equal probabilities. HC methods were still the best among these methods assessed. Since the genetic effects have two directions, the linear combination test (LCT) causes the signals to cancel out and has low power. The results for the other two scenarios of random genetic effects (data sets 4--5 in Table~\ref{Table_DataList}) are given in supplementary Figures~1 and 2 [\citet{wuz2014suppl}]. \begin{figure} \includegraphics{724f04.eps} \caption{For quantitative traits from random nonzero coefficients $\pm b_{1}$ with equal probabilities, HC and HCm have the highest power. X-axis: the strength parameter $r$ in equation (\protect\ref {Definer}), which corresponds to the nonzero coefficients $\beta_{j}=b_{1}$ in (\protect\ref {Definetau}). The six panels correspond to the same six correlation matrices of SNPs as those in Figure \protect\ref{Figure_Simu_Quanti}.} \label{Figure_Simu_Quanti_RandomSign} \end{figure} Our theoretical results in Sections~\ref{Sect: HC procedure}--\ref {Sect: Other Methods} are about reliable detection, that is, to get asymptotically full power of detecting true genes containing a small number of weak causative SNPs. In reality, the sample size may not be large enough to allow the power approaching to 1, and there is a chance of obtaining false discoveries. Here we assessed the False Discovery Rate (FDR) of these methods over a variety of type I error rate cutoffs. Figure~\ref{Figure_FDR_HC_Quanti} illustrates the FDR of HC methods for quantitative traits (Data 1 in Table~\ref{Table_DataList}), with the strength parameter $r=0.4$--0.9. It can be seen that the FDR is well controlled, with an expected decreasing trend for increasing signal strength $r$. The HC method was also compared with other methods in terms of the FDR in supplementary Figures~3--8 [\citet {wuz2014suppl}]. The FDR of the HC method is similar to or lower than those of the other methods. \begin{figure} \includegraphics{724f05.eps} \caption{False Discovery Rates of the HC method for quantitative traits. X-axis: the empirical type I error rate cutoff. The six panels correspond to the same six correlation matrices of SNPs as those in Figure \protect\ref{Figure_Simu_Quanti}.} \label{Figure_FDR_HC_Quanti} \end{figure} \subsection{Real genotypes and simulated phenotypes} \label{Sect. TrueSNPSimuPheno} By using real genotype data, we studied how the real allelic distributions and LD structures, which are more complicated than the above simulations, may influence the results. For this purpose, we used the observed SNP genotypes from the data of NIDDK--IBDGC (National Institute of Diabetes, Digestive and Kidney Diseases--Inflammatory Bowel Disease Genetics Consortium) [\citet{Duerr2006}]. The data contain 851 independent subjects from the Jewish population (417 cases and 434 controls) and 1145 independent subjects from the non-Jewish population (572 cases and 573 controls). SNPs were grouped into 15,860 genes on chromosomes 1--22 according to physical locations of genes and SNPs (NCBI Human Genome Build 35). For data quality control, SNPs were excluded if they have HWE $p$-values less than 0.01 or MAF less than 0.01. SNPs were also removed if their genotypes are redundant or have a missing rate over 10\%. The final data set contains 307,964 SNPs. The gene length (number of SNPs) ranges from 1 to 844 and is highly skewed to the right: the lower, median and upper quartiles are 3, 7 and 19, respectively. The missing genotypes were imputed as the average over subjects. Quantitative and binary traits were simulated under similar setups of rare and weak genetic effects as those in Section~\ref{Sect. SimuSNPdata}. Data sets 6--11 in Table~\ref{Table_DataList} list the parameters and setups based on three genes: \textit{BCHE} (butyrylcholinesterase) is a gene with 100 SNPs located at 3q26.1-q26.2; \textit{EXT1} (exostosin 1) is a gene with 106 SNPs located at 8q24.11; \textit{FSHR} (follicle stimulating hormone receptor) is a gene with 117 SNPs located at 2p21-p16. At the empirical type I error rate 0.05 from 1000 simulations, Figure~\ref{Figure_Simu_3genes} shows the empirical power of testing these genes through quantitative (row~1) and binary traits (row 2). It is clear that HC procedures performed similarly to or better than the other SNP-set methods. \begin{figure} \includegraphics{724f06.eps} \caption{Power comparison based on genotype data of genes BCHE (left), EXT1 (middle) and FSHR (right), respectively. Row 1 X-axis: the strength parameter $r$ for the genetic effect in equation (\protect\ref {Definer}) for the quantitative trait model; row 2 X-axis: the genetic effect $\beta$ in equation (\protect\ref{equ: genetic binary model}) for the binary trait model.}\label{Figure_Simu_3genes} \end{figure} We further studied the performance of these gene-detection methods when causative SNPs are simultaneously located within multiple risk genes. Specifically, we took 10 genes found to be associated with Crohn's disease (CD) in the literature [\citet{Franke2010}] and made each of these contain $L_{g}^{1-\alpha}$ causative SNPs (rounded to integer), where $L_{g}$ is the number of SNPs in the $g$th risk gene. The locations of these associated SNPs in each risk gene were randomly chosen. The quantitative traits were then generated by an additive model (\ref{equ: genetic model}) that contains all the causative SNPs from the 10 risk genes, where each causative SNP has a genetic effect $\beta_{j}$ defined in (\ref{Definetau})--(\ref{Definer}) with the rarity parameter $\alpha=0.8$ and the strength parameter $r_{j}=0.9$. After generating the quantitative trait, we carried out the GWA study by using the whole genotypes data of all 15,860 genes. Data sets 12 and 13 in Table~\ref{Table_DataList} summarize the information on the parameters and setups. To accommodate the fact that genes have distinct numbers of SNPs and LD structures, we again adapted the permutation test by randomly shuffling the response traits for obtaining the gene-by-gene empirical $p$-values. For the 10 risk genes, Tables~\ref{Table_10GeneJew} and \ref {Table_10GeneNonJew} show their empirical $p$-values from $10\mbox{,}000$ permutations as well as the corresponding ranks (ties are averaged) among all 15,860 genes based on Jewish and non-Jewish data, respectively. Only HC methods reliably had the smallest average $p$-values and ranks for both data sets. \begin{sidewaystable} \tabcolsep=0pt \tablewidth=\textheight \tablewidth=\textwidth \caption{Based on the NIDDK--IBDGC Jewish genotype data and the additive genetic model that contains 10 risk genes for Crohn's disease, all 15,860 genes were tested by gene-based SNP-set method, and were ranked based on their empirical $p$-values. The ranks and $p$-values of the 10 risk genes for each method are listed, and their averages are shown in the last row} \label{Table_10GeneJew} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ld{3.0}d{4.1}d{1.4}d{5.2}d{1.4}d{4.1}cd{4.0}d{1.4}d{4.1}d{1.4}d{4.1}d{1.4}@{}} \hline & & \multicolumn{2}{c}{\textbf{MinP}} & \multicolumn{2}{c}{\textbf{LCT}} & \multicolumn{2}{c}{\textbf{QT}} & \multicolumn{2}{c}{\textbf{KMT}} & \multicolumn{2}{c}{\textbf{HC}} & \multicolumn{2}{c}{\textbf{HCm}} \\ [-6pt] & & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c@{}}{\hrulefill} \\ \multicolumn{1}{@{}l}{\textbf{Genes}}& \multicolumn{1}{c}{\textbf{SNPs/gene}} & \multicolumn{1}{c}{\textbf{Rank}} & \multicolumn{1}{c}{\textbf{$\bolds{p}$-value}}& \multicolumn{1}{c}{\textbf{Rank}} & \multicolumn{1}{c}{\textbf{$\bolds{p}$-value}} & \multicolumn{1}{c}{\textbf{Rank}} & \multicolumn{1}{c}{\textbf{$\bolds{p}$-value}} & \multicolumn{1}{c}{\textbf{Rank}} & \multicolumn{1}{c}{\textbf{$\bolds{p}$-value}} & \multicolumn{1}{c}{\textbf{Rank}} & \multicolumn{1}{c}{\textbf{$\bolds{p}$-value}} & \multicolumn{1}{c}{\textbf{Rank}} & \multicolumn{1}{c@{}}{\textbf{$\bolds{p}$-value}}\\ \hline \textit{IL23R} & 23 & 490 & 0.0314 & 1772 & 0.1138 & 2337.5 & 0.1577 & 23 & 0.0007 & 109.5 & 0.0071 & 104.5 & 0.0069 \\ \textit{PTGER4} & 72 & 3984.5 & 0.2496 & 14\mbox{,}246 & 0.901 & 2885 & 0.1931 & 490 & 0.0309 & 470.5 & 0.0313 & 455 & 0.0298 \\ \textit{IL12B} & 41 & 2.5 & 0 & 15\mbox{,}574.5 & 0.9831 & 11.5 & 0.0006 & 3 & 0 & 2.5 & 0 & 2.5 & 0 \\ \textit{CDKAL1} & 160 & 2245.5 & 0.1423 & 4481 & 0.2859 & 6418.5 & 0.4155 & 150 & 0.0084 & 534.5 & 0.0352 & 506.5 & 0.0335 \\ \textit{PRDM1} & 71 & 4801.5 & 0.3029 & 2908 & 0.1858 & 5735.5 & 0.3733 & 8203 & 0.5243 & 8290 & 0.5243 & 8327 & 0.5275 \\ \textit{ZNF365} & 54 & 2.5 & 0 & 1809.5 & 0.1159 & 22 & 0.0013 & 8 & 0.0002 & 2.5 & 0 & 2.5 & 0 \\ \textit{PLCL1} & 64 & 1708.5 & 0.1092 & 8957 & 0.564 & 7353.5 & 0.4751 & 338 & 0.0194 & 807.5 & 0.0505 & 768.5 & 0.049 \\ \textit{BACH2} & 83 & 2.5 & 0 & 9747.5 & 0.6118 & 384 & 0.0274 & 3 & 0 & 2.5 & 0 & 2.5 & 0 \\ \textit{GALC} & 120 & 919 & 0.0578 & 15\mbox{,}391 & 0.972 & 7146.5 & 0.4612 & 1392 & 0.0948 & 936 & 0.0589 & 924.5 & 0.0581 \\ \textit{SMAD3} & 52 & 5806.5 & 0.3642 & 4193 & 0.268 & 3079 & 0.2041 & 5456 & 0.359 & 4985.5 & 0.3135 & 5024 & 0.316 \\[3pt] Average & 74 & 1996.3 & 0.1257 & 7907.95 & 0.5001 & 3537.3 & 0.2309 & \multicolumn{1}{c}{\phantom{.}\textbf{1606.6}} & \multicolumn{1}{c}{\textbf{0.1038}} & \multicolumn{1}{c}{\textbf{1614.1}} & \multicolumn{1}{c}{\textbf {0.1021}} & \multicolumn{1}{c}{\textbf{1611.9}} & \multicolumn{1}{c}{\textbf{0.1021}} \\ \hline \end{tabular*} \end{sidewaystable} \begin{sidewaystable} \tabcolsep=0pt \tablewidth=\textheight \tablewidth=\textwidth \caption{Same analysis as that for Table \protect\ref {Table_10GeneJew}, except by using the NIDDK--IBDGC non-Jewish genotype data} \label{Table_10GeneNonJew \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ld{3.0}d{4.1}d{1.4}d{5.2}d{1.4}d{4.1}cd{4.1}d{1.4}d{4.1}d{1.4}d{4.1}d{1.4}@{}} \hline & & \multicolumn{2}{c}{\textbf{MinP}} & \multicolumn{2}{c}{\textbf{LCT}} & \multicolumn{2}{c}{\textbf{QT}} & \multicolumn{2}{c}{\textbf{KMT}} & \multicolumn{2}{c}{\textbf{HC}} & \multicolumn{2}{c}{\textbf{HCm}} \\ [-6pt] & & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c@{}}{\hrulefill} \\ \multicolumn{1}{@{}l}{\textbf{Genes}}& \multicolumn{1}{c}{\textbf{SNPs/gene}} & \multicolumn{1}{c}{\textbf{Rank}} & \multicolumn{1}{c}{\textbf{$\bolds{p}$-value}}& \multicolumn{1}{c}{\textbf{Rank}} & \multicolumn{1}{c}{\textbf{$\bolds{p}$-value}} & \multicolumn{1}{c}{\textbf{Rank}} & \multicolumn{1}{c}{\textbf{$\bolds{p}$-value}} & \multicolumn{1}{c}{\textbf{Rank}} & \multicolumn{1}{c}{\textbf{$\bolds{p}$-value}} & \multicolumn{1}{c}{\textbf{Rank}} & \multicolumn{1}{c}{\textbf{$\bolds{p}$-value}} & \multicolumn{1}{c}{\textbf{Rank}} & \multicolumn{1}{c@{}}{\textbf{$\bolds{p}$-value}}\\ \hline \textit{IL23R} & 23 & 7184 & 0.4638 & 13\mbox{,}952.5 & 0.8833 & 3800.5 & 0.2603 & 4979 & 0.3379 & 5626 & 0.3584 & 5635 & 0.3587 \\ \textit{PTGER4} & 72 & 4627.5 & 0.2965 & 3859 & 0.2509 & 2983 & 0.2048 & 2080 & 0.1396 & 2327.5 & 0.1449 & 2318.5 & 0.1446 \\ \textit{IL12B} & 41 & 35 & 0.0016 & 48 & 0.0026 & 2552.5 & 0.1751 & 167 & 0.0075 & 29 & 0.0014 & 29.5 & 0.0013 \\ \textit{CDKAL1} & 160 & 3 & 0.0001 & 393 & 0.0246 & 3.5 & 0.0001 & 38 & 0.0011 & 4.5 & 0.0002 & 5.5 & 0.0002 \\ \textit{PRDM1} & 71 & 878 & 0.0529 & 9258.5 & 0.5888 & 8300.5 & 0.5427 & 41 & 0.0012 & 543 & 0.0322 & 517.5 & 0.0304 \\ \textit{ZNF365} & 54 & 6080.5 & 0.3912 & 4873 & 0.313 & 4021 & 0.2741 & 7593 & 0.4941 & 6857 & 0.4398 & 6837 & 0.4379 \\ \textit{PLCL1} & 64 & 1071 & 0.0656 & 404.5 & 0.0253 & 9475 & 0.6181 & 1048 & 0.0665 & 768 & 0.0479 & 777 & 0.048 \\ \textit{BACH2} & 83 & 2357.5 & 0.1469 & 11\mbox{,}721.5 & 0.7461 & 1055.5 & 0.069 & 2382 & 0.1591 & 1711 & 0.1065 & 1648.5 & 0.1032 \\ \textit{GALC} & 120 & 379.5 & 0.0232 & 14\mbox{,}902 & 0.9419 & 299.5 & 0.0209 & 45 & 0.0014 & 57.5 & 0.0033 & 58.5 & 0.0033 \\ \textit{SMAD3} & 52 & 119 & 0.0069 & 13\mbox{,}274.5 & 0.8428 & 952 & 0.0632 & 2378 & 0.1588 & 98 & 0.0052 & 96 & 0.0051 \\[3pt] Average & 74 & 2273.5 & 0.1449 & 7268.7 & 0.4619 & 3344.3 & 0.2228 & 2075.1 & 0.1367 & \multicolumn{1}{c}{\textbf{1802.2}} & \multicolumn{1}{c}{\textbf{0.1140}} & \multicolumn{1}{c}{\textbf{1792.3}} & \multicolumn{1}{c}{\textbf{0.1133}} \\ \hline \end{tabular*} \end{sidewaystable} \subsection{Real GWAS of Crohn's disease} Crohn's disease primarily causes ulcerations of the small and large intestines, which affects between 400,000 and 600,000 people in North America alone [\citet{Baumgart2007,Loftus2002}]. To detect novel risk genes of Crohn's disease, we applied the above gene-based SNP-set methods to the NIDDK--IBDGC data that contain both real genotypes and Crohn's disease status as the phenotype (see data sets 14 and 15 in Table~\ref{Table_DataList}). The genetic architecture of Crohn's disease remains unclear. One way to partially compare the above methods for detecting remaining risk genes is to base on risk genes that have similar properties as those undiscovered ones. In particular, we studied a set of 41 recently reported putative genes that likely contain such SNPs with rare and weak genetic effects to the susceptibility of Crohn's disease [Table~2 of \citet{Franke2010}]. The empirical $p$-values and the corresponding ranks for these 41 genes are summarized in supplementary Tables~1 and 2 in the supplementary materials [\citet{wuz2014suppl}] for the Jewish data and the non-Jewish data, respectively. For both data sets the HC method provided higher average ranks for the 41 risk genes than the other methods. For the top 96 ranked genes by HC and those by MinP methods, 87 of them are common. Nine genes were included in the top 96 genes by HC, but not by MinP: \textit{PFAAP5}, \textit{AGTR1}, \textit{CDA08}, \textit {NXPH1}, \textit{LCN10}, \textit{OR51G1}, \textit{FDXR}, \textit {KIAA1904}, and \textit{EDG1}. Interestingly, by the Catalogue of Somatic Mutations in Cancer (COSMIC), all nine genes contain one or more genetic variations associated to the tumor site on the large intestine. Some of these genes are likely to be relevant according to their functions. For example, \textit{PFAAP5} (human phosphonoformate immuno-associated protein~5) on chr13 is likely related to Crohn's disease, a disease of the immune system. \textit{AGTR1} (Angiotensin II receptor type 1) on chr3 involves positive regulation of inflammatory response [\citet{uniprot2012reorganizing}] and is associated with the increase of immunoglobulin [\citet{wallukat1999patients}]. As a critical antibody in mucosal immunity, 3--5 grams of immunoglobulin is secreted daily into the intestinal lumen [\citet{brandtzaeg2004let}]. For \textit {NXPH1} (neurexophilin~1) on chr7, neurexophilins are signaling molecules that resemble neuropeptides by binding to alpha-neurexins and possibly other receptors. This gene may be relevant because Crohn's disease can also present with neurological complications. Gene \textit {LCN10} is potentially relevant because biopsies of the affected colon of Crohn's patients may show mucosal inflammation, characterized by focal infiltration of neutrophils, a type of inflammatory cell, into the epithelium [\citet{Baumgart20121590}]. Gene \textit{EDG1} (endothelial differentiation gene 1) has regulatory functions in normal physiology and disease processes, particularly involving the immune, and influences the delivery of systemic antigens [\citet {arnon2011grk2}]. Furthermore, genes \textit{AGTR1}, \textit{CDA08}, \textit{OR51G1} and \textit{EDG1} correspond to the components integral to membranes [\citet{binns2009quickgo}], thus are also linked to Crohn's disease, which is categorized as a membrane transport protein disorder. Certainly, further biological validations are needed to confirm how these genes are related to Crohn's disease. \section{Discussion} \label{Sect: Discu} This paper makes several contributions to the literature. First, it considers the detection boundary for rare and weak genetic effects in the GWAS setting. Second, our approach allows for marker dependencies (LD) and unknown error variance, which are lacking in theoretical consideration in the literature and are better aligned with practical GWAS settings. Third, it shows that some of the commonly used SNP-set methods are suboptimal. Fourth, it proposes a HC-based method to evaluate the statistical evidence of association between a set of SNPs and a complex trait. We show that this method achieves the most power for the specified rare and weak genetic effect setting. Application of this method to the second wave of GWAS will likely help researchers identify more trait-associated genes. Because the values of $R$- or $T$-test statistics in (\ref{equ. R T stat}) depend on the correlations among the genotypic covariates, the HC procedure for optimal gene detection implicitly incorporates the LD information into the hypotheses testing. For example, those SNPs correlated with an associated SNP likely have larger magnitude of their $R$- or $T$-test statistics and thus smaller marginal $p$-values. So the maximization procedure in (\ref{equ. HC}) can capture this information to strengthen the genetic signal. At least in the polynomially decaying correlations defined in (\ref{equ. poly decay}), this implicit LD-incorporation is asymptotically more powerful than some commonly applied procedures that explicitly calculate and incorporate the correlation matrix into constructing test statistics [\citet {LuoXiong2010}], as is illustrated by Theorem~\ref{Thm: others less powerful}. This paper sheds some light on the power of genetic association studies based on marginal association tests versus joint association tests [\citet{Genovese2009}]. One interesting discovery of this paper is that the HC procedure based on marginal association tests has actually reached the optimal detection boundary for the additive genetic model in (\ref{equ: genetic model}). That is, the merit of joint association analysis is probably not for the additively joint genetic effects, but rather for gene--gene interactions [\citeauthor{WuZ2009} (\citeyear{WuZ2009,WuZ2011})]. Although we have derived some theoretical results in this paper, and the general setup may be a reasonable abstraction of the real model, the assumptions considered are still relatively simple and may not capture the complexity of the real genetic architecture. For example, we did not consider potential gene--gene interactions that are believed to play an important role in biological systems. However, our work does represent advances over the simpler setup in the literature [\citet {Arias2010,Donoho2004}],\vadjust{\goodbreak} with the allowance of genotype covariates and unknown environmental variance. Our theoretical results offer insights on the relative performance of different methods, which were supported by results from simulation and practical GWAS. Our current work can lead to several future research topics in statistical genetics. The empirical null distribution may depart from $N(0, 1)$ in large scale data due to unobserved covariates and/or correlations [\citeauthor{Efron2004} (\citeyear{Efron2004,efron2007correlation,Efron2007})]. It is important to address how likely this problem could arise in gene-based detection in GWAS, and how to theoretically and practically address the issue in detecting sparse heterogeneous mixtures. From a genetics perspective, first, it would be interesting to study more complex genetic models, such as those measuring gene--gene interactions. Second, the proposed HC procedure can be extended to broader applications in genetic studies. We have illustrated the methods for gene detection based on SNP-sets grouped within genes. Depending on the scientific interests, SNPs can also be grouped based on other genomic segments or based on pathways containing sets of relevant genes [\citet {LuoXiong2010,Yu2009}]. For example, in a pathway analysis, we can directly calculate the HC statistics using all individual SNPs within the pathway. We can also construct a two-level study, in which we calculate $p$-values for genes, for example, by the goodness-of-fit test [\citet{Donoho2004}, Section~1.6] for all SNPs within those genes, then use $p$-values of genes to calculate an HC type statistic for each pathway. These strategies will be investigated in further research. \section*{Acknowledgments} The authors thank the Area Editor, the Associate Editor and the two referees for many insightful and constructive comments that have significantly improved the paper. We appreciate the Computing and Communications Center at Worcester Polytechnic Institute for computational support. \begin{supplement}[id=suppA] \stitle{Supplement to ``Detection boundary and Higher Criticism approach for rare and weak genetic effect''} \slink[doi]{10.1214/14-AOAS724SUPP} \sdatatype{.pdf} \sfilename{aoas724\_supp.pdf} \sdescription{We provide the proofs for main theoretical results, the fundamental lemmas and their proofs, as well as additional figures and tables that show performance of Higher Criticism in comparing with other methods under a variety of setups.} \end{supplement}
{'timestamp': '2014-08-01T02:09:03', 'yymm': '1407', 'arxiv_id': '1407.8382', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8382'}
arxiv
\section{Introduction.} In nature, organisms whose sizes differ by many orders of magnitude have been observed to switch between different modes of movement. For instance, the bacterium \emph{Escherichia coli} changes the orientation of one or more of its flagella between clockwise and anticlockwise to achieve a \emph{run-and-tumble} like motion \cite{Berg_1983, Berg_1990}. As a result, during the runs, we see migration-like movement and during the tumbles, we see resting or local diffusion behaviour\footnote{The reason for observing diffusive-like behaviour is due to the bacterium's small size - which is on the length-scale of micrometres.}. To add to this complexity, it should be noted that the direction of successive runs are correlated. On a larger scale one could consider migratory movements of vertebrates where individuals often travel large distances intermittent with stop-overs to rest or forage. An example, used in this paper, is the lesser black-backed gull (\emph{Larus fuscus}). Individuals of this species that breed in the Netherlands migrate southwards during Autumn. Even though the scales involved in these two processes differ by many orders of magnitude, one can use a similar mathematical framework to model the observed motion. The use of mathematical models to describe the motion of a variety of biological organisms, including bumblebees \cite{kareiva83}, plants \cite{cain90} and zebra \cite{brooks08} has been the subject of much research interest for several decades. Early approaches were predominantly centred on the position jump model of motion \cite{Brenner_1998,skellam51}, where agents instantaneously change position according to a distribution kernel and are interspersed with waiting periods of stochastic length. The position jump framework suffers from the limitation that correlations in the direction of successive runs are difficult to capture, this correlation however is present in many types of movement \cite{Marsh_1988}. Furthermore, the diffusive nature of the position jump framework results in an unbounded distribution of movement speeds between successive steps. A related framework that is arguably more realistic for modelling the motion of organisms is the velocity jump (VJ) model \cite{Othmer_1988}, in which organisms travel with a randomly-distributed speed and angle for a finite duration before undergoing a stochastic reorientation event. In most formulations of the velocity jump process, there is an assumption that events occur as a Poisson process, which is manifested as a constant rate parameter in the resulting differential equation. In the position jump framework, non-exponentially distributed wait times and non-Gaussian kernel processes have been formulated, although this led to fractional diffusion equations \cite{Klafter_1987, Metzler_2000}. Recently, it has become clear how to extend the velocity jump framework to allow for more general distributions of interest \cite{Friedrich_2006_2, Friedrich_2006}. In many velocity jump models, it is assumed that resting states are largely negligible \cite{Erban_2004, Erban_2005}, this can be attributed to a focus on organisms with only momentary resting states, this has the benefit of alleviating some mathematical complexity whilst not changing the result significantly \cite{Erban_2004}. However, in the work by Othmer \cite{Othmer_1988} and Erban \cite{Erban_2007}, it was shown that resting states can be included and are sometimes required in order to obtain adequate fits to experimental data \cite{Othmer_1988}. Our goal in this paper is to extend the work by Friedrich \emph{et. al.} \cite{Friedrich_2006} to allow for resting states - which are non-negligible - following the methodology of Othmer \cite{Othmer_1988}. The mathematical complexity of Friedrich's model is such that finding solutions analytically or numerically is, in general, impractical. In the original paper, simplifications were made which led to a fractional Kramers-Fokker-Planck equation, which has a known analytic solution \cite{Friedrich_2006}. However, the simplifications relevant to a physical system are seldom relevant to a biological one. For instance, the original formulation related to non-Gaussian kinetics in a weakly damped system; however, we are considering self-propelled particle models where biological agents generate their own momentum. In the absence of such obvious simplifications for our system, we instead exploit methods to extract summary statistics from the governing equations, which may in turn be compared with experimental data. After presenting the model of interest we derive the mean squared displacement (MSD). As we have high-quality data available relating to the movement of \emph{E. coli} and \emph{L. fuscus}, we show that the MSD for the model and experimental data align. What is novel about our approach is that, provided the two discrete modes of operation constitute a good model, the parameters can be extracted on a microscopic scale prior to any numerical solution and then macroscopic behaviour can be derived \emph{without} optimising or trying to fit data \emph{a posteriori}. Since the dynamics of the experimental data and those of the generalised velocity jump model achieve a close match, we explore numerically tractable simplifications to the equations of interest. Most notably, we investigate the Cattaneo approximation, following the work by Hillen \cite{Hillen_2003, Hillen_2004}. Finally, it should be noted that the model presented does not take into account interactions between biological agents or even interactions with the environment. Whilst such effects are beyond the scope of the current study, it should be possible to extend the theory to incorporate these phenomena. In particular, the velocity jump process has roots in Kinetic Theory and as such, similar to how atoms attract and repel one another, models have been developed for biological agents to act comparably \cite{Carillo_2009, Degond_2004, Naldi_2010}. Equally, there is similar work detailing interactions between a biological agent and its environment, both fixed environments and signalling via diffusing chemical gradients \cite{Chauviere_2010, Erban_2004, Erban_2005}. \section{Two-state generalised velocity jump process.}\label{TwoStateGVJ} Consider a biological agent that switches stochastically between running and resting behaviour. During a running phase, the organism travels with constant velocity; during a resting phase, it remains stationary. Upon resuming a run following a rest, a new velocity is selected randomly. This motion is governed by three primary stochastic effects. We specify these by probability density functions (pdfs), as given below. \begin{itemize} \item[i.)] Waiting time: The time spent during a resting phase, denoted $\omega$ is governed by the pdf $f_{\omega}(t)$, where $\int_0^\infty f_\omega (t)\text{d} t=1$. \item[ii.)] Running time: The time spent during a running phase, denoted $\tau$ is governed by the pdf $f_{\tau}(t)$, where $\int_0^\infty f_\tau (t)\text{d} t=1$. \item[iii.)] Reorientation: We allow velocities from one run to another to be correlated from before to after a rest. Suppose the previous running phase (pre-rest) had an associated velocity $\vect{v}'\in V$, for velocity space $V\subset \mathds{R}^n$ in $n$ spatial dimensions, then we write the new (post-rest) velocity as $\vect{v}\in V$ which is newly selected upon entering a running phase. The selection of $\vect{v}$ is dependent on $\vect{v}'$ and is governed by the joint pdf $T(\vect{v},\vect{v}')$. We assume that this reorientation pdf is separable, so that $T(\vect{v},\vect{v}') = g(\vect{\theta}, \vect{\theta}')h(s, s')/s^{n-1}$ where $\vect{\theta}$ is a vector of length $(n-1)$ containing angles and $s = \vectornorm{\vect{v}}$ is the speed. In two dimensions, the turning kernel is decomposed as follows. \begin{quotation} \item[a.)] The angle distribution: $g(\theta, \theta')$, requires the normalisation $\int_0^{2\pi}g(\theta, \theta')\text{d} \theta = 1$. \item[b.)] The speed distribution: $h(s, s')$, requires the normalisation $\int_0^{\infty}h(s, s')\text{d} s = 1$. \end{quotation} \end{itemize} To further reinforce the process we are describing, we give a simple Gillespie algorithm \cite{Gillespie_1977} for generating a sample path up until time $T_{\text{end}} > 0$. It should be noted that the sample path will need to be truncated as it will generate positions past the end time. \begin{algorithm}[H] \DontPrintSemicolon \KwData{Initialise time $t=0$, starting position at $\vect{x}(t=0) = \vect{x}_0$ and starting velocity at $\vect{v}(t=0) =\vect{v}_0$.} Choose state of particle, for instance, assume particle has just initiated a running state. \; \While{$t < T_{\text{end}}$}{ Sample time spent running $\tau\sim f_{\tau}(t)$.\; Update position: $\vect{x}(t+\tau) \leftarrow \vect{x}(t) + \tau\vect{v}(t)$.\; Sample time spent waiting $\omega\sim f_{\omega}(t)$.\; Update position: $\vect{x}(t+\tau+\omega) \leftarrow \vect{x}(t+\tau)$.\; Sample new velocity for next running phase: $\vect{v}(t+\tau+\omega)\sim T(\cdot, \vect{v}(t))$.\; Update time $t \leftarrow t + \tau + \omega$.\; } \caption{Algorithm to generate a single generalised velocity jump sample path.} \end{algorithm} By considering the density of particles in a running state and the density of particles in a resting state, we can write down coupled differential equations for these states. We define $p=p(t,\vect{x},\vect{v})$ to be the density of particles at position $\vect{x}\in\Omega\subset\mathds{R}^n$, with velocity $\vect{v}\in V\subset\mathds{R}^n$ at time $t\in \mathds{R}^+$ and $r = r(t,\vect{x},\vect{v})$, the density of those particles resting at $(t, \vect{x})\in\mathds{R}^+\times \Omega$, having just finished a jump of velocity $\vect{v}\in V$. Note that this encodes an orientation to the resting state. The derivation for this two-state generalised velocity jump process through the use of Laplace transforms is provided in Appendix \ref{AppA}. Our analysis leads to the following equations \begin{eqnarray}\label{p_forward} \left(\frac{\partial}{\partial t} + \vect{v}\cdot{\nabla_{\vect{x}}} \right) p(t,\vect{x},\vect{v}) = -\int_0^t \Phi_\tau(t-s) p(s,\vect{x} - (t-s)\vect{v},\vect{v}) \text{d} s \\ + \int_0^t \Phi_{\omega}(t-s)\int_V T(\vect{v},\vect{v}')r(s,\vect{x},\vect{v}')\text{d}\vect{v}'\text{d} s, \nonumber \end{eqnarray} and \begin{equation}\label{r_forward} \frac{\partial}{\partial t}r(t,\vect{x},\vect{v}) = -\int_0^t \Phi_\omega(t-s) r(s,\vect{x},\vect{v}) \text{d} s + \int_0^t \Phi_{\tau}(t-s)p(s,\vect{x}-(t-s)\vect{v},\vect{v}) \text{d} s, \end{equation} where the delay kernels, $\Phi_i$ for $i = \tau, \omega$, are defined in Laplace space by \begin{equation}\label{f_psi_conversion} \bar{\Phi}_i (\lambda) = \frac{\lambda \bar{f}_i (\lambda)}{1 - \bar{f}_i(\lambda)} \quad \text{for }i=\tau , \omega . \end{equation} where $\bar{f}_i$ is the Laplace transform of the pdf for the running and waiting time respectively. When the waiting time is chosen as exponential\footnote{This can be seen simply for exponential distribution with mean $\chi^{-1}$, \begin{equation} f_i(t) = \chi_i e^{-\chi_i t}, \quad\implies\quad \bar{f}_i(\lambda) = \frac{\chi_i}{\lambda + \chi_i} ,\quad\implies\quad \bar{\Phi}_i (\lambda) = \chi_i ,\quad\implies\quad \Phi_i (t) = \chi_i \delta (t), \quad \text{for }i=\tau , \omega , \end{equation} where $\delta$ is the Dirac delta function.}, this is consistent with work by Othmer \cite{Othmer_1988} and Rosser \cite{Rosser_2012}. Finding closed forms of $\Phi_i(t)$ is non-trivial for most choices of distribution $f_i(t)$. In Appendix \ref{AppB}, we examine the small time behaviour of $\Phi$ and identify the sizes of potential impulses at $t=0$. For the remaining non-singular behaviour, in the cases where we know the Laplace transform of $f_i(t)$, we then have an analytic expression for $\bar\Phi (\lambda)$, which can be inverted numerically using either a Talbot inversion or an Euler inversion \cite{Abate_1995, Murli_1990}. \section{Mean-Squared Displacement.} Equations (\ref{p_forward}--\ref{r_forward}) give us a system of delay-integro-partial differential equations with $(2n + 1)$ degrees of freedom. With this level of complexity, a full analytic or numerical solution is impractical without first making simplifications. We therefore first consider how to estimate the second spatial moment, i.e. the mean squared displacement \cite{Othmer_1988}. For the test function $\varphi = \varphi(\vect{x}, \vect{v})$, we consider for arbitrary density $\rho = \rho(t,\vect{x},\vect{v})$, \begin{equation} Q_\rho(\varphi,t) = \int_V \int_\Omega \varphi (\vect{x}, \vect{v})\rho(t,\vect{x},\vect{v}) \text{d} \vect{x} \text{d} \vect{v}. \end{equation} This gives the expected value of $\varphi$ over the space $V\times\Omega$ at time t, weighted by density $\rho$. By using test functions $\varphi = 1, \vectornorm{\vect{x}}^2, \vect{v}\cdot\vect{x}, \vectornorm{\vect{v}}^2$, we associate $N_\rho(t) = Q_\rho(1,t)$ as the number of particles in state $\rho$ and then $D_\rho^2 (t)= Q_\rho (\vectornorm{\vect{x}}^2, t)$, $B_\rho(t) = Q_\rho (\vect{v}\cdot\vect{x}, t)$ and $V_\rho^2 (t)= Q_\rho (\vectornorm{\vect{v}}^2, t)$ as the mean squared displacement, the mean velocity-displacement and the mean squared velocity weighted by $\rho$, respectively. We can then obtain a closed system of integro-differential equations for these quantities. It first requires however, that we make some assumptions on the Turning kernel $T$. By considering that the mean post-turn velocity has the same orientation as the previous velocity, we define the index of persistence $\psi_d$ via the relation \begin{equation} \bar{\vect{v}}(\vect{v}') = \int_V \vect{v}T(\vect{v},\vect{v}') \text{d} \vect{v} = \psi_d \vect{v}'. \end{equation} Informally, this means that turning angles between consecutive velocities have zero mean. We also require that the average mean squared speed is a constant \begin{eqnarray} S_T^2(\vect{v}') = S_T^2 = \int_V \vectornorm{\vect{v}}^2 T(\vect{v},\vect{v}') \text{d} \vect{v} , \end{eqnarray} this corresponds to a memoryless turning kernel in speed, i.e. $h(s,s') = h(s)$. Finally, for unconstrained motion where $\Omega = \mathds{R}^n$, we see that delays in space correspond to inclusion of other moments, i.e. \begin{eqnarray} \int_V \int_\Omega \vectornorm{\vect{x}}^2 \rho(t,\vect{x}-c\vect{v},\vect{v}) \text{d} \vect{x} \text{d} \vect{v} &=& \int_V \int_\Omega \vectornorm{\vect{x} + c\vect{v}}^2 \rho(t,\vect{x},\vect{v}) \text{d} \vect{x} \text{d} \vect{v} ,\\ &=& \int_V \int_\Omega \left(\vectornorm{\vect{x}}^2 + 2c(\vect{v}\cdot\vect{x}) + c^2 \vectornorm{\vect{v}}^2 \right)\rho(t,\vect{x},\vect{v}) \text{d} \vect{x} \text{d} \vect{v} , \\ &=& D_\rho^2(t) + 2c B_\rho(t) + c^2 V_\rho^2(t) , \end{eqnarray} and similarly \begin{eqnarray} \int_V \int_\Omega (\vect{v}\cdot \vect{x}) \rho(t,\vect{x}-c\vect{v},\vect{v}) \text{d} \vect{x} \text{d} \vect{v} &=& \int_V \int_\Omega (\vect{v}\cdot \vect{x} + c\vect{v}) \rho(t,\vect{x},\vect{v}) \text{d} \vect{x} \text{d} \vect{v} , \\ &=& B_\rho(t) + c V_\rho^2(t) . \end{eqnarray} For conservation of mass, i.e. $N_p(t) + N_r(t) = N_0$, we see that \begin{eqnarray}\label{MSD_first_eq} \frac{\text{d} N_p(t)}{\text{d} t} = - \frac{\text{d} N_r(t)}{\text{d} t} = -\int_0^t \Phi_\tau (t-s)N_p(s)\text{d} s + \int_0^t \Phi_\omega (t-s)N_r (s) \text{d} s. \end{eqnarray} Equally, we obtain a system of equations for the mean squared displacement \begin{eqnarray} \frac{\text{d} D_p^2(t)}{\text{d} t} - 2B_p(t) = -\int_0^t \Phi_\tau(t-s)\left[ D_p^2(s) + 2(t-s)B_p(s) + (t-s)^2V_p^2(s)\right]\text{d} s, \\ + \int_0^t \Phi_\omega(t-s) D_r^2(s) \text{d} s = - \frac{\text{d} D_r^2(t)}{\text{d} t}. \nonumber \end{eqnarray} For the mean velocity-displacement, we see that \begin{eqnarray} \frac{\text{d} B_p(t)}{\text{d} t} = V_p^2(t) - \int_0^t \Phi_\tau (t-s) \left[ B_p(s) + (t-s)V_p^2(s)\right] \text{d} s, \\ + \psi_d \int_0^t \Phi_\omega (t-s) B_r(s) \text{d} s, \nonumber \end{eqnarray} and \begin{equation} \frac{\text{d} B_r(t) }{\text{d} t} = - \int_0^t \Phi_\omega (t-s) B_r(s) \text{d} s+ \int_0^t \Phi_\tau (t-s) \left[ B_p(s) + (t-s)V_p^2(s)\right] \text{d} s. \end{equation} Finally, for the second velocity moment: \begin{eqnarray} \frac{\text{d} V_p^2(t)}{\text{d} t} = - \int_0^t \Phi_\tau (t-s) V_p^2(s) \text{d} s +S_T^2 \int_0^t \Phi_\omega (t-s) N_r(s) \text{d} s, \\ \frac{\text{d} V_r^2(t)}{\text{d} t} = - \int_0^t \Phi_\omega (t-s) V_r^2(s) \text{d} s+ \int_0^t \Phi_\tau (t-s) V_p^2 (s) \text{d} s. \label{MSD_last_eq} \end{eqnarray} Equations (\ref{MSD_first_eq})--(\ref{MSD_last_eq}) above correspond to a system of 8 equations, or 7 unique equations once we impose conservation of mass. In the next section, we solve these equations numerically, the integrals are calculated using the trapezium rule along with a Crank-Nicholson scheme for the remaining differential operators, both of these methods are second-order accurate. \section{Comparison between Theory and Experiment.}\label{CompExpTheo} In this study, we consider experimental data relating to the bacterium \emph{E. coli} and the lesser black-backed gull \emph{L. fuscus}. Both of these exhibit somewhat similar behaviour, however at scales many orders of magnitude apart. \subsection{E. coli.} There is a large collection of work relating to studying the run-and-tumble motion as exhibited in many flagellated bacteria \cite{Berg_1972,frymier95,Rosser_2013,wu06}. A case of particular interest to many is \emph{E. coli}, perhaps due to the fact that its internal signalling pathways are less complex than those of other chemotactic bacteria \cite{porter08}. Most available literature points to both the running and resting times being exponentially distributed \cite{Berg_1990}. This exponential parameter can change as a response to its environment and has led to a multitude of papers showing that this mechanism leads to chemotaxis either towards nutrients or away from toxins \cite{Erban_2004, Erban_2005}. \begin{wrapfigure}{r}{0.4\textwidth} \begin{overpic}[width=0.4\textwidth]{figure1.pdf} \put(1,24){\rotatebox{90}{\small{Prob. Density}}} \put(33,0){\small{Angle in radians}} \end{overpic} \caption{\footnotesize{Fit between experimentally observed values of angle changes from run-to-run \emph{(blue)} and the probability density function for the Von-Mises distribution \emph{(red)}.}} \label{VonMises_Ecoli} \end{wrapfigure} In our case however, we do not consider \emph{E. coli} in any chemical gradient but just swimming freely. The dataset used here has previously been described in studies by Rosser \emph{et. al.} \cite{Rosser_2014, Rosser_2013}. In brief, the data was obtained by performing video microscopy on samples of free-swimming \emph{E. coli}, from which tracks were extracted using a kernel-based filter \cite{Wood_2012}. The tracks were subsequently analysed using a Hidden Markov Model to infer the state (running or resting) attributed to the motion between each pair of observations in a track \cite{Rosser_2013}. From the annotated tracks, it is possible to extract the angle changes observed between running phases and parameters for the exponential running and waiting pdfs along with speed distributions. \subsubsection{Results.} In Figure \ref{VonMises_Ecoli}, we see that from run-to-run, the distribution of angles is approximately a wrapped normal distribution. For mathematical ease, consider the Von Mises distribution as an approximation as plotted in red and given by the probability density function \begin{equation}\label{eq_vm_dist} \Theta (\theta | \mu, \kappa) = \frac{e^{\kappa \cos (\theta - \mu)}}{2\pi I_0(\kappa)}, \quad\text{for }\kappa > 0, \mu\in\mathds{R}, \end{equation} where $I_0(\cdot)$ is the modified Bessel function of order zero. By assuming $g(\theta, \theta') = \Theta (\theta - \theta')$, i.e. symmetry around the previous direction, we can specify $\mu = 0$, and find $\kappa$ through maximum likelihood estimation. It has been shown that for the choice of a Von Mises distribution, in two dimensions ($n=2$), the index of persistence is given by $\psi_d = I_1(\kappa) / I_0 (\kappa)$. \begin{figure}[h!] \begin{overpic}[width=0.5\textwidth]{figure2.pdf} \put(3,10){\rotatebox{90}{Mean sq. displacement $(\mu \text{m})^2$}} \put(44,0){Time (s)} \end{overpic} \caption{\footnotesize{{Comparison between system of equations (\ref{MSD_first_eq}--\ref{MSD_last_eq}) and \emph{E. coli} data. In red, the theoretical value of $(D_p^2 + D_r^2)/N_0$ is plotted and in blue there is the experimentally derived average MSD calculated from the bacterium's initial position. From the data, we determined that $\tau \sim \text{Exp}(2.30)$, $\omega \sim \text{Exp}(11.98)$. Equally, for the system of differential equations, we specify $N_p(0) = 66$, $N_r(0) = 1802$, $\psi_d = 0.46$ and $S_T^2 = 9.26\,(\mu\text{m})^2/\text{s}$. The initial state for all other differential equations is set to zero, except for $V_p^2(0) = S_T^2 N_p^2(0)$.}}} \label{MSD_eColi} \end{figure} It should be noted that from the literature, \emph{E. coli} is thought to have a bi-modal distribution around the previous direction \cite{Berg_1972}, the validity of this is hard to confirm as previous data was hand annotated and it is hard to specify the state of the bacterium when diffusion effects are also in place. Whilst we had more data available to us and used automated tracking methods, it could well be that our method heavily biases walks towards normally distributed reorientation. Through the HMM technique as outlined in \cite{Rosser_2014, Rosser_2013}, estimates for the exponential parameters were found to be $\tau \sim \text{Exp}(2.30)$ and $\omega \sim \text{Exp}(11.98)$. The mean squared speed whilst running was also calculated to be $S_T^2 = 9.26\,(\mu\text{m})^2/\text{s}$. In Figure \ref{MSD_eColi}, we plot the mean squared displacement over time. We clearly see that over the average of 1868 paths, we get a very good match between theory and experiment. We note that the videos were taken from a fixed position, where bacteria would swim in and out of the shot. By considering the average speeds of \emph{E. coli} along with the size of the viewing window, one can stipulate that by only considering the MSD before 4 seconds, we can achieve a good estimate. Note that we lose a small amount of data over time as bacterium swim out of the observation window, at later times this ruins the validity of the MSD curve. \subsection{Lesser black-backed gull.} In this section we consider Lesser black-backed gulls that breed on Texel (the Netherlands). During their non-breeding period (August to April), these birds interchange between localised movements (or resting) and long distance movements (migration) \cite{Em_ref_1, Em_ref_2}. During the resting mode birds travel up to 50 km but return to a central place every day, whereas during the migration mode birds do not return to the central place and can travel several hundreds of kilometers per day. One point of interest is that whilst the resting periods can last months on end, the migrations may only last for a few days on end. See Figure \ref{bird_sample_path_map} for a section of a sample path centred around London. \begin{wrapfigure}{l}{0.4\textwidth} \begin{center} \includegraphics[natwidth=400, natheight=350, width=0.4\textwidth]{figure3.png} \end{center} \caption{\footnotesize{Sample path from bird data.}}\label{bird_sample_path_map} \end{wrapfigure} \subsubsection{Identification of states.} The bird tracking data were collected by the UvA-BiTS system \cite{Em_ref_1} and contains tracks gathered from 10 birds over the months July until January in the years 2012 and 2013. Approximately every few hours\footnote{Although some devices are configured differently to the extent that a recording is taken every $15$ minutes.}, a recording is taken of a global time-stamp along with the bird's current latitude and longitude coordinates. To identify the state of a given bird, we create a signal centred around a time point of interest which we threshold to determine whether the bird is either undergoing local or migratory behaviour. By considering all GPS coordinates in a 24 hour window, we calculate the diameter of the convex hull (or diameter of a minimum bounding circle)\footnote{The maximum distance between any two points in the set.} of the set by using the Haversine formula\footnote{The Haversine formula is an equation for great-circle distances between a pair of points on a sphere. By considering the radius of the sphere (i.e. the approximate radius of the Earth) and a pair of latitude--longitude co-ordinates, one can calculate the distance between them.}. This signal is sampled $10$ times a day. If the value of this signal is low, points are clustered together (local resting behaviour) otherwise they are spread apart (migratory behaviour). At the cost of including some erroneous exceptionally short rests, we can set a low threshold value of $52 \text{km}$; the presence of short rests is then fixed by discarding any resting phases shorter than 2 days. In comparison, the running periods can virtually be of any length as there have been instances of a bird flying exceptionally long distances over a week. \subsubsection{Results.} \begin{figure} \centering \begin{overpic}[width=0.5\textwidth]{figure4.pdf} \put(5,12){\rotatebox{90}{Mean sq. displacement $(\text{km})^2$}} \put(39,0){Time (days)} \end{overpic} \caption{\footnotesize{Comparison between system of equations (\ref{MSD_first_eq}--\ref{MSD_last_eq}) and \emph{Larus fuscus} data. In red, the theoretical value of $(D_p^2 + D_r^2)/N_0$ is plotted and in blue there is the experimentally derived average MSD calculated from the bird's initial position. From the data, it was extracted that $\tau \sim \text{IG}(1.26,1.22)$, $\omega \sim \text{IG}(10.79,7.42)$. Equally, for the system of differential equations, we specify $N_p(0) = 6$, $N_r(0) = 56$, $\psi_d = 0.42$ and $S_T^2 = 1.03\times 10^{5}\, (\text{km})^2 / \text{day}$. The initial state for all other differential equations is set to zero, except for $V_p^2(0) = S_T^2 N_p^2(0)$.}} \label{MSD_gulls} \end{figure} As we only had the data for $10$ birds available, we divided their sample paths up into $28$ day intervals after approximating distributions of interest, leading to calculation of the MSD over 62 sample paths. In contrast to the \emph{E. coli} dataset, we see that running and waiting times are non-exponentially distributed. The distribution of running and waiting times were approximated by Inverse Gaussian distributions $\tau \sim \text{IG}(1.26,1.22)$ and $\omega \sim \text{IG}(10.79,7.42)$. The speed distribution gave an estimate for the mean squared running speed as $S_T^2 = 1.03\times 10^{5}\, (\text{km})^2 / \text{day}$ and again using a Von Mises distribution in angle, we find $\psi_d = 0.42$. In Figure \ref{MSD_gulls}, we plot the mean squared displacement in kilometres squared against time in days. As there were fewer sample paths available, the empirical mean square displacement curve is not very smooth and as a result the agreement with the theoretical curve is less good than in the bacterial case. However as the majority of the gulls were in a resting state to begin with, we do capture the initial delay before a linear growth stage. As the gulls are frequently resting as opposed to migrating, we see the data for the gulls (in blue) undergoing a style of step function where a small number of gulls undergoing fast movement quickly changes the MSD for the whole population. As the number of sample paths increases, this effect will smooth out. With both examples, as time passes, we see that $D_p^2(t) + D_r^2(t) \sim t$ for large $t$. It is well known that linear mean squared displacement corresponds to the solution of the diffusion equation, or at least diffusive-like behaviour. It would now be pertinent to see if a diffusion approximation could be found for large time. \section{Large time diffusion approximation.} We now construct a large time effective diffusion equation. By first considering equations (\ref{p_forward})--(\ref{r_forward}), we transform into Laplace space, where large values of $t$ correspond to small values of the Laplace variable $\lambda$. We then carry out a Taylor expansion of the delay kernels to remove the convolutions in time (see equations (\ref{p_laplace})--(\ref{r_laplace}) in Appendix \ref{AppA} for details). Converting back to the time domain, one obtains \begin{equation}\label{large_time_p_for} (1 + \bar{\Phi}_\tau '(0))\left(\frac{\partial}{\partial t} + \vect{v}\cdot{\nabla_{\vect{x}}} \right) p = -\bar{\Phi}_\tau(0) p + \int_V T(\vect{v},\vect{v}')\left( \bar{\Phi}_\omega(0) r(t,\vect{x},\vect{v}') + \bar{\Phi}_\omega'(0)\frac{\partial}{\partial t} r(t,\vect{x},\vect{v}') \right) \text{d}\vect{v}' , \end{equation} and \begin{equation}\label{large_time_r_for} (1 + \bar{\Phi}_\omega'(0))\frac{\partial}{\partial t}r = -\bar{\Phi}_\omega(0) r +\bar{\Phi}_\tau(0) p + \bar{\Phi}_\tau'(0)\left(\frac{\partial}{\partial t} + \vect{v}\cdot{\nabla_{\vect{x}}} \right) p \end{equation} There are now two further steps to obtain an effective diffusion equation. First, by considering successively greater monomial moments in the velocity space, one obtains a system of $k$-equations where the equation for the time evolution of moment $k$ corresponds to the flux of moment $k+1$. It therefore becomes necessary to `close' the system of equations to create something mathematically tractable. We use the Cattaneo approximation for this purpose \cite{Hillen_2003, Hillen_2004}. Once a closed system of equations has been found, we then carry out an asymptotic expansion where we investigate the parabolic regime to obtain a single equation for the evolution of the density of particles at large time. Note that it would be possible to carry out a similar process for smaller time behaviour by Taylor expanding the spatial delays in the convolution integrals. Asymptotic analysis would then have to be carried out to simplify the remaining convolution. \subsection{Moment equations} We can multiply equations (\ref{large_time_p_for})--(\ref{large_time_r_for}) by monomials in $\vect{v}$ and integrate over the velocity space to obtain equations for the velocity moments \begin{equation} m^0_\rho = \int_V \rho(t,\vect{x},\vect{v})\text{d} \vect{v}, \quad \vect{m}^1_\rho = \int_V \vect{v}\rho(t,\vect{x},\vect{v})\text{d} \vect{v}, \quad M^2_\rho = \int_V \vect{v}\vect{v}^T\rho(t,\vect{x},\vect{v})\text{d} \vect{v}. \end{equation} The equations relating the terms $m_p^0, m_r^0, \vect{m}_p^1, \vect{m}_r^1, M_p^2$ are given below. For initial integration over the velocity space, we see \begin{eqnarray}\label{m0_p} (1 + \bar{\Phi}_\tau'(0))\left( \frac{\partial m^0_p}{\partial t} + \nabla_{\vect{x}} \cdot \vect{m}_p^1 \right) = - \bar{\Phi}_\tau(0)m_p^0 + \bar{\Phi}_\omega(0)m_r^0 + \bar{\Phi}_\omega'(0)\frac{\partial m_r^0}{\partial t} , \end{eqnarray} and \begin{eqnarray}\label{m0_r} (1 + \bar{\Phi}_\omega'(0))\frac{\partial m^0_r}{\partial t} = - \bar{\Phi}_\omega(0)m_r^0 + \bar{\Phi}_\tau(0)m_p^0 + \bar{\Phi}_\tau'(0)\left( \frac{\partial m^0_p}{\partial t} + \nabla_{\vect{x}} \cdot \vect{m}_p^1 \right), \end{eqnarray} When summing equations (\ref{m0_p}) and (\ref{m0_r}), we see that mass flux is caused by the movement of particles in the running state only, i.e. \[ \frac{\partial }{\partial t}\left( m_p^0 + m_r^0 \right) + \nabla_{\vect{x}} \cdot \vect{m}_p^1 = 0. \] For multiplication by $\vect{v}$ and integrating, we obtain equations \begin{eqnarray} (1 + \bar{\Phi}_\tau'(0))\left( \frac{\partial \vect{m}^1_p}{\partial t} + \nabla_{\vect{x}} \cdot M_p^2 \right) = - \bar{\Phi}_\tau(0)\vect{m}_p^1 + \psi_d \bar{\Phi}_\omega(0)\vect{m}_r^1 + \psi_d \bar{\Phi}_\omega'(0)\frac{\partial \vect{m}_r^1}{\partial t} , \end{eqnarray} and \begin{eqnarray} (1 + \bar{\Phi}_\omega'(0))\frac{\partial \vect{m}^1_r}{\partial t} = - \bar{\Phi}_\omega(0)\vect{m}_r^1 + \bar{\Phi}_\tau(0)\vect{m}_p^1 + \bar{\Phi}_\tau'(0)\left( \frac{\partial \vect{m}^1_p}{\partial t} + \nabla_{\vect{x}}\cdot M_p^2 \right). \end{eqnarray} We would now like to approximate the $M_p^2$ term to close the system. \subsection{Cattaneo approximation step} We make use of the Cattaneo approximation to the velocity jump equation as studied by Hillen \cite{Hillen_2003, Hillen_2004}. For the case where the speed distribution is independent of the previous running step, i.e $h(s,s') = h(s)$, we approximate $M_p^2$ by the second moment of some function $u_\text{min} = u_\text{min} (t,\vect{x},\vect{v})$, such that $u_\text{min}$ has the same first two moments as $p = p(t, \vect{x}, \vect{v})$ and is minimised in the $L^2(V)$ norm weighted by $h(s)/s^{n-1}$. This is essentially minimising oscillations in the velocity space whilst simultaneously weighting down speeds which would be unlikely to occur \cite{Hillen_2003}. We introduce Lagrangian multipliers $\Lambda^0 = \Lambda^0(t, \vect{x})$ and $\vect{\Lambda}^1 =\vect{\Lambda}^1(t, \vect{x})$ and then define \begin{equation} H(u) := \frac{1}{2} \int_V \frac{u^2}{h(s)/s^{n-1}}\text{d} \vect{v} - \Lambda^0\left(\int_V u \text{d} \vect{v} - m_p^0\right) - \vect{\Lambda}^1\cdot \left(\int_V\vect{v} u \text{d} \vect{v} - \vect{m}_p^1\right). \end{equation} By the Euler-Lagrange equation \cite{Gregory}, we can minimise $H(u)$ to find that \begin{equation} u(t, \vect{x}, \vect{v}) = \frac{\Lambda^0(t, \vect{x}) h(s)}{s^{n-1}} + \frac{(\vect{\Lambda}^1(t, \vect{x}) \cdot \vect{v}) h(s)}{s^{n-1}}. \end{equation} We now use the constraints to find $\Lambda^0$ and $\vect{\Lambda}^1$. For $m_p^0$ we have \begin{equation} m_p^0 = \int_V u \text{d} \vect{v} = \Lambda^0 \int_V h(s)/s^{n-1} \text{d} \vect{v} = \Lambda^0 \text{Area}(\mathds{S}^{n-1}), \end{equation} where $\mathds{S}^{n} = \{\vect{x}\in\mathds{R}^{n+1}:\vectornorm{\vect{x}} = 1\}$ is the $n$-sphere centred at the origin. Notice also that the $\int_V \vect{v}h(s)/s^{n-1} \text{d} \vect{v} = \vect{0}$ by symmetry. For the first moment, we calculate \begin{equation} \vect{m}_p^1 = \int_V \vect{v} u \text{d} \vect{v} = \vect{\Lambda}^1 \cdot \int_V \vect{v}\vect{v}^T h(s)/s^{n-1} \text{d} \vect{v} = S^2_T \text{Vol}(\mathds{V}^{n})\vect{\Lambda}^1, \end{equation} where $\mathds{V}^n$ is the closure of $\mathds{S}^{n-1}$, i.e. the ball around the origin. Therefore, we can stipulate the form for $u_{\text{min}}$ as \begin{equation} u_{\text{min}}(t, \vect{x}, \vect{v}) = \frac{m_p^0(t, \vect{x}) h(s)}{s^{n-1}\text{Area}(\mathds{S}^{n-1})} + \frac{(\vect{m}_p^1(t, \vect{x}) \cdot \vect{v}) h(s)}{S_T^2s^{n-1}\text{Vol}(\mathds{V}^n)}. \end{equation} We now approximate the second moment of $p$ by the second moment of $u_{\text{min}}$. \begin{equation} M^2(u_{\text{min}}) = \int_V \vect{v}\vect{v}^T u_{\text{min}}(t,\vect{x},\vect{v})\text{d} \vect{v} = S_T^2 \frac{\text{Vol}(\mathds{V}^n)}{\text{Area}(\mathds{S}^{n-1})} I_n m_p^0(t, \vect{x}) = \frac{S_T^2}{n}I_n m_p^0(t, \vect{x}) . \end{equation} So in the above equations, we simply approximate $\nabla_{\vect{x}} \cdot M_p^2 \approx \frac{S_T^2}{n}\nabla_{\vect{x}}m_p^0$. \subsection{Effective diffusion constant} Finally, we rescale our equations using the parabolic regime \cite{Erban_2004} \begin{equation} \begin{array}{ccc} t = \hat{t}/\varepsilon^2, &\quad\ & \vect{x} = \hat{\vect{x}} /\varepsilon , \end{array} \end{equation} for arbitrary small parameter $\varepsilon > 0$. By putting our variables into vectors $\vect{u} = (m_p^0, m_r^0)^T$ and $\vect{v}=(\vect{m}_p^1,\vect{m}_r^1)^T$, we drop the hats over the rescaled variables and rewrite our equations as \begin{equation} \varepsilon^2 \frac{\partial}{\partial t} A\vect{u} + \varepsilon F \nabla_{\vect{x}}\cdot \vect{v} = C\vect{u}, \quad \varepsilon^2 \frac{\partial}{\partial t} B\vect{v} + \varepsilon \frac{S_T^2}{n}F \nabla_{\vect{x}} \vect{u} = D\vect{v}, \end{equation} where $\nabla_{\vect{x}} \vect{u} = [\nabla_{\vect{x}}m_p^0,\nabla_{\vect{x}}m_p^0]^T$ and $\nabla_{\vect{x}} \cdot \vect{v} = [\nabla_{\vect{x}}\cdot \vect{m}_p^1,\nabla_{\vect{x}}\cdot \vect{m}_p^1]^T$. Our time derivative matrices are given by \begin{equation} A = \left[ \begin{array}{cc} 1 + \bar{\Phi}_\tau '(0) & - \bar{\Phi}_\omega '(0) \\ - \bar{\Phi}_\tau '(0) & 1 + \bar{\Phi}_\omega '(0) \\ \end{array} \right], \quad B = \left[ \begin{array}{cc} 1 + \bar{\Phi}_\tau '(0) & - \psi_d\bar{\Phi}_\omega '(0) \\ - \bar{\Phi}_\tau '(0) & 1 + \bar{\Phi}_\omega '(0) \\ \end{array} \right], \end{equation} our flux matrix is given as \begin{equation} F = \left[ \begin{array}{cc} 1 + \bar{\Phi}_\tau '(0) & 0 \\ - \bar{\Phi}_\tau '(0) & 0 \\ \end{array} \right] . \end{equation} Finally our source terms are \begin{equation} C = \left[ \begin{array}{cc} - \bar{\Phi}_\tau (0) & \bar{\Phi}_\omega (0) \\ \bar{\Phi}_\tau (0) & -\bar{\Phi}_\omega (0) \\ \end{array}\right] \quad D = \left[ \begin{array}{cc} - \bar{\Phi}_\tau (0) & \psi_d \bar{\Phi}_\omega (0) \\ \bar{\Phi}_\tau (0) & - \bar{\Phi}_\omega (0) \\ \end{array}\right] \end{equation} By using the regular asymptotic expansion \begin{equation} \vect{u} = \vect{u}^0 + \varepsilon \vect{u}^1 + \varepsilon^2 \vect{u}^2 + ... ,\quad \vect{v} = \vect{v}^0 + \varepsilon \vect{v}^1 + \varepsilon^2 \vect{v}^2 + ... \end{equation} for $\vect{u}^j = (m_{p(j)}^0, m_{r(j)}^0)^T$ and $\vect{v}^j = (\vect{m}_{p(j)}^1,\vect{m}_{r(j)}^1)^T$, we obtain the set of equations \begin{equation} \begin{array}{ll} {\varepsilon^0:} & C\vect{u}^0 = \vect{0} ,\quad D\vect{v}^0 = \vect{0}, \\ {\varepsilon^1:} & F\nabla_{\vect{x}}\cdot\vect{v}^0 = C\vect{u}^1 , \quad F\nabla_{\vect{x}}\vect{u}^0 = D\vect{v}^1,\\ {\varepsilon^2:} & \frac{\partial}{\partial t} A\vect{u}^0 + F \nabla_{\vect{x}}\cdot \vect{v}^1 = C\vect{u}^2 , \\ & \frac{\partial}{\partial t} B\vect{v}^0 +\frac{S_T^2}{n}F \nabla_{\vect{x}} \vect{u}^1 = D\vect{v}^2 . \end{array} \end{equation} Providing $\psi_d \not= 1$, solving these in order gives rise to the differential equation for total density $m^0 = m_{p(0)}^0 + m_{r(0)}^0$ \begin{equation} \frac{\partial }{\partial t} m^0 = D \nabla_{\vect{x}}^2 m^0, \end{equation} for \begin{equation} D = \frac{S_T^2}{n}\frac{1}{\bar{\Phi}_\tau (0)}\frac{\bar{\Phi}_\omega (0)}{\bar{\Phi}_\omega (0) + \bar{\Phi}_\tau (0)} \frac{1 + \bar{\Phi}_\tau ' (0)(1-\psi_d)}{1 - \psi_d}. \end{equation} We now wish to find the values of $\bar{\Phi}_\tau (0), \bar{\Phi}_\omega (0)$ and $ \bar{\Phi}_\tau '(0)$. For probability distributions defined over the positive numbers with pdf $f(t)$, we see that the Laplace transform can be Taylor expanded as \begin{equation} \bar{f}(\lambda) = 1 - \lambda \langle t \rangle + \lambda^2 \langle t^2 \rangle - ... \end{equation} for small $\lambda$. Therefore, by putting these terms into the expression $\bar{\Phi}(\lambda)$ given by equation (\ref{f_psi_conversion}), provided that all moments are finite, we see that \begin{equation} \bar{\Phi}_i (0)= \lim_{\lambda \to 0}\bar{\Phi}_i(\lambda) = 1/\mu_i, \quad \bar{\Phi}_i '(0)= \lim_{\lambda \to 0}\bar{\Phi}_i'(\lambda) = (\sigma_i^2 - 1)/2\mu_i^2,\quad\text{for }i=\tau , \omega , \end{equation} for mean $\mu_i$ and variance $\sigma_i^2$ of distribution $i=\tau , \omega$, therefore \begin{equation} D = \frac{S_T^2}{n}\frac{\mu_\tau^2}{\mu_\tau + \mu_\omega} \left[ \frac{1}{1 - \psi_d} + \frac{1}{2}\left(\frac{\sigma_\tau^2}{\mu_\tau^2} - 1\right) \right] . \end{equation} It is noteworthy that the variance of the running time distribution contributes to the diffusion constant, while it is independent of the variance of the waiting time distribution. Furthermore, when the running time distribution is exponentially distributed, the correction $\bar{\Phi}_\tau'(0)$ is identically zero. So we can view our diffusion constant as the contribution from the exponential component of the running time distribution, plus an additional term for non-exponential running times. When referring back to the experimental data, it can be seen that by the end of the $4$ seconds, the \emph{E. coli} has entered into the diffusive regime with $D \approx 12.5\,(\mu\text{m})^2 / \text{s}$. The \emph{L. fuscus} however is yet to reach this state; we can predict that when it does, the corresponding value of the diffusion constant will be $D \approx 4.7\times 10^4\,(\text{km})^2 / \text{day}$, the solution of the mean squared displacement equations for greater time periods suggests that this is true. \subsection{Numerical example.} We now carry out a comparison between the underlying differential equation and Gillespie simulation. In Figure \ref{Comp_1}, we see the solution to the diffusion equation on the $\mathds{R}^2$ plane for a delta function initial condition, which takes the form of a bivariate Gaussian, compared with data simulated using the algorithm given in Section \ref{TwoStateGVJ}. For the Gillespie simulation, all sample paths are initialised at the origin with fixed speed equal to unity and uniformly random orientation, half the sample paths are initialised in a run and half are initialised in a rest. Therefore all plots will have the parameters $S_T^2 = 1$, $\psi_d = 0$ and we specify $\mu_\tau = \mu_\omega = 1$, plots are shown at $t=100$. On the top row, we see a diffusion approximation on the left compared with a velocity jump process where both the running and waiting times are sampled from an exponential distribution, with the mean of these distributions as stated, our effective diffusion constant for large time is $D = 1/2n$. On the bottom row, we see a diffusion approximation on the left compared with a velocity jump process where the running time is $\tau\sim\text{Gamma}(1/7,7)$ distributed, giving $\mu_\tau = 1$ and $\sigma_\tau^2 = 7$, the diffusion constant is therefore $D = 2/n$. The waiting time is $\omega\sim\text{Gamma}(1/14, 14)$ distributed; the high variance of the waiting time is chosen such that the simulation relaxes towards the diffusion approximation quickly. It was seen from numerical simulations that there there is a relationship between the choice of distribution for the waiting time $\omega$ and the index of persistence $\psi_d$ which will encourage the system to relax rapidly into the parabolic regime. It is necessary for the system to relax quickly in order for us to use the diffusion approximation as a valid method of comparison. The choices of these two distributions was chosen to illustrate the importance of the diffusion correction term. This is illustrated in Figure \ref{Comp_1} by the difference between the top and bottom rows, which differ only in this correction term. \begin{figure}[h!] \centering \includegraphics[width=0.30\textwidth]{figure5a.pdf} \includegraphics[width=0.30\textwidth]{figure5b.pdf} \includegraphics[width=0.034\textwidth]{figure5c.png} \\ \includegraphics[width=0.30\textwidth]{figure5d.pdf} \includegraphics[width=0.30\textwidth]{figure5e.pdf} \includegraphics[width=0.034\textwidth]{figure5f.png} \caption{\footnotesize{Comparison between solution to the diffusion equation (\emph{left column}) and Gillespie simulation (\emph{right column}). \emph{Top row}: case where $\tau\sim\text{Exp}(1)$ and $\omega\sim\text{Exp}(1)$. \emph{Bottom row}: case where $\tau\sim\text{Gamma}(1/7, 7)$ and $\omega\sim\text{Gamma}(1/14,14)$.} For all Gillespie simulations, $3\times 10^5$ runs were carried out with half initialised in a running phase and half initialised in the resting phase.} \label{Comp_1} \end{figure} Another point of interest is that one can model distributions other than exponential with different means and still achieve the same effective diffusion constant through careful selection of variance. An example is shown in Figure \ref{Comp_2}, where the diffusion constant $D = 1/2n$ is recovered by changing the running distribution to $\tau\sim\text{Gamma}(1/5, 5/2)$. This then gives a mean run time of $\mu_\tau = 1/2$ and variance $\sigma_\tau^2 = 5/4$ and compares well to the first row in Figure \ref{Comp_1}. For this simulation, $2/3$ of the sample paths were initialised in a run and the remainder in a resting state so that the system was again encouraged to relax quickly. \begin{figure}[h!] \centering \includegraphics[width=0.30\textwidth]{figure6.pdf} \caption{\footnotesize{Gillespie simulation for $\tau\sim\text{Gamma}(1/5, 5/2)$ and $\omega\sim\text{Exp}(1)$. For the Gillespie simulation, $2\times10^5$ simulations were initialised in a running phase and $10^5$ were initialised in a resting phase.}} \label{Comp_2} \end{figure} \section{Final remarks.} In this study, we have used a single modelling framework to describe two highly distinct biological movement processes, occurring in bacteria and birds. In spite of the significant mechanistic differences between the two species, their phenomenological similarities nonetheless persist over length scales of 10 orders of magnitude. We recover the correct behaviour including the non-local delay effects due to non-exponential waiting times. This formulation could be considered a particularly phenomenological approach as it outlines a way for observables to directly parameterise movement equations. This is counter to some previous literature where quantities such as diffusion constants were left to the reader to identify \cite{McKenzie_2009}. A notable advantage of the modelling framework proposed here is the straightforward interpretation of the distributions and parameters involved, all of which have naturally intuitive meanings. There is, unfortunately, no unified approach to extract such quantities of interest from biological movement data. This was demonstrated in Section \ref{CompExpTheo}, in which different approaches were taken to obtain the required parameters. Nonetheless, such methods are the focus of much current research effort \cite{Gautestad_2013, Patterson_2008}, and we therefore believe that approaches such as ours will become increasingly relevant in the future. As far as the authors are aware, there has been no unified approach to tackling this problem. Finally, we demonstrated the novel result that for the underlying stochastic process of interest, the variance of the running time contributes to the large time diffusion constant. This raises the key question: when does the parabolic regime emerge? Our results also act as a warning against using the exponentially distributed running times as an approximation for other distributions, as whilst their mean values may align, the underlying dynamics can change drastically as shown with the link between Figures \ref{Comp_1} and \ref{Comp_2}. Regarding the accuracy of this generalised velocity jump framework, it should be realised that the underlying models for the examples given could be improved by making the model more specific to the agent of interest. Below we discuss some possible alterations to the model - however at the cost of species generality. \subsection{Extensions to model.} For \emph{E. coli}, the bacterium is always subject to diffusion; in theory, this should add to its mean squared displacement while resting and may also affect running phases via rotational diffusion \cite{Rosser_2014}. If one wanted to incorporate a small fix to the resting state, it would be simple to add a diffusion term in space to equation (\ref{r_forward}). However, for a more comprehensive solution to the problem, to retain the correlation effects with turning kernel $T$, the equation (\ref{p_forward}) would have a rotational diffusion term added, which is achieved via a Laplacian in the velocity space \cite{Chandrasekhar_1943}. Furthermore, equation (\ref{r_forward}) would have to have to retain its defunct velocity field for orientation but also to include another velocity variable to allow for movement due to diffusion. A particularly interesting result would be to explore whether the Gaussian-like reorientation were a resultant effect from this rotational diffusion. By testing differing viscosities of fluid for the swimming \emph{E. coli}, one could undoubtedly make headway using this approach, work already initiated by Rosser \emph{et. al.} \cite{Rosser_2014}. For the \emph{L. fuscus}, there are many physical and ecological phenomena which could to be built into the model; these range from the day-night cycles, in which the bird is reluctant to fly long distances through the night, to geographical effects, where the bird may follow the coastline for navigation. One could also consider environment factors, such as wind influence and availability of food resources. In the work by Chauviere \emph{et. al.} \cite{Chauviere_2010}, the authors consider the migration of cells along an extra-cellular matrix. Using a similar formulation to ours, but only considering exponentially distributed waiting times, cells are modelled to preferentially guide themselves along these extra-cellular fibres. It would not be difficult to imagine modifying this work to show how gulls may align their trajectory along coastlines, or using other geographical markers.
{'timestamp': '2014-08-01T02:00:21', 'yymm': '1407', 'arxiv_id': '1407.8177', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8177'}
arxiv
\section{Introduction} \label{sec:intro} We study the \textit{asymmetric binary matrix partition problem}, recently proposed by Alon et al.~\cite{AFGT13}. Consider a matrix $A \in \{0,1\}^{n \times m}$ and a probability distribution $p$ over its columns; $p_j$ denotes the probability associated with column $j$. We distinguish between two cases for the probability distribution over the columns of the given matrix, depending on whether it is uniform or non-uniform. A partition scheme $B=(B_1,...,B_n)$ for matrix $A$ consists of a partition $B_i$ of $[m]$ for each row $i$ of $A$. More specifically, $B_i$ is a collection of $k_i$ pairwise disjoint subsets $B_{ik} \subseteq [m]$ (with $1 \leq k \leq k_i$) such that $\bigcup_{k=1}^{k_i}{B_{ik}}=[m]$. We can think of each partition $B_i$ as a smoothing operator, which acts on the entries of row $i$ and changes their value to the expected value of the partition subset they belong to. Formally, the {\em smooth value} of an entry $(i,j)$ such that $j \in B_{ik}$ is defined as \begin{eqnarray}\label{eq:smooth-value} A^B_{ij} &=& \frac{\sum_{\ell \in B_{ik}} p_{\ell} \cdot A_{i\ell}}{\sum_{\ell \in B_{ik}} p_{\ell}}. \end{eqnarray} Given a partition scheme $B$ that induces the {\em smooth matrix} $A^B$, the resulting {\em partition value} is the expected maximum column entry of $A^B$, namely, \begin{eqnarray}\label{eq:partition-value} v^B(A,p)&=&\sum_{j\in [m]}{p_j \cdot \max_i A^B_{ij}}. \end{eqnarray} The objective of the asymmetric binary matrix partition problem is to find a partition scheme $B$ such that the resulting partition value $v^B(A,p)$ is maximized. Alon et al.~\cite{AFGT13} were the first to consider the asymmetric matrix partition problem. They prove that the problem is APX-hard and provide a $0.563$- and a $1/13$-approximation for uniform and non-uniform probability distributions, respectively. They also consider input matrices with non-negative non-binary entries and present a $1/2$- and an $\Omega(1/\log{m})$-approximation algorithm for uniform and non-uniform distributions, respectively. This interesting combinatorial optimization problem has apparent relations to revenue maximization in \textit{take-it-or-leave-it sales}. For example, consider the following setting. There are $m$ items and $n$ potential buyers. Each buyer has a value for each item. Nature selects at random (according to some probability distribution) an item for sale and, then, the seller approaches the highest valuation buyer and offers the item to her at a price equal to her valuation. Can the seller exploit the fact that she has much more accurate information about the items for sale compared to the potential buyers? In particular, information asymmetry arises since the seller knows the realization of the randomly selected item whereas the buyers do not. The approach that is discussed in \cite{AFGT13} is to let the seller define a buyer-specific signalling scheme. That is, for each buyer, the seller can partition the set of items into disjoint subsets (bundles) and report this partition to the buyer. After nature's random choice, the seller can reveal to each buyer the bundle that contains the realization, thus enabling her to update her valuation beliefs. The relation of this problem to asymmetric matrix partition should be apparent. Interestingly, the seller can achieve revenue from items for which no buyer has any value. This scenario falls within the line of research that studies the impact of information asymmetry to the quality of markets. Akerlof \cite{A70} was the first to introduce a formal analysis of ``markets for lemons'', where the seller has more information than the buyers regarding the quality of the products. Crawford and Sobel \cite{CS82} study how, in such markets, the seller can exploit her advantage in order to maximize revenue. In \cite{MW82a}, Milgrom and Weber provide the ``linkage principle'' which states that the expected revenue is enhanced when bidders are provided with more information. This principle seems to suggest full transparency but, in \cite{LM10} and \cite{M10} the authors suggest that careful bundling of the items is the best way to exploit information asymmetry. Many different frameworks that reveal information to the bidders have been proposed in the literature. More recently, Ghosh et al.~\cite{GNS07} consider full information and propose a clustering scheme according to which, the items are partitioned into bundles and, then, for each such bundle, a separate second-price auction is performed. In this way, the potential buyers cannot bid only for the items that they actually want; they also have to compete for items that they do not have any value for. Hence, the demand for each item is increased and the revenue of the seller is higher. Emek et al.~\cite{EFGPT12} present complexity results in similar settings and Miltersen and Sheffet \cite{MS12} consider fractional bundling schemes for signaling. In this work, we focus on the simplest binary case of asymmetric matrix partition which has been proved to be APX-hard. We present a $9/10$-approximation algorithm for the uniform case and a $(1-1/e)$-approximation algorithm for non-uniform distributions. Both results significantly improve previous bounds of Alon et al.~\cite{AFGT13}. The analysis of our first algorithm is quite interesting because, despite its purely combinatorial nature, it exploits linear programming techniques. Similar techniques have been used in a series of papers on variants of set cover (e.g. \cite{ACK09,ACKK09,C09,CKK13}) by the second author; however, the application of the technique in the current context requires a quite involved reasoning about the structure of the solutions computed by the algorithm. In our second result, we exploit a nice relation of the problem to submodular welfare maximization and use well-known algorithms from the literature. First, we discuss the application of a simple greedy $1/2$-approximation algorithm that has been studied by Lehmann et al.~\cite{LLN06} and then apply Vondr\'ak's smooth greedy algorithm \cite{V08} to achieve a $(1-1/e)$-approximation. Vondr\'ak's algorithm is optimal in the value query model as Khot et al.~\cite{KLMM08} have proved. In a more powerful model where it is assumed that demand queries can be answered efficiently, Feige and Vondr\'ak \cite{FV10} have proved that $(1-1/e+\epsilon)$-approximation algorithms --- where $\epsilon$ is a small positive constant --- are possible. We briefly discuss the possibility/difficulty of applying such algorithms to asymmetric binary matrix partition and observe that the corresponding demand query problems are, in general, NP-hard. The rest of the paper is structured as follows. We begin with preliminary definitions and examples in Section \ref{sec:prelim}. Then, we present our $9/10$-approximation algorithm for the uniform case in Section \ref{sec:uniform} and our $(1-1/e)$-approximation algorithm for the non-uniform case in Section \ref{sec:non-uniform}. \section{Preliminaries} \label{sec:prelim} Let $A^+=\{j \in [m]:\text{ there exists a row } i \text{ such that } A_{ij}=1\}$ denote the set of columns of $A$ that contain at least one 1-value entry, and $A^0=[m]\backslash A^+$ denote the set of columns of $A$ that contain only 0-value entries. In the next sections, we usually refer to the sets $A^+$ and $A^0$ as the sets of {\em one-columns} and {\em zero-columns}, respectively. Furthermore, let $A_i^+=\{j \in [m]: A_{ij}=1\}$ and $A_i^0=\{j \in [m]: A_{ij}=0\}$ denote the sets of columns that intersect with row $i$ at a 1- and 0-value entry, respectively. All columns in $A_i^+$ are one-columns and, furthermore, $A^+=\cup_{i=1}^n{A_i^+}$. The columns of $A_i^0$ can be either one- or zero-columns and, thus, $A^0 \subseteq \cup_{i=1}^n{A_i^0}$. Also, denote by $r=\sum_{j \in A^+}{p_j}$ the total probability of the one-columns. As an example, consider the $3\times 6$ matrix $$A = \left( \begin{array}{c c c c c c} 0 & 1 & 1 & 0 & 1 & 0 \\ 0 & 1 & 1 & 0 & 1 & 0 \\ 0 & 1 & 1 & 0 & 0 & 0 \\ \end{array}\right)$$ and a uniform probability distribution over its columns. We have $A^+=\{2,3,5\}$ and $A^0=\{1,4,6\}$. In the first two rows, the sets $A^+_i$ and $A^0_i$ are identical to $A^+$ and $A^0$, respectively. In the third row, the sets $A^+_3$ and $A^0_3$ are $\{2,3\}$ and $\{1,4,5,6\}$. Finally, the total probability of the one-columns $r$ is $1/2$. A partition scheme $B$ can be thought of as consisting of $n$ partitions $B_1$, $B_2$, ..., $B_n$ of the set of columns $[m]$. We use the term {\em bundle} to refer to the elements of a partition $B_i$; a bundle is just a non-empty set of columns. For a bundle $b$ of partition $B_i$ corresponding to row $i$, we say that $b$ is an {\em all-zero} bundle if $b\subseteq A^0_i$ and an {\em all-one} bundle if $b\subseteq A^+_i$. A singleton all-one bundle of partition $B_i$ is called {\em column-covering bundle in row} $i$. A bundle that is neither all-zero nor all-one is called {\em mixed}. A mixed bundle corresponds to a set of columns that intersects with row $i$ at both 1- and 0-value entries. Let us examine the following partition scheme $B$ for matrix $A$ that defines the smooth matrix $A^B$ according to equation (\ref{eq:smooth-value}). \begin{table}[h!] \centering \begin{tabular}{|c|c|} \hline $B_1$ & $\{1,2,3,4\}$, $\{5,6\}$ \\ \hline $B_2$ & $\{1,2\}$, $\{3\}$, $\{4,6\}$, $\{5\}$ \\ \hline $B_3$ & $\{1,4,6\}$, $\{2,3,5\}$ \\ \hline \end{tabular}\ \ \ \ \begin{tabular}{|c|c|c|c|c|c|c|} \hline \multirow{3}{*}{$A^B$} & $1/2$ & $1/2$ & $1/2$ & $1/2$ & $1/2$ & $1/2$ \\ & $1/2$ & $1/2$ & $1$ & $0$ & $1$ & $0$ \\ & $0$ & $2/3$ & $2/3$ & $0$ & $2/3$ & $0$ \\ \hline $\max_i{A_{ij}^B}$ & $1/2$ & $2/3$ & $1$ & $1/2$ & $1$ & $1/2$ \\ \hline \end{tabular} \end{table} \noindent Here, the bundle $\{1,2,3,4\}$ of (the partition $B_1$ of) the first row is a mixed one. The bundle $\{3\}$ of $B_2$ is all-one and, in particular, column-covering in row $2$. The bundle $\{1,4,6\}$ of $B_3$ is all-zero. By equation (\ref{eq:partition-value}), the partition value is $25/36$ and it can be further improved. First, observe that the leftmost zero-column is included in two mixed bundles (in the first two rows). Also, the mixed bundle in the third row contains a one-column that has been covered through a column-covering bundle in the second row and intersects with the third row at a 0-value entry. Let us modify these two bundles. \begin{table}[h!] \centering \begin{tabular}{|c|c|} \hline $B'_1$ & $\{1\}$, $\{2,3,4\}$, $\{5,6\}$ \\ \hline $B'_2$ & $\{1,2\}$, $\{3\}$, $\{4,6\}$, $\{5\}$ \\ \hline $B'_3$ & $\{1,4,5,6\}$, $\{2,3\}$ \\ \hline \end{tabular}\ \ \ \ \begin{tabular}{|c|c|c|c|c|c|c|} \hline \multirow{3}{*}{$A^{B'}$} & $0$ & $2/3$ & $2/3$ & $2/3$ & $1/2$ & $1/2$ \\ & $1/2$ & $1/2$ & $1$ & $0$ & $1$ & $0$ \\ & $0$ & $1$ & $1$ & $0$ & $0$ & $0$ \\ \hline $\max_i{A_{ij}^{B'}}$ & $1/2$ & $1$ & $1$ & $2/3$ & $1$ & $1/2$ \\ \hline \end{tabular} \end{table} \noindent The partition value becomes $7/9>25/36$. Now, by merging the two mixed bundles $\{2,3,4\}$ and $\{5,6\}$ in the first row, we obtain the smooth matrix below with partition value $47/60>7/9$. Observe that the contribution of column $4$ to the partition value decreases but, overall, we have an increase in the partition value due to the increase in the contribution of column $6$. Actually, such merges never decrease the partition value (see Lemma \ref{lem:structure} below). \begin{table}[h!] \centering \begin{tabular}{|c|c|} \hline $B''_1$ & $\{1\}$, $\{2,3,4,5,6\}$ \\ \hline $B''_2$ & $\{1,2\}$, $\{3\}$, $\{4,6\}$, $\{5\}$ \\ \hline $B''_3$ & $\{1,4,5,6\}$, $\{2,3\}$ \\ \hline \end{tabular}\ \ \ \ \begin{tabular}{|c|c|c|c|c|c|c|} \hline \multirow{3}{*}{$A^{B''}$} & $0$ & $3/5$ & $3/5$ & $3/5$ & $3/5$ & $3/5$ \\ & $1/2$ & $1/2$ & $1$ & $0$ & $1$ & $0$ \\ & $0$ & $1$ & $1$ & $0$ & $0$ & $0$ \\ \hline $\max_i{A_{ij}^{B''}}$ & $1/2$ & $1$ & $1$ & $3/5$ & $1$ & $3/5$ \\ \hline \end{tabular} \end{table} \noindent Finally, by merging the bundles $\{1,2\}$ and $\{3\}$ in the second row and decomposing the bundle $\{2,3\}$ in the last row into two singletons, the partition value becomes $73/90>47/60$ which can be verified to be optimal. \begin{table}[h!] \centering \begin{tabular}{|c|c|} \hline $B'''_1$ & $\{1\}$, $\{2,3,4,5,6\}$ \\ \hline $B'''_2$ & $\{1,2,3\}$, $\{4,6\}$, $\{5\}$ \\ \hline $B'''_3$ & $\{1,4,5,6\}$, $\{2\}$, $\{3\}$ \\ \hline \end{tabular}\ \ \ \ \begin{tabular}{|c|c|c|c|c|c|c|} \hline \multirow{3}{*}{$A^{B'''}$} & $0$ & $3/5$ & $3/5$ & $3/5$ & $3/5$ & $3/5$ \\ & $2/3$ & $2/3$ & $2/3$ & $0$ & $1$ & $0$ \\ & $0$ & $1$ & $1$ & $0$ & $0$ & $0$ \\ \hline $\max_i{A_{ij}^{B'''}}$ & $2/3$ & $1$ & $1$ & $3/5$ & $1$ & $3/5$ \\ \hline \end{tabular} \end{table} We will now give some more definitions that will be useful in the following. We say that a one-column $j$ is {\em covered} by a partition scheme $B$ if there is at least one row $i$ in which $\{j\}$ is column-covering. For example, in $B'''$, the singleton $\{5\}$ is a column-covering bundle in the second row and the singletons $\{2\}$ and $\{3\}$ are column-covering in the third row. We say that a partition scheme {\em fully covers} the set $A^+$ of one-columns if all of them are covered. In this case, we use the term {\em full cover} to refer to the pairs of indices $(i,j)$ of the 1-value entries $A_{ij}$ such that $\{j\}$ is a column-covering bundle in row $i$. For example, the partition scheme $B'''$ has the full cover $(2,5), (3,2), (3,3)$. It turns out that optimal partition schemes always have a special structure like the one of $B'''$. Alon et al.~\cite{AFGT13} have formalized observations like the above into the following statement. \begin{lemma}[Alon et al.~\cite{AFGT13}]\label{lem:structure} Given a uniform instance of the asymmetric binary matrix partition problem with a matrix $A$, there is an optimal partition scheme $B$ with the following properties: \begin{enumerate} \item[P1.] $B$ fully covers the set $A^+$ of one-columns. \item[P2.] For each row $i$, $B_i$ has at most one bundle containing all columns of $A_i^+$ that are not included in column-covering bundles in row $i$ (if any). This bundle can be either all-one (if it does not contain zero-columns) or the unique mixed bundle of row $i$. \item[P3.] For each zero-column $j$, there exists at most one row $i$ such that $j$ is contained in the mixed bundle of $B_i$ (and $j$ is contained in the all-zero bundles of the remaining rows). \item[P4.] For each row $i$, the zero-columns that are not contained in the mixed bundle of $B_i$ form an all-zero bundle. \end{enumerate} \end{lemma} Properties P1 and P3 imply that we can think of the partition value as the sum of the contributions of the column-covering bundles and the contributions of the zero-columns in mixed bundles. Property P2 should be apparent; the columns of $A_i^+$ that do not form column-covering bundles in row $i$ are bundled together with zero-columns (if possible) in order to increase the contribution of the latter to the partition value. Property P4 makes $B$ consistent to the definition of a partition scheme where the disjoint union of all the partition subsets in a row should be $[m]$. Clearly, the contribution of the all-zero bundles to the partition value is $0$. Also, the non-column-covering all-one bundles do not contribute to the partition value either. The proof of Lemma \ref{lem:structure} in \cite{AFGT13} extensively uses the fact that the instance is uniform. Unfortunately, as we will see later in Section \ref{sec:non-uniform}, the lemma (in particular, property P1) does not hold for non-uniform instances. Luckily, it turns out that non-uniform instances also exhibit some structure which allows us to consider the problem of computing an optimal partition scheme as a {\em welfare maximization problem}. In welfare maximization, there are $m$ items and $n$ agents; agent $i$ has a valuation function $v_i: 2^{[m]} \rightarrow \mathbb{R}^+$ that specifies her value for each subset of the items. I.e., for a set $S$ of items, $v_i(S)$ represents the value of agent $i$ for $S$. Given a disjoint partition (or allocation) $S=(S_1, S_2, ..., S_n)$ of the items to the agents, where $S_i$ denotes the set of items allocated to agent $i$, the social welfare is the sum of values of the agents for the sets of items allocated to them, i.e., $\text{SW}(S)=\sum_{i}{v_i(S_i)}$. The term welfare maximization refers to the problem of computing an allocation of maximum social welfare. We will discuss only the variant of the problem where the valuations are monotone and submodular; following the literature, we use the term submodular welfare maximization to refer to it. \begin{definition} A valuation function $v$ is monotone if $v(S) \leq v(T)$ for any pair of sets $S,T$ such that $S \subseteq T$. A valuation function $v$ is submodular if $v(S \cup \{x\}) - v(S) \geq v(T \cup \{x\}) - v(T)$ for any pair of sets $S,T$ such that $S \subseteq T$ and for any item $x \notin T$. \end{definition} An important issue in (submodular) welfare maximization arises with the representation of valuation functions. A valuation function can be described in detail by listing explicitly the values for each of the possible subsets of items. Unfortunately, this is clearly inefficient due to the necessity for exponential input size. A solution that has been proposed in the literature is to assume access to these functions by queries of a particular form. The simplest such form of queries reads as ``what is the value of agent $i$ for the set of items $S$?'' These are known as {\em value queries}. Another type of queries, known as {\em demand queries}, are phrased as follows: ``Given a non-negative price for each item, compute a set $S$ of items for which the difference of the valuation of agent $i$ minus the sum of prices for the items in $S$ is maximized.'' Approximation algorithms that use a polynomial number of valuation or demand queries and obtain solutions to submodular welfare maximization with a constant approximation ratio are well-known in the literature. Our improved approximation algorithm for the non-uniform case of asymmetric binary matrix partition exploits such algorithms. \section{The uniform case} \label{sec:uniform} In this section, we present the analysis of a greedy approximation algorithm when the probability distribution $p$ over the columns of the given matrix is uniform. Our algorithm uses a {\em greedy completion procedure} that was also considered by Alon et al.~\cite{AFGT13}. This procedure starts from a full cover of the matrix, i.e., from column-covering bundles in some rows so that all one-columns are covered (by exactly one column-covering bundle). Once this initial full cover is given, the set of columns from $A_i^+$ that are not included in column-covering bundles in row $i$ can form a mixed bundle together with some zero-columns in order to increase the contribution of the latter to the partition value. Greedy completion proceeds as follows. It goes over the zero-columns, one by one, and adds a zero-column to the mixed bundle of the row that maximizes the marginal contribution of the zero-column. The marginal contribution of a zero-column to the partition value when it is added to a mixed bundle that consists of $x$ zero-columns and $y$ one-columns is given by the quantity \begin{eqnarray*} \Delta(x,y)&=&(x+1)\frac{y}{x+y+1}-x\frac{y}{x+y} = \frac{y^2}{(x+y)(x+y+1)}. \end{eqnarray*} The right-hand side of the first equality is simply the difference between the contribution of $x+1$ and $x$ zero-columns to the partition value when they form a mixed bundle with $y$ one-columns. Alon et al.~\cite{AFGT13} proved that, in the uniform case, this greedy completion procedure yields the maximum contribution from the zero-columns to the partition value among all partition schemes that include a given full cover. We extensively use this property as well as the fact that $\Delta(x,y)$ is non-decreasing with respect to $y$. So, our algorithm consists of two phases. In the first phase, called the {\em cover phase}, the algorithm computes an arbitrary full cover for set $A^+$. In the second phase, called the {\em greedy phase}, it simply runs the greedy completion procedure mentioned above. In the rest of this section, we will show that this simple algorithm obtains an approximation ratio of $9/10$; we will also show that our analysis is tight. Even though our algorithm is purely combinatorial, our analysis exploits linear programming duality. Overall, the partition value obtained by the algorithm can be thought of as the sum of contributions from column-covering bundles (this is exactly $r$) plus the contribution from the mixed bundles created during the greedy phase (i.e., the contribution from the zero-columns). Denote by $\rho$ the ratio between the total number of appearances of one-columns in the mixed bundles of the optimal partition scheme (so, the number each one-column is counted equals the number of mixed bundles that contain it) and the number of zero-columns. For example, in the partition scheme $B'''$ in the example of the previous section, the two mixed bundles are $\{2,3,4,5,6\}$ in the first row and $\{1,2,3\}$ in the second row. So, the one-columns $2$ and $3$ appear twice while the one-column $5$ appears once in these mixed bundles. Since we have three zero-columns, the value of $\rho$ is $5/3$. We can use the quantity $\rho$ to upper-bound the optimal partition value as follows. \begin{lemma}\label{lem:opt} The optimal partition value is at most $r+(1-r)\frac{\rho}{\rho+1}$. \end{lemma} \begin{proof} The first term in the above expression represents the contribution of the one-columns in the full cover of the optimal partition scheme. The second term is the hypothetical contribution of all zero-columns assuming that all mixed bundles of the optimal partition scheme are merged into one. The proof follows by an observation of Alon et al.~\cite[Lemma 1]{AFGT13} that has been used to prove what we state as property P2 in Lemma \ref{lem:structure}. According to that observation, the contribution of the zero-columns of two disjoint bundles to the partition value is not higher than their contribution when the two disjoint bundles are merged. \end{proof} In our analysis, we distinguish between two main cases depending on the value of $\rho$. The first case is when $\rho < 1$; in this case, the additional partition value obtained during the greedy phase of the algorithm is lower-bounded by the partition value we would have by creating bundles containing exactly one one-column and either $\lceil 1/\rho \rceil$ or $\lfloor 1/\rho \rfloor$ zero-columns. \begin{lemma}\label{lem:small-rho} If $\rho<1$, then the partition value obtained by the algorithm is at least $0.97$ times the optimal one. \end{lemma} \begin{proof} We will lower-bound the partition value returned by the algorithm by considering the following formation of mixed bundles as an alternative to the greedy completion procedure used in the greedy phase. For each appearance of a one-column in a mixed bundle in the partition scheme computed by the algorithm (observe that the total number of such appearances is exactly $\rho m(1-r)$), we include this one-column in a mixed bundle together with either $\ceil{1/\rho}$ or $\floor{1/\rho}$ distinct zero-columns. By Lemma \ref{lem:opt}, this process yields an optimal partition value if $1/\rho$ is an integer. Otherwise, denote by $x=m(1-r)(1-\rho\floor{1/\rho})$ the number of mixed bundles containing $\ceil{1/\rho}$ zero-columns. Then, the number of mixed bundles containing $\floor{1/\rho}$ zero-columns will be $\rho m(1-r) -x = m(1-r)(\rho\ceil{1/\rho}-1)$. Observe that the smooth value of a zero-column is $\frac{1}{1+\ceil{1/\rho}}$ in the first case and $\frac{1}{1+\floor{1/\rho}}$ in the second case. Hence, we can bound the partition value obtained by the algorithm as follows: \begin{align*} \mbox{ALG} \geq r + (1-r)(1-\rho\floor{1/\rho}) \frac{\ceil{1/\rho}}{1+\ceil{1/\rho}} + (1-r)(\rho\ceil{1/\rho}-1)\frac{\floor{1/\rho}}{1+\floor{1/\rho}}. \end{align*} Now, assuming that $\rho \in (\frac{1}{k+1},\frac{1}{k})$ for some integer $k \geq 1$, we have that $\floor{1/\rho}=k$ and $\ceil{1/\rho}=k+1$ and, hence, \begin{align*} \mbox{ALG} \geq r +(1-r)\frac{1+\rho k(k+1)}{(k+1)(k+2)}. \end{align*} Using Lemma \ref{lem:opt}, we have \begin{align*} \frac{\mbox{ALG}}{\mbox{OPT}} &\geq \frac{r +(1-r)\frac{1+\rho k(k+1)}{(k+1)(k+2)}}{r+ (1-r)\frac{\rho}{\rho+1}} \geq \frac{\frac{1+\rho k(k+1)}{(k+1)(k+2)}}{\frac{\rho}{\rho+1}} = \frac{(1+1/\rho)(1+\rho k(k+1))}{(k+1)(k+2)}. \end{align*} This last expression is minimized (with respect to $\rho$) for $1/\rho=\sqrt{k(k+1)}$. Hence, \begin{align*} \frac{\mbox{ALG}}{\mbox{OPT}} &\geq \frac{\left(1+\sqrt{k(k+1)}\right)^2}{(k+1)(k+2)}, \end{align*} which is minimized for $k=1$ to approximately $0.97$. \end{proof} For the case $\rho \geq 1$, we use completely different arguments. We will reason about the solution produced by the algorithm by considering a particular decomposition of the set of mixed bundles computed in the greedy phase. Then, using again the observation of Alon et al.~\cite[Lemma 1]{AFGT13}, the contribution of the zero-columns to the partition value in the solution computed by the algorithm is lower-bounded by their contribution to the partition value when that are part of the mixed bundles obtained after the decomposition. The decomposition is defined as follows. It takes as input a bundle with $y$ zero-columns and $x$ one-columns and decomposes it into $y$ bundles containing exactly one zero-column and either $\lfloor x/y \rfloor$ or $\lceil x/y \rceil$ one-columns. Note that if $x/y$ is not an integer, there will be $x-y\lfloor x/y \rfloor$ bundles with $\lceil x/y \rceil$ one-columns. The solution obtained after the decomposition of the solution returned by the algorithm has a very special structure as our next lemma suggests. \begin{lemma}\label{lem:s-t} There exists an integer $s \geq 1$ such that each bundle in the decomposition has at least $s$ and at most $3s$ one-columns. \end{lemma} \begin{proof} Consider the application of the decomposition step to the mixed bundles that are computed by the algorithm and let $s$ be the minimum number of one-columns among the decomposed mixed bundles. This implies that one of the mixed bundles, say $b_1$, computed by the algorithm has $\mu$ zero-columns and at most $(s+1)\mu-1$ one-columns. Denoting by $\nu$ the number of one-columns in this bundle, we have that the marginal partition value when the last zero-column $Z$ is included in $b_1$ is exactly \begin{align*} \Delta(\mu,\nu) = \frac{\nu^2}{(\nu+\mu)(\nu+\mu-1)} \leq \frac{( (s+1)\mu-1 )^2 }{( (s+2)\mu-1 ) ( (s+2)\mu-2 )} \end{align*} since $\Delta(\mu,\nu)$ is increasing in $\nu$ and $\nu \leq (s+1)\mu-1$. The rightmost expression is decreasing in $\mu$ and $\mu\geq 1$; hence, the marginal partition value of $Z$ is at most $\frac{s}{s+1}$. Now assume for the sake of contradiction that one of the mixed bundles obtained after the decomposition has at least $3s+1$ one-columns. Clearly, this must have been obtained by the decomposition of a mixed bundle $b_2$ (returned by the algorithm) with $\lambda$ zero-columns and at least $(3s+1)\lambda$ one-columns. Denote by $\nu'$ the number of one-columns in this bundle and let us compute the marginal partition value if the zero-column $Z$ would be included in $b_2$. This would be \begin{align*} \Delta(\lambda+1,\nu') &= \frac{\nu'^2}{(\nu'+\lambda+1)(\nu'+\lambda)} \geq \frac{(3s+1)^2\lambda}{((3s+2)\lambda+1)(3s+2)} \geq \frac{(3s+1)^2}{(3s+3)(3s+2)}. \end{align*} The first inequality follows since the marginal partition value function is increasing in $\nu'$ and $\nu'\geq (3s+1)\lambda$, and the second one follows since $\lambda \geq 1$. Now, the last quantity can be easily verified to be strictly higher that $\frac{s}{s+1}$ and the algorithm should have included $Z$ in $b_2$ instead. We have reached the desired contradiction that proves the lemma. \end{proof} Now, our analysis proceeds as follows. For every triplet $r \in [0,1], \rho \geq 1$ and integer $s\geq 1$, we will prove that any solution consisting of an arbitrary cover of the $rm$ one-columns and the decomposed set of bundles containing at least $s$ and at most $3s$ one-columns yields a $9/10$-approximation of the optimal partition value. By the discussion above, this will also be the case for the solution returned by the algorithm. In order to account for the worst-case contribution of zero-columns to the partition value for a given triplet of parameters, we will use the following linear program, which we denote by $\text{LP}(r,\rho,s)$: \begin{eqnarray*} \label{eq:lp} &\mbox{minimize } & \sum_{k=s}^{3s}{ \frac{k}{k+1} \theta_k } \\ &\mbox{subject to: } & \sum_{k=s}^{3s}{\theta_k}=1-r \\ & & \sum_{k=s}^{3s}{k \theta_k} \geq \rho(1-r)-r \\ & & \theta_k \geq 0, k=s, ..., 3s \end{eqnarray*} The variable $\theta_k$ denotes the total probability of the zero-columns that participate in decomposed mixed bundles with $k$ one-columns. The objective is to minimize the contribution of the zero-columns to the partition value. The equality constraint means that all zero-columns have to participate in bundles. The inequality constraint requires that the total number of appearances of one-columns in bundles used by the algorithm is at least the total number of appearances of one-columns in mixed bundles of the optimal partition scheme minus one appearance for each one-column, since for every selection of the cover, the algorithm will have the same number of (appearances of) one-columns available to form mixed bundles. Informally, the linear program answers (rather pessimistically) to the question of how inefficient the algorithm can be. In particular, given an instance with parameters $r$ and $\rho$, the quantity $\min_{\text{\normalfont int } s\geq 1}\mbox{\normalfont LP}(r,\rho,s)$ yields a lower bound on the contribution of the zero-columns to the partition value and $r+\min_{\text{\normalfont int } s\geq 1}\mbox{\normalfont LP}(r,\rho,s)$ is a lower bound on the partition value. The next lemma completes the analysis of the greedy algorithm for the case $\rho \geq 1$. \begin{lemma}\label{lem:big-rho} For every $r \in [0,1]$ and $\rho \geq 1$, $$r+ \min_{\text{\normalfont int } s\geq 1} \mbox{\normalfont LP}(r,\rho,s) \geq \frac{9}{10} \text{\normalfont OPT}.$$ \end{lemma} \begin{proof} We will prove the lemma using LP-duality. The dual of $\text{LP}(r,\rho,s)$ is: \begin{eqnarray*} \label{eq:dlp} &\mbox{maximize } & (1-r)\alpha + ((1-r)\rho-r))\beta \\ &\mbox{subject to: } & k\beta + \alpha \leq \frac{k}{k+1}, k=s, ..., 3s \\ & & \beta \geq 0 \end{eqnarray*} Using Lemma \ref{lem:opt}, we bound the optimal partition value as \begin{align*} \mbox{OPT} \leq r + (1-r)\frac{\rho}{\rho+1} = \frac{\rho+r}{\rho+1}. \end{align*} Hence, it suffices to show that, for every triplet of parameters $(r, \rho, s)$, there is a feasible dual solution of objective value $D(r,\rho,s)$ that satisfies \begin{align} \label{eq:rD} r + D(r,\rho,s) - \frac{9}{10}\frac{\rho+r}{\rho+1} & \geq 0. \end{align} The feasible region of the dual is defined by the lines $\beta=0$, $\alpha=\frac{s}{s+1}-s\beta$ and $\alpha=\frac{3s}{3s+1}-3s\beta$; the remaining constraints can be easily seen to be redundant. The two important intersections of those lines are the points $$(\alpha,\beta)=\left(\frac{s}{s+1},0\right) \mbox{ and } (\alpha,\beta)=\left(\frac{3s^2}{(s+1)(3s+1)},\frac{1}{(s+1)(3s+1)}\right)$$ with objective values $$D_1(r,\rho,s)=\frac{s}{s+1}(1-r)\, \mbox{ and } D_2(r,\rho,s)=\frac{3s^2}{(s+1)(3s+1)}(1-r)+\frac{\rho(1-r)-r}{(s+1)(3s+1)},$$ respectively. We will show that one of these two points can always be used as a feasible dual solution in order to prove inequality (\ref{eq:rD}). We distinguish between two cases. \paragraph{Case I:} $r \geq \frac{\rho-1}{\rho}$. We will show that the point with dual objective value $D_1(r,\rho,s)$ satisfies inequality (\ref{eq:rD}), i.e., \begin{align}\label{eq:ineq1} r + \frac{s}{s+1}(1-r) - \frac{9}{10}\frac{\rho+r}{\rho+1} & \geq 0. \end{align} Since $s\geq 1$, we have that the left hand side of inequality (\ref{eq:ineq1}) is at least \begin{align*} \frac{1+r}{2}-\frac{9}{10}\frac{\rho+r}{\rho+1} = \frac{1}{2}-\frac{9\rho}{10(\rho+1)} +r \left( \frac{1}{2} - \frac{9}{10(\rho+1)} \right). \end{align*} Since $\rho\geq 1$, we have that $\frac{1}{2} - \frac{9}{10(\rho+1)} \geq 0$, and we can lower-bound the above quantity using the assumption $r \geq \frac{\rho-1}{\rho}$, as follows: \begin{align*} \frac{1+r}{2} - \frac{9}{10}\frac{\rho+r}{\rho+1} &\geq \frac{1}{2}-\frac{9\rho}{10(\rho+1)} +\frac{\rho - 1}{\rho} \left( \frac{1}{2} - \frac{9}{10(\rho+1)} \right) = \frac{(\rho-2)^2}{10\rho(\rho+1)} \geq 0, \end{align*} and inequality (\ref{eq:ineq1}) follows. \paragraph{Case II:} $r < \frac{\rho-1}{\rho}$. We will now show that the point with dual objective value $D_2(r,\rho,s)$ satisfies inequality (\ref{eq:rD}), i.e., \begin{align}\label{eq:ineq2} r + \frac{3s^2}{(s+1)(3s+1)}(1-r)+\frac{\rho(1-r)-r}{(s+1)(3s+1)} -\frac{9}{10}\frac{\rho+r}{\rho+1} &\geq 0. \end{align} Let us denote by $F$ the left hand side of inequality (\ref{eq:ineq2}). With simple calculations, we obtain \begin{align}\label{eq:F} F &= \frac{10\rho^2-(-3s^2+36s-1)\rho+30s^2}{10(3s+1)(s+1)(\rho+1)} - r \cdot \frac{10\rho^2-(40s-10)\rho+27s^2-4s+9}{10(3s+1)(s+1)(\rho+1)}. \end{align} Observe that the numerator of the left fraction in (\ref{eq:F}) is a quadratic function with respect to $\rho$ with positive coefficient in the leading term. Its discriminant is $-1191s^4-216s^3+1296s^2-72 s +7$ which is clearly negative for every integer $s\geq 1$. Hence, the numerator of the left fraction is always positive. Now, if the numerator of the rightmost fraction is negative, then inequality (\ref{eq:ineq2}) is obviously satisfied. Otherwise, using the assumption $r <\frac{\rho-1}{\rho}$, we have \begin{align*} F &\geq \frac{10\rho^2-(-3s^2+36s-1)\rho+30s^2}{10(3s+1)(s+1)(\rho+1)} - \frac{\rho-1}{\rho} \cdot \frac{10\rho^2-(40s-10)\rho+27s^2-4s+9}{10(3s+1)(s+1)(\rho+1)}\\ &= \frac{(3s^2+4s+1)\rho^2+(3s^2-36s+1)\rho+27s^2-4s+9}{10\rho(3s+1)(s+1)(\rho+1)}. \end{align*} Now, the numerator of the last fraction is again a quadratic function in terms of $\rho$ with positive coefficient in the leading term and discriminant equal to $$-315 s^4-600 s^3+1150 s^2-200 s-35 = (-315 s^3-915 s^2+235 s -35)(s-1) \leq 0,$$ for every integer $s\geq 1$. Hence, $F\geq 0$ and the proof is complete. \end{proof} The next statement summarizes the discussion above. \begin{theorem}\label{thm:uniform-main} The greedy algorithm always yields a $9/10$-approximation of the optimal partition value in the uniform case. \end{theorem} Our analysis is tight as our next counter-example suggests. \begin{theorem} There exists an instance of the uniform asymmetric binary matrix partition problem for which the greedy algorithm computes a partition scheme with value (at most) $9/10$ of the optimal one. \end{theorem} \begin{proof} Consider the instance of the asymmetric binary matrix partition problem that consists of the matrix $$A = \left(\begin{array}{c c c c}1&0&0&0\\0&1&0&0\\1&1&0&0\\1&1&0&0\end{array}\right)$$ with $p_i=1/4$ for $i=1, 2, 3, 4$. The optimal partition value is obtained by covering the one-columns in the first two rows and then bundling each of the two zero-columns with a pair of one-columns in the third and fourth row, respectively. This yields a partition value of $5/6$. The greedy algorithm may select to cover the one-columns using the 1-value entries $A_{31}$ and $A_{42}$. This is possible since the greedy algorithm has no particular criterion for breaking ties when selecting the full cover. Given this full cover, the greedy completion procedure will assign each of the two zero-columns with only one one-column. The partition value is then $3/4$, i.e., $9/10$ times the optimal partition value. \end{proof} \section{Asymmetric binary matrix partition as welfare maximization} \label{sec:non-uniform} We now consider the more general non-uniform case. Interestingly, property P1 of Lemma \ref{lem:structure} does not hold any more as the following statement shows. \begin{lemma} For every $\epsilon>0$, there exists an instance of the asymmetric binary matrix partition problem in which any partition scheme containing a full cover of the columns in $A^+$ yields a partition value that is at most $8/9+\epsilon$ times the optimal one. \end{lemma} \begin{proof} Consider the instance of the asymmetric binary matrix partition problem consisting of the matrix $$A = \left(\begin{array}{c c c c}1&0&0&0\\0&1&0&0\\0&1&0&0\\1&0&1&0\end{array}\right)$$ with column probabilities $p_j=\frac{1}{\beta+3}$ for $j=1,2,3$ and $p_4=\frac{\beta}{\beta+3}$ for $\beta > 2$. Observe that there are four partition schemes containing a full cover (depending on the rows that contain the column-covering bundle of the first two columns) and, in each of them, the zero-column is bundled together with a 1-value entry. By making calculations, we obtain that the partition value in these cases is $\frac{4\beta+3}{(\beta+1)(\beta+3)}$. Here is one of these partition schemes: \begin{table}[h!] \centering \begin{tabular}{|c|c|} \hline $B_1$ & $\{1\}$, $\{2,3,4\}$ \\ \hline $B_2$ & $\{2\}$, $\{1,3,4\}$ \\ \hline $B_3$ & $\{1,3\}$, $\{2,4\}$ \\ \hline $B_4$ & $\{1\}$, $\{3\}$, $\{2,4\}$ \\ \hline \end{tabular}\ \ \ \ \begin{tabular}{|c|c|c|c|c|} \hline \multirow{4}{*}{$A^B$} & $1$ & $0$ & $0$ & $0$ \\ & $0$ & $1$ & $0$ & $0$ \\ & $0$ & $\frac{1}{\beta+1}$ & $0$ & $\frac{1}{\beta+1}$ \\ & $1$ & $0$ & $1$ & $0$ \\ \hline $p_j \cdot \max_i{A_{ij}^B}$ & $\frac{1}{\beta+3}$ & $\frac{1}{\beta+3}$ & $\frac{1}{\beta+3}$ & $\frac{\beta}{(\beta+1)(\beta+3)}$ \\ \hline \end{tabular} \end{table} In contrast, consider the partition scheme $B'$ in which the 1-value entries $A_{11}$ and $A_{22}$ form column-covering bundles in rows $1$ and $2$, the entries $A_{32}$ and $A_{33}$ are bundled together in row $3$ and the entries $A_{41}$, $A_{43}$, and $A_{44}$ are bundled together in row $4$. As it can be seen from the tables below (recall that $\beta>2$), the partition value now becomes $\frac{4.5\beta+5}{(\beta+2)(\beta+3)}$. \begin{table}[h!] \centering \begin{tabular}{|c|c|} \hline $B'_1$ & $\{1\}$, $\{2,3,4\}$ \\ \hline $B'_2$ & $\{2\}$, $\{1,3,4\}$ \\ \hline $B'_3$ & $\{1,4\}$, $\{2,3\}$ \\ \hline $B'_4$ & $\{2\}$, $\{1,3,4\}$ \\ \hline \end{tabular}\ \ \ \ \begin{tabular}{|c|c|c|c|c|} \hline \multirow{4}{*}{$A^{B'}$} & $1$ & $0$ & $0$ & $0$ \\ & $0$ & $1$ & $0$ & $0$ \\ & $0$ & $1/2$ & $1/2$ & $0$ \\ & $\frac{2}{\beta+2}$ & $0$ & $\frac{2}{\beta+2}$ & $\frac{2}{\beta+2}$ \\ \hline $p_j \cdot \max_i{A_{ij}^{B'}}$ & $\frac{1}{\beta+3}$ & $\frac{1}{\beta+3}$ & $\frac{1}{2(\beta+3)}$ & $\frac{2\beta}{(\beta+2)(\beta+3)}$ \\ \hline \end{tabular} \end{table} Clearly, the ratio of the two partition values approaches $8/9$ from above as $\beta$ tends to infinity. Hence, the theorem follows by selecting $\beta$ sufficiently large for any given $\epsilon>0$. \end{proof} Still, as the next statement indicates, the optimal partition scheme has some structure which we will exploit later. \begin{lemma}\label{lem:non-uniform-structure} Consider an instance of the asymmetric binary matrix partition problem consisting of a matrix $A$ and a probability distribution $p$ over its columns. There is an optimal partition scheme $B$ that satisfies properties P2, P3, P4 as well as the following property: \begin{enumerate} \item[P5.] Given any column $j$, denote by $H_j = \arg\max_i{A_{ij}^B}$ the set of rows through which column $j$ contributes to the partition value $v^B(A,p)$. For every $i\in H_j$ such that $A_{ij}=1$, the bundle of partition $B_i$ that contains column $j$ is not mixed. \end{enumerate} \end{lemma} \begin{proof} Consider an optimal partition scheme $B$ that does not satisfy property P5, and let $j^*$ be a column such that $A_{i^*j^*}=1$ for some $i^*\in H_{j^*}$. Furthermore, assume that the mixed bundle $b$ of partition $B_{i^*}$ that contains column $j^*$, also contains the columns of a (possibly empty) set $b_1 \subseteq A_{i^*}^+\setminus\{j^*\}$ and the columns of a non-empty set $b_0 \subseteq A_{i^*}^0$. Let $p^+\geq 0$ and $p^0>0$ be the sum of probabilities of the columns in $b_1$ and $b_0$, respectively. Let $B'$ be the partition scheme that is obtained from $B$ when splitting bundle $b$ into two bundles $\{j^*\}$ and $b\setminus \{j^*\}$; we will show that $B'$ must be optimal as well. Observe that $A_{i^*j}^B=\frac{p_{j^*}+p^+}{p_{j^*}+p^++p^0}$ and $A_{i^*j}^{B'}=\frac{p^+}{p^++p^0}$ for every $j\in b\setminus\{j^*\}$; hence, $A_{i^*j}^B>A_{i^*j}^{B'}$. Since, this is the only difference between $B$ and $B'$, the difference $\max_i{A_{ij}^B} - \max_i{A_{ij}^{B'}}$ is at most $A_{i^*j}^B-A_{i^*j}^{B'}$ for every $j\in b\setminus\{j^*\}$, and $\max_i{A_{ij^*}^B} - \max_i{A_{ij^*}^{B'}} = A_{i^*j^*}^B-A_{i^*j^*}^{B'} = \frac{p_{j^*}+p^+}{p_{j^*}+p^++p^0}-1$. Hence, we have \begin{align*} v^B(A,p) - v^{B'}(A,p) &= \sum_{j\in [m]}{p_j \cdot \max_i{A_{ij}^B}} - \sum_{j\in [m]}{p_j \cdot \max_i{A_{ij}^{B'}}}\\ &= \sum_{j\in b}{p_j\left(\max_i{A_{ij}^B} - \max_i{A_{ij}^{B'}}\right)}\\ &\leq \sum_{j\in b}{p_j\left(A_{i^*j}^B-A_{i^*j}^{B'}\right)}\\ &= p_{j^*}\left(\frac{p_{j^*}+p^+}{p_{j^*}+p^++p^0}-1\right) + \sum_{j\in b\setminus\{j^*\}}{p_j\left(\frac{p_{j^*}+p^+}{p_{j^*}+p^++p^0}-\frac{p^+}{p^++p^0}\right)}\\ &= 0, \end{align*} where the last equality follows from the fact that $\sum_{j\in b\setminus\{j^*\}}{p_j}=p^++p^0$. Hence, the partition value does not decrease. By repeating this argument, we will reach an optimal partition scheme that satisfies property P5. Using arguments similar to the ones used in the proof of Alon et al.~\cite{AFGT13} for Lemma~\ref{lem:structure} we can prove that the resulting partition scheme can be transformed in such a way so that it satisfies properties P2, P3, and P4. \end{proof} What Lemma \ref{lem:non-uniform-structure} says is that the contribution of column $j\in A^+$ to the partition value comes from a row $i$ such that either $j\in A^+_i$ and $\{j\}$ forms a column-covering bundle or $j\in A^0_i$ and $j$ belongs to the mixed bundle of row $i$. The contribution of a column $j\in A^0$ to the partition value always comes from a row $i$ where $j$ belongs to the mixed bundle. Hence, the problem of computing the partition scheme of optimal partition value is equivalent to deciding the row from which each column contributes to the partition value. Let $B$ be a partition scheme and $S$ be a set of columns whose contribution to the partition value of $B$ comes from row $i$ (i.e., $i$ is the row that maximizes the smooth value $A_{ij}^B$ for each column $j$ in $S$). Denoting the sum of these contributions by $R_i(S)=\sum_{j\in S}{p_j \cdot A_{ij}^B}$, we can equivalently express $R_i(S)$ as \begin{align*} R_i(S)=\sum_{j \in S \cap A_i^+}{p_j} + \frac{\sum_{j \in S \cap A_i^0}{p_j \sum_{j \in A_i^+ \setminus S}{p_j}}}{\sum_{j \in S \cap A_i^0} p_j + \sum_{j \in A_i^+ \setminus S}{p_j}}. \end{align*} The first sum represents the contribution of columns of $S\cap A^+_i$ to the partition value (through column-covering bundles) while the second sum represents the contribution of the columns in $S\cap A^0_i$ which are bundled together with all $1$-value entries in $A^+_i\setminus S$ in the mixed bundle of row $i$. Then, the partition scheme $B$ can be thought of as a collection of disjoint sets $S_i$ (with one set per row) such that $S_i$ contains those columns whose entries achieve their maximum smooth value in row $i$. Hence, the partition value of $B$ is $v^B(A,p) = \sum_{i\in[n]}{R_i(S_i)}$ and the problem is essentially equivalent to welfare maximization where the rows act as the agents who will be allocated bundles of items (corresponding to columns). \begin{lemma}\label{lem:submodular} For every row $i$, the function $R_i$ is non-decreasing and submodular. \end{lemma} \begin{proof} We will show that the function $R_i$ is non-decreasing and has decreasing marginal utilities, i.e., \begin{itemize} \item (monotonicity) for every set $S$ and item $x\not\in S$, it holds that $R_i(S)\leq R_i(S\cup \{x\})$; \item (decreasing marginal utilities) for every pair of sets $S, T$ such that $S \subseteq T$ and every item $x \not\in T$, it holds that $R_i(S \cup \{x\})-R_i(S) \geq R_i(T \cup \{x\})-R_i(T)$. \end{itemize} In order to simplify notation, let us define the functions $\alpha(S)=\sum_{j \in S \cap A_i^+}p_j$, $\beta(S)=\sum_{j \in S \cap A_i^0} p_j$ and $\gamma(S)=\sum_{j \in A_i^+ \setminus S} p_j$. We can rewrite the function $R_i$ as \begin{align*} R_i(S)=\alpha(S) + \frac{\beta(S) \cdot \gamma(S)}{\beta(S) + \gamma(S)}. \end{align*} Let $S, T \subseteq [m]$ be two sets of columns such that $S\subseteq T$ and let $x$ be a column that does not belong to set $T$. We distinguish between two cases depending on $x$. If $x\in A_i^+$, observe that \begin{itemize} \item $\alpha(S \cup \{x\}) = \alpha(S)+p_x$ and $\alpha(T \cup \{x\}) = \alpha(T)+p_x$; \item $\beta(S \cup \{x\}) = \beta(S)$ and $\beta(T \cup \{x\}) = \beta(T)$; \item $\gamma(S \cup \{x\}) = \gamma(S)-p_x$ and $\gamma(T \cup \{x\}) = \gamma(T)-p_x$. \end{itemize} Using the definition of function $R_i$, we have \begin{align*} R_i(S \cup \{x\})- R_i(S) &= p_x + \beta(S) \left( \frac{\gamma(S)-p_x}{\beta(S)+\gamma(S)-p_x} - \frac{\gamma(S)}{\beta(S)+\gamma(S)} \right) \\ &= p_x - \frac{ p_x \beta(S)^2}{(\beta(S)+\gamma(S))\cdot(\beta(S)+\gamma(S)-p_x)} \\ &\geq p_x - \frac{ p_x \beta(S)^2}{(\beta(S)+\gamma(T))(\beta(S)+\gamma(T)-p_x)} \\ &\geq p_x - \frac{ p_x \beta(T)^2}{(\beta(T)+\gamma(T))(\beta(T)+\gamma(T)-p_x)} \\ &= R_i(T \cup \{x\})- R_i(T). \end{align*} The first inequality follows since $\gamma$ is clearly non-increasing and $S \subseteq T$ and the second inequality follows by applying twice (with $a=\gamma(T)$ and $a=\gamma(T)-p_x$, respectively) the fact that the function $f(z)=\frac{z}{z+a}$ for $a\geq 0$ is non-decreasing. If instead $x\in A_i^0$, observe that \begin{itemize} \item $\alpha(S \cup \{x\}) = \alpha(S)$ and $\alpha(T \cup \{x\}) = \alpha(T)$; \item $\beta(S \cup \{x\}) = \beta(S)+p_x$ and $\beta(T \cup \{x\}) = \beta(T)+p_x$; \item $\gamma(S \cup \{x\}) = \gamma(S)$ and $\gamma(T \cup \{x\}) = \gamma(T)$. \end{itemize} Hence, we have \begin{align*} R_i(S \cup \{x\})- R_i(S) &= \gamma(S) \left( \frac{\beta(S)+p_x}{\beta(S)+\gamma(S)+p_x} - \frac{\beta(S)}{\beta(S)+\gamma(S)} \right) \\ &= \frac{ p_x \gamma(S)^2}{(\beta(S)+\gamma(S))(\beta(S)+\gamma(S)+p_x)} \\ &\geq \frac{ p_x \gamma(S)^2}{(\beta(T)+\gamma(S))(\beta(T)+\gamma(S)+p_x)} \\ &\geq \frac{ p_x \gamma(T)^2}{(\beta(T)+\gamma(T))(\beta(T)+\gamma(T)+p_x)}\\ &= R_i(T \cup \{x\})- R_i(T). \end{align*} Again, the inequality follows since $\beta$ is clearly non-decreasing and $S\subseteq T$ and the second inequality follows by applying twice (with $a=\beta(T)$ and $a=\beta(T)+p_x$, respectively) the fact that the function $f(z)=\frac{z}{z+a}$ with $a\geq 0$ is non-decreasing. We have completed the proof that $R_i$ has decreasing marginal utilities. In order to establish monotonicity, it suffices to observe that the quantity at the right-hand side of the second equality in each of the above two derivations starting with $R_i(S\cup \{x\})-R_i(S)$ is non-negative. \end{proof} Lehmann et al.~\cite{LLN06} studied the submodular welfare maximization problem and provided a simple algorithm that yields a $1/2$-approximation of the optimal welfare. Their algorithm considers the items one by one and assigns item $j$ to the agent that maximizes the marginal valuation (the additional value from the allocation of item $j$). In our setting, this algorithm can be implemented as follows. It considers the one-columns first and the zero-columns afterwards. Whenever considering a one-column $j$, a column-covering bundle $\{j\}$ is formed at an arbitrary row $i$ with $j\in A^+_i$ (such a decision definitely maximizes the increase in the partition value). Whenever considering a zero-column, it includes it to a mixed bundle so that the increase in the partition value is maximized. Using the terminology of Alon et al.~\cite{AFGT13}, the algorithm essentially starts with an arbitrary cover of the one-columns and then it runs the greedy completion procedure. Again, we will use the term greedy for this algorithm. \begin{theorem}\label{thm:lehmann} The greedy algorithm for the asymmetric binary matrix partition problem has approximation ratio at least $1/2$. This bound is tight. \end{theorem} \begin{proof} The lower bound holds by the equivalence of the greedy algorithm with the algorithm studied by Lehmann et al.~\cite{LLN06}. Below, we prove the upper bound. In particular, we show that for every $\epsilon>0$, there exists an instance of the problem in which the greedy algorithm obtains a partition scheme whose value is at most $1/2+\epsilon$ of the optimal one. Let $k>0$ be a positive integer and $\alpha$ significantly higher than $k$. Consider the instance of the asymmetric binary matrix partition that consists of the following $(k+1) \times (k+1)$ matrix $$A = \left(\begin{array}{c c c c c}1&0&\cdots&0&0\\0&1&\cdots&0&0\\\vdots&\vdots&\ddots&\vdots&\vdots\\0&0&\cdots&1&0\\1&1&\cdots&1&0\end{array}\right)$$ where $p_j=\frac{1}{k+\alpha}$ for $j\in [k]$ and $p_{k+1}=\frac{\alpha}{k+\alpha}$. So, the first $k$ columns and rows of $A$ form an identity matrix, the last column has only 0-value entries and the last row consists of $k$ 1-value entries in the first $k$ columns. In order to lower-bound the optimal partition value, consider the partition scheme consisting of a full cover that contains the 1-value entries $(i,i)$ for $i\leq k$, and a bundle containing the whole $(k+1)$-th row. The optimal partition value is lower-bounded by the value of this partition scheme. By simple calculations, we obtain \begin{align*} \mbox{OPT} &\geq \frac{k^2+2\alpha k}{(k+\alpha)^2}. \end{align*} On the other hand, the greedy algorithm may select first to cover the $k$ one-columns using the 1-value entries $(k+1,j)$ for $j\leq k$ and, then, bundle the zero-column together with only one 1-value entry in some of the first $k$ rows. The partition value of the greedy algorithm is then \begin{align*} \mbox{GREEDY} &=\frac{k+(k+1)\alpha}{(k+\alpha)(\alpha+1)}. \end{align*} Hence, the ratio between the two partition values is \begin{align*} \frac{\mbox{GREEDY}}{\mbox{OPT}} &\leq \frac{(k+\alpha)(k+(k+1)\alpha)}{(k^2+2\alpha k)(\alpha+1)}. \end{align*} Pick an arbitrarily small $\delta>0$; then, there exist a value for $\alpha$ (significantly higher than $k$) so that the above ratio satisfies $\frac{\mbox{GREEDY}}{\mbox{OPT}} \leq \frac{k+1}{2k}+\delta$. The theorem follows by picking $k$ sufficiently large and $\delta$ sufficiently small. \end{proof} We can use the more sophisticated smooth greedy algorithm of Vondr\'ak \cite{V08}, which uses value queries to obtain the following. \begin{corollary} There exists a $(1-1/e)$-approximation algorithm for the asymmetric binary matrix partition problem. \end{corollary} One might hope that due to the particular form of functions $R_i$, better approximation guarantees might be possible using the $(1-1/e+\epsilon)$-approximation algorithm of Feige and Vondr\'ak \cite{FV10} which requires that demand queries of the form \begin{quote} given a price $q_j$ for every item $j \in [m]$, select the bundle $S$ that maximizes the difference $R_i(S)- \sum_{j \in S}{q_j}$ \end{quote} can be answered in polynomial time. Unfortunately, in our setting, this is not the case in spite of the very specific form of the function $R_i$. \begin{lemma}\label{lem:demand-hard} Answering demand queries associated with the asymmetric binary matrix partition problem are NP-hard. \end{lemma} \begin{proof} We use reduction from {\sc Partition} to show that the following (very restricted) decision version DQ of a demand query is NP-hard. \begin{quote} DQ: Given a $1\times m$ binary matrix $A$, probabilities $p_j$ and prices $q_j$ for column $j \in [m]$, is there a set $S\subseteq [m]$ such that $R_i(S)- \sum_{j \in S}{q_j}\geq 5/18$? \end{quote} We start from an instance of {\sc Partition} consisting of a collection $C$ of $t$ items of integer size $w_1$, $w_2$, ..., $w_t$ and the question of whether there exists a subset $Y\subseteq C$ of items such that $$\sum_{j\in Y}{w_j} = \sum_{j\in C\setminus Y}{w_j} = \frac{1}{2}\sum_{j\in C}{w_j}.$$ Define $W=\sum_{j\in C}{w_j}$. Given this instance, we construct an instance of DQ with $m=t+1$ as follows. The binary matrix $A$ consists of a single row that contains $t$ 1-value entries with associated probabilities $\frac{w_1}{2W}$, $\frac{w_2}{2W}$, ..., $\frac{w_t}{2W}$ and a 0-value entry with associated probability $1/2$. Set the prices as $q_j=\frac{5w_j}{18W}$ for $j=1, ..., t$ and $q_{t+1}=0$. By the definition of the function $R_i$, given a set $S\subseteq [t+1]$, we have \begin{align*} R_i(S) -\sum_{j\in S}{q_j} &= \frac{1}{2W}\sum_{j\in S\setminus \{t+1\}}{w_j} + \frac{\frac{1}{4W}\sum_{j\in [t]\setminus S}{w_j}}{\frac{1}{2}+\frac{1}{2W}\sum_{j\in [t]\setminus S}{w_j}} - \frac{5}{18W}\sum_{j\in S\setminus \{t+1\}}{w_j}\\ &=\frac{2}{9} - \frac{2}{9W}\sum_{j\in [t]\setminus S}{w_j}+\frac{\sum_{j\in [t]\setminus S}{w_j}}{2W+2\sum_{j\in [t]\setminus S}{w_j}}. \end{align*} Now, consider the function $f(z)= \frac{2}{9}-\frac{2z}{9W} +\frac{z}{2W+2z}$; the equality above implies that $$R_i(S) -\sum_{j\in S}{q_j} = f\left(\sum_{j\in [t]\setminus S}{w_j}\right).$$ By nullifying the derivative of function $f$, we obtain that is has a unique maximum at $z=W/2$. Since $f(W/2)=5/18$, the instance of DQ is equivalent to asking whether there exists a set $S$ such that $\sum_{j\in [t]\setminus S}{w_j}=W/2$, which is equivalent to asking whether there exists a set of items of total size $W/2$ in the instance of {\sc Partition}. \end{proof}
{'timestamp': '2015-04-09T02:16:48', 'yymm': '1407', 'arxiv_id': '1407.8170', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8170'}
arxiv
\section{Introduction} The number one enemy and the bottle neck of wireless networks is signal interference caused by the inherent broadcast nature of the wireless medium. Interference alignment (IA) \cite{maddah2008communication,4567443} is a key concept that arises in the context of interference management which refers to creating a correlation or an overlap between the interference signals at receiver in order to minimize dimensions of the interference subspace and maximize the desired signal space dimensions. Global, perfect, and instantaneous channel state information at transmitter (CSIT) is a fundamental component for interference alignment in pioneering works \cite{maddah2008communication,4567443,5208535, 4418479}. On the other hand, in the complete absence of CSIT, an overly pessimistic assumption, the potential of IA fades and the degrees of freedom (DoF) of many networks collapse to what is achievable by time-division between users\cite{6205390}. Maddah Ali and Tse \cite{maddah2012completely} proved that completely outdated CSIT can still be useful even if the channel states are completely independent, contrary to the popular belief that in fast fading environment, delayed CSIT is vain. In another research direction, Tandon et al. in \cite{6471826} formalized an interesting model for the availability of the CSIT, in the context of broadcast channel, called alternating CSIT. In this model, the authors allow the availability of CSIT to vary over time which is a more practical assumption and convenient to the nature of wireless networks and alternating CSIT could provide synergistic DoF gain. Earlier research works on the DoF of the X-channel have determined that the upper bound for DoF of a single-input single-output (SISO) X-channel is $4/3$ and for a MIMO one is $4M/3$ where $M$ is the number of antennas per node \cite{maddah2008communication, 5208535,4418479}. These upper bounds are achievable with global, perfect and instantaneous CSIT. Then, the authors of \cite{ghasemi2011degrees} demonstrated that the delayed CSIT is beneficial for wireless networks consisting of distributed transmitters and receivers. Specifically, they showed that the SISO X-channel with delayed CSIT can achieve $6/5$ DoF. Recently, the authors of \cite{Delayed_CSIT} confirmed that the upper bound on the DoF of the SISO X-channel with delayed CSIT is to be $6/5$, using a new converse proof. More recently, the remarkable finding of \cite{Wagdy} is that the \textit{fixed} perfect CSIT is not a necessary requirement to achieve the upper bound on the DoF of the X-channel. In this work, we consider the SISO X-channel with alternating CSIT. The main contribution of this work is to provide new achievability results on the DoF of X-channel. A pertinent question we ask is whether the \textit{fixed} delayed availability of CSIT is the only middle ground between the two CSIT extremes; fixed perfect and fixed no-CIST. We answer this question by extending the system model of \cite{Wagdy} where each CSIT availability state is associated with a time fraction $\lambda_S$ where $S \in \{P , D, N \}$ and each CSIT alternation pattern is associated with a distribution $\Lambda(\lambda_P, \lambda_D, \lambda_N )$ to the states of CSIT. Hence, the fixed delayed CSIT $\equiv \Lambda(0, 1, 0)$ is not the only middle ground between the fixed perfect $\equiv\Lambda(1, 0, 0)$ and the fixed no-CSIT $\equiv\Lambda(0, 0, 1)$. Finally, we show that for a certain distribution of CSIT availability states there are synergistic alternation patterns and dissociative ones. The remainder of this paper is organized as follows. In Section II, the system model is described. Section III presents achievability scheme for three different cases of CSIT alternation patterns. Finally, Theorem 1 and concluding remarks are presented in Section IV. \section{System Model} A SISO X-channel is considered, in which a two independent transmitters $T_1$ and $T_2$ transmit four independent messages $W_{11}, W_{12},W_{21}, W_{22}$ to receivers $R_1$ and $R_2$, where $W_{ij}$ originates in transmitter $j$ and is intended to receiver $i$ and each node equipped with single antenna. The received signal at the $i$th receiver at time slot $t$ is given by: \begin{equation}\label{eq1} Y_i(t)= \displaystyle\sum_{j=1}^2 h_{ij}(t)X_j(t)+N_i(t) \end{equation} where $X_j(t)=f_{1j}(t) W_{1j}(t)+f_{2j}(t) W_{2j}(t)$ is the transmitted signal from $T_j$ at the $t$th time slot which satisfies the power constraint $E[\|X(t)\|^2]\leq P$ and $f_{ij}(t)$ is the precoding coefficient for the message $W_{ij}(t)$. The noise $N_i(t)\sim \mathbb{C}\mathcal{N}(0,1)$ is the circularly symmetric complex additive white Gaussian noise with unit variance generated at $R_i$ at time slot $t$. In \eqref{eq1}, $h_{ij}(t)$ is the channel coefficient from $T_j$ to $R_i$ and all channel coefficients are independent identically distributed (i.i.d.) drawn from continuous distribution over time. We assume that the receivers have perfect global channel state information. Furthermore, we consider three different states of the availability of CSIT identified by: \begin{enumerate} \item Perfect CSIT (P): identifies the state of CSIT in which CSIT is available to the transmitters instantaneously and without error. \item Delayed CSIT (D): identifies the state of CSIT in which CSIT is available to the transmitters with some delay $\ge$ one time slot and without error. \item No CSIT (N): identifies the state of CSIT in which CSIT is not available to the transmitters at all. \end{enumerate} Then, The state of CSIT availability of the channels to the $i$th receiver is denoted by $S_i$; where, $S_i$ $\in \{P,D,N\}$. In addition, let $S_{12}$ denote the state of CSIT availability for the channels to the first and second receivers, respectively. Therefore, $S_{12} \in \{PP,PD,PN,DP,DD,DN,NP,ND,NN\}$. For example, $S_{12}= PN$ refers to the case where $T_1$ has perfect knowledge of $h_{11}$ (and no information about $h_{21}$) and $T_2$ has perfect knowledge of $h_{12}$ (and no information about $h_{22}$). We denote the CSIT availability of the channels to the $i$th receiver in the $t$th time slot by $S_i(t)$ and over $n$ time slots of time channel extension by $n$-tuple $S_i^n =(S_i(1),...,S_i(n))$. Similarly, we denote the availability of CSIT for the channels to the first and second receivers in the $t$th time slot by $S_{12}(t)$ and over $n$ time slots channel extension \textquotedblleft CSIT pattern\textquotedblright denoted by $S_{12}^n=(S_{12}(1),...,S_{12}(n))$. Furthermore, the fraction of time associated with the state of CSIT availability for the network denoted by $\lambda_{S}, S \in \{ P, D, N\}$ is given by \begin{equation} \lambda_{S}=\frac{\sum_t\sum_i \mathbb{I}_S(S_i(t))}{k*n} \end{equation} where $\mathbb{I}$ denote the Indicator function and $k$ is the number of users, so that \begin{equation} \sum_S\lambda_{S}=1. \end{equation} and $\Lambda(\lambda_P, \lambda_D, \lambda_N )$ denotes the distribution of the fraction of time for the different states $\{P, D, N\}$ of the CSIT availability. Let $r_{ij}(P)$ denote the rate of $W_{ij}$ for a given transmission power $P$ where $ r_{ij}(P)= \frac{\log_2(|W_{ij}|)}{n}$ and $n$ is the number of channel uses. The rate $r_{ij}(P)$ is achievable if there exists a sequence of coding schemes such that the probability of error in decoding $W_{ij}$ goes to zero as $n$ goes to infinity for all $(i,j)$. The degrees of freedom region $\mathcal{D}(\Lambda)$ is defined as the set of all achievable tuples $(d_{11}, d_{12}, d_{21},d_{22})$, where $d_{ij}= \lim_{P \rightarrow \infty} \frac{R_{ij}(P)}{\log_2{(P)}}$ is the degrees of freedom for message $W_{ij}$. The sum degrees of freedom of the network defined as: \begin{equation} \text{DoF}(\Lambda)= \max_{(d_{11},d_{12},d_{21},d_{22}) \in \mathcal{D}(\Lambda)} d_{11}+d_{12}+d_{21}+d_{22} \end{equation} Noteworthy, we could consider this system model as a general model for the availability of CSIT where the fixed perfect, delayed and no-CSIT are special cases included in this model for $\Lambda(1,0,0),\Lambda(0,1,0)\text{and} \Lambda(0,0,1)$ respectively. Finally, we could state the problem as to characterize the sum degrees of freedom $\text{DoF}(\Lambda)$ as a function of the distribution of the time fractions associated with the three states of CSIT availability for the X-Channel. \section{ The achievability Scheme} \label{Scheme} In this section, we present three illustrative cases for the proposed achievable scheme in three different cases of CSIT availability. In all these cases, we show that $5/4$ DoF is achievable by sending $5$ different data symbols; $3$ for the first receiver and $2$ for the second one over four time slots. Inspired by idea of Maddah-Ali and Tse in \cite{maddah2012completely} which is to exploit the past received signals to create common signals to different receivers, hence improving DoF by broadcasting them to the receivers, we constructed our approach. In the context of distributed transmitters networks like X-channel, it may not be possible for transmitters to create common signals by reconstructing previously received signals with only delayed CSIT, since the common signal at one transmitter contains the signals of the other transmitters. Here, we developed a new transmission strategy based on creating signals of common interest for different receivers utilizing the synergy of alternating CSIT. Specifically, exploiting the cooperation between delayed CSIT and perfect CSIT to perfectly reconstruct the \textquotedblleft interference\textquotedblright, signal of common interest, formerly received. Hence, transmitters could reconstruct the interference formerly received and defeat the distributed nature of the X-channel. The proposed achievability scheme of $5/4$ for the SISO X-channel is performed in two phases over four time slots. The first phase is associated with the delayed CSIT and divided into two sub-phases where each sub-phase might consume one or two time slots. This phase is called \textquotedblleft interference creation\textquotedblright, where the transmitters greedily transmit their messages. As a result, the receivers get linear combinations of their desired messages in addition to interference. Totally, this phase needs three different delayed CSIT either distributed over three time slots, i.e., $S_{12}^3 = (ND,ND,DN)$ or combined over two time slots, i.e.,$S_{12}^2 = (DD,ND)$. On the other hand, the second phase is associated with the perfect CSIT state and is called the \textquotedblleft interference resurrection\textquotedblright phase. In this phase, transmitters reconstruct the old interference by exploiting the delayed CSIT received in phase one and the perfect CSIT in the second phase. Hence, after four time slots, one receiver has three different linear combinations of its desired messages and only one interference term received twice and the other receiver has two different linear combinations of its desired messages and three aligned interference terms. Noteworthy, in some cases the two phases can overlap over the four time slots. Let $u^1_1$, $u^2_1$ and $u_2$ be three independent data symbol intended to $R_1$ where $u^1_1$, $u^2_1$ transmitted from $T_1$ and $u_2$ transmitted from $T_2$. Also, let $v_1$ and $v_2$ be two independent data symbol intended to $R_2$ transmitted from $T_1$ and $T_2$, respectively. In the next subsections, we show that we can reliably transmit the three symbols $(u^1_1 ,u^1_2, u_2)$ to receiver 1 and the two symbols $(v_1 ,v_2)$ to receiver 2 in four time slots in three different cases of alternating CSIT. \subsection{Combined creation and distributed resurrection} Let us consider the alternating CSIT pattern given by $S_{12}^4 = (DD,ND,PN,NN)$. Here, We have combined delayed $S_{12}(1) = (DD)$. Consequently, the interference creation phase consumes only two time slots while the interference resurrection phase can extend over two time slots. The proposed scheme is performed in two separate phases as follows. \textit{Phase one:} In the first time slot, each transmitter greedily transmit two data symbols to the two receivers, i.e., $X_1(1)= u_1^1 + v_1$ and $X_2(1)= u_2 + v_2$. As a result, the received signals \begin{eqnarray} Y_1(1)&\!\!\!=\!\!\!& h_{11}(1)u_1^1 + h_{12}(1)u_2+ h_{11}(1)v_1+h_{12}(1)v_2 \nonumber \\ &\!\!\!\equiv \!\!\!& L_1^1(u_1^1,u_2)+ I_1(v_1,v_2)\\ Y_2(1)&\!\!\!=\!\!\!&h_{21}(1)u_1^1 + h_{22}(1)u_2+ h_{21}(1)v_1+h_{22}(1)v_2 \nonumber \\ &\!\!\!\equiv\!\!\!& I_2^1(u_1^1,u_2)+ L_2^1(v_1,v_2) \end{eqnarray} where $L_i^j(x_1,x_2)$ denotes the $j$th linear combination of the two messages $x_1$ and $x_2$ that are intended for receiver $R_i$ and $I_i^j(z_1,z_2)$ denotes the $j$th interference term for receiver $R_i$ which is a function of the messages $z_1$ and $z_2$ that are not intended for this receiver. Similarly, in the next time slot, $T_1$ transmits $u_1^2$ and $T_2$ transmits $u_2$. The received signals at $R_1$ and $R_2$ are: \begin{eqnarray} Y_1(2)&\!\!\!=\!\!\!&h_{11}(2)u_1^2 + h_{12}(2)u_2 \equiv L_1^2(u_1^2,u_2)\\ Y_2(2)&\!\!\!=\!\!\!&h_{21}(2)u_1^2 + h_{22}(2)u_2 \equiv I_2^2(u_1^2,u_2) \end{eqnarray} Therefore, $R_1$ receives the second linear combination $L_1^2(u_1^2,u_2)$ of its desired signals, while $R_2$ receives only interference $I_2^2(u_1^2,u_2)$. \textit{Phase two:} This phase consists of two time slots where in each time slot the transmitted signals are designed such that the interference is resurrected at one receiver while the second receiver receives a new linear combination of its desired messages. Note that now the transmitters are aware of the CSIT of the previous time slot, i.e., $T_1$ knows $h_{11}(1)$, $h_{21}(1)$ and $h_{21}(2)$ while $T_2$ knows $h_{12}(1)$, $h_{22}(1)$ and $h_{22}(2)$. Also, at $t=3$, the channels to the first receiver are known perfectly and instantaneously at the two transmitters, i.e., $T_1$ knows $h_{11}(3)$ and $T_2$ knows $h_{12}(3)$. As a result, the first time slot in this phase is dedicated to resurrecting the interference $I_1(v_1,v_2)$ received by $R_1$ in the first time slot. The transmitted signals of $T_1$ and $T_2$ are: \begin{eqnarray} X_1(3)&\!\!\!=\!\!\!&h_{11}^{-1}(3)h_{11}(1)v_1\\ X_2(3)&\!\!\!=\!\!\!&h_{12}^{-1}(3)h_{12}(1)v_2 \end{eqnarray} and the received signals at $R_1$ and $R_2$ are: \begin{eqnarray} Y_1(3)&\!\!\!=\!\!\!& h_{11}(1)v_1+h_{12}(1)v_2 \equiv I_1(v_1,v_2)\\ Y_2(3)&\!\!\!=\!\!\!&h_{21}(3)h_{11}^{-1}(3)h_{11}(1)v_1+h_{22}(3)h_{12}^{-1}(3)h_{12}(1)v_2 \nonumber \\ &\!\!\!\equiv \!\!\!&L_2^2(v_1,v_2) \end{eqnarray} Hence, at the end of sub-phase one, $R_1$ has received $I_1(v_1,v_2)$, the interference received in the first time slot, and $R_2$ has received a new linear combination $L_2^2(v_1,v_2)$. In the second sub-phase; the fourth time slot, the transmitted signals are designed to resurrect the interference received by $R_2$ in the first and second time slots and provide a new linear combination of the desired messages to $R_1$. The transmitted signals of $T_1$ and $T_2$ are given by: \small \begin{eqnarray} X_1(4)&\!\!\!=\!\!\!&h_{22}(2)h_{21}(1)u_1^1-h_{22}(1)h_{21}(2)u_1^2\\ X_2(4)&\!\!\!=\!\!\!&0 \end{eqnarray} \normalsize The received signals at $R_1$ and $R_2$ are given by: \small \begin{eqnarray} Y_1(4)&\!\!\!=\!\!\!&h_{11}(4)[(h_{22}(2)h_{21}(1)u_1^1 - h_{22}(1)h_{21}(2)u_1^2]\nonumber\\&\!\!\!\equiv \!\!\!& L_1^3(u_1^1,u_1^2) \\ Y_2(4)&\!\!\!=\!\!\!&h_{21}(4)[(h_{22}(2)h_{21}(1)u_1^1 - h_{22}(1)h_{21}(2)u_1^2]\nonumber\\&\!\!\!\equiv \!\!\!&h_{21}(4)[h_{22}(2)I_2^1(u_1^1,u_2)- h_{22}(1)I_2^2(u_1^2,u_2)] \end{eqnarray} \normalsize After the fourth time slot, the two receivers $R_1$ and $R_2$ have enough information to decode their intended messages. In particular, $R_1$ have access to three different equations in $u_1^1$ $u_1^2$ and $u_2$. The first one is obtained by subtracting $Y_1(3)$, from $Y_1(1)$ to cancel out the interference, the second and the third equations are $Y_1(2)$ and $Y_1(4)$ by themselves as they are received without interference. Similarly, $R_2$ forms its first equation by subtracting $h_{21}^{-1}(4)Y_2(4)$ from $(h_{22}(2)Y_2(1)- h_{22}(1)Y_2(2))$ to cancel out the interference while the second equation is $Y_2(3)$. \subsection{Distributed creation and combined resurrection} Let us consider the 2-user SISO X-channel with alternating CSIT given by $S_{12}^4 = (ND,ND,DN,PN)$. Here, we have the delayed CSIT are distributed over three time slots. Consequently, the interference creation phase consumes three time slots while the interference resurrection phase could be executed over only one time slots. The transmission strategy of this case are similar to case 1 but with minor modification concisely clarified below and the details of the transmission strategy are omitted for brevity. \textit{Phase one:} the first and second time slots of this phase are dedicated to the first receiver where the transmitters transmit two different linear combinations form the desired messages. The third time slot is dedicated to the second receiver where $T_1$ transmits $v_1$ and $T_2$ transmits $v_2$. \textit{Phase two}: This phase includes only the fourth time slot where the transmitters resurrect the formerly received interference terms $I_1(v_1,v_2)$, $I_2^1(u_1^1,u_2)$ and $I_2^2(u_1^2,u_2)$, while providing new linear combinations of the desired messages to the two receivers. Therefore, the transmitted signals from $T_1$ and $T_2$ is given by \begin{eqnarray} X_1(4)&\!\!\!=\!\!\!&h_{22}(2)h_{21}(1)u_1^1-h_{22}(1)h_{21}(2)u_2^2\nonumber \\ &\!\!\!+ \!\!\!&h_{11}^{-1}(4)h_{11}(3)v_1\\ X_2(4)&\!\!\!=\!\!\!&h_{12}^{-1}(4)h_{12}(3)v_2 \end{eqnarray} by the end of the fourth time slot, the two receivers $R_1$ and $R_2$ have enough information to decode their intended messages. For example, $R_1$ subtracts $Y_1(3)$ from $Y_1(4)$ to obtain the third equation in $u_1^1$ and $u_2^2$ while the first and second equations are $Y_1(1)$ and $Y_1(2)$ by themselves. \subsection{Distributed creation and distributed resurrection} Let us consider a 2-user SISO X-channel with CSIT pattern given by $S_{12}^4 = (ND,DN,PD,NN)$. Unlike the aforementioned cases, we have an overlap between the two phases in the third time slot where $S_{12}(3) = (PD)$ occurs. Consequently, the proposed scheme is performed in two overlapping phases as follows. \textit{Time slot 1:} The first sub-phase of phase one begins at $t=1$, and is dedicated to transmitting the desired messages of $R_1$, i.e., $T_1$ transmits $u_1^1$ while $T_2$ transmits $u_2$. Therefore, $R_1$ receives the first linear combination $L_1^1(u_1^1,u_2)$ of its desired signals, while $R_2$ receives only interference $I_2^1(u_1^1,u_2)$. \textit{Time slot 2}: The second sub-phase of phase one occurs at $t=2$, and is dedicated to transmitting the desired messages of $R_2$, i.e., $T_1$ transmits $v_1$ while $T_2$ transmits $v_2$. Therefore, $R_2$ receives linear combination $L_2^1(v_1,v_2)$ of its desired signals, while $R_1$ receives only interference $I_1(v_1,v_2)$. \textit{Time slot 3}: At $t=3$ the overlap occurs between the two phases. In particular, the second time slot of sub-phase one of phase one and sub-phase one of phase two begin simultaneously. In this time slot, sub-phase one of phase one creates interference at $R_2$ with while sub-phase one of phase two is designed to resurrect the interference term $I_1(v_1,v_2)$. The transmitted signals are given by: \begin{eqnarray} X_1(3)&\!\!\!=\!\!\!&u_1^2+h_{11}^{-1}(3)h_{11}(2)v_1 \\ X_2(3)&\!\!\!=\!\!\!&u_2+h_{12}^{-1}(3)h_{12}(2)v_2 \end{eqnarray} and the corresponding received signals are given by: \begin{eqnarray} Y_1(3)&\!\!\!=\!\!\!&h_{11}(3)u_1^2 + h_{12}(3)u_2 +h_{11}(2)v_1 + h_{12}(2)v_2 \nonumber \\ &\!\!\!\equiv\!\!\!& L_1^2(u_1^2,u_2)+I_1(v_1,v_2)\\ Y_2(3)&\!\!\!=\!\!\!& h_{21}(3)h_{11}^{-1}(3)h_{11}(2)v_1+h_{22}(3)h_{12}^{-1}(3)h_{12}(2)v_2 \nonumber \\ &\!\!\!+\!\!\!&h_{21}(3)u_1^2 + h_{22}(3)u_2\nonumber \\ &\!\!\!\equiv\!\!\!& L_2^2(v_1,v_2)+I_2^2(u_1^2,u_2) \end{eqnarray} Therefore, $R_2$ receives a new linear combination $L_2^2(v_1,v_2)$ of its desired signals and an interference term $I_2(u_1^2,u_2)$ as a by-product of the overlap, while $R_1$ receives the old interference $I_1(v_1,v_2)$ and the second linear combination $L_1^2(u_1^2,u_2)$ of its desired signals. \textit{Time slot 4}: The details of the transmission strategy are omitted for brevity as it is almost similar to the fourth time slot of case 1. Finally, the two receivers $R_1$ and $R_2$ have enough information to decode their intended messages. Similarly, $R_2$ its first equation is $Y_2(2)$ while forming its second equation by subtracting $h_{21}^{-1}(4)Y_2(4)$ from $(h_{22}(1)Y_2(3)- h_{22}(3)Y_2(1))$ to cancel out the interference. Noteworthy, this scheme could be used not only with the aforementioned cases but also with all the synergistic alternating CSIT patterns listed in Table 1. Also, It could be used with all the mirrored copy of the synergistic alternating CSIT patterns listed in Table 1 but with minor modification in the two phases where the two sub-phases in each phase swap their dedications from $R_1$ to $R_2$ and vise versa. \section{Main Results and Discussion} To the best of our knowledge, there are only three achievability results and fundamental bounds on the DoF for the 2-user SISO X-channel. In particular, $4/3$ DoF for 2-user SISO X-channel with perfect \cite{5208535}, $6/5$ DoF \cite {ghasemi2011degrees} and unity DoF \cite{6205390} for the same channel with delayed CSIT and no-CSIT, respectively. The poverty in the achievablility of DoF results in the context of X-channel compared with the other wireless channels encourage us to introduce new achievable results and hence $5/4$ DoF hits. In this section, we discuss CSIT alternation patterns that can provide synergistic gain for the DoF of the two-user SISO X-channel. We note that the aforementioned examples in Section \ref{Scheme} present the synergistic alternating CSIT patterns among four-symbol channel extension CSIT patterns of $\Lambda(1/8,3/8,1/2)$ sufficient to achieve $5/4$ DoF. \textit{Theorem 1:} The two-user SISO X-channel with synergistic alternating CSIT and the associated distribution of the fraction of time for the different CSIT availability states $\{P, D, N\}$ is $\Lambda(1/8,3/8,1/2)$, can achieve $5/4$ degrees of freedom almost surely. \begin{proof}[\textit{Proof:}\\] \textit{A. } \textit{Achievability:}\\ The achievability is provided in section \ref{Scheme}, and utilizes a simple linear coding scheme to achieve $5/4$. The coding scheme is based on the idea of reconstructing the interference formerly received exploiting the synergy of delayed CSIT followed by perfect CSIT to realize interference alignment at receivers. \textit{B. } \textit{Distribution:}\\ Here we show that the first requirement for Theorem 1; the associated distribution of the fraction of time for the CSIT availability states $\{P, D, N\}$ is $\Lambda(1/8,3/8,1/2)$, contains sufficient channel knowledge that allows the transmitters to steer their signals to perfectly align interference at the receivers. As mentioned before to achieve $5/4$ DoF we send $5$ different symbols $3$ for one receiver and $2$ for the other one over $4$-symbol channel extension. $\Lambda(1/8,3/8,1/2)$ contains only $1$ perfect CSIT, $3$ delayed CSIT and $4$ no-CSIT over $4$ time slots. Three delayed CSIT are sufficient in the interference creation phase to create $3$ different constructable interference terms and as a by-product $2$ different linear combination of desired symbols to one receiver and only one to the other one. Noteworthy, each delayed CSIT could be associated with no-CSIT in the interference creation phase as receiving interference at one receiver imply receiving desired signal at the other receiver. Finally, only one perfect CSIT is necessary to broadcast one old interference term reconstructed from distributed transmitters, i.e. $I_1(v_1,v_2)$, and only one no-CSIT to broadcast one old interference term reconstructed from one transmitter, i.e. $I_2(u_1^1,u_1^2)$. \textit{C. } \textit{Synergistic alternation:} \\ Although $\Lambda(1/8,3/8,1/2)$ contains sufficient channel knowledge to enable interference alignment, it is not sufficient by itself to do that. Hence, the synergistic alternation in CSIT arises to be a complementary condition to $\Lambda(1/8,3/8,1/2)$ to be a sufficient condition to realize the interference alignment and achieve $5/4$ DoF. There are three conditions for the synergistic alternation of CSIT for $\Lambda(1/8,3/8,1/2)$. The first condition is no delayed CSIT at the last time slot as it will be degraded to no-CSIT. The second condition is the delayed CSIT should followed by perfect CSIT for the same receiver. The third condition is the $S_{12} \in \{NN\}$ is prohibited in the interference creation phase. The first and second conditions yield six possible minimum states for the CSIT of the channel to the receiver interested in receiving $3$ symbols over four time slots; \small $S_i^4 \in \{\text{(N,N,D,P),(N,D,N,P),(D,N,N,P),(N,D,P,N),(D,N,P,N),(D,P,N,N)}\}$\normalsize, and three possible minimum states for the CSIT of the channel to the other receiver; $S_i^4 \in \{\text{(D,D,N,N), (D,N,D,N), (N,D,D,N)}\}$. As a result we have 18 possible combinations for the CSIT of the two-user channel. Eleven of these 18 combinations, satisfy the third condition and are listed as the first $11$ entries in Table 1 and the other excluded by the third condition are the dissociative ones .\\ \renewcommand{\qedsymbol}{$\blacksquare$} \end{proof} \begin{table}[!ht] \begin{tabular}{|l|p{.85 cm}||l|p{.85 cm}|} \hline CSIT pattern & Case & CSIT pattern & Case \\ \hline $(DD,ND,PN,NN)$ & 1& $(ND,DN,ND,PN)$ & 2\\ $(ND,DD,PN,NN)$ & 1& $(DN,ND,ND,PN)$ & 2\\ $(ND,DD,NN,PN)$ & 1& $(ND,DN,PD,NN)$ & 3\\ $(DD,ND,NN,PN)$ & 1& $(DN,ND,PD,NN)$ & 3\\ $(DD,PN,ND,NN)$ & 1& $(DN,PD,ND,NN)$ & 3\\ $(ND,ND,DN,PN)$ & 2& & \\ \hline \end{tabular}\\ \caption {the synergistic alternating CSIT patterns for $\Lambda(1/8,3/8,1/2)$ } \end{table} \textit{Remark 1:} \textbf{[Redundant Knowledge]} The first condition for achievability of $5/4$ DoF in Theorem 1 clarify that it requires alternating CSIT with $\Lambda(1/8,3/8,1/2)$. Definitely, any synergistic alternating CSIT pattern with higher distribution $\Lambda(\lambda_P \geq 1/8, \lambda_D \geq 3/8, \lambda_N \leq 1/2)$ can achieve $5/4$ DoF for SISO X-channel but with much redundant channel knowledge. Although we showed that $\Lambda(1/8,3/8,1/2)$ provide zero redundant channel knowledge for the achievable scheme in section \ref{Scheme}, it still unproven that $\Lambda(1/8,3/8,1/2)$ is the minimum distribution sufficient for synergistic alternating pattern to achieve $5/4$ or not. \textit{Remark 2:} \textbf{[Synergistic alternation pattern ]} The CSIT alternation pattern listed in Table I are called synergistic patterns as they could interact together in a cooperative way to provide a DoF gain strictly greater that their individual DoF for the same network. For alternating CSIT with $\Lambda(1/8,3/8,1/2)$, if there is no interaction between the different CSIT states over four time slots, the DoF that could be achieved are $\frac{1}{8} \frac{4}{3} + \frac{3}{8} \frac{6}{5} + \frac{1}{2}= \frac{67}{60}$ which is strictly lower than $5/4$. \\ \textit{Remark 3:} \textbf{[Blind creation]} The third condition for the synergistic CSIT alternation patterns of $\Lambda(1/8,3/8,1/2)$ excludes seven CSIT alternation patterns where the synergy in alternation could not achieve $5/4$. The main common factor of the seven dissociative patterns is the existence of combined no-CSIT, i.e. $S_{12}= NN$, at the interference creation phase, i.e. $S_i^4 =(NN, ND, DD, PN)$. As mentioned before, the strategy of interference creation phase is to create interference for the receiver who can provide the transmitters with CSIT either perfect or delayed to enable the transmitters to reconstruct the interference in the interference resurrection phase. Then, combined no-CSIT is useless at interference creation phase as it provides nothing to transmitters and hence the transmitters blindly create interference. \section{Conclusion} We obtained new achievable results on the degrees of freedom of the X-channel with alternating CSIT under certain distribution of CSIT availability states. The achieved DoF under alternating CSIT assumption are strictly greater than the DoF of the same channel under delayed and no-CSIT assumptions. By developing new transmission strategy, the usefulness of perfect CSIT when available following delayed CSI has been illustrated. \bibliographystyle {IEEEtran}
{'timestamp': '2014-08-01T02:08:03', 'yymm': '1407', 'arxiv_id': '1407.8348', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8348'}
arxiv
\section{Introduction} An interesting concept for next generation of radars is multiple-input multiple-output (MIMO) radar systems; this has been an active area of research for the last couple of years \cite{LS08}. MIMO radars have been classified into widely-spaced \cite{HBC08}, where antenna elements are placed widely apart, and colocated \cite{LS07}, where antenna elements are placed next to each other. MIMO radars can transmit multiple signals, via its antenna elements, that can be different from each other, thus, resulting in waveform diversity. This gives MIMO radars an advantage over traditional phased-array radar systems which can only transmit scaled versions of single waveform and, thus, can't exploit waveform diversity. Waveforms with constant-envelope (CE) are very desirable, in radar and communication system, from an implementation perspective, i.e., they allow power amplifiers to operate at or near saturation levels. CE waveforms are also popular due to their ability to be used with power efficient class C and class E power amplifiers and also with linear power amplifiers with no average power back-off into power amplifier. As a result, various researchers have proposed CE waveforms for communication systems; for example, CE multi-carrier modulation waveforms \cite{TS02}, such as CE orthogonal frequency division multiplexing (CE-OFDM) waveforms \cite{TAP+08}; and radar systems, for example, CE waveforms \cite{SLZ08}, CE binary-phase shift keying (CE-BPSK) waveforms \cite{ATPM11_FACE}, and CE quadrature-phase shift keying (CE-QPSK) waveforms \cite{SHC+14}. Existing radar systems, depending upon their type and use, can be deployed any where between 3 MHz to 100 GHz of radio frequency (RF) spectrum. In this range, many of the bands are very desirable for international mobile telecommunication (IMT) purposes. For example, portions of the 700-3600 MHz band are in use by various second generation (2G), third generation (3G), and fourth generation (4G) cellular standards throughout the world. It is expected that mobile traffic volume will continue to increase as more and more devices will be connected to wireless networks. The current allocation of spectrum to wireless services is inadequate to support the growth in traffic volume. A solution to this spectrum congestion problem was presented in a report by President's Council of Advisers on Science and Technology (PCAST), which advocated to \textit{share} 1000 MHz of government-held spectrum \cite{PCAST12}. As a result, in the United States (U.S.), regulatory efforts are underway, by the Federal Communications Commission (FCC) along with the National Telecommunications and Information Administration (NTIA), to share government-held spectrum with commercial entities in the frequency band 3550-3650 MHz \cite{FCC12_SmallCells}. In the U.S., this frequency band is currently occupied by various services including radio navigation services by radars. The future of spectrum sharing in this band depends on novel interference mitigation methods to protect radars and commercial cellular systems from each others' interference \cite{SKA+14, Mo_radar, Awais_MILCOM}. Radar waveform design with interference mitigation properties is one way to address this problem, and this is the subject of this paper. \subsection{Related Work} Transmit beampattern design problem, to realize a given covariance matrix subject to various constraints, for MIMO radars is an active area of research; many researchers have proposed algorithms to solve this beampattern matching problem. Fuhrmann et al. proposed waveforms with arbitrary cross-correlation matrix by solving beampattern optimization problem, under the constant-modulus constraint, using various approaches \cite{FS08}. Aittomaki et al. proposed to solve beampattern optimization problem under the total power constraint as a least squares problem \cite{AK07}. Gong et al. proposed an optimal algorithm for omnidirectional beampattern design problem with the constraint to have sidelobes smaller than some predetermined threshold values \cite{GST14}. Hua et al. proposed transmit beampatterns with constraints on ripples, within the energy focusing section, and the transition bandwidth \cite{HA13}. However, many of the above approaches don't consider designing waveforms with finite alphabet and constant- envelope property, which is very desirable from an implementation perspective. Ahmed et al. proposed a method to synthesize covariance matrix of BPSK waveforms with finite alphabet and constant-envelope property \cite{ATPM11_FACE}. They also proposed a similar solution for QPSK waveforms but it didn't satisfy the constant-envelope property. A method to synthesize covariance matrix of QPSK waveforms with finite alphabet and constant-envelope property was proposed by Sodagari et al. \cite{SHC+14}. However, they did not prove that such a method is possible. We prove the result in this paper and show that it is possible to synthesize covariance matrix of QPSK waveforms with finite alphabet and constant-envelope property. As introduced earlier due to the congestion of frequency bands future communication systems will be deployed in radar bands. Thus, radars and communication systems are expected to share spectrum without causing interference to each other. For this purpose, radar waveforms should be designed in such a way that they not only mitigate interference to them but also mitigate interference by them to other systems \cite{SKC+12, KAC+14ICNC}. Transmit beampattern design by considering the spectrum sharing constraints is a fairly new problem. Sodagari et al. have proposed BPSK and QPSK transmit beampatterns by considering the constraint that the designed waveforms do not cause interference to a single communication system \cite{SHC+14}. This approach was extended to multiple communication systems, cellular system with multiple base stations, by Khawar et al. for BPSK transmit beampatterns \cite{KAC14DySPANWaveform, KAC+14DySPANProjection}. We extend this approach and consider optimizing QPSK transmit beampatterns for a cellular system with multiple base stations. \subsection{Our Contributions} In this paper, we make contributions in the areas of: \begin{itemize} \item \textbf{Finite alphabet constant-envelope QPSK waveform:} In this area of MIMO radar waveform design, we make the following contribution: we prove that covariance matrix of finite alphabet constant-envelope QPSK waveform is positive semi-definite and the problem of designing waveform via solving a constrained optimization problem can be transformed into an un-constrained optimization problem. \item \textbf{MIMO radar waveform with spectrum sharing constraints:} We design MIMO radar waveform for spectrum sharing with cellular systems. We modify the newly designed QPSK radar waveform in a way that it doesn't cause interference to communication system. We design QPSK waveform by considering the spectrum sharing constraints, i.e., the radar waveform should be designed in such a way that a cellular system experiences zero interference. We consider two cases: first, stationary maritime MIMO radar is considered which experiences a stationary or slowly moving interference channel. For this type of radar, waveform is designed by including the constraints in the unconstrained nonlinear optimization problem, due to the tractability of the constraints. Second, we consider a moving maritime MIMO radar which experiences interference channels that are fast enough not to be included in the optimization problem due to their intractability. For this type of radar, FACE QPSK waveform is designed which is then projected onto the null space of interference channel before transmission. \end{itemize} \subsection{Organization} This paper is organized as follows. System model, which includes radar, communication system, interference channel, and cooperative RF environment model is discussed in Section \ref{sec:model}. Section \ref{sec:BP_prelim_FACE} introduces finite alphabet constant-envelope beampattern matching design problem. Section \ref{sec:QPSK_prelim} introduces QPSK radar waveforms and Section \ref{sec:QPSKproof} provides a proof of FACE QPSK waveform. Section \ref{sec:arch} discusses spectrum sharing architecture along with BS selection and projection algorithm. Section \ref{sec:nsp} designs QPSK waveforms with spectrum sharing constraints for stationary and moving radar platforms. Section \ref{sec:simulation} discusses simulation setup and results. Section \ref{sec:conclude} concludes the paper. \renewcommand{\arraystretch}{1.5} \begin{table} \centering \caption{Table of Notations} \begin{tabular}{ll} \topline \headcol Notation &Description\\ \midline $\mbfwt x(n)$ &Transmitted QPSK radar waveform\\ \rowcol $\mbf a(\theta_k)$ &Steering vector to steer signal to target angle $\theta_k$\\ $\mbfwt r_k(n)$ &Received radar waveform from target at $\theta_k$\\ \rowcol $\mbfwt R$ &Correlation matrix of QPSK waveforms\\ $\mbf s_j(n)$ &Signal transmitted by the $j^{\text{th}}$ UE in the $i^{\text{th}}$ cell\\ \rowcol $\mc L_i$ &Total number of user equipments (UEs) in the $i^{\text{th}}$ cell \\ $\mc K$ &Total number of BSs \\ \rowcol $M$ &Radar transmit/receive antennas \\ $N_{\text{BS}}$ &BS transmit/receive antennas \\ \rowcol $N_{\text{UE}}$ &UE transmit/receive antennas \\ $\mbf H_i$ &$i^{\text{th}}$ interference channel\\ \rowcol $H_n$ &Hermite Polynomial\\ $\mbf y_i(n)$ &Received signal at the $i^{\text{th}}$ BS\\ \rowcol $\mbf P_i$ &Projection matrix for the $i^{\text{th}}$ channel \\ \hline \end{tabular} \label{tab:Notations} \end{table} \subsection{Notations} Bold upper case letters, $\textbf{A}$, denote matrices while bold lower case letters, $\textbf{a}$, denote vectors. The $m^{\text{th}}$ column of matrix is denoted by $\textbf{a}_m$. For a matrix $\textbf{A}$, the conjugate and conjugate transposition are respectively denoted by $\textbf{A}^{\star}$ and $\textbf{A}^{H}$. The $m^{\text{th}}$ row and $n^{\text{th}}$ column element is denoted by $\textbf{A}(m,n)$. Real and complex, vectors and matrices are denoted by operators $\Re (\cdot)$ and $\Im (\cdot)$, respectively. A summary of notations is provided in Table \ref{tab:Notations}. \section{System Model}\label{sec:model} In this section, we introduce our system models for MIMO radar and cellular system. In addition, we introduce the cooperative RF sharing environment between radar and cellular system along with the definition of interference channel. \subsection{Radar Model}\label{sec:radar} We consider waveform design for a colocated MIMO radar mounted on a ship. The radar has $M$ colocated transmit and receive antennas. The inter-element spacing between antenna elements is on the order of half the wavelength. The radars with colocated elements give better spatial resolution and target parameter estimation as compared to radars with widely spaced antenna elements \cite{LS07, HBC08}. \subsection{Communication System} We consider a MIMO cellular system, with $\mc K$ base stations, each equipped with $N_{\text{BS}}$ transmit and receive antennas, with the $i^{\text{th}}$ BS supporting $\mc L_i$ user equipments (UEs). Moreover, the UEs are also multi-antenna systems with $N_{\text{UE}}$ transmit and receive antennas. If $\mbf s_j(n)$ is the signals transmitted by the $j^{\text{th}}$ UE in the $i^{\text{th}}$ cell, then the received signal at the $i^{\text{th}}$ BS receiver can be written as \begin{align}\label{eqn:RxPureComm} \mbf y_i(n) = \sum_j \mbf H_{i,j} \: \mbf s_{j}(n) + \mbf w(n), \quad \, \, \text{for} \, \, 1 \leq i \leq \mc K \, \, \text{and} \, \, 1 \leq j \leq \mc L_i \nonumber \end{align} where $\mbf H_{i,j}$ is the channel matrix between the $i^{\text{th}}$ BS and the $j^{\text{th}}$ user and $\mbf w(n)$ is the additive white Gaussian noise. \subsection{Interference Channel} In our spectrum sharing model, radar shares $\mc K$ interference channels with cellular system. Let's define the $i^{\text{th}}$ interference channel as \begin{equation}\label{Rx} \mbf H_{i} \triangleq \begin{bmatrix} h_i^{(1,1)} &\cdots &h_i^{(1,M)} \\ \vdots &\ddots &\vdots \\ h_i^{(N^{\text{BS}},1)} &\cdots &h_i^{(N^{\text{BS}},M)} \end{bmatrix} \quad (N_{\text{BS}} \times M) \end{equation} where $i=1, 2, \ldots, \mc K,$ and $h_i^{(l,k)}$ denotes the channel coefficient from the $k^{\text{th}}$ antenna element at the MIMO radar to the $l^{\text{th}}$ antenna element at the $i^{\text{th}}$ BS. We assume that elements of $\mbf H_i$ are independent, identically distributed (i.i.d.) and circularly symmetric complex Gaussian random variables with zero-mean and unit-variance, thus, having a i.i.d. Rayleigh distribution. \subsection{Cooperative RF Environment} Spectrum sharing between radars and communication systems can be envisioned in two types of RF environments, i.e., military radars sharing spectrum with military communication systems, we characterize it as \textit{Mil2Mil} sharing and military radars sharing spectrum with commercial communication systems, we characterize it as \textit{Mil2Com} sharing. In \textit{Mil2Mil} or \textit{Mil2Com} sharing, interference-channel state information (ICSI) can be provided to radars via feedback by military/commercial communication systems, if both systems are in a frequency division duplex (FDD) configuration \cite{TV05}. If both systems are in a time division duplex configuration, ICSI can be obtained via exploiting channel reciprocity \cite{TV05}. Regardless of the configuration of radars and communication systems, there is the incentive of zero interference, from radars, for communication systems if they collaborate in providing ICSI. Thus, we can safely assume the availability of ICSI for the sake of mitigating radar interference at communication systems. \section{Finite Alphabet Constant-Envelope Beampattern Design}\label{sec:BP_prelim_FACE} In this paper, we design QPSK waveforms having finite alphabets and constant-envelope property. We consider a uniform linear array (ULA) of $M$ transmit antennas with inter-element spacing of half-wavelength. Then, the transmitted QPSK signal is given as \begin{equation} \mbfwt x(n) = \begin{bmatrix} \wt x_1(n) &\wt x_2(n) &\cdots &\wt x_M(n) \end{bmatrix}^T \end{equation} where $\wt x_m(n)$ is the QPSK signal from the $m^{\text{th}}$ transmit element at time index $n$. Then, the received signal from a target at location $\theta_k$ is given as \begin{equation}\label{eqn:rxsignal} \wt r_k(n) = \sum_{m=1}^{M}{e^{-j(m-1)\pi \sin\theta_k} \wt x_m(n)}, \quad k = 1,2, ...,K, \end{equation} where $K$ is the total number of targets. We can write the received signal compactly as \begin{equation} \wt r_k(n) = \mbf{a}^H(\theta_k)\mbfwt{x}(n) \end{equation} where $\mbf a(\theta_k)$ is the steering vector defined as \begin{equation} \mbf a(\theta_k) = \begin{bmatrix} 1 &e^{-j\pi \sin\theta_k} &\cdots &e^{-j(M-1)\pi \sin\theta_k}\end{bmatrix}^T. \end{equation} We can write the power received at the target located at $\theta_k$ as \begin{equation} \begin{aligned} P(\theta_k) & = \mathbb{E}\{\mbf{a}^H(\theta_k)\, \mbfwt{x}(n)\, \mbfwt{x}^H(n)\, \mbf{a}(\theta_k)\} \\ & = \mbf{a}^H(\theta_k)\, \mbfwt{R} \, \mbf{a}(\theta_k) \end{aligned} \end{equation} where $\mbfwt {R}$ is correlation matrix of the transmitted QPSK waveform. The desired QPSK beampattern $\phi(\theta_k)$ is formed by minimizing the square of the error between $P(\theta_k)$ and $\phi(\theta_k)$ through a cost function defined as \begin{equation}\label{eqn:obj_fn} J(\mbfwt {R}) = \frac{1}{K}\sum_{k=1}^{K}{\Big(\mbf{a}^H(\theta_k)\, \mbfwt{R}\, \mbf{a}(\theta_k)-\phi(\theta_k)\Big)^2}. \end{equation} Since, $\mbfwt R$ is covariance matrix of the transmitted signal it must be positive semi-definite. Moreover, due to the interest in constant-envelope property of waveforms, all antennas must transmit at the same power level. The optimization problem in equation \eqref{eqn:obj_fn} has some constraints and, thus, can't be chosen freely. In order to design finite alphabet constant-envelope waveforms, we must satisfy the following constraints: \begin{align*} C_1: \, &\mbf v^H \mbfwt{R} \mbf v \geq 0, \qquad \qquad \; \; \; \forall \: \mbf v, \\ C_2: \, &\mbfwt{R} (m,m) = c, \qquad \qquad m=1,2, \ldots, M, \end{align*} where $C_1$ satisfies the `positive semi-definite' constraint and $C_2$ satisfies the `constant-envelope' constraint. Thus, we have a constrained nonlinear optimization problem given as \begin{equation}\label{eqn:opt_const_smallR} \begin{aligned} & \underset{\mbfwt{R}}{\text{min}} & & \frac{1}{K}\sum_{k=1}^{K}{\Big(\mbf{a}^H(\theta_k) \, \mbfwt{R} \, \mbf{a}(\theta_k)-\phi(\theta_k)\Big)^2} \\ & \text{subject to} & & \mbf{v}^H\mbfwt{R}\mbf v \geq 0, \;\;\;\;\;\;\;\; \forall \:\mbf{v},\\ & & & \mbfwt{R}(m,m) = c, \;\;\;\;\; m = 1,2, ...,M. \end{aligned} \end{equation} Ahmed et al. showed that, by using multi-dimensional spherical coordinates, this constrained nonlinear optimization can be transformed into an unconstrained nonlinear optimization \cite{ATPM11_UnconstSynthesis}. Once $\mbfwt{R} $ is synthesized, the waveform matrix $\mbfwt X$ with $N$ samples is given as \begin{equation} \mbfwt X = \begin{bmatrix} \mbfwt x(1) &\mbfwt x(2) &\cdots &\mbfwt x(N) \end{bmatrix}^T. \end{equation} This can be realized from \begin{equation} \mbfwt X = \bsym{\mathcal{X}} \bsym \Lambda^{1/2} \mbf W^H \label{eqn:GaussX} \end{equation} where $\bsym{\mathcal{X}} \in \mathcal{C}^{N \times M}$ is a matrix of zero mean and unit variance Gaussian random variables, $\bsym \Lambda \in \mathcal{R}^{M \times M}$ is the diagonal matrix of eigenvalues, and $\mbf W \in \mathcal{C}^{M \times M}$ is the matrix of eigenvectors of $\mbfwt{R} $ \cite{HKO01}. Note that $\mbfwt X$ has Gaussian distribution due to $\bsym{\mathcal{X}}$ but the waveform produced is not guaranteed to have the CE property. \section{Finite Alphabet Constant-Envelope QPSK Waveforms}\label{sec:QPSK_prelim} In \cite{SHC+14}, an algorithm to synthesize FACE QPSK waveforms to realize a given covariance matrix, $\mbfwt R$, with complex entries was presented. However, it was not proved that such a covariance matrix is positive semi-definite and the constrained nonlinear optimization problem can be transformed into an un-constrained nonlinear optimization problem, we prove the claim in this paper. Consider zero mean and unit variance Gaussian random variables (RVs) $\wt x_m$ and $\wt y_m$ that can be mapped onto a QPSK RV $\wt z_m$ through, as in \cite{SHC+14}, \begin{equation}\label{eqn:QPSK_RV} \wt z_m = \frac{1}{\sqrt{2}}\bigg[ \text{sign}(\wt x_m) + \jmath \, \text{sign} (\wt y_m) \bigg]. \end{equation} Then, it is straight forward to write the $(p,q)$th element of the complex covariance matrix as \begin{equation} \mbb E \{\wt z_p \wt z_q\} = \gamma_{pq} = \gamma_{\Re_{pq}} + \jmath \, \gamma_{\Im_{pq}} \end{equation} where $\gamma_{\Re_{pq}}$ and $\gamma_{\Im_{pq}}$ are the real and imaginary parts of $\gamma_{{pq}}$, respectively. If, Gaussian RVs $\wt x_p, \wt x_q, \wt y_p$, and $\wt y_q$ are chosen such that \begin{align}\label{eqn:ExpProperty} \mbb E \{\wt x_p \wt x_q\} &= \mbb E \{\wt y_p \wt y_q\} \nonumber \\ \mbb E \{\wt x_p \wt y_q\} &= - \mbb E \{\wt y_p \wt x_q\} \end{align} then we can write the real and imaginary parts of $\gamma_{pq}$ as \begin{align} \gamma_{\Re_{pq}} &= \mbb E \Big\{ \text{sign}(\wt x_p) \text{sign} (\wt x_q) \Big\} \nonumber \\ \gamma_{\Im_{pq}} &= \mbb E \Big\{ \text{sign}(\wt y_p)\text{sign} (\wt x_q) \Big\}\cdot \end{align} Then, from equation \eqref{eqn:ProofXcor} Appendix \ref{sec:ProofGaussian}, we have \begin{equation}\label{eqn:ExpectZpZq} \mbb E \{\wt z_p \wt z_q\} = \frac{2}{\pi} \Bigg[ \sin^{-1} \bigg(\mbb E \{\wt x_p \wt x_q\} \bigg) + \jmath \, \sin^{-1} \bigg(\mbb E \{\wt y_p \wt x_q\} \bigg) \Bigg]. \end{equation} The complex Gaussian covariance matrix $\mbfwt R_g$ is defined as \begin{equation} \mbfwt R_g \triangleq \Re ( \mbf R_g ) + \jmath \, \Im (\mbf R_g ) \label{eq:def_Rg} \end{equation} where $\Re ( \mbf R_g )$ and $\Im (\mbf R_g )$ both have real entries, since $\mbf R_g $ is a real Gaussian covariance matrix. Then, equation \eqref{eqn:ExpectZpZq} can be written as \begin{equation} \mbfwt R = \frac{2}{\pi} \bigg[ \sin^{-1} \Big( \Re ( \mbf R_g ) \Big) + \jmath \, \sin^{-1} \Big( \Im ( \mbf R_g ) \Big) \bigg]. \label{eqn:def_R} \end{equation} In \cite{SHC+14}, it is proposed to construct complex Gaussian covariance matrix via transform $\mbfwt R_g = \mbfwt U^H \mbfwt U$, where $\mbfwt U$ is given by equation \eqref{eqn:Utilda}. Then, $\mbfwt U$ can be written as \begin{equation} \mbfwt U = \Re (\mbfwt U) + \jmath \Im (\mbfwt U) \end{equation} where $\Re (\mbfwt U)$ and $\Im (\mbfwt U)$ are given by equations \eqref{eqn:realR} and \eqref{eqn:imagR}, respectively. Alternately, $\mbfwt R_g$ can also be expressed as \begin{align}\label{eqn:RgDefined} \mbfwt R_g = \bigg[\Re (\mbfwt U)^H \Re (\mbfwt U) + \Im (\mbfwt U)^H \Im (\mbfwt U)\bigg] +\jmath \, \bigg[ \Re (\mbfwt U)^H\Im (\mbfwt U)-\Im (\mbfwt U)^H\Re (\mbfwt U)\bigg]. \end{align} \begin{equation}\label{eqn:Utilda} \mbfwt U = \begin{pmatrix} e^{j \psi_1} &e^{j \psi_2} \sin(\psi_{21}) & e^{j \psi_3}\sin(\psi_{31})\sin(\psi_{32}) & \cdots & e^{j \psi_M}\prod_{m=1}^{M-1} \sin(\psi_{Mm}) \\ 0 &e^{j \psi_2} \cos(\psi_{21}) &e^{j \psi_3} \sin(\psi_{31})\cos(\psi_{32}) & \cdots &e^{j \psi_M} \prod_{m=1}^{M-2} \sin(\psi_{Mm})\cos(\psi_{M,M-1}) \\ 0 & 0 & e^{j \psi_3} \cos(\psi_{31}) & \ddots & \vdots \\ \vdots & \vdots & \ddots & \cdots &e^{j \psi_M} \sin(\psi_{M1})\cos(\psi_{M2}) \\ 0 & 0 & \cdots & \cdots &e^{j \psi_M} \cos(\psi_{M1}) \end{pmatrix} \end{equation} \begin{equation}\label{eqn:realR} \Re \big(\mbfwt U \big) = \begin{pmatrix} \cos(\psi_1) &\cos(\psi_2) \sin(\psi_{21}) &\cos(\psi_3) \sin(\psi_{31})\sin(\psi_{32}) &\cdots &\cos(\psi_M) \prod_{m=1}^{M-1} \sin(\psi_{Mm}) \\ 0 &\cos(\psi_2) \cos(\psi_{21}) &\cos(\psi_3) \sin(\psi_{31})\cos(\psi_{32}) & \cdots &\cos(\psi_M) \prod_{m=1}^{M-2} \sin(\psi_{Mm})\cos(\psi_{M,M-1}) \\ 0 & 0 &\cos(\psi_3) \cos(\psi_{31}) & \ddots & \vdots \\ \vdots & \vdots & \ddots & \cdots &\cos(\psi_M) \sin(\psi_{M1})\cos(\psi_{M2}) \\ 0 & 0 & \cdots & \cdots &\cos(\psi_M) \cos(\psi_{M1}) \end{pmatrix} \end{equation} \begin{equation}\label{eqn:imagR} \Im \big(\mbfwt U \big) = \begin{pmatrix} \sin(\psi_1) &\sin(\psi_2) \sin(\psi_{21}) &\sin(\psi_3) \sin(\psi_{31})\sin(\psi_{32}) &\cdots &\sin(\psi_M) \prod_{m=1}^{M-1} \sin(\psi_{Mm}) \\ 0 &\sin(\psi_2) \cos(\psi_{21}) &\sin(\psi_3) \sin(\psi_{31})\cos(\psi_{32}) & \cdots &\sin(\psi_M) \prod_{m=1}^{M-2} \sin(\psi_{Mm})\cos(\psi_{M,M-1}) \\ 0 & 0 &\sin(\psi_3) \cos(\psi_{31}) & \ddots & \vdots \\ \vdots & \vdots & \ddots & \cdots &\sin(\psi_M) \sin(\psi_{M1})\cos(\psi_{M2}) \\ 0 & 0 & \cdots & \cdots &\sin(\psi_M) \cos(\psi_{M1}) \end{pmatrix} \end{equation} \setcounter{theorem}{0} \begin{lemma} \label{L1} If $\mbf R_g$ is a covariance matrix and \begin{equation} \mbfwt R_g = \Re ( \mbf R_g ) + \jmath \, \Im (\mbf R_g ) \end{equation} then the complex covariance matrix $\mbfwt R_g$ will always be positive semi-definite. \end{lemma} \begin{proof} Please see Appendix \ref{app:Proofs}. \end{proof} Lemma \ref{L1} satisfies constraint $C_1$ and $\mbfwt R_g$ also satisfies constraint $C_2$ for $c=1$. This helps to transform constrained nonlinear optimization into unconstrained nonlinear optimization in the following section. In order to generate QPSK waveforms we define $N \times 2M$ matrix $\mbfwt S$, of Gaussian RVs, as \begin{equation} \mbfwt S \triangleq \begin{bmatrix}\mbfwt X &\mbfwt Y \end{bmatrix} \end{equation} where $\mbfwt X$ and $\mbfwt Y$ are of each size $N \times M$, representing real and imaginary parts of QPSK waveform matrix, which is given as \begin{equation} \mbfwt Z = \frac{1}{\sqrt{2}}\bigg[ \text{sign}(\mbfwt X) + \jmath \, \text{sign} (\mbfwt Y) \bigg]. \end{equation} The covariance matrix of $\mbfwt S$ is given as \begin{equation} \mbfwt R_{\mbfwt S} = \mbb E \{\mbfwt S^H \mbfwt S \} = \begin{bmatrix} \Re ( \mbf R_g ) &\Im ( \mbf R_g ) \\ -\Im ( \mbf R_g ) &\Re ( \mbf R_g ) \end{bmatrix}\cdot \end{equation} QPSK waveform matrix $\mbfwt Z$ can be realized by the matrix $\mbfwt S$ of Gaussian RVs which can be generated using equation \eqref{eqn:GaussX} by utilizing $\mbfwt R_{\mbfwt S}$. \section{Gaussian Covariance Matrix Synthesis for Desired QPSK Beampattern}\label{sec:QPSKproof} In this section, we prove that the desired QPSK beampattern can be directly synthesized by using the complex covariance matrix, $\mbfwt R_g$, for complex Gaussian RVs. This generates $M$ QPSK waveforms for the desired beampattern which satisfy the property of finite alphabet and constant-envelope. By exploiting the relationship between the complex Gaussian RVs and QPSK RVs we have \begin{equation}\label{eqn:def_RSecV} \mbfwt R = \frac{2}{\pi} \Bigg[ \sin^{-1} \bigg( \Re ( \mbf R_g ) \bigg) + \jmath \, \sin^{-1} \bigg( \Im ( \mbf R_g ) \bigg) \Bigg]. \end{equation} \begin{lemma} \label{L2} If $\mbfwt R_g$ is a complex covariance matrix and \begin{equation*} \mbfwt R = \frac{2}{\pi} \Bigg[ \sin^{-1} \bigg( \Re ( \mbf R_g ) \bigg) + \jmath \, \sin^{-1} \bigg( \Im ( \mbf R_g ) \bigg) \Bigg] \end{equation*} then $\mbfwt R$ will always be positive semi-definite. \end{lemma} \begin{proof} Please see Appendix \ref{app:Proofs}. \end{proof} Using equation \eqref{eqn:def_RSecV} we can rewrite the optimization problem in equation \eqref{eqn:opt_const_smallR} as \begin{equation}\label{eqn:opt_unct_smallR} \begin{aligned} & \underset{\mbfwt{R}}{\text{min}} & & \frac{1}{K} \sum_{k=1}^K \Bigg[ \frac{2}{\pi} \mbf a^H(\theta_k) \bigg\{\sin^{-1} \bigg(\Re (\mbf R_g)\bigg) + \jmath \sin^{-1} \bigg(\Im (\mbf R_g)\bigg) \bigg\} \mbf{a}(\theta_k)-\phi(\theta_k)\Bigg]^2 \\ & \text{subject to} & & \mbf{v}^H\mbfwt{R}\mbf v \geq 0, \;\;\;\;\;\;\;\; \forall \:\mbf{v},\\ & & & \mbfwt{R}(m,m) = c, \;\;\;\;\; m = 1,2, ...,M. \end{aligned} \end{equation} \begin{align}\label{eqn:JthetaDetailed} J (\bsym \Theta) = \frac{1}{K} \sum_{k=1}^K \Bigg[ \frac{2}{\pi} \mbf a^H(\theta_k) &\bigg\{\sin^{-1} \bigg(\Re (\mbfwt U)^H \Re (\mbfwt U)+ \Im (\mbfwt U)^H \Im (\mbfwt U)\bigg) \nonumber \\ &+\jmath \sin^{-1} \bigg( \Re (\mbfwt U)^H\Im (\mbfwt U)-\Im (\mbfwt U)^H\Re (\mbfwt U)\bigg) \bigg\}\mbf a^H(\theta_k) - \alpha \phi(\theta_k) \Bigg]^2 \end{align} Since, the matrix $\mbfwt U$ is already known, we can formulate $\mbfwt R_g$ via equation \eqref{eqn:RgDefined}. We can also write the $(p,q)$th element of the upper triangular matrix $\mbfwt R_g$ by first writing the $(p,q)$th element of the upper triangular matrix $\Re \big(\mbf R_g(p,q)\big)$ as \begin{align} \Re &\big(\mbf R_g(p,q)\big) = \begin{cases} \prod_{l=1}^{q-1} \sin (\Psi_{ql}) \prod_{s=1}^{p} \prod_{u=1}^{q} f(s,u), \, &p > q \\1, &p=q \end{cases} \end{align} where $f(s,u) = \cos (\Psi_{s}) \cos (\Psi_{u}) + \sin (\Psi_{s}) \sin (\Psi_{u})$; and the $(p,q)$th element of the upper triangular matrix $\Im \big(\mbf R_g(p,q)\big)$ as \begin{align} \Im \big(\mbf R_g(p,q)\big) &= \begin{cases} g(p,q) \prod_{l=1}^{q-1} \sin (\Psi_{ql}), &p > q \\0, &p=q \end{cases} \end{align} where $g(p,q) = \cos (\Psi_{p}) \sin (\Psi_{q}) + \sin (\Psi_{p}) \cos (\Psi_{q}) $. Thus, we can write the $(p,q)$th element of the upper triangular matrix $\mbfwt R_g$ as \begin{equation} \mbfwt R_g(p,q) = \begin{cases} \Re \big(\mbf R_g(p,q)\big) + \jmath \Im \big(\mbf R_g(p,q)\big), \, &p > q \\1, &p=q. \end{cases} \end{equation} By utilizing the information of $\mbfwt U$, the constrained optimization problem in equation \eqref{eqn:opt_unct_smallR} can be transformed into an unconstrained optimization problem that can be written as equation \eqref{eqn:JthetaDetailed}, where \begin{equation} \bsym \Theta = \begin{bmatrix} \bsym \Psi^T &\bsymwt \Psi^T &\alpha \end{bmatrix}^T, \end{equation} and \begin{align*} \bsym \Psi^T &= \begin{bmatrix} \Psi_{21} &\Psi_{21} &\cdots &\Psi_{21} \end{bmatrix}^T, \\ \bsymwt \Psi^T &= \begin{bmatrix} \Psi_{1} &\Psi_{2} &\cdots &\Psi_{M} \end{bmatrix}^T. \end{align*} The optimization is over $M(M-1)/2 +M$ elements $\Psi_{mn}$ and $\Psi_{l}$. The advantage of this approach lies in the free selection of elements of $\bsym \Theta$ without effecting the positive semi-definite property and diagonal elements of $\mbfwt R_g$. Noting that $\mbfwt U$ and $\mbfwt R_g$ are functions of $\bsym \Theta$, we can alternately write the cost-function, in equation \eqref{eqn:JthetaDetailed}, as \begin{align}\label{eqn:35} J (\bsym \Theta) &= \frac{1}{K} \sum_{k=1}^K \bigg[ \frac{2}{\pi} \mbf a^H(\theta_k) \sin^{-1} \Big(\Re (\mbf R_g)\Big) \mbf a(\theta_k) + \frac{2\jmath}{\pi} \mbf a^H(\theta_k) \sin^{-1} \Big(\Im (\mbf R_g)\Big) \mbf a(\theta_k) - \alpha \phi(\theta_k) \bigg]^2\cdot \end{align} First, the partial differentiation of $J (\bsym \Theta)$ with respect to any element of $\bsym \Psi$, say $\Psi_{mn}$, can be found as \begin{align}\label{eqn:partialJ} \frac{\partial J (\bsym \Theta) }{\partial \Psi_{mn}} =& \Bigg[ \frac{2}{K} \sum_{k=1}^K \bigg\{ \frac{2}{\pi} \mbf a^H(\theta_k) \sin^{-1} \big(\Re (\mbf R_g)\big) \mbf a(\theta_k) + \frac{2\jmath}{\pi} \mbf a^H(\theta_k) \sin^{-1} \big(\Im (\mbf R_g)\big) \mbf a(\theta_k) - \alpha \phi(\theta_k)\bigg\} \Bigg] \nonumber \\ &\times \Bigg[ \frac{\partial}{\partial \Psi_{mn}}\bigg\{ \frac{2}{\pi} \mbf a^H(\theta_k) \sin^{-1} \big(\Re (\mbf R_g)\big) \mbf a(\theta_k) + \frac{2\jmath}{\pi} \mbf a^H(\theta_k) \sin^{-1} \big(\Im (\mbf R_g)\big) \mbf a(\theta_k)\bigg\} \Bigg]\cdot \end{align} The matrix $\Re (\mbf R_g)$ is real and symmetric, i.e., $\Re \big(\mbf R_g(p,q)\big)=\Re \big(\mbf R_g(q,p)\big)$, at the same time, $\Im (\mbf R_g)$ has real entries but is skew-symmetric, i.e., $\Im \big(\mbf R_g(p,q)\big)=-\Im \big(\mbf R_g(q,p)\big)$. These observations enables us to write equation \eqref{eqn:partialJ} in a simpler form \begin{align}\label{eqn:1stSimplification1stElement} \frac{\partial J (\bsym \Theta)}{\partial \Psi_{mn}} =& \Bigg[ \frac{4}{K} \sum_{k=1}^K \bigg\{ \frac{2}{\pi} \mbf a^H(\theta_k) \sin^{-1} \big(\Re (\mbf R_g)\big) \mbf a(\theta_k) + \frac{2\jmath}{\pi} \mbf a^H(\theta_k) \sin^{-1} \big(\Im (\mbf R_g)\big) \mbf a(\theta_k) - \alpha \phi(\theta_k)\bigg\} \Bigg] \nonumber \\ &\times \Bigg[\frac{2}{\pi} \sum_{p=1}^{M-1} \sum_{q=p+1}^{M} \frac{\cos\big(\pi|p-q|\sin(\theta_k)\big)}{\sqrt{1-\Re \big(\mbf R_g^2(p,q)\big)}} \frac{\partial \Re \big(\mbf R_g(p,q)\big)}{\partial \Psi_{mn}} \Bigg]\cdot \end{align} Moreover, $\Re (\mbf R_g)$ contains only $(M-1)$ terms which depend on $\Psi_{mn}$, thus, equation \eqref{eqn:1stSimplification1stElement} further simplifies as \begin{align}\label{eqn:2ndSimplification1stElement} \frac{\partial J (\bsym \Theta)}{\partial \Psi_{mn}} =& \frac{8}{\pi K} \Bigg[ \sum_{k=1}^K \bigg\{ \frac{2}{\pi} \mbf a^H(\theta_k) \sin^{-1} \big(\Re (\mbf R_g)\big) \mbf a(\theta_k) + \frac{2\jmath}{\pi} \mbf a^H(\theta_k) \sin^{-1} \big(\Im (\mbf R_g)\big) \mbf a(\theta_k) - \alpha \phi(\theta_k)\bigg\} \Bigg] \nonumber \\ &\times \Bigg[\bigg\{ \sum_{p=1}^{m-1} \frac{\cos\big(\pi|p-m|\sin(\theta_k)\big)}{\sqrt{1-\Re \big(\mbf R_g^2(p,m)\big)}} \frac{\partial \Re \big(\mbf R_g(p,m)\big)}{\partial \Psi_{mn}} + \sum_{q=m+1}^{M} \frac{\cos\big(\pi|m-q|\sin(\theta_k)\big)}{\sqrt{1-\Re \big(\mbf R_g^2(m,q)\big)}} \frac{\partial \Re \big(\mbf R_g(m,q)\big)}{\partial \Psi_{mn}} \bigg\} \Bigg]. \end{align} Second, the partial differentiation of $J (\bsym \Theta)$ with respect to any element of $\bsymwt \Psi$, say $\Psi_l$, can be found in the same manner as was found for $\Psi_{mn}$, i.e., \begin{align}\label{eqn:2ndElement} \frac{\partial J (\bsym \Theta)}{\partial \Psi_{l}} =& \frac{8}{\pi K} \Bigg[ \sum_{k=1}^K \bigg\{ \frac{2}{\pi} \mbf a^H(\theta_k) \sin^{-1} \big(\Re (\mbf R_g)\big) \mbf a(\theta_k) + \frac{2\jmath}{\pi} \mbf a^H(\theta_k) \sin^{-1} \big(\Im (\mbf R_g)\big) \mbf a(\theta_k) - \alpha \phi(\theta_k)\bigg\} \Bigg] \nonumber \\ &\times \Bigg[ \sum_{p=1}^{M-1} \sum_{q=p+1}^{M} \frac{\cos\big(\pi|p-q|\sin(\theta_k)\big)}{\sqrt{1-\Re \big(\mbf R_g^2(p,q)\big)}} \frac{\partial \Re \big(\mbf R_g(p,q)\big)}{\partial \Psi_{l}} \Bigg]\cdot \end{align} Finally, the partial differentiation of $J (\bsym \Theta)$ with respect to $\alpha$ is \begin{align \frac{\partial J (\bsym \Theta)}{\partial \alpha} =\frac{-2 \phi(\theta_k)}{K} \Bigg[ \sum_{k=1}^K \bigg\{ \frac{2}{\pi} \mbf a^H(\theta_k) \sin^{-1} \big(\Re (\mbf R_g)\big) \mbf a(\theta_k) + \frac{2\jmath}{\pi} \mbf a^H(\theta_k) \sin^{-1} \big(\Im (\mbf R_g)\big) \mbf a(\theta_k) - \alpha \phi(\theta_k)\bigg\} \Bigg]. \end{align} \section{Radar-Cellular System Spectrum Sharing}\label{sec:arch} In the following sections, we will discuss our spectrum sharing architecture and spectrum sharing algorithms for the 3550-3650 MHz band under consideration, which is co-shared by MIMO radar and cellular systems. . \begin{figure} \centering \includegraphics[width=\linewidth]{scenario_detailed.eps} \caption{Spectrum Sharing Scenario: Seaborne MIMO radar sharing spectrum with a cellular system.} \label{fig:scenario} \end{figure} \subsection{Architecture} Considering the coexistence scenario in Fig. \ref{fig:scenario}, where the radar is sharing $\mc K$ interference channels with the cellular system, the received signal at the $i^{\text{th}}$ BS can be written as \begin{equation}\label{eqn:RxRadarComm} \mbf y_i(n) = \mbf H_i \mbfwt x(n) + \sum_j \mbf H_{i,j} \: \mbf s_{j}(n) + \mbf w(n) \end{equation} In order to avoid interference to the $i^{\text{th}}$ BS, the radar shapes its waveform $\mbfwt x(n)$ such that it is in the null-space of $\mbf H_i$, i.e. $\mbf H_i \mbfwt x(n) = \bsym 0$. \subsection{Projection Matrix} In this section, we formulate a projection algorithm to project the radar signal onto the null space of interference channel $\mbf H_i$. Assuming, the MIMO radar has ICSI for all $\mbf H_i$ interference channels, either through feedback or channel reciprocity, we can perform a singular value decomposition (SVD) to find the null space of $\mbf H_i$ and use it to construct a projector matrix. First, we find SVD of $\mbf H_i$, i.e., \begin{equation} \mbf H_i = \mbf U_i \bsym \Sigma_i \mbf V_i^H. \end{equation} Now, let us define \begin{equation} \bsymwt \Sigma_i \triangleq \text{diag} (\wt \sigma_{i,1}, \wt \sigma_{i,2}, \ldots, \wt \sigma_{i,p}) \end{equation} where $p \triangleq \min (N^{\text{BS}},M)$ and $\wt \sigma_{i,1} > \wt \sigma_{i,2} > \cdots > \wt \sigma_{i,q} > \wt \sigma_{i,q+1} = \wt \sigma_{i,q+2} = \cdots \wt \sigma_{i,p} = 0$. Next, we define \begin{equation} \bsymwt {\Sigma}_i^\prime \triangleq \text{diag} (\wt \sigma_{i,1}^\prime,\wt \sigma_{i,2}^\prime, \ldots, \wt \sigma_{i,M}^\prime) \end{equation} where \begin{align} \wt \sigma_{i,u}^\prime \triangleq \begin{cases} 0, \quad \text{for} \; u \leq q,\\ 1, \quad \text{for} \; u > q. \end{cases} \end{align} Using above definitions we can now define our projection matrix, i.e., \begin{equation}\label{eqn:ProjDefinition} \mbf P_i \triangleq \mbf V_i \bsymwt \Sigma_i^\prime \mbf V_i^H. \end{equation} Below, we show two properties of projection matrices showing that $\mbf P_i$ is a valid projection matrix. \setcounter{theorem}{0} \begin{property} $\mbf P_i \in \mbb C^{M \times M}$ is a projection matrix if and only if $\mbf P_i = \mbf P_i^H = \mbf P_i^2$. \end{property} \begin{proof} Let's start by showing the `only if' part. First, we show $\mbf P_i = \mbf P_i^H$. Taking Harmition of equation \eqref{eqn:ProjDefinition} we have \begin{equation}\label{eqn:Projhermitian} \mbf P_i^H = (\mbf V_i \bsymwt \Sigma_i^\prime \mbf V^H)^H = \mbf P_i. \end{equation} Now, squaring equation \eqref{eqn:ProjDefinition} we have \begin{equation}\label{eqn:ProjSquare} \mbf P_i^2 = \mbf V_i \bsymwt \Sigma_i \mbf V^H \times \mbf V_i \bsymwt \Sigma_i \mbf V^H = \mbf P_i \end{equation} where above equation follows from $ \mbf V^H \mbf V_i = \mbf I$ (since they are orthonormal matrices) and $(\bsymwt \Sigma_i^\prime)^2 =\bsymwt \Sigma_i^\prime$ (by construction). From equations \eqref{eqn:Projhermitian} and \eqref{eqn:ProjSquare} it follows that $\mbf P_i = \mbf P_I^H = \mbf P_i^2$. Next, we show $\mbf P_i$ is a projector by showing that if $\mbf v \in$ range ($\mbf P_i$), then $\mbf P_i \mbf v = \mbf v$, i.e., for some $\mbf w, \mbf v = \mbf P_i \mbf w$, then \begin{equation} \mbf P_i \mbf v = \mbf P_i (\mbf P_i \mbf w) = \mbf P_i^2 \mbf w = \mbf P_i \mbf w = \mbf v. \end{equation} Moreover, $\mbf P_i \mbf v - \mbf v \in$ null($\mbf P_i$), i.e., \begin{equation} \mbf P_i (\mbf P_i \mbf v - \mbf v) = \mbf P_i^2 \mbf v -\mbf P_i \mbf v = \mbf P_i \mbf v - \mbf P_i \mbf v = \mbf 0. \end{equation} This concludes our proof. \end{proof} \begin{property} $\mbf P_i \in \mbb C^{M\times M}$ is an orthogonal projection matrix onto the null space of $\mbf H_i \in \mbb C^{N^{\text{BS}}\times M}$ \end{property} \begin{proof} Since $\mbf P_i = \mbf P_i^H$, we can write \begin{equation} \mbf H_i \mbf P_i^H = \mbf U_i \bsymwt \Sigma_i \mbf V_i^H \times \mbf V_i \bsymwt \Sigma_i^\prime \mbf V^H = \bsym 0. \end{equation} The above results follows from noting that $\bsymwt \Sigma_i \bsymwt \Sigma_i^\prime = \bsym 0$ by construction. \end{proof} The formation of projection matrix in the waveform design process is presented in the form of Algorithm \ref{alg:Proj}. \begin{algorithm} \caption{Projection Algorithm}\label{alg:Proj} \begin{algorithmic} \IF {$\mbf H_i$ received from waveform design algorithm} \STATE{Perform SVD on $\mbf H_i$ (i.e. $\mbf H_i=\mbf U_i \bsym \Sigma_i \mbf V_i^H$)} \STATE{Construct $\bsymwt \Sigma_i = \text{diag} (\wt \sigma_{i,1}, \wt \sigma_{i,2}, \ldots, \wt \sigma_{i,p})$} \STATE{Construct $\bsymwt {\Sigma}_i^\prime = \text{diag} (\wt \sigma_{i,1}^\prime,\wt \sigma_{i,2}^\prime, \ldots, \wt \sigma_{i,M}^\prime)$} \STATE{Setup projection matrix $\mbf P_i = \mbf V_i \bsymwt \Sigma_i^\prime \mbf V_i^H$.} \STATE{Send $\mbf P_i$ to waveform design algorithm.} \ENDIF \end{algorithmic} \end{algorithm} \section{Waveform Design for Spectrum Sharing}\label{sec:nsp} In the previous section, we designed finite alphabet constant-envelope QPSK waveforms by solving a beampattern matching optimization problem. In this section, we extend the beampattern matching optimization problem and introduce new constraints in order to tailor waveforms that don't cause interference to communication systems when MIMO radar and communication systems are sharing spectrum. We design spectrum sharing waveforms for two cases: the first case is for a stationary maritime MIMO radar and the second case is for moving maritime MIMO radar. The waveform design in these contexts is and its performance is discussed in the next sections. \subsection{Stationary maritime MIMO radar}\label{sec:NSP_included} Consider a naval ship docked at the harbor. The radar mounted on top of that ship is also stationary. The interference channels are also stationary due to non-movement of ship and BSs. In such a scenario, the CSI has little to no variations and thus it is feasible to include the constraint of NSP, equation \eqref{eqn:ProjectedSignal}, into the optimization problem. Thus, the new optimization problem is formulated as \begin{align}\label{eqn:opt_unct_proj} \min_{\psi_{ij},\psi_l} &\frac{1}{K} \sum_{k=1}^K \Bigg[ \frac{2}{\pi} \mbf a^H(\theta_k) \mbf P_i \bigg\{\sin^{-1} \bigg(\Re (\mbfwt U)^H \Re (\mbfwt U) + \Im (\mbfwt U)^H \Im (\mbfwt U)\bigg) + \jmath \sin^{-1} \bigg( \Re (\mbfwt U)^H\Im (\mbfwt U)&-\Im (\mbfwt U)^H\Re (\mbfwt U)\bigg) \bigg\} \nonumber \\ &\times \mbf P_i^H \mbf a^H(\theta_k) - \alpha \phi(\theta_k) \Bigg]^2\cdot \end{align} A drawback of this approach is that it does not guarantee to generate constant-envelope radar waveform. However, the designed waveform is in the null space of the interference channel, thus, satisfying spectrum sharing constraints. The waveform generation process is shown using the block diagram of Figure \ref{fig:block_in_opt}. Note that, $\mc K$ waveforms are designed, as we have $\mc K$ interference channels that are static. Using the projection matrix $\mbf P_i$, the NSP projected waveform can be obtained as \begin{equation}\label{eqn:ProjectedSignal} \breve{\mbfwt Z}_{\text{NSP}}^{\text{opt}} = \mbfwt Z_i^{\text{opt}} \mbf P_i^H. \end{equation} The correlation matrix of the NSP waveform is given as \begin{equation} \breve{\mbfwt R}_i = \frac{1}{N} \left(\breve{\mbfwt Z}_{\text{NSP}}^{\text{opt}}\right)^H \breve{\mbfwt Z}_{\text{NSP}}^{\text{opt}} . \end{equation} We propose to select the transmitted waveform with covariance matrix $\breve{\mbfwt R}_i$ is as close as possible to the desired covariance matrix, i.e., \begin{align} i_{\text{min}} &\triangleq \argmin_{1 \leq i \leq \mc K} \Bigg[ \frac{1}{K}\sum_{k=1}^{K}{\Big(\mbf{a}^H(\theta_k)\, \breve{\mbfwt{R}}_i\, \mbf{a}(\theta_k)-\phi(\theta_k)\Big)^2} \Bigg]\\ {\mbfwt R}_{\text{NSP}}^{\text{opt}} &\triangleq \breve{\mbfwt R}_{i_{\text{min}}}. \end{align} Equivalently, we select $\mbf P_i$ which projects maximum power at target locations. Thus, for stationary MIMO radar waveform with spectrum sharing constraints we propose Algorithm \eqref{alg:Stationary_Waveform}. \begin{figure}[t] \centering \includegraphics[width=3.4in]{block_in_opt.eps} \caption{Block diagram of waveform generation process for a stationary MIMO radar with spectrum sharing constraints.} \label{fig:block_in_opt} \end{figure} \begin{algorithm} \caption{Stationary MIMO Radar Waveform Design Algorithm with Spectrum Sharing Constraints}\label{alg:Stationary_Waveform} \begin{algorithmic} \LOOP \FOR{$i=1:\mc K$} \STATE{Get CSI of $\mbf H_i$ through feedback from the $i^{\text{th}}$ BS.} \STATE{Send $\mbf H_i$ to Algorithm \eqref{alg:Proj} for the formation of projection matrix $\mbf P_i$.} \STATE{Receive the $i^{\text{th}}$ projection matrix $\mbf P_i$ from Algorithm \eqref{alg:Proj}.} \STATE{Design QPSK waveform $\mbfwt Z_i^{\text{opt}}$ using the optimization problem in equation \eqref{eqn:opt_unct_proj}.} \STATE{Project the QPSK waveform onto the null space of $i^{\text{th}}$ interference channel using $\breve{\mbfwt Z}_{\text{NSP}}^{\text{opt}} = \mbfwt Z_i^{\text{opt}} \mbf P_i^H$.} \ENDFOR \STATE{Find {$i_{\text{min}} = \argmin\limits_{1 \leq i \leq \mc K} \Bigg[ \dfrac{1}{K}\sum_{k=1}^{K}{\Big(\mbf{a}^H(\theta_k)\, \breve{\mbfwt{R}}_i\, \mbf{a}(\theta_k)-\phi(\theta_k)\Big)^2} \Bigg]$.}} \STATE{Set ${\mbfwt R}_{\text{NSP}}^{\text{opt}} = \breve{\mbfwt R}_{i_{\text{min}}}$ as the covariance matrix of the desired NSP QPSK waveforms to be transmitted.} \ENDLOOP \end{algorithmic} \end{algorithm} \begin{figure}[t] \centering \includegraphics[width=3.4in]{block_out_opt.eps} \caption{Block diagram of waveform generation process for a moving MIMO radar with spectrum sharing constraints.} \label{fig:block_out_opt} \end{figure} \subsection{Moving maritime MIMO radar}\label{sec:NSP_after} Consider the case of a moving naval ship. The radar mounted on top of the ship is also moving, thus, the interference channels are varying due to the motion of ship. Due to time-varying ICSI, it is not feasible to include the NSP in the optimization problem. For this case, we first design finite alphabet constant-envelope QPSK waveforms, using the optimization problem in equation \eqref{eqn:JthetaDetailed}, and then use NSP to satisfy spectrum sharing constraints using transform \begin{equation}\label{eqn:QPSK_NSP_waveform} \breve{\mbfwt{Z}}_{i} = \mbfwt{Z}\mbf{P}_{i}^H. \end{equation} The waveform generation process is shown using the block diagram of Figure \ref{fig:block_out_opt}. Note that only one waveform is designed using the optimization problem in equation \eqref{eqn:JthetaDetailed} but $\mc K$ projection operations are performed via equation \eqref{eqn:QPSK_NSP_waveform}. The transmitted waveform is selected on the basis of minimum Forbenius norm with respect to the designed waveform using the optimization problem in equation \eqref{eqn:JthetaDetailed}, i.e., \begin{align} i_{\text{min}} &\triangleq \argmin_{1 \leq i \leq \mc K} || \mbfwt Z \mbf P_i^H - \mbfwt Z ||_F \\ \breve{\mbfwt Z}_{\text{NSP}} &\triangleq \breve{\mbfwt Z}_{i_{\text{min}}}. \end{align} The correlation matrix of this transmitted waveform is given as \begin{equation} {\mbfwt R}_{\text{NSP}} = \frac{1}{N} \breve{\mbfwt Z}_{\text{NSP}}^H \breve{\mbfwt Z}_{\text{NSP}}. \end{equation} Thus, for moving MIMO radar waveform with spectrum sharing constraints we propose Algorithm \eqref{alg:Moving_Waveform}. \begin{algorithm} \caption{Moving MIMO Radar Waveform Design Algorithm with Spectrum Sharing Constraints}\label{alg:Moving_Waveform} \begin{algorithmic} \STATE{Design FACE QPSK waveform $\mbfwt Z$ using the optimization problem in equation \eqref{eqn:JthetaDetailed}.} \LOOP \FOR{$i=1:\mc K$} \STATE{Get CSI of $\mbf H_i$ through feedback from the $i^{\text{th}}$ BS.} \STATE{Send $\mbf H_i$ to Algorithm \eqref{alg:Proj} for the formation of projection matrix $\mbf P_i$.} \STATE{Receive the $i^{\text{th}}$ projection matrix $\mbf P_i$ from Algorithm \eqref{alg:Proj}.} \STATE{Project the FACE QPSK waveform onto the null space of $i^{\text{th}}$ interference channel using $\breve{\mbfwt{Z}}_{i} = \mbfwt{Z}\mbf{P}_{i}^H$.} \ENDFOR \STATE{Find {$i_{\text{min}} = \argmin\limits_{1 \leq i \leq \mc K} || \mbfwt Z \mbf P_i^H - \mbfwt Z ||_F$.}} \STATE{Set ${\mbfwt R}_{\text{NSP}}$ as the covariance matrix of the desired NSP QPSK waveforms to be transmitted.} \ENDLOOP \end{algorithmic} \end{algorithm} \section{Simulation}\label{sec:simulation} In order to design QPSK waveforms with spectrum sharing constraints, we use a uniform linear array (ULA) of ten elements, i.e., $M=10$, with an inter-element spacing of half-wavelength. Each antenna transmits waveform with unit power and $N=100$ symbols. We average the resulting beampattern over 100 Monte-Carlo trials of QPSK waveforms. At each run of Monte Carlo simulation we generate a Rayleigh interference channel with dimensions $N_{\text{BS}} \times M$, calculate its null space, and solve the optimization problem for stationary and moving maritime MIMO radar. \subsection{Waveform for stationary radar} In this section, we design the transmit beampattern for a stationary MIMO radar. The desired beampattern has two main lobes from $-60^\circ$ to $-40^\circ$ and from $40^\circ$ to $60^\circ$. The QPSK transmit beampattern for stationary maritime MIMO radar is obtained by solving the optimization problem in equation \eqref{eqn:opt_unct_proj}. We give different examples to cover various scenarios involving different number of BSs and different configuration of MIMO antennas at the BSs. We also give one example to demonstrate the efficacy of Algorithms \eqref{alg:Proj} and \eqref{alg:Stationary_Waveform} in BS selection and its impact on the waveform design problem. \noindent \textbf{Example 1: Cellular System with five BSs and $\{3,5,7\}$ MIMO antennas and stationary MIMO radar} In this example, we design waveform for a stationary MIMO radar in the presence of a cellular system with five BSs. We look at three cases where we vary the number of BS antennas from $\{3,5,7\}$. In Figure \ref{fig:M10N3_stationary}, we show the designed waveforms for all five BSs each equipped with 3 MIMO antennas. Note that, due to channel variations there is a large variation in the amount of power projected onto target locations for different BSs. But for certain BSs, the projected waveform is close to the desired waveform. In Figure \ref{fig:M10N5_stationary}, we show the designed waveforms for all five BSs each equipped with 5 MIMO antennas. Similar to the previous case, due to channel variations there is a large variation in the amount of power projected onto target locations for different BSs. However, the power projected onto the target is less when compared with the previous case. We increase the number of antennas to $7$ in Figure \ref{fig:M10N7_stationary}, and notice that the amount of power projected onto the targets is least as compared to previous two cases. This is because when $N_{\text{BS}} \ll M$ we have a larger null space to project radar waveform and this results in the projected waveform closer to the desired waveform. However, when $N_{\text{BS}} < M$, this is not the case. \begin{figure} \centering \includegraphics[width=3.4in]{M10N3_stationary.eps} \caption{QPSK waveform for stationary MIMO radar, sharing RF environment with five BSs each equipped with \textit{three} antennas.} \label{fig:M10N3_stationary} \end{figure} \begin{figure} \centering \includegraphics[width=3.4in]{M10N5_stationary.eps} \caption{QPSK waveform for stationary MIMO radar, sharing RF environment with five BSs each equipped with \textit{five} antennas.} \label{fig:M10N5_stationary} \end{figure} \noindent \textbf{Example 2: Performance of Algorithms \eqref{alg:Proj} and \eqref{alg:Stationary_Waveform} in BS selection for spectrum sharing with stationary MIMO radar} In Examples 1, we designed waveforms for different number of BSs with different antenna configurations. As we showed, for some BSs the designed waveform was close to the desired waveform but for other it wasn't and the projected waveform was closer to the desired waveform when $N_{\text{BS}} \ll M$ then when $N_{\text{BS}} < M$. In Figure \ref{fig:QPSK_in_opt}, we use Algorithms \eqref{alg:Proj} and \eqref{alg:Stationary_Waveform} to select the waveform which projects maximum power on the targets or equivalently the projected waveform is closest to the desired waveform. We apply Algorithms \eqref{alg:Proj} and \eqref{alg:Stationary_Waveform} to the cases when $N_{\text{BS}} =\{3,5,7\}$ and select the waveform which projects maximum power on the targets. It can be seen that Algorithm \eqref{alg:Stationary_Waveform} helps us to select waveform for stationary MIMO radar which results in best performance for radar in terms of projected waveform as close as possible to the desired waveform in addition of meeting spectrum sharing constraints. \begin{figure} \centering \includegraphics[width=3.4in]{M10N7_stationary.eps} \caption{QPSK waveform for stationary MIMO radar, sharing RF environment with five BSs each equipped with \textit{seven} antennas.} \label{fig:M10N7_stationary} \end{figure} \begin{figure} \centering \includegraphics[width=3.4in]{QPSK_in_opt_all.eps} \caption{Algorithm \eqref{alg:Stationary_Waveform} is used to select the waveform which projects maximum power on the targets when $N_{\text{BS}} =\{3,5,7\}$ in the presence of five BSs.} \label{fig:QPSK_in_opt} \end{figure} \subsection{Waveform for moving radar} In this section, we design transmit beampattern for a moving MIMO radar. The desired beampattern has two main lobes from $-60^\circ$ to $-40^\circ$ and from $40^\circ$ to $60^\circ$. The QPSK transmit beampattern for moving maritime MIMO radar is obtained by solving the optimization problem in equation \eqref{eqn:35} and then projecting the resulting waveform onto the null space of ${\mbf H_i}$ using the projection matrix in equation \eqref{eqn:QPSK_NSP_waveform}. We give different examples to cover various scenarios involving different number of BSs and different configuration of MIMO antennas at the BSs. We also give one example to demonstrate the efficacy of Algorithms \eqref{alg:Proj} and \eqref{alg:Moving_Waveform} in BS selection and its impact on the waveform design problem. \noindent \textbf{Example 3: Cellular System with five BSs each with $\{3,5,7\}$ MIMO antennas and moving MIMO radar} \noindent In this example, we design waveform for a moving MIMO radar in the presence of a cellular system with five BSs. We look at three cases where we vary the number of BS antennas from $\{3,5,7\}$. In Figure \ref{fig:M10N3_mobile}, we show the designed waveforms for all five BSs each equipped with 3 MIMO antennas. Note that, due to channel variations there is a large variation in the amount of power projected onto target locations for different BSs. When compared with Figure \ref{fig:M10N3_stationary}, the power projected onto the target by NSP waveform is less due to the mobility of radar. In Figure \ref{fig:M10N5_mobile}, we show the designed waveforms for all five BSs each equipped with 5 MIMO antennas. Similar to the previous case, due to channel variations there is a large variation in the amount of power projected onto target locations for different BSs. However, the power projected onto the target is less when compared with the previous case. We increase the number of antennas to $7$ in Figure \ref{fig:M10N7_mobile}, and notice that the amount of power projected onto the targets is least as compared to previous two cases. This is because when $N_{\text{BS}} \ll M$ we have a larger null space to project radar waveform and this results in the projected waveform closer to the desired waveform. However, when $N_{\text{BS}} < M$, this is not the case. Moreover, due to mobility of the radar, the amount of power projected for all three cases considered in this example are less than the similar example considered for stationary radar. \begin{figure} \centering \includegraphics[width=3.4in]{M10N3_mobile.eps} \caption{QPSK waveform for moving MIMO radar, sharing RF environment with five BSs each equipped with \textit{three} antennas.} \label{fig:M10N3_mobile} \end{figure} \begin{figure} \centering \includegraphics[width=3.4in]{M10N5_mobile.eps} \caption{QPSK waveform for moving MIMO radar, sharing RF environment with five BSs each equipped with \textit{five} antennas.} \label{fig:M10N5_mobile} \end{figure} \textbf{Example 4: Performance of Algorithms \eqref{alg:Proj} and \eqref{alg:Moving_Waveform} in BS selection for spectrum sharing with moving MIMO radar} \noindent In Examples 3, we designed waveforms for different number of BSs with different antenna configurations. As we showed, for some BSs the designed waveform was close to the desired waveform but for other it wasn't and the projected waveform was closer to the desired waveform when $N_{\text{BS}} \ll M$ then when $N_{\text{BS}} < M$. In Figure \ref{fig:QPSK_after_opt}, we use Algorithms \eqref{alg:Proj} and \eqref{alg:Moving_Waveform} to select the waveform which has the least Forbenius norm with respect to the designed waveform. We apply Algorithms \eqref{alg:Proj} and \eqref{alg:Moving_Waveform} to the cases when $N_{\text{BS}} =\{3,5,7\}$ and select the waveform which has minimum Forbenius norm. It can be seen that Algorithm \eqref{alg:Moving_Waveform} helps us to select waveform for stationary MIMO radar which results in best performance for radar in terms of projected waveform as close as possible to the desired waveform in addition of meeting spectrum sharing constraints. \begin{figure} \centering \includegraphics[width=3.4in]{M10N7_mobile.eps} \caption{QPSK waveform for moving MIMO radar, sharing RF environment with five BSs each equipped with \textit{seven} antennas.} \label{fig:M10N7_mobile} \end{figure} \begin{figure} \centering \includegraphics[width=3.4in]{QPSK_after_opt_all.eps} \caption{Algorithm \eqref{alg:Moving_Waveform} is used to select the waveform which projects maximum power on the targets when $N_{\text{BS}} =\{3,5,7\}$ in the presence of five BSs.} \label{fig:QPSK_after_opt} \end{figure} \section{Conclusion}\label{sec:conclude} Waveform design for MIMO radar is an active topic of research in the signal processing community. This work addressed the problem of designing MIMO radar waveforms with constant-envelope, which are very desirable from practical perspectives, and waveforms which allow radars to share spectrum with communication systems without causing interference, which are very desirable for spectrum congested RF environments. In this paper, we first showed that it is possible to realize finite alphabet constant-envelope quadrature-pulse shift keying (QPSK) MIMO radar waveforms. We proved that such the covariance matrix for QPSK waveforms is positive semi-definite and the constrained nonlinear optimization problem can be transformed into an un-constrained nonlinear optimization problem, to realize finite alphabet constant-envelope QPSK waveforms. This result is of importance for both communication and radar waveform designs where constant-envelope is highly desirable. Second, we addressed the problem of radar waveform design for spectrally congested RF environments where radar and communication systems are sharing the same frequency band. We designed QPSK waveforms with spectrum sharing constraints. The QPSK waveform was shaped in a way that it is in the null space of communication system to avoid interference to communication system. We considered a multi-BS MIMO cellular system and proposed algorithms for the formation of projection matrices and selection of interference channels. We designed waveforms for stationary and moving MIMO radar systems. For stationary MIMO radar we presented an algorithm for waveform design by considering the spectrum sharing constraints. Our algorithm selected the waveform capable to project maximum power at the targets. For moving MIMO radar we presented another algorithm for waveform design by considering spectrum sharing constraints. Our algorithm selected the waveform with the minimum Forbenius norm with respect to the designed waveform. This metric helped to select the projected waveform closest to the designed waveform. \appendices \section{Preliminaries} \setcounter{theorem}{0} This section presents some preliminary results used in the proofs throughout the paper. For proofs of the following theorems, please see the corresponding references. \begin{theorem}\label{thm:R_psd} The matrix $\mbf A \in \mbb{C}^{n \times n}$ is positive semi-definite if and only if $\Re (\mbf A)$ is positive semi-definite \cite{Bern09}. \end{theorem} \begin{theorem} A necessary and sufficient condition for $\mbf A \in \mbb{C}^{n \times n}$ to be positive definite is that the Hermitian part \begin{equation*} \mbf A_H = \frac{1}{2} \left[ \mbf A + \mbf A^H \right] \end{equation*} be positive definite \cite{Bern09}. \end{theorem} \begin{theorem}\label{thm:sum_psd} If $\mbf A \in \mbb{C}^{n \times n}$ and $\mbf B \in \mbb{C}^{n \times n}$ are positive semi-definite matrices then the matrix $\mbf C = \mbf A + \mbf B$ is guaranteed to be positive semi-definite matrix \cite{HJ85}. \end{theorem} \begin{theorem}\label{thm:SchurProd} If the matrix $\mbf A \in \mbb{C}^{n \times n}$ is positive semi-definite then the $p$ times Schur product of $\mbf A$, denoted by $\mbf A_{\circ}^{p}$, will also be positive semi-definite \cite{HJ85}. \end{theorem} \section{Generating CE QPSK Random Processes From Gaussian Random Variables}\label{sec:ProofGaussian} Assuming identically distributed Gaussian RV's $\wt x_p, \wt y_p, \wt x_q$ and $\wt y_q$ that are mapped onto QPSK RV's $\wt z_p$ and $\wt z_q$ using \begin{align} \wt z_p &= \frac{1}{\sqrt{2}}\Bigg[ \text{sign}\bigg(\frac{\wt x_p}{\sqrt{2}\sigma}\bigg) + \jmath \, \text{sign} \bigg(\frac{\wt y_p}{\sqrt{2}\sigma}\bigg) \bigg]\\ \wt z_q &= \frac{1}{\sqrt{2}}\Bigg[ \text{sign}\bigg(\frac{\wt x_q}{\sqrt{2}\sigma}\bigg) + \jmath \, \text{sign} \bigg(\frac{\wt y_q}{\sqrt{2}\sigma}\bigg) \bigg] \end{align} where $\sigma^2$ is the variance of Gaussian RVs. The cross-correlation between QPSK and Gaussian RVs can be derived as \begin{align} \mbb E\{\wt z_p \wt z_q^*\} = \frac{1}{2}\mbb E \Bigg[ \bigg\{ &\text{sign}\Big(\frac{\wt x_p}{\sqrt{2}\sigma}\Big) + \jmath \, \text{sign} \Big(\frac{\wt y_p}{\sqrt{2}\sigma}\Big) \bigg\} \bigg\{ \text{sign}\Big(\frac{\wt x_q}{\sqrt{2}\sigma}\Big) + \jmath \, \text{sign} \Big(\frac{\wt y_q}{\sqrt{2}\sigma}\Big) \bigg\} \Bigg]\cdot \end{align} Using equation \eqref{eqn:ExpProperty} we can write the above equation as \begin{align}\label{eqn:60} \mbb E\{\wt z_p \wt z_q^*\} = \mbb E \bigg\{&\text{sign}\Big(\frac{\wt x_p}{\sqrt{2}\sigma}\Big) \text{sign} \Big(\frac{\wt x_q}{\sqrt{2}\sigma}\Big) \bigg\} + \jmath \, \mbb E \bigg\{\text{sign}\Big(\frac{\wt y_p}{\sqrt{2}\sigma}\Big) \text{sign} \Big(\frac{\wt x_q}{\sqrt{2}\sigma}\Big) \bigg\}\cdot \end{align} The cross-correlation relationship between Gaussian and QPSK RVs can be derived by first considering \begin{align}\label{eqn:61} \mbb E \bigg\{\text{sign}\Big(\frac{\wt x_p}{\sqrt{2}\sigma}\Big)&\text{sign} \Big(\frac{\wt x_q}{\sqrt{2}\sigma}\Big) \bigg\} = \int\limits_{-\infty}^{\infty}\int\limits_{-\infty}^{\infty} \Bigg[\text{sign}\Big(\frac{\wt x_p}{\sqrt{2}\sigma}\Big) \times \text{sign} \Big(\frac{\wt x_q}{\sqrt{2}\sigma}\Big) p (\wt x_p,\wt x_q,\rho_{\wt x_p \wt x_q}) \Bigg] \: d\wt x_p \: d\wt x_q \end{align} where $p (\wt x_p,\wt x_q,\rho_{\wt x_p \wt x_q})$ is the joint probability density function of $\wt x_p$ and $\wt x_q$, and $\rho_{\wt x_p \wt x_q} = \frac{\mbb E \{\wt x_p \wt x_q^*\}}{\sigma^2}$ is the cross-correlation coefficient of $\wt x_p$ and $\wt x_q$. Using Hermite polynomials \cite{Bro68}, the above double integral can be transformed as in \cite{ATPM11_FACE}. Thus, \begin{align}\label{eqn:63} \mbb E \bigg\{\text{sign}\Big(\frac{\wt x_p}{\sqrt{2}\sigma}\Big) \text{sign} \Big(\frac{\wt x_q}{\sqrt{2}\sigma}\Big) \bigg\} =& \sum_{n=0}^{\infty} \dfrac{\rho^n_{\wt x_p \wt x_q}}{2\pi\sigma^22^nn!} \times \int\limits_{-\infty}^{\infty} \text{sign}\Big(\frac{\wt x_p}{\sqrt{2}\sigma}\Big) e^{{\wt x^2_p}/{2\sigma^2}} H_n\Big(\frac{\wt x_p}{\sqrt{2}\sigma}\Big) \: d\wt x_p \nonumber \\&\times \int\limits_{-\infty}^{\infty} \text{sign}\Big(\frac{\wt x_q}{\sqrt{2}\sigma}\Big) e^{{\wt x^2_q}/{2\sigma^2}} H_n\Big(\frac{\wt x_q}{\sqrt{2}\sigma}\Big) \: d\wt x_q \end{align} where \begin{equation}\label{eqn:HermitePoly} H_n (\wt x_m) = (-1)^n e^{\frac{\wt x^2_m}{2}}\frac{d^n}{d\wt x^n_m}e^{\frac{-\wt x^2_m}{2}} \end{equation} is the Hermite polynomial. By substituting $\hat x_p = \frac{\wt x_p}{\sqrt{2}\sigma}$ and $\hat x_q = \frac{\wt x_q}{\sqrt{2}\sigma}$, and splitting the limits of integration into two parts, equation \eqref{eqn:63} can be simplified as \begin{align}\label{eqn:65} \mbb E \bigg\{\text{sign}(\hat x_p) \text{sign} (\hat x_q) \bigg\} = \sum_{n=0}^{\infty} \dfrac{\rho^n_{\hat x_p \hat x_q}}{\pi 2^nn!} \Bigg( \int\limits_{0}^{\infty} e^{\hat x^2_p} \Big[ H_n(\hat x_p)- H_n(-\hat x_p)\Big] \: d\hat x_p \Bigg)^2\cdot \end{align} Using $H_n(-\hat x_p) = (-1)^n H_n(\hat x_p)$ \cite{DDF10}, equation \eqref{eqn:65} can be written as \begin{align} \mbb E \bigg\{\text{sign}(\hat x_p) \text{sign} (\hat x_q) \bigg\} = \sum_{n=0}^{\infty} \dfrac{\rho^n_{\hat x_p \hat x_q}}{\pi 2^nn!} \Bigg( \int\limits_{0}^{\infty} e^{\hat x^2_p} H_n(\hat x_p) \big(1-(-1)^n\big) \: d\hat x_p \Bigg)^2\cdot \end{align} The above equation is non-zero for odd $n$ only, therefore, we can rewrite it as \begin{align}\label{eqn:66} \mbb E \bigg\{\text{sign}(\hat x_p) \text{sign} (\hat x_q) \bigg\} = &\sum_{n=0}^{\infty} \dfrac{\rho^{2n+1}_{\hat x_p \hat x_q}}{\pi 2^{2n}(2n+1)!} \Bigg( \int\limits_{0}^{\infty} e^{\hat x^2_p} H_{2n+1}(\hat x_p) \: d\hat x_p \Bigg)^2 \cdot \end{align} Then using $\int\limits_{0}^{\infty} e^{\hat x^2_p} H_{2n+1}(\hat x_p) \: d\hat x_p = (-1)^n \frac{(2n)!}{n!}$ from \cite{DDF10}, we can write equation \eqref{eqn:66} as \begin{align}\label{eqn:67} \mbb E \bigg\{\text{sign}\Big(\frac{\wt x_p}{\sqrt{2}\sigma}\Big) \text{sign} \Big(\frac{\wt x_q}{\sqrt{2}\sigma}\Big) \bigg\} &= \sum_{n=0}^{\infty} \dfrac{\rho^{2n+1}_{\wt x_p \wt x_q}}{\pi 2^{2n}(2n+1)!} \Bigg( (-1)^n \dfrac{2n!}{n!}\Bigg)^2 \nonumber \\ &= \dfrac{2}{\pi} \Bigg[ \rho_{\wt x_p \wt x_q} + \dfrac{\rho_{\wt x_p \wt x_q}^3}{2 \cdot 3} + \dfrac{1\cdot3\rho_{\wt x_p \wt x_q}^5}{2 \cdot 4 \cdot 5}+ \dfrac{1\cdot3 \cdot 5\rho_{\wt x_p \wt x_q}^7}{2 \cdot 4 \cdot 6 \cdot 7}+\cdots \Bigg]\nonumber \\ &= \dfrac{2}{\pi} \sin^{-1} \bigg(\mbb E \{\wt x_p \wt x_q\} \bigg) \end{align} In equation \eqref{eqn:61}, we expanded the first part of equation \eqref{eqn:60}. Now, similarly expanding the second part of equation \eqref{eqn:60}, i.e., \begin{align}\label{eqn:68} \mbb E \bigg\{\text{sign}\Big(\frac{\wt y_p}{\sqrt{2}\sigma}\Big)&\text{sign} \Big(\frac{\wt x_q}{\sqrt{2}\sigma}\Big) \bigg\} = \int\limits_{-\infty}^{\infty}\int\limits_{-\infty}^{\infty} \Bigg[\text{sign}\Big(\frac{\wt y_p}{\sqrt{2}\sigma}\Big) &\text{sign} \Big(\frac{\wt x_q}{\sqrt{2}\sigma}\Big) p (\wt y_p,\wt x_q,\rho_{\wt y_p \wt x_q}) \Bigg] \: d\wt y_p \: d\wt x_q \end{align} where $p (\wt y_p,\wt x_q,\rho_{\wt y_p \wt x_q})$ is the joint probability density function of $\wt y_p$ and $\wt x_q$, and $\rho_{\wt y_p \wt x_q} = \frac{\mbb E \{\wt y_p \wt x_q^*\}}{\sigma^2}$ is the cross-correlation coefficient of $\wt y_p$ and $\wt x_q$. Using Hermite polynomials, equation \eqref{eqn:HermitePoly}, we can write equation \eqref{eqn:68} as \begin{align}\label{eqn:69} \mbb E \bigg\{\text{sign}\Big(\frac{\wt y_p}{\sqrt{2}\sigma}\Big) \text{sign} \Big(\frac{\wt x_q}{\sqrt{2}\sigma}\Big) \bigg\} =& \sum_{n=0}^{\infty} \dfrac{\rho^n_{\wt y_p \wt x_q}}{2\pi\sigma^22^nn!} \times \int\limits_{-\infty}^{\infty} \text{sign}\Big(\frac{\wt y_p}{\sqrt{2}\sigma}\Big) \times e^{{\wt y^2_p}/{2\sigma^2}} H_n\Big(\frac{\wt y_p}{\sqrt{2}\sigma}\Big) \: d\wt y_p \nonumber \\ &\times \int\limits_{-\infty}^{\infty} \text{sign}\Big(\frac{\wt x_q}{\sqrt{2}\sigma}\Big) e^{{\wt x^2_q}/{2\sigma^2}} H_n\Big(\frac{\wt x_q}{\sqrt{2}\sigma}\Big) \: d\wt x_q. \end{align} By substituting $\hat y_p = \frac{\wt y_p}{\sqrt{2}\sigma}$ and $\hat x_q = \frac{\wt x_q}{\sqrt{2}\sigma}$, and splitting the limits of integration into two parts, equation \eqref{eqn:69} can be simplified as \begin{align}\label{eqn:70} \mbb E \bigg\{\text{sign}(\hat y_p) &\text{sign} (\hat x_q) \bigg\} = \sum_{n=0}^{\infty} \dfrac{\rho^n_{\hat y_p \hat x_q}}{\pi 2^nn!} \Bigg( \int\limits_{0}^{\infty} e^{\hat y^2_p} \Big[ H_n(\hat y_p)- H_n(-\hat y_p)\Big] \: d\hat y_p \Bigg)^2\cdot \end{align} Using $H_n(-\hat y_p) = (-1)^n H_n(\hat y_p)$, above equation can be written as \begin{align} \mbb E \bigg\{\text{sign}(\hat y_p) \text{sign} &(\hat x_q) \bigg\} = \sum_{n=0}^{\infty} \dfrac{\rho^n_{\hat y_p \hat x_q}}{\pi 2^nn!} \Bigg( \int\limits_{0}^{\infty} e^{\hat y^2_p} H_n(\hat y_p) \big(1-(-1)^n\big) \: d\hat y_p \Bigg)^2\cdot \end{align} The above equation is non-zero for odd $n$ only, therefore, we can rewrite it as \begin{align}\label{eqn:72} \mbb E \bigg\{\text{sign}(\hat y_p) \text{sign} (\hat x_q) \bigg\} = \sum_{n=0}^{\infty} \dfrac{\rho^{2n+1}_{\hat y_p \hat x_q}}{\pi 2^{2n}(2n+1)!} &\Bigg( \int\limits_{0}^{\infty} e^{\hat y^2_p} H_{2n+1}(\hat y_p) \: d\hat y_p \Bigg)^2 \cdot \end{align} Then using $\int\limits_{0}^{\infty} e^{\hat y^2_p} H_{2n+1}(\hat y_p) \: d\hat y_p = (-1)^n \frac{(2n)!}{n!}$, we can write equation \eqref{eqn:72} as \begin{align}\label{eqn:73} \mbb E \bigg\{\text{sign}\Big(\frac{\wt y_p}{\sqrt{2}\sigma}\Big) \text{sign} \Big(\frac{\wt x_q}{\sqrt{2}\sigma}\Big) \bigg\} &= \sum_{n=0}^{\infty} \dfrac{\rho^{2n+1}_{\wt y_p \wt x_q}}{\pi 2^{2n}(2n+1)!} \Bigg( (-1)^n \dfrac{2n!}{n!}\Bigg)^2 \nonumber \\ &= \dfrac{2}{\pi} \Bigg[ \rho_{\wt y_p \wt x_q} + \dfrac{\rho_{\wt y_p \wt x_q}^3}{2 \cdot 3} + \dfrac{1\cdot3\rho_{\wt y_p \wt x_q}^5}{2 \cdot 4 \cdot 5}+ \dfrac{1\cdot3 \cdot 5\rho_{\wt y_p \wt x_q}^7}{2 \cdot 4 \cdot 6 \cdot 7}+\cdots \Bigg]\nonumber \\ &= \dfrac{2}{\pi} \sin^{-1} \bigg(\mbb E \{\wt y_p \wt x_q\} \bigg)\cdot \end{align} Combining equations \eqref{eqn:67} and \eqref{eqn:73}, gives us the cross-correlation of equation \eqref{eqn:60} as \begin{equation}\label{eqn:ProofXcor} \mbb E \{\wt z_p \wt z_q\} = \frac{2}{\pi} \Bigg[ \sin^{-1} \bigg(\mbb E \{\wt x_p \wt x_q\} \bigg) + \jmath \, \sin^{-1} \bigg(\mbb E \{\wt y_p \wt x_q\} \bigg) \Bigg]\cdot \end{equation} \section{Proofs}\label{app:Proofs} \begin{proof}[Proof of Lemma \ref{L1}] To prove Lemma \ref{L1}, we note that the real part of $\mbfwt R_g $ is $\mbf R_g$ which is positive semi-definite by definition, thus, by Theorem \ref{thm:R_psd}, the complex covariance matrix $\mbfwt R_g $ is also positive semi-definite. \end{proof} \begin{proof}[Proof of Lemma \ref{L2}] To prove Lemma \ref{L2}, we can individually expand the sum, $\sin^{-1} \left( \Re ( \mbfwt R_g ) \right) + \jmath \, \sin^{-1} \left( \Im ( \mbfwt R_g ) \right) $, using Taylor series, i.e., first expanding $\sin^{-1} \left( \Re ( \mbfwt R_g ) \right) $ \begin{align}\label{eq:real_Rg} \sin^{-1} \left( \Re ( \mbf R_g ) \right) = \Re ( \mbf R_g ) + \frac{1}{2 \cdot 3} \Re ( \mbf R_g )_{\circ}^{3} + \frac{1 \cdot 3}{2 \cdot 4 \cdot 5} \Re ( \mbf R_g )_{\circ}^{5} + \frac{1 \cdot 3 \cdot 5}{2 \cdot 4 \cdot 6 \cdot 7} \Re ( \mbf R_g )_{\circ}^{7} + \cdots \end{align} Then using Theorem \ref{thm:sum_psd}, each term or matrix, on the right hand side, is positive semi-definite, since, $\Re ( \mbf R_g )$ is positive semi-definite by definition. Moreover, $\sin^{-1} \left( \Re ( \mbf R_g ) \right) $ is also positive semi-definite since its a sum of positive semi-definite matrices, this follows from Theorem \ref{thm:R_psd}. Similarly, expanding $\jmath \, \sin^{-1} \left( \Im ( \mbf R_g ) \right) $ as \begin{align}\label{eq:comp_Rg} \jmath \, \sin^{-1} \left( \Im ( \mbf R_g ) \right) = \jmath [ \Im ( \mbf R_g ) + \frac{1}{2 \cdot 3} \Im ( \mbf R_g )_{\circ}^{3} + \frac{1 \cdot 3}{2 \cdot 4 \cdot 5} \Im ( \mbf R_g )_{\circ}^{5} + \frac{1 \cdot 3 \cdot 5}{2 \cdot 4 \cdot 6 \cdot 7} \Im ( \mbf R_g )_{\circ}^{7} + \cdots ] \end{align} Now, $\mbfwt R$ is positive semi-definite since real part of it is positive semidefinite, from equation \eqref{eq:real_Rg} and Theorem \ref{thm:SchurProd}. \end{proof} \bibliographystyle{ieeetr}
{'timestamp': '2014-08-15T02:13:25', 'yymm': '1407', 'arxiv_id': '1407.8510', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8510'}
arxiv
\section{Introduction} Twitter, over the years has gained immense popularity with milllions of registered users. As a microblogging website, Twitter allows users to post terse 140 character long `tweets' or status updates. For any information retrieval or reccommendation task, user classification can be an effective pre-processing step. Previous work \cite{conf/icwsm/PennacchiottiP11} have utilised profile features and some tweets of a user to bring about the task of user classification, in our study we do \textbf{not} consider the tweets of a user, but utilise other features like followers count, following count, number of tweets and the profile description of a user. The profile description is a short 160 character alphanumeric field. To the best of our knowledge no previous attempt at user classification has utilised this feature. We train two classifiers, OUC, to classify profiles as Organisations, Users and Others and MPS, to classify users on the basis of interest towards Music, Politics and Sports. In order to train the classifier we utilise Decision Trees, Naive Bayes and Support Vector Machines. Comparative results are provided in Section 3. \section{Feature Set} Any classifier, requires a set of features to be trained upon, for our classifier, as mentioned earlier, we utilise a) The followers count, b) The following count, c) The number of Tweets, d) Ratio of Followers to Following count and the e) Profile Description. Features a,b,c are whole numbers whereas the Profile Description is a 160 character alphanumeric field. \subsubsection*{Profile Description} We analysed a corpus of over 70,000 user profiles, which were aggregated using the Twitter Streaming API \cite{tdev} and found that about 85\% provide atleast one or more character of user description. We removed all punctuation marks and special characters from all the descriptions. Out of the users that do provide profile description , the average length was found to be 59 characters while the average number of words was approximately 6. \begin{figure}[h] \centering \includegraphics[width = 6cm]{results3.png} \caption{No. of users vs. no. of words} \label{fig:exectelnet} \end{figure} We analysed our corpus of user profiles and extracted the top 50 most frequently occuring words in the profile description. These words were used for creating binary features to train our algorithms. \subsubsection*{Numerical Features} Since, the range of values for the numerical features was large, binning was required to reduce dimensionality of our features. This was carried out using the function \begin{equation}\large H(n)=[\log_{10}n]\end{equation} Here n is the whole number value associated with the particular feature and [ ] is the greatest integer function. Figures 2 to 5 visualise the Features after binning using the function described above. We also define another derived feature, `ratio' which is essentially the ratio of the followers count and the following count. Since this produces a fractional term, to this we apply the function as described above to perform binning. \begin{figure} \centering \includegraphics[width = 6cm]{followers.png} \caption{No. of Users vs Followers Count} \includegraphics[width = 6cm]{following.png} \caption{No. of Users vs Followings Count} \includegraphics[width = 6cm]{tweets.png} \caption{No. of Users vs Tweets Count} \includegraphics[width = 6cm]{ratio.png} \caption{No. of Users vs Ratio} \end{figure} \section{Training \& Results} We trained to classifiers, OUC to classify users as Organisations, Users and Celebrites and MPC, Music, Politics and Sports. We aggregated 1200 user profiles and labelled them as OUC and MPS. For each classification we trained Decision Trees (DT), Naive Bayes (NB) and Linear Support Vector Machines (SVM). For DT \& NB we utilise the NLTK Python package \cite{Bird:2009:NLP:1717171}, while for SVM we utilise SciKit \cite{scikit-learn}. For each classification we perform 4-cross validation, and present the most accurate confusion matrix out of the four iterations. We also provide the average accuracy of the entire classifier. \subsection{OUC Classifier} \subsubsection{Decision Trees} \vspace{0.5em} \begin{table}[h] \centering \begin{tabular}{c|ccc} \toprule \textsc{} & \textsc{U} & \textsc{O} & \textsc{C} \\ \midrule \textsc{U} & \textbf{36.8}\% & 1.9\% & 0.9\% \\ \textsc{O} & 7.5\% & \textbf{16.0\%} & 15.1\% \\ \textsc{C} & 0.9\% & 1.9\% &\textbf{18.9\%} \\ \bottomrule \multicolumn{4}{c}{Accuracy: 71.7\%} \\ \end{tabular} \caption[OUC Classification - Decision Trees]{Confusion Matrix for DT in OUC} \end{table} \subsubsection{Support Vector Machines} \vspace{0.5em} \begin{table}[h] \centering \begin{tabular}{c|ccc} \toprule \textsc{} & \textsc{U} & \textsc{O} & \textsc{C} \\ \midrule \textsc{U} & \textbf{36.8}\% & 2.8\% & . \\ \textsc{O} & 7.5\% & \textbf{17.9\%} & 13.2\% \\ \textsc{C} & 0.9\% & . &\textbf{20.8\%} \\ \bottomrule \multicolumn{4}{c}{Accuracy: 75.5\%} \\ \end{tabular} \caption[OUC Classification - Decision Trees]{Confusion Matrix for SVM in OUC} \end{table} \subsubsection{Naive Bayes} \vspace{0.5em} \begin{table}[h] \centering \begin{tabular}{c|ccc} \toprule \textsc{} & \textsc{U} & \textsc{O} & \textsc{C} \\ \midrule \textsc{U} & \textbf{37.1}\% & . & 1.9\% \\ \textsc{O} & 1.9\% & \textbf{22.9\%} & 4.8\% \\ \textsc{C} & 1.9\% & 2.9\% &\textbf{27.6\%} \\ \bottomrule \multicolumn{4}{c}{Accuracy: 87.6\%} \\ \end{tabular} \caption[OUC Classification - Decision Trees]{Confusion Matrix for NB in OUC} \end{table} \begin{table}[h] \centering \begin{tabular}{c|c|c|cc} \toprule \textbf{} & \textbf{Feature} & \textbf{Label} & \textbf{Ratio}\\ \midrule 1& followers = 6 & c : u &34.1 : 1.0 \\ 2& ratio = 4 & c : u &26.9 : 1.0 \\ 3& ratio = 3 & c : u &15.6 : 1.0 \\ 4& contains(my) & u : o &14.1 : 1.0 \\ 5& followers = 4 & u : c &13.6 : 1.0 \\ 6& contains(news) & o : u &13.1 : 1.0 \\ 7&contains(official)& o : u &13.0 : 1.0 \\ 8&contains(from) & o : c &11.2 : 1.0 \\ 9& contains(i) & u : o &9.9 : 1.0 \\ 10&followers = 3 & u : o &8.7 : 1.0 \\ \bottomrule \end{tabular} \caption[OUC Classification - Most Significant Features]{Most Significant Features in Naive Bayes} \end{table} \begin{table}[h] \centering \begin{tabular}{c|c|c|cc} \toprule \textbf{Features} & \textbf{DT} & \textbf{SVM} & \textbf{NB}\\ \midrule numerical & 65.6\% & 66.7\% & 64.8\% \\ numerical+ratio& 64.6\% & 65.6\% &66.3\% \\ numrical+ratio+description& 69.6\% & 72.9\% &80.9\% \\ \bottomrule \end{tabular} \caption[OUC Classification - Overall]{Average Results for OUC classification} \end{table} \newpage \subsection{MPS Classifier} \subsubsection{Decision Trees} \vspace{0.5em} \begin{table}[h] \centering \begin{tabular}{c|cccc} \toprule \textsc{} & \textsc{M} & \textsc{P} & \textsc{S} \\ \midrule \textsc{M} & \textbf{30.9\%} & 1.4\% & 2.2\% \\ \textsc{P} &2.9\%&\textbf{32.5\%}&4.1\%& \\ \textsc{S} &3.8\% &2.2\% & \textbf{20.1\%} & \\ \bottomrule \multicolumn{5}{c}{Accuracy: 83.4\%} \\ \end{tabular} \caption{Confusion Matrix for DT in MPS} \begin{flushleft} \subsubsection{Naive Bayes} \end{flushleft} \centering \begin{tabular}{c|cccc} \toprule \textsc{} & \textsc{M} & \textsc{P} & \textsc{S} \\ \midrule \textsc{M} & \textbf{23.8\%} & 2.9\% & 7.6\% \\ \textsc{P} &4.8\%&\textbf{29.5\%}&3.8\%& \\ \textsc{S} &10.5\% &5.7\% & \textbf{11.4\%} & \\ \bottomrule \multicolumn{5}{c}{Accuracy: 76.8\%} \\ \end{tabular} \caption[OUC Classification - Naive Bayes]{Confusion Matrix for NB in MPS} \label{tab:misuse-vs-anomaly} \end{table} \begin{table}[h] \centering \begin{tabular}{c|c|c|cc} \toprule \textbf{} & \textbf{Feature} & \textbf{Label} & \textbf{Ratio}\\ \midrule 1& contains(music) & m : p &23.4 : 1.0 \\ 2& contains(sports)& s : p &10.6 : 1.0 \\ 3& contains(news) & p : m &9.4 : 1.0 \\ 4& contains(breaking)& p : s & 8.6 : 1.0 \\ 5& contains(new) & m : p & 8.3 : 1.0 \\ 6& contains(it) & m : p &6.7 : 1.0 \\ 7&contains(father)&s : p & 6.2 : 1.0 \\ 8&contains(singer)& m : p &5.9 : 1.0 \\ 9& contains(india) &m : p &5.9 : 1.0 \\ 10& contains(by) & p : m & 5.3 : 1.0 \\ \bottomrule \end{tabular} \caption[MPS Classification - Most Significant Features]{Most Significant Features in Naive Bayes} \end{table} \begin{table}[h] \centering \begin{tabular}{c|c|c|cc} \toprule \textbf{Features} & \textbf{DT} & \textbf{SVM} & \textbf{NB}\\ \midrule numerical & 50.5\% & * & 42.1\% \\ numerical+ratio& 53.4\% & * &43.1\% \\ numrical+ratio+description& 80.1\% & * &65.3\% \\ \bottomrule \end{tabular} \caption[MPS Classication]{Average Results for MSP classification} \end{table} \section{Conclusions} We find that ambient profile metadata associated with user profiles, is an efficient feature set to bring about user classification. For both classifiers, MPS and OUC we get reasonably high accuracies after 4 cross validation. As expected, from Table 4 we can infer that the OUC classifier depends more on numerical features like followers count whereas, from Table 5 it is clear that the MPS classifier relies more on the lexical features of the profile description. We can thus conclude that any future twitter classifier, must incorporate these features, in its training. \section{Acknowledgments} The authors would like to thank Prof. N Balakrishnan for constant guidance and support. We would also like to thank the Supercomputer Education Research Centre, Indian Institute of Science, Bangalore and the Indian Academy of Sciences, The National Academy of Sciences, India and the Indian National Science Academy for providing the opportunity to carry out the research work. \nocite{*} \bibliographystyle{abbrv}
{'timestamp': '2014-08-01T02:12:10', 'yymm': '1407', 'arxiv_id': '1407.8499', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8499'}
arxiv
\section{Introduction} \label{sec:intro} Shortest path computation has come a long way since Edgar W. Dijkstra first formally introduced and solved the problem in 1959. Modern speed-up techniques -- techniques that process road networks in a separate step under the assumption of a static network and augment them with additional information -- compute shortest paths on continental sized road networks in less than a millisecond. Pure distance queries can be performed even faster. However, these techniques do not consider the robustness of the found path but rather focus solely on the plain travel time. This approach presents a severe shortcoming with regards to actual travel. Any speed-up technique will ignore a path that takes a few seconds more, even though the shortest path might come with a high risk of traffic jams while the ``longer'' path is usually less frequented. Two general approaches have been taken to counter these problems. One method focuses on time-dependency: Instead of a plain travel time, streets are assigned a travel time function that depends on the actual arrival time. As such, reoccurring phenomena as the morning or evening rush can usually be modeled quite well. However, such approaches still only focus on an expected travel time and do not consider associated risks. Another approach is to actually view the travel time as a random variable that behaves according to some probability distribution. In this setting, one is interested in finding not only a reliable path but rather a full strategy that depends on a remaining time budget. Finding such a strategy, described via a cumulative distribution function at every intersection, is expensive, though. To compute the distributions, each step requires multiple convolutions. In addition, even though it is known how to optimize the order of convolutions to minimize the computational effort~\cite{sbb-tcarrsn-12}, an optimal strategy might contain loops and with longer distances, the respective overhead grows immensely. Running times up to hours are possible. We present a new approach to account for the reliability in a more tractable manner. As, similar to time dependent routing, reliability depends on measured data and deduced predictions, we propose to abandon guaranteed exactness. In this work, we study different techniques that allow the computation of reliable shortest paths up to multiple orders of magnitude faster without a large impact on the actual quality of the strategies themselves; we do so by focusing on meaningful subsets of the road network based on recent research into alternative routes. \section{Definitions and Terminology} \label{sec:pre} Every road network can be viewed as a directed and weighted graph. We formalize this notion in Definition~\ref{def:graph}. \begin{center} \begin{minipage}[c]{35em} \begin{definition}[Graph, Restricted Graph]\label{def:graph} A weighted \textbf{graph} $G = (V,A,c)$ is described as a set of vertices $V, |V| = n$, a set of arcs $A \subseteq V \times V, |A| = m$ and a cost function $c: A \mapsto \mathbb{N}_{>0}\text{.}$ For a given arc $(u,v)$, $c_{u,v}$ denotes the cost the arc (usually a form of travel time). \end{definition} \end{minipage} \end{center} All of the methods described within this work are targeted at the computation of shortest paths. The required modelling of paths and their associated distances is summarized in Definition~\ref{def:paths}. \begin{center} \begin{minipage}[c]{35em} \begin{definition}[Paths, Length, Distance]\label{def:paths} Given a graph $G = (V,A,c)$: We call a sequence $\apath{s,t} = \brpath{s=v_0}{v_k = t}$ with $v_i \in V, (v_i,v_{i+1}) \in A$ a \textbf{path} from $s$ to $t$. Its \textbf{length} $\mathcal{L}(\apath{s,t})$ is given as the combined weights of the represented arcs: $\mathcal{L}(\apath{s,t}) = \sum_{i=0}^{k-1} c(v_i,v_{i+1})\text{.}$ If the length of a path $\apath{s,t}$ is minimal over all possible paths between $s$ and $t$ with respect to $c$, we call the path a \textbf{shortest path} and denote $\apath{s,t} = \spath{s,t}\text{.}$ The length of such a shortest path is called the \textbf{distance} between $s$ and $t$: $\dist{s,t} = \length{\spath{s,t}}$. Furthermore, we define $\spath{s,v,t}$ as the \textbf{concatenated path} $\spath{s,v,t} = \spath{s,v} \cdot \spath{v,t}\text{.}$ \end{definition} \end{minipage} \end{center} \section{The Stochastic on-time Arrival Problem (SOTA)} \label{sec:sota} Following, we give an overview over the current state of the art before describing our problem in detail. We conclude the section by discussing a competing model to solve the problem. \subsection{Related Work} \label{sec:sota-related} One approach to unreliable travel times is to take into account the inherent variability in the travel time distributions and compute robust routing strategies. A commonly used method in this setting is to maximize the probability of reaching the destination within a prespecified time budget. There are two different approaches that have been developed to solve this problem. The first approach is to find the optimal \textit{a priori} path that maximizes the probability of on-time arrival and is known as the shortest path with on-time arrival reliability (SPOTAR) problem. Nie and Wu~\cite{Nie2009} proposed a general solution to the problem based on first-order stochastic dominance of paths, but the solution has worst-case exponential running times. They also present a pseudo-polynomial algorithm that gives an approximate solution to the problem and performs well in practice. Nikolova et al.~\cite{Nikolova2006a} showed how to solve the problem in $n^{\Theta(\log n)}$ time when the arc travel time distributions are Gaussian. The second approach is to find a routing policy that determines the optimal route by selecting the best next direction at each junction, and is known as stochastic on-time arrival (SOTA) problem. Such a strategy can result in different paths based on the realized travel times at intermediate road segments and will provide a success probability that is greater than or equal to that of the SPOTAR path. Fan et al.~\cite{fan} formulated the SOTA problem as a stochastic dynamic programming problem and solved it using a standard \textit{successive approximation} (SA) algorithm. However, in a network that contains cycles as is the case with all road networks, there is no finite bound on the maximum number of iterations required for the algorithm to converge. This is due to the fact that the optimal solution can contain loops, see \cite{sbb-tcarrsn-12} for an example. As an alternative, Nie et al.~\cite{nie2006} proposed a discrete approximation algorithm for the SOTA problem which converges in a finite number of steps and runs in pseudo-polynomial time. Samaranayake et al.~\cite{sbb-tcarrsn-12} presented a number of optimization techniques to speed up the computation including a label-setting algorithm based on the existence of a uniform, strictly positive minimum arc travel time, advanced convolution methods centered on the Fast Fourier Transform and the idea of zero-delay convolution~\cite{sbb-spsoap}, and localization techniques for determining an optimal order of policy computation. The resulting algorithm is later referred to as \emph{classic} implementation. Sabran et al.~\cite{sbb-stsoap-2014} showed how preprocessing techniques can be used to further reduce the computation time of the SOTA problem. Unfortunately, the problem structure of the SOTA formulation limits the types of preprocessing methods that can be used for this problem, and prevents massive running times reductions as possible in the deterministic case. Furthermore, this leads to large precomputation times due to the inability to decompose the respective tasks into smaller ones. \subsection{Problem Definition} \label{sec:sota-problem} We consider the stochastic on-time arrival (SOTA) problem of finding the optimal routing strategy for reaching a given destination within a prespecified time budget. In this problem, the costs of each arc $(u,v)\in{E}$ are random variables with a probability density function $c_{u,v}(\cdot)$ that represents the travel time on arc $(u,v)$. The arc travel time distributions are assumed to be independent\footnote{See~\cite{sbb-tcarrsn-12} for an extension of the formulation that considers local correlations.}. Given a time budget $T$, an \textit{optimal routing policy} is defined to be a routing policy that maximizes the probability of reaching the destination vertex $t$ within a total travel time of $T$. A routing policy is an \textit{adaptive} set of instructions that determines the optimal path at each vertex (i.e., at an intersection in the road network) based on the cumulative travel time that has already been realized. This is in contrast to the SPOTAR solution~\cite{Nie2009, Nikolova2006b} that only gives a fixed path from the source to the destination. Given a vertex $u\in{V}$ and a time budget $\tau$, let $prob_{u,t}(\tau)$ denote the probability of reaching the destination $t$ from $u$ in less than time $\tau$ when following the optimal policy, and let $next_{u,t}(\tau)$ be the optimal next vertex to visit. At each vertex $u$, the traveler should pick the arc $(u,v)$ that maximizes the probability of arriving on time at the destination. If $v$ is the next vertex being visited after vertex $u$ and $\omega$ is the time spent on arc $(u,v)$, the traveler starting at $u$ with a time budget $\tau$ has a time budget of $\tau - \omega$ to travel from $v$ to the destination\footnote{In this formulation of the problem, the traveler is not allowed to wait at any of the intermediate vertices. See~\cite{sbb-tcarrsn-12} for the conditions under which travel time distributions from traffic information systems satisfy the first-in-first-out (FIFO) condition. This condition implies that the on-time arrival probability can not be improved by waiting at any vertex.}. The optimal routing policy for the SOTA problem can be obtained by solving the following system of equations. \begin{eqnarray} \label{eq:sota} prob_{u,t}(\tau) & = & \max_{(u,v)\in{E}} \int_{0}^{\tau}c_{u,v}(\omega)\,prob_{v,t}(\tau-\omega)d\omega \\ & & \hspace*{5em} \forall {u}\in{V}, \enspace u\neq{t}, \enspace 0\le{\tau}\le{T} \nonumber \\ prob_{t,t}(\tau) & = & 1 \hspace*{5em} 0\le{\tau}\le{T} \nonumber \\[1.5em] next_{u,t}(\tau) & = & \argmax\limits_{(u,v) \in E} \int_{0}^{\tau}c_{u,v}(\omega)prob_{v,t}(\tau-\omega)d\omega \\ & & \hspace*{5em} \forall {u}\in{V}, \enspace u\neq{t}, \enspace 0\le{\tau}\le{T} \nonumber \end{eqnarray} One approach to solving this problem would be to use a \textit{successive approximations} (SA) algorithm as in~\cite{fan}, which solves the system of equations~(\ref{eq:sota}) repeatedly until convergence and gives an optimal routing policy. If the arc travel time distributions are lower bounded by a strictly positive constant and uniformly bounded on the network, as is the case with road networks, the system can be solved more efficiently using a label setting algorithm~\cite{sbb-tcarrsn-12}. \subsection{A Different Approach} \label{sec:time-dependent-related} Another approach to model variations in travel time along a road segment is to consider time-dependent routing. In the time-dependent scenario, arcs are assigned a travel time function that depends on the actual time of arrival. Dreyfus \cite{d-aspa-69} gives an early result to solve earliest arrival queries using a modified version of Dijkstra's algorithm. Orda and Rom \cite{or-smantd-90} discuss different variations of potential \emph{travel time functions} (TTF), showing that the FIFO property can be achieved for functions violating it using an auxiliary TTF. Fast algorithms exist to solve earliest arrival queries \cite{d-tdsharc-11} and profile queries \cite{bgsv-mtdttch-13} on such networks; a profile query gives a travel time profile for a full period of time. Nevertheless, the SOTA problem remains an interesting problem to solve as the types of delays that can be modeled using travel time functions for time-dependent routing differ from the types of uncertainty modeled in travel-time distributions. Typical approaches for time-dependent routing are regular and predictable delays. Potential examples include roads that have different speed-limits at night or the morning/evening rush. In the stochastic setting, one is more interested in irregular delays that are not predictable. \section{Pruning Techniques for the SOTA Problem} \label{sec:pruning} In a basic SOTA query, most of the road network $G$ only contributes a tiny fraction to the PDF at each vertex. Therefore, it is reasonable to limit the search space of each query to a subgraph $G'$ that allows us to compute near optimal results with respect to the PDFs at a fraction of the normally required convolutions. We conjecture that paths that are contributing a significant amount to the PDFs are likely to be part of a reasonable alternative route between source $s$ and destination $t$. Our results in the experimental section show this conjecture to be sound. Following, we give a short recapitulation on previous work on alternative routes, before describing required adjustments to these original methods. \subsection{Existing Techniques} The following techniques are designed for static route planning. In the stochastic setting, we evaluate distributions for their mean to apply these techniques. \paragraph*{Via-Node Alternative Routes.} The via-node approach to alternatives routes was first introduced in \cite{c-cr-05} and later refined by \cite{adgw-arrn-13,ls-csarr-14,k-hidar-13}. The main idea behind this approach is to model alternative routes $\spath{s,v,t}$ as a concatenation of two shortest paths $\spath{s,v}$, $\spath{v,t}$, with $v$ called a \emph{via node}. A candidate set of via nodes $V_C$ can be computed by intersecting the (pruned) search spaces from $s$ in forward direction and from $t$ in backward direction. The actual via node is selected by some feasibility criteria elaborated in the original work. \paragraph*{Penalty Method.} The penalty method \cite{bdgs-argrn-11,krs-eepmag-13,pz-iarp-13} considers a different approach to alternative routes that allows us to find routes of a different structure than the via-node approach. It constructs a set of alternative routes between $s$ and $t$ by iteratively computing shortest paths between these two vertices and penalizing the arcs on this path as well as the adjoint arcs. The iteration stops once the found paths get too long or after a set number of rounds. A path computed in this fashion is only retained as an alternative route if it adheres to some quality criteria discussed in the original publications. The subgraph induced by the set of found alternative routes and the shortest path is called an \emph{alternative graph}. \paragraph*{Route Corridors.} A related problem is considered in \cite{dklw-rmrplc-12}. Here, the goal is to compute a corridor of paths from $s$ to $t$ that contain all arcs that are possibly visited when driving from $s$ to $t$ and performing up to $k$ successive wrong turns. We call this subgraph of $G$ a \emph{$k$-turn corridor} $\corridor{k}{s,t}$. It can be constructed recursively as $\corridor{k}{s,t}$ is the union of all shortest paths $\spath{v,t}$ with $v \in \corridor{k-1}{s,t}$ and $\corridor{0}{s,t} = \spath{s,t}$. \subsection{Adjustments for Our Setting} As the experimental results show most of these techniques perform remarkably well right out of the box. The penalty method and route corridors directly yield a subgraph $G'$ that we can use to prune the SOTA search. Although, in our setting we keep all paths the penalty method finds and do not evaluate for quality. For the via-node approach, however, we have to come up with a new solution for constructing $G'$, as the basic via-node approach only yields single alternative routes. It can be iterated to generate additional routes that are an alternative to the shortest path and to all previous alternative routes, though, and we could use the union of these routes as an alternative graph similar to the penalty method. However, only few routes are found on average leading to a very sparse graph $G'$. We therefore opt for another option. We take the union of all paths $\spath{s,v,t}$ with $v \in V_C$ that adhere to the feasibility criteria as alternative graph. This corresponds to an approach previously discussed in \cite{k-hidar-13}. \section{Evaluation Framework} In this work, we present an experimental study on pruning techniques. The relevance of these techniques strongly depends on the actual distributions found in the network. We present values based on a variety of different inputs, ranging from measured data incorporated into traffic models to complete random data. The focus of our experiments is San Francisco, for which measured data is available to us. In addition, we present measurements on randomly generated gamma distributions \cite{KapariasBellBelzner08} for San Francisco as well as the district of Karlsruhe. \subsection{Measured Data} Measured data available to us is due to the Mobile Millennium Project (\url{http://traffic.berkeley.edu/}). The project collects GPS based probe data from a number of sources and processes this data using filtering and estimation techniques~\cite{hunter12wafr} to obtain travel-time distributions at the granularity of road segments. The resulting Mobile Millennium input set describes possible travel times in San Francisco as normal mixtures. In a smoothed setting we scale the parameters of extreme distributions (see Figure~\ref{fig:variance-network}). \subsection{Generated Data} We consider three variations of path based randomness as well as two path independent settings. Except for a completely random setting, all of the techniques operate in multiple rounds. The characteristic of the resulting graphs is described in Table~\ref{tab:input-char}. For the path based settings, we compute a range of different paths each round, following one of the three paradigms specified below. During each round, we keep a counter for every arc that is incremented whenever an arc is part of a shortest path. Based on these counters, we increase (or decrease) the respective parameters of the gamma distributions (shape and scale) of the associated arc. For a decrease we have chosen a multiplicative factor of 0.9, for increase we have chosen additive penalties of 0.02/0.08 for shape and 0.1/0.5 for scale. The resulting distributions somewhat resemble distributions found in the measured data. The individual path based settings operate as follows: \paragraph*{Random Paths:} For the random paths setting, counters are based on source and target pairs chosen uniformly at random. After a shortest path computation using \emph{free flow times} (best possible travel time), the counters of the arcs on the respective path are increased. \paragraph*{Random Shuffle:} Instead of choosing source and target pairs uniformly at random, we pair each vertex of the graph with another random vertex of the graph. This results in every vertex acting as source and target vertex once in every round. As such, the number of paths considered is given as the number of vertices in the graph. \paragraph*{Hotspots:} The hotspot setting is similar to the random path setting but creates more localized penalties. In every round, a few random hotspots are chosen. The paths to compute are distributed equally over these hotspots. For every such path, we choose a source vertex uniformly and compute the path to the desired hotspot.\\ The non path based settings operate as follows: \paragraph*{Random Arcs:} A completely random setting for which we simply increase the count of randomly chosen arcs. In this setting, we interpret each arc as a one-hop path and operate as described above. \paragraph*{Random Arc Distributions:} As a final test of robustness, we also generated a completely unrealistic setting: random distributions. In this setting we do not operate in rounds but rather assign a random gamma distribution with shape $\in \left[ 0.01, 10 \right]$ and scale $\in \left[0.01, 10\right]$ to each arc directly. \begin{table} \centering \caption{Characteristics of our main inputs. Setting gives appropriate parameters for \#(R)rounds, \#(P)aths, and \#(H)otspots. Order describes the relation between the classic/optimal ordering; optimal ordering is an a posteriori ordering that first performs an instance of the classic algorithm, extracts the actually contributing vertices, and prunes the search space to contain only said vertices. Type names the kind of distributions used (NM: Normal Mixtures or GD: Gamma Distribution). Nodes [\%] give the fragment of the input graph that makes up the optimal prune space (nodes that make up the perfect strategy after running the classic approach). Time budget by arrival probability describes the factor in relation to free-flow traffic that is necessary to guarantee on-time arrival with X\% probability. The graphs are illustrated in Figure~\ref{fig:variance-network}.} \label{tab:input-char} \begin{tabular}{clcccccccc} \toprule & & & & & & \multicolumn{4}{c}{Budget by Arr. Prob.}\\\cmidrule{7-10} \# & Source & Setting & Type & Order & Nodes & 25 & 50 & 75 & 100 \\ \midrule 1 & Random Shuffle & R15 & GD & 2.22 & 16.78 & 1.08 & 1.11 & 1.14 & 1.45 \\ 2 & Random Arcs & R40, P50k & GD & 3.34 & 14.86 & 1.11 & 1.14 & 1.18 & 1.73 \\ 3 & Hotspot & R15, P5k, H50 & GD & 1.89 & 26.24 & 1.14 & 1.19 & 1.24 & 1.84 \\ 4 & Random Paths & R100, P2.5k & GD & 3.97 & 19.27 & 1.29 & 1.37 & 1.47 & 2.19 \\ 5 & Random Paths & R25 P10k & GD & 1.51 & 46.05 & 1.37 & 1.47 & 1.57 & 2.79 \\ 6 & Mobile Millen. & smoothed & NM & 1.74 & 34.64 & 1.24 & 1.31 & 1.38 & 2.03 \\ 7 & Mobile Millen. & - & NM & 1.33 & 56.24 & 1.45 & 1.58 & 1.73 & 3.86 \\ \bottomrule \end{tabular} \end{table} \section{Experiments} \label{sec:exp} Even though we present an experimental approach to speed-up stochastic-routing, we do not focus on running times. Instead, we mostly rate the success of our approach via the reduction in the number of convolutions necessary to compute an optimal strategy. Our decision to do so is based on the large influence of the multitude of design decisions necessary in implementing an algorithm to solve the SOTA problem. Especially the method chosen to perform the convolution, trade-offs between memory overhead and pre-evaluated arc distributions, and memory allocation itself during the execution of the algorithm have a large influence on the running time; some of which might not be viable due to the associated overheads. The main workload, however, remains in the cost of the convolutions. By purely focusing on the plain number of convolutions performed, we give a less biased view on the benefits of our approach. The running time of the used techniques is negligible, as all of them have been proven highly efficient and require only a few milliseconds on continental sized networks. \paragraph*{Methodology:} The data we present is measured on the small network of San Francisco. The graphs consists of 2.3k nodes. Depending on the budget, however, running times can still reach minutes for the classic techniques as the optimal node order might still reach into the millions of steps. Unless otherwise noted, we present data averaged over a thousand queries, source and target chosen uniformly at random. \subsection{Absolute Errors} In Figure~\ref{fig:pdf-errors-examples}, we present the absolute delta (error) of the pruned PDFs in relation to the unpruned PDF and to the relevant time budget over a selection of different graphs. While the relative order of the different techniques varies a bit, the experienced behavior more or less remains the same. A $1$-turn corridor usually presents a viable method for most of the budget already, especially in the high budget regions, however, it might not suffice in terms of approximation quality as errors get relatively large for lower budget ranges. Higher degree corridors come closer to the optimal solution, close to a perfect approximation. \begin{figure}[tb] \subfigure[Mobile Millenium (Graph 7)]{\includegraphics[width=0.47\textwidth,page=3]{plot/sfr-nm-as_is.pdf}}\hfill \subfigure[Random Arcs (Graph 2)]{\label{fig:errors-cc}\includegraphics[width=0.47\textwidth,page=3]{plot/max-sfr-r40-p50k-chaos-gd.pdf}}\\ \subfigure[Hotspot (Graph 3)]{\includegraphics[width=0.47\textwidth,page=3]{plot/sfr-random-gd-r15-p5000-h50.pdf}}\hfill \subfigure[Random Paths (Graph 4)]{\includegraphics[width=0.47\textwidth,page=3]{plot/sfr-random-r100-p2500-gd.pdf}} \caption{Mean error in relation to given time budget, scaled to 100~\%. Pruning techniques evaluate for the expected mean travel time of an arc. Plots are scaled to a 100~\% between first relevant budget (arrival probability $>$ 0.001) and first 100~\% arrival guarantee.} \label{fig:pdf-errors-examples} \end{figure} The quality of the approximation seems relatively stable. It offers some higher maximal possible errors on a few graphs with difficult to handle extreme variances, though. In the presence of extreme variance, allowing for high probabilities for travel times of more than 10 times the free flow time, the exclusion of a single arc can sometimes introduce errors as high as 10-15~\% in the PDF of the source vertex for various techniques. Even on these graphs, these kind of paths occur rarely and can be deemed unrealistic. A scenario that has to consider more than three times the travel time during free flowing traffic for a routing strategy seems unreasonable to the authors. \paragraph*{Range Influence:} In road networks, the typical topology of a shortest path changes with longer distance. Paths of sufficient lengths are usually restricted to a rather sparse network after leaving the respective region of the starting point or when far enough away from the target \cite{bfmss-itcsp-07}. To make sure our algorithm performs well for both long range and short range queries, we performed tests on different Dijkstra ranks on a larger network, consisting of the district of Karlsruhe; the Dijkstra rank of a node is the iteration in which Dijkstra's algorithm would settle the node. The graph consists of 129k nodes and 320k edges and we used the random path setting for generating distributions as it seems closest to the Mobile Millennium framework (see Table~\ref{tab:input-char}). While we did experience some minor variation, the general result remained the same over all Dijkstra ranks. \subsection{Technique benefits} The different pruning techniques not only vary in terms of their approximation quality but also in terms of their pruning quality. We compare the differences in Figure~\ref{fig:scatter-overhead}. Every dot represents a different input graph, including additional graphs (in relation to Table~\ref{tab:input-char}) with different randomization parameters. For the most part, both the Penalty method as well as the 2-turn corridor offer a reasonable trade-off between average experienced approximation rate and reduction in the number of convolutions. The 5-turn corridor does prune far less nodes, but also offers near perfect approximation. The combination of alternative routes while evaluating arcs to their minimal, average, and maximal possible travel time (\emph{via-mix}) performs comparable to a 5-turn corridor. \begin{figure}[tb] \includegraphics[width=1.0\textwidth]{plot/overhead-scatter.pdf} \caption{Number of convlutions in optimal SOTA-ordering and corresponding error in relation to the classic ordering and the maximal encountered error. Every dot represents a different input graph (e.g. mobile millenium, hotspots, random paths, random arcs) with varying parameters. Scaled to 100~\% in relation to the classic ordering.} \label{fig:scatter-overhead} \end{figure} Even though the reduction in the size of the node order varies between $5~\%$ and up to $78~\%$ of the node order required in the classic approach, this reduction has a far larger influence as one might expect at first glance. Considering that the average node has a total of two to four reachable neighbors, the reduction in the ordering process translate into an even larger speed-up as every update may require four convolutions. In addition, the pruned implementations usually prune some of these convolutions due to neighboring nodes not being considered at all, only performing two instead of four convolutions. As such, we expect (and experienced in our implementation) possible speed-ups of more than one or two orders of magnitude. The benefit, however, lessens when influencing factors like evaluation of arc distributions and memory allocation as well as a potential faster convolution implementation are considered. \section{Conclusion and Future Work} \label{sec:con} This experimental study proves a high potential for utilizing alternative route techniques for difficult to solve problems on road networks, such as the stochastic on-time arrival problem. We show that concentrating on a meaningful subgraph of the network helps to reduce the calculation overheads immensely. Using techniques as we present here, reductions by multiple orders of magnitude are possible, making it possible to handle relatively large networks of more than a hundred thousand vertices. We expect the impact of our proposed pruning methods to be even more important on larger networks that require large budgets and contain large amounts of vertices. Even though we verified our expectations in some sense on artificial inputs, it would be most important to gain access to actual measured distributions on larger instances to confirm our approach. With access to more realistic data, it would be interesting to fit the pruning techniques to the cause to minimize maximal errors and to reduce the computational overhead at the same time. Potential improvements could focus on different methods based on the distance from source and target or budget dependent pruning as minimal and maximal necessary time budgets can be computed in a trivial fashion. We expect turn corridors that allow for more turns at the start/end of the route to offer great results, both with respect to speed-up and to experienced errors. \subsubsection*{Acknowledgements.} We would like to thank Mehrdad Niknami for providing us with the graph of the Mobile Millennium framework. \bibliographystyle{splncs03}
{'timestamp': '2014-08-01T02:06:40', 'yymm': '1407', 'arxiv_id': '1407.8295', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8295'}
arxiv
\section{Introduction} In recent years, the {\it degrees of freedom} (DoF) have emerged as one of the most important metrics for characterizing interference networks. The DoF describe how the system sum rate scales with the logarithm of the signal to noise ratio (SNR) at the high SNR regime. The Interference Alignment (IA) concept has elucidated the optimal DoF for certain configurations of interference networks. The main purpose of \ac{IA} is to design the transmit filters in such a way that each receiver observes all the interfering signals overlapped in a common subspace. The concept was originally proposed in the context of index coding in \cite{Birk&Kol}, while it crystallized later on for the 2-user \ac{MIMO} X-channel in \cite{Maddah-Ali2008} and for the $K$-user \ac{SISO} \ac{IC} with $K>2$ in \cite{CJ}. Surprisingly, Cadambe \etal \cite{CJ} proposed a linear precoding scheme that provides \textit{each user half the cake}, and therefore a total of $\nicefrac{K}{2}$ DoF over the network. Additionally, the authors showed that this result generalizes to the \ac{MIMO} case, obtaining $\nicefrac{KM}{2}$ total DoF when all nodes are equipped with $M$ antennas. For both cases, the achievability of fractional DoF relies on transmitting along an arbitrarily large number of channel uses on a time-varying / frequency-selective channel. However, it fails when considering a constant \ac{SISO} channel because the equivalent channel matrices result on scaled identity matrices and the diversity provided by the channel variations cannot be exploited. There is a large number of works in the literature that have employed the IA concept for analyzing the MIMO \ac{IC} in terms of DoF, see for example \cite{AlignmentChainsTrans,Yetis2010,Razaviyayn2012,Gou2010_DoF_MN,GenieChainsArxiv,Reciprocity,ACS,Geometry2011}. Especially interesting is the work in \cite{Reciprocity}, where the authors showed the DoF reciprocity concept in wireless networks \cite{Reciprocity}. This property states that given a network with one particular antenna setting, its reciprocal setting, i.e. a network where the number of antennas at the transmitters and receivers (or the roles of transmitters and receivers) are exchanged, has exactly the same DoF. This important result allows to half the number of antenna settings to be investigated. After the disrupting idea of IA, different types of IA emerged. Basically, there are two different frameworks for developing IA-based transmit precoders: lattice level IA \cite{LayeredIA} (\emph{lattice alignment}), and vector space level IA \cite{Maddah-Ali2008}, (\emph{vector space alignment}). These two techniques arise from the choice between structured or random codes, respectively. Lattice alignment-based techniques exploit the rational dimensions framework such that the undesired signals are seen at each receiver on the same lattice. Inspired on this idea, \cite{Ghasemi2010} showed that the DoF outer bound may be attained for almost any user and antenna settings. Nevertheless, this type of IA is highly dependent on the SNR and its rate performance is extremely degraded at medium SNR \cite{Ordentlich2013}. On the other hand, vector space alignment techniques are able to attain the optimal DoF only for certain antenna configurations, but in contrast to the lattice-based techniques, they show a better rate performance at medium SNR. Basically, there exist in the literature 3 types of IA in the vector space alignment framework currently proposed: the conventional approach explained before, Ergodic IA (EIA)\cite{ErgodicIA} and Opportunistic IA (OIA) \cite{OIA}. The idea of EIA relies on repeating the same transmission along two time slots with complementary channel states, such that by summing up the signals received from both time slots the interference is canceled. The surprising result in \cite{ErgodicIA} was that each user attains the $\frac{1}{2}$ DoF in a $K$-user SISO IC regardless the number of users $K$, without the need of any precoding at the transmitter side, and for any SNR value. However, it was also shown that the delay users must wait for complementary channel states grows as the SNR. For this reason, we will assume that transmitters cannot choose the time slots when they transmit, and ergodic IA will not be considered. On the other hand, OIA exploits the user dimension through scheduling. The idea is to combine the benefits of opportunistic beamforming and IA. The advantage of this approach is that information sharing among transmitters is not required, and the required CSI feedback may be highly alleviated. However, the number of users associated to each transmitter should grow with the SNR \cite{OIA}. This paper will consider the conventional IA approach. In this context, the best known inner bound for the 3-user SISO IC was proposed by Cadambe \etal in \cite{ACS}. The authors proposed a linear precoding scheme able to achieve $1.2$ DoF, thanks to the \textit{asymmetric complex signaling} (ACS) concept. This approach, together with symbol extensions in time, is able to exploit the real and imaginary components of the channel. As a result, the equivalent channel matrices are no longer scaled identity matrices but present a more sophisticated structure that can be exploited by the IA scheme. A similar approach has been recently reported for the 4-user SISO IC in \cite{ACS_4users}. Moreover, Wang \etal have recently characterized the 3-user MIMO IC \cite{AlignmentChainsTrans} in DoF terms. On the one hand, the DoF outer bound is derived by introducing the change of basis (CB) operation, which allows to write the equivalent channels in such a way that the appropriate genie signals to be provided to each receiver can be more easily identified\footnote{Interestingly, the CB operation has been found to be useful for other settings, e.g. the MIMO rank-deficient IC \cite{Zeng_defRank_MIMO3}.}. On the other hand, the proposed DoF inner bound flows from the \textit{subspace alignment chains} concept. This approach proposes a transmitter design intertwined among users through the alignment, being optimal in DoF terms for almost all antenna settings. Nevertheless, the SISO case and all $\left(p+1, p \right)$ and $\left(p, p+1 \right)$ MIMO cases with $p\!>\!1$\footnote{The case $p=1$ was previously addressed in \cite{Gou2010_DoF_MN}.} remain open problems (see Section 8.3 in \cite{AlignmentChainsTrans}) when the channel coefficients are held constant. In this regard, it is worth pointing out that the DoF characterization of the 3-user $\left(p, p+1 \right)$ MIMO IC has been later on claimed in \cite{AlignmentChains_ISIT,ACSnoPublicat} by means of \ac{ACS} and \textit{subspace alignment chain} concepts, but the result is just sustained on numerical experiments. Therefore, to the best of the authors' knowledge, there is not a formal proof in the literature. \begin{figure}[] \centerline{\includegraphics[width=0.65\linewidth]{3userIC_p2.pdf}} \caption[The 3-user MIMO IC]{The 3-user (2,3) MIMO IC. Transmitters and receivers are equipped with $p=2$ and $p+1=3$ antennas, respectively. Solid lines define the intended signals, while dotted lines denote the interfering signals.} \label{fig:IC} \end{figure} \subsection{Contributions} \label{sec:contributions} The goal of this work is to provide a formal proof about the optimal DoF of the 3-user $\left(p,p+1 \right)$ MIMO IC with constant channel coefficients using linear transmit-receive filters. As an example of such scenarios, Fig.\ref{fig:IC} shows the $\text{3-user} \left(2, 3 \right)$ MIMO IC. The proposed scheme is based on interference alignment, \textit{symbol extensions in time} and \textit{asymmetric complex signaling}. Three contributions summarize this work: \begin{itemize} \item We prove that the DoF per user for ${p=2,3...6}$ are exactly $\frac{p\left(p+1\right)}{2p+1}$, see Theorem \ref{theorem23} and \mbox{Theorem \ref{theorem34}} in Sections \ref{sec:5case23} and \ref{sec:6generalCase}, respectively. \item The proposed transmit precoding matrices present a specific structure that can be generalized for any value of $p$. This structure is characterized by two properties: {\it i)} there are some elements equal to zero, and {\it ii)} all transmit precoders are defined as a function of 3 matrices, denoted as the \textit{support precoding blocks}. An iterative algorithm is proposed, able to find the structure of each precoding matrix for any value of $p$. \item By generalizing the proposed scheme and proof methodology, we conjecture that the 3-user $\left(p,p+1 \right)$ MIMO IC with constant channel coefficients has $\frac{p\left(p+1\right)}{2p+1}$ DoF per user for any ${p\geq7}$, achieved by means of linear filters at transmitters and receivers. \end{itemize} \subsection{Organization} This paper is organized as follows. \mbox{Section \ref{sec:2SystemModel}} introduces the system model considered in this work. Next, Section \ref{sec:DoF} reviews the DoF for our specific scenario, as well as DoF achievability conditions when using IA. The structure of our precoding scheme and the alignment chains are addressed in Section \ref{sec:PrecodingStructure}. Section \ref{sec:5case23} is devoted to present the $p=2$ case, while Section \ref{sec:6generalCase} addresses the $p=3$ case, which differs from the previous case in notation, and allows the generalization of the precoding scheme for $p>3$. This is achieved by means of the $\textit{zero propagation algorithm}$, presented in \mbox{Section \ref{sec:6generalCase}}. These cases $p=2,3$ allow understanding the achievability proof for the general case. Moreover, simulation results are provided in \mbox{Section \ref{sec:4.3sim}}, where the the sum-rate is depicted as a function of the SNR for different values of $p$, and DoF achievability is shown. Finally, conclusions are drawn in \mbox{Section \ref{sec:7conclusion}}. \subsection{Notation} We write vectors in boldface lowercase types ($\mathbf{x}$), and matrices in boldface uppercase types ($\mathbf{X}$). $(\cdot)^T$, $(\cdot)^H$, and $\otimes$ stand for the transpose, transpose and conjugate, and Kronecker product operators, respectively, and we define \begin{IEEEeqnarray}{c} \Stack { \mathbf{A} , \mathbf{B} } = \Big[ {\mathbf{A}}^T \quad {\mathbf{B}}^T \Big]^T. \end{IEEEeqnarray} Furthermore, for any given $N$-column vector ${\mathbf{x}=\left[x(1), x(2), \ldots, x(N)\right]^T}$ and ${M\text{-column}}$ matrix ${\mathbf{Y}=\left[ \mathbf{y}_1, \mathbf{y}_2, \ldots , \mathbf{y}_M \right]}$, we define \begin{IEEEeqnarray*}{c} \mathbf{x}(a:b)=\left[x(a), x(a+1),\ldots,x(b)\right]^T, \quad \mathbf{Y}_{a:b}=\left[\mathbf{y}_{a}, \mathbf{y}_{a+1}, \ldots, \mathbf{y}_{b}\right]. \end{IEEEeqnarray*} Additionally, $\lceil . \rceil$, $\lfloor . \rfloor$, and $\langle . \rangle$ stand for the ceiling, floor, and modulo-3 operators, respectively. We remark that all indices in this work are assumed to be in the set $\{1,2,3\}$, applying the modulo-3 operation only if necessary. Furthermore, $\Span{\mathbf{A}}$ defines the subspace generated by all linear combinations of the columns of $\mathbf{A}$, and $\Rank{\mathbf{A}}$ denotes its dimension. Finally, $ \mathbb{R},\mathbb{C}$ stand for the real and complex sets of numbers, respectively. \section{System Model} \label{sec:2SystemModel} The 3-user $\left(p,p+1 \right)$ MIMO IC is considered, where each transmitter and each receiver is equipped with $p$ and $p+1$ antennas, respectively. Each transmitter aims to deliver a message to one unique receiver, labelled with the same index. Perfect and instantaneous \ac{CSI} is assumed and exploited at both sides. Channel coefficients are randomly drawn from some continuous complex probability density function, and assumed to be constant along the whole transmission time. The transmission is carried out over $2T$ equivalent channel uses thanks to the $T$ \textit{symbol extensions in time} and \textit{asymmetric complex signaling} \cite{ACS}. The received and processed signals may be written as follows \begin{IEEEeqnarray}{c} \label{eq:extendedSignal2} \mathbf{{y}}_j = {{\mathbf{H}}_{j,j}} {{\mathbf{V}}_j}{{\mathbf{x}}_j} + \!\! \sum\limits_{i = 1, i \ne j}^{3} {\mathbf{ H}}_{j,i} {\mathbf{V}}_i {\mathbf{x}}_i + {{\mathbf{n}}_j} \\ {{\mathbf{z}}_j} = {\mathbf{W}}_j {{\mathbf{y}}_j}, \label{eq:ProcessedSignal} \end{IEEEeqnarray} where ${\mathbf{y}}_j\Rmat{2T(p+1)}{1}$ is the received signal vector at the $j$th receiver, ${{\mathbf{z}}_j} \Rmat{\hat d_j}{1}$ is the processed signal, ${\mathbf{x}}_j \Rmat{\hat d_j}{1}$ is the vector with uncorrelated components composed of $\hat d_j$ real-valued data symbols defining the message intended to the $j$th receiver, ${\mathbf{V}}_j\Rmat{2Tp}{\hat d_j}$ is the precoding matrix of the $j$th transmitter, ${\mathbf{W}}_j \Rmat{\hat d_j}{2T(p+1)}$ is a linear receiving filter, and ${\mathbf{n}}_j\Rmat{2T(p+1)}{1}$ denotes the noise vector at the $j$th receiver, whose components are i.i.d. as $\mathcal{N}\!(0,1)$. Furthermore, $\mathbf{H}_{j,i} \Rmat{2T(p+1)}{2Tp}$ stands for the equivalent channel matrix from the $i$th transmitter to the $j$th receiver after considering symbol extensions in time and ACS concepts, and applying a CB operation, to be detailed next. Let $\bar{\mathbf{H}}_{j,i} \Cmat{p+1}{p}$ be the original channel matrix from the $i$th transmitter to the $j$th receiver, and assume a transmission over $T$ channel uses. In such a case, one could stack all the received signals, and write a more compact system model. Therefore, the equivalent channel matrix could be written as follows: \begin{IEEEeqnarray}{c} \label{eq:TimeExtension} \Text{ \mathbf{\bar{H}}_{j,i} } = \mathbf{I}_T \otimes \bar{\mathbf{H}}_{j,i}, \end{IEEEeqnarray} where $\mathbf{I}_T \, \Rmat{T}{T}$ is the identity matrix. Similarly, real and imaginary parts of the received signals could be considered separately, as done in \cite{ACS}. However, in contrast to \cite{ACS}, here we use the ACS concept for each particular channel coefficient. The extended form for each channel element is therefore written as: \begin{IEEEeqnarray}{c} \label{eq:ACSextension} \ACS{\bar{h}_{j,i}^{q,r}} =\left| \bar{h}_{j,i}^{q,r} \right| \bar{\mathbf{U}}\left( \bar{\phi}_{j,i}^{q,r} \right) \Rmat{2}{2}, \end{IEEEeqnarray} where $\bar{h}_{j,i}^{q,r}$ is the \textit{complex} channel gain between the $r$th antenna of transmitter $i$ and the $q$th antenna of receiver $j$, $\bar \phi _{j,i}^{q,r}$ is the complex phase of $\bar{h}_{j,i}^{q,r}$, and $\mathbf{\bar U} \left( {\bar \phi _{j,i}^{q,r}} \right) \,\Rmat{2}{2} $ is an unitary matrix given by: \begin{IEEEeqnarray}{c} \label{eq:matrixU} \bar{\mathbf{U}}\left( \bar \phi _{j,i}^{q,r} \right) = \begin{bmatrix} \cos \left( \bar \phi _{j,i}^{q,r} \right) & - \sin \left( {\bar{\phi}_{j,i}^{q,r}} \right) \vspace{1mm}\\ \sin \left( \bar {\phi} _{j,i}^{q,r} \right) & \cos \left( {\bar \phi _{j,i}^{q,r}} \right) \end{bmatrix}, \end{IEEEeqnarray} with some interesting properties, for example: \begin{IEEEeqnarray}{l} \label{eq:propertiesU} \hskip -5mm \begin{matrix} {\mathbf{\bar U}}\left( a \right){\mathbf{\bar U}}\left( b \right) = { \mathbf{\bar U}}\left( {a+b} \right) , \,\, {\mathbf{\bar U}}{\left( a \right)^{ - 1}} = {\mathbf{\bar U}}\left( -a \right), \end{matrix} \end{IEEEeqnarray} for any arbitrary phases $a,b \in \left[ \,0,2\pi \,\right] $. For the sake of clarity, let us write the equivalent channel channel matrix ${\hat \Hn_{j,i} \Rmat{2T(p+1)}{2Tp}}$ when the two previous concepts are together applied, given by \begin{IEEEeqnarray}{c} \label{eq:extendedChannel} \hat \Hn_{j,i} = \begin{bmatrix} \Cn \left( \bar{h}_{j,i}^{1,1} \right) & \dots & \Cn \left( \bar{h}_{j,i}^{1,p} \right) \\ \vdots & \ddots & \vdots \\ \Cn \left( \bar{h}_{j,i}^{p+1,1} \right) & \dots & \Cn \left( \bar{h}_{j,i}^{p+1,p} \right) \end{bmatrix}, \end{IEEEeqnarray} with ${\Cn \left( \bar{h}_{j,i}^{q,r} \right) = \left| \bar h_{j,i}^{q,r} \right| \mathbf{I}_T \otimes \mathbf{\bar U} \left( \bar \phi _{j,i}^{q,r} \right)}$. Now the last step to obtain the system model in (\ref{eq:extendedSignal2}) consists on applying a CB operation \cite{AlignmentChainsTrans}: \begin{IEEEeqnarray}{c} \label{eq:CB} \Hn_{j,i} = \CB{ \hat\Hn_{j,i} } = \mathbf{R}_{j} \hat\Hn_{j,i} \mathbf{T}_{i}, \end{IEEEeqnarray} where $\mathbf{R}_{j} \Rmat{2T(p+1)}{2T(p+1)} $ and $\mathbf{T}_{j} \Rmat{2Tp}{2Tp} $ are invertible linear transformations applied at the transmitters and the receivers. This way the equivalent channel becomes a rotation of $\hat\Hn_{j,i}$ with zeros at some specific antenna elements, see \cite{AlignmentChainsTrans} for details. In this work, the same CB as in \cite{AlignmentChainsTrans} is applied at the transmit side, whereas that for the receiver side contains some additional operations described in \mbox{Appendix \ref{sec:appendixA}}. This way we obtain a simplified structure for the channel matrices, which simplifies the precoding design based on interference alignment, as well as the achievability proof. \\ \textit{Remark}: Notice that matrices $\mathbf{R}_{j}$ and $\mathbf{T}_{j}$ are applied at the transmitter and the receiver, respectively. Therefore, the equivalent precoding matrix at each transmitter and receiving filter at each receiver are $\mathbf{W}_{j} \mathbf{R}_{j}$ and $\mathbf{T}_{j} \Vn_{j}$, respectively. \section{Degrees of Freedom} \label{sec:DoF} The DoF per user $d_{j}$ for the 3-user $\left(p,p+1 \right)$ MIMO IC are upper bounded \cite{AlignmentChainsTrans} by \begin{IEEEeqnarray}{c} \label{eq:DoFouterbound} {d}_j \leq \dot{d}_{j} = \frac{{p\left( {p + 1} \right)}}{{2p + 1}}. \end{IEEEeqnarray} On the other hand, the DoF achieved by the $j$th user assuming the channel model described in Section \ref{sec:2SystemModel} are given by \begin{IEEEeqnarray}{c} \label{eq:DoF_extended} \mathring{d}_j = \frac{1}{2T} \Rank{ \mathbf{W}_j \Hn_{j,j} \Vn_j } \overset{(a)}{\leq} \frac{\hat{d}_j}{2T} {\leq} d_{j} \end{IEEEeqnarray} in case all the received interference is completely removed, i.e. \begin{IEEEeqnarray}{c} \mathbf{{W}}_{j} \mathbf{{H}}_{j,i} \mathbf{{V}}_i = \0 , \quad \forall i \neq j . \label{eq:noInterferenceb} \end{IEEEeqnarray} The previous condition forces ${\mathbf{W}}_j$ to be an orthogonal projection onto the interference space. Consequently, (\ref{eq:DoF_extended} - $a$) will be satisfied with equality only in case the desired and interfering signals are \textit{linearly independent}. Let define the $\textit{signal space matrix}$ (SSM) as the matrix whose columns generate the sum space of desired and interference subspaces at each receiver, \begin{IEEEeqnarray}{c} \label{eq:Gdefinition} \begin{matrix} \Gn_j = \big[ \Gdes \, \Gint \big] \\[2mm] \Span{\Gdes} = \Span{{\Hn}_{j,j}{\Vn}_j} \\[2mm] \Span{\Gint}= \Span{ \begin{bmatrix} {\Hn}_{j,j-1}{\Vn}_{j-1} & {\Hn}_{j,j+1}{\Vn}_{j+1} \end{bmatrix} }, \end{matrix} \end{IEEEeqnarray} where $\Gdes$ and $\Gint$ are defined as some full-rank matrices whose columns form a basis (see definition of operator $\mathsf{span}(\cdot)$ in the notation section) for the subspaces occupied by desired and interference signals, respectively. Given this formulation, proving the DoF achievability reduces to prove that the SSM is full-rank, since in such a case desired and interfering signals are linearly independent, thus there exists a solution for transmitting and receiving filters simultaneously satisfying (\ref{eq:DoF_extended} - $a$) with equality and (\ref{eq:noInterferenceb}). The present work proves that the achievable DoF $\mathring{d}_{j}$ and outer bound DoF $\dot{d}_{j}$ coincide on the optimal DoF $d_{j}$. This is shown by proposing a precoding scheme that can reliably transmit ${\hat d_j= 2p\left(p+1\right)}$ data symbols employing ACS and $T=2p+1$ symbol extensions in time. \section{Precoding matrix structure} \label{sec:PrecodingStructure} The \textit{subspace alignment chains} concept \cite{AlignmentChainsTrans} describes a linear precoding strategy whereby the transmit precoders of the different users are connected for getting the alignment of interfering signals at each receiver. For the proper alignment of interfering signals at the receivers, the precoding matrix of each user is divided in $p$ sub-block matrices, grouped in three main matrix blocks, \begin{IEEEeqnarray}{l} \Vn_i \! = \! \! \begin{pmat}[{..|.|..}] \Vn_{i,\left(1\right)}^1 & \ldots & \Vn_{i,\left(S_i^1\right)}^1 & \Vn_{i,\left(1\right)}^2 & \ldots & \ldots & \Vn_{i,\left(S_i^3 \right)}^3 \cr \end{pmat} \mathbf{P}_i, \label{eq:precMatrix} \end{IEEEeqnarray} where $\mathbf{P}_i \Rmat{\hat{d}_j}{\hat{d}_j}$ is an arbitrary unitary permutation matrix used to obtain the same structure for all users and $\Vn_{i,\left(s\right)}^{k} \Rmat{2Tp}{2(p+1)}$ denotes the $s$th sub-block of the $i$th user designed according to the $k$th alignment chain condition. Three alignment chains are built, describing the constraints to be satisfied by each sub-block, see (\ref{eq:AlternateAlignChaina})-(\ref{eq:AlternateAlignChaind}), where $k=1,2,3$ identifies each alignment chain, $\eta_k = k - p$ is the last receiver of the $k$th chain, and the value $S_i^k$ denotes the number of sub-blocks corresponding to the $i$th user designed according to the $k$th alignment chain. Since there are 3 users and each precoding matrix has $p$ sub-blocks, $S_i^k$ may be expressed in closed form as \setcounter{equation}{19} \begin{IEEEeqnarray}{c} S_i^k = \left\lceil \frac {p - \left\langle {k - i} \right\rangle} {3} \right\rceil . \end{IEEEeqnarray} \begin{figure*} \setcounter{equation}{14} \begin{IEEEeqnarray}{c} \Span{ \Hn_{k+1,k}{\Vn_{k,(1)}^k }} = \Span{ \Hn_{k+1,k-1}\mathbf{V}_{k-1,(1)}^k} \label{eq:AlternateAlignChaina} \\ \Span{ \Hn_{k,k-1}{\Vn_{k-1,(1)}^k }} = \Span{ \Hn_{k,k+1}\mathbf{V}_{k+1,(1)}^k} \label{eq:AlternateAlignChainb} \\ \Span{ \Hn_{k-1,k+1}{\Vn_{k+1,(1)}^k }} = \Span{ \Hn_{k-1,k}\mathbf{V}_{k,(2)}^k} \label{eq:AlternateAlignChainc} \\ \nonumber \vdots \\ \Span{ \Hn_{\eta_k,\eta_k-1} \Vn_{\eta_k-1,\big(S_{\eta_k-1}^k\big)}^k } = \Span{ \Hn_{\eta_k,\eta_k+1} \Vn_{\eta_k+1,\big(S_{\eta_k+1}^k\big)}^k } \label{eq:AlternateAlignChaind} \end{IEEEeqnarray} \begin{IEEEeqnarray}{c} \begin{bmatrix} \Hn_{k+1,k} & -\Hn_{k+1,k-1} & \0 & \ldots & \0 \\ \0 &\Hn_{k,k-1} & -\Hn_{k,k-2} & &\vdots \\ \vdots & \ddots & \ddots & \ddots & \0 \\ \0 & \ldots & \0 & \Hn_{\eta_k,\eta_k-1} &-\Hn_{\eta_k,\eta_k+1} \end{bmatrix} \begin{bmatrix} \Vn_{k,\left(1\right)}^k \\ \Vn_{k-1,\left(1\right)}^k \\ \Vn_{k-2,\left(1\right)}^k \\ \Vn_{k,\left(2\right)}^k \\ \vdots \\ \Vn_{\eta_k+1,\left(S_{\eta_k+1}^k\right)}^k \end{bmatrix} = \0 \label{eq:GeneralAlignChain} \end{IEEEeqnarray} \hrule \vspace*{-8mm} \end{figure*} \begin{figure}[] \begin{center} \centerline{\includegraphics[width=0.45\linewidth]{alignmentchain.pdf}} \caption[General Alignment chain] {Occupation of receivers for the signals designed using alignment chain $k$ ($p=3$ case). Ovals represent different subspaces at transmitters and receivers. Colors/Line patterns identify users.} \label{fig:alignChainNoSquare} \end{center} \vspace{-6mm} \end{figure} The meaning of the alignment chain conditions in (\ref{eq:AlternateAlignChaina})-(\ref{eq:AlternateAlignChaind}) is reviewed in the sequel, and depicted for the $p=3$ case in Fig. \ref{fig:alignChainNoSquare}, where ovals represent the subspaces for the $k$th alignment chain at each transmitter/receiver, and each color/line pattern identifies each user's signals. First, (\ref{eq:AlternateAlignChaina}) states that the subspace occupied by the sub-block $\mathbf{V}_{k,(1)}^k $ should be same as that for the sub-block $\mathbf{V}_{k-1,(1)}^k$ at the $(k+1)$th receiver, see Fig. \ref{fig:alignChainNoSquare}. In the literature, this is usually expressed as the alignment among sub-block $\mathbf{V}_{k,(1)}^k $ and sub-block $\mathbf{V}_{k-1,(1)}^k$ at receiver $(k+1)$. Next, (\ref{eq:AlternateAlignChainb}) ensures that this latter sub-block is, $\textit{at the same time}$, aligned with $\mathbf{V}_{k+1,(1)}^k$ at the $k$th receiver. This process continues as long as there exists a subspace at each receiver where signals can be aligned. The existence of such subspace can be guaranteed by means of basic linear algebra properties (see \cite{AlignmentChainsTrans} for details), and defines the length of the alignment chain, corresponding to the number of sub-blocks designed according to such chain. Notice that the first and last sub-blocks in each alignment chain participate only in the first and the last conditions, respectively. Consequently, they are only aligned with other undesired signals at one of the non-intended receivers. This can be observed in Fig. \ref{fig:alignChainNoSquare} at receiver $k-1$. The resolution of (\ref{eq:AlternateAlignChaina})-(\ref{eq:AlternateAlignChaind}) is typically tackled by dropping the $\Span{\cdot}$ operators and simply equating the matrices at both sides, as in (\ref{eq:GeneralAlignChain}). Hence, the precoding matrices are obtained as the right null space of some matrix\footnote{For $p=2$ the notation has to be minorly changed. This case will be addressed in Section \ref{sec:5case23}.}. Notice that (\ref{eq:GeneralAlignChain}) represents a sufficient but not necessary condition for (\ref{eq:AlternateAlignChaina})-(\ref{eq:AlternateAlignChaind}). In other words, (\ref{eq:GeneralAlignChain}) is more restrictive than (\ref{eq:AlternateAlignChaina})-(\ref{eq:AlternateAlignChaind}), but it is sufficient for our purpose. Finally, for convenience in the analysis each sub-block $\Vn_{i,\left(s\right)}^{k} $ is subsequently divided in $p$ blocks by rows, as follows: \setcounter{equation}{20} \begin{IEEEeqnarray}{c} \label{eq:subprecodingMatrix} {\mathbf{V}}_{i,\left( s \right)}^k = \! \Stack { \Vn_{i,\left(s\right)}^{k,1} , \Vn_{i,\left(s\right))}^{k,2} , \! \dots, \,\, \Vn_{i,\left(s\right))}^{k,p} }, \end{IEEEeqnarray} where each $\Vn_{i,\left(s\right)}^{k,r} \Rmat{2T}{2(p+1)}$ corresponds to one of the $r=1\dots p$ transmit antennas. \section{The $\left(2,3\right)$ Case} \label{sec:5case23} This section characterizes the DoF of the (2,3) constant MIMO IC. A precoding scheme is presented where each transmitter delivers $\hat d_j = 12$ real-valued symbols to its intended receiver over $2T=10$ channel extensions, thus attaining the DoF outer bound of $\nicefrac{6}{5}$ according to (\ref{eq:DoFouterbound}). First, the precoding matrices are obtained for this antenna deployment in Section \ref{sec:5A}, designed according to minorly modified conditions from the ones shown in Section \ref{sec:PrecodingStructure}. Next, Section \ref{sec:5B} derives the SSM $\mathbf{G}_j$ introduced in (\ref{eq:Gdefinition}) and provides the achievability proof for the proposed precoding scheme. \def1{1} \subsection{Precoding matrix design} \label{sec:5A} According to definitions (\ref{eq:precMatrix}) and (\ref{eq:subprecodingMatrix}), each precoding matrix can be written as \begin{IEEEeqnarray}{c} \label{eq:precod_p2} \Vn_i = { \begin{bmatrix} \Vn_i^{1} & \Vn_i^{2}\\ \end{bmatrix} }, \quad \Vn_i^k = { \begin{bmatrix} \Vn_i^{k,1} \\ \Vn_i^{k,2} \end{bmatrix} }, \end{IEEEeqnarray} with ${\mathbf{V}_i\Rmat{20}{12}}$, ${\mathbf{V}_i^k\Rmat{20}{6}}$ and ${\mathbf{V}_i^{k,q}\Rmat{10}{6}}$. Notice that for ease of notation the subindex $s$ appearing in (\ref{eq:precMatrix}) has been dropped. The three alignment chains for this case are \begin{IEEEeqnarray*}{c} \label{eq:alChains23} \begin{matrix} \big[ \Hn_{2,1},-\Hn_{2,3} \big] \!\! \begin{bmatrix} \Vn_1^1 \\ \Vn_3^1 \end{bmatrix} = \0 , \quad \big[ \Hn_{3,2} , -\Hn_{3,1} \big] \!\! \begin{bmatrix} \Vn_2^1 \\ \Vn_1^2 \end{bmatrix} = \0 , \, \quad \big[ \Hn_{1,3} , -\Hn_{12} \big] \!\! \begin{bmatrix} \Vn_3^2 \\ \Vn_2^2 \end{bmatrix} = \0 . \end{matrix} \end{IEEEeqnarray*} Next, we focus without loss of generalization on the first alignment chain. By plugging the particular structure of equivalent channels (see Appendix \ref{sec:appendixA}), it reduces to \begin{IEEEeqnarray*}{c} \setlength{\arraycolsep}{2pt} \begin{bmatrix} \mathbf{C}\left( {h}_{2,1}^{1,1} \right) & \0 & \0 & \0 \\ \0 & \mathbf{C}\left( {h}_{2,1}^{2,2} \right) & \mathbf{C}\left( {h}_{2,3}^{2,1} \right) & \0 \\ \0 & \0 & \0 & \mathbf{C}\left( {h}_{2,3}^{3,2} \right)\\ \end{bmatrix} \!\! \begin{bmatrix} {{\mathbf{V}}_1^{1,1}}\\ {{\mathbf{V}}_1^{1,2}}\\ {{\mathbf{V}}_3^{1,1}}\\ {{\mathbf{V}}_3^{1,2}} \end{bmatrix} = \0 . \nonumber \label{eq:22_alChains23} \end{IEEEeqnarray*} \setlength{\arraycolsep}{5pt} \def1{1} This is easily solved by using properties in (\ref{eq:propertiesU}) and taking into account that non-zero blocks are full-rank with high probability, obtaining \begin{IEEEeqnarray*}{c} {{\mathbf{V}}_1^{1,1} = {\0} }, \quad {{\mathbf{V}}_3^{1,1} = \Cn\left( {\frac{{{h}_{2,1}^{2,2}}}{{{h}_{2,3}^{2,1}}}} \right){\mathbf{V}}_1^{1,2} }, \quad {{\mathbf{V}}_3^{1,2} = {\0}}. \nonumber \label{eq:23solutionAlChains23} \end{IEEEeqnarray*} Similarly, one may solve the rest of alignment chains, finally obtaining \def1{1} \begin{IEEEeqnarray*}{c} {\mathbf{V}_1} = \begin{bmatrix} \0& \mathbf{C} \left( \frac{{h}_{3,2}^{2,2}}{{h}_{3,1}^{2,1}} \right) \Vn_2^{1,2}\\ \Vn_1^{1,2}&\0 \end{bmatrix} \mathbf{P}_1, \qquad {\mathbf{V}_2} = \begin{bmatrix} \0& \mathbf{C} \left( \frac{{h}_{1,3}^{2,2}}{{h}_{12}^{2,1}} \right) \Vn_3^{2,2}\\ \Vn_2^{1,2}&\0 \end{bmatrix} \mathbf{P}_2, \\ {\mathbf{V}_3} = \begin{bmatrix} \mathbf{C} \left( \frac{{h}_{2,1}^{2,2}}{{h}_{2,3}^{2,1}} \right) \Vn_1^{1,2} & \0\\ \0 & \Vn_3^{2,2} \end{bmatrix} \mathbf{P}_3. \end{IEEEeqnarray*} Now we will make use of the permutation matrices $\mathbf{P}_i$ in order to obtain the same structure for all precoding matrices. Notice that reordering the columns of the precoders does not affect to the interference alignment. Furthermore, notice that there are only three precoding sub-blocks different from zero. Hereafter, they will be referred to as the support precoding blocks (SPBs) and denoted as $\An_1,\An_2$ and $\An_3$. Therefore, the $j$th precoding matrix for $j=1,2,3$ is generally written as follows: \setcounter{equation}{23} \begin{IEEEeqnarray}{c} \Vn_j = \begin{bmatrix} \mathbf{C} \left( \frac{{h}_{j - 1,j + 1}^{2,2}}{{h}_{j - 1,j}^{2,1}} \right) \An_{j + 1} & \0 \\ \0 & \An_j \end{bmatrix}. \label{eq:25} \end{IEEEeqnarray} \subsection{Achievability proof} \label{sec:5B} This section derives the SSM $\mathbf{G}_j$ as a function of the SPBs. Then, a design for those matrices is proposed easing the achievability proof, formalized in \mbox{Lemma \ref{lem:p=2}}. For the proper computation of the SSM, let write \setlength{\arraycolsep}{2pt} \begin{IEEEeqnarray}{c} \small \big[ \Hn_{j,j + 1}\!\Vn_{j + 1},\Hn_{j,j - 1} \Vn_{j - 1} \big] = \!\! \begin{bmatrix} \Cn \! \left( \frac{{h}_{j,j - 1}^{1,1} {h}_{j + 1,j}^{2,2}} {{h}_{j+1,j-1}^{2,1}} \right) \! \An_j \!\! & \0 & \0 & \0\\ \0 & \Cn \! \left( {{h}_{j,j - 1}^{2,2}} \right) \! \An_{j - 1} & \Cn \! \left( {h}_{j,j - 1}^{2,2} \right) \! \An_{j - 1}\! & \0\\ \0 & \0 & \0 & \Cn \! \left( {{h}_{j,j + 1}^{3,2}} \right) \! \An_{j + 1} \end{bmatrix} \nonumber \\ \label{eq:crossProducts} \end{IEEEeqnarray} defining the subspaces of received interference at the $j$th receiver, see (\ref{eq:Gdefinition}). Notice that the third block column of (\ref{eq:crossProducts}) is aligned with the second block column of (\ref{eq:crossProducts}), which is actually forced by the alignment chain $j+1$. As a result, the basis for the interfering space $\Gint$ is defined by the three linearly independent block columns of (\ref{eq:crossProducts}), and the SSM $\mathbf{G}_j$ is given by (\ref{eq:28matrixG_23}). \def1{1} \setlength{\arraycolsep}{5pt} \begin{figure*} \setcounter{equation}{22} \def1{1.3} \setlength{\arraycolsep}{5pt} \begin{IEEEeqnarray}{c} \Gn_j= \begin{bmatrix} \Cn\left( {h}_{j,j}^{1,1} \right) \An_{j + 1} & \Cn\left( {h}_{j,j}^{1,2} \right) \An_j & \Cn\left( \frac{{h}_{j,j - 1}^{1,1} {h}_{j + 1,j}^{2,2}} {{h}_{j+1,j-1}^{2,1}} \right) \An_j & \0 & \0 \\ \Cn\left( {h}_{j,j}^{2,1} \right) \An_{j + 1} & \Cn\left( {h}_{j,j}^{2,2} \right) \An_j & \0 & \Cn \left( {h}_{j,j - 1}^{2,2} \right) \An_{j-1} & \0 \\[2mm] \Cn \left( {h}_{j,j}^{3,1} \right) \An_{j+1} & \Cn \left( {h}_{j,j}^{3,2} \right) \An_j & \0 & \0 & \Cn \left( {h}_{j,j + 1}^{3,2} \right) \An_{j + 1} \end{bmatrix} \def1{1} \nonumber \\ \label{eq:28matrixG_23} \end{IEEEeqnarray} \hrule \vspace{-10mm} \end{figure*} The SSM obtained in (\ref{eq:28matrixG_23}) is similar to the equivalent magnitude obtained in equation (16) of \cite{ACSnoPublicat}. Even though in this case the full-rank condition for the SSM can be ensured by picking entries of the SPBs randomly (as pointed out by \cite{ACSnoPublicat}), we present a formal proof that is also useful for the non-straightforward $p>2$ case. Let define $\boldsymbol\lambda_i^j \Rmat{6}{1}$, $i=1\ldots5$, $j=1,2,3$ as the \textit{rank multipliers}. Then, one may ensure that the SSM is full-rank iff the only solution for \setcounter{equation}{25} \begin{IEEEeqnarray}{c} \label{eq:29Glanda} \Gn_j \Big[ \, \left( \boldsymbol{\lambda }_1^j \right)^T \,\ldots \, \left(\boldsymbol{\lambda }_5^j\right)^T \,\, \Big]^T = \0 \end{IEEEeqnarray} is to set all rank multipliers to zero. To this end, let also define an arbitrary orthonormal basis ${\mathbf{B}= \Big[ \mathbf{b}_{1} \, \mathbf{b}_{2} \, \ldots \, \mathbf{b}_{10} \Big] \Rmat{10}{10}}$. We propose the following design: \begin{IEEEeqnarray}{c} \setlength{\arraycolsep}{6pt} \begin{matrix} \An_1 = \begin{bmatrix} \mathbf{B}_{1:2} & \mathbf{B}_{3:5} & \mathbf{B}_6 \end{bmatrix}, \quad \An_2 = \begin{bmatrix} \mathbf{B}_{1:2} & \mathbf{B}_{7:9} & \mathbf{B}_{10} \end{bmatrix}, \quad \An_3 = \begin{bmatrix} \mathbf{B}_{3:5} & \mathbf{B}_{7:9} \end{bmatrix}. \end{matrix} \label{eq:30Adesign} \end{IEEEeqnarray} The following lemma states the DoF achievability: \begin{lemma}[$\mathbf{G}_j$ full-rank for $p=2$] \label{lem:p=2} Considering (\ref{eq:28matrixG_23}) and the SPBs chosen as in (\ref{eq:30Adesign}), then the only possible solution for (\ref{eq:29Glanda}) is $\boldsymbol{\lambda}_i^j=\0, \forall i,j$. \end{lemma} \begin{IEEEproof} See Appendix \ref{sec:appendixB}. \end{IEEEproof} Finally, the optimal DoF are settled by means of the following theorem: \begin{theorem}[DoF for the (2,3) case] \label{theorem23} The 3-user $\left(2,3 \right)$ MIMO IC with constant channel coefficients has exactly 6/5 DoF per user, and they can be achieved by means of linear precoding at the transmitters and linear filtering at the receivers. \end{theorem} \begin{IEEEproof} Each user transmits $ \hat{d}=12$ real-valued symbol streams along $T=5$ symbol extensions in time, considering ACS, and the precoding scheme described in Section \ref{sec:5A}. Therefore, according to Lemma \ref{lem:p=2}, the SSM $\mathbf{G}_j$ becomes full rank, thus interference and desired signals become linearly independent, and the desired symbols can be decoded. Since the DoF outer bound (\ref{eq:DoFouterbound}) and the achievable DoF attained by the proposed scheme match, this value corresponds to the optimal DoF. \end{IEEEproof} \section{The $\left(p,p+1\right)$ case with $p>2$} \label{sec:6generalCase} This section defines the optimal DoF for the $p\geq 3$ case. A precoding scheme is presented where each user obtains $\hat d_j = 2p\left(p+1\right)$ real-valued data symbols over $2T=2\left(2p+1\right)$ channel extensions, thus attaining the DoF outer bound $\frac{p\left(p+1\right)}{2p+1}$ in (\ref{eq:DoFouterbound}). Unfortunately, the number of conditions used for the precoder design, see (\ref{eq:GeneralAlignChain}), increases with $p^2$. Therefore, the complexity of the analysis using the approach for the $p=2$ case becomes cumbersome as $p$ grows. This section presents a methodology to simplify the resolution of such matrix equation system, which will be illustrated for the $p=3$ case. The core of this methodology is the \ac{ZP} algorithm, which allows to obtain the structure of the transmit and receive filters for any value of $p$. \subsection{Precoding matrix design} \label{sec:6A} Consider the first alignment chain ($k=1$) given by (\ref{eq:31}), shown at the top of the next page. \begin{figure*}[t] \setcounter{equation}{29} \begin{IEEEeqnarray*}{c} \def1{1.5} \setlength{\arraycolsep}{2pt} \begin{bmatrix} \Cn \left( {h}_{2,1}^{1,1} \right) \!&\!\0&\0&\0&\0&\0&\0&\0&\0 \\ \0&\Cn \left( {h}_{2,1}^{2,2} \right)& \Cn \left( {h}_{2,1}^{2,3} \right)& \Cn \left( {h}_{2,3}^{2,1} \right)&\0&\0&\0&\0&\0 \\ \0 & \0 & \Cn \left( {h}_{2,1}^{3,3} \right)& \Cn \left( {h}_{2,3}^{3,1} \right)& \Cn \left( {h}_{2,3}^{3,2} \right) & \0&\0&\0&\0 \\ \0&\0&\0&\0&\0&\Cn \left( {h}_{2,3}^{4,3} \right)&\0&\0&\0 \\ \0&\0&\0&\Cn \left( {h}_{1,3}^{1,1} \right) &\0&\0&\0&\0&\0 \\ \0&\0&\0&\0&\Cn \left( {h}_{1,3}^{2,2} \right)& \Cn \left( {h}_{1,3}^{2,3} \right)& \Cn \left( {h}_{1,2}^{2,1} \right)&\0&\0 \\ \0&\0&\0 & \0 & \0 & \Cn \left( {h}_{1,3}^{3,3} \right)& \Cn \left( {h}_{1,2}^{3,1} \right)& \Cn \left( {h}_{1,2}^{3,2} \right) & \0 \\ \0&\0&\0&\0&\0&\0&\0&\0&\Cn \left( {h}_{1,2}^{4,3} \right) \end{bmatrix} \begin{bmatrix} \Vn_{1,\left(1\right)}^{1,1} \\ \Vn_{1,\left(1\right)}^{1,2} \\ \Vn_{1,\left(1\right)}^{1,3} \\ \Vn_{3,\left(1\right)}^{1,1} \\ \Vn_{3,\left(1\right)}^{1,2} \\ \Vn_{3,\left(1\right)}^{1,3} \\ \Vn_{2,\left(1\right)}^{1,1} \\ \Vn_{2,\left(1\right)}^{1,2} \\ \Vn_{2,\left(1\right)}^{1,3} \\ \end{bmatrix} = \0 \end{IEEEeqnarray*} \begin{align} \label{eq:31} \mathbf{E} \cdot \mathbf{F} = \0 \end{align} \vspace{-8mm} \centering \def1{1.2} \setlength{\arraycolsep}{6pt} \begin{IEEEeqnarray}{c} \begin{bmatrix} \0 &\0&\0&\0&\0&\0&\0&\0&\0 \\ \0&\Cn \left( {h}_{2,1}^{2,2} \right)& \Cn \left( {h}_{2,1}^{2,3} \right)& \0&\0&\0&\0&\0&\0 \\ \0 & \0 & \Cn \left( {h}_{2,1}^{3,3} \right)& \0& \Cn \left( {h}_{2,3}^{3,2} \right) & \0&\0&\0&\0 \\ \0&\0&\0&\0&\0&\0&\0&\0&\0 \\ \0&\0&\0&\0 &\0&\0&\0&\0&\0 \\ \0&\0&\0&\0&\Cn \left( {h}_{1,3}^{2,2} \right)& \0& \Cn \left( {h}_{1,2}^{2,1} \right)&\0&\0 \\ \0&\0&\0 & \0 & \0 & \0& \Cn \left( {h}_{1,2}^{3,1} \right)& \Cn \left( {h}_{1,2}^{3,2} \right) & \0 \\ \0&\0&\0&\0&\0&\0&\0&\0&\0 \end{bmatrix} \begin{bmatrix} \0 \\ \Vn_{1,\left(1\right)}^{1,2} \\ \Vn_{1,\left(1\right)}^{1,3} \\ \0 \\ \Vn_{3,\left(1\right)}^{1,2} \\ \0 \\ \Vn_{2,\left(1\right)}^{1,1} \\ \Vn_{2,\left(1\right)}^{1,2} \\ \0 \\ \end{bmatrix} = \0 \label{eq:outputZP} \setlength{\arraycolsep}{5pt} \end{IEEEeqnarray} \\ \hrule \vspace{-12mm} \end{figure*} It can be observed that thanks to the obtained structure of matrix $\mathbf{E}$, some sub-blocks of $\mathbf{F}$ are zero. For example, consider the fifth block row element \setcounter{equation}{27} \begin{IEEEeqnarray}{c} \Cn\left( {{h}_{1,3}^{1,1}} \right){\mathbf{V}}_{3,\left( 1 \right)}^{1,1} = \0. \label{eq:3,2a} \end{IEEEeqnarray} Clearly, the only solution for (\ref{eq:3,2a}) is $\mathbf{V}_{3,(1)}^{1,1}=\0$. Hence, other equations where this variable participates are simplified. These events are denoted as {\it zero propagations} (ZP) and give the possibility of finding which blocks are zero for $\mathbf{F}$ in (\ref{eq:31}). Inspired by this idea, we present the ZP algorithm, see \mbox{Table 1}. \def1{1.7} \begin{table*} \begin{center} \begin{minipage}{0.9\linewidth} \normalsize \caption{\small Zero Propagation Algorithm}\label{ZPalg} \vspace{-6mm} \begin{tabular}{l p{0.8\linewidth}} \hhline{==} \multicolumn{2}{p{0.94\linewidth}}{Consider the matrix equation system given by ${\mathbf{E} \cdot \mathbf{F} = \0}$, with ${\mathbf{F} \Rmat{F_\text{BR} \cdot r_\text{F}}{F_\text{BC}}}$ and ${\mathbf{E} \Rmat{E_\text{BR} \cdot r_\text{E}}{F_\text{BR} \cdot r_\text{F}}}$, where $r_\text{F} (r_\text{E})$ defines the number of block rows of $\mathbf{E}$ ($\mathbf{F}$). Moreover, $F_\text{BC}$ ($F_\text{BR}$) defines the number of columns (rows) of each block element of $\mathbf{F}$, and $E_\text{BR}$ defines the number of rows of each block column of $\mathbf{E}$. The blocks of $\mathbf{F}$ that can be set to zero may be obtained by computing the following steps:} \\[-1mm] 1. & Find one block row in $\mathbf{E}$ containing only one non-zero element, located at the $[r^*,c^*]$th block position. \\ 2. & Set $\begin{cases}\mathbf{E}(r^*,:)=\text{zeros}(E_\text{BR}, F_\text{BR} \cdot r_\text{F}) \\ {\mathbf{E}(:,c^*)=\text{zeros}(E_\text{BR} \cdot r_\text{E},F_\text{BR})}\end{cases}$ \\ 3. & Set $\mathbf{F}(c^*,:)=\text{zeros}(F_\text{BR},F_\text{BC})$. \\ 4. & Repeat (1)-(3) until (1) provides no more block rows. \\ \hhline{==} \end{tabular} \end{minipage} \end{center} \vspace{-10mm} \end{table*} \def1{1} This algorithm allows to simplify the conditions initially presented in (\ref{eq:31}) to obtain (\ref{eq:outputZP}). Note that the 1st, 4th, 6th and 9th block elements of $\mathbf{F}$ in (\ref{eq:31}) are forced to be zero. Moreover, by writing the remaining equations it turns out that each precoding matrix can be written as a function of three SPBs, as follows: \setlength{\arraycolsep}{5pt} \begin{IEEEeqnarray}{c} {{\mathbf{V}}_i} = \! \begin{bmatrix} \Cn\left(\theta_{i,(1)}^{i-1,1}\right)\An_{i-1} & \0 & \0 \\ \Cn\left(\theta_{i,(1)}^{i-1,2}\right)\An_{i-1} & \Cn\left(\theta_{i,(1)}^{i+1,2}\right)\An_{i+1} & \Cn\left(\theta_{i,(1)}^{i,2}\right)\An_{i} \\ \0 & \0 & \An_i \end{bmatrix}, \label{eq:34} \end{IEEEeqnarray} where $\theta _{i,\left( 1 \right)}^{q,r}$ stands for the complex value obtained from the $q$th alignment chain and located at the $r$th block row of ${\mathbf{V}}_i$. Those complex numbers can be obtained by removing the rows and columns with zeros from (\ref{eq:outputZP}) and computing a null space basis. Note that the number of unknown sub-block matrices is reduced from 27 in (\ref{eq:31}) to 3 in (\ref{eq:34}). In general, the $3p^2$ variables (block matrices) involved in all alignment chains can be written as a function of the three SPBs of dimension $2(2p+1)\times 2(p+1)$. \subsection{Achievability proof} \label{sec:6B} This section derives the SSM for the $p=3$ case, and gives some intuitions about the general case. First, a design for the three SPBs in (\ref{eq:34}) is proposed, generalizing (\ref{eq:30Adesign}) for any value of $p$. Second, the SSM is shown to be full rank, hence the optimal DoF are stated in \mbox{Theorem \ref{theorem34}}. In order to build $\mathbf{G}_j$, it is necessary to compute a basis for the sum space defined by the received interference and desired signals. Regarding the desired signals, it can be easily seen that $\Gn_j^{\text{des}}={{\mathbf{H}}_{j,j}}{{\mathbf{V}}_{j}}$. On the other hand, since some of the interference is aligned it is necessary to first calculate the products ${{\mathbf{H}}_{j,j-1}}{{\mathbf{V}}_{j-1}}$ and ${{\mathbf{H}}_{j,j+1}}{{\mathbf{V}}_{j+1}}$. Next, we will see that this task can be highly alleviated. Recall on the fact that the ZP algorithm output in (\ref{eq:outputZP}) not only states which sub-blocks of each $\Vn_i$ are actually zero, but also which conditions should satisfy the remaining sub-blocks. For example, from (\ref{eq:outputZP}) it can be observed that \vspace{-1mm} \setcounter{equation}{31} \begin{IEEEeqnarray}{c} \Cn\left( {{h}_{2,1}^{2,2}} \right){\mathbf{V}}_{1,\left( 1 \right)}^{1,2} + \Cn\left( {{h}_{2,1}^{2,3}} \right){\mathbf{V}}_{1,\left( 1 \right)}^{1,3} = {\0} \label{eq:exampleSimpG} \vspace{-1mm} \end{IEEEeqnarray} needs to be satisfied. Interestingly, this is indeed one of the elements resulting from the product $\Hn_{2,1}\Vn_1$. Taking into account all other conditions where there are only elements managed by one unique transmitter, the products ${{\mathbf{H}}_{j,j-1}}{{\mathbf{V}}_{j-1}}$ and ${{\mathbf{H}}_{j,j+1}}{{\mathbf{V}}_{j+1}}$ can be further simplified, obtaining (\ref{eq:prodCreuatsa})-(\ref{eq:prodCreuatsb}), where $\bar \theta _{j,i}^{q,r}$ is the corresponding complex number for the ($q$,$r$)th position of ${\mathbf{H}_{j,i} \mathbf{V}_i , i \ne j}$. Note that in this case due to alignment conditions, we will have $\bar \theta _{j,j - 1}^{q,q} = \bar \theta _{j,j + 1}^{q,q - 1}$ with $q=2,3$, i.e. columns 2, 3 of ${\mathbf{H}}_{j,j + 1}{\mathbf{V}}_{j + 1}$ are aligned with columns 1, 2 of ${\mathbf{H}}_{j,j - 1}{\mathbf{V}}_{j - 1}$, respectively. Therefore, in this case the SSM is given by (\ref{eq:Gdes_p3})-(\ref{eq:Gint_p3}), where $\Gdes(q,r)$ and $\hat \theta _j^{q,r}$ are the matrix and the complex number corresponding to the ($q$,$r$)th position of $\Gdes$ and $\Gint$, respectively. For $\Gdes$, we write the blocks $\Gdes(q,r)$ because they are linear combinations of some extended channel elements, e.g. \vspace{-1mm} \begin{IEEEeqnarray*}{c} {\Gdes(1,2)=\Ch{1,1}{1}}-\C{ \frac{\hel{1,1}{2,2}\hel{3,1}{3,1}}{\hel{3,1}{3,2}} }. \vspace{-1mm} \end{IEEEeqnarray*} Notice that each matrix $\Cn \big(\hat \theta _j^{q,r}\big)$ is a combination of a number of cross-channels coefficients, thus it can be assumed independent of any of the matrices $\Gdes(q,r)$, since they are function of the direct channel coefficients. \begin{figure*}[t] \setcounter{equation}{35} \def1{1.6} \begin{IEEEeqnarray}{r l} \Hn_{j,j-1} \Vn_{j-1} = & \begin{bmatrix} \Cn\left(\bar\theta_{j,j-1}^{1,1}\right)\An_{j+1} & \0 & \0 \\ \Cn\left(\bar\theta_{j,j-1}^{2,1}\right)\An_{j+1} & \Cn\left(\bar\theta_{j,j-1}^{2,2}\right)\An_{j} & \0 \\ \0 & \0 & \Cn\left(\bar\theta_{j,j-1}^{3,3}\right)\An_{j-1} \\ \0 & \0 & \0 \end{bmatrix} \label{eq:prodCreuatsa} \\[2mm] \Hn_{j,j+1} \Vn_{j+1} = & \begin{bmatrix} \0 & \0 & \0 \\ \Cn\left(\bar\theta_{j,j+1}^{2,1}\right)\An_{j} & \0 & \0 \\ \0 & \Cn\left(\bar\theta_{j,j+1}^{3,2}\right)\An_{j-1} & \Cn\left(\bar\theta_{j,j+1}^{3,3}\right)\An_{j+1} \\ \0 & \0 & \Cn\left(\bar\theta_{j,j+1}^{4,3}\right)\An_{j+1} \end{bmatrix} \label{eq:prodCreuatsb} \\[2mm] \Gn_j^{\text{des}} = & \begin{bmatrix} \Geldes{1,1}{j-1}\!\! & \Geldes{1,2}{j+1} & \Geldes{1,3}{j} \\ \Geldes{2,1}{j-1}\!\! & \Geldes{2,2}{j+1} & \Geldes{2,3}{j} \\ \Geldes{3,1}{j-1}\!\! & \Geldes{3,2}{j+1} & \Geldes{3,3}{j} \\ \Geldes{4,1}{j-1}\!\! & \Geldes{4,2}{j+1} & \Geldes{4,3}{j} \end{bmatrix} \label{eq:Gdes_p3} \\[2mm] \Gn_j^{\text{int}} = & \begin{bmatrix} \Gel{1,1}{j+1}\! & \G0 & \G0 & \G0 \\ \Gel{2,1}{j+1}\! & \Gel{2,2}{j} & \G0 & \G0 \\ \G0 & \G0\! & \Gel{2,3}{j-1} & \Gel{2,4}{j+1} \\ \G0 & \G0\! & \G0 & \Gel{3,4}{j+1} \end{bmatrix} \label{eq:Gint_p3} \end{IEEEeqnarray} \hrule \end{figure*} In contrast to (\ref{eq:28matrixG_23}), now it is not that clear if the SSM for this case is full-rank by just taking the SPBs randomly. Next, we provide the proof to verify that $\Gn_j$ is full rank. Magnitudes are defined for a general value of $p$, and all possible procedures are generalized. As before, the SSM may be shown to be full rank iff all ${\boldsymbol\lambda_i^j \Rmat{2(2p+1)}{1}}$, $i=1\ldots 2p+1$, $j=1,2,3$ constrained by \setcounter{equation}{32} \begin{IEEEeqnarray}{c} \label{eq:29GlandaXX} \Gn_j \Big[ \, \left( \boldsymbol{\lambda }_1^j \right)^T \,\ldots \, \left(\boldsymbol{\lambda }_{2p+1}^j\right)^T \,\, \Big]^T = \0 \end{IEEEeqnarray} are actually equal to zero. Define an orthonormal basis $\mathbf{B}=\!\! \left[ \mathbf{b}_1, \mathbf{b}_2\ldots \! \mathbf{b}_{2(2p+1)} \right] \! \Rmat{2(2p+1)}{2(2p+1)}$ and sets \begin{IEEEeqnarray}{c} \begin{matrix} X_1 = \left\{ 3,4,\ldots,p+3 \right\}, \quad X_2 = \left\{ p+4,p+5,\ldots,2p+2\right\}, \\ Y_1 = \left\{ 2p+3,\ldots,3p+3\right\}, \quad Y_2 = \left\{ 3p+4,\ldots,4p+2\right\}, \quad Z = \left\{1,2\right\}. \end{matrix} \label{eq:sets} \end{IEEEeqnarray} We will use these sets to arrange columns of $\mathbf{B}$, e.g. $\mathbf{B}_{X_2}=\mathbf{B}_{p+4:2p+2}$. Accordingly, we set: \begin{IEEEeqnarray}{c} \begin{matrix} \An_1 = \begin{bmatrix} \mathbf{B}_Z & \mathbf{B}_{X_1} & \mathbf{B}_{X_2} \end{bmatrix}, \quad \An_2 = \begin{bmatrix} \mathbf{B}_Z & \mathbf{B}_{Y_1} & \mathbf{B}_{Y_2} \end{bmatrix}, \quad \An_3 = \begin{bmatrix} \mathbf{B}_{X_1} & \mathbf{B}_{Y_1} \end{bmatrix}. \end{matrix} \label{eq:37} \end{IEEEeqnarray} Given these definitions, the following lemma states the DoF achievability: \vskip 2ex \begin{lemma}[$\mathbf{G}_j$ full-rank for $p=3\ldots6$] \label{lem:p=3} For the $p=3, \ldots, 6$ cases, the SSM defined as in (\ref{eq:Gdefinition}) with SPBs chosen as in (\ref{eq:37}) is full rank with probability one. \end{lemma} \begin{IEEEproof} See Appendix \ref{sec:appendixB1}. \end{IEEEproof} \vskip 2ex The DoF characterization for $p=3\ldots6$ follows from Lemma 2, and it is next formalized: \begin{theorem} [DoF of the $\left(p,p+\!1\right)$\! IC,\! $p=3\ldots6$] \label{theorem34} The 3-user $\left(p,p+1\right)$, $p=3\ldots6$ MIMO IC with constant channel coefficients has exactly $\frac{p\left(p+1\right)}{2p+1}$ DoF per user, and they can be achieved by means of linear precoding at the transmitters and linear filtering at the receivers. \end{theorem} \begin{IEEEproof} The proof is analogous to the proof of Theorem \ref{theorem23}. In general, the optimal DoF are attained by using the proposed transmitting scheme, delivering $\hat d_j= 2p(p+1)$ symbol streams to each user along $2T=2(2p+1)$ symbol extensions in time, and considering ACS. \end{IEEEproof} \vskip 2ex We remark that we have only analytically proved the cases $p=2,3,\ldots,6$. Nonetheless, based on the explained methodology and some numerical results (see next section), we conjecture that for any $p>6$ full rank SSMs are obtained, and hence the optimal DoF can be attained: \begin{conjecture}[DoF for the general $\left(p,p+1\right)$ IC] \label{conjecture} The 3-user $\left(p,p+1\right)$ MIMO IC with constant channel coefficients has exactly $\frac{p\left(p+1\right)}{2p+1}$ DoF per user for $p>6$. They can be achieved using linear transmit and receive filters, and by means of applying subspace alignments chains, symbol extensions in time and ACS. \end{conjecture} \section{Simulation results} \label{sec:4.3sim} In order to validate the contributions of this work, as well as increase the strength of \mbox{Conjecture \ref{conjecture}}, we simulate the cases $p=2,3,5,6,8,9$ for the 3-user MIMO IC. Two schemes are simulated, the one proposed in this work, and the design in \cite{AlignmentChainsTrans} not considering ACS. In both cases, we apply the CB operation and the additional transformations as explained in Appendix \ref{sec:appendixA} together with the proposed scheme. Results are shown in Fig. \ref{fig:ACSvsNoACS}, where solid/dashed lines denote the two schemes with/without considering ACS. It can be seen that the scheme considering ACS improves the slope achieved at high SNR for each case. Moreover, notice that we simulate two cases $p>6$, whose DoF were conjectured in previous section. \begin{figure}[] \centering \footnotesize \begin{tikzpicture} \begin{axis}[% view={0}{90}, width=0.6\linewidth, xmin=0, xmax=100, xlabel={SNR(dB)}, grid style={dashed, gray!50}, xmajorgrids, ymin=0, ymax=400, ylabel={Sum-rate (bps/Hz)}, ymajorgrids, ylabel style={at={(0.03,0.5)},rotate=0}, legend style={at={(axis cs: 10,350)},anchor=north west}, cycle multi list={ solid,dashed \nextlist {red,mark=square},{blue,mark=diamond},{orange,mark=o},{magenta,mark=triangle},{black,mark=triangle,mark options={rotate=180,solid}},{cyan,mark=pentagon} }, every axis plot/.append style={mark size = 2pt,mark repeat={10},mark options={solid}}, ] \pgfplotstableread[col sep=tab]{simResults.txt} \rates \foreach \L in {2,3,5,6,8,9} { \addplot table[x =SNR, y = p\L] from \rates ; \addlegendentryexpanded{$p=\L$}; } \foreach \L in {2,3,5,6,8,9} { \addplot table[x =SNR, y = np\L] from \rates ; } \end{axis} \end{tikzpicture}% \vspace{-2mm} \caption[]{Comparison of using IA with the proposed channel extension (solid lines) with respect to using the scheme with only symbol extensions in time (dashed lines).} \label{fig:ACSvsNoACS} \end{figure} \section{Conclusions} \label{sec:7conclusion} This work has investigated the DoF of the 3-user $(p,p+1)$ MIMO Interference channel with constant channel coefficients and full CSI at both sides. We have obtained that the best known outer bound can be attained for the cases $p=2\ldots6$ by means of a linear precoding scheme. Moreover, a methodology has been presented easing the proof for the general case, where we conjecture that the known DoF outer bound is also tight. This conjecture has been numerically checked for two cases. The contribution of this work is twofold. On the one hand, we have shown that the use of \ac{ACS} together with the previous state-of-the-art approach in \cite{AlignmentChainsTrans} allows to attain the optimal DoF. Therefore, we have provided a formal proof, and uncoupled the achievability statement from numerical experiments. On the other hand, we have shown that linear precoding schemes attain the same DoF as lattice alignment based schemes (except for the SISO case), being the former more robust for the finite SNR regime. Future work may be oriented to complete the characterization of this channel for the SISO case, where DoF inner and outer bounds have not yet been found. Also, it may be interesting to optimize not only the slope of the rate curve at the high SNR regime, but also the SNR offset. Further improvement seems to be possible by optimizing the SPBs in terms of the sum rate subject to some transmit power constraint. \appendices \section{Additional change of basis at the receiver side} \label{sec:appendixA} The CB operation \cite{AlignmentChainsTrans} is a tool that provides a predetermined structure for the cross-channel matrices. In particular, it forces zeros at some specific antenna elements. For example, the equivalent cross-channel matrices $\big\{ \mathbf{\tilde{H}}_{j,j-1},\mathbf{\tilde{H}}_{j,j+1} \big\}$ for $p=3$ after performing the original CB described in \cite{AlignmentChainsTrans} are given by (\ref{eq:estructuraPreFinal_H_p=3}). Here we assume that the CB at the receiver $\mathbf{R}_{j}$ is the product of two matrices: the original CB and an additional combining matrix $\boldsymbol{\Upsilon}_j \Rmat{2T(p+1)}{2T(p+1)}$ such that (\ref{eq:estructuraFinal_H_p=3}) is satisfied. Then, each block row of $\boldsymbol{\Upsilon}_j=\big[ \boldsymbol{\upsilon}_{j,1}^T , \ldots , \boldsymbol{\upsilon}_{j,4}^T \big]^T$ is derived as follows: \setcounter{equation}{41} \begin{IEEEeqnarray}{c} \begin{matrix} \boldsymbol{\upsilon}_{j,1} = \big[ \, \I_{2T} \quad \0 \, \big] \\[0.5mm] \boldsymbol{\upsilon}_{j,2} = \Null{\big[ \mathbf{\tilde{H}}_{j,j-1} \big( :,1 \big), \mathbf{\tilde{H}}_{j,j+1} \big( :,2:3 \big) \big]} \\[2.5mm] \boldsymbol{\upsilon}_{j,3} = \Null{\big[ \mathbf{\tilde{H}}_{j,j-1} \big( :,1:2 \big), \mathbf{\tilde{H}}_{j,j+1} \big( :,3 \big) \big]} \\[0.5mm] \boldsymbol{\upsilon}_{j,4} = \big[ \, \0 \quad \I_{2T} \, \big], \end{matrix} \end{IEEEeqnarray} where $\mathbf{A}(:,b:c)$ gives the matrix resulting from picking the entries of $\An$ from block column $b$ to $c$, and $\I_{2T} \Rmat{2T}{2T}$, $\0 \Rmat{2T}{2Tp}$ are the identity and all-zero matrices. \def1{1} \setlength{\arraycolsep}{0.5pt} \begin{figure*} \setcounter{equation}{39} \def1{1.5} \setlength{\arraycolsep}{0.5pt} \begin{IEEEeqnarray}{l} \left[\mathbf{\tilde{H}}_{j,j-1},\mathbf{\tilde{H}}_{j,j+1}\right] = \begin{bmatrix} \Cn \big( \tilde{h}_{j,j-1}^{1,1} \big) & \0 & \0 & \0 & \0 & \0 \\ \Cn \big( \tilde{h}_{j,j-1}^{2,1} \big) & \Cn \big( \tilde{h}_{j,j-1}^{2,2} \big) & \Cn \big( \tilde{h}_{j,j-1}^{2,3} \big) & \Cn \big( \tilde{h}_{j,j+1}^{2,1} \big) & \0 & \Cn \big( \tilde{h}_{j,j+1}^{2,3} \big) \\ \Cn \big( \tilde{h}_{j,j-1}^{3,1} \big) & \0 & \Cn \big( \tilde{h}_{j,j-1}^{3,3} \big) & \Cn \big( \tilde{h}_{j,j+1}^{3,1} \big) & \Cn \big( \tilde{h}_{j,j+1}^{3,2} \big) & \Cn \big( \tilde{h}_{j,j+1}^{3,3} \big) \\ \0 & \0 & \0 & \0 & \0 & \Cn \big( \tilde{h}_{j,j+1}^{4,3} \big) \end{bmatrix} \label{eq:estructuraPreFinal_H_p=3} \end{IEEEeqnarray} \begin{IEEEeqnarray}{l} \boldsymbol{\Upsilon}_j \left[\mathbf{\tilde{H}}_{j,j-1},\mathbf{\tilde{H}}_{j,j+1}\right] \!= \! \begin{bmatrix} \Cn \big( {h}_{j,j-1}^{1,1} \big) & \0 & \0 & \0 & \0 & \0 \\ \0 & \Cn \big( {h}_{j,j-1}^{2,2} \big) & \Cn \big( {h}_{j,j-1}^{2,3} \big) & \Cn \big( {h}_{j,j+1}^{2,1} \big) & \0 & \0 \\ \0 & \0 & \Cn \big( {h}_{j,j-1}^{3,3} \big) & \Cn \big( {h}_{j,j+1}^{3,1} \big) & \Cn \big( {h}_{j,j+1}^{3,2} \big) & \0 \\ \0 & \0 & \0 & \0 & \0 & \Cn \big( {h}_{j,j+1}^{4,3} \big) \end{bmatrix} \label{eq:estructuraFinal_H_p=3} \end{IEEEeqnarray} \hrule \vspace{-5mm} \end{figure*} \section{Proof of Lemma 1} \label{sec:appendixB} We will prove the lemma for the system of equations defined for $j=1$. Cases $j=2,3$ can be similarly handled, due to symmetry of the problem. Therefore, we drop the supraindex $j$ and write ${\boldsymbol{\lambda}_i, i=1,\ldots5}$ to simplify notation. Some rank-preserving transformations are applied to $\mathbf{G}_j$, such that (\ref{eq:29Glanda}) for $j=1$ can be written as follows: \setcounter{equation}{42} \begin{IEEEeqnarray}{c} { \Ch{1,1}{1,1} {\An_2}{{\boldsymbol{\lambda }}_1} + {\An_1}{{\boldsymbol{\lambda }}_3} = {\0}} \nonumber, \\[-2mm] {\Ch{1,1}{2,1} {\An_2}{{\boldsymbol{\lambda }}_1} + \Ch{1,1}{2,2}{\An_1}{{\boldsymbol{\lambda }}_2} + {\An_3}{{\boldsymbol{\lambda }}_4} = {\0}}, \qquad \label{eq:41} \\[-2mm] \nonumber {\Ch{1,1}{3,2}{\An_1}{{\boldsymbol{\lambda }}_2} + {\An_2}{{\boldsymbol{\lambda }}_5} = {\0}}, \end{IEEEeqnarray} which can be simplified by introducing (\ref{eq:30Adesign}), and by means of linear independence among $\mathbf{b}_i$. For instance, consider all equations corresponding to $\mathbf{B}_{1:2}$ in (\ref{eq:41}): \begin{IEEEeqnarray}{c} \label{eq:4,3_eq1} \Ch{1,1}{1,1} \mathbf{b}_q \, \lambda _1 \left( q \right) + \mathbf{b}_q \, \lambda _3 \left( q \right) = \0, \, \\[-2mm] \label{eq:4,3_eq2} \Ch{1,1}{2,1} \mathbf{b}_q \, \lambda _1 \left( q \right) + \Ch{1,1}{2,2} \mathbf{b}_q \, \lambda _2 \left( q \right) = \0, \, \\[-2mm] \label{eq:4,3_eq3} \Ch{1,1}{3,2} \mathbf{b}_q \, \lambda _2 \left( q \right) + \mathbf{b}_q \, \lambda _5 \left( q \right) = \0, \, \end{IEEEeqnarray} with $q=1,2$. Each of such equations can be simplified as follows. Let us define: \begin{IEEEeqnarray}{c} \mathbf{\tilde b}_q = \begin{bmatrix} b_q \left( 1 \right) + j b_q \left( 2 \right) \quad & b_q \left( 3 \right) + j b_q \left( 4 \right) \quad& \ldots \quad & b_q \left( 9 \right) + j b_q \left( 10 \right) \end{bmatrix}^T , \label{eq:44} \end{IEEEeqnarray} where $\mathbf{b}_q = \begin{bmatrix} b_q \left( 1 \right) \quad & b_q \left( 2 \right) \quad & \ldots \quad& b_q \left( 10 \right) \end{bmatrix}^T$, $j=\sqrt{-1}$ stands for the imaginary unit, and $q=1,2$. Then, as in \cite{ACS}, we can write (\ref{eq:4,3_eq1})-(\ref{eq:4,3_eq3}) in terms of $\mathbf{\tilde b}_q$. For instance, (\ref{eq:4,3_eq1}) can be rewritten as follows: \begin{IEEEeqnarray}{c} \begin{matrix} \left| h_{1,1}^{1,1} \right|{e^{j \phi _{1,1}^{1,1}}}{{{\mathbf{\tilde b}}}_q} \,{\lambda _1}\left( q \right) + {{{\mathbf{\tilde b}}}_q}\,{\lambda _3}\left( q \right) = {\0} \quad \Rightarrow \quad \left| h_{1,1}^{1,1} \right|{e^{j \phi _{1,1}^{1,1}}}{\lambda _1}\left( q \right) + {\lambda _3}\left( q \right) = 0 \end{matrix}, \label{eq:45} \end{IEEEeqnarray} with $q = 1,2$. Hence, equating real and imaginary parts of each equation to zero, we have: \begin{IEEEeqnarray}{c} \begin{matrix} \left| h_{1,1}^{1,1} \right|\sin \left( {\phi _{1,1}^{1,1}} \right)\lambda _1(q) = 0, \\ \left| h_{1,1}^{1,1} \right|\cos \left( {\phi _{1,1}^{1,1}} \right)\lambda _1(q) + \lambda _3(q) = 0, \end{matrix} \label{eq:46} \end{IEEEeqnarray} with $q = 1,2$. The set containing all the possible values such that $\left| h_{1,1}^{1,1} \right|\sin \left( {\phi _{1,1}^{1,1}} \right) = 0$ is a countable set, thus it has zero measure \cite{MeasureProbability}. By randomness arguments the only solution is $\lambda _r(q) = 0, r = 1,3, q = 1,2$. Applying this methodology to all equations derived from all groups of columns of $\mathbf{B}$, one finds out that all rank multipliers must be zero. We present an alternative way to see that the rank multipliers associated to $\mathbf{B}_{1:2}$ must be zero. Instead of developing (\ref{eq:4,3_eq1}) only, let us write all equations (\ref{eq:4,3_eq1})-(\ref{eq:4,3_eq3}) in the form of (\ref{eq:46}). Then, equating imaginary parts to zero, some rank multipliers can be determined as the solution to \begin{IEEEeqnarray}{c} \begin{bmatrix} \,\left| h_{1,1}^{1,1} \right|\sin \left( {\phi _{1,1}^{1,1}} \right) & 0\,\\ \,\left| h_{1,1}^{2,1} \right|\sin \left( {\phi _{1,1}^{2,1}} \right) & \left| h_{1,1}^{2,2} \right|\sin \left( {\phi _{1,1}^{2,2}} \right) \,\\ \, 0 & \left| h_{1,1}^{3,2} \right|\sin \left( {\phi _{1,1}^{3,2}} \right) \,\\ \end{bmatrix} \!\! \begin{bmatrix} \,\lambda _1(q) \,\\ \,\lambda _2(q) \,\\ \end{bmatrix} = \0. \label{eq:eliminationMatrix} \end{IEEEeqnarray} We will refer to the $3 \times 2$ matrix at the left-hand side of (\ref{eq:eliminationMatrix}) as an \textit{elimination matrix}. As long as we can ensure it has no right null space, all rank multipliers in (\ref{eq:eliminationMatrix}) can be set to zero. In this case, this is trivially ensured by means of randomness arguments. Likewise, using the real counterpart of (\ref{eq:eliminationMatrix}), we have ${\lambda _i(q)=0, i=3,5},$ $q=1,2$. By the same rationale applied to each group of columns of $\mathbf{B}$, we obtain an elimination matrix for each case, and it is easy to check that none of them has right null space, thus all rank multipliers are definitely equal to zero. So far we have proved that considering ACS is sufficient for achieving a full rank SSM. In what follows, we explain why it is necessary when using the scheme based on alignment chains. In this regard, notice that if only symbol extensions in time are employed, a set of equations similar to (\ref{eq:4,3_eq1})-(\ref{eq:4,3_eq3}) is obtained, and we have \begin{IEEEeqnarray}{c} \def1{1} \setlength{\arraycolsep}{7pt} \begin{matrix} h_{1,1}^{1,1} \lambda _1(q) + \lambda _3(q) = 0 \\ h_{1,1}^{2,1} \lambda _1 \left( q \right) + h_{1,1}^{2,2} \lambda _2 \left( q \right) = 0 \\ h_{1,1}^{3,2} \lambda _2 \left( q \right) + \lambda _5(q) = 0 \end{matrix} \quad \Rightarrow \quad \begin{bmatrix} h_{1,1}^{1,1} & 0 & 1 & 0 \\ h_{1,1}^{2,1} & h_{1,1}^{2,2} & 0 & 0 \\ 0 & h_{1,1}^{3,2} & 0 & 1 \end{bmatrix} \begin{bmatrix} \lambda_1(q) \\ \lambda_2(q) \\ \lambda_3(q) \\ \lambda_5(q) \end{bmatrix} = \0, \label{eq:eliminationMatrixOnlyT} \end{IEEEeqnarray} \\ with $q=1,2$, where all $\mathbf{C}(\cdot)$ disappear since channel elements are written in the extended model as scaled identity matrices, and the rank multipliers are now complex magnitudes. In this case, the elimination matrix is a $3 \times 4$ full-row rank matrix, thus there exists at least one non-zero solution. Consequently, the SSM becomes rank deficient since there are some rank multipliers different from zero and thus desired signals cannot be separated from interference. \section{Proof of Lemma 2} \label{sec:appendixB1} Due to similarity with the proof for $p=2$, we elaborate a sketch of the proof for $p=3$ and provide intuition of the proof for $p=4,5,6$ by means of examples of its elimination matrices. The SSM for $p=3$ is constructed by using (\ref{eq:prodCreuatsa})-(\ref{eq:prodCreuatsb}). As before, without loss of generality we consider receiver 1 only. In this case, after applying some full-rank linear transformations to the SSM, the following system of four equations is obtained: \begin{IEEEeqnarray*}{l} \small \left[ \Ch{1,1}{1,1} - \C{ \alpha^\text{des}_{1,1} } \right] \An_3 \boldsymbol{\lambda }_1 + \Ch{1,1}{1,2} \An_2 \boldsymbol{\lambda}_2 +\left[ \Ch{1,1}{1,3} - \C{ \alpha^\text{des}_{1,2} } \right] {\An_1}{{\boldsymbol{\lambda }}_3} + \Ch{1,3}{1,1} {\An_2}{\boldsymbol{\lambda }}_4 = {\0}, \\ \small \left[ \Ch{1,1}{2,1} - \C{ \alpha^\text{des}_{2,1} } \right] {\An_3}{{\boldsymbol{\lambda}_1}} + \Ch{1,1}{2,2} \An_2 \boldsymbol{\lambda}_2 -\C{ \alpha^\text{int}_{1} } {\An_2}{\boldsymbol{\lambda }}_4 + \An_1{{\boldsymbol{\lambda }}_5} = {\0}, \end{IEEEeqnarray*} \begin{IEEEeqnarray*}{l} \small \Ch{1,1}{3,2} \An_2 \boldsymbol{\lambda}_2 + \left [ \Ch{1,1}{3,3} - \C{ \alpha^\text{des}_{3,2} } \right] {\An_1}{{\boldsymbol{\lambda }}_3} + \An_3{{\boldsymbol{\lambda }}_6} -\C{ \alpha^\text{int}_{2} } {\An_2}{\boldsymbol{\lambda }}_7= {\0}, \\ \small \left[ \Ch{1,1}{41} - \C{ \alpha^\text{des}_{4,1} } \right] {\An_3}{{\boldsymbol{\lambda }}_1} + \Ch{1,1}{42} \An_2 \boldsymbol{\lambda}_2 +{\left[ \Ch{1,1}{4,3} - \C{ \alpha^\text{des}_{4,2} } \right] {\An_1}{{\boldsymbol{\lambda }}_3}} + \Ch{1,2}{4,3} \An_2 \boldsymbol{\lambda}_7 = {\0}, \label{eq:41_p=3} \end{IEEEeqnarray*} where the SPBs are chosen as in (\ref{eq:37}), i.e: \begin{IEEEeqnarray}{c} \setlength{\arraycolsep}{3pt} \An_1 = \left[ \begin{matrix} \mathbf{B}_{1:2} & \mathbf{B}_{3:6} & \mathbf{B}_{7:8} \end{matrix} \right], \quad \An_2 = \begin{bmatrix} \mathbf{B}_{1:2} & \mathbf{B}_{9:12} & \mathbf{B}_{13:14} \end{bmatrix}, \quad \An_3 = \begin{bmatrix} \mathbf{B}_{3:6} & \mathbf{B}_{9:12} \end{bmatrix}, \label{eq:A_p3} \end{IEEEeqnarray} \vspace{-3mm} and \vspace{-3mm} \begin{IEEEeqnarray*}{c c c c c c c} \alpha^\text{des}_{q,1} = \frac{\hel{1,1}{q,2}\hel{3,1}{3,1}}{\hel{3,1}{3,2}} , & \quad & \alpha^\text{des}_{q,2} = \frac{\hel{1,1}{q,2}\hel{2,1}{2,3}}{\hel{2,1}{2,2}} , & \quad & \alpha^\text{int}_{1} = \frac{\hel{1,3}{2,2}\hel{2,3}{3,1}}{\hel{2,3}{3,2}} , & \quad & \alpha^\text{int}_{2} = \frac{\hel{1,2}{3,2}\hel{3,1}{2,3}}{\hel{3,1}{2,2}}. \end{IEEEeqnarray*} The SSM is full-rank as long as all rank multipliers ${\boldsymbol{\lambda}_i, i=1,\ldots,7}$ are equal to zero. For instance, consider the elimination matrix in (\ref{eq:eliminationMatrixp3}), obtained for the group $Z$ (see (\ref{eq:sets})) after applying similar steps as in Appendix \ref{sec:appendixB}, and equating imaginary parts to zero. Notice that this elimination matrix is full rank almost surely, since each row contains at least one element of the direct channel. Therefore, all rank multipliers involved in (\ref{eq:eliminationMatrixp3}) can be set to zero. Similar ideas apply to cases $p=4,5,6$. For the sake of brevity, we show only the elimination matrix analogous to (\ref{eq:eliminationMatrixp3}) for each of those cases at the next page, where following similar arguments discussed above, it can be ensured that all the elimination matrices are full rank, they have no right null space, and thus all involved rank multipliers can be set to zero. To simplify notation we have used the function $\psi(a,b)$, defined as the sum of the sinusoidal functions corresponding to the position $(a,b)$ of each elimination matrix. \begin{figure*} \begin{IEEEeqnarray}{c} \small \begin{bmatrix} \left| h_{1,1}^{1,2} \right|\sin \left( {\phi _{1,1}^{1,2}} \right) & \left| h_{1,1}^{1,3} \right|\sin \left( {\phi _{1,1}^{1,3}} \right) - \left|\alpha^\text{des}_{1,2} \right|\sin \left( {\alpha^\text{des}_{1,2}} \right) & \left| h_{1,3}^{1,1} \right|\sin \left( {\phi _{1,3}^{1,1}} \right) & 0\\ \left| h_{1,1}^{2,2} \right|\sin \left( {\phi _{1,1}^{2,2}} \right) & 0 & -\left|\alpha^\text{int}_{1} \right|\sin \left( \alpha^\text{int}_{1} \right) & 0 \\ \left| h_{1,1}^{3,2} \right|\sin \left( {\phi _{1,1}^{3,2}} \right) & \left| h_{1,1}^{3,3} \right|\sin \left( {\phi _{1,1}^{3,3}} \right) - \left|\alpha^\text{des}_{3,2} \right|\sin \left( {\alpha^\text{des}_{3,2}} \right) & -\left|\alpha^\text{int}_{1} \right|\sin \left( \alpha^\text{int}_{1} \right) & -\left|\alpha^\text{int}_{2} \right|\sin \left( \alpha^\text{int}_{2} \right) \\ \left| h_{1,1}^{42} \right|\sin \left( {\phi _{1,1}^{42}} \right) & \left| h_{1,1}^{4,3} \right|\sin \left( {\phi _{1,1}^{4,3}} \right) - \left|\alpha^\text{des}_{4,2} \right|\sin \left( {\alpha^\text{des}_{4,2}} \right) & \left| h_{1,2}^{4,3} \right|\sin \left( {\phi _{1,2}^{4,3}} \right) & 0\\ \end{bmatrix} \!\!\! \! \begin{bmatrix} \lambda _2(q) \\ \lambda _3(q) \\ \lambda _4(q) \\ \lambda _7(q) \end{bmatrix} \!= \! \0 \nonumber \vspace{-3mm} \\ \vspace{-1mm} \label{eq:eliminationMatrixp3} \end{IEEEeqnarray} \hrule \begin{IEEEeqnarray*}{l} p=4 :\\[3mm] \begin{bmatrix} 0 & \elim{1}{2} & \elim{1}{3} & 0 \\ \elim{2}{1} & 0 & \elim{2}{3} & 0 \\ 0 & \elim{3}{2} & 0 & \elim{3}{4} \\ \elim{4}{1} & \elim{4}{2} & \elim{4}{3} & \elim{4}{4} \\ \elim{5}{1} & 0 & \elim{5}{3} & \elim{5}{4} \end{bmatrix} \begin{bmatrix} \lambda _1(q) \\ \lambda _3(q) \\ \lambda _4(q) \\ \lambda _9(q) \end{bmatrix} =\0 \\[4mm] p=5 :\\[3mm] \begin{bmatrix} \elim{1}{1} & 0 & 0 & 0 & \elim{1}{5} & 0 \\ \elim{2}{1} & \elim{2}{2} & \elim{2}{3} & \elim{2}{4} & \elim{2}{5} & 0 \\ 0 & \elim{3}{2} & 0 & \elim{3}{4} & \elim{3}{5} & 0 \\ \elim{4}{1} & 0 & \elim{4}{3} & 0 & 0 & \elim{4}{6} \\ \elim{5}{1} & \elim{5}{2} & \elim{5}{3} & \elim{5}{4} & 0 & \elim{5}{6} \\ 0 & \elim{6}{2} & 0 & 0 & 0 & \elim{6}{6} \end{bmatrix} \begin{bmatrix} \lambda _1(q) \\ \lambda _2(q) \\ \lambda _4(q) \\ \lambda _5(q) \\ \lambda _9(q) \\ \lambda _{11}(q) \end{bmatrix} =\0 \\[4mm] p=6 :\\[3mm] \begin{bmatrix} 0 & 0 & 0 & \elim{1}{4} & \elim{1}{5} & 0 & 0 \\ 0 & 0 & \elim{2}{3} & 0 & \elim{2}{5} & \elim{2}{6} & 0 \\ \elim{3}{1} & \elim{3}{2} & \elim{3}{3} & \elim{3}{4} & \elim{3}{5} & \elim{3}{6} & 0 \\ 0 & \elim{4}{2} & 0 & \elim{4}{4} & 0 & \elim{4}{6} & 0 \\ \elim{5}{1} & 0 & \elim{5}{3} & 0 & 0 & 0 & \elim{5}{7} \\ \elim{6}{1} & \elim{6}{2} & \elim{6}{3} & \elim{6}{4} & 0 & 0 & \elim{6}{7} \\ 0 & \elim{7}{2} & 0 & \elim{7}{4} & 0 & 0 & \elim{7}{7} \end{bmatrix} \begin{bmatrix} \lambda _2(q) \\ \lambda _3(q) \\ \lambda _5(q) \\ \lambda _6(q) \\ \lambda _7(q) \\ \lambda _{8}(q) \\ \lambda _{13}(q) \end{bmatrix} =\0 \end{IEEEeqnarray*} \\[10mm] \end{figure*} \newpage \bibliographystyle{IEEEtranTCOM}
{'timestamp': '2014-08-01T02:08:26', 'yymm': '1407', 'arxiv_id': '1407.8359', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8359'}
arxiv
\section{Introduction}\label{sec:intro} In Competitive facility location problem several market players compete with each other for placing facilities (post office, shopping mall etc.) (\cite{CFL1},\cite{CFL4},\cite{CFL6_Hakimi},\cite{CFL3_Hakimi},\cite{CFL5_Hakimi},\cite{CFL2}). The customers choose the best facility to get services with respect to some specific requirements. The goal is to attract as much customers as possible. For a comprehensive study see the surveys (\cite{CFL_survey2},\cite{CFL_survey1}). Competitive facility location can also be viewed from the perspective of Game theory. Here in each move a market player places her facilities judiciously so that her {\it Gain} or {\it Payoff} is maximized. An interesting direction is to study how the decision of these players affect each other. Thus game theoretic arguments are used to analyze the best move or winning strategy of the players. Ahn {\em et al.}~\cite{Ahn_et_al} consider a competitive facility location problem which they call the \textit{Voronoi Game}. There are only two players P1 and P2 who play this game against each other. Both of the players place a specified number, $m$, of facilities alternately, starting with P1 ($m$ round game). The facilities are placed in a planar region $U$. After placement of all the 2$m$ facilities the nearest neighbor Voronoi diagram of those 2$m$ points is computed and the Voronoi region corresponding to each facility is assigned to it as its service zone. Service zone of a player is the union of the service zones corresponding to its $m$ facilities. The player whose service zone is having larger area wins the game. Considering the complications of the planar version Ahn {\em et al.}~\cite{Ahn_et_al} focus on an one-dimensional version of this game, where the region is a line segment or a circular arc. They show that the second player always has a winning strategy for this version. They have also considered another version of the game, where instead of placing the facilities alternately P1 places its $m$ facilities at first and then P2 places its $m$ facilities (one-round game). They show that in this case the first player always has a winning strategy. The one-round planar version has studied by Cheong {\em et al.}~\cite{Cheong_One-Round_Voronoi_Game} for a square-shaped region. In this case also the second player always has a winning strategy. Fekete {\em et al.}~\cite{Fekete_one-round_Voronoi_game} have studied the planar one-round version for a rectangular region with aspect ratio $\rho$. They have shown that the second player has a winning strategy for $m\geq 3$ and $\rho > \frac{\sqrt{2}}{m}$, and for $m=2$ and $\rho > \frac{\sqrt{3}}{2}$. The first player wins in all the remaining cases. In real life scenario often the facilities like shopping malls are allowed to be placed only on (or beside) road networks (\cite{CFL6_Hakimi},\cite{Hakimi_et_al},\cite{CFL_duopoly},\cite{CFL_tree1},\cite{CFL_survey1}). The customers are also assumed to be on (or beside) the road network for the sake of reachability. The customers always choose their nearest (along the edges of the road network) facility. The problem of interest is to find the placement location of the facilities that attract maximum number of customers. Teramoto, Demaine and Uehara \cite{Voronoi_game_on_graphs} and Durr {\em et al.}~\cite{nash_DurrT07} independently consider this model which they call \textit{discrete} Voronoi game. Here the road network is modeled using a weighted graph. Two players alternately occupy 2$n$ vertices of the graph. Each vertex is assigned to the player who occupies the nearest (with respect to shortest path distance) vertex to it. Either a player dominates larger number of vertices or the game ends in a tie. They have studied the game on complete $k$-ary tree. They show that P1 has a winning strategy if (1) 2$n \leq k$, or (2) $k$ is odd and the complete $k$-ary tree contains at least $(k^3n^2-1)/(k-1)$ vertices. In contrast, in case when $k$ is even, $2n > k$, and the complete $k$-ary tree contains at least $(k^3n^2-1)/(k-1)$ vertices, two players tie if they play optimally. They also consider a restricted version of the game where P1 occupies only one vertex and P2 occupies $n$ vertices. Surprisingly for this case they have shown that it is $\mathcal{NP}$-complete to determine whether P2 has a winning strategy. Moreover, they show that for a given graph $G$ and the number $n$ of turns it is $PSPACE$-complete to determine whether P1 has a winning strategy. Kiyomi, Saitoh and Uehara \cite{Vgameonpath} consider discrete Voronoi game on paths. They show that if the length of the path is even and the number of rounds is even then P1 has a trivial winning strategy. In all the other cases the game ends in a tie. Existence of pure Nash equilibrium has also been studied on this model (\cite{nash_DurrT07},\cite{nash_transitive_FeldmannMM09},\cite{nash_cycle_MavronicolasMPS08}). In this paper we study a natural extension of discrete Voronoi game. The game is played on a graph embedded in $\mathbb{R}^2$ whose vertices and edges are having non-negative weights. In this model the facilities can be placed either on the vertices or on the points of the edges. At first P1 places $m$ facilities and then P2 places $k$ facilities. A point on the graph (point on an edge or a vertex) is assigned to its nearest (with respect to weighted shortest path distance) facility. In case of tie the point is assigned to the facility of P2. Each facility controls a portion of the graph which is called its service zone. Service zone of a player is the collection of service zones corresponding to its facilities. Payoff of a player is the weight of its service zone (sum of the weights of the vertices, edges, and portion of edges contained in it). The player with the larger payoff wins the game or in case where both players have same payoff the game ends in a tie. Considering the above mentioned model we define the following problem which we call the {\it Maximum Payoff Problem}.\\\\ {\em Maximum Payoff Problem}: Given a weighted graph $G$=$(V,E)$ and a placement of $m$ facilities of P1, find a set of $k$ points $S$ on $G$ that maximizes the payoff of P2.\\\\ Throughout the paper we mainly focus on this problem. We design a polynomial time algorithm to solve the Maximum Payoff Problem on trees. Thus the main result of this paper is the following theorem. \begin{theorem}\label{thm:opt_tree} The Maximum Payoff Problem on trees can be solved in polynomial time. \end{theorem} At a high level the idea is to characterize a candidate set of polynomial size which contains a solution of the {\em Maximum Payoff Problem}. Then we design an algorithm to find $k$ points from this set which maximizes the payoff of P2. This algorithm is based on dynamic programming and runs in polynomial time. On the other hand, we prove that the decision version of {\em Maximum Payoff Problem} is strongly $\mathcal{NP}$-complete by reducing it from the {\it Dominating Set Problem}. This implies that finding a winning strategy of P2 is $\mathcal{NP}$-complete. Consequently, we design an $1-\frac{1}{e}$ factor approximation algorithm for this problem, where $e \approx 2.718$. Lastly, we consider a different problem of finding the maximum payoff of P1 for placing $m$ facilities given that later P2 will place $k$ facilities. As a side effect of our results we obtain a lower bound on the maximum payoff of P1 for trees which is tight indeed for a special class of trees. The rest of the article is organized as follows. In Section \ref{sec:prob_def} we formally define the framework. In Section \ref{sec:optongraph} we charaterize the optimal solution of {\it Maximum Payoff Problem}. Then in section \ref{sec:optontree} we prove Theorem \ref{thm:opt_tree}. Section \ref{sec:com_comx} deals with the $\mathcal{NP}$-completeness proof followed by the approximation algorithm in Section \ref{sec:approximation}. We conclude our discussion with the lower bound on the maximum payoff of P1. \section{Problem Definitions}\label{sec:prob_def} Let $G$=$(V,E)$ be a weighted graph embedded in $\mathbb{R}^2$. \textit{weight} of a vertex or an edge is defined by a real function $w: E\cup V \rightarrow \mathbb{R^+} \cup \lbrace 0\rbrace$. Consider an edge $e$=$(u,v)$ as a segment $\wideparen{uv}$ of length $w(e)$. Also consider a point $p$ on $e$. $p$ can be considered as a vertex of weight 0 which forms two new edges $(u,p)$ and $(p,v)$ from $e$. The weight of $(u,p)$ and $(p,v)$ are equal to the length of the segments $\wideparen{up}$ and $\wideparen{pv}$ respectively. To distinguish these new edges from the edges in $E$ we refer to them as {\it arcs}. A path between two points $p_1$ and $p_2$ is defined as a sequence of points starting with $p_1$ and ending with $p_2$ such that any two consecutive points share an edge or arc. The weight of a path is the sum of the lengths of the edges and arcs on the path. Define the distance $d(p,q)$ between two points $p$ and $q$ on $G$ (vertices or points on edges) as the length of any weighted shortest path between them. We consider a version of Voronoi game on $G$ played between two players P1 and P2. At first P1 chooses a set $F$ of $m$ points on $G$ to place its facilities. Thereafter P2 chooses a set $S$ of $k$ points to place its facilities, where $F \cap S$ is empty. Define the service zone of a facility $f \in F\cup S$ as,$$S(f,F\cup S)=\lbrace p: d(p,f) < d(p,f'), f' \in (F\cup S)\setminus f\rbrace$$A point equidistant from the facilities of only one player is arbitrarily added to the service zone of one of those facilities. However, a point equidistant from the facilities of both of the players is added to the service zone of one of those facilities of P2. We note that the collection of points in the service zone of a facility can be visualized as a connected graph embedded in $\mathbb{R}^2$ which contain a subset of vertices, edges and arcs of $G$. All the points on those edges or arcs must belong to the service zone of that facility. Henceforth we consider the service zone of a facilty as a subgraph of $G$. In Figure \ref{fig:srve_zone} three facilities $f_1,f_2$ and $f_3$ are placed on a tree with unit vertex and edge weights. The service zone of $f_2$ contains the vertices $v_4,v_6$, the edge $(v_4,v_6)$, and the arcs $(p_1,v_4)$, $(v_4,p_2)$. \begin{figure}[ht] \centering \includegraphics[height=30mm]{27} \caption{Service zone of $f_2$ (shown in bold)} \label{fig:srve_zone} \end{figure} For a facilty $f$, let $\mathcal{Z}(f,F\cup S)$ denote the sum of the weights of the vertices, edges and arcs in $S(f,F\cup S)$. Given two sets of facilities $F$ and $S$ placed by P1 and P2 respectively, we define the payoff of P1 as,$$\mathcal{Q}_1(F,S)=\sum_{f\in F }\mathcal Z(f,F\cup S)$$ Thus the payoff of P2, $\mathcal{Q}_2(F,S)$=$\mathcal{W}-\mathcal{Q}_1(F,S)$, where $\mathcal{W}$ is the sum of the weights of the vertices and edges of $G$. Given a set of facilities $F$ placed by P1 we define the maximum payoff of P2 as $\eta(F)$=$\max_{S} \mathcal{Q}_2(F,S)$, where maximum is taken over all possible $k$ facility locations of P2. Now we formally define the game framework which we call {\it One-Round $(m,k)$ Voronoi Game on Graphs}. \begin{description} \item[{\it One-Round $(m,k)$ Voronoi Game on Graphs:}] Given a graph $G=(V,E)$, a weight function $w$ and two players P1 and P2 interested in placing $m$ and $k$ facilities respectively, P1 chooses a set $F^*$ of $m$ facility locations on $G$ following which P2 chooses a set $S^*$ of $k$ facility locations on $G$ disjoint from $F^*$ such that: \begin{enumerate}[(i)] \item $\min_{F}$ $\eta(F)$ is attained at $F$=$F^*$, where the minimum is taken over all possible set of $m$ facility locations $F$ of P1. \item $\max_{S} \mathcal{Q}_2(F^*,S)$ is attained at $S$=$S^*$, where maximum is taken over all possible set of $k$ facility locations $S$ of P2. \end{enumerate} \end{description} Throughout the paper we consider the framework {\it One-Round $(m,k)$ Voronoi Game on Graphs}. Specifically we are interested in the optimal facility location problem for P2 on this framework which we have defined before as the {\it Maximum Payoff Problem}. With respect to this framework, given any set $F$ of $m$ facilities of P1 we are interested in finding a set of $k$ points $S$ on $G$ that maximizes $\mathcal{Q}_2(F,S)$. \section{Characterization of Optimal Facility Locations of P2}\label{sec:optongraph In this section we characterize the optimal solution of the {\em Maximum Payoff Problem}, which is going to be used extensively in the following sections. To be precise we characterize a finite set of points which contains an optimal solution. Note that the number of optimal solutions may be infinite. Figure \ref{fig:cor1} shows an example tree with unit vertex and edge weights, where One-Round $(4,1)$ Voronoi Game is played. Here optimal placement by P2 can be at any point on the edge $(v_1,v_2)$ making the search space for possible optimal locations infinite. Note that here the maximum payoff of P2 is 5 (2 from the vertices and 3 from the edges). \begin{figure}[ht] \centering \includegraphics[height=30mm]{cor1} \caption{Example of infinite optimal solutions: a possible location is $s_1$ and the corresponding service zone is shown in bold} \label{fig:cor1} \vspace{-0.1in} \end{figure} Consider any facility $f$ placed by P1 or P2. A point $b$ on $G$ is called a {\em bisector} corresponding to $f$ if there exists another facility $f'$ such that the path between $f$ and $b$ is served by $f$, the path between $b$ and $f'$ is served by $f'$, and the lengths of these paths are equal. Note that the bisectors corresponding to a facility demarcate its service zone from other facilities. As the number of paths between $f$ and any other facility is finite and each such path can contain at most one bisector, the number of such bisectors is also finite. Consider the One-Round $(4,2)$ Voronoi Game played on the graph shown in Figure \ref{fig:cor21}. $\{f_1,f_2,f_3\}$ and $\{s_1,s_2\}$ are the sets of facilities placed by P1 and P2 respectively. The service zone of $s_1$ is denoted by the bold arcs and demarcated by the bisectors $a$, $b$, $c$, $d$ and $e$. The distance of $a$ from $s_1$ is equal to the distance of $a$ from $f_3$ along the path $(s_1,v_y,a,v_2,f_3)$. The path $(a,v_2,f_3)$ is served by P1 and the path $(a,v_y,s_1)$ is served by P2. \begin{figure}[ht] \centering \includegraphics[height=40mm]{cor2} \caption{Service zone of $s_1$ (shown in bold)} \label{fig:cor21} \vspace{-0.1in} \end{figure} Consider any placement $F$ and $S$ by P1 and P2 respectively. Observe that the bisectors corresponding to a facility $s_i$ of P2 can be of two types. The first type of bisectors split a path between $s_i$ and $f_j$, where $f_j \in F$. The second type of bisectors split a path between $s_i$ and $s_j$, where $i \neq j$ and $s_j \in S$. In Figure \ref{fig:cor21}, $a,b,c,d$ is of the first type and $e$ is of the second type of bisectors. Let us investigate that how the service zone of P2 changes if one of its facilities $s_i$ is moved along the edge on which it is lying. Again consider the example graph in Figure \ref{fig:cor21}. Suppose the facility at $s_1$ is shifted by a very small distance towards $v_x$ and its new location is say $s_1'$. Subsequently bisector $a$ on the edge $(v_2,v_y)$ shifts towards $v_y$. On the other hand, bisector $c$ on edge $(v_1,v_x)$ shifts towards $v_1$. The bisector $e$ also shifts towards $s_2$ along the path $(s_1,v_x,s_2)$, but that does not change the overall payoff of P2 as the path $(s_1,v_x,s_2)$ is always in the service zone of P2. Henceforth by bisector we refer to the bisectors of first type, as the other type does not contribute in computation of change in payoff. Consider a facility $s$ $\in$ $(v_x,v_y)$ placed by P2. Also consider the bisectors corresponding to $s$ and their respective paths from $s$ to the facilities of P1. Such a path is called a $v_x$ {\it path} if it contains the vertex $v_x$ and $v_y$ does not appear in between $s$ and $v_x$ in it. A path correspond to one of those bisectors which is not a $v_x$ path is called a $v_y$ {\it path}. Now consider the two sets of bisectors $B_x$ and $B_y$ corresponding to the $v_x$ and $v_y$ paths. Note that these two sets of bisectors are not necessarily disjoint (see Figure \ref{fig:fig13}). Take two paths $\pi_1$ and $\pi_2$ corresponding to a bisector $b$ common to both of these sets. Without loss of generality say $\pi_1$ is a $v_x$ path corresponding to $s$. Then $\pi_2$ must be a $v_y$ path corresponding to $s$. Also let $f_j$ be the facility corresponding to $\pi_1$ and $\pi_2$. Note that if the facility at $s$ is shifted along the edge $(v_x,v_y)$, then the distance between $s$ and $b$ decreases. Hence after movement of $s$, P2 occupies more users from $\pi_1$ and $\pi_2$ and the payoff of P2 increases along these paths. Thus we have the following observation. \begin{figure}[ht] \centering \includegraphics[height=25mm]{common} \caption{Demonstration of common bisector $b$} \label{fig:fig13} \vspace{-0.1in} \end{figure} \begin{obs}\label{obs:common} Consider a facility $s$ of P2 placed on $(v_x,v_y)$. If two $v_x,v_y$ paths share a common bisector, then the movement of $s$ towards $v_x$ or $v_y$ increases the payoff of P2 along these paths. \end{obs} For the time being assume that $B_x \cap B_y$ is empty. Suppose a facility $s$ of P2 is shifted till the moment when one of its bisectors reaches to a vertex, say $v_l$, for the first time. If $s$ is moved further in the same direction, the number of bisectors of $s$ could be changed. Say $\epsilon$ be a distance such that if $s$ is shifted by $\epsilon$ unit from its original position, the bisectors on any path do not cross any vertex. In other words the bisectors does not change the edges on which they were lying initially. We call such an $\epsilon$ a \textit{safe distance}. Consider a path between $s$ and $f_j\in F$. If $s$ is shifted by $\epsilon$ unit along this path, then the current path between $s$ and $f_j$ shrinks by $\epsilon$ unit. Thus now the bisector on this path is shifted by $\frac{\epsilon}{2}$ unit. Similarly when $s$ is shifted away from this path, the current path between $s$ and $f_j$ expands by $\epsilon$ unit and the corresponding bisector shifts by $\frac{\epsilon}{2}$ unit. Thus we have the following observation. \begin{obs}\label{obs:shift} Consider a facility $s$ of P2 placed on $(v_x,v_y)$ and let $\epsilon$ be a safe distance. Suppose $s$ is shifted by $\epsilon$ unit, then each of those bisectors shifts by $\frac{\epsilon}{2}$ unit. \end{obs} Consider a $v_x$ path between $s$ and a facility $f_j \in F$. If $s$ is moved towards $v_x$ by a safe distance, say $\epsilon$, the path between $s$ and $f_j$ shrinks. But, considering the old path between $s$ and $f_j$ the payoff of P2 increases by $\frac{\epsilon}{2}$ unit on this path by Observation \ref{obs:shift}. As $B_x \cap B_y$ is empty the bisector corresponding to this path does not appear in $B_y$. Consider any $v_y$ path between $s$ and a facility $f_i \in F$. Then due to the movement of $s$ towards $v_x$ the path between $s$ and $f_i$ expands. Thus P2 misses a payoff of $\frac{\epsilon}{2}$ unit from the old path between $s$ and $f_i$. Thus if there are $k_1$ $v_x$ paths and $k_2$ $v_y$ paths payoff of P2 increases in $k_1$ paths and decreases in $k_2$ paths by $\frac{\epsilon}{2}$ unit. Similarly, if $s$ is shifted towards $s$ by a safe distance $\epsilon$, payoff of P2 decreases in $k_1$ paths and increases in $k_2$ paths by $\frac{\epsilon}{2}$ unit. Hence we have the following observation. \begin{obs}\label{obs:payoff_change} Suppose $s$ is a facility of P2 placed on $(v_x,v_y)$. Say $B_x \cap B_y$ is empty and $|B_x|=k_1$, $|B_y|=k_2$. Then if $s$ is shifted towards $v_x$ (resp. $v_y$) by a safe distance, say $\epsilon$, the payoff of P2 increases (decreases) in $k_1$ paths and decreases (increases) in $k_2$ paths by $\frac{\epsilon}{2}$ unit. \end{obs} Now while moving the facility $s$ suppose a bisector touches a vertex, say $v_l$, for the first time. Thus it is also the first time when $v_l$ comes in the service zone of P2 from the service zone of P1. So the payoff of P2 is increased by at least the weight of $v_l$ at that moment. This corresponding to a situation when the distance of $s$ and $v_l$ is same as the distance between $v_l$ and $f_l$, where $f_l$ is one of the facilities of P1 closest to $v_l$. This current location of $s$ is a transition point, when $v_l$ moves from service zone of P1 to service zone of P2. To capture these transition points we define the following set. For any vertex $v_i\in V$, denote one of the facilities of P1 closest to $v_i$ by $f(v_i)$ and the distance between $v_i$ and $f(v_i)$ by $d_i$. Let $\Gamma(v_i)$ be the set of points in $G$ excluding $f(v_i)$ which are at a distance $d_i$ from $v_i$. Define $\Gamma$=$\cup_{1\leq i\leq n} \Gamma(v_i)$. It is easy to verify that any edge can contain at most two points of $\Gamma(v_i)$. Thus $\Gamma(v_i)$ contains $O(|E|)$ points and consequently $\Gamma$ contains $O(|V||E|)$ points. Let $f_t$ be any facility of P1 on any edge $(v_i,v_j)$. Then we assume that there is a point $p \in (f_t,v_j)$ very close to $f_t$ such that the distance between $p$ and $f_t$ is small enough to be considered as zero. For any such $f_t$ and $(v_i,v_j)$ that point is included into $\Gamma$ and we have the following observation. \begin{obs} The number of points in $\Gamma$ is $O(|V||E|+m)$.\label{obs:gamma} \end{obs} Consider a facility $s$ of P2 placed at a point not in $\Gamma \cup V$. Suppose $s$ is shifted along the edge in both directions until it touches a point of $\Gamma \cup V$. We show that in at least one direction the payoff of P2 increases and thus it is always beneficial to place a facility of P2 at a point of $\Gamma \cup V$. The following theorem proves this formally. \begin{theorem} \label{thm:optimality} There exists a size $k$ subset of $\Gamma \cup V$ which is an optimal placement for P2. \end{theorem} \begin{proof} Let $OPT_S$ be an optimal $k$ placement by P2. We construct a set $A \subseteq \Gamma \cup V$ from $OPT_S$ such that $\mathcal{Q}_2(F,OPT_S) \leq \mathcal{Q}_2(F, A)$. Suppose there is a facility $s$ at $s_t \in OPT_S$ such that $s_t \notin \Gamma \cup V$. Also let $s_t$ belongs to the edge $(v_x,v_y)$. Let $p_l \in$ $(v_x,s_t)$ be the point closest to $s_t$ such that $p_l \in \Gamma \cup V$. Similarly let $p_r \in$ $(s_t,v_y)$ be the point closest to $s_t$ such that $p_r \in \Gamma \cup V$ (see Figure $\ref{fig:fig5}$). We show that either $\mathcal{Q}_2(F, OPT_S) \leq \mathcal{Q}_2(F, (OPT_S \setminus \{s_t\}) \cup \{p_l\})$ or $\mathcal{Q}_2(F,OPT_S) \leq \mathcal{Q}_2(F, (OPT_S \setminus \{s_t\}) \cup \{p_r\})$. \begin{figure}[ht] \centering \includegraphics[height=27.5mm]{4} \caption{Positions of $s_t$, $p_l$ and $p_r$} \label{fig:fig5} \end{figure} For the sake of contradiction suppose $\mathcal{Q}_2(F,OPT_S) > \mathcal{Q}_2(F, (OPT_S \setminus \{s_t\}) \cup \{p_l\})$ and $\mathcal{Q}_2(F,$ $OPT_S) > \mathcal{Q}_2(F,$ $ (OPT_S \setminus \{s_t\}) \cup \{p_r\})$. Let the length of $(p_l,s_t)$ and $(s_t,p_r)$ be $\delta_1$ and $\delta_2$ respectively. Consider the $v_x$ paths and the $v_y$ paths corresponding to $s_t$ as defined before. Note that the service zone of P2 changes in only these paths when $s$ is shifted within $(p_l,p_r)$. Also consider the two sets of bisectors $B_x$ and $B_y$ corresponding to the $v_x$ and $v_y$ paths. Moreover, as $p_l$ and $p_r$ are the closest points of $\Gamma \cup V$ to $s_t$ the number of bisectors of $s$ remains same when $s$ is shifted till $p_l$ or $p_r$. At first consider the bisectors which are present in both $B_x$ and $B_y$. From Observation \ref{obs:common} it follows that when $s$ is shifted till $p_l$ or $p_r$ the payoff of P2 increases along the paths corresponding to these bisectors. Now consider the bisectors which are not shared by the two sets $B_x$ and $B_y$. Let $B_x$ and $B_y$ contains $k_1$ and $k_2$ such bisectors respectively. Then by Observation \ref{obs:payoff_change}, \begin{equation} \label{eq:solve1} \mathcal{Q}_2(F,(OPT_S \setminus \{s_t\}) \cup \{p_l\}) \geq \mathcal{Q}_2(F,OPT_S) + (k_1-k_2)\frac{\delta_1}{2} \end{equation} and \begin{equation} \label{eq:solve2} \mathcal{Q}_2(F,(OPT_S \setminus \{s_t\}) \cup \{p_r\}) \geq \mathcal{Q}_2(F,OPT_S) + (k_2-k_1)\frac{\delta_2}{2} \end{equation} Now as, $\mathcal{Q}_2(F,OPT_S) > \mathcal{Q}_2(F, (OPT_S \setminus \{s_t\}) \cup \{p_l\})$ and $\mathcal{Q}_2(F,OPT_S) > \mathcal{Q}_2(F, (OPT_S \setminus \{s_t\}) \cup \{p_r\})$, from Equation $(\ref{eq:solve1})$ and $(\ref{eq:solve2})$ we get, $(k_1-k_2)\frac{\delta_1}{2} < 0$ and $(k_2-k_1)\frac{\delta_2}{2} < 0$. As $\delta_1,\delta_2 > 0$, we get $(k_1-k_2) < 0$ and $(k_2-k_1) < 0$. This is a contradiction as both of $k_1$ and $k_2$ are non-negative integers. Hence the claim follows. We add the point $p_l$ in $A$ if $\mathcal{Q}_2(F, OPT_S) \leq \mathcal{Q}_2(F, (OPT_S \setminus \{s_t\}) \cup \{p_l\})$. Otherwise we add $p_r$ in $A$. We repeat this process to replace all such $s_t \in OPT_S$ with $s_t'$ such that $s_t' \in \Gamma \cup V$. Thus we get a set $A \subseteq \Gamma \cup V$ such that $\mathcal{Q}_2(F,OPT_S) \leq \mathcal{Q}_2(F, A)$ which completes the proof of the theorem. \end{proof} Note that it is sufficient to search $\Gamma \cup V$ exhaustively to get an optimal solution. But the searching time is still exponential in $k$. \section{Maximum Payoff Problem on Trees: Proof of Theorem \ref{thm:opt_tree}}\label{sec:optontree} Given a weighted tree $T$=$(V,E)$ and a set of facilities $F$=$\lbrace f_1,\ldots,f_m\rbrace$ placed by P1 on $T$ we are interested in finding a set of $k$ optimal facility locations of P2 on $T$. We'll design a polynomial time algorithm for this problem. Let $P$=$\{p_1,p_2,\ldots,p_\tau\}$ be any finite set of points on any tree $T'=(V',E')$. We add the points of $P\setminus V'$ into $V'$. Note that now $P$ can be regarded as a set of cut vertices, as removal of these vertices generates a finite number of subtrees (a point of $P$ can appear as a leaf in one or more subtrees). Define a \textit{partition} $T'(P)$ with respect to a finite set of points $P$ as the collection of subtrees of a tree $T'$ generated by removal of the points of $P$. We consider the partition $T(F)$ of $T$ (see Figure \ref{fig:part}). Let $|V|=n$. As $|F|=m$ and each point in $F$ can generate a number of subtrees equal to its degree $|T(F)|=O(m+n)$. We note that a facility placed by P2 in a subtree can not serve a point of another subtree, as each subtree is separated from others by facilities of P1. Thus the computation of the maximum payoff of P2 in these subtrees can be done independent of each other. Suppose the problem of placing $k'\leq k$ facilities in any such subtree is solved. Now we show how to merge those independent solutions to get a global solution for $T$. The problem of merging the solutions of individual subtree is similar to the \textit{Optimum Resource Allocation} problem (\cite{ora1},\cite{ora2},\cite{karush},\cite{karush53}). We have a set of $p$ resources and a set of $l$ processors. Corresponding to each processor $i$ there is an efficiency function $g_i$. $g_i(p_i)$ denotes the efficiency of $i^{th}$ processor when $p_i$ resources are allocated to it. Moreover, all the values of $g_i(p_i)$ are known for $0\leq p_i\leq p$ and $1\leq i\leq l$. The \textit{Optimum Resource Allocation} problem is to find an allocation of $p$ resources to $l$ processors so that $\sum_{i=1}^l g_i(p_i)$ is maximized, where $p_i$ resources are allocated to $i^{th}$ processor and $\sum_{i=1}^l p_i = p$. The following theorem implies from \cite{karush} by Karush. \begin{figure*} \centering \begin{minipage}[c]{0.5\textwidth} \centering \includegraphics[width=50mm] {19}\\ {\small (a)}\\ \end{minipage}% \begin{minipage}[c]{0.5\textwidth} \centering \includegraphics[width=53mm] {20}\\ {\small (b)}\\ \end{minipage}% \caption{An example tree and its partition with respect to $\lbrace f_1,f_2\rbrace$} \label{fig:part % \end{figure*} \begin{theorem}\label{th:alloc} There is a routine ALLOC($g_1$, $\ldots$,$g_l$;$p$) which solves the Optimum Resource Allocation problem in $O(lp^2)$ time. \end{theorem} In this context it is worth it to mention that Hakimi {\em et al.}~\cite{Hakimi_et_al} also have used a similar routine to solve The Maximum Coverage Location Problem. Now we show how to solve our problem on $T$ by using Theorem \ref{th:alloc}. Consider the subtrees as the processors and the facilities as the resources. Denote the maximum payoff of P2 from $i^{th}$ subtree for placing $p_i$ facilities by $\mu_i(p_i)$. We set $g_i(p_i)=\mu_i(p_i), l=|T(F)|$, and $p=k$. As the payoff of P2 from $T$ is the sum of the payoffs from individual subtrees our problem is reduced to the \textit{Optimum Resource Allocation} problem. Thus assuming all the values of $\mu_i(p_i)$ are known, by Theorem \ref{th:alloc} it follows that the \textit{Maximum Payoff Problem} on $T$ can be solved in $O((m+n)k^2)$ time. Now we consider the problem on individual subtrees. A subtree which contains exactly one facility of P1, can be served by P2 totally by placing just one facility (see Figure $\ref{fig:part}(b)$). Now consider a subtree $T_i$ which contain at least $2$ facilities of P1. Let $\pi$ be the union of the paths of $T_i$ between the facilities of P1. Observe that $T_i \setminus \pi$ is a forest. Each tree $\lambda_j \in T_i \setminus \pi$ shares exactly one vertex with $\pi$, say $\alpha_j$. For example in Figure $\ref{fig:part}(b)$ the edge $(v_2,v_5)$ itself is such a tree and $v_2$ is the shared vertex. Note that as $\lambda_j$ does not contain any facility of P1 only one facility of P2 is sufficient to serve it totally. To be precise it is always advantageous for P2 to place a facility at $\alpha_j$ instead of placing it at any other points in $\lambda_j$. Thus for any such $\lambda_j$ we add its weight to the weight of $\alpha_j$ and remove $\lambda_j$ from $T_i$. Note that now all the leaves of $T_i$ contain facilities of P1. We refer to this kind of subtree as \textit{bounded subtree}. Hence it is sufficient to solve our problem on \textit{bounded subtrees}. \subsection{Maximum Payoff Problem on a Bounded Subtree} In this subsection we consider a more general problem. To avoid intricate notations we reuse some notations from before. Let $T$=$(V,E)$ be any tree where all the leaves of $T$ are occupied by facilities of P1. Each vertex has a non-negative weight. With each edge $(v_i,v_j)$ of $T$ two non-negative real values $l_{ij}$ and $w_{ij}$ are associated, where $l_{ij}$ denotes the length of the edge and $w_{ij}$ denotes the weight of that edge. Note that if an edge $e$ is within service zone of a player, then its payoff from $e$ is equal to the weight of $e$. On the other hand, in computation of distance between two points the lengths of edges are used and weights do not play any role in this context. Service zone and payoff are defined in the same manner like before. P2 is interested in placement of $k$ facilities on the points of $\Gamma \cup V$ such that its payoff is maximized, where $\Gamma$ is the set of points on $T$ as defined in Section \ref{sec:optongraph}. By Theorem $\ref{thm:optimality}$ it is sufficient to consider only points of $\Gamma \cup V$ to find an optimal placement for P2 on a bounded subtree. Then the only difference between \textit{Maximum Payoff Problem} and this general problem is that in \textit{Maximum Payoff Problem} the weight and length of any edge are considered to be same, but not in the general problem. Thus if we set the same value to $w_{ij}$ and $l_{ij}$ for any $(v_i,v_j)$, then solving the general problem would solve the \textit{Maximum Payoff Problem} on any bounded subtree. Henceforth we consider the general problem. We propose a polynomial time algorithm for choosing $k$ optimal points from $\Gamma \cup V$. Now for each $v_i$ a point in $\Gamma(v_i)$ must lie on a path between the facility of P1 nearest to $v_i$ and another facility of P1. Thus $|\Gamma(v_i)|=O(m)$ and $ |\Gamma|=O(m|V|)$. For each point $p$ in $\Gamma \cup V$ we compute the bisectors with respect to the facilities of P1 assuming a facility of P2 is placed at $p$. Let $B$ be the set of all those bisectors. We consider the points of $\Gamma$ and $B$ also as vertices and the edges are added accordingly. As the bisectors are now vertices the service zone of any facility of P2 placed at a point of $\Gamma \cup V$ does not contain any edge partially. Let $V'=V \cup \Gamma \cup B$. Thus $V'$ is our new set of vertices. Now for each point $p \in \Gamma \cup V$ a bisector must lie on a path between $p$ and a facility of P1. Thus $O(m)$ such bisectors are possible. Hence $|B|=O(m^2|V|)$ and $|V'|=O(m^2|V|)$. We choose an arbitrary vertex $r\in V$ to make it the root of $T$. We design a routine OPT to compute the maximum payoff of P2 from $T$ for placing $k$ facilities. OPT selects $k$ vertices of $\Gamma \cup V$ in non-decreasing order of their distances from $r$ recursively. Suppose $v_j$ be the first vertex chosen by this routine. Let $\Gamma_{j}=T \setminus \Upsilon_{j}$, where $\Upsilon_{j}$ is the path between $r$ and $v_{j}$. As the further vertices are chosen in non-decreasing order no facilities could be placed on $\Upsilon_{j}$. Observe that $\Gamma_{j}$ is a forest. We need to search the subtrees in $\Gamma_{j}$ to place the remaining $k-$1 facilities. Note that these subtrees are maximal in the sense that all of their leaves contain facilities of P1. At this stage we need a routine which can optimally distribute those $k-$1 facilities to these subtrees. To resolve this issue we use the ALLOC function. We can set $g_i$ to be the maximum payoff of P2 from the $i^{th}$ subtree like before. But observe that some vertices and edges of these subtrees might already be served by the facility at $v_j$. Thus we modify the subtree by changing the weights of those vertices and edges to zero. It is to be noted that though the weights of these edges are changed to zero, their lengths remain same. Also to ensure that facilities of P2 are placed in non-decreasing order of their distances to $r$ no facility could be placed at a vertex if its distance to $r$ is less than the distance between $r$ and $v_j$. Let $V^f$ be the forbidden set of vertices of the $i^{th}$ subtree where facilities can not be placed. Then we set $g_i(p_i)$ to be the maximum payoff of P2 from the modified $i^{th}$ subtree for placing $p_i$ facilities such that no facility is placed in the vertices of $V^f$. But note that ALLOC needs the values of $g_i(p_i)$ beforehand. Thus instead of calling the routine recursively on the subtrees we ensure that the payoff values of P2 from all of those maximal subtrees are already computed. Moreover, we need a storage space where we can store all those values for future usage. Any maximal subtree on which the routine is executed is uniquely identified by three parameters (i) its root (ii) a subset of its vertices and edges currently served by the existing facilities of P2 and (iii) a set of forbidden vertices. We refer to these maximal subtrees as \textit{auxilliary} subtrees. OPT takes an auxilliary subtree and an integer $p$ and returns the maximum payoff of P2 from that subtree for placing $p$ facilities such that no facilities are placed at the forbidden vertices. We maintain a table $M$ to store the values returned by OPT. Each row of $M$ corresponding to an auxilliary subtree. $M$ contains $k$ columns marked by 1 to $k$. The entry $M[T_i,p]$ stores the maximum payoff of P2 from the auxilliary subtree $T_i$ for placing $p$ facilities avoiding the forbidden vertices. Now we define the OPT routine for any auxilliary tree $T=(V',E')$ and an integer $p$. Let $V\subseteq V'$ be the set of vertices excluding any bisector which was originally not a vertex. \begin{description} \item[$OPT(T,p)$:] Say $r$ be the root of $T$. Let $V^z$ and $E^z$ be the sets of vertices and edges currently served by the existing facilities of P2. Also let $V^f$ be the set of forbidden vertices of $T$ and $\{v_{1},v_{2},\ldots, v_{t}\}$ be the vertices in $V\setminus V^f$, sorted in non-decreasing order of their distances from the root of $T$. \qquad If $t \leq c$ for some constant $c$, return the maximum payoff of P2 by checking all possible valid $p$ placements by P2. \qquad For each $1\leq j\leq t$ let $E_{j}$ and $V_j$ be the respective sets of edges and vertices of $T$ served by the facility of P2 placed at $v_{j}$. Let $\Gamma_{j}=T \setminus \Upsilon_{j}$, where $\Upsilon_{j}$ is the path between $r$ and $v_{j}$. Also let $|\Gamma_{j}|=l_j$. Say $r_{ij}$, $V_{ij}$ and $E_{ij}$ be the respective root, set of vertices and set of edges of the $i^{th}$ subtree of $\Gamma_{j}$ for $1\leq i\leq l_j$. Let $V_{ij}^f$ be the set of vertices in $i^{th}$ subtree of $\Gamma_{j}$ at a distance from $r$ which is lesser than the distance between $v_j$ and $r$. Suppose $T_{ij}$ be the auxilliary tree identified by (i) the root $r_{ij}$ (ii) the respective sets of vertices and edges $(V^z \cup V_j) \cap V_{ij}$ and $(E^z \cup E_j) \cap E_{ij}$ currently served by existing facilities of P2 (iii) the set of forbidden vertices $(V^f\cap V_{ij}) \cup V_{ij}^f$. Define $g_{ij}(p_{ij})$=$M[T_{ij}, p_{ij}]$, where $\sum_{i=1}^{l_j} p_{ij}$=$p-$1. \qquad Let $Q_{j}$=ALLOC $(g_{1j}(p_{1j}),g_{2j}(p_{2j}),\ldots,g_{l_jj}(p_{l_jj});p-1)$+$W(E_{j}+V_j)$, where $W(E_{j}+V_j)$ is the sum of the weights of the edges and vertices in $E_{j}$ and $V_j$. Lastly, set $M[T,p] = \max_{1\leq j\leq t} Q_{j}$. \end{description} Now we show that OPT($T,p$) indeed compute the maximum payoff of P2. If $T$ contains at most constant number of vertices at which facilities could be placed OPT($T,p$) returns the maximum value by checking all possible combinations. Otherwise, for each $v_j$ a facility is placed at $v_j$ and the remaining $p-1$ facilities are placed in the auxilliary subtrees contained in $\Gamma_{j}$. These $p-1$ facilities are allocated to $l_j$ subtrees using a call to ALLOC. Now to argue that these facilities are placed in an optimal manner we need to consider two issues (i) a facility in $T_{ij}$ does not serve any point of $T_{i'j}$ for any $i\neq i'$ and (ii) all the values $M[T_{ij}, p_{ij}]$ are available beforehand. The following observation resolves the first issue. \begin{figure*} \centering \includegraphics[width=42mm] {ind}\\ \caption{Independence of $T_{ij}$ and $T_{i'j}$} \label{fig:fig9 \end{figure*} \begin{obs}\label{obs:ind} For any $i \neq i'$, placement of facilities of P2 in $T_{ij}$ and $T_{i'j}$ are independent of each other. \end{obs} \begin{proof} Let $v_{tj}$ be the root of $T_{tj}$, where $1\leq t\leq l_j$. Consider any subtree $T_{ij}$ such that $v_{ij}$=$v_{j}$, then the service zone of any facility of P2 in $T_{ij}$ except the one at $v_j$ is limited within $T_{ij}$. Moreover, as $T_{ij}$ is connected to other subtrees through $v_{ij}$ facilities of P2 in other subtrees do not get any payoff from $T_{ij}$. Now consider two subtrees $T_{ij}$ and $T_{i'j}$ such that $v_{ij}\neq v_{j}$ and $v_{i'j}\neq v_{j}$. Let $d_{tj}$ be the distance between $v_{j}$ and $v_{tj}$ for all $t$. Also let $d_{j}$ be the distance between $r$ and $v_{j}$. Without loss of generality we assume $d_{ij} < d_{i'j}$. As all the root of the subtrees in $\Gamma_j$ are lying on the $rv_j$ path $d_{j} \geq d_{i'j}$ (see Figure $\ref{fig:fig9}$). Now the distance between any facility of P2 in $T_{i'j}$ and $v_{ij}$ is at least $d_{i'j} + (d_{i'j} - d_{ij})$ as no facility can be placed in $T_{i'j}$ within a distance $d_{i'j}$ from $v_{i'j}$. Now $d_{i'j} + (d_{i'j} - d_{ij})>d_{ij}$. Hence the facility at $v_{j}$ is closest to $v_{ij}$ than any other facilities in $T_{i'j}$. Hence any facility placed at $T_{i'j}$ does not get any payoff from $T_{ij}$. Similarly, any facility placed at $T_{ij}$ does not get any payoff from $T_{i'j}$ which completes the proof of this observation. \end{proof} Considering the second issue we enumerate the auxilliary subtrees in a way such that all the entries of $M$ needed by OPT($T,p$) are computed beforehand. We note that if the entries corresponding to a subtree $T'$ is needed while running OPT($T,p$), $T'$ must be a proper subtree of $T$, as $T'$ is a tree in $\Gamma_{j}$ which is obtained by deleting at least one edge of $T$. Thus it is sufficient to enumerate the auxilliary subtrees based on subtree containment relationship. In this ordering if $T'$ is contained in $T$, then $T'$ appears before $T$. We order the rows of $M$ in this manner. $M$ is filled up from top row to bottom row and in a fixed row from left to right. Hence we have the following lemma. \begin{lemma} OPT($T,p$) computes the maximum payoff of P2 from auxilliary tree $T$ for placing $p$ facilities such that no facilities are placed at the forbidden vertices. \end{lemma} To compute the maximum payoff of P2 for the original tree $T$ corresponding to the general problem we make a call to $OPT(T,k)$ where there is no existing facility of P2 and the set of forbidden vertices is empty. Then the last entry of the last row of $M$ gives the desired value. Now we consider the time complexity of the algorithm which is precisely the product of the number of entries of $M$ and the time complexity of computing each entry. The time complexity of computation of an entry is dominated by the complexity of $t=O(|\Gamma \cup V|)=O(m|V|)$ calls to ALLOC. By Theorem \ref{th:alloc} each call to ALLOC needs $O(l_jp^2)=O(|V'|k^2)=O(m^2k^2|V|)$ time. Thus the total time needed is $O(m^3k^2{|V|}^2)$ to compute each entry. Now the number of entries in $M$ is the product of number of distinct auxilliary trees and size of each row ($k$). Recall that an auxilliary tree is uniquely identified by its root $r'$, a subset $U^z$ of its vertices and edges currently served by the existing facilities of P2 and a set $V^f$ of forbidden vertices. The number of distinct $r'$ is $O(|V'|)$. The way the set $U^z$ is constructed it depends on the distance of $v_j$ and $r$. Thus for a subtree with fixed root the number of distinct $U^z$ is bounded by the number of distinct distances. Now $v_j$ always belong to $\Gamma \cup V$. Thus the number of such distinct distances is $O(|\Gamma \cup V||V'|)=O(m^3{|V|}^2)$. As the set $V^f$ is also constructed based on distance the number of such $V^f$ is also $O(m^3{|V|}^2)$. Hence the number of distinct auxilliary trees is bounded by $O(m^2|V|)*O(m^3{|V|}^2)*O(m^3{|V|}^2)=O(m^8{|V|}^5)$. Thus our algorithm runs in $O(m^{11}{|V|}^7k^2)$ time and we have the following lemma. \begin{lemma}\label{lem:bounded} The \textit{Maximum Payoff Problem} on a bounded subtree can be solved in $O(m^{11}{|V|}^7k^2)$ time. \end{lemma} Using Lemma \ref{lem:bounded} the total time needed to compute the table $M$ for all bounded trees is $O((m+n)m^{11}{n}^7k^2)$. Thus the maximum payoff of P2 from $T$ can be computed in $O((m+n)m^{11}{n}^7k^2)$ time which completes the proof of Theorem \ref{thm:opt_tree}. \section{Computational Complexity of the Maximum Payoff Problem}\label{sec:com_comx This section is devoted to address the computational complexity of the {\it Maximum Payoff Problem} on graphs. To be precise we show that existence of a polynomial time algorithm for this problem is unlikely unless $\mathcal{P}\neq \mathcal{NP}$. To set up the stage, first we define the {\em decision} version of the {\it Maximum Payoff problem}.\\\\ {\it INSTANCE:} Graph $G$=$(V,E)$, a set of $m$ points $F$ on $G$, a positive real number $\delta$ and a positive integer $k$.\\ {\it QUESTION:} Does there exist a set of $k$ points $S$ on the graph $G$ such that $\mathcal{Q}_2(F,S) \geq \delta$?\\ Note that given a certificate for this problem consists of $G$, $F$, $S$ and $\delta$ we can verify whether the payoff of P2 is at least $\delta$ or not in polynomial time. So the problem is in $\mathcal{NP}$. In the remaining part of this section we show a reduction from {\it Dominating Set Problem} to this problem. As {\it Dominating Set Problem} is known to be $\mathcal{NP}$-hard \cite{gareynjohnson}, this implies that the decision version of the {\em Maximum Payoff Problem} is also $\mathcal{NP}$-hard. Let us begin our discussion by defining {\it Dominating Set} of a graph.\\ { DOMINATING SET:} Given a graph $G$=$(V,E)$ a \textit{dominating set} is a set of vertices $S \subseteq V$ such that each vertex in $G$ is either in $S$ or is a neighbor of at least one vertex in $S$. The {\it Dominating Set Problem} is as follows.\\\\ {DOMINATING SET PROBLEM}\\ {\it INSTANCE:} Graph $G$=$(V,E)$, positive integer $k \leq |V|$.\\ {\it QUESTION:} Is there a dominating set of size $k$ in $G$?\\\\ The following Theorem proves the $\mathcal{NP}$-completeness of the decision version of the {\it Maximum Payoff Problem}. \begin{theorem} The decision version of the Maximum Payoff Problem is $\mathcal{NP}$-complete.\label{th:nphard} \end{theorem} \vspace{-0.2in} \begin{figure*}[h] \centering \begin{minipage}[c]{0.5\textwidth} \centering \includegraphics[width=50mm] {17}\\ {$G$}\\ \end{minipage}% \begin{minipage}[c]{0.5\textwidth} \centering \includegraphics[width=55mm] {18}\\ {$G'$}\\ \end{minipage} \caption{Construction of $G'$ from an example graph $G$} \label{fig:fig7 \vspace{-0.2in} \end{figure*} \begin{proof} It is already shown that the decision version of the {\it Maximum Payoff Problem} is in $\mathcal{NP}$. Now we show a reduction from {\it Dominating Set Problem} to this problem. Let $\mathcal{I}$=$(G,k)$ be any valid instance of {\it Dominating Set Problem}, where $G$=$(V,E)$ is an unweighted graph and $k$ is an integer. We construct a new weighted graph $G'$=$(V',E')$ from $G$ by adding a pendant vertex to each of the vertices. The construction for an example graph is shown in Figure \ref{fig:fig7}. Let $\tilde{F}$ be the set of $|V|$ new vertices. Define $V'$ = $V \cup \tilde{F}$ and $E'$ = $E \cup \{(v_i,f_i)$ $| \forall v_i \in V\}$. Assign weight $w_e < \frac{1}{|V|+|E|+k}$ to each edge $e \in E'$ and weight $w_v=1$ to each vertex $v\in V'$. Now consider the decision version of the {\it Maximum Payoff Problem} on $G'$, where each of the points in $\tilde{F}$ contains a facility of P1. We claim that there exists a dominating set of size $k$ in $G$ if and only if there exists a set $S$ of $k$ points in $G'$ such that $\mathcal{Q}_2(\tilde{F},S)\geq |V|$. Consider the forward direction at first. Suppose $G$ has a dominating set $D$ of size $k$. In graph $G'$, $D$ can be used for placement by $P2$. Note that every vertex in $V$ is adjacent to one of the vertices of $D$. So the payoff of $P2$ is at least $|V|$. Now consider the reverse direction. Suppose $S$ be a set of $k$ points in $G'$ such that $\mathcal{Q}_2(\tilde{F},S)\geq|V|$. Now using a construction similar in the proof of Theorem \ref{thm:optimality} we can construct a placement $S_1$ such that $S_1 \subseteq \Gamma\cup V$. Thus without loss of generality we assume $S\subseteq \Gamma\cup V$. Recall that for each edge $(f_i,v_i)$ there exists a point $p_i$ very close to $f_i$ such that distance between $p_i$ and $f_i$ is small enough to be considered as zero. Denote the set of all such points as $P$. Now observe that as weight of each edge is same $\Gamma \subseteq P\cup V$. Hence $S\subseteq P\cup V$. Now we construct a new set of placements $S'$ from $S$ in the following way. For all points $s_i\in S$, such that $s_i\in V$, add $s_i$ to $S'$. For all points $s_i\in S$ such that $s_i\in P$, let $s_i \in (f_i,v_j)$. Add $v_j$ to $S'$ if $v_j\notin S$, else add any vertex $v\in V$ to $S'$ such that $v\notin S$ (see Figure \ref{fig:shiftvertex}). Observe $S'\subset V$ and $\mathcal{Q}_2(\tilde{F},S')>\mathcal{Q}_2(\tilde{F},S)-kw_e$. We show that $S'$ is a dominating set. Note that the payoff $\mathcal{Q}_2(\tilde{F},S')$ can be written as $\mathcal{Q}_{E'}+\mathcal{Q}_V$, where $\mathcal{Q}_{E'}$ and $\mathcal{Q}_V$ are the sum of the weights of the respective edges and vertices in service zone of P2 corresponding to the placement $S$. Observe that $\mathcal{Q}_{E'}\leq (|V|+|E|)w_e$. Hence $\mathcal{Q}_V > \mathcal{Q}_2(\tilde{F},S)-kw_e-(|V|+|E|)w_e > \mathcal{Q}_2(\tilde{F},S)-(|V|+|E|+k)w_e$. But recall that $w_e < \frac{1}{|V|+|E|+k}$, thus $\mathcal{Q}_V > \mathcal{Q}_2(\tilde{F},S)-$1. Now the assumption was that $\mathcal{Q}_2(\tilde{F},S)\geq|V|$, which implies $\mathcal{Q}_V > |V|-$1. As $\mathcal{Q}_ V$ is always an integer $\mathcal{Q}_V\geq |V|$. Thus P2 serves all the vertices of $V$. Now any vertex $v_i\in V$ will be served by a facility $s_j\in S'$ if and only if $s_j$ is neighbor of $v_i$. Hence $S'$ is a dominating set of $G$ of size $k$, which completes the proof of this theorem. \end{proof} \begin{figure}[ht] \centering \includegraphics[height=10mm]{14} \caption{Formation of $S'$ from $S$ in proof of Theorem \ref{th:nphard}} \label{fig:shiftvertex} \end{figure} Note that scaling of the weights of the edges and the vertices by same amount does not change the relative payoffs of P1 and P2. Thus the proof of $\mathcal{NP}$-completeness still holds if we scale up the weights of edges and vertices of the graph used in our construction by a factor of $|V|+|E|+k$. Now the weight of any edge is at most $1$ and the weight of any vertex is $|V|+|E|+k$. Thus the problem remains $\mathcal{NP}$-complete even if the weights of the graph is bounded by a polynomial in the length of the input. Hence the decision version of the Maximum Payoff Problem is strongly $\mathcal{NP}$-complete indeed. \section{Approximation Bound for the Maximum Payoff Problem on Graphs}\label{sec:approximation}\vspace{0.1in} In this section we discuss an $1-\frac{1}{e}$ factor approximation algorithm for the {\it Maximum Payoff Problem}. We show a construction for generating an instance of the {\em Weighted Maximum Coverage Problem} from an instance of the {\em Maximum Payoff Problem} in polynomial time and use the existing approximation algorithm for the {\it Weighted Maximum Coverage Problem} to get an approximation algorithm for our problem. But before that let us define the {\it Weighted Maximum Coverage Problem}.\\\\ {\it Weighted Maximum Coverage Problem} (WMCP): Given an universe $X=\{x_1,x_2,\ldots,x_n\}$, a family $\mathcal{S}$ of subsets of $X$, an integer $\tau$ and weight $w_i$ associated with each $x_i\in X$, find $\tau$ subsets from $\mathcal{S}$ such that total weight of the covered elements is maximized.\\ WMCP is known to be $\mathcal{NP}$-hard and there is an $1-\frac{1}{e}$ factor greedy approximation algorithm for it, where $e\approx 2.718$ \cite{Hochbaum}. In each iteration this algorithm chooses a subset, which contains the maximum weighted uncovered elements. Thus we have the following theorem. \begin{theorem} \cite{Hochbaum} The greedy algorithm for WMCP achieves an approximation ratio of $1-\frac{1}{e}$.\label{th:hochbaum} \end{theorem} \begin{figure}[ht] \centering \includegraphics[height=40mm]{10} \caption{Service zone of $s$} \label{fig:app} \vspace{-0.1in} \end{figure} Let $G$=$(V,E)$ be any graph and $F$ be any set of facilities placed by P1 in $G$. P2 wants to place $k$ new facilities. Now from Theorem \ref{thm:optimality} it follows that there exists an optimal placement by \textit{P2} which is a subset of $\Gamma\cup V$. Now consider any placement of facility at $s\in \Gamma\cup V$ by P2. Let $B_s$ be the set of bisectors corresponding to $s$. For example in Figure \ref{fig:app}, P1 has placed two facilities at $f_1$ and $f_2$ and P2 has placed a facility at $s$. The service zone of P2 is shown with dotted lines. Here the set $B_s$ will be equal to $\{p_1,p_2,p_3\}$. Define $$B= \{\cup_{s\in \Gamma\cup V} B_s\}\cup \Gamma$$ It is easy to see that each edge of $G$ can contain at most a constant number of bisectors corresponding to each point of $\Gamma \cup V$. Thus from Observation $\ref{obs:gamma}$ it follows that the cardinality of $B$ is bounded by $O({(\Gamma\cup V)}E)$= $O((V+E)^2)$. Now we construct a new graph $G'$=$(V',E')$ from $G$, where $V'$=$V\cup B\cup F$. For any edge $e_{ij}\in E$ with end vertices $v_i$ and $v_j$, which does not contain any point of $B$, include $e_{ij}$ in $E'$. Any edge $e_{ij}$ which contains one or more points of $B$, say $\{b_1,b_2,\ldots ,b_l\}$, sorted along $v_i$ to $v_j$, add the edges $(v_i,b_1),(b_1,b_2),\ldots, (b_{l-1},b_l)$ to $E'$. The weight of each such edge is equal to its length. Now observe that service zone of the facility of P2 placed at a point of $\Gamma\cup V$ is a subgraph whose edges are in $E'$ and vertices are in $V\cup B$. Now consider the set system where $X$ is equal to $E' \cup V$ and for each point $p_i\in \Gamma\cup V$ define the set $S_i \subseteq E' \cup V$ such that $S_i$ is the set of edges and non-bisector vertices which are in service zone of the facility of P2 at $p_i$. Now run the greedy algorithm for the {\it Weighted Maximum Coverage Problem} on this set system with $\tau$=$k$. The weight returned by this algorithm is the payoff of P2. Thus we have the following lemma. \begin{lemma} Any $\alpha$ factor approximation algorithm for WMCP produces an $\alpha$ factor approximation for the {\it Maximum Payoff Problem}.\label{lemma:alpha} \end{lemma} Thus by combining Theorem \ref{th:hochbaum} and Lemma \ref{lemma:alpha} we have the following theorem. \begin{theorem}\label{thm:approx} There exists an $1-\frac{1}{e}$ factor approximation algorithm for the Maximum Payoff Problem. \end{theorem} \section{Bound on Maximum Payoff of P1 on Trees}\label{sec:tree} We are given a tree $T$=$(V,E)$. We show a lower bound on maximum payoff of P1 from $T$. Denote the total weight of $T$ by $\mathcal{W}$. Recall the definition of partition of a tree from Section \ref{sec:optontree}. We show that there is a collection of points $P$ in $T$ such that the weight of each subtree in the partition $T(P)$ is at most $\frac{\mathcal{W}}{|P|+1}$. Here we assume that if a subtree in a partition contains a vertex of $P\cap V$, then its weight is changed to zero. \begin{lemma} For any tree $T$ and a positive integer $\tau$ there is a set of points $P=\{p_1,p_2,\ldots,p_\tau\}$ which partitions $T$ into at least $\tau+1$ subtrees such that weight of each subtree in $T(P)$ is at most $\frac{\mathcal{W}}{\tau+1}$.\label{lem:tau} \end{lemma} \begin{proof} Observe that it is enough to show that for any weighted tree $T$=$(V,E)$ with weight function $w$ and a positive integer $\tau$ there is a point $\mathring{p}$ which partitions the tree into two or more parts so that the weight of one part is at most $\frac{\tau \mathcal{W}}{\tau+1}$ and the weight of every other part is at most $\frac{\mathcal{W}}{\tau+1}$. Choose an arbitrary vertex of tree as the root of $T$. Define an extended weight function $w_T: V \rightarrow \mathbb{R}^+ \cup \{0\}$ such that for a vertex $v_i$,\\ \[ w_T(v_i) = \left\{ \begin{array}{l l} w(v_i) & \textrm{ if $v_i$ is a leaf}\\ w(v_i) + \sum_{j:\text {$v_j$ is a child of $v_i$}}(w_T(v_j)+w(v_i,v_j)) & \text{ otherwise} \end{array} \right.\] Now observe that there will always be a vertex with extended weight greater than or equal to $\frac{\mathcal{W}}{\tau+1}$ and all of its children are having extended weight less than $\frac{\mathcal{W}}{\tau+1}$. Denote that vertex by $\breve{v}$. Let the children of $\breve{v}$ be $\{v_1,v_2,\ldots,v_l\}$. Now if for all $1\leq i\leq l$, $w_T(v_i)+w(\breve{v},v_i)$ is less than $\frac{\mathcal{W}}{\tau+1}$, then $\mathring{p}=\breve{v}$. Otherwise there exists a child $v_j$ of $\breve{v}$ such that $w_T(v_j)+w(\breve{v},v_j)>\frac{\mathcal{W}}{\tau+1}$, and $w_T(v_j)<\frac{\mathcal{W}}{\tau+1}$. However, in that case there exists a point $p$ on the edge $(\breve{v},v_j)$, which partitions the tree into two parts, one having weight $\frac{\mathcal{W}}{\tau+1}$ and the other having weight $\frac{\tau\mathcal{W}}{\tau+1}$. Thus $\mathring{p}=p$ and the result follows. \end{proof} The next corollary follows from Lemma \ref{lem:tau}. \begin{cor} There exists a placement strategy of P1 such that it always achieves at least $\frac{m-k+1}{m+1}\mathcal{W}$ as its payoff for {\it One-Round (m,k) Voronoi Game on} $T$.\label{cor:boundonpayoff \end{cor} \begin{proof} We prove this corollary by proposing a placement strategy of P1. By Lemma $\ref{lem:tau}$ we know that there exists a set $F'$ which partition the tree $T$ in a manner such that each of the partition is having weight at most $\frac{\mathcal{W}}{m+1}$, where $|F'|$=$m$. Suppose P1 places its facilities on the points of $F'$. By placing $k$ facilities P2 can occupy at most $k$ partitions. Payoff of P2 in that case would be at most $\frac{\mathcal{W}}{m+1}k$ . Hence the payoff of P1 is at least $\frac{m-k+1}{m+1}\mathcal{W}$, which completes the proof of this corollary. \end{proof} Now consider a restricted version of this game where P2 places only one facility. Also consider the complete bipartite graph $K_{1,m}$ with $m$ edges of equal weight. In this case, an optimal strategy of P1 is to place a facility at the \textit{central vertex} (i.e., at the vertex with degree $m$) and the remaining $m-1$ facilities anywhere on the graph. On the other hand, P2 chooses a point as close as possible to the \textit{central vertex} as its optimal strategy. Thus service zone of P2 is limited within an edge and payoff of P1 is $\frac{m}{m+1}\mathcal{W}$. So, the bound of Corollary $\ref{cor:boundonpayoff}$ is tight for $k=1$. \section{Conclusion} Considering the optimal facility location problem for P1 we have shown a lower bound on the maximum payoff. But the status of this problem is still unresolved for general graphs. Also it is not known that whether this problem could be solved in polynomial time on trees. We have shown that the {\it Maximum Payoff Problem} is strongly $\mathcal{NP}$-complete and subsequently designed an $1-\frac{1}{e}$ factor approximation algorithm. But no tight lower bound is known on the maximum payoff of P2. We have designed a polynomial time algorithm for the {\it Maximum Payoff Problem} on tree. However, the time complexity of this algorithm is very high and thus one might be interested to reduce it. On the other hand, it would be interesting to study the nature of this problem for some special classes of trees. \bibliographystyle{plain}
{'timestamp': '2014-08-01T02:11:26', 'yymm': '1407', 'arxiv_id': '1407.8474', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8474'}
arxiv
\section{Introduction}\label{sec1} Multiple sclerosis (MS) is an autoimmune disease of the central nervous system characterized by neuronal demyelination that results in brain and spinal cord lesions. These lesions can appear throughout the brain but are more prevalent in white matter. Damage to the myelin and axons, the ``wires'' of the central nervous system, affects the ability of nerve cells to communicate effectively and leads to deficits in the motor, sensory, visual and autonomic systems [\citet{Compston2008}]. Clinical symptoms of MS occur in episodic acute periods of attacks (relapsing forms), in gradual progressive deterioration of neurologic function (progressive forms) or in a combination of both [\citet{Lublin1996}]. Patients are categorized into different MS subtypes based on these clinical disease courses. However, the progression of the disease and the formation of lesions are highly heterogeneous both within and between individuals. MRI is an established tool in the diagnosis of MS and in monitoring its evolution [\citet{Bakshi2008,Filippi2011}]. A single MRI scanner can produce a range of different types of images. $T_1$-weighted MRI images show white matter as most intense, gray matter darker and cerebral spinal fluid darkest. $T_2$-weighted MRI images show cerebral spinal fluid as most intense, gray matter darker and white matter darkest; air has no signal in either type of image. In MS, $T_{1}$-weighted images identify areas of permanent axonal damage that appear as hypointense ``black holes.'' $T_{2}$-weighted images show both new and old lesions as hyperintense regions. These MRI scans provide complementary information about the nature of MS and are important tools used to monitor disease course in both time and space [\citet{Neema2007}]. $T_{1}$ and $T_{2}$ images also support various approaches in lesion detection, lesion segmentation [\citet{Anbeek2004}], patient phenotyping and patient classification [\citet{Bakshi2008}]. For quantitative analysis of MS lesions from MRI scans, researchers create lesion maps, binary images that mark the exact location of the lesions. After registering all subjects to a common anatomical atlas, they create lesion probability maps (LPM) that show the empirical lesion rate at each voxel (or volume element). Despite the importance of MRI for management of MS, clinically observed disease progression correlates only poorly with conventional MRI findings; this is so notable that some researchers call the lack of such associations a paradox [\citet{Kacar2011}]. Possible reasons for this paradox include an underestimation of brain damage by conventional MRI and a lack of histopathological specificity of MRI findings [\citet {Barkhof2002}]. This, however, has prompted structural investigations of the so-called normal-appearing brain tissue outside the MR visible lesions [\citet {Vrenken2006}]. For example, another type of MRI, diffusion tensor imaging (DTI), is used for measuring changes in the normal appearing brain tissues [\citet{Rovaris2005}] and is used to investigate the relationship between diffusion abnormalities and clinical disabilities in MS patients [\citet {Werring1999,Filippi2001,Roosendaal2009,Goldsmith2011}]. To better detect and understand MRI-clinical associations, a number of authors have focused on voxel-by-voxel analyses of LPMs. Some studies compare distribution of patterns of lesions from different MS subtypes [\citet{Holland2012,Filli2012}]. Others have proposed correlating lesion map data with different types of clinical deficits; ``Voxel-based lesion-symptom mapping'' (VLSM) [\citet{Bates2003}] is the name given to voxel-by-voxel modeling of tissue damage with behavioral and clinical correlates. However, these methods are all ``mass univariate'' and ignore the spatial dependence between nearby voxels. These methods also use standard linear models that are inappropriate for binary data. Often, researchers smooth the lesion maps, but this does not completely eliminate the non-Gaussian nature of the data and requires an arbitrary choice of the smoothing parameter [\citeauthor{Charil2003} (\citeyear{Charil2003,Charil2007}) \citet{Kincses2011,Dalton2012}]. For example, \citet{Charil2003} perform voxel-wise linear regressions between lesion probability and different clinical disability scores to identify the regions preferentially responsible for different types of clinical deficits. \citet{Charil2007} correlate focal cortical thickness with white matter lesion load and with MS disability scores. In both studies, the authors apply an arbitrary smoothing kernel and perform the analyses independently at each voxel or cortical vertex. Our motivation for this work is twofold: (1) to appropriately model these binary lesion maps and model the local spatial dependence and, more importantly, (2) to obtain sensitive inferences on the presence of spatial associations between lesion location and subject specific covariates such as MS subtype, age, gender, disease duration (DD) and disease severity as measured by the Expanded Disability Status Scale (EDSS) score and the Paced Auditory Serial Addition Test (PASAT) score. To this end, we propose a Bayesian spatial model of lesion maps. In particular, we propose a spatial generalized linear mixed model with spatially varying coefficients. The spatially varying coefficients are latent spatial processes (or fields). We model these processes jointly using a multivariate pairwise difference prior model, a particular instance of the multivariate conditional autoregressive model [\citeauthor{Besag1974} (\citeyear{Besag1974,Besag1993}), \citet{Mardia1988}]. Our model fully respects the binary nature of the data and the spatial structure of the lesion maps as opposed to the aforementioned mass univariate methods. Furthermore, our model produces regularized (smoothed) estimates of lesion incidence without an arbitrary smoothing parameter. Our model also allows for explicit modeling of the spatially varying effects of covariates such as age, gender and disabilities scores (e.g., the EDSS and PASAT scores), producing spatial maps of these effects and their significance, as well as the (scalar) effect of spatially varying covariates such as the fraction of white matter in each voxel. The idea of spatial modeling with spatially varying coefficient processes traces back to \citet{Gelfand2003}. They model the coefficient surface as a realization of a Gaussian spatial process. The correlation function of the Gaussian process determines the smoothness of the process. However, difficulties arise when the number of sites is large. In particular, inversion of the correlation matrix is computationally infeasible. To overcome this difficulty, \citet{Banerjee2008} introduce the Gaussian predictive process. They project the original high-dimensional space onto a low-dimensional subspace with a reduced set of locations, fit a Gaussian process on this subspace and then use Kriging [\citet {Krige1951}] to interpolate back to the original space. \citet{Furrer2006} and \citet{Kaufman2008} reduce the computational burden by covariance tapering. Covariance tapering is a method whereby the covariance function is attenuated with an appropriate compactly supported positive definite function such that the covariance between pairs of sites that are farther apart than some prespecified constant is set to zero. This results in a sparse covariance matrix that can be inverted using algorithms specifically designed for sparse matrices. A different perspective is to view both the outcome and the coefficient images as 3-dimensional functions, and thus use the framework of functional data analysis [\citet{Ramsay2006}]. In particular, function-on-scalar regression models regress functional outcomes on scalar predictors (covariates) [\citet{Reiss2010}]. \citet{Reiss2009} propose a functional principle component analysis approach for scalar outcome generalized linear models with functional predictors and spatially varying coefficients. \citet{Crainiceanu2009} introduce generalized multilevel functional regression that uses a truncated Karhunen--Lo\`{e}ve expansion to estimate spatially varying coefficients. All these alternative approaches rely on data reduction methods or approximations to the processes. In contrast, our model does not rely on data reduction methods or approximations. Parallel computing on a graphical processing unit (GPU) handles the computational burden. In the next two sections we formulate our Bayesian spatial model and discuss some important algorithmic issues. In Section~\ref{section-app} we apply our model to binary lesion maps derived from $T_{2}$-weighted, high-resolution MRI images from 250 subjects categorized into the five clinical subtypes of MS. We compare our results with a mass univariate logistic regression approach, Firth regression [\citet{Firth1993,Heinze2002}], in terms of both parameter estimates and predictive performance. Results from a simulation study are reported in Section~\ref{section-simstudy}. We conclude the paper with a brief discussion. Gibbs sampler details and some theoretical aspects of our model are given in the supplemental article [\citet{Ge2014}]. \section{Spatial generalized linear mixed models} Spatial generalized linear mixed models are similar to generalized linear mixed models in that both have a link function, fixed and random components. The difference lies in how both the data and systematic component are functions of space in the former. We have binary data $Y(s)$ for each subject, where $s \in\mathbb R^{d}$, for $d \geqslant1$ dimensional space (we work exclusively with $d=3$). The link function is a monotonic function that relates the expectation of the random outcome to the systematic component. The systematic component relates a scalar $\eta(s)$ to a linear combination of the covariates: $\eta(s)={\mathbf x}^{\mathrm T}(s){\bolds\beta}(s)$. That is, the covariates, parameters and $\eta$ are functions of space. This representation of the systematic component is general enough to cover spatially varying coefficients, spatially varying covariates, spatially constant covariates and coefficients, and any combination of the above. Typically for binary data, either the canonical link, the logit link, with the natural parameter, the log odds or the probit link is used. For computational reasons, we use the probit link (see Section~\ref{section-algo}). This model, along with appropriate prior distributions for the model parameters, applies to a wide range of scenarios with spatial binary data on a lattice, though we focus only on our neuroimaging application. \subsection{The model} \label{model} We use notation from the spatial literature and refer to each voxel in the image as a site. Let $s_{j}, j=1, \ldots, M$, denote the $j$th site within the brain $\mathcal{B} \subset\mathbb{R}^{3}$, where the sites are ordered lexicographically. For subject $i=1, \ldots, N$ at site $s_{j}$, let $Y_{i}(s_{j})$ denote a Bernoulli random variable representing the presence [$Y_{i}(s_{j})=1$] or absence [$Y_{i}(s_{j})=0$] of a lesion. For subject $i$, let ${\mathbf x}_{i}$ denote a column vector of $P$ subject-specific covariates and let $w(s_{j})$ denote a single spatially varying covariate evaluated at site $s_{j}$ that is shared among all subjects. Our spatial generalized linear mixed model at site $s_{j}$ can then be written as \begin{eqnarray} \bigl[Y_{i}(s_{j}) \mid p_{i}(s_{j}) \bigr] &\sim& \operatorname {Bernoulli}\bigl[p_{i}(s_{j})\bigr], \label{sglmm:random} \\ \Phi^{-1} \bigl\{\mathrm{E} \bigl[Y_{i}(s_{j}) \mid p_{i}(s_{j}) \bigr] \bigr\} &=& \eta_{i}(s_{j}), \label{sglmm:link} \\ \eta_{i}(s_{j}) &=& {\mathbf x}_{i}^{\mathrm T} \bigl[\bolds\alpha+\bolds\beta (s_{j}) \bigr]+w(s_{j}){\gamma}, \label{sglmm:systematic} \end{eqnarray} reflecting the random, link and systematic component, respectively. The random component is specified in \eqref{sglmm:random}, $Y_{i}(s_{j})$ is a Bernoulli random variable where $\Pr [Y_{i}(s_{j})=1 ]=p_{i}(s_{j})$. The link function is the probit link function, $\Phi^{-1}$, and the systematic component is given by equation \eqref{sglmm:systematic}. The motivation for this specific choice of systematic component will become clear in Section~\ref{section-app}. Since the expectation in \eqref{sglmm:link} is equal to the probability that $Y_{i}(s_{j})=1$, $p_{i}(s_{j})$, we can combine these three components into a \emph{spatial probit regression model} with mixed effects: \begin{equation} \label{probit} \Phi^{-1} \bigl\{\Pr \bigl[Y_{i}(s_{j})=1 \mid\eta_i(s_{j}) \bigr] \bigr\}= {\mathbf x}_{i}^{\mathrm T} \bigl[\bolds\alpha+\bolds\beta(s_{j}) \bigr]+w(s_{j}){\gamma}. \end{equation} The fixed effects in this model are the $P$-vector of parameters ${\bolds \alpha}$ and the scalar parameter $\gamma$, while the random effects are the $P$-vectors ${\bolds\beta}(s_{j})$, one at each site. Note that these random effects are spatially varying random effects and not subject specific random effects. Finally, $w(s_{j})$ is a covariate function of space, typically called a spatially varying covariate, while the spatially varying random effects are often called spatially varying coefficients. Note that our model is not implying a causal pathway. Indeed, demyelination, that appears in $T_2$-weighted MRI imaging as hyperintense lesions, may cause changes in both EDSS and PASAT. Rather, our model is an association model, relating lesion prevalence to covariates through the spatially varying coefficients. We conclude our model specification by assigning priors to all parameters. The fixed effect parameters have flat, improper, uninformative priors: $\pi({\bolds\alpha}) \propto{\mathbf 1}$ and $\pi(\gamma) \propto1$, as is standard for fixed effects regression parameters in Bayesian regression. Spatial parameters have Markov random field or conditional autoregressive model priors to account for the spatial structure. Neighborhood systems of sites define these priors. We regard two sites (i.e., voxels) as neighbors if they share a common face and, thus, a site can have a maximum of six neighbors. If sites $s_{j}$ and $s_{k}$ are neighbors, we write $s_{j} \sim s_{k}$, and we denote the set of neighbors of site $s_{j}$ by $\partial s_{j}= \{s_{k}\dvtx s_{k} \sim s_{j} \}$ and the cardinality of this set by $n(s_{j})$. The spatial random effect parameters have zero-centered multivariate conditional autoregressive model (MCAR) priors as follows. Define ${\bolds\beta}^{\mathrm T}= [{\bolds\beta}^{\mathrm T}(s_{1}), \ldots, {\bolds\beta}^{\mathrm T}(s_{M}) ]$: a $\mathrm{PM}$-length column vector. Following the notation in \citet{Mardia1988}, the full conditional distribution of ${\bolds\beta}(s_{j})$ is multivariate normal: \begin{equation} \bigl[{\bolds\beta}(s_{j}) \mid{\bolds\beta(-s_j)}, {\bolds \Sigma} \bigr] \sim \operatorname{MVN} \biggl[\dispf{\sum_{s_{r}\in\partial s_{j}}{ \bolds\beta }(s_{r})} {n(s_{j})}, \frac{{\bolds\Sigma}}{n(s_{j})} \biggr], \end{equation} where ${\bolds\Sigma}$ is a $P\times P$ symmetric positive definite matrix and $\bolds\beta(-s_{j})$ denotes the vector $\bolds\beta$ without the $P$ components at site $s_{j}$. Note here that over most of the interior of the brain $n(s_{j})=6$ and on the surface of the brain $n(s_{j})<6$. Thus, this implies a spatially constant covariance over most of the brain. In the discussion we show how this assumption can be relaxed. By Brook's lemma [\citet{Brook1964}], the joint distribution, up to a constant of proportionality, is \begin{equation} \pi [{\bolds\beta} \mid{\bolds\Sigma} ] \propto \exp \biggl\{-\dispf{1} {2}\sum _{s_{i} \sim s_{j}} \bigl[{\bolds\beta}(s_{i})-{\bolds \beta}(s_{j}) \bigr]^{\mathrm T}{{\bolds \Sigma}}^{-1} \bigl[{ \bolds\beta}(s_{i})-{\bolds\beta}(s_{j}) \bigr] \biggr\}. \end{equation} This joint distribution is improper and is not identifiable [\citet{Besag1986}], as we can add an arbitrary constant to ${\bolds\beta}$ without changing the joint distribution. Nevertheless, as long as there is information in the data regarding ${\bolds\beta}$, the posterior of ${\bolds\beta}$ will be proper. Last, we need to place a prior distribution on the hyperprior parameter ${\bolds\Sigma}$ or, equivalently, on the precision matrix ${\bolds\Sigma}^{-1}$. We assign a Wishart prior with $\nu$ degrees of freedom and $P\times P$ identity scale matrix, ${\mathbf I}$, to the precision: ${\bolds\Sigma}^{-1} \sim W(\nu, {\mathbf I})$. In the analysis below, we assign an improper, uninformative prior to the precision matrix by setting $\nu=0$ while noting that the posterior is proper. \section{Some algorithmic issues} \label{section-algo} The full conditional posterior distribution of ${\bolds\beta}(s_{j})$ is not easy to sample. We can resort to the Metropolis--Hastings algorithm [\citet {Hastings1970}] or we can introduce continuous latent variables that turn the spatial generalized linear mixed model into a spatial linear mixed model [\citet{Albert1993}]. We adopt the latter approach, as then all full conditional posterior distributions are easy to sample via Gibbs sampling [\citet {Geman1984,Gelfand1990}]. We begin by introducing $N \times M$ independent continuous normal latent variables $Z_{i}(s_{j}), i=1, \ldots, N$ and $j=1, \ldots, M$, such that \begin{equation} \label{latent} \bigl[Z_{i}(s_{j}) \mid\eta_{i}(s_{j}) \bigr] \sim\mathrm{N} \bigl[\eta_{i}(s_{j}),1 \bigr]. \end{equation} Now define the conditional probability that $Y_{i}(s_{j})=1$ given $Z_{i}(s_{j})$ by \[ \Pr \bigl[Y_{i}(s_{j})=1 \mid Z_{i}(s_{j}) \bigr]= \cases{ 1,&\quad $Z_{i}(s_{j})>0,$ \vspace*{2pt}\cr 0,&\quad $Z_{i}(s_{j})\leqslant0.$} \] The spatial linear mixed model is now given by \eqref{latent} and \eqref {sglmm:systematic} along with the priors specified above. All full conditional posterior distributions are now known distributions that are easy to sample. Thus, the joint posterior of all model parameters, given the latent variables, are updated using a Gibbs sampler. To show equivalence between the two models (the probit model and the latent variable model), we integrate out the latent variables to recover our probit model~\eqref {probit}: \begin{eqnarray*}& & \Pr \bigl[ Y_{i}(s_{j})=1 \mid\eta_i(s_{j}) \bigr] \\ &&\qquad= \disp\int_{-\infty}^{+\infty}\Pr \bigl[Y_{i}(s_{j})=1 \mid z_{i}(s_{j}) \bigr]\pi \bigl[z_{i}(s_{j}) \mid\eta_i(s_{j}) \bigr]\,\mathrm{d}z_{i}(s_{j}) \\ &&\qquad= 1-\Phi \bigl[-\eta_i(s_{j}) \bigr]=\Phi \bigl[ \eta_{i}(s_{j}) \bigr]. \end{eqnarray*} The full conditional distributions of the latent variables are truncated normal distributions: \[ \bigl[Z_{i}(s_{j}) \mid Y_{i}(s_{j}), \eta_{i}(s_{j})\bigr] \sim \cases{ \mathrm{N}\bigl(\eta_{i}(s_{j}),1\bigr) \times I\bigl(Z_{i}(s_{j})>0\bigr),&\quad $Y_{i}(s_{j})=1,$ \vspace*{2pt}\cr \mathrm{N}\bigl(\eta_{i}(s_{j}),1\bigr)\times I \bigl(Z_{i}(s_{j})<0\bigr),&\quad $Y_{i}(s_{j})=0,$} \] where $I(\cdot)$ is the indicator function. We use Robert's algorithm [\citet{Robert1995}] to efficiently sample these full conditionals. We provide all full conditional posterior distributions in the supplemental article [\citet{Ge2014}]. \begin{figure} \includegraphics{718f01.eps} \caption{Trace plots and autocorrelation functions (ACFs) for assessing the mixing of our posterior sampler. Top row: Disease duration fixed effect (spatially constant) after the burn-in period, showing extremely strong autocorrelation. Middle and bottom rows: After reparameterizing with sum of fixed and random effects, the autocorrelation is reduced to acceptable levels; middle row shows a voxel with large empirical probability of lesion, while bottom row shows a voxel with an empirical probability of zero. We found similar results for mixed effects estimates at randomly selected locations in the brain.} \label{fig-TS-ACF} \end{figure} Another issue is the extremely slow mixing (high autocorrelation) of the fixed effects parameters ${\bolds\alpha}$, as we initially observed and as reported by others [\citet{Gelfand2003}]. We accelerate the mixing by noting that our primary interest is not in the fixed effects, ${\bolds\alpha}$, but rather in the spatially varying coefficients, ${\bolds\alpha}+{\bolds \beta}(s_{j})$. We also note that the posterior variances of the components\vadjust{\goodbreak} of ${\bolds \alpha}$ are much smaller than the posterior variances of the components of the ${\bolds\beta}(s_{j})$ and that the ${\bolds\beta}(s_{j})$ do not suffer from slow mixing. Thus, by reparameterizing the model with ${\bolds\beta}^{*}(s_{j})={\bolds \alpha}+{\bolds\beta}(s_{j})$ and placing a nonzero-centered MCAR prior on the ${\bolds\beta}^{*}(s_{j})$, we speed up mixing to acceptable levels (see time series and autocorrelation function plots shown in Figure~\ref{fig-TS-ACF}). One can easily recover the marginal posteriors of the components of ${\bolds\alpha}$ by simply taking the average of each component of ${\bolds\beta }^{*}(s_{j})$ over $\mathcal{B}$ during the posterior simulation, that is, at each iteration of the Gibbs sampling algorithm. The final issue is the sheer size of both data and parameters. In our application data set there are $N=250$ subjects, with $M=274\mbox{,}596$ observed Bernoulli random variables per subject for a total of 68,649,000 observations. The length of each vector ${\bolds\beta}^*(s_{j})$ in our application is 10. Thus, the total number of spatially varying coefficients that we need to estimate is 2,745,960 along with the $10\times10$ covariance matrix ${\bolds\Sigma}$. Therefore, simulating from the full posterior is an onerous task. We reduce this computational burden by coding the problem to run in parallel on a GPU. We use a NVIDIA Tesla C2050 GPU card that has 3~Gb of main memory and 448 threads (independent processing units). All data and code fit in 522 Mb of memory using floating point memory for real-valued variables. We run the algorithm for 150 thousand iterations, discarding the first 50 thousand as burn-in, at which time the Markov chain has reached its stationary distribution. The algorithm runs in just under 8 hours real time. This is approximately an increase in speed of 45 times: decreasing the real time from 15 days of computing on a single CPU (on a 3~GHz Intel processor, coded in C$++$) to just 8 hours of computing on the GPU. One trick is necessary when updating the ${\bolds\beta}^{*}(s_{j})$, as they are not independent, creating a problem when parallelizing the code. By leveraging the a priori and a posteriori conditional independence of these vectors, we break the problem into two independent parts. We explain this for the case of a 2-dimensional image, though the extension to 3-dimensions is trivial (and is what we use in practice). The pixels in a 2-dimensional image can be thought of as squares on a checkerboard, alternately colored black and red. Given the first order neighborhood system, the parameters, ${\bolds\beta}^{*}(s_{j})$, on the red squares are conditionally independent given the parameters on the black squares. Similarly, the parameters on the black squares are conditionally independent given the parameters on the red squares. However, neighbors are dependent on one another. Thus, to parallelize this problem, we divide and conquer, by extracting all ``black square'' parameter vectors and updating them in parallel conditional on the current parameter vector values on the red squares. Likewise, we extract the ``red square'' parameter vectors and update them in parallel conditional on the current parameter values on the black squares. This divide-and-conquer scheme respects the dependence of neighbors during the parameter updates and, thus, the entire algorithm remains a valid Gibbs updating algorithm. \section{Analysis of MS lesions} \label{section-app} Our motivating data set consists of 250 MS patients, each classified into one of five clinical subtypes of MS. In increasing order of clinical severity, these subtypes are clinically isolated syndrome (CIS, 11 subjects),\vadjust{\goodbreak} relapsed remitting (RLRM, 173 subjects), primary progressive (PRP, 13 subjects), secondary chronic progressive (SCP, 43 subjects) and primary relapsing (PRL, 10 subjects). We note that CIS is not a true MS subtype, but rather is the first clinical sign that MS may be imminent. Between 30--70\% of patients diagnosed with CIS go on to develop MS [\citet{Miller2005,Compston2008}]. Lesions were identified on $T_{2}$-weighted images in native resolution, $0.977\times0.977\times3.000\ \mathrm{mm}^{3}$. Two neuropathologists independently outline lesions on the MRI scans using a semi-automated approach, and a third radiologist mediates any discrepancies. The result is a binary lesion map with 1 indicating the presence of a lesion and 0 the absence of a lesion at each voxel. The images are then affine registered to the Montreal Neurological Institute (MNI) template at $1\times1\times1\ \mathrm{mm}^{3}$ resolution using trilinear interpolation, and thresholded at 0.5 to retain binary values. To reduce the overall size of the images, over 2 million voxels, we subsample every other voxel in each of the $x$-, $y$- and $z$-directions, resulting in binary images with voxel size $2\times2\times2\ \mathrm{mm}^{3}$ for a total of $M=274\mbox{,}596$ voxels. Finally, we note that our model is not dependent on the method of lesion identification and will work with any type of atlas-registered binary image data exhibiting spatial dependence. In the analysis we use six patient specific covariates: clinical subtype (coded as five dummy variables), age, gender, DD, EDSS score, PASAT score and one spatially varying covariate shared by all subjects, the white matter probability map. The EDSS score is an ordinal measure of overall disability, ranging from zero to ten in increments of one half [\citet{Kurtzke1983}]. The PASAT score is a neuropsychological test that assesses the capacity and rate of information processing as well as sustained and divided attention [\citet{Spreen1998}]. We treat clinical subtype as a nominal variable. Subtype classification is based on the clinical course of the disease. Patients classified as RLRM may convert to SCP, but, in general, patients do not progress through the five disease subtypes and, thus, we do not consider subtype as ordinal. The white matter probability map, $w(s_{j})$, is the sole spatially varying covariate. MS is primarily a white matter disease, yet due to imperfect inter-subject registration of the brain images, each subject's white matter voxels will not perfectly overlap. Thus, instead of constraining our analysis to a set of voxels defining white matter, we choose to analyze all brain voxels and use the white matter spatial covariate to account for the gross differences in lesion incidence over the brain. Thus, the covariate vector ${\mathbf x}_{i}$ has ten components. Associated with each component is a spatially varying coefficient. The first five are the intercepts for the five subtypes, and the remaining are the slopes for age, gender, DD, EDSS score and PASAT score. We do not model interactions between subtypes and covariates, as some subtypes have very little data (e.g., CIS with 11 subjects). We mean-center age, DD, EDSS and PASAT scores prior to the analysis. \subsection{Estimation} We estimate the posterior distribution via Markov chain Monte Carlo (MCMC). In particular, since all full conditional distributions have closed form, we use the Gibbs sampler. We simulate 100,000 draws from the posterior after a burn-in of 50,000, by which time the chain has converged to its stationary distribution, the posterior. \begin{figure} \includegraphics{718f02.eps} \caption{Comparison of the empirical probabilities (left) and the estimated mean posterior probabilities from our model (right) for each of the five MS subtypes. Model estimates exhibit greater smoothness due to our spatial MCAR prior.}\label{fig-Prbs} \end{figure} Figure~\ref{fig-Prbs} (left) shows the empirical lesion probabilities for the five MS subtypes. RLRM and SCP appear to have the most spatially extensive distribution of lesions. This, however, is an artifact of those groups having the most subjects. Figure~\ref{fig-Prbs} (right) shows the estimated mean posterior probabilities from our model. Only the CIS patients show a dramatically different spatial distribution of lesion incidence compared to the other subtypes. This likely corresponds to the fact that CIS patients are those first showing signs of having MS and thus have the lowest lesion load. Furthermore, only 11 of the 250 subjects are classified as CIS. However, other subtle differences are evident. For example, PRL patients appear to have the highest overall lesion prevalence. \begin{figure}[t!] \includegraphics{718f03.eps} \caption{A comparison of thresholded statistical significance maps for covariates. On the left are Bayesian standardized spatial maps (posterior mean divided by posterior standard deviation) for age, gender, disease duration, EDSS and PASAT scores, and on the right are classical statistic spatial maps (mean divided by standard deviation) from the mass univariate Firth logistic regression. Color scale is set from 2 to 5 for positive values (values below 2 are not shown, values of 5 or greater have maximal yellow color), and from $-5$ to $-2$ for negative values (values above $-2$ are not shown, values of $-5$ or smaller have the lightest blue color). The statistic values from Firth logistic regression are significantly attenuated and spatially contracted compared to our model estimates.} \label{fig-SpatialCoef}\vspace*{-6pt} \end{figure} Figure~\ref{fig-SpatialCoef} is a comparison of the thresholded (at $\pm2$) statistical maps (spatially varying coefficient estimates divided by their standard deviations) for the covariates. On the left are Bayesian standardized spatial maps (posterior mean divided by posterior standard deviation) for age, gender, DD, EDSS and PASAT scores, and on the right are classical statistic spatial maps (mean divided by standard deviation) from a mass univariate approach using Firth logistic regression [\citet {Heinze2002,Firth1993}]. (Note that we compare with Firth regression as opposed to other published methods [e.g., \citet{Kincses2011}] that use a standard linear model to fit the binary data; as we state in the \hyperref[sec1]{Introduction}, such linear models are inappropriate for binary data.) Firth regression avoids the complete separation problem by shrinking parameter estimates using a penalized likelihood approach. For Firth regression, the mass univariate regressors include the five dummy variables for clinical subtypes: age, gender, DD, EDSS and PASAT scores. Therefore, the Firth regression model shares the same subject specific covariates with our Bayesian spatial model, excluding the white matter spatial regressor, but of course ignores any spatial dependence. (While we could have included the white matter term, each voxel would have a different estimate, whereas it is shared across all voxels in our model.) \begin{table}[t!] \caption{Proportion of voxels that have standardized coefficients more extreme than $\pm2$. Our model results in a larger proportion of voxels that are substantially large compared to Firth logistic regression. This is due to the borrowing of strength from neighboring voxels in our model}\label{tab-diff} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccccc@{}} \hline & \textbf{Gender} & \textbf{Age} & \textbf{DD} & \textbf{EDSS} & \textbf {PASAT} \\ \hline {Bayesian spatial model} & 3.78\% & 5.17\% & 4.73\% & 4.08\% & 5.08\% \\ {Firth logistic regression} & 0.75\% & 1.43\% & 1.11\% & 1.80\% & 1.76\% \\ \hline \end{tabular*} \end{table} Firth regression is performed in R with the \texttt{logistf} package (\url {http://cran.r-project.org/web/packages/logistf}). In Figure~\ref{fig-SpatialCoef}, one can see that the standardized parameters from our model are substantially larger and more spatially extensive compared to those from Firth regression. Table~\ref{tab-diff} numerically contrasts the extent of spatial differences between our model and Firth regression. The scatterplots of standardized parameter estimates in Figure~\ref{fig-atten} show the strengthening of these estimates. For EDSS, for large positive coefficients, standardized parameter estimates from our spatial model tend to be larger than those from Firth regression. Likewise, for PASAT, both for large positive and negative coefficients, standardized parameter estimates from our model tend to be larger than those from Firth regression. This is a direct consequence of the MCAR prior, allowing parameter estimates from neighboring voxels to borrow strength from one another, producing smaller posterior estimates of the parameter variances. The final result is an increase in standardized parameter estimates and larger spatial extent of the signal. \begin{figure} \includegraphics{718f04.eps} \caption{Scatterplots of standardized parameter estimates from our model versus those from Firth logistic regression on a voxel-by-voxel basis. These plots show that statistic estimates from our model tend to have greater magnitude at both large negative and positive values. Vertical streaks reflect how many Firth statistic estimates are the same at different voxels (e.g., where there are no lesions), while our estimates vary. Our model tends to spread out these coefficients due to the spatial smoothing induced by the prior and, to a lesser extent, MCMC error.}\label{fig-atten} \end{figure} We consider age, gender and disease duration as nuisance parameters. Our main interest is in the EDSS and PASAT scores. Figure~\ref{fig-PASAT-EDSS} shows a single sagittal slice of standardized PASAT and EDSS parameter estimates (top left and right, resp.). For reference, the bottom panel shows the reference MRI template (left) and empirical lesion counts overlaid on the reference template (right). PASAT scores are negatively correlated (blue voxels, top left) with lesion occurrence as evident throughout areas of high lesion counts (lower PASAT scores correspond to greater mental deficits). EDSS scores are positively correlated (red voxels, top right) with lesion occurrence within the minor and major forceps (anterior and posterior medial white matter tracks that connect the prefrontal cortex between the two hemispheres of the brain and the parietal/occipital lobes between the two hemispheres, resp.), which is consistent with higher EDSS scores corresponding to more severe MS. To the best of our knowledge, these findings have not been previously reported. \begin{figure} \includegraphics{718f05.eps} \caption{A comparison of statistical significance maps for PASAT and EDSS covariates. A~single sagittal slice showing the standardized PASAT and EDSS parameter estimates (top left and right, resp.). High PASAT scores correspond to less damage from MS, and hence negative correlation between PASAT score and lesion occurrence can be seen, especially along the corpus callosum. Higher EDSS scores correspond to more severe MS, and hence the positive correlation between EDSS score and lesion occurrence in the minor and major forceps (anterior and posterior medial white matter tracks, see arrows in the figure) can be seen. For reference, the bottom panel shows the reference $T_{1}$ MRI template (left) and the same with empirical counts overlaid (right).}\label {fig-PASAT-EDSS} \end{figure} \subsection{Prediction} Using our detailed Bayesian model, it is straightforward to make predictions using Bayes' theorem. In particular, there is immense potential clinical value in predicting an individual's MS subtype based on their MRI lesion map, along with their age, gender, DD, EDSS and PASAT scores. To assess the predictive capabilities of our model, we use a cross-validation approach, leaving one subject out at a time. Direct implementation of leave-one-out cross-validation (LOOCV) would be very time consuming, as omitting one subject and rerunning the model would take 8 hours for each of 250 subjects. Thus, we adopt an importance sampling approach originally proposed by \citet{Gelfand1992} where we need to run the model only once: We remove each subject's contribution to the model by adjusting the posterior at each iteration with an importance sample, thus allowing held-out predictions for that subject. We provide details of this importance sampling approach in the supplemental article [\citet{Ge2014}]. We assign, a priori, a categorical distribution to clinical subtype with equal probability of 0.2 to each of the 5 subtypes. \begin{table} \caption{The confusion matrices of the LOOCV classification using our Bayesian spatial model (top) based on all in-mask voxels, compared to a Na\"{i}ve Bayesian classifier (NBC) (middle) and Firth logistic regression (bottom) based on voxels that have at least two lesions across subjects. Equal prior probability is assigned to each subtype when using the Bayesian model. The true subtype is shown in each row and the estimated subtype is shown in each column. The overall and the average classification rates for our Bayesian model are $0.772 \pm0.052$ and $0.828 \pm0.047$, respectively. The overall and the average classification rates for NBC are $0.552\pm 0.062$ and $0.245\pm0.053$, respectively. The overall and the average classification rates for Firth logistic regression are $0.672 \pm0.058$ and $0.300\pm0.057$, respectively} \label{tab-LOOCV} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccccc@{}} \hline & \textbf{CIS} & \textbf{RLRM} & \textbf{PRP} & \textbf{SCP} & \textbf{PRL} \\ \hline \multicolumn{6}{c}{\textit{The Bayesian spatial model}} \\ {CIS} & \textbf{1.000} & 0.000 & 0.000 & 0.000 & 0.000 \\ {RLRM} & 0.243 & \textbf{0.734} & 0.000 & 0.023 & 0.000 \\ {PRP} & 0.154 & 0.000 & \textbf{0.846} & 0.000 & 0.000 \\ {SCP} & 0.140 & 0.000 & 0.000 & \textbf{0.860} & 0.000 \\ {PRL} & 0.100 & 0.000 & 0.100 & 0.100 & \textbf{0.700} \\[3pt] \multicolumn{6}{c}{\textit{Na\"{i}ve Bayesian classifier}} \\ {CIS} & \textbf{0.000} & 1.000 & 0.000 & 0.000 & 0.000 \\ {RLRM}& 0.046 & \textbf{0.757} & 0.017 & 0.093 & 0.087 \\ {PRP} & 0.077 & 0.769 & \textbf{0.000} & 0.077 & 0.077 \\ {SCP} & 0.023 & 0.744 & 0.023 & \textbf{0.070} & 0.140 \\ {PRL} & 0.000 & 0.600 & 0.000 & 0.000 & \textbf{0.400} \\[3pt] \multicolumn{6}{c}{\textit{Firth logistic regression}} \\ {CIS} & \textbf{0.000} & 1.000 & 0.000 & 0.000 & 0.000 \\ {RLRM} & 0.052 & \textbf{0.821} & 0.006 & 0.087 & 0.034 \\ {PRP} & 0.000 & 0.538 & \textbf{0.000} & 0.385 & 0.077 \\ {SCP} & 0.000 & 0.302 & 0.023 & \textbf{0.582} & 0.093 \\ {PRL} & 0.000 & 0.400 & 0.000 & 0.500 & \textbf{0.100} \\ \hline \end{tabular*} \end{table} Table~\ref{tab-LOOCV} (top) shows the LOOCV classification results from our model. The rows show the true clinical subtype, while the columns show our predicted subtype. The overall correct classification rate is $0.772 \pm0.052$ ($X \pm 0.052$ denotes the limits of an approximate 95\% confidence interval centered at $X$ based on a normal approximation to a binomial sample proportion). The average classification rate, the unweighted average of the per-subtype correct classification rates, is $0.828 \pm0.047$. Due to the imbalance in group sizes, we find the average classification rate is much more interpretable than the overall correct classification rate. Consider a simple, obviously poor classifier that classifies every one of the 250 subjects as RLRM (when in fact only 173 subjects have this subtype). The overall correct classification rate in this case is $173/250=0.692$, while the average classification rate is $0.2$. The average classification rate balances out extremely high correct classification rates in one or two subtypes that have the largest samples sizes with extremely low correct classification rates in subtypes that have very few subjects. We see in Table~\ref{tab-LOOCV} (top) that if there is a misclassification, that misclassification tends to be in the CIS subtype. We investigated this further and found that those patients that are misclassified to CIS tend to have fewer and smaller lesions than those correctly classified (see Figure S1 in the supplemental article [\citet{Ge2014}]). As a comparison, we also perform LOOCV using a na\"{i}ve Bayesian classifier (NBC) and Firth logistic regression. Both NBC and Firth logistic regression assumes all voxels are mutually independent, ignoring spatial dependence, but NBC bases predictions on the empirical lesion rates alone (see supplemental article [\citet{Ge2014}] for NBC details). While assuming spatial independence seems like a gross oversimplification, empirically NBC often outperforms more sophisticated and computationally expensive approaches [and there are theoretical arguments for this; see \citet{Zhang2004}]. Table~\ref{tab-LOOCV} (middle and bottom) shows the NBC and Firth regression LOOCV classification results, based on only those voxels that have at least two lesions across all subjects. This ensures that for each voxel, after leaving one subject out, there is at least one lesion in the remaining subjects (classification based on all in-mask voxels produced much worse results). The results of the NBC and Firth regression are largely biased to the RLRM subtype. The overall and the average correct classification rates for the NBC are $0.552 \pm0.062$ and $0.245 \pm0.053$, respectively. The overall and the average correct classification rates for Firth regression are $0.672 \pm0.058$ and $0.300 \pm0.057$, respectively. Despite the theoretical reasons offered by \citet{Zhang2004}, for this data set, our modeling approach significantly outperforms NBC in correctly classifying subtype, and it significantly outperforms Firth regression as well. Although our model tends to misclassify a few patients into the somewhat milder CIS subtype than the other methods, it is much better at correctly classifying patients in the other four subtypes, particularly PRL patients, than the other methods (0.70 versus 0.40 and 0.10; cf. the last entry in each panel). Furthermore, our overall correct and average classification rates are much higher than either the NBC approach or Firth logistic regression. Both of these methods tend to classify most subjects into the RLRM, the subtype with the largest number of patients. Finally, to confirm that it is the imaging data and not just demographic and clinical variables that are driving prediction, we use a polytomous logistic regression (baseline categories model) with no lesion data to perform this same classification. We found accuracy rates of $0.776 \pm0.052$ (overall) and $0.419 \pm 0.061$ (average), demonstrating that it is the imaging data driving prediction accuracy. \subsection{Model diagnostics} As with any regression analyses, model diagnostics should be performed. For binary regression models these include investigation of outlying and influential observations. This should be done for each covariate at each voxel for each subject. However, the sheer size of the problem and data make this untenable. However, careful scrutiny of the coefficient maps, together with estimated mean posterior probability maps, revealed a potential outlier. Figure~\ref{fig-Outlier} shows a coronal view of a proton density image (upper left) and the standardized (posterior mean divided by posterior standard deviation) coefficient map (upper right) for age (thresholded at $\pm2$). The region in question is demarcated by cross-hairs and was identified by its location near the superior cortical gray matter. Although this region has large negative standardized coefficients (voxel at cross-hairs, $-4.3$), the posterior mean coefficient is only $-0.076$ and the mean posterior probability is only $2.5 \times10^{-4}$ (bottom panel). We find that there is one subject with a lesion in this location and she is the second youngest patient in the data set and has no discernible clinical disabilities from her disease. An investigation of her images reveals that there is indeed a lesion located in this region. Thus, although there is strong statistical evidence that younger patients are more likely to have a lesion in this location, there is little scientific significance (an increase in probability of about $2.5 \times10^{-4}$ over a subject one decade older). \begin{figure} \includegraphics{718f06.eps} \caption{Upper panel: the proton density image (left) of the outlying subject and the standardized age coefficients overlaid on the brain atlas (right). The lesion is seen on the proton density image and the standardized age coefficients (above and below the thresholds, 2 and $-2$, are shown). Lower panel: the fitted posterior lesion probabilities (blue line) as a function of age for a selected voxel (see cross-hairs in upper panel) in ``average'' RLRM females (gender, disease duration, EDSS and PASAT scores all set to 0). Also shown are the responses for all individuals at the selected voxel.} \label{fig-Outlier} \end{figure} Each area that may be of interest should be carefully examined, as we have above. This is true for all imaging based models. We therefore caution that the results require careful interpretation along with the empirical and/or posterior probability maps to determine if the results are reliable or are simply the result of an error in marking of a lesion. The area of model diagnostics for large imaging problems is an open problem that requires further work (not only for our model, but for large imaging problems in general), where traditional model diagnostics methods, that rely heavily on graphical outputs, are not feasible. \subsection{Convergence diagnostics} MCMC algorithms must be monitored for convergence. This is typically done by saving the chains for all parameters and assessing convergence either visually or by Markov chain diagnostic methods. Obviously, monitoring the approximately 2.75 million parameters in our model is not feasible. Thus, we selected 10 voxels where we monitor convergence. Some of these voxels are located in regions of high lesion prevalence and others in low lesion prevalence. We ran the model from three random initial parameter settings. Convergence was assessed using the Gelman--Rubin convergence diagnostic for multiple chains [\citet{Gelman1992}]. The largest scale reduction factor observed was 1.01, indicating convergence. As another check, we examined the 5 posterior mean coefficient maps of interest (age, gender, disease duration, EDSS and PASAT scores) and searched for the largest difference (in absolute value) between the three possible pairs of runs for each of the 5 coefficient maps. After locating the voxel at which the maximum difference occurs, using the same initial settings and seeds, we reran the 3 simulations, saving the draws of the coefficients at these voxels. Gelman--Rubin convergence diagnostics revealed a largest scale reduction factor of 1.01, indicating convergence at each of these voxels as well. \section{Simulation study} \label{section-simstudy} We now present a simulation study to assess our model when ground truth is known. We create 2-dimensional, $100\times100$, images with different behaviors in each of four $50\times50$ squares. We assume that there are two groups of subjects consisting of both males and females. The number of lesions in each quadrant is drawn from a Poisson distribution. On average, within the same group, females and males have the same number of lesions on the left two quadrants, while for each quadrant on the right, females have 4 more lesions than males. Similarly, on average, for the same gender, subjects in groups 1 and 2 have the same number of lesions on the top two quadrants, while for each quadrant at the bottom, subjects in group 1 have 4 more lesions than subjects in group 2. The locations of the lesions are uniformly distributed on each quadrant. Each lesion is modeled as a square with side length a random variable uniformly distributed on the set $\{1, 3, 5\}$. Lesions are allowed to intersect with each other and merge into larger lesions. Figure~\ref{fig-SimProb}(A) shows the binary images from some randomly selected subjects. For each combination of male vs. female and group 1 vs. group 2, we simulated binary data for ten thousand subjects. With the large number of subjects, an accurate estimation of true lesion probability can be obtained by calculating the empirical lesion rate at each pixel and averaging over each quadrant excluding the outer two edge pixels on all sides to reduce edge effects. For example, the ``true'' lesion rates for the males in group 1 (the first column in Figure~\ref{fig-SimProb}) are thus 0.0455, 0.0366, 0.0546 and 0.0459, clockwise, starting with the upper left quadrant. \begin{figure} \includegraphics{718f07.eps} \caption{Simulated data results. \textup{(A)} Lesion patterns from randomly selected subjects. \textup{(B)} Empirical lesion rates based on 100 randomly generated subjects. \textup{(C)} Estimated lesion probabilities from the Bayesian spatial model. \textup{(D)} Histograms of the difference between the estimated probabilities from the Bayesian spatial model and the true probability in the interior area of each quadrant. \textup{(E)} Histograms of the difference between the estimated probabilities from Firth logistic regression and the true probability in the interior area of each quadrant.} \label{fig-SimProb} \end{figure} We then randomly selected 100 subjects from each combination, creating a sample size of 400, and fitted our model. The empirical lesion rates from the selected subjects are shown in Figure~\ref{fig-SimProb}(B). The regressors in the model are gender and two random intercepts corresponding to the two groups. All regressors are associated with spatially varying coefficients. Females are coded 0 and males 1. We consider two pixels to be neighbors if they shared a common edge. The posterior distributions of the parameters are approximated by running the Gibbs sampler for 12,000 iterations, discarding the first 2000 as burn-in. Figure~\ref{fig-SimProb}(C) shows the estimated lesion probabilities from our Bayesian spatial model. Compared to the empirical rates in Figure~\ref{fig-SimProb}(B), the smoothing effect is evident. Figure~\ref{fig-SimProb}(D) shows histograms of the difference between the estimated probabilities from the Bayesian spatial model and the ``true'' lesion rates in each quadrant. The mean squared error (MSE), averaged over all pixels, is $1.20\times10^{-4}$. As a comparison, we also performed Firth logistic regression at each pixel. The histograms of the difference between the estimated probabilities from Firth logistic regression and the ``true'' lesion rates in each quadrant are shown in Figure~\ref{fig-SimProb}(E). These histograms are wider, and the MSE is $3.33\times10^{-4}$: approximately 3 times larger. \begin{figure} \includegraphics{718f08.eps} \caption{Simulated data results. \textup{(A)} Standardized spatially varying coefficients of gender and the difference between the two intercepts. \textup{(B)} Standardized coefficient maps produced by Firth logistic regression.} \label{fig-SimCoef} \end{figure} Figure~\ref{fig-SimCoef}(A) shows the standardized spatially varying coefficients of gender and the difference between the two intercepts (Group1--Group2). The spatial coefficient maps clearly reflect the spatially varying effect of gender and the group difference. Figure~\ref{fig-SimCoef}(B) shows the standardized coefficient maps from Firth logistic regression. Without spatial regularization, the significance map is attenuated relative to that from our model. We note here that the true coefficient maps are not available and that the comparisons made here are relative between the two models. \section{Discussion} \label{Discussion} In this paper we present a Bayesian spatial model that respects the binary nature of the data and exploits the spatial structure of MS lesion maps without use of an arbitrary smoothing parameter. The method is suitable to model any patterns of lesions, including $T_{2}$ lesions, which show a variety of sizes and shapes, $T_{1}$ ``black-hole'' lesions and any other types of lesions from which a binary image marking the location of the lesions can be derived. By explicitly including covariates and allowing for spatially varying coefficients, our model provides spatial information that most current empirical approaches cannot; for example, we obtain estimates and estimator precisions for the spatially varying effects of age, gender, DD, EDSS and PASAT. Our model provides excellent classification accuracy for predicting clinical subtypes of MS based on the entire pattern of lesions over the brain, as well as demographic and behavioral variables. As noted in the \hyperref[sec1]{Introduction}, associations between MRI findings and clinical outcomes have been paradoxically weak. Hence, our construction of a model that not only finds disease subtype differences but also provides high prediction accuracies is an important advance for this area. Specifically, we know of no other work that performs such 5-way classification over disease subtypes. It appears that, by borrowing strength from neighboring voxels and respecting the binary nature of the data, our modeling approach overcomes this paradox to some degree. Our model is easily extended to include EDSS sub-scores (i.e., disabilities in 7 functional systems) or other diagnostic measures. Last, in Section~\ref{model} we note that the covariance matrix was constant over much of the brain. This can easily be relaxed by allowing a voxel specific covariance matrix, ${\bolds\Sigma}_{j}$, at the expense of larger computational burden. The large data set analyzed in this paper, 3-dimensional images each with about 275K voxels from 250 subjects, consists of approximately 70 million observed outcomes, represents a challenge for any spatial data analysis. There are several spatial models, as reviewed in the \hyperref[sec1]{Introduction}, with spatially varying coefficient processes which in principle could be used, but, to our knowledge, have not been applied to such a large problem. Compared to these methods, our model does not require any approximation or data reduction method. One limitation of our data is the use of affine registration to align subjects to a common space and, thus, a future direction is to use high-dimensional nonlinear registration that can better align brain structures across subjects. We could then investigate whether the predictive accuracy or covariate maps will be improved by the better structural alignment afforded by nonlinear registration. However, an issue with nonlinear registration is that lesion volumes may not change proportionally as they do with affine registration. For a given subject, some lesions may shrink by nonlinear registration while others become larger. When a lesion is shrunk, we are implicitly stating that this lesion is less important for that subject. Thus, an intriguing methodological direction is the development of a model for binary lesion data that accounts for local volume change induced by nonlinear registration, as Voxel Based Morphometry [\citet{Ashburner2000}] does with its Jacobian-based adjustment. All code, both CPU and GPU versions, is available by contacting the authors or online at \url{http://go.warwick.ac.uk/tenichols/BSGLMM}. \section*{Acknowledgments} We would also like to thank Ernst-Wilhelm Rad\"{u} and the staff of the Medical Image Analysis Center (MIAC) at the University Hospital Basel, Switzerland for generously providing the data and motivating this work. We also thank the two anonymous reviewers, the Associate Editor and Editor for the many constructive comments that have made this a much better manuscript. \begin{supplement}[id=suppA] \stitle{Supplement to ``Analysis of multiple sclerosis lesions via spatially varying coefficients''} \slink[doi]{10.1214/14-AOAS718SUPP} \sdatatype{.pdf} \sfilename{aoas718\_supp.pdf} \sdescription{This supplement contains full details of the Gibbs sampler, leave-one-out cross-validation and the na\"{i}ve Bayesian classifier. It also contains supplementary figures.} \end{supplement}
{'timestamp': '2014-08-01T02:09:39', 'yymm': '1407', 'arxiv_id': '1407.8406', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8406'}
arxiv
\section{Introduction}\label{sec1} Dynamic PET studies provide the opportunity to image functional metabolic parameters of tissue in-vivo [\citet{phelps00}]. Although there have been many developments in this direction [e.g., \citet{cunn-jones}, \citet{murase}, \citet{osull93}, Muzi et al. (\citeyear{Muzi12}), Veronese et al. (\citeyear{VRT})], no procedure has yet been\vadjust{\goodbreak} widely adopted for routine use. Most often quantitation of dynamic PET studies is based on consideration of a single time point for a user-defined region of interest (ROI). In view of the complexity of PET imaging and its expense, this is unsatisfactory. As most radiotracers used in PET act in a linear and time-invariant fashion, dynamic PET imaging measures the convolution between the activity of the tracer in the arterial blood supply and the tissue impulse response. The impulse response is known as the tissue residue function. In statistical terms the residue is the life table associated with the collection of PET tracer atoms introduced, typically by intravenous injection, to the circulatory system. The residue has its roots in the seminal indicator dilution work of \citet{MZ54}. Kinetic analysis of PET data is substantially concerned with modeling and estimation of the residue function. To this end, there are a suite of commonly used compartmental models [\citet{huang86}]. However, while compartmental models adequately represent the biochemistry of well-mixed homogeneous in-vitro samples, they are not necessarily well suited to represent micro-vascular flows and micro-heterogeneity that are part of in-vivo tissue [Bassingthwaighte (\citeyear{Bass70}), Li, Yipintsoi and Bassingthwaighte (\citeyear{li}) and \citet{ostergaard}]. Consequently, there is interest in more flexible nonparametric approaches to the estimation of the tissue residues. Among the most popular approaches is the spectral method introduced by \citet{cunn-jones}. Here residues are approximated by nonnegative sums of exponentials, whose amplitudes and rate constants are adapted to the data; see Veronese et al. (\citeyear{VRT}) for a recent treatment and review. Spectral methods have the complexity of requiring estimating of a set of intrinsically nonlinear exponential rate constants. This is a significant practical computational challenge; see Zeng et al. (\citeyear{zeng}), for example. But spectral methods also have a theoretical limitation in that they force the negative-derivative of residue function, aka the transit time density of tracer-atoms, to be monotonically decreasing from a mode at zero. This assumption is at odds with micro-vascular flow measurements which support a more log-Normal or Gamma-like form for the transit time density. If the residue is to be estimated nonparametrically, it is desirable to have a procedure, like that given in Hawe et al. (\citeyear{HaweOS}) or O'Sullivan et al. (\citeyear{Sull09}), that does not impose an unrealistic physiologic assumption on the residue function {ab initio}. Our focus here is on voxel-level estimation. The method approximates voxel-level residues by a mixture of \textit{basis} residue functions that have been optimized by applying a backward elimination technique to a segmentation of the entire volume of data. The use of mixtures in this setting is not new [\citet{osull93}], however, unlike the previous work, which has involved approximation of mixtures of compartmental models by a compartmental model form, the current approach does not require this step. An important aspect of the methodology is decomposition of the tissue residue to separately focus on characteristics associated with short transit times of tracer atoms in the vasculature, distinct from slower transit times associated with blood-tissue exchange and retention. This decomposition parallels the often separate consideration given to early and late life-time mortality patterns in human life tables. The methodology leads to a practical quadratic programming-based algorithm for voxel-level residue reconstruction and associated generation of functional metabolic images of parameters of interest. For a typical dynamic PET study the analysis, including the segmentation steps, runs on a 3.2~GHz PC in less than 30 minutes. In the context of PET scanning in cancer applications, that is, about 90\% of all clinical PET imaging studies, this is completely adequate for routine operational use. Section~\ref{sec2} presents the basic statistical models underlying the approach. Inference and model selection methodology are developed in Section~\ref{sec3}. Section~\ref{sec4} presents illustrations with imaging data from both normal subjects and cancer patients. Performance of the methodology for $^{18}$F fluoro-deoxy\-glucose (FDG) and $^{15}$O water (H2O) imaging studies is considered in Section~\ref{sec5}. This includes comparisons with compartmental model analysis and more theoretical evaluation via simulations. \section{Theory}\label{sec2} Let $C_{T}(t,x)$ represent the concentration of tracer atoms at time $t$ in a tissue voxel with three-dimensional spatial coordinate $x$. $C_{T}(t,x)$, measured as activity per unit mass (mg) of tissue, evolves in response to the localized arterial input function, denoted $C_{P}(t,x)$ and measured as activity per unit volume (ml) of whole blood. The basic assumption of most PET imaging is that the interaction of the tracer with the tissue can be approximated as a linear and time-invariant process. Thus, the measurable concentration arises as a convolution between the tissue response and the arterial input function \begin{equation}\label{eq1} C_{T}(t,x)=\int_{0}^{t}R(t-s,x)C_{P}(s,x)\,ds. \end{equation} Here $R (t,x)$ is tissue response and, borrowing terminology of the work of Meier and Zierler (\citeyear{MZ54}) on indicator dilutions, $R(\cdot,x)$ is called the residue function. Formally, $R(\cdot,x)$ is proportional to the impulse response of the tissue at location $x$ and has units of flow (ml$/$g$/$min). If all tracer atoms were instantaneously introduced in a unit volume of blood, $R(\cdot,x)$ would give the number remaining in the tissue as a function of time. If $N$ tracer atoms per ml are introduced in the arterial blood supply to the tissue, for small time increments $\Delta t$, then the number of those atoms, per gram of tissue, remaining in the tissue over the time interval $[t,t+\Delta t]$ is $N R(\cdot,x)\Delta t$. In statistical terms, $R(\cdot,x)$ defines the life table for the time variable which measures the duration of stay of the tracer atom in the tissue---the transit time. Tracer atom transit times are viewed as random---they arise from a range of interactions with an array of micro-vascular flow paths, transporters, enzymes, ligands, etc. that have the potential to influence the overall length of time the tracer atom is in the local tissue region. Measurable transit times are restricted to the observation window $[0, T_e ]$ of the scanning and, apart from the complexity of indirect measurement by the convolution equation, there is censoring because tracer atoms decay over time. Such restrictions will be familiar, as they arise in traditional life-table work. \subsection{Decomposition of residue and key summary parameters}\label{sec2.1} To better understand the residue, it is helpful to separate the early (vascular) component from the later components that are associated with longer term interaction with the tissue and also retention.\setcounter{footnote}{2}\footnote{This is similar to how a mortality life table might be dissected to focus on survival patterns at different stages of life.} Using $\tau_v \in( 0, T_e)$ as a cutoff for rapid (large-vessel) transit times, a decomposition of the residue is obtained as \begin{equation}\label{eq2} R(t,x) =R_B (t,x) + R_D (t,x) + R_X (t,x), \end{equation} where $R_B (t,x) = R(t\land\tau_v,x )$, $R_D (t,x)=R(t\lor\tau_v,x ) - R(T_e , x)$ and $R_X (t,x)$ is the constant $R(T_e, x)$. We refer to $R_B$ as the rapid vascular component, $R_D$ as the exchangeable or in-distribution component and $R_X$ as the (apparent) extracted component. \textit{Apparent} is used because the ultimate (asymptotic) extraction is not strictly observable based on the finite duration of the study, however, as it is common to choose $T_e$ large enough that there would be little further decline in the residue at times greater than $T_e$, $R(T_e, x)$ should be a good approximation to the relevant flux of the tracer atoms into tissue. The decomposition in (\ref{eq2}) is dependent on the value of $\tau_v$ (and $T_e$). For human imaging, the choice of $\tau_v=1$ minute is reasonable, as this matches the early vascular distribution time for intravenously injected contrast agents, upon which the standard scanning duration used to assess local blood volume parameters in computerized tomography (CT) and magnetic resonance (MR) is based [Provenzale et al. (\citeyear{AJNR})]. In the absence of other information, the temporal resolution of a PET study for the residue can be no better than the temporal sampling of scanning and the sharpness of the arterial input resulting from the intravenous injection of the tracer. Each component of the residue decomposition in (\ref{eq2}) is itself a residue or life table. The extracted component is constant but the vascular and distribution components carry information beyond scale. Key parameters for a residue function are its maximum and integral values, which represent the flow and volume occupied by the collection of tracer atoms defined by the residue [Meier and Zierler (\citeyear{MZ54}), Hawe et al. (\citeyear{HaweOS})]. So based on the decomposition in (\ref{eq2}), we identify five summary parameters of particular interest---vascular flow and volume ($K_B (x) $, $V_B (x)$), distribution flow and volume ($K_D (x)$, $V_D (x)$) and the apparent flux ($K_i (x)$) which is seen as the net flux of tracer into tissue up to time $T_e$. A further parameter of interest is the extraction fraction, defined by $ \zeta(x) ={K_i (x)}\cdot{(K_B (x) + K_D (x) + K_i (x))^{-1}}$. In the case where the residue is exponential, for example, a 1-compartment model [e.g., Bassingwaighte (\citeyear{Bass70})] with rate constants $K_1$ and $k_2$, for $\tau_v=0$, the flow $K_D$ reduces to $K_1$ and as $T_e \rightarrow\infty$ the exchangeable volume $V_D \rightarrow\frac {K_1}{k_2}$. Also, for a 2-compartment FDG model [Phelps et al. (\citeyear{Phelps79})] with $k_4=0$ and $\tau_v=0$, as $T_e \rightarrow\infty$ $K_D \rightarrow\frac {K_1k_2}{k_2+k_3}$, $V_D \rightarrow\frac{K_D}{k_2+k_3}$ and the flux value $ K_i (x) \rightarrow\frac{K_1 k_3}{k_2 + k_3}$.\footnote{Consideration of asymptotic quantities might be criticized, as it assumes the underlying physiology is constant---extrapolation beyond the observation window is always fraught with difficulty.}\vspace*{1pt} Substitution of the residue decomposition (\ref{eq2}) into (\ref{eq1}) gives a decomposition of the tracer tissue concentration as a sum of vascular ($C_V$), in distribution ($C_D$) and extracted ($C_X$) components \begin{equation}\label{eq3} C_{T}(t,x)=C_{V}(t,x)+ C_D (t,x) + C_X (t,x). \end{equation} The sum $C_E(t,x)=C_D (t,x) + C_X (t,x)$ is the extravascular component. Examples of this are shown in Section~\ref{sec4}. As $R_X$ is constant, $C_X (t,x)$ is the product of flux and the cumulative arterial activity. At late time points, vascular and exchangeable concentration are safely ignored so the late time concentration is effectively proportional to the cumulative arterial activity. This is the basis of a model-free approach to the analysis of flux [Patlak, Blasberg and Fenstermacher (\citeyear{Patlak})]. \subsection{Additive modeling of the tissue residue}\label{sec2.2} A variety of blood-tissue exchange models, for example, Bassingwaighte (\citeyear{Bass00}), Huang and Phelps (\citeyear{huang86}) and Gunn et al. (\citeyear{Gunn}), as well as many general life-table methods, for example, Cox and Oakes (\citeyear{Cox01}) and \citet{lawless}, might be used to approximate tissue residue functions. We should allow any approach that does not systematically misrepresent the physiologic/metabolic processes involved. Validation of model formulations for PET tracers is difficult. In-vitro studies clarify important biochemical transformations involved, but satisfactory in-vivo validation of model assumptions related to the structure of micro-vasculature flows and heterogeneities is not possible. The most widely used one- and two-compartment models in PET reduce to representation of the residue by sums of mono-exponential functions. While these models may adequately represent the biochemistry involved, their ability to describe the complexities of vascular transport is limited. Indeed, in the standard compartmental models the tracer atom transit time density is always monotonically decreasing, so the modal transit time for the nonextracted tracer is always zero. Physiologically this is difficult to justify [Bassingwaighte (\citeyear{Bass70})]. We use an additive model that approximates the local tissue residue by a positive linear sum of a fixed set of distinct basis residue functions, $\bar R_1 , \bar R_2 , \ldots ,\bar R_J$, that have themselves been derived from a nonparametric analysis of time courses arising from a full segmentation of the data volume. The model is \begin{equation}\label{eq4} R(t,x)\approx\alpha_{1}(x) \bar R_{1}(t)+ \alpha_{2}(x) \bar R_{2}(t)+\cdots+\alpha\label{eq:rr} _{J}(x) \bar R_{J}(t), \end{equation} where the $\alpha_{j}$'s are nonnegative constants. For simplicity, the basis residues are normalized to have maximum of unity, that is, $\bar R_j (0)=1$ for $j=1,2,\ldots,J$. Assuming $C_P (t,x)$ can be described by a delayed version of a sampled arterial time-course $C_P (t)$, which, in view of the temporal resolution of PET, is reasonable, equation (\ref{eq4}) implies \begin{eqnarray}\label{eq5 C_{T}(t,x)&=& \alpha_{1}(x) \bar C_{1} \bigl(t- \Delta(x) \bigr)+\alpha_{2}(x) \bar C_{2} \bigl(t-\Delta(x) \bigr)+\cdots \nonumber \\[-8pt] \\[-8pt] \nonumber &&{}+ \alpha_{J}(x) \bar C_{J} \bigl(t-\Delta(x) \bigr), \end{eqnarray} where $\bar C_j (t) = \int_0^t \bar R_j (t-s) C_P (s) \,ds$ for $j=1,2, \ldots, J$. For known delay, $\Delta(x)$, the model is linear in the $\alpha$-coefficients. Note estimation of the $\alpha$'s in (\ref{eq5}) allows the local residues to be determined by equation (\ref{eq:rr}); from them associated flow and volume parameters of Section~\ref{sec2.1} can be recovered. \subsubsection*{Remarks} 1. If the $\bar C_j$'s in (\ref{eq5}) correspond to specific regional time courses, a~mixture model interpretation for the model can be developed. This is reasonable, as the population of available metabolic pathways for a tracer atom is determined by the profile of enzymes, receptor ligands or transporters that are represented. Across a collection of voxels these profiles vary with a greater representation of certain characteristics in some voxels than in others. Thus, the transit time for a randomly chosen tracer atom in voxel $x$ can be expected to select a metabolic pathway in accordance with the distribution of pathways available within the voxel, and the $\alpha$-coefficients (scaled to sum to unity) could be viewed as a set of mixing proportions; see O'Sullivan (\citeyear{osull93}, \citeyear{osull06}). The form in equation (\ref{eq:rr}) can also be viewed as an example of a general multivariate factor analysis (without reference to residues). Such models have been used to describe PET time-course data; see, for example, Kassinen et al. (\citeyear{kaasinen}), \citet{layfield}, Lee et al. (\citeyear{lee}) and Zhou et al. (\citeyear{zhou}). 2. A tissue region can contain significant nonarterial blood vessels. Depending on tissue location, separate signals associated with major blood pools in the circulatory system, such as the right ventricle of the heart, the lungs, venous blood and the venous supply path from the injection site to the heart, might need to be considered. This can be accomplished by augmenting equation (\ref{eq5}) to include terms representing nonarterial blood signals. Obviously this is particularly relevant in the thoracic imaging where the direct or indirect (via a spillover artifact) impact of nonarterial cardiac and pulmonary blood signals can be significant. Venous blood vessels arise throughout the body, so there is a case for always including a venous signal term. But rarely does the simultaneous measurement of arterial and venous blood activity arise in a PET study. Venous blood can be viewed as a response to the arterial supply, so the venous signal is sensibly represented as a whole-body response to the arterial supply---$C_V (t) = \int_0^t R_V (t-s) C_P (s) \,ds$. Thus, if an explicit venous signal is not available, the structure of our modeling approach allows for the component $R_j$-residues to adapt to $R_V$ so that the overall tissue residue will have the venous component included. As mean transit times from arterial to venous blood are short ($<$1 minute), our proposed decomposition of the residue with $\tau_b <1$ will be a combination of pure arterial, venous contributions. Hence, $V_B (x)$ should be viewed as an estimate of the volume (per mg) of large arterial and large venous vessels in the tissue. Thus, if an explicit venous blood signal is included ($\alpha_{0}(x) C_{V}(t-\Delta(x))$), the local estimate of blood volume should be the sum of the venous volume [i.e., $\alpha_0 (x)$] and $V_B(x)$ from the estimated residue in~(\ref{eq2}). 3. Due to limited resolution, voxel-level data are subject to mixing and partial volume effects, which are reasonably modeled by mixtures; see also Section~\ref{sec3.3}. \section{Inference techniques}\label{sec3} The estimation of voxel-level residues involves three steps. First, a segmentation procedure is applied to extract scaled time-course patterns from the measured set of voxel-level time courses in the data. Next, the time courses are analyzed to recover a nonparametric residue function for each and a backward elimination procedure is used to obtain a reduced set of basis residue functions. The final step does voxel-level optimization of $\alpha$-coefficients and delay in equation (\ref{eq5}) with subsequent evaluation of the voxel residue in equation (\ref{eq:rr}) and the key parameters identified in Section~\ref{sec2.1}. The details involved in each of these steps are presented below. As the analysis is based on a voxel-level fitting process, the residuals associated with the fitting process provide useful diagnostic information. Some proposals for examining the temporal and spatial patterns in those residuals are indicated. \subsection{Segmentation}\label{sec3.1} A split-and-merge segmentation procedure from\break \citet{osull06} is used. The procedure groups voxels on the basis of the shape of the measured time course, the \textit{scaled} time course. The splitting employs a principal component analysis to recursively divide the tissue volume into a large collection (typically 10,000) of hyper-rectangular regions whose {scaled} time-course patterns show maximal homogeneity. The merging process then recursively combines (initially with a constraint to ensure that segments consist of contiguous collections of voxels) these regions to create a collection of regions with high average within-region homogeneity. For the analyses reported here, the number of segments used is taken to be large enough to explain 95\% of the variance in the {scaled} time-course data, about 7--12 segments for a typical cerebral study and 15--20 segments for a chest or abdominal study. The choice of the number of segments was examined in \citet{osull06}. As the focus of the algorithm is on \textit{scaled} time-course information, the extracted segments are well suited for use in subsequent mixture modeling. A particular advantage of the scaled approach is that it results in fewer segments than might otherwise be required to explain a comparable proportion of variance in the data. It is helpful to display segments to connect with anatomy. If the average scaled time course for a segment is given by a vector $\mu$, imaging the $\mu$-weighted average of the voxel-level time-course data in the segment is effective. Some examples are shown in Section~\ref{sec4}. \subsection{Construction of basis residues}\label{sec3.2} The time bins of data acquisition are $[$\b{t}$_{b},\bar t}_{b})$ for $b=1,2,\ldots,B$. The segmentation algorithm provides a mean time course and associated sample variance vector, $\{(y _{kb},v_{kb})$ for $b=1,2,\ldots,B\}$, for each of $k=1,2,\ldots,K$ segments. Arising from the underlying Poisson emissions that are the basis of the imaging process, regional time-course data have an approximate quasi-Poisson structure [see \citet{Hues84}; Carson et al. (\citeyear{carson}) and \citet{HaweOS}], that is, \begin{equation}\label{eq6} \mathrm{E} ( y_{kb} )= \mu_{kb} \quad\mbox{and}\quad \mathrm{V} (y_{kb} )\approx\phi_k \mu_{kb} \end{equation} for $\phi_k>1$. Thus, up to known calibration factors (incorporating time-bin duration and voxel dimension), the mean values are proportional to the integrated concentration per milligram of radioactive tracer atoms which in turn is a function of the regional residue $R_k$ and input arterial supply: \begin{equation}\label{eq7} \mu_{kb} = \int_{\underline{t}_b}^{{\bar t}_b} C_{k}(t) e^{-\lambda t} \,dt \quad\mbox{and} \quad C_{k}(t) = \int_{0}^{t}R_{k}(t-s)C_{P}(s- \Delta_{k})\,ds, \label{eq:mu} \end{equation} where $\lambda$ represents isotope decay and $\Delta_k$ is an appropriate delay. Note $C_{k} (t)$ here represents the total (radioactive and nonradioactive) tracer atom concentration at time $t$. An initial set of possible residue basis elements are obtained by representation of the $R_k$'s in terms of B-splines [O'Sullivan et al. (\citeyear{Sull09})]. Here the B-spline coefficients and the delay $\Delta_k$ are optimized by weighted least squares with weights $\varpi_{kb}$ given by $v_{kb}^{-1}$. We seek to express the segment residues in terms of a reduced set of basis residue forms. Since retention is apparent in nearly all residues, it makes sense to ensure that the constant residue function (a \textit{Patlak} term, cf. Section~\ref{sec2.1}) is a fixed member of any basis. Thus, the focus of the basis search is on representation of the nonretained residue components. Suppose we have a set of $J-1$ such normalized basis elements denoted $\bar R_j$ for $j=1,2 \ldots, J-1$ as well as the constant unit value Patlak residue, $\bar R_J$. With these, the residue for the $k$th segment ($R_k$) is approximated by the (nonnegative) linear combination \begin{equation}\label{eq8} R_k \approx\beta_1 \bar R_1+ \beta_2 \bar R_2+ \cdots+\beta_J \bar R_J \label{eq:rb}. \end{equation} By substitution into (\ref{eq:rb}), the $\beta$-coefficients and delay can be optimized to the observed segment data. A weighted least squares fitting is used with weights given by $\varpi _{kb}$. An approximate unbiased risk assessment criterion is used to obtain an overall assessment of the $J$-component basis. The target loss is the weighted square error difference between the true segment mean vectors and their estimated values based on the $J$-component approximation \begin{equation}\label{eq9} L(J) = \sum_{kb} \varpi_{kb} \bigl[ \mu_{kb}-\hat\mu^{(J)}_{kb} \bigr]^2. \end{equation} With $z_{kb}=\sqrt{\varpi_{kb}} y_{kb}$ and $\hat z_{kb}=\sqrt{\varpi _{kb}} \hat\mu^{(J)}_{kb}$, \[ z_k' \hat z^{(J)}_{k} = \sum _b \varpi_{kb} y_{kb} \hat \mu^{(J)}_{kb} = \sum_b \varpi_{kb} \mu_{kb}\hat\mu^{(J)}_{kb} + \sum_b \varpi_{kb}( y_{kb}- \mu_{kb} ) \hat\mu^{(J)}_{kb} . \] So in the case that the vector $\hat\mu^{(J)}_{k} $ is a linear function of the weighted data, that is, $\hat z^{(J)}_{k}=H_{J} z_k$, $\mathrm{E} (z_k' \hat z^{(J)}_{k}) = \mu_k' \mathrm{E} (\hat z^{(J)}_{k}) + \operatorname{trace} [ H_J \Sigma_k ]$, where $\Sigma_k$ is the covariance of $z_k$. But separate time frames, which involve distinct emission events, are statistically independent, so $\Sigma_k$ is diagonal. From equation (\ref{eq:mu}), the diagonal entries of $\Sigma_k$ are approximately $ \phi\varpi_{kb} \mu_{kb}$ for $b=1,2, \ldots, B$. Letting $\hat D_k$ be the diagonal matrix with entries $\varpi_{kb} y_{kb}$, we are led to the criterion \[ C(J) = \sum_k \biggl\{\sum _b \varpi_{kb} \bigl[y_{kb}-\hat \mu^{(J)}_{kb} \bigr]^2 + 2 \phi_k \operatorname{trace} ( H_J \hat D_k ) \biggr\} \] for evaluation of the loss $L(J)$ in equation (\ref{eq9}). Since $E C(J) = E(L(J)) + \phi\sum_{kb} \varpi_{kb} \mu_{kb}$, up to a constant that is independent of $J$, $C(J)$ is an unbiased estimator for $L(J)$. With $\phi_k=1$, this statistic has a close connection to the Rudemo and Bowman cross-validation statistic for density estimation; see, for example, O'Sullivan and Pawitan (\citeyear{OSPA96}) who gave a corresponding risk estimator for bandwidth selection in Poisson deconvolution problems. For practical use a choice of $\phi_k$ must be made---the ratio $\hat \phi_k = \sum_b v_{kb}/\sum_b y_{kb}$ seems reasonable for this. If $H_J$ is a projection, that is, $\hat\mu^{(J)}_{k} $ is approximately obtained by a weighted least squares regression, $\operatorname{trace} (H_J) = J$ and $\operatorname{trace} ( H_J \hat D_k )$ might reasonably be approximated as $J \bar d_k$, where $\bar d_k = \frac{1}{B}\sum_b\varpi_{kb} y_{kb}$. Thus, we obtain a criterion with a familiar AIC-like [\citet{Akaike}] form\footnote{It should be clear that this is not in fact an information criterion in the formal sense---only first and second order moment assumptions are involved.} \begin{equation}\label{eq10} \hat C(J) = \sum_k \biggl\{\sum _b \varpi_{kb} \bigl[y_{kb}-\hat\mu ^{(J)}_{kb} \bigr]^2 + 2 \hat\phi_k \bar d_k J \biggr\}. \end{equation} Using this criterion, a backward elimination procedure is used to select a subset of the starting $K+1$ basis residues (corresponding to the segment data residue fits plus the Patlak residue). The resulting basis set is applied in the analysis of voxel-level data. \subsection{Voxel-level optimization and local averaging}\label{sec3.3} At the voxel-level we have data with substantially the same structure as the segment-level data, $y_{bk}$ above. If $ y_{bi}$ for $b=1,2, \ldots,B$ is the PET measured activity at the $i$th voxel, from equations (\ref{eq6}) and (\ref{eq7}) we have $\mathrm{E} ( y_{ib} )=\mu_{ib}$ and $\mathrm{V} ( y_{ib} )= \phi_i \mu_{ib}$ with \begin{equation}\label{eq11} \mu_{ib} = \alpha_{i1} \bar\mu_{1b} ( \Delta_i) + \alpha_{i2} \bar\mu _{2b}( \Delta_i) +\cdots+ \alpha_{iJ} \bar\mu_{Jb}( \Delta_i) \equiv\bar\mu_{b} (\Delta_i)' \alpha_i, \end{equation} where $\alpha_{ij}= \alpha_j (x_i)$, and with $\bar C_{j}(t) =\int_{0}^{t} \bar R_{j}(t-s)C_{P}(s)\,ds$, $ \bar\mu_{jb} (\Delta_i) = \int_{\underline{t}_b}^{{\bar t}_b} \bar C_{j}(t-\Delta_i) e^{-\lambda t} \,dt$. This is in the form of a quasi-Poisson regression problem [McCullagh and Nelder (\citeyear{McCull})]. A standard iteratively reweighted least squares method is used for optimization of unknowns. With weights defined by the current guess, $\omega_{ib} = 1/{\mu_{ib}^{(0)}}$, updated values for the unknowns are obtained by minimization of \begin{equation}\label{eq12} \operatorname{WRSS}({\alpha}_i, \Delta_i ) = \sum _{b=1}^{B}\omega_{ib} \bigl[y_{ib}- \bar\mu_{b} (\Delta_i)' \alpha_i \bigr]^{2} \end{equation} with positivity constraints on the $\alpha$-coefficients. Thus, for fixed $\Delta_i$, fast (exact) quadratic programming codes are used for evaluation of solutions, making the computation efficient. Grid search is used for optimization of the delay. The impact of iterative reweighting on computing time here is quite minimal: Typically the solutions obtained with a fixed set of weights, such as weights which are inversely proportional to the segment variance ($v_{kb}$, if the voxel belongs to segment~$k$), produce results that are largely unaffected by subsequent iteration. \subsubsection*{Local averaging and smoothing} The residue formulation allows residues for locally averaged (smoothed) data to be evaluated as local averages of residue coefficients---if local variation in delay is negligible. To see this, suppose $w_{xi}$ for $i=1,2,\ldots,N$ represents a set of nonnegative weighting coefficients used to produce the averaged data---$\tilde y_{xb} = \sum_i w_{xi}y_{ib} $ is the averaged data at voxel $x$. Assume that the weights are focused, in the sense that $w_{xi} > 0$ for $i$ in a neighborhood $N_x$ and the delay variation is negligible here, that is, $\Delta_i \approx\Delta$ for $i \in N_x$. Let $\mu_{ib}= \bar\mu_{b} (\Delta)' \alpha_i $ for $i \in N_x$. From (\ref{eq11}) we have \begin{eqnarray} \tilde\mu_{xb}&=&\sum_i w_{xi} \mu_{ib} \nonumber \\[-8pt] \\[-8pt] \nonumber &=&\tilde\alpha_{x1} \bar\mu_{1b} (\Delta) + \tilde \alpha_{x2} \bar\mu_{2b} (\Delta) +\cdots+\tilde \alpha_{xJ} \bar\mu_{Jb} (\Delta) = \bar\mu_{b} ( \Delta)' \tilde\alpha_x , \end{eqnarray} where $\tilde\alpha_{xj} = \sum_i w_{xi} \alpha_{ij} $. Thus, the mean of the smoothed data $\tilde y_{xb}$ is given by a positive linear combination of the basis elements $\bar\mu_{jb} (\Delta)$ in (\ref{eq11}). Using (\ref{eq11}) again, we can also write $\tilde\mu_{xb} = \int_{\underline{t}_b}^{{\bar t}_b} \tilde C_{x}(t-\Delta_i) e^{-\lambda t} \,dt$, where $ \tilde C_x (t) = \int_0^t \tilde R_x (t-s) C_P(s- \Delta) \,ds$ and \begin{equation}\label{eq14} \tilde R_x (t) = \tilde\alpha_{x1} \bar R_1 (t) + \tilde \alpha _{x2} \bar R_2 (t) +\cdots+\tilde \alpha_{xJ} \bar R_J (t). \end{equation} Hence, the averaged $\alpha$-coefficients define the appropriate local residues for the averaged image data. This result has implication for smoothing by local averaging methods. While data smoothing/filtering is not the only mechanism used to achieve regularity in statistical function estimation, it is widely used and very reasonable in many image processing contexts, including tomography [\citet{NaWu01}]. The parametric images produced in the examples in Section~\ref{sec4} are subjected smoothed---the computed $\alpha$-coefficients are convolved with a 3-D Gaussian kernel whose coordinate standard deviation is between 1 and 2 times the voxel dimension. \subsection{Diagnostic evaluation of model adequacy}\label{sec3.4} To ensure the validity of the parametric imaging results, we assess the assumptions underlying the fitted parametric model by examining the temporal and spatial patterns in the voxel-level standardized residuals: \begin{equation}\label{eq15} r_{ib}=\sqrt{w_{ib}}\cdot{}[ y_{ib}- \hat{y}_{ib} ], \end{equation} where $w_{ib}=\hat{y}_{ib}^{-1}$. Both temporal and spatial patterns in these residuals should be examined. Temporal aspects are best appreciated by plotting uptake data, for example, time courses for segments together with fitted modeling results. The spatial distribution of the residuals can be examined but the standardization by activity is unstable for low activities (recall that the raw filtered back-projection reconstructed data can be negative for some voxels). Thus, we find it best to use a common set of weights $w_{ib}=\bar w_b$ and compare the spatial pattern of the residual and data root mean square (RMS): \begin{eqnarray*} \mbox{RMS(residual)}&=& \sqrt{\sum_b \bar w_{b}[ y_{ib}-\hat {y}_{ib} ]^{2}/B} ; \\ \mbox{RMS(data)}&= &\sqrt{\sum_b \bar w_{b}[ y_{ib}-\bar{y}_{i} ]^{2}/B}, \end{eqnarray*} where $\bar{y}_{i}$ is the weighted mean of the time course. Techniques for analysis of temporal and spatial patterns in residuals are needed, such as estimation of their spatial covariance structure, which might be related to the PET image reconstruction process [Carson et al. (\citeyear{carson}), \citet{maitra}]. \section{Application to real data}\label{sec4} We now present some case studies to illustrate the parametric imaging technique. The first examples come from cerebral imaging in normal subjects using the two most well-established PET tracers, FDG and H2O. The second set of examples are from imaging cancer patients using FDG and H2O as well more experimental tracers. All studies were carried out on a GE Advance PET scanner at the University of Washington. This scanner produces reconstructions of tracer uptake (per time bin of acquisition) as an array consisting of $35$ transverse planes/slices and a within-slice discretization of $128\times128$ voxels. Slices have a fixed thickness of $4.25$~mm, but the within-slice voxel resolution can be varied depending on the tissue volume in the field of view, typically $2.23$~mm for brain studies to $4.29$~mm for abdominal and thoracic studies. The scanner does not use X-ray CT acquisition for attenuation measurement. Instead attenuation is derived from PET transmission scans with a 511 keV rod source. All data were reconstructed using standard filtered back-projection methods. Below we present uptake and parametric images superimposed on images of PET-measured attenuation. Tracers were injected intravenously and catheterized sampling used to measure the tracer time course in the arterial blood ($C_P$). \subsection{Brain studies in normal subjects with FDG and H2O}\label{sec4.1} The FDG data set is a series reported in Graham et al. (\citeyear{graham}). For FDG, dynamic PET imaging was carried out over a 90-minute time period ($T_{e}=90$). The tracer dose (370 MBq) was injected over a 1-minute period, and $B=31$ time frames of data were acquired according to the following sampling: 1 minute pre-injection frame followed by 4 15-second frames, 4 30-second frames, 4 1-minute frames, 4 3-minute frames and ending with 14 5-minute frames. A 10-region segmentation of the data was used to initialize the mixture model analysis, that is, $K=10$ in Section~\ref{sec3.2}. This segmentation explained over 95\% of the variance in the data. Initialization with $20$ or $40$ segments produced little or no change in results. The final mixture model and associated normalized basis residues (apart from the constant residue component) had $3$ components; see Figure~\ref{fig:fig1}(a). Figure~\ref{fig:fig1}(a) shows total tracer uptake as well as computed values of the flux ($K_i$) and distribution volume ($V_D$); cf. Section~\ref{sec2.1}, superimposed on the PET-measured tissue attenuation. The flux is the most well-resolved parameter here, showing high values in white and gray matter structures of the brain. Distribution volume shows a more diffuse pattern with elevated values outside the brain (cf. the nasal cavity). In all cases the values of metabolic parameters are in agreement with values reported in the literature; cf. Graham et al. (\citeyear{graham}). Overall, the kinetic analysis of flux and volume of distribution provides an understanding of tissue metabolism of FDG that cannot be appreciated from the uptake information. \begin{figure} \centering \begin{tabular}{@{}c@{}} \footnotesize{(a) Dynamic 90-minute PET-FDG study in a normal subject}\\ \includegraphics{732f01a.eps} \\[3pt] \footnotesize{(b) Dynamic 7.5-minute PET-$H2O$ study in a normal subject}\\ \includegraphics{732f01b.eps} \end{tabular} \caption{Color maps of selected kinetic parameters (cf. Section~\protect\ref{sec2.1}) recovered by residue analysis and the integrated uptake divided by study duration. Transverse, sagittal and coronal slices shown. The gray-scale images give tissue attenuation measured by the PET transmission scan. Line plots give the fitted mixture model [cf. $\bar C_j$ in equation (\protect\ref{eq6})], including the arterial input ($C_P$ in red) and the Patlak component (blue). The normalized, non-Patlak, basis residues [$\bar R_j$ in equation (\protect\ref{eq5})] are also shown on the right.}\label{fig:fig1} \end{figure} \begin{figure}[t!] \includegraphics{732f02.eps} \caption{{\emph{Top}}: Sample segment time-course data (points) and fitted step-function nonparametric residues (gray). The fitted residue-model time course (black line) is shown with vascular (purple) vs. nonvascular (brown) components: $C_V$ and $C_E$ after (\protect\ref{eq3}). Inserts show the intensity of the time course within the region of the segment. Right color maps show the distribution of the RMS for data and residuals from analysis (cf. Section~\protect\ref{sec3.4}). {\emph{Bottom}}: (Left) Raw piecewise constant residues for segments (scaled to unity). A dendrogram obtained by clustering residues is also provided. (Center) Line plots are scaled B-spline-computed residues without retention [$\bar R_j$'s in (\protect\ref{eq9})]. (Right) Risk values [$\hat C(J)$ in (\protect\ref{eq10})] plotted against the number of components ($J$) in the mixture model---optimal number shown with blue line.} \label{fig:fig2} \end{figure} The H2O data come from a series reported in Muzi et al. (\citeyear{Muzi09}). The tracer dose (776~MBq) was injected over a 5-second time period. Dynamic PET imaging was carried out over a 7.9-minute time period ($T_{e}=7.9$). A~set of $B=42$ time frames of data was acquired according to the following sampling: 1-minute pre-injection frame followed by 5 3-second frames, 10 6-second frames, 12 10-second frames, 8 15-second frames and ending with 6 20-second frames. Similar to FDG, a 10-region segmentation of the data was used to initialize the mixture model analysis, that is, $K=10$ in Section~\ref{sec3.2} (values of $K=20$ and $K=40$ were also considered but produced little or no change in results). The mixture model and associated normalized basis residues, apart from the constant residue component, had $4$ components; see Figure~\ref{fig:fig1}(b). Figure~\ref{fig:fig1}(b) shows total tracer uptake as well as computed values for vascular blood volume ($V_B$) and the distributional flow component ($K_D$). Note the vascular blood volume is elevated in the neighborhood of the internal carodits and the nasal cavity. The (distributional) flow pattern is elevated in the white and gray matter structures of the brain. In general, values of metabolic parameters are in agreement with those reported in the literature; cf. Muzi et al. (\citeyear{Muzi09}). Similar to FDG, the kinetic analysis here is seen to add to the information provided by uptake alone. Figure~\ref{fig:fig2} presents some diagnostic information for the analyses presented. Sample segments and the results of the associated nonparametric residue analysis are shown. The increased variability of H2O is evident. Even though the injected dose is larger than that of FDG, the shorter time frames and much shorter half-life of $^{15}$O results in lower radioactivity per time frame in the H2O study. Consequently, the data have more noise, as reflected in the displayed parameters. The voxel-level residual RMS characteristics of the fit are shown in Figure~\ref{fig:fig2}. For FDG, the RMS error is very small relative to the tracer uptake; in the case of H2O, the RMS error is generally higher relative to uptake, but there still does not appear to be a spatially coherent structure to the lack of fit. The fitted residue models for the selected segments are in good agreement with the data; see Figure~\ref{fig:fig2}. The decomposition of the time course of the fitted models show the vascular and nonvascular components of the fit [cf. equation (\ref{eq3})]. Note the time courses with high vascular contributions arise from well-known blood pools in the neck and nasal cavity; less vascular signals arise from white and grey matter tissue. The full set of fitted piecewise constant nonparametric residues [Hawe et al. (\citeyear{HaweOS})] as well as the smoother residues produced by B-spline fitting [O'Sullivan et al. (\citeyear{Sull09})] are also shown in Figure~\ref{fig:fig2}. Note these latter residue curves only present the nonretained parts of the residues, that is, extraction is subtracted. The model selection criterion is plotted against the number of retained components. Three components are indicated for the FDG and four for the H2O data. A dendrogram for a hierarchical cluster analysis of the raw residues (normalized and adjusted for extraction) using a Euclidean distance matrix shows some exploratory support for the number of components selected. Note that, unlike the model selection statistic, the cluster analysis does not involve any recursive refitting of the time-course data. Overall, the analysis and diagnostics are very reasonable. A more detailed analysis over a series of similar cerebral studies is provided in the next section. \subsection{Cancer imaging examples}\label{sec4.2} The use of PET for metabolic imaging of cancer and its response to therapy is of current clinical interest [\citet{Abogye}, Krohn et al. (\citeyear{krohn-o}) and Mankoff et al. (\citeyear{mankoff-o})]. While PET-FDG imaging is an indicator of glucose metabolism, other aspects of cancer biology may also be useful. Cell proliferation, hypoxia, vascularity, drug resistance and cell death play important roles and the study of these processes in cancers with PET radiotracers is being explored with clinical imaging trails [Krohn et al. (\citeyear{krohn-o})]. We present two examples to illustrate applications of our metabolic imaging procedure in such contexts. From a methodological viewpoint, these examples demonstrate the versatility of the residue imaging technique across a range of radiotracers and also in different target tissue volumes. \subsubsection*{I. Brain tumor study} These data are from a series in Spence et al. (\citeyear{spence09}). The patient is a 39-year-old with recurrent right parietal anaplastic astrocytoma. The patient had follow-up clinical MR scans at 4 and 4.5 years after initial treatment with a combination of surgery, radiotherapy and chemotherapy. At the time of follow-up PET scans with $^{11}C$-labeled acetate (ACE), $^{11}C$-labeled carbon dioxide (CO2) and $^{18}$F-labeled fluoro-thymidine (FLT) were carried out. The ACE and CO2 studies were performed at the 4-year follow-up and the FLT at the 4.5-year follow-up. The focus of these PET scans was to study the potential for differentiation between tumor regional radionecrosis (residual but dead tissue) from tumor recurrence. This issue is difficult to decide on the basis of the standard clinical MR scan. Acetate flux is an indicator of membrane lipid synthesis [Yu et al. (\citeyear{evanyu})] and so may provide an early indicator of tumor recurrence. Metabolism of acetate produces carbon dioxide. As a result, the interpretation of acetate is somewhat confounded by processes associated with the fate of $^{11}C$ in carbon dioxide. The CO2 PET study is used to address this issue. FLT has the potential to provide information on the rate of thymidine utilization and this in turn is a potential indicator of cell proliferation. Tracers were introduced by 1-minute intravenous infusion. The sampling protocols for ACE and CO2 were identical: Frame durations in seconds (some of which were repeated a number of times) were as follows: 5(18), 10(7), 20(4), 60(4), 180(4), 300(8) for a total of $B=45$ dynamic scans. With FLT there were $B=47$ frames: 10(10), 20(4), 40(3), 60(3), 120(5), 180(4), 300(18). An initial $K=10$ region segmentation was used for each data set. The selected mixture models have 5, 3 and 4 terms for ACE, CO2 and FLT. In each case, temporal and spatial diagnostics for the mixture model fit were satisfactory. Results of metabolic parameters are shown in Figure~\ref{fig:fig3}(a). The tumor region is apparent on both magnetic resonance (MR) scans. ACE flux is elevated in parts of this and these areas are also seen as high FLT flux. The CO2 flux is elevated in the brain ventricle/choroid plexus. The choroid plexus makes cerebral spinal fluid (CSF) in part by carbonic anhydrase to facilitate the exchange between CO2 and water and bicarbonate, and this starts in the cerebral ventricles. Thus, it makes physiologic sense that choroid plexus has high CO2 flux. There is an increased flow of FLT in the skull bone marrow and that is also elevated (perhaps as a result of blood-brain-barrier disruption) in the tumor. Note that the FLT flux is not substantially elevated in the marrow of the skull here. In normal circumstances this would be unexpected, however, because the marrow is lower on the side of the tumor, compared to the other side, this is likely a radiation effect. The increased FLT flux in the tumor region abnormality suggests enhanced cellular proliferation---possible tumor recurrence. The Spence et al. (\citeyear{spence09}) report found that FLT flux has potential as an imaging biomarker for distinguishing proliferation in patients with recurrent gliomas from radionecrosis, which has a similar MR pattern. There are a number of National Cancer Institute (NCI) sponsored trials underway that are investigating the potential of PET-FLT for guiding the treatment of cancer patients. The quantitation of flux and flow provided here enhances the understanding of the information provided by these studies. \begin{figure} \centering \begin{tabular}{@{}c@{}} \footnotesize{(a) Brain tumor}\\ \includegraphics{732f03a.eps} \\[3pt] \footnotesize{(b) Breast cancer}\\ \includegraphics{732f03b.eps} \end{tabular} \caption{\textup{(a)} Brain tumor 4 and 4.5 years after treatment. Standard clinical T1-weighted Magnetic Resonance images---tumor site indicated with pink arrow. Dynamic PET imaging with $^{11}C$ Acetate and $^{11}C$ $CO_2$ at 4-year follow-up were analyzed by residue analysis to obtain flux estimates. Dynamic $^{18}F$ fluoro-thymidine PET imaging was analyzed by residue analysis to obtain flux, $K_d$ and $K_b$ estimates. Transverse images through a representative plane of the tumor are shown. \textup{(b)} Patient with locally advanced Breast Cancer imaged with PET-H2O and PET-FDG. Transverse slices of tracer uptake and residue calculated metabolic images of blood and distribution volume and flux. The grey scale is the measured tissue attenuation. The tumor site indicated with pink arrows.}\label{fig:fig3} \end{figure} \subsubsection*{II. Breast cancer} This data here is from a series of locally advanced breast cancer patients studied with PET FDG and H2O prior to treatment with neoadjuvant chemotherapy. The study, reported by Dunnwald et al. (\citeyear{dunwald}), showed that the mismatch between H2O evaluated flow and FDG measured flux, provided a prognostic indicator of response and disease-free survival. A bolus intravenous injection of H2O was followed by dynamic PET image acquisition over a 7.75 minute period. A total of $B=53$ frames were obtained. A 1-minute pre-injection scan was followed by consecutive frames whose durations in seconds (with number of repeats) were as follows: 2(15), 5(14), 10(10), 15(8), 20(5). A short time later the FDG study was carried out. This entailed 2-minute intravenous infusion of FDG. A 1-minute pre-injection scan was followed by 24 further frames; these frame durations in seconds (including repeat number) were as follows: 20(4), 40(4), 60(4), 180(4), 300(4). There was no blood sampling, but analysis of the right ventricle of the heart region was used to extract an arterial input function in the analysis. Additional time courses for venous blood (vena-cava), the pulmonary veins and the right ventricle of the heart were also recovered from the PET image data; see \citet{OSull11} for details of the technique used. These signals were included as additional terms in the segmentation and mixture model analysis. In view of the increased range of tissue structures in the field of view, a greater number of segments ($K=15$) were used. Selected mixture models had 5 residue components for FDG and 4 for H2O. In each case temporal and spatial diagnostics for the mixture model fit were satisfactory. Parametric images are shown in Figure~\ref{fig:fig3}(b). The raw uptake patterns for the tracers do not differentiate between areas with high vascular uptake (heart cavity, liver) and areas with increased longer term retention (tumor and heart wall). The vascular and retention patterns are well described by images of blood volume ($V_B$), distributional flow ($K_D$) and flux ($K_i$). The increased apparent retention time of water in the tumor region (seen as a ``flux'' in the water residue analysis) may reflect that less effective vasculature often is associated with cancers, particular larger cancers; see Dunnwald et al. (\citeyear{dunwald}) and Jain (\citeyear{Jain05}). This is an example of a patient whose tumor has low blood flow and high FDG uptake, which is nicely captured by the analysis. The greatest FDG flux is in the section of the tumor at the edge of an apparent necrotic section, which makes sense as a place where blood flow would be low and FDG uptake might be high. We expect the flow measures to be similar from water and FDG [Tseng et al. (\citeyear{Tseng04})], and the images support this. \section{Analysis of performance}\label{sec5} We consider cerebral PET studies with FDG and H2O and examine aspects of the proposed methodology using both real and simulated data. One issue is to determine how regional averages of voxel-level residue estimates compare to regional residue estimates produced by analysis of regionally averaged time-course data. The latter issue is of interest because it is the common way that regional summaries of PET tracer kinetics are obtained. We used numerical simulations to explore this matter. A second issue is whether the approximation capabilities of our residue basis are adequate for real data. Recall the underlying mixture model is constructed adaptively by segmentation of the entire image volume. It is not clear if the derived mixture basis set has adequate local approximation characteristics. We compare our mixture modeling approach with an analysis of regionally averaged time-course data using standard compartment models. \subsection{Adaptive mixtures versus compartmental model residues}\label{sec5.1} As previously indicated, the sample data sets used in Section~\ref{sec4.1} are taken from two series on normal subjects reported by Muzi et al. (\citeyear{Muzi09}) and Graham et al. (\citeyear{graham}). In those series PET time-course data for a number of brain structures were recovered. With detailed reliance on co-registered high-resolution MR scans for anatomic reference, region of interest (ROI) PET time-course data for a number of brain structures were created. For FDG there were 10 regions in each of 12 studies to give a total of 120 ROI data sets. The regions were as follows: cerebellum, temporal, frontal, parietal and occipital cortex, thalamus, putamen, caudate, whole brain and white matter. For H2O, a set of 11 subjects was considered with each subject scanned twice. In each study between 6 and 9 regions were considered, giving a total of 184 ROI data sets. The regions included: choroid, pituitary and salivary gland, ventricle, selected whole brain regions, white and gray matter. In Muzi et al. (\citeyear{Muzi09}) and Graham et al. (\citeyear{graham}), these ROI data were analyzed using the conventional compartmental models.\footnote{A description of the relevant 1- and 2-compartmental models used for H2O and FDG in a normal brain can be found, for example, in Huang and Phelps (\citeyear{huang86}).} Here we compare compartmental analysis of these H2O and FDG ROI data with analysis obtained using the adaptive mixture model recovered using the segmentation and recursive refinement algorithm of Section~\ref{sec3.1} and Section~\ref{sec3.2} of this paper. The mixture model was then applied to analyze the time-course data for each of the ROIs that had been recovered in the study, that is, application of the model in equation (\ref{eq11}) to the ROI data. At the same time the ROI data were also analyzed using the relevant compartmental models. For reference, the ROI data were also analyzed using a fully nonparametric procedure with a piecewise constant residue [Hawe et al. (\citeyear{HaweOS})]. In terms of fit, this gives an effective lower bound on what can be achieved for a given data set. Leave-out-one cross-validation residuals [\citet{weisberg}] were constructed for each analysis method, and the weighted sums of squares of these residuals were used for comparisons between different methods. Absolute cross-validated residuals from the mixture and compartmental approaches were also subjected to a paired Wilcoxon test [\citet{wilcox}]. The $p$-value for this test provides evidence against the hypothesis of similarity between the average magnitude of cross-validated residuals from the compartmental and mixture analysis. An overall comparison between the compartmental and mixture models is also carried out. A sign test is applied to the set of differences between the cross-validated residual sums of squares for the mixture and compartmental model. The mixture model is favored if the percentage of time it outperforms the compartmental model is significantly greater than 50\%. We also compare compartmental and mixture model-based estimates of key kinetic parameters: flux ($K_i$) and distribution volume ($V_D$) for FDG and blood volume ($V_B$) and the distributional flow ($K_D$) for H2O. Note in the compartmental case this involves evaluating the fitted compartmental residue and then using the definitions in Section~\ref{sec2.1} to evaluate the resultant kinetic parameters. \begin{figure} \centering \begin{tabular}{@{}c@{}} \footnotesize{(a) FDG data}\\ \includegraphics{732f04a.eps} \end{tabular} \caption{Comparison between selected kinetic parameters recovered from analysis of ROI data using compartmental (FDG and H2O) and mixture models $(1,2,3)$. 4.~Sample ROI data (dots) together with fitted compartment, mixture and nonparametric analysis (red, blue and grey lines); fitted residues are shown with broken lines. 5.~Color-coded leave-out-one cross-validated residuals. 6.~Histogram and cumulative distribution (dots) of Wilcoxon $p$-values for paired comparison of the absolute CV-residuals of the compartmental and mixture models, line of identity included.}\label{fig:fig4} \end{figure} \setcounter{figure}{3} \begin{figure} \centering \begin{tabular}{@{}c@{}} \footnotesize{(b) H2O data}\\ \includegraphics{732f04b.eps} \end{tabular} \caption{(Continued). \end{figure} Results are presented in Figure~\ref{fig:fig4}. With FDG, the cross-validated residual sum of squares for the adaptive mixture models is lower than that for the 2-compartment model in 97 of the 120 ROIs examined (80\% of cases). This is highly significant. In addition, the distribution of Wilcoxon $p$-values clearly favor the mixture model; see Figure~\ref{fig:fig4}(a)6. Results for H2O are not as strong. Here the adaptive mixture models is lower than that for the 1-compartmental model in 137 of the 184 ROIs examined (74\% of cases). This is again highly significant. However, the distribution of Wilcoxon $p$-values [Figure~\ref{fig:fig4}(b)6], while still favoring the mixture model, is more uniform than was found for FDG. This reduced improvement in the mixture model is very likely a reflection of the higher noise which is evident in many of the H2O ROIs. Some representative sample time-course data and the models fit are also shown in Figures \ref{fig:fig4}(a)4 and \ref{fig:fig4}(b)4. In the high noise H2O example, the improvement in fit achieved by the mixture model is not so clear, however, there is little ambiguity in the FDG case. Figure~\ref{fig:fig4} also reports comparisons between kinetic parameters recovered using the mixture and compartmental model analyses. Note the kinetics from the compartmental and mixture analysis are quite similar, particularly with flux and volume of distribution in FDG Figure~\ref{fig:fig4}(a)1--2. Discrepancies in flow values are apparent in Figure~\ref{fig:fig4}(a)3, with higher flow values being produced by the mixture analysis model. Somewhat noisier patterns are found with H2O. Flow and blood volume values obtained by the mixture analysis are on average higher than those of the compartmental model analysis; see Figure~\ref{fig:fig4}(b)1--3. The 1-compartmental model produces somewhat higher distribution volume values; see Figure~\ref{fig:fig4}(b)2. Given the model fit comparisons, parameters provided by mixture analysis are likely to be more reliable for FDG and H2O. \subsection{Simulation study}\label{sec5.2} A prime motivation for mapping of residues at the voxel level is the simplicity with which the residue for a region can then be obtained, that is, by simply averaging the voxel-level residue estimates. If voxel-level data were measured without error, this approach would be guaranteed to yield the correct regional residue. However, one might have concern that with realistic noise, estimation at the voxel-level might be so poorly behaved that the regional averaging of voxel-level estimates would not produce good estimates of the target regional values. Here the residue recovered from analysis of the average time course for the region might be more accurate. We explore this issue in the context of the brain studies analyzed in Section~\ref{sec4.1}. Recall those analyses involved consideration of $K=10$ segments, each with a characteristic time course: $y_k$ for $k=1,2,\ldots,K$. Each time course was subsequently represented as a linear combination of a reduced set of ($J$) basis residues as described in equations (\ref{eq4}) and~(\ref{eq5})---and modeled, similar to equation (\ref{eq11}), as \[ y_{kb} = \mu_{kb} + w_{kb}^{-1/2} \varepsilon_{kb}, \] where $\mu_{kb} = \sum_{j=1}^J \alpha_{jk} \bar\mu_{jb} (\Delta_k)$, $w_{kb} = 1/{\mu_{kb}}$ and the errors $\varepsilon_{kb}$ are found to be approximately Guassian with mean zero and constant variance, say, $\phi_k^2$. Given that these data are from normal subjects, the configuration of the coefficients $\alpha_{\cdot k} = (\alpha_{1k},\alpha _{2k},\ldots,\alpha_{Jk}) $ for the $K$ segments is realistic for normal cerebral PET studies with the FDG and H2O tracers. We bootstrap from these results to simulate voxel-level data for a set of $K$ synthetic regions of interest (ROIs). The simulated data for the $i$th voxel in the $k$th region is generated by \begin{equation}\label{eq16} y_{kib} =\tilde{\mu}_{kib} + \tilde{w}_{kib}^{-1/2} \tilde\varepsilon_{kib} \end{equation} for $i=1,2,\ldots,N_k$ and $b=1,2,\ldots,B$. Here $\tilde{\mu}_{kib} = \sum_{j=1}^J \tilde\alpha_{ijk} \bar\mu _{jb}(\tilde\Delta_{ik})$ and $\tilde{w}_{kib}=1/{\tilde\mu_{kib}}$, with $\tilde\varepsilon_{kib}$, $\tilde\Delta_{ik}$ and $\tilde\alpha_{ijk} $ independent random variables. The measurement errors ($\tilde\varepsilon_{kib}$'s) are mean zero Gaussian with variance $N_k \phi_k^2$ for $i=1,2,\ldots,N_k$. Amplification of the variance by $N_k$ ensures the mean error over voxels has variance $\phi_k^2$; the delays ($\tilde\Delta_{ik}$'s) are log-normal with mean $\Delta_k$ and standard deviation proportional to the size of the region. The coefficient of variation is 20\% in the largest region and, finally, the residue basis scales ($\tilde\alpha_{ijk}$'s) are generated from a Gamma distribution with mean $\alpha_{jk}$ and coefficient of variation set in proportion to the region size. The largest region has a coefficient of variation of 20\%. This structure is designed to capture the intra-region voxel-to-voxel variation in terms of the time-of-arrival of the tracer, the voxel-to-voxel variation/heterogeneity in residues (including flow) and, of course, the quasi-Poisson measurement errors associated with PET instrumentation [Carson et al. (\citeyear{carson}) and \citet{Hues84}]. The overall scale of $\alpha$-coefficients is varied to achieve a range of six activity levels, equispaced on a logarithmic scale, the highest of which is 20 times larger than the lowest activity. The 10 regions had sizes ($N_k$) as follows: 20, 22, 39, 73, 85, 92, 93, 287, 345 and 1519 for FDG; 20, 31, 42, 128, 173, 195, 213, 394, 399 and 925 for H2O. \begin{figure} \centering \begin{tabular}{@{}c@{}} \footnotesize{(a) FDG simulation}\\ \includegraphics{732f05a.eps} \end{tabular} \caption{Sample time activity curve data (dots), together with the true (solid red) and fitted model (broken red) and the corresponding residues (blue)---1 (Voxel data), 2 and 3 (ROI data). Mean square error values (averaged over 50 replicates) for the residue 4 and two other parameters, 5 and 6 (flux and distribution volume for FDG and flow and distribution volume for H2O) plotted against dose ($\kappa$) for different regions. Regions are represented by separate symbols.} \label{fig:fig5} \end{figure} \setcounter{figure}{4} \begin{figure} \centering \begin{tabular}{@{}c@{}} \footnotesize{(b) H2O simulation}\\ \includegraphics{732f05b.eps} \end{tabular} \caption{(Continued).} \end{figure} Sample voxel-level and mean ROI time-course data are shown in Figures \ref{fig:fig5}(a)1--3 (FDG) and 5(b)1--3 (H2O). The intermediate activity/noise data are qualitatively similar to the data in Section~\ref{sec4.1}. Sample residue estimates at the voxel and ROI levels are also shown in these same figures. Regional residues were computed in 2-ways, one based on analysis of the mean time-course data for the region and the other involving averaging of voxel-level residues. Voxel-level analysis could be done with and without imposition of positivity constraints on $\alpha$-coefficients. In high-noise environments, constrained estimators will be biased. The averaging of such estimators reinforces the voxel-level bias leading to a bias in the regional summary. In light of this, for quantitative regional analysis, the averaging of unconstrained voxel-level residues is recommended [\citet{huang13}]. Simulations involving data generation for 6 noise levels and 10 regions were repeated 50 times. Estimated residues were compared to true values directly using the integrated squared deviation and also in terms of squared deviation of key parameters, flux and distribution volume for FDG and flow and volume of distribution for H2O. The squared deviations were averaged over replicates to obtain estimates of mean square errors (MSE). The MSE for the averaged voxel-level estimators are plotted against dose in Figure~\ref{fig:fig5}(a)4--6 (FDG) and Figure~\ref{fig:fig5}(b)4--6 (H2O). A very similar pattern is found for the MSEs estimators produced by the analysis of the regionally averaged time-course data. A log-linear pattern is evident in Figure~\ref{fig:fig5}. MSEs vary by region, with larger regions having smaller MSEs. An analysis of the MSE data leads to \begin{equation}\label{eq17} \log(\operatorname{MSE}_{lk}) =\sum_k \beta_k \cdot I_{lk} - \gamma_a \cdot\log( \kappa _{lk}) + \gamma_M \cdot M_{lk}+ e_{lk}, \end{equation} where $\kappa_{lk}$ is dose level, $I_{lk}$ is the region indicator for region $k$ and $M_{lk}$ is an indicator of whether the estimator was evaluated by analysis of averaged time-course data or not. The modeling error is $e_{lk}$. \begin{table} \caption{MSE Characteristics for estimation of regional residues---parameters defined in the model in equation (\protect\ref{eq17}). $R^2$ values (adjusted) are from the model fit}\label{tab1} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccc@{}} \hline \textbf{Variable} & $\bolds{\gamma_a}$ & $\bolds{\gamma_M}$ & $\bolds{R^2}$ \\ \hline \multicolumn{4}{c}{FDG}\\ Residue & 0.96 ($\pm0.02$) &$-0.03$ ($\pm0.02$) & 0.99 \\ Flux & 0.88 ($\pm0.02$) & \phantom{$-$}0.05 ($\pm0.02$) & 0.99 \\ $V_D$ & 0.98 ($\pm0.02$) & $-0.01$ ($\pm0.02$) & 0.98 \\ [3pt] \multicolumn{4}{c}{H2O} \\ Residue & 0.76 ($\pm0.04$) &\phantom{$-$}0.01 ($\pm0.04$) & 0.84 \\ Flow& 0.66 ($\pm0.07$) & \phantom{$-$}0.01 ($\pm0.08$) & 0.98 \\ $V_D$ & 0.95 ($\pm0.02$) & \phantom{$-$}0.01 ($\pm0.02$) & 0.99 \\ \hline \end{tabular*} \end{table} Table~\ref{tab1} reports estimated values for the $\gamma_a$-coefficients. For FDG the $\hat\gamma_a \approx1.0$, consistent with what one might expect in theory (see below). A~slower rate\vadjust{\goodbreak} ($\hat\gamma_a \approx0.8$) is indicated for H2O, a reflection of the larger number of time frames (42 for H2O versus 31 for FDG) and the greater noise arising from the rapid decay of the $^{15}$O isotope. Larger regions generally have lower MSEs, but the heterogeneity of the region plays a role. As regards comparison between regional kinetic quantification by analysis of the averaged time course for the ROI or the averaging of voxel-level residues, there is little difference. With H2O there is some small (1\%) degradation in MSE obtained by analysis of the average time-course data for the region; a similar result holds for Flux in FDG, although this is not the case for integrated squared error of the residue or the volume of distribution. This result supports mapping voxel-level residues because it allows subsequent analysis of regions of interest to be simply achieved by direct application of ROIs to voxel-level residue information. \subsubsection*{Theoretical interpretation of results} At high doses MSE can be expected to be dominated by variance. Since equation (\ref{eq16}) is a linear model, the covariance of the estimated $\alpha$-coefficients at the $i$th voxel, which are obtained by a weighted least squares procedure, will be approximated by $ \Sigma_{\alpha} \approx\phi^2 [X'WX]^{-1}$, where \[ X'WX_{jj'} = \sum_b w_b \bar\mu_{jb} (\hat\Delta) \bar\mu_{j'b} (\hat \Delta) \] and $w_b = \sum_j \hat\alpha_j \bar\mu_{jb} ( \hat\Delta)$. Here, to simplify the notation, we have dropped the subscripts $i$ and $k$. This variance approximation will become more reliable at high doses when the constraints on the $\alpha$-coefficients are, typically, not active. Recall from equation (\ref{eq7}), $\bar\mu_{jb}$ involves the convolution of the normalized residue $\bar R_j$ and the arterial input function, $C_p$. So if $C_p$ is expressed as $C_p = \kappa\bar C_p$ where $ \bar C_p$ has amplitude of unity, $ \Sigma_{\alpha} $ can be expressed as \begin{equation}\label{eq18} \Sigma_{\alpha} = \kappa^{-1} \phi^2 \bigl[\bar X' \bar W \bar X \bigr]^{-1}, \end{equation} with $ \bar X' \bar W \bar X$ the same as $X' W X$ but with $\bar\mu _{jb} $ now involving convolution of the normalized residue and normalized arterial input $\bar C_p$. Thus, at high doses the variance and, consequently, the MSE, will be inversely proportional to dose ($\kappa$). This is consistent with $\hat\gamma_a \approx1$, as was found for FDG in the simulation. The slower convergence ($\hat\gamma_a \approx0.8$) for H2O may be a reflection of a greater dependence on constraints, due to the higher noise. When constraints are active, the standard weighted least squares covariance formula will not be reliable. \section{Discussion}\label{sec6} We have presented an approach to the estimation of voxel-level tracer residues from PET time-course data. The technique uses a data-adaptive mixture model that allows for voxel-level variation in the time of arrival of the tracer in the arterial supply. The mixture representation of local residues is plausible and has been used previously with basis residues that are a compartmental model or have simple exponential forms [\citet{cunn-jones} and \citet{osull93}]. The present work shows that it is possible to also use nonparametric forms for the basis residues. This allows the possibility to better investigate potential deviations from compartmental-like descriptions of tissue residues. Computationally, the linearity of mixture models is attractive, as it facilitates the implementation based on efficient use of standard quadratic programming tools. The work has a reliance on multivariate statistical methods and uses backward elimination guided by an unbiased risk type model selection statistic.\vadjust{\goodbreak} Residue functions are life tables for the transit time of radiotracer atoms. Just as infant and elderly mortality patterns might be given separate attention in a human life table, decomposition of the residue can provide insight into the tracer kinetics. Our approach emphasizes decomposition of residue to focus on flow and volume characteristics of vascular and in distribution transport as well as the (apparent) rate of extraction of the tracer by tissue, that is, flux. Thus, we have a 5-number summary for the residue. The life-table perspective on the tissue residue emphasized in this paper may encourage broader interest in adapting methods from mainstream survival analysis for application to the growing needs for quantitation in PET studies and for related contrast tracking techniques used in computerized tomography and magnetic resonance [Schmid et al. (\citeyear{Schmidt})]. PET imaging has grown in importance particularly in the context of cancer, where over 90\% of clinical imaging with PET is carried out. Having more sophisticated kinetic analysis tools, such as residue analysis, can enhance the type of information recovered from these studies. This may potentially lead to better procedures for selecting and monitoring cancer treatments in order to optimize the patient outcomes. A number of current clinical imaging trails with PET in cancer already have reliance on detailed kinetic analysis for extraction of diagnostic information. Given the nature of the problems involved, there is an opportunity for statistics to play a greater role in these developments. \section*{Acknowledgments} We are grateful to the referees, Associate Editor and the Editor for a number of comments which led to significant improvements to the manuscript.
{'timestamp': '2014-08-01T02:09:32', 'yymm': '1407', 'arxiv_id': '1407.8402', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8402'}
arxiv
\section{Introduction} Given the advent of powerful mobile devices and the fast pace of today's world, users crave connectivity while on the go. This leads to a networking scenario with heterogeneous, mobile, and power-constraint devices, as well as wireless networks with intermittent connectivity even in urban scenarios, due to the presence of wireless shadowing, and the existence of closed access points and expensive Internet services. Moreover, users' requirements for ubiquitous data access is not aligned with the current Internet architecture, since users are not interested in knowing the location of data. It has been shown that focusing on the content, rather then on the host, we can improve the performance of challenged networks \cite{socialcast,contentplace} by allowing an efficient direct communication between producers and consumers of content. In addition, exploiting nodes' social interactions and structure (i.e., communities \cite{bubble2011}, levels of social interaction \cite{dlife,cipro}) has been shown efficient to increase the performance of opportunistic routing. Thus, combining content knowledge (i.e., content type, interested parties) with social proximity shall bring benefits (faster, better content reachability) in challenged networks. \emph{SCORP} exploits social proximity and content knowledge to augment the efficiency of data delivery in urban, dense scenarios. We show the advantages that \emph{SCORP} brings to the operation of opportunistic networks (in terms of delivery, cost and latency) through simulations based on synthetic mobility and trace-based scenarios. This paper is structured as follows. Section 2 briefly goes over the related work. In Section 3, we present \emph{SCORP}. Section 4 presents our evaluation study. In Section 5, conclusions and future work are presented. It is worth noting that the words \emph{information}, \emph{data}, \emph{message}, and \emph{content} are used interchangeably throughout this paper. \section{Related Work\label{sec:Related-Work}} Routing in opportunistic networks must be capable of dealing with occasional contacts, intermittent connectivity, highly mobile nodes, power and storage-constrained devices, and the possible nonexistence of end-to-end paths. In the last couple of years, different social-aware opportunistic routing solutions have emerged \cite{bookchapter} trying to exploit the less volatile graph created by social proximity metrics in relation to metrics reflecting the mobility behavior of nodes. Now with content being introduced to social-aware opportunistic routing, proposals can be classified as content-oblivious or content-oriented. Among the social-aware content-oblivious proposals, \emph{Bubble} \emph{Rap} \cite{bubble2011}, \emph{dLife} \cite{dlife}, and \emph{CiPRO} \cite{cipro} are close in essence to \emph{SCORP}: all exploit social proximity to devise forwarding schemes. \textit{Bubble Rap} combines node centrality with the idea of community structure to perform forwarding. Communities are formed considering the number of contacts between nodes and their duration, and centrality is seen from a local (i.e., inside communities) and global (i.e., whole network) perspective. Messages are replicated based on the global centrality metric until it reaches the community of the destination (i.e., a node belonging to the same community). At this point, forwarding is done by using the local centrality metric, aiming to reach the destination inside the community. With \emph{dLife} , the dynamism of users' behavior found in their daily life routines is considered to aid routing. The goal is to keep track of the different levels of social interactions (in terms of contact duration) that nodes have throughout their daily activities in order to infer how well socially connected users are in different periods of the day. \emph{CiPRO} considers the time and place nodes meet throughout their routines and\emph{ }holds knowledge of nodes (e.g., carrier's name, address, nationality, device's battery level, memory) expressed by means of profiles that are used to compute encounter probability among nodes in specific time periods. While \emph{CiPRO} uses users' daily social interactions to classify the type of contact among them, aiming to predict future encounters, \emph{SCORP} uses these interactions to measure the proximity between nodes sharing data interests. This is similar to what happens with \emph{dLife} and \emph{Bubble} \emph{Rap}: the former weighs the levels of social interaction between nodes and computes their importance; and the latter uses social interactions to identify communities and popular (i.e., high centrality) nodes. Regarding the social-aware content-oriented proposals, \emph{SocialCast} \cite{socialcast} and \emph{ContentPlace} \cite{contentplace} also take into account the content and users' interest on it. \textit{SocialCast} considers the interest shared among nodes and devises a utility function that captures the node's future co-location (with others sharing the same interest) and the change in its connectivity degree. Thus, the utility functions used by \emph{SocialCast} measure how good message carrier a node can be regarding a given interest. Moreover, \textit{SocialCast} functions are based on the publish-subscribe paradigm, where users broadcast their interests, and content is disseminated to interested parties and/or to high utility new carriers. Since the performance of \emph{SocialCast} is related to the co-location assumption (i.e., nodes with same interests spend quite some time together), the proposal may be compromised in scenarios where it does not always apply as such assumption may not always be true \cite{people}. Besides taking into account the interest that users have in the content,\emph{ ContentPlace} \cite{contentplace} also considers information about the users' social relationships to improve content availability. For that, a utility function is computed for each data object considering the access probability to the object and the involved cost in accessing it, as well as the user's social strength towards the different communities that he/she belongs to and/or has interacted with. The idea is to have users fetching data objects that maximize the utility function with respect to the local cache limitations, choosing the objects that are of interest to him/herself and can be further disseminated in the communities with which they have strong social ties. These social-aware content-oriented approaches differ from \emph{SCORP} as \emph{SocialCast} is based on the publish/subscribe paradigm (i.e., our solution does not require propagation of interests further than encountered nodes), and \emph{ContentPlace} is much more data-aware: besides the content type and interested parties, it also considers how much content has already been spread and its availability. When making an overall analysis of all proposals, it is clear that \emph{SCORP} may contribute to reduce network overhead and to make routing rather simple when compared to \emph{SocialCast}, \emph{ContentPlace} and \emph{CiPRO}, since it is independent from attributes such as: i) connectivity degree and node co-location \cite{socialcast}; ii) content availability, and users' communities \cite{contentplace}; iii) prediction of future encounter \cite{cipro}. Regarding content-oblivious solutions such as \emph{dLife} and \emph{Bubble} \emph{Rap}, conceptually it is not clear the advantages and limitations that content-oriented proposals, such as \emph{SCORP,} may have in terms of the data dissemination efficiency. Therefore, \emph{dLife} and \emph{Bubble} \emph{Rap} are selected as benchmarks for our comparison studies. As we aim at a low cost associated to message delivery, \emph{Spray and Wait }\cite{spraywait} is considered as lower bound for delivery cost for being concerned with resource usage (it controls replications to spare resources). Hence, in a general sense, this paper aims to prove that taking content into account leads to an improvement on the performance of social-aware opportunistic routing, based on the performance of \emph{SCORP}. In a future work, we aim to experimentally show the conceptually advantages that \emph{SCORP} has in relation to \emph{SocialCast}, \emph{ContentPlace} and \emph{CiPRO, }as soon as the code or a detailed specification (e.g., Internet Draft) of such approaches is made available, to allow us to perform a precise implementation, since details provided in the papers are not enough to achieve such goal. \section{The SCORP Proposal\label{sec:SCORP}} This section presents our social-aware content-based opportunistic routing proposal that takes into account the social proximity between nodes and the content knowledge that nodes have while taking forwarding decisions. \emph{SCORP} is based on a utility function that reflects the \emph{probability of encountering nodes with a certain interest among the ones that have similar daily social habits}. The reason to use social proximity with content knowledge is two-fold: first, nodes with similar daily habits have higher probability of having similar (content) interest \cite{socialcast}; second, social proximity metrics allow a faster dissemination of data, taking advantage of the more frequent and longer contacts between closer nodes. Fig. \ref{fig:0} shows the different social interactions that a node $A$ has with other nodes throughout its daily routine. For the sake of simplicity, in this example each encountered node has only one interest (nodes $B$ and $F$ have interest 1, and nodes $C$, $D$ and $E$ have interests $2$, $3$, and $4$, respectively). \emph{SCORP} measures the duration of contacts, indexing such duration to interests that such nodes have (cf. $CD(a,b1)$ in Fig. \ref{fig:0}). This way, nodes have measures of different levels (intermittency of lines in graphs) of social interactions with nodes having similar interests ($w(a,1)$) during specific time periods of their daily activities. These different levels of social interactions are considered while deciding whether a node is classified as a good forwarder for a message tagged with a certain interest. \begin{figure*} \begin{centering} \vspace{-0.4cm} \includegraphics[scale=0.33]{scorp1}\vspace{-0.3cm} \par\end{centering} \caption{\label{fig:0}Contacts that node $A$ has with nodes having interests $x$ ($CD(a,x)$) in different daily samples $\Delta T_{i}$.} \vspace{-0.4cm} \end{figure*} If a node $A$ has $n$ contacts with another node having an interest $x$ in a daily sample $\Delta T_{i}$, with each contact $k$ having a certain duration (\emph{Contact} \emph{Duration} - $CD\,(a,x)_{k}$), at the end of $\Delta T_{i}$ the \emph{Total Connected Time to Interest $x$} ($TCTI\,(a,x)_{i}$) is given by Eq. \ref{eq:1}. \begin{equation} TCTI\,(a,x)_{i}=\sum_{k=1}^{n}CD\,(a,x)_{k}\label{eq:1} \end{equation} The \emph{Total Connected Time to Interest} $x$ in the same daily sample over consecutive days is used to estimate the average duration of contacts towards the data interest $x$ for that specific daily sample. Thus, from the perspective of node $A$, the \emph{Average Total Connected Time to Interest} $x$ (\emph{ATCTI}) during a daily sample $\Delta T_{i}$ in a day $j$ is given by a cumulative moving average of $TCTI$ in that daily sample ($TCTI(a,x)_{ji}$), and the $ATCTI$ during the same daily sample $\Delta T_{i}$ in the previous day ($ATCTI(a,x)_{(j-1)i}$) as illustrated in Eq. \ref{eq:2}. {\small \begin{equation} ATCTI\,(a,x)_{ji}=\frac{{TCTI\,(a,x)_{ji}+(j-1)ATCTI\,(a,x)_{(j-1)i}}}{j}\label{eq:2} \end{equation} }{\small \par} Then, node $A$ computes the \emph{Time-Evolving Contact to Interest $x$ (TECI)} (cf. Eq. \ref{eq:3}) to determine its social strength ($w(a,x)_{i}$) towards nodes tagged with interest $x$ in a daily sample $\Delta T_{i}$ based on the $ATCTI$ computed in that daily sample and consecutive $t-1$ samples, where $t$ is the total number of samples. In Eq. \ref{eq:3} $\frac{t}{t\text{+k-i}}$ represents the time transitive property as in \emph{dLife} \cite{dlife}. \begin{equation} TECI=w\,(a,x)_{i}=\sum_{k=i}^{i+t-1}\frac{t}{t+k-i}ATCTI\,(a,x)_{k}\label{eq:3} \end{equation} \subsection{Algorithm} The operation of \emph{SCORP }is very simple as illustrated in Alg. \ref{alg:AlgorithmSCORP}: when the $CurrentNode$ meets a \emph{$Node_{i}$} in a daily sample $\Delta T_{k}$, it gets a list with all content interests \emph{$Node_{i}$} was faced with in that daily sample, and the social weights towards the nodes having such interests (\emph{$Node_{i}$}.weightsToAllinterests computed based on Eq. \ref{eq:3}). Additionally, \emph{$Node_{i}$} sends a list of the messages it already carries (\emph{$Node_{i}$}.carriedMessages). Then, every $Message_{j}$ in the buffer of the $CurrentNode$ is replicated to \emph{$Node_{i}$ }if: \begin{itemize} \item \emph{$Node_{i}$} has interest (\emph{$Node_{i}$.}getInterests) in the content of the message\linebreak{} ($Message_{j}$.getContentType ); or\\ \item \emph{The social weight of $Node_{i}$} towards a node having that interest\linebreak{} (i.e., $Message_{j}$.getContentType) is greater than the weight that the\linebreak{} $CurrentNode$ has towards any node with the same interest. \end{itemize} With this, \emph{SCORP} is expected to create replicas only to nodes that indeed have interest in the content carried by the message to be forwarded, or that have a strong relationship with nodes that have that specific interest. Consequently, it is expected the creation of less replicas improving resource usage and decreasing delivery latency. \begin{algorithm} \caption{\label{alg:AlgorithmSCORP}Forwarding with \emph{SCORP}} \textbf{\footnotesize begin}{\footnotesize \par} {\footnotesize \hspace{0.1 cm}}\textbf{\footnotesize foreach}\emph{\footnotesize{} $Node_{i}$ }{\footnotesize encountered by $CurrentNode$ }\textbf{\footnotesize do}{\footnotesize \par} {\footnotesize \hspace{0.3 cm}receive(}\emph{\footnotesize $Node_{i}$}{\footnotesize .weightsToAllinterests and }\emph{\footnotesize $Node_{i}$}{\footnotesize .carriedMessages)}\textbf{\footnotesize \vspace{-0.01 cm}}{\footnotesize \par} {\footnotesize \hspace{0.3 cm}}\textbf{\footnotesize foreach}{\footnotesize{} $Message_{j}$}\textbf{\footnotesize{} }{\footnotesize $\in$}\textbf{\footnotesize{} }{\footnotesize buffer.($CurrentNode$) \& $\notin$ buffer(}\emph{\footnotesize $Node_{i}$}{\footnotesize ) }\textbf{\footnotesize do\vspace{-0.03 cm}}{\footnotesize \par} {\footnotesize \hspace{0.6 cm}}\textbf{\footnotesize if}{\footnotesize{} ($Message_{j}$.getContentType $\in$}\emph{\footnotesize $Node_{i}$.}{\footnotesize getInterests)}\textbf{\footnotesize \vspace{-0.03 cm}}{\footnotesize \par} {\footnotesize \hspace{0.9 cm}}\textbf{\footnotesize then}{\footnotesize{} $CurrentNode$.replicateTo(}\emph{\footnotesize $Node_{i}$}{\footnotesize , $Message_{j}$)}\textbf{\footnotesize \vspace{-0.03 cm}}{\footnotesize \par} {\footnotesize \hspace{0.6 cm}}\textbf{\footnotesize else if}{\footnotesize{} (}\emph{\footnotesize $Node_{i}$.}{\footnotesize getWeightTo($Message_{j}$.getContentType) $>$ }{\footnotesize \par} {\footnotesize \hspace{2.5 cm}$CurrentNode$}\emph{\footnotesize .}{\footnotesize getWeightTo($Message_{j}$.getContentType)}\textbf{\footnotesize \vspace{-0.03 cm}}{\footnotesize \par} {\footnotesize \hspace{0.9 cm}}\textbf{\footnotesize then}{\footnotesize{} $CurrentNode$.replicateTo(}\emph{\footnotesize $Node_{i}$}{\footnotesize , $Message_{j}$)}\textbf{\footnotesize \vspace{-0.03 cm}}{\footnotesize \par} \textbf{\footnotesize end} \end{algorithm} \section{Comparison Evaluation\label{sec:Comparison-Evaluation} } \emph{SCORP} is evaluated against \emph{dLife} \cite{dlife,draftDlife}, a social-aware proposal based on users' daily life routines; \emph{Bubble Rap} \cite{bubble2011}, a community-aware proposal; and \emph{Spray and Wait} \cite{spraywait}, a social-oblivious solution that serves as lower bound in what concerns delivery cost. This section starts by presenting the used methodology and experimental settings, followed by the results obtained based on synthetic mobility models and trace-based scenarios. This section ends with a scalability analysis. \subsection{Evaluation Methodology\label{sub:Evaluation-Methodology}} The simulations are carried in the Opportunistic Network Environment (ONE) simulator \cite{one}, considering the available implementations of \emph{Spray and Wait, Bubble Rap }and\emph{ dLife }for this simulator. The code for \emph{SCORP}% \footnote{http://siti.ulusofona.pt/aigaion/index.php/publications/show/406% } is also available for reviewers to download and test it. Results are presented with a 95\% confidence interval and are analyzed in terms of average delivery probability (i.e., ratio between the number of delivered messages and the total number of messages that should have been delivered), average cost (i.e., number of replicas per delivered message), and average latency (i.e., time elapsed between message creation and delivery). \subsection{Experimental Settings \label{sub:Settings}} In our experiments we use two different mobility models: a synthetic one and one based on human mobility traces. The synthetic mobility model comprises different mobility patterns. It simulates a 12-day interaction in the city of Helsinki between 150 nodes divided into 8 groups of people and 9 groups of vehicles. Each node has a 11-Mbps WiFi interface with 100-meter communication range. One vehicle group (10 nodes) follows the \emph{Shortest Path Map Based Movement} mobility model and represents police patrols that randomly choose destinations and use the shortest path to reach them: waiting times rang from 100 to 300 seconds. The remaining 8 vehicle groups (each with 2 nodes) represent buses following the \emph{Bus Movement} mobility model with waiting times ranging from 10 to 30 seconds. The speed of vehicles range from 7 to 10 m/s. The groups of people have different number of nodes: group A has 14 nodes; groups C, E, F, and G have 15 nodes each; groups B and D have 16 nodes each; and group H has 18 nodes. People have walking speeds between 0.8 to 1.4 m/s following the \emph{Working Day Movement} mobility model and may use the bus to move around. Each group was configured to have different offices, meeting spots, and home locations. Each person has an average of 8 daily working hours and walk around the office with pause times between 1 minute and 4 hours. These people also have a 50\% probability of having a leisure activity after work which may be done alone or in group and last up to 2 hours. The used CRAWDAD human traces \cite{cambridge-haggle-imote-content-2006-09-15} including 36 nodes, for two months while Cambridge University students moved throughout their daily routines. As general remark regarding this dataset, the measurements that we did to prepare the configuration of the experiments show that it has an average of 32 contacts per hour among nodes and such contacts happen sporadically. Additionally, the average number of formed community is approx. 6.7, where most of them comprise almost all nodes. The challenge faced to configure the experimentation set was related to the different nature of the approaches being compared: although \emph{Bubble Rap}, \emph{dLife} and \emph{SCORP} are social-aware routing solutions, they differ in the sense that \emph{SCORP} is receiver-driven: driven by interests that potential receivers have about specific content traversing the network. The other two approaches, as well as \emph{Spray and Wait,} are source-driven: driven by the need that a node has to send data to a specific receiver. Hence, to provide a fair comparison, and to show the potential of bringing the content knowledge into the opportunistic routing realm, we put the four solutions under the same load conditions. That is, the number of messages reaching the destinations in each simulation is the same. Thus, in the synthetic mobility scenario, a total of 6000 messages are generated and expected to be received throughout the simulation of \emph{Spray and Wait, Bubble Rap }and\emph{ dLife}. To achieve the same number of messages to be received in \emph{SCORP}, 170 messages with unique content are generated and each group of people has 10 different and randomly assigned interests that may or not overlap fully or partially with the interests of other groups. By combining the types of interests that are assigned to such groups and the number of generated messages with content matching these interests, we end up with 6000 messages to be delivered throughout \emph{SCORP}'s simulation. In the human mobility trace scenario, with\emph{ Spray and Wait, Bubble Rap }and\emph{ dLife} the source creates and sends 1, 5, 10, 20 and 35 different messages towards each destination. In the case of \emph{SCORP, }the source creates 35 messages with different interests once, and each receiver is configured with 1, 5, 10, 20, and 35 different interests. Since node 0 is the source of these messages to the remaining 35 nodes, this means that a total of 35, 175, 350, 700, and 1225 messages will reach the destinations in any of the simulations done with \emph{Spray and Wait, Bubble Rap},\emph{ dLife} and \emph{SCORP}. Nevertheless the number of messages generated by the source is different for the source- and receiver-driven approaches: for instance, in a configuration with a \emph{dLife} or \emph{Bubble} \emph{Rap} source generating 20 different messages for each of the 35 nodes, we have a total of 700 messages being generated and expected to reach the destinations; in the case of \emph{SCORP}, each of the 35 receivers is configured with 20 different interests, so we have 35 messages being generated and the same 700 messages are expected to reach the destinations. The configurations of messages and interests (denoted in the paper as msg/int in Sec. 4.4) are done to guarantee the same amount of potential messages being delivered. The msg/int notation denotes the number of different messages sent by \emph{Spray and Wait, Bubble Rap }and\emph{ dLife} sources or the number of different interests of each of the \emph{SCORP} receivers. Message TTL vary between 1, 2, 4 days, 1, and 3 weeks to represent the different applications that cope with opportunistic networks, and message size ranges from 1 to 100 kB. Although message TTL may not be of great interest with the content-oriented paradigm if we take into account that content can be always stored in the network, we consider a more realistic scenario in which content utility is timely limited. Hence, we chose to represent messages with different TTL values. Message size ranges from 1 to 100 kB. Nodes have only a 2 MB buffer space: despite the content-oriented concept consider no buffer limitations as nodes are capable of storing large amount of data, we assume that users may not be willing to share all the storage capacity of their devices. Both message and buffer size follow the universal evaluation framework proposed earlier \cite{latincom}. To guarantee fairness throughout our comparison study for \emph{Spray and Wait, Bubble Rap }and\emph{ dLife} in the human trace scenario, node 0 has no buffer size restriction to avoid message discardation due to buffer constraint given the number of messages it has to generate. Additionally, the rate of message generation varies with the load: when the load is of 1, 5, and 10 messages generated to each node, they are generated at a rate of 35 messages per day. As for the load with 20 and 35 messages, the rates are of 70, and 140 messages per day, respectively. This is done to allow \emph{Bubble Rap} and \emph{dLife }messages to be exchanged/delivered given the message TTL (i.e., 1 day). We use the synthetic and the human traces mobility scenarios to analyze different properties of the solutions being compared: the impact of having different message TTLs in the case of the synthetic mobility models; and the impact of having different network load in the case of the human traces mobility models. We also observed the impact of the different network load while varying the TTL, but these last set of results have been omitted due to space limitation. As for the proposals, \emph{Spray and Wait} runs in binary mode with number of copies $L$ set to 10. \emph{Bubble Rap} uses algorithms for community formation and node centrality computation (K-Clique and cumulative window) \cite{bubble2011}. \emph{dLife }and \emph{SCORP} consider 24 daily samples of one hour as mentioned in \emph{dLife}'s paper \cite{dlife}. \subsection{Evaluation of TTL Impact \label{sub:TTL-Impact-Evaluation}} We use the synthetic mobility model with varying message TTL, in order to: i) assess the impact that message TTL has on opportunistic routing solutions; and ii) choose the TTL value that allows solutions to have the best overall performance\emph{. }Before looking into the results, here is a general remark regarding the synthetic mobility model: it has an average of 962 contacts per hour happening in a homogeneous manner. Fig. \ref{fig:1} shows the average delivery probability. The performance of \emph{Bubble Rap} is affected by the fact that, while communities are still being built it relies mostly on global centrality to reach destinations. However, in this scenario, few nodes have high centrality (20\%) and most messages are generated in low centrality nodes. As a result replication is increased causing buffer exhaustion. This situation gets worse as TTL increases. \emph{dLife} performs up to 21\% better than \emph{Bubble Rap }as it is able to capture the dynamic behavior of nodes. Given the high number of contacts and their frequency, \emph{dLife} takes longer to have a stable view of the network in terms of social weights, resulting in useless replications leading to buffer exhaustion and preventing more messages to be delivered. \begin{figure} \vspace{-0.4cm} \subfigure[Average delivery probability]{\label{fig:1} \includegraphics[scale=0.7]{avg_del_prob_scenario2}}~~~\subfigure[Average cost]{\label{fig:2}\includegraphics[scale=0.7]{avg_cost_scenario2}} \subfigure[Average latency]{\label{fig:3}{\scriptsize \hspace{3.2 cm}}\includegraphics[scale=0.7]{avg_latency_scenario2}} \vspace{-0.3cm} \caption{Performance under synthetic mobility model} \vspace{-0.4cm} \end{figure} \emph{Spray and Wait} outperforms \emph{Bubble Rap }and \emph{dLife} (up to 58.6\% and 37.7\%, respectively): \emph{Spray and Wait} random replications are able to reach most of these nodes, since the scenario comprises buses and police patrols covering most of the simulated area and equipped with a 100-meter transmission range. Since nodes interact very often, \emph{SCORP} also takes advantage of shared interests among nodes to replicate content. Thus, messages are quickly disseminated, increasing its delivery rate up to 64.7\%, 44.5\%, and 10.7\% over \emph{Bubble Rap}, \emph{dLife} and \emph{Spray and Wait}, respectively. Still, \emph{SCORP} suffers a subtle decrease of delivery rate due to the number of forwardings, which increases with TTL. This causes few messages to be discarded due to buffer exhaustion, since messages are allowed to live longer in the network. When it comes to the average cost (cf. Fig. \ref{fig:2}), \emph{Bubble Rap} creates the highest number of replicas to perform a successful delivery, since it creates more replicas as messages are allowed to live longer in the network \cite{bubble2011}. \emph{dLife} creates replicas based on the: i) social strength between carrier/encountered nodes and destination; ii) node importance \cite{dlife}. Since social weight is more accurate (i.e., capture reality) than community formation given the subjective nature of the latter (communities formed based on pre-defined and static contact duration, when in reality people consider much more than this to create communities), this explains why \emph{dLife} generates between 64.5\% and 65.2\% less replicas than \emph{Bubble Rap} for the simulated TTLs. Given the contact frequency in this scenario, \emph{SCORP }nodes have a social weight towards all the different interests. This results in a easier way to identify the nodes that should receive a replica in order to successfully deliver content to interested nodes. As a consequence \emph{SCORP} creates up to 99.8\% and 99.4\% less replicas than \emph{Bubble Rap} and \emph{dLife}, respectively. \emph{Spray and Wait }serves as lower bound for delivery cost as it limits the created number of replicas ($L$ = 10), thus it is expected to have the best cost behavior (an average of 10.14 replicas across the TTL configurations). Still, for the TTL configurations with one and two days, \emph{SCORP} creates 8.6 and 8.3 less replicas when compared to \emph{Spray and Wait.} This result show the advantage in \emph{SCORP} for applications requiring low TTLs (messages with a timely limited utility). In terms of average latency (cf. Fig. \ref{fig:3}), \emph{Bubble Rap} takes up to 58.1\%, 52.6\% and 58.8\% longer than \emph{Spray and Wait},\emph{ dLife} and \emph{SCORP}, respectively, to deliver content due to the fact that communities are not updated (i.e., nodes not seen for a long period remain in communities), and few nodes have high centrality. Thus, messages are replicated to nodes that have weak social ties with the destination, which in turn increases the overall time to deliver them. \emph{dLife} and \emph{SCORP} experience less latency as forwardings only happen when the encountered node: i) has higher social weight towards the destination or is more important in the former case; and ii) has a higher social weight towards a specific content (i.e., interest) in the latter case, increasing their probability of delivering content in less time. \emph{SCORP }has a subtle advantage over \emph{Spray and Wait }and \emph{dLife }(up to 6.4\% and 17.6\% less latency, respectively) as it considers the interest of nodes. This advantage is not seen for TTL over 1 week: as messages are allowed to stay longer, \emph{SCORP} takes more time to choose the best next forwarders. We observe that the TTL has very little impact in social-oblivious \emph{Spray and Wait}, while having an impact over the social-aware proposals at different levels. Additionally, being content-oriented has its advantage: \emph{SCORP} reaches a delivery rate of 97.2\% with very little associated cost and low latency. This performance study led us to select the message TTL value that allows the proposals to deliver the most messages in less time and with the least associated cost. So, for the following set of results, we use a 1-day message TTL. \subsection{Evaluation of Network Load Impact \label{sub:Evaluation-of-LoadImpact}} We use a human trace-based scenario with varying network load to assess performance behavior of the studied proposals on a scenario with direct exchange of data among mobile devices independently of the existing levels of disruption/intermittency. As general remark: i) this dataset has an average of 32 contacts per hour among nodes and contacts happen sporadically; ii) with \emph{Bubble Rap} the average number of formed community is approx. 6.7, where most of them comprise almost all nodes. Fig. \ref{fig:4} presents the results of average delivery probability with an increasing number of messages/interests (msg/int) per node. In the 1 msg/int configuration, \emph{Bubble Rap }delivers 4.9\% and 24.8\% more messages than \emph{Spray and Wait} and \emph{dLife}/\emph{SCORP}, respectively, since most of the communities comprise almost all nodes and replication is done within those communities, resulting in more replicas, and thus higher probability of delivering content. Despite of having a 20\% advantage over \emph{dLife} and \emph{SCORP} regarding delivery, \emph{Spray and Wait }experiences a decrease in performance when compared to the results described in Sec. 4.3. The reason being that nodes in this scenario follow routines and do not cover the whole simulated area. Consequently, replicas are created to nodes that may never encounter the destination. \emph{dLife} and \emph{SCORP }have similar behavior, since forwarding only occurs if social weight to nodes or node importance (\emph{dLife}) or social weight to interests (\emph{SCORP}) is greater in the encountered nodes. Since contacts are little (32) and happen sporadically, these proposals replicate less directly affecting their delivery capability. For 5 and 10 msg/int configurations, the advantage of \emph{Spray and Wait} and \emph{Bubble Rap} is reduced due to the limited TTL and contact sporadicity: since messages can be created during a period without contacts, they may never reach their destination.\emph{} For \emph{Bubble Rap}, this issue is further increased in the 20 and 35 msg/int configurations, where it experiences buffer exhaustion. We estimate buffer occupancy for the 20 msg/int configuration to support this claim: there is an average of 39240 forwardings in the simulation, if we divide this by the number of days (roughly 12% \footnote{This dataset is worth of two months of data. However, when simulated in ONE it is worth almost 12 day of communications. % }) and by the number of nodes (35, source not included), we get an average of 3270 replications per node. If we times this by the average message size (52275 bytes), we get a buffer occupancy of 4.88 MB per node, which exceeds the 2 MB allowed (cf. Sec. 4.1). This is just an estimation for the worst case scenario with \emph{Bubble Rap} spreading copies to every node. Since this is highly unlikely as\emph{ }it\emph{ }also uses centrality to control replication, buffer exhaustion worsens as replication occurs to few nodes and not all as in our estimation. As message generation rate increases with load, messages can potentially take over forwarding opportunities of other messages, reducing the delivery probability of the latter. \begin{figure} \vspace{-0.4cm} \subfigure[Average delivery probability]{\label{fig:4} \includegraphics[scale=0.7]{avg_del_prob_1dTTL2}}~~~\subfigure[Average cost]{\label{fig:5}\includegraphics[scale=0.7]{avg_cost_1dTTL2}} \subfigure[Average latency]{{\scriptsize \label{fig:6}\hspace{3.2 cm}}\includegraphics[scale=0.7]{avg_latency_1dTTL2}} \vspace{-0.3cm} \caption{Performance under different network load} \vspace{-0.4cm} \end{figure} By considering the social strength towards destination or node importance, \emph{dLife} has a stabler behavior when compared to \emph{Bubble Rap}. Still, \emph{dLife} is affected by the rate of contacts due to its design choices. We observe that buffer exhaustion (\textasciitilde{}24\% more than the allowed) can also occur in this proposal in a 35 msg/int configuration. The performance of \emph{SCORP} shows the potential of content-awareness in the context of opportunistic routing. The delivery ratio of \emph{SCORP} increases as the ability of nodes to become a good message carrier increases (i.e., the more interests a node has, the better it is to deliver content to others since they potentially share interests). Regarding average cost (cf. Fig. \ref{fig:5}), \emph{Bubble Rap} has the highest cost in the 1 msg/int configuration since it relies on the formed communities to replicate: in an average of 671.4 forwardings against the 317, 141 and 236 forwardings done by \emph{Spray and Wait}, \emph{dLife} and \emph{SCORP}, respectively. As expected, \emph{Spray and Wait }has a stable cost due to its limited copies. In an attempt to find a next forwarder, nodes well socially connected to the destination or to nodes interested in the content carried in the message, \emph{dLife} and \emph{SCORP} solutions tend to replicate less. \emph{SCORP} creates a few more replicas than \emph{dLife} due to a particularity in its implementation: nodes interested in the content of a certain message not only process that message, but also keep a copy for further replication as they may have a chance to find nodes with this same interest, or that met other nodes with such interest. In this latter case, a node receiving a message with content matching its interest, also replicates it (unnecessary and unwanted replicas) to nodes that often have encountered it (and have a greater social weight to that specific interest).\emph{} For each of the 5, 10, 20 and 35 msg/int configurations, the number of forwardings is proportional to the load. This is reflected in the average cost of \emph{Bubble Rap }and \emph{dLife}: despite their increased replication, their efforts are not enough to increase their delivery rate and only contribute to the associated cost in delivering content. With a greater list of interests, a \emph{SCORP} node can act~as carrier for a larger number of nodes. Thus, those unwanted replicas observed in the 1 msg/int configuration have a positive effect while spreading content. Moreover, as messages are only replicated to interested nodes or to nodes that have a stronger social weight towards other nodes with higher interest in the content of the message than the current carrier, the cost is reduced. Consequently, \emph{SCORP} creates an average of \textasciitilde{}3.5 replicas across the msg/int configurations against an average of 9, \textasciitilde{}48.4 and 16.1 replicas of \emph{Spray and Wait},\emph{ Bubble Rap} and \emph{dLife}, respectively. Moreover, \emph{SCORP} keeps resource usage (i.e., buffer) at a low usage rate: with content awareness, the estimated maximum buffer occupancy (as we have done for \emph{Bubble Rap}) varies between \textasciitilde{}0.03 MB (1 msg/int) and 0.15 MB (35 msg/int). Fig. \ref{fig:6} shows the average latency that messages experienced. For the 1 msg/int configuration, messages experience over 24\% and 52\% more latency with \emph{Bubble Rap} than with \emph{Spray and Wait }and \emph{dLife}/\emph{SCORP}, respectively. This occurs since nodes can be part of each others community and messages exchanged between nodes take longer to reach destinations, due to the amount of nodes within each community. By looking at the delivered messages, we observe that\emph{~dLife} and \emph{SCORP} performed mostly (90\%) direct deliveries as the source node meets destinations within the first two hours of simulation. This surely reduces the overall latency, explaining why they take the same time to perform a delivery. \emph{Spray and Wait} also delivered most (85\%) of its messages by the second hour of simulation, but only few (17\%) were directed delivered which reflects its random replication power. For the 5, 10, 20 and 35 msg/int configurations, we observe that the latency peak experienced by all proposals is with the 5 msg/int configuration, due to the message creation time. Messages are generated in a daily basis and by analyzing the contacts/hour, we identified that some messages are created during periods of very few (and sometimes no) contacts followed by long periods (between 12 and 23 hours) of almost no contact. Thus, messages are stored longer, contributing to the overall high latency. This effect is mitigated as the load increases (messages are created almost immediately before a high number of contacts), reducing the experienced latency. As latency is in function of the delivered messages, this explains the decrease and variable behavior (from the 10 msg/int configuration on) experienced by\emph{ Spray and Wait}, \emph{Bubble Rap }and \emph{dLife}: their delivery rate decreases and increases, being influenced by the choices of next forwarders that take longer to deliver content.\emph{} \emph{SCORP} experiences up to 93.61\%, 90.25\% and 89.94\% less latency than \emph{Spray and Wait}, \emph{Bubble Rap} and \emph{dLife}, respectively. A \emph{SCORP} node can receive more information since it is interested in the content being replicated, and becomes a better forwarder as the chance of meeting nodes sharing the same interests is high. We observe that almost all communities comprise almost all nodes. Although the notion of community is not used in \emph{SCORP}, this observation suggests that nodes have a high number of contacts, and this is advantageous for \emph{SCORP,} as it can find interested nodes faster. To confirm this claim, we look at the delivered messages, and observe that shared interests account for 46\%, 53\%, 59\% and 66\% of deliveries in the 5, 10, 20, and 35 msg/int configurations, respectively. The remaining destinations are reached by the ability that \emph{SCORP} has in identifying interested parties further improving its performance. \subsection{Scalability Analysis} \emph{SCORP} takes into account users' interests in content. So, its scalability is determined based on the total number of existing interests. With this mind, we check memory requirements to compute~ $TECI$. For a worst case scenario with $k$ time slots and $m$ interests, and with every node meeting all other nodes (having at least one interest) in each $\Delta Ti$, \emph{SCORP} requires: i) $m$ variables to store every connection; ii) $m$ variables to store $TCTI$ computations; and iii) $k\times m$ variables to store $ATCTI$ computations. Considering each variable has $X$ bits, $TECI$'s needed resources is given by Eq. \ref{eq:4}. \begin{equation} TECI_{alloc}=m\times(k+2)\times X\, bits\label{eq:4} \end{equation} With 35 interests, 24 time slots, and 64 bit double for storing, \emph{SCORP} requires 7.11 KB of storage in each node. However, content-driven networks shall have a high number of interests: if per day a node meets other nodes that have 1 billion different interests, \emph{SCORP} requires 193.71 GB of memory, which is still feasible as nodes (e.g., laptops) have storage up to 500 GB. Still, not all nodes in dynamic networks have such storage (i.e., smartphones) and even if they did, owners would probably not share all of it on behalf of others. So, a \emph{SCORP} node can reduce its encountered interest space by: i) setting a daily threshold of 2 MB (equivalent to meet nodes with more than 10000 interests); ii) eliminating the interests associated to nodes not well socially connected to them at the end of a day: iii)if the threshold is reached. This rules set the basics to allow \emph{SCORP} to scale. \section{Conclusions and Future Work\label{sec:Conclusions-and-Future}} Access to data while on the go is desired by Internet users. Despite of the available networking infrastructure, such goal can be rather challenging, because most of the wireless access points is closed, restricted or expensive, and wireless networks suffer from interference. To overcome such challenges, an alternative is to allow direct exchange of data among users by exploiting the type of content and the interest users have on it \cite{socialcast,contentplace} along with social similarly \cite{bubble2011,dlife,cipro} among users. This offloading approach has shown its potential in improving data exchange over challenged networking environments. Our study aims at further investigate the advantages of using the content awareness (i.e., information type, interested parties) to improve data dissemination in urban, dense scenario. Thus, we propose \emph{SCORP,} a social-aware content-based opportunistic routing approach based on users' daily interactions and interests. Our findings show that the efficiency of data dissemination can be improved over challenged networks when routing is designed having content knowledge and social proximity in mind. \emph{SCORP} has better performance than previous social-aware content-oblivious routing proposals (e.g,. \emph{Bubble Rap} and \emph{dLife}): \emph{SCORP} delivers up to 97\% of its content in an average of 46.9 minutes, against the 335.5 and 343.7 minutes needed by \emph{Bubble Rap} and \emph{dLife}, respectively. Additionally, \emph{SCORP} produces up to approximately 13.9 and 4.7 times less replicas than \emph{Bubble Rap} and \emph{dLife}, respectively. Since this work is part of the DTN-Amazon project% \footnote{http://siti.ulusofona.pt/\textasciitilde{}dtnamazon/% } that aims at promoting the social/digital inclusion of the riverside communities in the northern region of Brazil, as future steps we will implement \emph{SCORP} as content dissemination application among the students of the Federal University of Para campus, Belem, Brazil, and later being extended to disseminate content (public, health, safety) to these isolated communities. Moreover, we would like to experimentally show the conceptually advantages of \emph{SCORP} in relation to other content-oriented social-aware solutions (\emph{SocialCast}, \emph{ContentPlace} and \emph{CiPRO})\emph{ }as soon as the code of such approaches is made available, or if guidance is available to support realistic, unbiased implementations. \section*{Acknowledgment} Thanks are due to FCT for supporting the UCR (PTDC/EEA-TEL/103637/2008) project and Mr. Moreira's PhD grant (SFRH/BD/62761/2009), and to the colleagues of the DTN-Amazon project for the fruitful discussions. \bibliographystyle{elsarticle-num}
{'timestamp': '2014-08-01T02:08:28', 'yymm': '1407', 'arxiv_id': '1407.8363', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8363'}
arxiv
\section*{Supplementary Material} \begin{mylem}[Bernstein inequality]\label{bernstein} Let $\myX_1,\dots, \myX_\myn$ be independent zero-mean random variables. If for all $1\leq\myi\leq\myn, |\myX_\myi|\leq \myM$, then for all $\myt>0$, \[\Pr \left[\left|\sum_{\myi=1}^\myn \myX_\myi\right|>\myt\right] \leq \exp\left\{-\frac{\myt^2/2} {\sum_{\myi=1}^\myn \mathbb{E} [\myX_\myi^2]+\myM\myt/3}\right\}.\] \end{mylem} \section{CMAB with Clustered Arms} \label{sec:clusteredbandit} In many applications, multiple arms are clustered and are always played together. For example, in the PMC bandit problem, all arms (edges) incident to a node in $L$ are always played together; in the influence maximization bandit problem, all arms (outgoing edges) from the same node are always played together. In this section, we show how to take advantage of such arm clusters to further improve the regret analysis. We consider the following CMAB problem with clustered arms. Formally, each cluster $C \subseteq [m]$ contains a set of simple arms. Denote ${U}$ as the set of all clusters. Notice that one arm may belong to multiple clusters. We assume $|{U}| < m$. In this setting, each super arm $S$ is a union of several clusters: $S=\bigcup_{C\in g(S)} C$, where $g(S)$ is the set of clusters that forms $S$. When super arm $S$ is played in round $t$, the outcomes of all arms in the clusters in $S$ will be revealed. We will use the same CUCB algorithm with a minor change to the initialization rounds: In the first $|U|$ rounds of initialization, for each cluster $C$, we play a super arm $S$ such that $C\in g(S)$ and update variables $\hat{\mu}_i$ accordingly. For a given cluster $C\subseteq [m]$, we sort all {\em bad} super arms whose cluster set contains $C$ as $S_{C,B}^1, S_{C,B}^2, \cdots, S_{C,B}^{K_C}$ by increasing reward. Define \begin{equation} \label{eqn:deltaij:cluster} \Delta^{C,j} = \alpha \cdot {\mathrm{opt}}_{{\boldsymbol \mu}} - r_{{\boldsymbol \mu}}(S_{C,{\mathrm{B}}}^j), \end{equation} $\Delta_{\max}^C = \Delta^{C,1}$ and $\Delta_{\min}^C = \Delta^{C, K_C}$. If $C$ does not belong to any {\em bad} super arm, $K_C = 0$ and set $\Delta_{\max}^C = \Delta_{\min}^C = 0$. Furthermore, define $\Delta_{\max}=\max_{C\in U} \Delta_{\max}^C$. \def\thmclustered{ Consider the CMAB problem with the set of clusters $U$ of arms. In $n$ rounds the $(\alpha,\beta)$-approximation regret of the CUCB algorithm using an $(\alpha,\beta)$-approximation oracle is at most \[ \sum_{C\,\mid\, \Delta_{\min}^C > 0}\left( \frac{6\ln n}{(f^{-1}(\Delta^C_{\min}))^2}\cdot \Delta^C_{\min} + \int_{\Delta^{C}_{\min}}^{\Delta^{C}_{\max}} \frac{6\ln n}{(f^{-1}(x))^2} \mathrm{d}x\right) + \left(\frac{\pi^2}{3}+1\right)\cdot m \cdot \Delta_{\max}. \] } \begin{mythm} \label{thm:clustered} {\thmclustered} \end{mythm} \paragraph{Discussion.} Comparing with the regret bound in Theorem~1, we are taking the summation over all clusters instead of all underlying arms. Since we assume $|U|<m$, intuitively, we could be better off. However, it is not clear how the $\Delta_{\min}$'s of the underlying arms and clusters are correlated with each other. When clusters do not intersect with one another and thus form a partition of the underlying arms, it is straightforward to show that $\Delta_{\min}^i = \Delta_{\min}^C$ if the cluster $C$ contains the arm $i$. In this case, the new regret bound of Theorem~\ref{thm:clustered} is a strict improvement over Theorem~1. The two applications discussed in this paper, i.e., the bandit PMC problem and the bandit influence maximization problem, belong to this category and thus Theorem~\ref{thm:clustered} could be applied and obtain improved regret bounds. \begin{proof} The proof of this theorem is almost identical to Theorem~1. In addition to $T_i$, our analysis requires $T_{C}$ which is the number of time cluster $C$ is selected to play. Let $T_{{C},n}$ be the value of $T_{C}$ at the end of round $n$, that is, $T_{{C},n}$ is the number of times cluster ${C}$ is played in the first $n$ rounds. Let $T_{i,n}$ still be the value of $T_i$ at the end of round $n$, that is, $T_{i,n}$ is the number of times arm $i$ is played in the first $n$ rounds. Since arm $i$ might be contained in multiple clusters, here $T_{i,n}$ is larger than $T_{{C},n}$ for any ${C}$ containing $i$. For the proof, we maintain counter $N_{C}$ for each cluster ${C}$ after the ${U}$ initialization rounds. Let $N_{{C},t}$ be the value of $N_{C}$ after the $t$-th round and $N_{{C},|{U}|} = 1$. Note that $\sum_{{C}}N_{{C},|{U}|}=|{U}|$. $\{N_{C}\}$ is updated in the following way. For a round $t>|U|$, let $S_t$ be the super arm selected in round $t$. Round $t$ is bad if the oracle selects a super arm $S_t\in \mathcal{S}_{\mathrm{B}}$, which is not an $\alpha$-approximate super arm. If round $t$ is bad, let ${C} = \operatornamewithlimits{argmin}_{{C}\in g(S_t)} N_{{C},t-1} $ and increment $N_{{C}}$ by one, i.e., $N_{{C},t} = N_{{C},t-1}+1$. In other words, we find the cluster $C$ with smallest counter in $g(S_t)$ and increase its counter. If ${C}$ is not unique, we pick an arbitrary cluster with the smallest counter in $g(S_t)$. By definition $N_{{C},t} \leq T_{{C},t}$. The total number of bad rounds in the first $n$ rounds is $\sum_{{C}}N_{{C},n}$. Each time $N_C$ gets updated, one of the bad arm whose cluster set contains $C$ is played. We further divide $N_C$ into more counters as follows: \[\forall l\in [K_C],\, N_{C,n}^l = \sum_{t=|U|+1}^n \mathbb{I}\{S_t = S_{C,{\mathrm{B}}}^l, N_{C,t}>N_{C,t-1}\}.\] Define ${\ell}_n(\Delta)=\frac{6\ln n }{(f^{-1}(\Delta))^2}$. When counter $N_{i,t}^l$ is increased at time $t$, i.e., $S_t=S_{C,B}^l$, we inspect the counter $N_{C,t-1}^l$. Notice that $N_{C,t-1}^l$ is the smallest time that all arms in $S_t$ have been played. If $N_{c,t-1}>{\ell}_n (\Delta^{C,l})$, we call the bad arm $S_{C,B}^l$ is sufficiently sampled. Otherwise, it is under-sampled. We write as \begin{align*} N_{C,n}^{l, suf} =& \sum_{t=m+1}^n \mathbb{I}\{S_t = S_{C,{\mathrm{B}}}^l, N_{C,t}>N_{C,t-1}, N_{C,t-1} > \ell_n(\Delta^{C,l})\}, \nonumber \\ N_{C,n}^{l, und} =& \sum_{t=m+1}^n \mathbb{I}\{S_t = S_{C,{\mathrm{B}}}^l, N_{C,t}>N_{C,t-1}, N_{C,t-1} \le \ell_n(\Delta^{C,l})\}. \end{align*} Then we have $N_{C,n} = 1+\sum_{l\in [K_C]} (N_{C,n}^{l, suf} + N_{C,n}^{l, und})$. Using this notation, the total reward at time horizon $n$ is at least \begin{equation} \label{eqn:reward:cluster} n\cdot \alpha \cdot {\mathrm{opt}}_{{\boldsymbol \mu}} - \sum_{C\in U}\left(\Delta^{C,1} + \sum_{l\in [K_C]} (N_{C,n}^{l, suf} + N_{C,n}^{l, und}) \cdot \Delta^{C,l}\right). \end{equation} Note that the total sampled time of underlying arms in one cluster will not be smaller than the total sampled time of that cluster. We claim that it is unlikely that a bad super arm is played when all the underlying arms are sufficiently sampled. In other words, for a bad super arm, if all its underlying arms are sufficiently sampled, it should not be played in the first place. More specifically, we have the following claim. \begin{mylem} For any time horizon $n > m$, \begin{equation} \label{eqn:suf:cluster} \mathbb{E}\left[\sum_{C\in U} \sum_{l\in [K_C]} N_{C,n}^{l, suf}\right] \leq (1-\beta)n+\frac{\pi^2}{3}\cdot m \end{equation} \end{mylem} \begin{proof} By the definition of $N_{C,n}^{l,suf}$, it is sufficient to show that for any $t>m$, \begin{align*} &\mathbb{E}\left[ \sum_{C\in [m], l\in [K_C]}\mathbb{I}\{S_t= S_{C,{\mathrm{B}}}^l, N_{C,t}>N_{C,t-1}, N_{C,t-1} > \ell_n(\Delta^{C,l})\}\right]\\ \le&\sum_{C\in[m], l\in [K_C]}\Pr\{ S_t = S_{C,{\mathrm{B}}}^l, \forall s \in S_{C,{\mathrm{B}}}^l, T_{s,t-1} > \ell_n(\Delta^{C,l}) \} \\ \leq &(1-\beta)+2mt^{-2}\\ \end{align*} Define $\Lambda_{i,t}=\sqrt{ \frac{ 3\ln t}{2T_{i,t-1}}}$ (a random variable since $T_{i,t-1}$ is a random variable) and $\Lambda_{t} =\max \{ \Lambda_{i,t} \,\mid i\in S_t\}$. Define $\Lambda^{C,l} = \sqrt{\frac{3\ln t}{2\ell_n(\Delta^{C,l})}}$. Let $\mathcal{N}_t$ indicate the event that the process is {\em nice} at time $t$. Let $F_t$ indicate the event that the oracle fails to return an $\alpha$-approximation with respect to the input vector at time $t$. For any particular $C\in U$ and $l\in [K_C]$, if $\left\{\mathcal{N}_t, \neg F_t, S_t = S_{C,{\mathrm{B}}}^l, \forall s\in S_t, T_{s,t-1} >{\ell}_n(\Delta^{C,l}) \right\}$ holds at time $t$, we have the following properties: \begin{align*} r_{{\boldsymbol \mu}}(S_t) + f(2\Lambda^{C,l}) >& r_{{\boldsymbol \mu}}(S_t) +f(2\Lambda_{t}) &\mbox{ strict monotonicity of $f(\cdot)$ and Eq.(8)}\\ \geq & r_{\bar{{\boldsymbol \mu}}_t}(S_t) &\mbox{bounded smoothness property and Eq.(7)} \\ \geq &\alpha\cdot {{\mathrm{opt}}_{\bar{{\boldsymbol \mu}}_t}}& \mbox{$\neg F_t \Rightarrow$ $S_t$ is an $\alpha$ approximation w.r.t $\bar{{\boldsymbol \mu}}_t$} \\ \geq &\alpha \cdot r_{\bar{{\boldsymbol \mu}}_t}(S_{\boldsymbol \mu}^*) &\mbox{definition of ${\mathrm{opt}}_{\bar{{\boldsymbol \mu}}_t}$} \\ \geq & \alpha\cdot r_{{\boldsymbol \mu}}(S_{\boldsymbol \mu}^*) = \alpha\cdot {\mathrm{opt}}_{{\boldsymbol \mu}}. &\mbox{ monotonicity of $r_{{\boldsymbol \mu}}(S)$ and Eq.(9)} \end{align*} So we have \begin{align} r_{{\boldsymbol \mu}}(S_{C,{\mathrm{B}}}^l)+f(2\Lambda^{C,l})> \alpha \cdot {\mathrm{opt}}_{\boldsymbol \mu}. \label{eqn:min_Delta_il:cluster} \end{align} Since ${\ell}_n(\Delta^{C,l}) = \frac{ 6\ln n }{(f^{-1}(\Delta^{C,l}))^2}$, we have $f(2\Lambda^{C,l}) =\Delta^{C,l}$. Therefore, Eq.~(\ref{eqn:min_Delta_il:cluster}) contradicts the definition of $\Delta^{C,l}$. In other words, \begin{align*} &\forall C\in[m]\, \forall l\in[K_C],\, \Pr \left\{\mathcal{N}_t, \neg F_t, S_t=S_{C,{\mathrm{B}}}^l, \forall s\in S_t, N_{s,t-1} >{\ell}_n(\Delta^{C,l}) \right\} = 0 \\ \Rightarrow &\Pr\left\{\mathcal{N}_t, \neg F_t, \exists C\in U, \exists l\in [K_C], S_t=S_{C,{\mathrm{B}}}^l, \forall s\in S_t, N_{s,t-1} >{\ell}_n(\Delta^{C,l}) \right\} = 0 \\ \Rightarrow &\Pr \left\{\exists C\in U, \exists l\in [K_C], S_t=S_{C,{\mathrm{B}}}^l, \forall s\in S_t, N_{s,t-1} >{\ell}_n(\Delta^{C,l}) \right\} \leq \Pr[F_t \lor \neg \mathcal{N}_t] \leq (1-\beta)+2mt^{-2} \\ \Rightarrow &\sum_{C\in U,l\in[K_C]}\Pr \left\{ S_t=S_{C,{\mathrm{B}}}^l, \forall s\in S_t, N_{s,t-1} >{\ell}_n(\Delta^{C,l}) \right\} \leq (1-\beta)+2mt^{-2} \end{align*} The first inequality comes from Lemma~\ref{lem:nice}. \end{proof} Now we consider the bad super arms that are under-sampled when played. To simplify the notation, define $\ell_n(\Delta^{C,0}) = 0$. For a cluster $C$, \begin{align} &\sum_{l\in [K_C]} N_{C,n}^{l,und}\cdot \Delta^{C,l} \nonumber\\ =& \sum_{t=|U|+1}^n \sum_{l\in [K_C]}\mathbb{I}\{S_t = S_{C,{\mathrm{B}}}^l, N_{C,t}>N_{C,t-1}, N_{C,t-1} \le \ell_n(\Delta^{C,l})\}\cdot \Delta^{C,l} \nonumber\\ =& \sum_{t=|U|+1}^n \sum_{l\in [K_C]} \sum_{j=1}^l \mathbb{I}\{S_t = S_{C,{\mathrm{B}}}^l, N_{C,t}>N_{C,t-1}, N_{C,t-1} \in (\ell_n(\Delta^{C,j-1}), \ell_n(\Delta^{C,j}) ] \} \cdot \Delta^{C,l} \nonumber\\ \leq& \sum_{t=|U|+1}^n \sum_{l\in [K_C]} \sum_{j=1}^l \mathbb{I}\{S_t = S_{C,{\mathrm{B}}}^l, N_{C,t}>N_{C,t-1}, N_{C,t-1} \in (\ell_n(\Delta^{C,j-1}), \ell_n(\Delta^{C,j}) ] \} \cdot \Delta^{C,\mathbf{j}} \nonumber\\ \leq& \sum_{t=|U|+1}^n \sum_{l\in [K_C]} \sum_{j\in [\mathbf{K_C}]} \mathbb{I}\{S_t = S_{C,{\mathrm{B}}}^l, N_{C,t}>N_{C,t-1}, N_{C,t-1} \in (\ell_n(\Delta^{C,j-1}), \ell_n(\Delta^{C,j}) ] \} \cdot \Delta^{C,j} \nonumber\\ =& \sum_{t=|U|+1}^n \sum_{j\in [K_C]} \mathbb{I}\{S_t \in \mathcal{S}_{C,{\mathrm{B}}}, N_{C,t}>N_{C,t-1}, N_{C,t-1} \in (\ell_n(\Delta^{C,j-1}), \ell_n(\Delta^{C,j}) ] \} \cdot \Delta^{C,j} \nonumber \\ =& \sum_{j\in [K_C]} \sum_{t=|U|+1}^n\mathbb{I}\{S_t \in \mathcal{S}_{C,{\mathrm{B}}}, N_{C,t}>N_{C,t-1}, N_{C,t-1} \in (\ell_n(\Delta^{C,j-1}), \ell_n(\Delta^{C,j}) ] \} \cdot \Delta^{C,j} \nonumber \\ \leq& \sum_{j\in [K_C]} (\ell_n(\Delta^{C,j}) - \ell_n(\Delta^{C,j-1}))\cdot \Delta^{C,j} \nonumber\\ =& \ell_n(\Delta^{C,K_i}) \Delta^{C,K_i}+\sum_{j\in [K_C]} \ell_n(\Delta^{C,j}) \cdot( \Delta^{C,j} -\Delta^{C,j+1}) \nonumber \\ \leq& \ell_n(\Delta^{C,K_C}) \Delta^{C,K_C} + \int_{\Delta^{C,K_C}}^{\Delta^{C,1}} \ell_n(x) \mathrm{d}x. \label{eqn:und:cluster} \end{align} Last inequality comes from the fact that $\ell_n(x)$ is decreasing. Notice that by our definition, for clusters that $C_j \in [m] \setminus \{ C \mid \Delta_{\min}^C > 0 \}$, the counter $N_C$ remains one after the initialization. Since they do not contribute to any regret, we have $K_C = 0$ for all these arms. Combining with Eq.(\ref{eqn:suf:cluster}) and Eq.(\ref{eqn:und:cluster}), the overall regret of our algorithm is \begin{align*} & Reg^A_{{\boldsymbol \mu},\alpha,\beta}(n) \\ \leq &n \cdot \alpha \cdot \beta\cdot {\mathrm{opt}}_{{\boldsymbol \mu}} - \left(\alpha \cdot n\cdot {\mathrm{opt}}_{{\boldsymbol \mu}} - \sum_{C\in U}\left( \Delta^{C,1}+\sum_{l\in [K_C]} (N_{C,n}^{l, suf} + N_{C,n}^{l, und}) \cdot \Delta^{C,l}\right) \right)\\ \leq& \Delta_{\max} \cdot \sum_{C\in U, l\in [K_C]} N_{C,n}^{l, suf} + \sum_{C\,\mid \, \Delta_{\min}^C > 0}\left( \Delta^{C,1}+ \ell_n(\Delta^{C,K_C}) \Delta^{C,K_C} + \int_{\Delta^{C,K_C}}^{\Delta^{C,1}} \ell_n(x) \mathrm{d}x\right) - (1-\beta)\cdot n\cdot \alpha \cdot {\mathrm{opt}}_{{\boldsymbol \mu}}\\ \leq &\left(\frac{\pi^2}{3}+1\right)\cdot m \cdot \Delta_{\max} + \sum_{C\,\mid \, \Delta_{\min}^C > 0}\left( \ell_n(\Delta^{C,K_C}) \Delta^{C,K_C} + \int_{\Delta^{C,K_C}}^{\Delta^{C,1}} \ell_n(x) \mathrm{d}x\right) . \end{align*} The theorem follows directly. \end{proof} \vspace{0pt} \section{$\varepsilon_t$-Greedy algorithm} \vspace{0pt} \begin{algorithm}[t] \centering \caption{$\varepsilon_t$-greedy algorithm with computation oracle} \label{alg:epsgreedy} \begin{algorithmic}[1] \STATE For each arm $i$, maintain variable $\hat \mu_{i}$ as the mean of all outcomes $X_{i,*}$'s of arm $i$ observed so far. \STATE $\myn\leftarrow 0$ \WHILE {\TRUE} \STATE $\myt\leftarrow \myt+1$; $\varepsilon_\myt\leftarrow\min\{\frac{\gamma}{\myt},1\}$. \STATE With probability $\varepsilon_\myt$, choose an arm $i$ uniform at random, then play an arbitrary super arm $S\in\mathcal{S}$ containing $i$; with probability $1-\varepsilon_\myt$, get $S = \mathrm{Oracle}(\hat \mu_1, \hat \mu_2,\ldots, \hat \mu_m)$. \STATE Play $S$ and update all $\hat \mu_{\myi}$'s. \ENDWHILE \end{algorithmic} \end{algorithm} Unlike CUCB algorithm, $\varepsilon_t$-greedy algorithm exhibits the combination of exploration and exploitation more explicitly. In the $\myt$-th round, with probability $\varepsilon_\myt$ the algorithm performs {\em exploration}, i.e., chooses an arm $i$ uniformly at random, then select an arbitrary super arm $S\in \mathcal{S}$ containing $i$; with probability $1-\varepsilon_\myt$, the algorithm performs {\em exploitation}, i.e., uses the approximation oracle to choose a super arm. As $\myt$ grows, the probability of performing exploration decreases so that the regret can be bounded. See Algorithm \ref{alg:epsgreedy} for details. Note that if an arm $i$ has never been played, $\hat \mu_i$ could be any arbitrary value. The appeal of the $\epsilon_t$-greedy algorithm is its simplicity and match with intuition. However, as shown in the following theorem, in order to have a theoretical guarantee on the regret bound, parameter $\gamma$ needs to be set appropriately and it depends on $\Delta_{\min}$ and function $f(\cdot)$. In constrast, the CUCB algorithm does not rely on the knowledge of $\Delta_{\min}$ and $f(\cdot)$, and thus CUCB is applicable to more settings in this sense. \begin{mythm} \label{thm:epsgreedy} {\thmepsgreedy} \end{mythm} Recall that the definition of $\Delta_{\min}$ is \begin{equation} \label{eqn:gmin} \Delta_{\min} = \alpha\cdot {\mathrm{opt}}_{{\boldsymbol \mu}} - \max\{ r_{{\boldsymbol \mu}}(S) \, \mid \, S\in \mathcal{S}_{\mathrm{B}}\}. \end{equation} \begin{proof} Let $R_{\myi,\myt}$ be the indicator for the event that $\myi$ was chosen to {\em explore} in the $\myt$-th round and $N_{i,t}$ be the number of rounds that arm $i$ is explored in the first $t$ rounds. Set $\varphi = \frac{\gamma}{3m}$. For simplicity, we assume $\gamma$ is integer. We have: \begin{align} \mathbb{E}[N_{i,n}] = \sum_{\myt=1}^\myn \mathbb{E}[R_{\myi,\myt}]= \sum_{\myt=1}^\myn \frac{\varepsilon_\myt}{m}= \frac{\gamma-1}{m}+ \sum_{\myt=\gamma}^\myn \frac{3\varphi}{\myt} > 3\varphi+ \int_{\gamma}^{\myn} \frac{3\varphi}{\myx} \dx= 1+ 3\varphi \ln (\myn /\gamma) \label{ineq1} \end{align} When $n> \gamma ^3$, (\ref{ineq1}) is at least $2\varphi \ln n + 1$. Now let $\myX_{\myi,\myt}=R_{\myi,\myt}-\mathbb{E}[R_{\myi,\myt}]$. We have $\mathbb{E}[\myX_{\myi,\myt}]=0$, $|\myX_{\myi,\myt}|\leq 1$, and \begin{align*} \sum_{\myt=1}^\myn\mathbb{E} \left[\myX_{\myi,\myt}^2\right]= \sum_{\myt= \gamma }^\myn\left(1-\frac{3\varphi}{\myt}\right)\frac{3\varphi}{\myt}< 3\varphi \ln \myn. \end{align*} By Bernstein inequality in Lemma \ref{bernstein}, when $n> \gamma^3$, we have \begin{align*} \Pr \left[\left|\sum_{\myt=1}^\myn \myX_{\myi,\myt}\right|>\varphi \ln \myn \right] &\leq \exp\left\{-\frac{\varphi^2(\ln \myn)^2 /2} {\sum_{\myt=1}^\myn \mathbb{E} [\myX_{\myi,\myt}^2]+\myM (\varphi \ln \myn)/3}\right\}\nonumber\\ &\leq \exp\left\{-\frac{\varphi^2(\ln \myn)^2 /2} {3\varphi \ln \myn+\varphi \ln \myn/3}\right\}\nonumber\\ &=\mye^{-\frac{3}{20}\varphi\ln \myn}=\myn^{-\frac{3}{20}\varphi}\leq n^{-c}. \end{align*} In other words, $\Pr[ N_{i,t} \leq \varphi \ln t +1] \leq t^{-c}$. By union bound, $\Pr[\exists i\in [m], \, N_{i,t} \leq \varphi \ln t + 1] \leq mt^{-c}$. Let $P_t$ to be the indicator of the event that in the $t$-th round, all the arms have been played for at least $\varphi \ln t +1$ times. So, $\Pr[P_t=0]\leq mt^{-c}$. Set ${\ell}_t= \frac{(c+1) \ln t} {\left(f^{-1} \left(\frac{\Delta_{\min}}{2}\right)\right)^{2}} \leq \varphi \ln t $. Note $P_t=1$ indicates for every arm $i$, $T_{i,t}\geq N_{i,t}\geq \varphi \ln t +1>{\ell}_t$. Let $I_{t}$ be the event that we choose a bad arm $S_t\in \mathcal{S}_{{\mathrm{B}}}$ in the $t$-th round. Let $Y_{t}$ be the event that the action taken in the $t$-th round is exploitation (not exploration). Let $F_t$ be the event that the oracle failed to produce an $\alpha$-approximate answer in an exploitation round $t$. We have $\mathbb{E}[F_t\mid Y_{t}]\leq 1-\beta$. We have, \begin{align*} \sum_{t=\gamma^3+1}^n \mathbb{I} \{I_t\} &= \sum_{t=\gamma^3+1}^n \left(\mathbb{I}\{I_t,\neg Y_t\}+\mathbb{I}\{I_t,Y_t\}\right) \\ &= \sum_{t=\gamma^3+1}^n \varepsilon_t\cdot \mathbb{I}\{I_t \mid \neg Y_t\}+ \sum_{t=\gamma^3+1}^n \mathbb{I}\{I_t, Y_t\} \\ &\leq \gamma \ln n+ \sum_{t=\gamma^3+1}^n \mathbb{I}\{I_t ,Y_t\} \end{align*} Consider the second term. \begin{align*} \\ &\sum_{t=\gamma^3+1}^n \mathbb{I}\{I_t, Y_t\} \\ \leq & \sum_{t=\gamma^3+1}^n \left(\mathbb{I}\{F_t, Y_t\} +\mathbb{I}\{\neg F_t, I_t, Y_t\} \right) \\\leq& (1-\beta)(n-\gamma^3)+ \sum_{t=\gamma^3+1}^n \left( \mathbb{I}\{\neg F_t,I_t,\neg P_t , Y_t\} +\mathbb{I}\{\neg F_t,I_t,P_t, Y_t\} \right) \\ \leq& (1-\beta)n+ \sum_{t=\gamma^3+1}^n \left( mt^{-c}\cdot \mathbb{I}\{I_t\mid \neg F_t,\neg P_t,Y_t\} +\mathbb{I}\{\neg F_t,I_t, P_t, Y_t\} \right) \\ \leq& (1-\beta)n+ \zeta(c)\cdot m+ \sum_{t=\gamma^3+1}^n \mathbb{I}\{\neg F_t,I_t,P_t, Y_t\} \\ =& (1-\beta)n+ \zeta(c)\cdot m+ \sum_{t=\gamma^3+1}^n \mathbb{I}\{ \neg F_t,Y_t, S_t\in \mathcal{S}_{\mathrm{B}}, \forall i\in [m],\, T_{i,t-1}>{\ell}_t \}\nonumber \end{align*} We claim that $$\Pr[\{ \neg F_t,Y_t, S_t\in \mathcal{S}_{\mathrm{B}}, \forall i\in [m],\, T_{i,t-1}>{\ell}_t \}] \leq 2\cdot m\cdot t^{-c}. $$ We now prove this claim. Same as in the proof of Theorem~1, let $T_{i,n}$ be the number of times arm $i$ is played in the first $n$ rounds; let $\hat \mu_{i,s}$ be the value of $\hat \mu_i$ after arm $i$ is played $s$ times, that is, $\hat \mu_{i,s} = (\sum_{j=1}^{s} X_{i,j})/s$. Then, the value of variable $\hat \mu_i$ at the end of round $n$ is $\hat \mu_{i,T_{i,n}}$. By Chernoff bound in Lemma~\ref{chernoffLemma}, for any $i\in [m]$, \begin{align} \Pr\left[ |\hat \mu_{i,T_{i,t-1}} - \mu_i| \geq \sqrt{\frac{ 2\ln t+\ln \ln t }{2T_{i,t-1}}} \right] &\leq t\cdot 2e^{-2\ln t - \ln \ln t} \leq 2(t\ln t)^{-1}. \label{eqn:epsilonhatp-p} \end{align} Define $\Delta_{i,t}=\sqrt{ \frac{2\ln t + \ln\ln t}{2T_{i,t-1}}}$. Define ${E}_t = \{ \forall i \in [m], \, |\hat \mu_{i,T_{i,t-1}} - \mu_i| \leq \Delta_{i,t}\}$. By union bound, $\Pr[\neg {E}_t] \leq 2\cdot m \cdot t^{-c}$. Let $\Delta = \sqrt{\frac{2\ln t+\ln\ln t}{2{\ell}_t}}$. Notice that when $\forall i\in [m], T_{i,t-1}>{\ell}_t$, we have $\Delta > \Delta^t \stackrel{\mathrm{def}}{=} \max \{ \Delta_{i,t} \,\mid i\in [m]\}$. Let $\hat{{\boldsymbol \mu}}_t = (\hat{\mu}_{1,T_{1,t-1}}, \ldots, \hat{\mu}_{m,T_{m,t-1}})$ be the random vector representing the estimated expectation vector at round $t$ before calling the oracle. Then, when $\{{E}_t, \neg F_t, Y_t, S_t\in \mathcal{S}_{\mathrm{B}}, \forall i\in [m], T_{i,t-1}>{\ell}_t\}$ holds, we have the following properties: \begin{align*} r_{{\boldsymbol \mu}}(S_t)+2f(\Delta) & > r_{{\boldsymbol \mu}}(S_t)+(1+\alpha)f(\Delta^t) &\mbox{monotonicity of $f(\cdot)$}\\ &\geq r_{\hat{\boldsymbol \mu}_t}(S_t)+\alpha f(\Delta^t) & \mbox{bounded smoothness property with ${E}_t$}\\ &\geq \alpha\cdot {\mathrm{opt}}_{\hat {\boldsymbol \mu}_t}+\alpha f(\Delta^t) & \mbox{$\neg F_t \Rightarrow$ $S_t$ is an $\alpha$ approximation w.r.t $\hat{{\boldsymbol \mu}}_t$}\\ & \geq \left(r_{\hat{\boldsymbol \mu}_t}(S_{\boldsymbol \mu}^*)+f(\Delta^t)\right)\cdot \alpha &\mbox{definition of ${\mathrm{opt}}_{\hat{{\boldsymbol \mu}}_t}$} \\ &\geq \alpha \cdot r_{{\boldsymbol \mu}}(S_{\boldsymbol \mu}^*) = \alpha \cdot {\mathrm{opt}}_{{\boldsymbol \mu}}. & \mbox{bounded smoothness property with ${E}_t$} \end{align*} These above inequalities imply that when ${E}_t$ holds, we have \begin{align} r_{\boldsymbol \mu}(S^j) +2f(\Delta) > \alpha \cdot {\mathrm{opt}}_{\boldsymbol \mu}. \label{eqn:sopt} \end{align} Since ${\ell}_t = \frac{ 2\ln t+\ln\ln t }{\left(f^{-1}\left(\frac{\Delta_{\min}}{2}\right)\right)^2}$, we have \[ 2f(\Delta) =2f\left(f^{-1}\left(\frac{\Delta_{\min}}{2}\right)\right) =\Delta_{\min}. \] With $2f(\Delta)=\Delta_{\min}$, Eq.~(\ref{eqn:sopt}) is in conflict with the definition of $\Delta_{\min}$ in Eq.~(\ref{eqn:gmin}). In other words, \begin{align*} &\Pr\left[ \{ {E}_t, \neg F_t,Y_t, S_t\in \mathcal{S}_{\mathrm{B}}, \forall i\in [m], T_{i,t-1}>{\ell}_t \}\right] = 0 \Rightarrow \\ &\Pr\left[ \{\neg F_t,Y_t, S_t=S^j, \forall i\in S^j \cup S_{\boldsymbol \mu}^*, T_{i,t-1}=s_i \} \right] \leq \Pr[\neg {E}_t]\leq 2\cdot m\cdot (t\ln t)^{-1}. \end{align*} Thus, \begin{align*} &\mathbb{E}\left[\sum_{t=1}^n \mathbb{I} \{I_t\}\right] \\ \leq & \gamma^3+ \gamma \ln n + (1-\beta)n+ \zeta(c)\cdot m+ \sum_{t=\gamma^3+1}^n 2\cdot m (t\ln t)^{-1} \\ \leq & \gamma^3+\gamma \ln n +(1-\beta)n+ \zeta(c)\cdot m + 2m\ln \ln n \end{align*} That means, the regret is at most: \begin{align*} Reg^A_{{\boldsymbol \mu},\alpha,\beta}(n) &\leq n \cdot \alpha \cdot \beta\cdot {\mathrm{opt}}_{{\boldsymbol \mu}} - \left( n\cdot \alpha\cdot {\mathrm{opt}}_{{\boldsymbol \mu}}-\Delta_{\max}\cdot \mathbb{E}\left[\sum_{t=1}^n \mathbb{I} \{I_t\}\right]\right) \\&\leq \left( \gamma^3+\gamma \ln n +(1-\beta)n+ 3\cdot \zeta(c)\cdot m \right)\Delta_{\max} - (1-\beta) \cdot n \cdot \alpha \cdot {\mathrm{opt}}_{{\boldsymbol \mu}} \nonumber\\ &\leq \left( \gamma \ln n + 3\cdot \zeta(c)\cdot m + \gamma ^3 \right) \Delta_{\max}. \end{align*} \end{proof} \section{Improving the UCB1 algorithm of~\cite{AuerCF02} and its analysis using our approach} \label{sec:improveUCB1} We can improve the UCB1 algorithm of~\cite{AuerCF02} by replacing its adjustment term of $\sqrt{\frac{2\ln n}{n_i}}$ with $\sqrt{\frac{(c+1)\ln n}{2n_i}}$ for any $c>1$. The improved analysis using our approach will give the following regret bound: \[ \left[ 2(c+1) \sum_{i:\mu_i < \mu^*} \left( \frac{\ln n}{\Delta_i}\right)\right] + \left(1+2\cdot \zeta(c)\right)\left(\sum_{j=1}^{K} \Delta_j\right). \] The following is the revised analysis of the improved algorithm. We start from the following formula in page 242 of the paper~\cite{AuerCF02}: \begin{align*} T_i(n) \le \ell + \sum_{t=K+1}^n\mathbb{I}\{\bar{X}^*_{T^*(t-1)} + c_{t-1,T^*(t-1)} \le \bar{X}_{i,T_i(t-1)} + c_{t-1,T_i(t-1)}, T_i(t-1)\ge \ell\}. \end{align*} Following the argument of the paper, event $\{\bar{X}^*_{T^*(t-1)} + c_{t-1,T^*(t-1)} \le \bar{X}_{i,T_i(t-1)} + c_{t-1,T_i(t-1)}\}$ implies that $\{\bar{X}^*_{T^*(t-1)} \le \mu^*- c_{t-1,T^*(t-1)}\}$ or $\{\bar{X}_{i,T_i(t-1)} \ge \mu_i + c_{t-1,T_i(t-1)}\}$ or $\{\mu^* < \mu_i + 2c_{t-1,T_i(t-1)}\}$. Therefore, we have \begin{align} &T_i(n)\nonumber\\ \le& \ell + \sum_{t=K+1}^n\mathbb{I}\{\bar{X}^*_{T^*(t-1)} + c_{t-1,T^*(t-1)} \le \bar{X}_{i,T_i(t-1)} + c_{t-1,T_i(t-1)}, T_i(t-1)\ge \ell \} \nonumber\\ \le& \ell +\sum_{t=K+1}^n [ \mathbb{I}\{\mu^* < \mu_i + 2c_{t-1,T_i(t-1)}, T_i(t-1)\ge \ell\} + \mathbb{I}\{\bar{X}^*_{T^*(t-1)} \le \mu^*- c_{t-1,T^*(t-1)}, T_i(t-1)\ge \ell\} \nonumber\\ & +\mathbb{I}\{\bar{X}_{i,T_i(t-1)} \ge \mu_i + c_{t-1,T_i(t-1)}, T_i(t-1)\ge \ell\} ] \label{eq:key}\\ \le& \ell + \sum_{t=K+1}^n \mathbb{I}\{\bar{X}^*_{T^*(t-1)} \le \mu^*- c_{t-1,T^*(t-1)}\} + \sum_{t=K+1}^n\mathbb{I}\{\bar{X}_{i,T_i(t-1)} \ge \mu_i + c_{t-1,T_i(t-1)}\} \nonumber\\ & + \sum_{t=K+1}^n\mathbb{I}\{\mu^* < \mu_i + 2c_{t-1,T_i(t-1)}, T_i(t-1)\ge \ell\} \nonumber\\ \le & \ell + \sum_{t=K+1}^n\sum_{s=1}^{t-1} \mathbb{I}\{\bar{X}^*_{s} \le \mu^*- c_{t-1,s}\} + \sum_{t=K+1}^n\sum_{s_i=1}^{t-1} \mathbb{I}\{\bar{X}_{i,s_i} \ge \mu_i + c_{t-1,s_i}\} \nonumber\\&+ \sum_{t=K+1}^n \mathbb{I}\{\mu^* < \mu_i + 2c_{t,T_i(t-1)}, T_i(t-1)\ge \ell\} \nonumber\\ \le & \ell + \sum_{t=1}^\infty\sum_{s=1}^{t} \mathbb{I}\{\bar{X}^*_{s} \le \mu^*- c_{t,s}\} + \sum_{t=1}^\infty\sum_{s_i=1}^{t} \mathbb{I}\{\bar{X}_{i,s_i} \ge \mu_i + c_{t,s_i}\} + \sum_{t=K+1}^n \mathbb{I}\{\mu^* < \mu_i + 2c_{t,T_i(t-1)}, T_i(t-1)\ge \ell\}. \nonumber \end{align} Derivation on Eq.~\eqref{eq:key} is the key. It uses fixed values $\mu^*$ and $\mu$ to separate two sets of random variables and their inequalities. The enumeration of the values of those random variables only comes after, where the original proof does the enumeration first,which has to be $t^2$ combinations. We set $c_{t,s}=\sqrt{\frac{(c+1)\ln t}{2s}}$, here $c>1$. This means the UCB algorithm should use adjustment term of $\sqrt{\frac{(c+1)\ln n}{2n_i}}$. Then by Chernoff bound, we have \begin{align*} \Pr[\bar{X}^*_{s} \le \mu^*- c_{t,s}] \le t^{-(c+1)} ,~~ \Pr[\bar{X}_{i,s_i} \ge \mu_i + c_{t,s_i}] \le t^{-(c+1)}. \end{align*} Set $\ell = \lceil (2(c+1)\ln n)/\Delta_i^2 \rceil$. Then when $t\le n$ and $T_i(t-1) \ge \ell$, $2c_{t,T_i(t-1)} \le 2 c_{t,\ell} \le \Delta_i=\mu^* - \mu_i$. Therefore, when $t\le n$, indicator $\mathbb{I}\{\mu^* < \mu_i + 2c_{t,T_i(t-1)}, T_i(t-1)\ge \lceil (2(c+1)\ln n)/\Delta_i^2 \rceil\}$ is always $0$. Hence, we have \begin{align*} &\mathbb{E}[T_i(n)] \\ \le& \left\lceil \frac{2(c+1)\ln n}{\Delta_i^2}\right\rceil + \sum_{t=1}^\infty\sum_{s=1}^{t} \Pr[\bar{X}^*_{s} \le \mu^*- c_{t,s}] + \sum_{t=1}^\infty\sum_{s_i=1}^{t} \Pr[\bar{X}_{i,s_i} \ge \mu_i + c_{t,s_i}] +\\& \sum_{t=K+1}^n \Pr\left[\mu^* < \mu_i + 2c_{t,T_i(t-1)}, T_i(t-1)\ge \left\lceil \frac{2(c+1)\ln n}{\Delta_i^2}\right\rceil\right] \\ \le &\left\lceil \frac{2(c+1)\ln n}{\Delta_i^2}\right\rceil + 2\sum_{t=1}^\infty\sum_{s=1}^{t} t^{-(c+1)} \le \frac{2(c+1)\ln n}{\Delta_i^2} + 1 + 2\cdot \zeta(c). \end{align*} Therefore, the regret bound is given by \begin{align*} &\sum_{i:\mu_i < \mu^*} \mathbb{E}[T_i(n)]\cdot\Delta_i \le \left[ 2(c+1) \sum_{i:\mu_i < \mu^*} \left( \frac{\ln n}{\Delta_i}\right)\right] + \left(1+2\cdot \zeta(c)\right)\left(\sum_{j=1}^{K} \Delta_j\right), \end{align*} with any $c>1$. The analysis in~\cite{AuerCF02} corresponds to the special case of $c=2$, for which we have the following bound. \begin{align*} &\sum_{i:\mu_i < \mu^*} \mathbb{E}[T_i(n)]\cdot\Delta_i \le \left[ 6 \sum_{i:\mu_i < \mu^*} \left( \frac{\ln n}{\Delta_i}\right)\right] + \left(1+\frac{\pi^2}{3}\right)\left(\sum_{j=1}^{K} \Delta_j\right). \end{align*} The constant coefficient of the leading term is reduced from $8$ to $6$. We can further choose any $c>1$ and reduce the coefficient to $2(c+1)$, making it arbitrarily close to $4$. \section{Introduction} Multi-armed bandit (MAB) is a problem extensively studied in statistics and machine learning. The classical version of the problem is formulated as a system of $m$ arms (or machines), each having an unknown distribution of the reward with an unknown mean. The task is to repeatedly play these arms in multiple rounds so that the total expected reward is as close to the reward of the optimal arm as possible. An MAB algorithm needs to decide which arm to play in the next round given the outcomes of the arms played in the previous rounds. The metric for measuring the effectiveness of an MAB algorithm is its {\em regret}, which is the difference in the total expected reward between always playing the optimal arm (the arm with the largest expected reward) and playing arms according to the algorithm. The MAB problem and its solutions reflect the fundamental tradeoff between exploration and exploitation: whether one should try some arms that have not been played much (exploration) or one should stick to the arms that provide good reward so far (exploitation). Existing results show that one can achieve a regret of $O(\log n)$ when playing arms in $n$ rounds, and this is asymptotically the best possible. In many real-world applications, the setting is not the simple MAB one, but has a combinatorial nature among multiple arms and possibly non-linear reward functions. For example, consider the following online advertising scenario. A web site contains a set of web pages and has a set of users visiting the web site. An advertiser wants to place an advertisement on a set of selected web pages on the site, and due to his budget constraint, he can select at most $k$ web pages. Each user visits a certain set of pages, and each visited page has one click-through probability for each user clicking the advertisement on the page, but the advertiser does not know these probabilities. The advertiser wants to repeatedly select sets of $k$ web pages, observe the click-through data collected to learn the click-through probabilities, and maximize the number of users clicking his advertisement over time. There are several new challenges raised by the above example. First, page-user pairs can be viewed as arms, but they are not played in isolation. Instead, these arms form certain combinatorial structures, namely bipartite graphs, and in each round, a set of arms (called a {\em super arm}) are played together. Second, the reward structure is not a simple linear function of the outcomes of all played arms but takes a more complicated form. In the above example, for all page-user pairs with the same user, the collective reward of these arms is either $1$ if the user clicks the advertisement on at least one of the pages, or $0$ if the user does not click the advertisement on any page. Third, even the offline optimization problem when the probabilities on all edges of the bipartite graph are known is still an NP-hard problem. Thus, the online learning algorithm needs to deal with combinatorial arm structures, nonlinear reward functions, and computational hardness of the offline optimization task. Consider another example of viral marketing in online social networks. In an online social network such as Facebook, companies carry out viral marketing campaigns by engaging with a certain set of seed users (e.g. providing free sample products to seed users), and hoping that these seed users could generate a cascade in the network promoting their products. The cascades follow certain stochastic diffusion model such as the independent cascade model \citep{kempe03}, but the influence probabilities on edges are not known in advance and have to be learned over time. Thus, the online learning task is to repeatedly select seed nodes in a social network, observe the cascading behavior of the viral information to learn influence probabilities between individuals in the social network, with the goal of maximizing the overall effectiveness of all viral cascades. Similar to the online advertising example given above, we can treat each edge in the social network as a base arm, and all outgoing edges from a seed set as a super arm, which is the unit of play. Besides sharing the same challenges such as the combinatorial arm structures, nonlinear reward functions, and computational hardness of the offline maximization task, this viral marketing task faces another challenge: in each round after some seed set is selected, the cascade from the seed set may probabilistically trigger more edges (or arms) in the network, and the reward of the cascade depends on all probabilistically or deterministically triggered arms. A naive way to tackle both examples above is to treat every super arm as an arm and simply apply the classical MAB framework to solve the above combinatorial problems. However, such naive treatment has two issues. First, the number of super arms may be exponential to the problem instance size due to the combinatorial explosion, and thus classical MAB algorithms may need exponential number of steps just to go through all the super arms once. Second, after one super arm is played, in many cases, we can observe some information regarding the outcomes of the underlying arms, which may be shared by other super arms. However, this information is discarded in the classical MAB framework, making it less effective. In this paper, we define a general framework for the {\em combinatorial multi-armed bandit (CMAB)} problem to address the above issues and cover a large class of combinatorial online learning problems in the stochastic setting, including the two examples given above. In the CMAB framework, we have a set of $m$ base arms, whose outcomes follow certain unknown joint distribution. A super arm $S$ is a subset of base arms. In each round, one super arm is played and all base arms contained in the super arm are played. To accommodate applications such as viral marketing, we allow that the play of a super arm $S$ may further trigger more base arms probabilistically, and the triggering depends on the outcomes of the already played base arms in the current round. The reward of the round is determined by the outcomes of all triggered arms, which are observed as the feedback to the online learning algorithm. A CMAB algorithm needs to use these feedback information from the past rounds to decide the super arm to play in the next round. The framework allows an arbitrary combination of arms into super arms. The reward function only needs to satisfy two mild assumptions \chgins{(referred to as monotonicity and bounded smoothness)}, and thus covering a large class of nonlinear reward functions. We do not assume the direct knowledge on how super arms are formed from underlying arms or how the reward is computed. Instead, we assume the availability of an offline computation oracle that takes such knowledge as well as the expectations of outcomes of all arms as input and computes the optimal super arm with respect to the input. Since many combinatorial problems are computationally hard, we further allow (randomized) approximation oracles with failure probabilities. In particular, we relax the oracle to be an $(\alpha,\beta)$-approximation oracle for some $\alpha,\beta \le 1$, that is, with success probability $\beta$, the oracle could output a super arm whose expected reward is at least $\alpha$ fraction of the optimal expected reward. As a result, our regret metric is not comparing against the expected reward of playing the optimal super arm each time, but against the $\alpha\beta$ fraction of the optimal expected reward, since the offline oracle can only guarantee this fraction in expectation. We refer to this as the {\em $(\alpha,\beta)$-approximation regret}. For the general framework, we provide the CUCB (combinatorial upper confidence bound) algorithm, an extension to the UCB1 algorithm for the classical MAB problem~\citep{AuerCF02}. We provide a rigorous analysis on the distribution-dependent regret of CUCB and show that it is still bounded by $O(\log n)$. Our analysis further allows us to provide a distribution-independent regret bound that works for arbitrary distributions of underlying arms, for a large class of CMAB instances. For the extension accommodating probabilistically triggered arms, we also provide distribution-dependent and -independent bounds with triggering probabilities as parameters. We then apply our framework and provide solutions to two new bandit applications, the probabilistic maximum coverage problem for advertisement placement and social influence maximization for viral marketing. The offline versions of both problems are NP-hard, with constant approximation algorithms available. Both problems have nonlinear reward structures that cannot be handled by any existing work. We also apply our result to combinatorial bandits with linear rewards, recently studied by~\cite{Yi2012}. We show that we significantly improve their distribution-dependent regret bound, even though we are covering a much larger class of combinatorial bandit instances. We also provide new distribution-independent bound not available in~\citep{Yi2012}. This paper is an extension to our ICML'13 paper \citep{CWY13}, with explicit modeling of probabilistically triggered arms and their regret analysis for the CUCB algorithm. We correct an erroneous claim in \citep{CWY13}, which states that the original CMAB model and result without probabilistically triggered arms can be applied to the online learning task for social influence maximization. Our correction includes explicit modeling of probabilistically triggered arms in the CMAB framework, and significant reworking of the regret analysis to incorporate triggering probabilities in the analysis and the regret bounds. In summary, our contributions include: (a) defining a general CMAB framework that encompasses a large class of nonlinear reward functions, (b) providing CUCB algorithm with a rigorous regret analysis as a general solution to this CMAB framework, (c) further generalizing our framework to accommodate probabilistically triggered base arms, and applying this framework to the social influence maximization problem, and (d) demonstrating that our general framework can be effectively applied to a number of practical combinatorial bandit problems, including ones with nonlinear rewards. Moreover, our framework provides a clean separation of the online learning task and the \mbox{offline} computation task: the oracle takes care of the offline computation task, which uses the domain knowledge of the problem instance, while our CMAB algorithm takes care of the online learning task, and is oblivious to the domain knowledge of the problem instance. \paragraph{Related work.} Multi-armed bandit problem has been well studied in the literature, in particular in statistics and reinforcement learning \citep[cf.][]{BF85,SB98}. Our work follows the line of research on stochastic MAB problems, which is initiated by \cite{LaiRobbins85}, who show that under certain conditions on reward distributions, one can achieve a tight asymptotic regret of $\Theta(\log n)$, where $n$ is the number of rounds played. Later, \cite{AuerCF02} demonstrate that $O(\log n)$ regret can be achieved uniformly over time rather than only asymptotically. They propose several MAB algorithms, including the UCB1 algorithm, which has been widely followed and adapted in MAB research. For combinatorial multi-armed bandits, a few specific instances of the problem has been studied in the literature. A number of studies consider simultaneous plays of $k$ arms among $m$ arms \citep[e.g.][]{AVW87a,CG07,LiuLZ11}. Other instances include the matching bandit~\citep{GaiKJ10} and the online shortest path problem~\citep{Liu2012}. The work closest to ours is a recent work by \cite{Yi2012}, which also considers a combinatorial bandit framework with an approximation oracle. However, our work differs from theirs in several important aspects. Most importantly, their work only considers linear rewards while our CMAB framework includes a much larger class of linear and nonlinear rewards. Secondly, our regret analysis is much tighter, and as a result we significantly improve their distribution-dependent regret bound when applying our result to the linear reward case, and we are able to derive a distribution-independent regret bound close to the theoretical lower bound while they do not provide distribution-independent bounds. Moreover, we allow the approximation oracle to have a failure probability (i.e., $\beta < 1$), while they do not consider such failure probabilities. In terms of types of feedbacks in combinatorial bandits~\citep{Audibert2011}, our work belongs to the {\em semi-bandit} type, in which the player observes only the outcomes of played arms in one round of play. Other types include (a) {\em full information}, in which the player observes the outcomes of all arms, and (b) {\em bandit}, in which the player only observes the final reward but no outcome of any individual arm. More complicated feedback dependences are also considered by~\cite{Mannor2011}. \chgins{ Bounded smoothness property in our paper is an extended form of Lipschitz condition, but our model and results differ from the Lipschitz bandit research \citep{Bobby1} in several aspects. First, Lipschitz bandit considers a continuous metric space where every point is an arm, and the Lipschitz condition is applied to two points (i.e., two arms). Under this assumption, if we know one arm pretty well, we will also know the nearby arms pretty well. In contrast, our bounded smoothness condition is applied to a vector of mean values of the base arms instead of one super arm, and by knowing one super arm well, we cannot directly know how good are the other super arms. Second, the feedback model is different: Lipschitz bandit assumes bandit feedback model while our CMAB assumes semi-bandit feedback. Third, using the Lipschitz condition, they designed a new algorithm called zooming algorithm, which maintains a confidence radius of arms, so that by knowing the center arm well, they are also pretty confident of the arms within the confidence radius of the center. In comparison, our algorithm is basically a direct extension of the classical UCB algorithm, in which the confidence radius is used to get confidence on the estimate of every base arm.} \chgins{ \cite{Bobby1} generalize the setting of continuum bandits, which assumes the strategy set is a compact subset of $\mathbb{R}^d$ and the reward function satisfies the Lipschitz condition, see e.g. \citep{continuum2, continuum1}. } A different line of research considers {\em adversarial multi-armed bandit}, initiated by \cite{AuerCFS02}, \chgins{ in which no probabilistic assumptions are made about the rewards, and they can even be chosen by an adversary. } In the context of adversarial bandits, several studies also consider combinatorial bandits~\citep{CL09,Audibert2011,Bubeck12}. For linear rewards, \cite{Kakade2009} have shown how to convert an approximation oracle into an online algorithm with sublinear regret both in the full information setting and the bandit setting. For non-linear rewards, various online submodular optimization problems with bandit feedback are studied in the adversarial setting~\citep{Streeter2008, Radlinski2008, Streeter2009, Hazan2009}. Notice that our framework deals with stochastic instances and we can handle reward functions more general than the submodular ones. This paper is the full version of our ICML'13 paper \citep{CWY13} with the extension to include probabilistically triggered arms in the model and analysis. We made a mistake in \citep{CWY13} by claiming that the online learning task for social influence maximization is an instance of the original CMAB model proposed in \citep{CWY13} without explicitly modeling probabilistically triggered arms. In this paper we correct this mistake by allowing probabilistically triggered arms in the CMAB model, and by significantly revising the analysis to include triggering probabilities in the analysis and the regret bounds. Since our work in \citep{CWY13}, several studies are also related to combinatorial multi-armed bandits or in general combinatorial online learning. \cite{QinCZ14} extend CMAB to contextual bandits and apply it to diversified online recommendations. \cite{LAKLC14} address combinatorial actions with limited feedbacks. \cite{GMM14} use Thompson sampling method to tackle combinatorial online learning problems. Comparing with our CMAB framework, they allow more feedback models than our semi-bandit feedback model, but they require finite number of actions and observations, their regret contains a large constant term, and it is unclear if their framework supports approximation oracles for hard combinatorial optimization problems. \cite{KWAEE14} study linear matroid bandits, which is a subclass of the linear combinatorial bandits we discussed in Section~\ref{sec:linear}, and they provide better regret bounds than our general bounds given in Section~\ref{sec:linear}, because their analysis utilizes the matroid combinatorial structure. \chgins{In a latest paper \cite{KWAS15} improve the regret bounds of the linear combinatorial bandits via a more sophisticated non-uniform sufficient sampling condition than the one we used in our paper. However, it is unclear if this technique can be applied to non-linear reward functions satisfying the bounded smoothness condition (see discussions in Section~\ref{sec:linear} for more details).} \paragraph{Paper organization.} In Section~\ref{sec:model} we formally define the CMAB framework. Section~\ref{sec:alg} provides the CUCB algorithm and the main results on its regret bounds and the proofs. Section~\ref{sec:app} shows how to apply the CMAB framework and CUCB algorithm to the online advertising and viral marketing applications, as well as the class of combinatorial bandits with linear reward functions. We conclude the paper in Section~\ref{sec:conclude}. \vspace{0pt} \section{General CMAB Framework} \label{sec:model} A {\em combinatorial multi-armed bandit (CMAB)} problem consists of $m$ {\em base arms} associated with a set of random variables $X_{i,t}$ for $1\leq i\leq m$ and $t\geq 1$, with bounded support on $[0,1]$. Variable $X_{i,t}$ indicates the random outcome of the $i$-th base arm in its $t$-th trial. The set of random variables $\{X_{i,t} \mid t \geq 1\}$ associated with base arm $i$ are independent and identically distributed according to some unknown distribution with unknown expectation $\mu_i$. Let ${\boldsymbol \mu} = (\mu_1,\mu_2,\ldots, \mu_m)$ be the vector of expectations of all base arms. Random variables of different base arms may be dependent. The unit of play in CMAB is a {\em super arm}, which is a set of base arms. Let $\cal S$ denote the set of all possible super arms that can be played in a CMAB problem instance. For example, $\cal S$ could be the set of all subsets of base arms containing at most $k$ base arms. In each round, one of the super arms $S \in {\cal S}$ is selected and played, and every base arm $i\in S$ are triggered and played as a result. The outcomes of base arms in $S$ may trigger other base arms not in $S$ to be played, and the outcomes of these arms may further trigger more arms to be played, and so on. Therefore, when super arm $S$ is played in round $t$, a superset of $S$ is triggered and played, and the final reward of this round depends on the outcomes of all triggered base arms. The feedback in the round after playing super arm $S$ is the outcomes of the triggered (played) base arms. The random outcomes of triggered base arms in one round are independent of random outcomes in other rounds, but they may depend on one another in the same round. For each $i\in [m]$, let $p_i^S$ denote the probability that base arm $i$ is triggered when super arm $S$ is played. Once super arm $S$ is fixed, the event of triggering of base arm $i$ is independent of the history of previous plays of super arms. It is clear that for all $i\in S$, $p_i^S = 1$. Note that probability $p_i^S$ may not be known to the learning algorithm, since the event of triggering base arm $i$ may depend on the random outcomes of other base arms, the distribution of which may be unknown. Moreover, the triggering of base arms may depend on certain combinatorial structure of the problem instance, and triggering of different base arms may not be independent from one another (for an example, see the social influence maximization application in Section~\ref{sec:infmax}). Let $\trig{S} = \{i \in [m]\,|\, p_i^S > 0 \}$ denote the set of possibly triggered base arms by super arm $S$, also referred to as the {\em triggering set} of $S$. Let $p_i\triangleq \min_{S\in {\cal S}, i\in \trig{S}} p_i^{S}$ denote the minimum nonzero triggering probability of base arm $i$ under all super arms. When $p_i=1$ for all $i\in [m]$, each super arm $S$ deterministically triggers all base arms in $\trig{S}$, in which case we treat $S$ and $\trig{S}$ as the same set. \chgred{Let $p^* \triangleq \min_{i\in [m]} p_i$.} \chgins{ In our model, it is possible that a base arm $i$ does not belong to any super arm, and thus $i$ can only be probabilistically triggered. In fact, our model is flexible enough to allow that {\em all} based arms are probabilistically triggered. To do so, we can simply add a set of dummy base arms and dummy super arms for the purpose of probabilistically triggering real base arms. In particular, for each real base arm $i$, we can add a dummy base arm $d_i$, which is a Bernoulli random variable with $1$ meaning $i$ is triggered and $0$ meaning $i$ is not triggered. Then a dummy super arm containing a subset of these Bernoulli dummy base arms can be used to probabilistically trigger a set of real base arms. If all super arms are such dummy super arms, then all real base arms are only probabilistically triggered. } For each arm $i\in [m]$, let $T_{i,t}$ denote the number of times arm $i$ has been successfully triggered after the first $t$ rounds in which $t$ super arms are played. If an arm $i \in \trig{S}\setminus S$ is not triggered in round $t$ when super arm $S$ is played, then $T_{i,t} = T_{i,t-1}$. Let $R_t(S)$ be a non-negative random variable denoting the reward of round $t$ when super arm $S$ is played. The reward depends on the actual problem instance definition, the super arm $S$ played, and the outcomes of all triggered arms in round $t$. The reward $R_t(S)$ might be as simple as a summation of the outcomes of the triggered arms in $S$: $R_t(S) = \sum_{i\in \trig{S}, i \mathrm{~is~triggered}}X_{i,T_{i,t}}$, but our framework allows more sophisticated nonlinear rewards, as explained below. In this paper, we consider CMAB problems in which the expected reward of playing any super arm $S$ in any round $t$, $\mathbb{E}[R_t(S)]$, is a function of $S$ and the expectation vector ${\boldsymbol \mu}$ of all arms. For the linear reward case as given above together with no probabilistic triggering ($S=\trig{S}$), this is true because linear addition is commutative with the expectation operator. For non-linear reward functions not commutative with the expectation operator, it is still true if we know the type of distributions and only the expectations of arm outcomes are unknown. For example, the distribution of $X_{i,t}$'s are known to be independent $0$-$1$ Bernoulli random variables with unknown mean $\mu_i$.\chgins{\footnote{\chgins{It is also possible that the Bernoulli random variables are not independent. For example, the joint distribution is determined by sampling a random value $\rho\in [0,1]$ uniformly at random, and then each base arm $i$ takes value $1$ if any only if $\rho \le \mu_i$.}}} Henceforth, we denote the expected reward of playing $S$ as $r_{\boldsymbol \mu}(S)\triangleq \mathbb{E}[R_t(S)]$. \begin{mydef}[Assumptions on expected reward function] \label{def:assumptions} To carry out our analysis, we make the following two mild assumptions on the expected reward $r_{\boldsymbol \mu}(S)$: \begin{itemize} \item {\bf Monotonicity}. The expected reward of playing any super arm $S\in \mathcal{S}$ is monotonically nondecreasing with respect to the expectation vector, i.e., if for all $i\in [m]$, $\mu_i \leq \mu_i' $, we have $r_{{\boldsymbol \mu}}(S) \leq r_{{\boldsymbol \mu}'}(S)$ for all $S\in \mathcal{S}$. \item {\bf Bounded smoothness.} There exists a continuous, strictly increasing (and thus invertible) function $f(\cdot)$ with $f(0)=0$, called {\em bounded smoothness function}, such that for any two expectation vectors ${\boldsymbol \mu}$ and ${\boldsymbol \mu}'$ and for any $\Lambda > 0$, we have $|r_{{\boldsymbol \mu}}(S) - r_{{\boldsymbol \mu}'}(S)| \leq f(\Lambda)$ if $\max_{i\in \trig{S}}|\mu_i - \mu_i'|\le \Lambda$. \end{itemize} \end{mydef} Both assumptions are natural. In particular, they hold true for all the applications we considered. \chgins{We remark that bounded smoothness is an extended form of Lipschitz condition in that we use a general function $f$ instead of linear or power-law functions typically used in Lipschitz condition definition, and we use infinity norm instead of typically used $L_2$ norm.} \begin{mydef}[CMAB algorithm] A CMAB algorithm $A$ is one that selects the super arm of round $t$ to play based on the outcomes of revealed arms of previous rounds, without knowing the expectation vector ${\boldsymbol \mu}$. Let $S^A_t \in {\cal S}$ be the super arm selected by $A$ in round $t$. Note that $S^A_t$ is a random super arm that depends on the outcomes of arms in previous rounds and potential randomness in the algorithm $A$ itself. The objective of algorithm $A$ is to maximize the expected reward of all rounds up to a round $n$, that is, $\mathbb{E}_{S,R}[\sum_{t=1}^n R_t(S^A_t)]=\mathbb{E}_S[\sum_{t=1}^n r_{\boldsymbol \mu}(S^A_t)]$, where $\mathbb{E}_{S,R}$ denotes taking expectation among all random events generating the super arms $S^A_t$'s and generating rewards $R_t(S^A_t)$'s, and $\mathbb{E}_S$ denotes taking expectation only among all random events generating the super arms $S^A_t$'s. \end{mydef} We do not assume that the learning algorithm has the direct knowledge about the problem instance, e.g. how super arms are formed from the base arms, how base arms outside of a super arm are triggered, and how reward is defined. Instead, the algorithm has access to a computation oracle that takes the expectation vector ${\boldsymbol \mu}$ as the input, and together with the knowledge of the problem instance, computes the optimal or near-optimal super arm $S$. Let ${\mathrm{opt}}_{\boldsymbol \mu} = \max_{S\in \mathcal{S}}r_{\boldsymbol \mu}(S)$ and $S_{\boldsymbol \mu}^* = \operatornamewithlimits{argmax}_{S\in \mathcal{S}}r_{\boldsymbol \mu}(S)$. We consider the case that exact computation of $S_{\boldsymbol \mu}^*$ may be computationally hard, and the algorithm may be randomized with a small failure probability. Thus, we resolve to the following {\em $(\alpha,\beta)$-approximation oracle}: \begin{mydef}[$(\alpha,\beta)$-Approximation oracle] For some $\alpha,\beta \le 1$, $(\alpha,\beta)$-approximation oracle is an oracle that takes an expectation vector ${\boldsymbol \mu}$ as input, and outputs a super arm $S\in \mathcal{S}$, such that $\Pr[r_{{\boldsymbol \mu}}(S) \geq {\alpha} \cdot {\mathrm{opt}}_{{\boldsymbol \mu}}]\geq \beta$. Here $\beta$ is the success probability of the oracle. \end{mydef} Many computationally hard problems do admit efficient approximation oracles~\citep{Vazirani04}. With an $(\alpha,\beta)$-approximation oracle, it is no longer fair to compare the performance of a CMAB algorithm against the optimal reward ${\mathrm{opt}}_{\boldsymbol \mu}$ as the regret of the algorithm. Instead, we compare against the $\alpha\cdot\beta$ fraction of the optimal reward, because only a $\beta$ fraction of oracle computations are successful, and when successful the reward is only an $\alpha$-approximation of the optimal value. \begin{mydef}[$(\alpha,\beta)$-approximation regret] \label{def:regretdef} $(\alpha,\beta)$-approximation regret of a CMAB algorithm $A$ after $n$ rounds of play using an $(\alpha,\beta)$-approximation oracle under the expectation vector ${\boldsymbol \mu}$ is defined as \begin{equation} Reg^A_{{\boldsymbol \mu},\alpha,\beta}(n) = n \cdot \alpha \cdot \beta\cdot {\mathrm{opt}}_{{\boldsymbol \mu}} - \mathbb{E}_S\left[ \sum_{t=1}^n r_{\boldsymbol \mu}(S^A_t)\right]. \end{equation} \end{mydef} Note that the classical MAB problem is a special case of our general CMAB problem, in which (a) the constraint $\mathcal{S} = \{\{i\}\,|\, i\in [m]\}$ so that each super arm is just a base arm; (b) $S = \trig{S}$ for all super arm $S$, that is, playing of a base arm does not trigger any other arms; (c) the reward of a super arm $S=\{i\}$ in its $t$'s trial is its outcome $X_{i,t}$; (d) the monotonicity and bounded smoothness hold trivially with function $f(\cdot)$ being the identity function; and (e) the $(\alpha,\beta)$-approximation oracle is simply the $\operatornamewithlimits{argmax}$ function among all expectation vectors, with $\alpha=\beta=1$. \vspace{0pt} \section{CUCB Algorithm for CMAB} \label{sec:alg} \begin{algorithm}[t] \centering \caption{CUCB with computation oracle. \label{alg:oracleucb} } \label{algorithmoracle} \begin{algorithmic}[1] \STATE For each arm $i$, maintain: (1) variable $T_{i}$ as the total number of times arm $i$ is played so far\chgins{, initially $0$}; (2) variable $\hat \mu_{i}$ as the mean of all outcomes $X_{i,*}$'s of arm $i$ observed so far\chgins{, initially $1$}. \chgins{ \STATE $t \leftarrow 0$.} \WHILE {\TRUE} \STATE $t \leftarrow t+1$. \STATE For each arm $i$, \chgins{set $\bar{\mu}_{i}=\min\left \{\hat{\mu}_{i} + \sqrt{\frac{ 3\ln t}{2T_{i}}},1\right \}$}. \label{alg:adjustCUCB} \STATE \label{alg:selectsarm} $S = \mathrm{Oracle}(\bar{\mu}_{1}, \bar{\mu}_{2},\ldots, \bar{\mu}_{m})$. \STATE Play $S$, observe outcomes of played base arms $i$, and update all $T_{i}$'s and $\hat \mu_{i}$'s. \ENDWHILE \end{algorithmic} \end{algorithm} We present our CUCB algorithm in Algorithm~\ref{alg:oracleucb}. We maintain an empirical mean $\hat \mu_i$ for each arm $i$. More precisely, if arm $i$ has been played $s$ times by the end of round $n$, then the value of $\hat \mu_i$ at the end of round $n$ is $(\sum_{j=1}^{s}X_{i,j})/s$. The actual expectation vector $\bar{{\boldsymbol \mu}}$ given to the oracle contains an adjustment term $\sqrt{\frac{3\ln t}{2T_{i}}}$ for each $\hat \mu_i$, which depends on the round number $t$ and the number of times arm $i$ has been played (stored in variable $T_{i}$). Then we simply play the super arm returned by the oracle and update variables $T_{i}$'s and $\hat \mu_i$'s accordingly. Note that in our model all arms have bounded support on $[0,1]$, but with the adjustment \chgins{the upper confidence bound $\hat{\mu}_{i} + \sqrt{\frac{3\ln t}{2T_{i}}}$ may exceed $1$, in which case we simply trim it down to $1$ and assign it to $\bar{\mu}_i$ (line~\ref{alg:adjustCUCB}).} \chgins{ Our algorithm does not have an initialization phase where all base arms are played at least once. This is to accommodate the case where some base arms may only be probabilistically triggered and there is no super arm that can trigger them deterministically. Instead, we simply initialize the counter $T_i$ to $0$ and $\hat{\mu}_i$ to $1$ for every base arm $i$. Thus initially $\bar{\mu}_i=1$ for all $i$, and the oracle will select a super arm given an all-one vector input. Intuitively, any base arm $i$ that has not been played will have its $\bar{\mu}_i=1$, which should let the oracle be biased toward playing a super arm that (likely) triggers $i$. It may be possible that a base arm $i$ is never played, and this only means that $i$ is not important for the optimization task and the oracle decides not to play it (deterministically or probabilistically). Our analysis works correctly without the initialization phase. } We now provide necessary definitions for the main theorems. \begin{mydef}[Bad super arm] \label{def:badsuperarm} A super arm $S$ is {\em bad} if $r_{\boldsymbol \mu}(S) < \alpha \cdot {\mathrm{opt}}_{\boldsymbol \mu}$. The set of bad super arms is defined as $\mathcal{S}_{{\mathrm{B}}} \triangleq \{ S\,\mid \, r_{{\boldsymbol \mu}}(S) < \alpha \cdot {\mathrm{opt}}_{{\boldsymbol \mu}}\}$. For a given base arm $i\in [m]$, let $\mathcal{S}_{i,{\mathrm{B}}} = \{ S \in \mathcal{S}_{{\mathrm{B}}} \,|\, i \in \trig{S} \}$ be the set of bad super arms whose triggering sets contain $i$. We sort all bad super arms in $\mathcal{S}_{i,{\mathrm{B}}}$ as $S_{i,{\mathrm{B}}}^1, S_{i,{\mathrm{B}}}^2, \ldots, S_{i,{\mathrm{B}}}^{K_i}$, in increasing order of their expected rewards, where $K_i = |\mathcal{S}_{i,{\mathrm{B}}}|$. Note that when $K_i=0$, there is no bad super arm that can trigger base arm $i$. \end{mydef} \begin{mydef}[$\Delta$ of bad super arms]\label{def:delta} For a bad super arm $S \in \mathcal{S}_{{\mathrm{B}}} $, we define $\Delta_S \triangleq \alpha \cdot {\mathrm{opt}}_{{\boldsymbol \mu}} - r_{{\boldsymbol \mu}}(S)$. For a given base arm $i\in [m]$ with $K_i>0$ and index $j \in [K_i]$, we define \begin{equation*} \label{eqn:deltaij} \Delta^{i,j} \triangleq \Delta_{S_{i,{\mathrm{B}}}^j}. \end{equation*} We have special notations for the minimum and the maximum $\Delta^{i,j}$ for a fixed $i$ with $K_i>0$: \begin{align*} \Delta_{\max}^i &\triangleq \Delta^{i,1},\\ \Delta_{\min}^i &\triangleq \Delta^{i, K_i}. \end{align*} Furthermore, define $\Delta_{\max}\triangleq \max_{i\in [m], K_i>0} \Delta_{\max}^i$, $\Delta_{\min}\triangleq\min_{i\in [m], K_i>0} \Delta_{\min}^i$. \end{mydef} Our main theorem below provides the distribution-dependent regret bound of the CUCB algorithm using the $\Delta$ notations. We use $\mathbb{I}\{\cdot\}$ to denote the indicator function, and $\mathbb{I} \{{\cal E}\} = 1$ if $\cal E$ is true, and $0$ if $\cal E$ is false. \begin{mythm} \label{thm:cucb individual} The $(\alpha,\beta)$-approximation regret of the CUCB algorithm in $n$ rounds using an $(\alpha,\beta)$-approximation oracle is at most \begin{align} &\sum_{i\in [m], K_i>0} \left( \ell_n(\Delta^i_{\min},p_i) \Delta^i_{\min} + \int_{\Delta^i_{\min}}^{\Delta^i_{\max}} \ell_n(x,p_i) \mathrm{d}x \right ) + \chgred{\left(\frac{(2+\mathbb{I}\{p^* < 1\})\pi^2}{6} +1\right)\cdot m \cdot \Delta_{\max}}, \label{eqn:detailed regret bound} \end{align} where \chgred{$p^* = \min_{i\in [m]} p_i$, and } \chgred{ \begin{equation*} \ell_n(\Delta,p)= \left\{ \begin{array}{lr} \max\left (\frac{12\cdot \ln n}{(f^{-1}(\Delta))^2\cdot p}, \frac{24\cdot \ln n}{p} \right ), & \textrm{if~} 0<p<1,\\ \frac{6\ln n}{(f^{-1}(\Delta))^2},& \textrm{if~} p=1. \end{array} \right. \end{equation*}} and $f(\cdot)$ is the bounded smoothness function. \end{mythm} \chgred{Note that when $p_i=1$ for all $i\in [m]$, each super arm $S$ deterministically triggers base arms in $S$ and no probabilistic triggering of other arms. In this case, the above theorem falls back to Theorem 1 of \cite{CWY13}. When $p_i<1$ for some $i\in [m]$, the regret bound is slightly more complicated, in particular, it has an extra factor of $1/p_i$ appearing in the leading $\ln n$ term.} In Theorem~\ref{thm:cucb individual}, when $\Delta^i_{\min}$ is extremely small, the regret would be approaching infinity. Below we prove a distribution-independent regret for arbitrary distributions with support in $[0,1]$ on all arms, for a large class of problem instances with a polynomial bounded smoothness function $f(x) = \gamma x^\omega$ for $\gamma > 0$ and $ 0< \omega \leq 1$. The rough idea of the proof is, if $\Delta^i_{\min}\leq 1/\sqrt n$, it can only contribute $\sqrt n$ regret at time horizon $n$. The proof of the following theorem relies on the tight regret bound of Theorem~\ref{thm:cucb individual} on the leading $\ln n$ term. \def\thmworst{ Consider a CMAB problem with an $(\alpha,\beta)$-approximation oracle. Let $p^* = \min_{i\in [m]} p_i$. If the bounded smoothness function $f(x) = \gamma \cdot x^\omega$ for some $\gamma >0$ and $\omega\in (0,1]$, the regret of CUCB is at most: \[ \left\{ \begin{array}{lr} \frac{2\gamma}{2-\omega}\cdot (6m\ln n)^{\omega/2} \cdot n^{1-\omega/2}+ \left(\frac{\pi^2}{3}+1\right)\cdot m \cdot \Delta_{\max}, & \textrm{if~} p^*=1,\\ \frac{2\gamma}{2-\omega}\cdot \left(\frac{12m\ln n}{p^*}\right)^{\omega/2} \cdot n^{1-\omega/2}+ \left(\chgred{\frac{\pi^2}{2}}+1\right)\cdot m \cdot \Delta_{\max} + \sum_{i\in [m]} \chgred{\frac{24\ln n}{p_i} } \cdot \Delta_{\max}, & \textrm{if~} 0<p^*<1.\\ \end{array} \right. \]} \begin{mythm} \label{thm:worstbound} {\thmworst} \end{mythm} Note that for all applications discussed in Section~\ref{sec:app}, we have $\omega=1$. For the classical MAB setting with $\omega=1$ and $p^* = 1$, we obtain a distribution-independent bound of $O(\sqrt{mn\ln n})$, which matches (up to a logarithmic factor) the original UCB1 algorithm~\citep{Audibert2009}. In the linear combinatorial bandit setting, i.e., semi-bandit with $L_\infty$ assumption in~\cite{Audibert2011}, our regret is $O(\sqrt{m^3n\log n})$, which is a factor $\sqrt{m}$ off the optimal bound in the adversarial setting, \chgins{a more general setting than the stochastic setting (see the discussion in the end of Section~\ref{sec:linear} for a reason of this gap)}. \subsection{Proof of the Theorems} \subsubsection{Proof of Theorem~\ref{thm:cucb individual}} Before getting to the proof of our theorem, we need more definitions and lemmas. First, we have a convenient notation for the case when the oracle outputs non-$\alpha$-approximation answers. \begin{mydef}[Non-$\alpha$-approximation output] \label{def:nonalphaoutput} In the $t$-th round, let $F_t$ be the event that the oracle fails to produce an $\alpha$-approximate answer with respect to its input $\bar{{\boldsymbol \mu}}=(\bar{\mu}_{1}, \bar{\mu}_{2},\ldots, \bar{\mu}_{m})$. We have $\Pr[F_t]=\mathbb{E}[\mathbb{I}\{F_t\}]\leq 1-\beta$. \end{mydef} Since the value of many variables are changing in different rounds, we also define notations for their value in round $t$. All of them are random variables. \begin{mydef}[Variables in round $t$] For variable $T_i$, let $T_{i,t}$ be the value of $T_i$ at the end of round $t$, that is, $T_{i,t}$ is the number of times arm $i$ is played in the first $t$ rounds. For variable $\hat \mu_i$, let $\hat \mu_{i,s}$ be the value of $\hat \mu_i$ after arm $i$ is played $s$ times, that is, $\hat \mu_{i,s} = (\sum_{j=1}^{s} X_{i,j})/s$, where $X_{i,j}$ is the outcome of base arm $i$ in its $j$-th trial, as defined at the beginning of Section~\ref{sec:model}. Then, the value of variable $\hat \mu_i$ at the end of round $t$ is $\hat \mu_{i,T_{i,t}}$. For variable $\bar \mu_i$, let $\bar \mu_{i,t}$ be the value of $\bar \mu_i$ at the end of round $t$. \end{mydef} Next, we introduce an important parameter in our proof called sampling threshold. \chgred{ \begin{mydef}[Sampling threshold] \label{def:samplthreshold} For a probability value $p\in (0,1]$ and reward difference value $\Delta \in \mathbb{R}^+$, the value $\ell_n(\Delta,p)$ defined below is called the {\em sampling threshold} for round $n$: \begin{equation*} \ell_n(\Delta,p)= \left\{ \begin{array}{lr} \max\left (\frac{12\cdot \ln n}{(f^{-1}(\Delta))^2\cdot p}, \frac{24\cdot \ln n}{p} \right ), & \textrm{if~} 0<p<1,\\ \frac{6\ln n}{(f^{-1}(\Delta))^2},& \textrm{if~} p=1. \end{array} \right. \end{equation*} \end{mydef} } Informally, base arm $i\in [m]$ at round $n$ is considered as sufficiently sampled if the number of times $i$ has been played by round $n$, $T_{i,n}$, is above its sampling threshold $\ell_n(\Delta^i_{\min},p_i)$. When all base arms are sufficiently sampled, with high probability we would obtain accurate estimates of their sample means and would be able to distinguish the $\alpha$-approximate super arms from bad super arms. \chgred{ We utilize the following well known tail bounds in our analysis. \begin{myfact}[Hoeffding's Inequality \citep{hoeffding63}]\label{fact:hoeffding} Let $X_1, \cdots , X_n$ be independent and identically distributed random variables with common support $[0,1]$ and mean $\mu$. Let $Y=X_1+\cdots+X_n$. Then for all $\chgins{\delta} \geq0$, \[\Pr\{|Y-n\mu|\geq \chgins{\delta} \} \leq 2e^{-2\chgins{\delta}^2/n}. \] \end{myfact} \begin{myfact}[Multiplicative Chernoff Bound \citep{MU05}\footnote{\chgred{The result in \citep{MU05} (Theorem 4.5 together with Excercise 4.7) only covers the case where random variables $X_i$'s are independent. However the result can be easily generalized to our case with an almost identical proof. The only main change is to replace $\mathbb{E}\left[e^{{t(\sum_{j=1}^{i-1} X_j + X_i)}}\right]= \mathbb{E}\left[e^{{t\sum_{j=1}^{i-1} X_j}}\right]\mathbb{E}\left[e^{{t X_i}}\right]$ with $\mathbb{E}\left[e^{t(\sum_{j=1}^{i-1} X_j + X_i)}\right] = \mathbb{E}\left[e^{t\sum_{j=1}^{i-1} X_j} \mathbb{E}\left[e^{tX_i}\mid X_1,\ldots, X_{i-1}\right]\right]$.}}]\label{chernoffLemma} Let $X_1, \cdots , X_n$ be Bernoulli random variables taking values from $\{0,1\}$, and $\mathbb{E}[X_t|X_1,\cdots, X_{t-1}]\geq\mu$ for every $t\leq n$. Let $Y=X_1+\cdots+X_n$. Then for all $0<\chgins{\delta} <1$, \[\Pr\{Y\leq (1-\chgins{\delta})n\mu\} \leq e^{-\frac{\chgins{\delta}^2n\mu }{2}}. \] \end{myfact} } Using the above tail bounds, we can prove that with high probability, the empirical mean of a set of independently sampled variables is close to the actual mean. Below we give a definition on the standard difference between the empirical mean and the actual expectation. \begin{mydef}[Standard difference]\label{def:standdif} For the random variable $T_{i,t-1}$, standard difference is defined as a random variable \chgins{$\Lambda_{i,t}=\min\{\sqrt{ \frac{ 3\ln t}{2T_{i,t-1}}},1\}$.} The maximum standard difference is defined as a random variable $\Lambda_{t} =\max \{ \Lambda_{i,t} \,\mid i\in \trig{S}_t\}$ (be reminded that it is $\trig{S}_t$, not $S_t$). \chgins{The universal difference bound is defined as $\Lambda^{i,l} = \frac{f^{-1}(\Delta^{i,l})}{2}$, which is \emph{not} a random variable.} \end{mydef} If in the round $t$, the difference between the empirical mean and the actual expectation is below the standard difference, we call the process a ``nice process''. See the formal definition below. \begin{mydef}[Nice run]\label{def:nicerun} The run of Algorithm~\ref{alg:oracleucb} is {\em nice} at time $t$ (denoted as the indicator $\mathcal{N}_t$) if: \begin{align} \forall i\in [m], \, |\hat{\mu}_{i,T_{i,t-1}} -\mu_i| \,\chgins{\le}\, \Lambda_{i,t}.\label{eqn:niceProcess} \end{align} \end{mydef} \begin{mylem} \label{lem:nice} The probability that the run of Algorithm~\ref{alg:oracleucb} is {\em nice} at time $t$ is at least $1-\frac{2m}{ t^2}$. \end{mylem} \begin{proof} \chgins{ If $T_{i,t-1}=0$, this is trivially true. If $T_{i,t-1}>0$, by} the Hoeffding's inequality in Fact~\ref{fact:hoeffding}, for any $i\in [m]$, \begin{align} &\Pr\left\{ \mid \hat \mu_{i,T_{i,t-1}} - \mu_i\mid \geq \Lambda_{i,t} \right\} = \sum_{s=1}^{t-1} \Pr \left\{ \mid \hat \mu_{i,s} - \mu_i\mid \geq \Lambda_{i,t}, T_{i,t-1} = s \right\} \nonumber\\ \leq &\sum_{s=1}^{t-1} \Pr \left\{ \mid \hat \mu_{i,s} - \mu_i\mid \geq \sqrt{\frac{ 3\ln t }{2s} } \right\} \leq t\cdot 2 e^{-3\ln t} = \frac{2}{ t^2}. \label{eqn:hatp-p:appendix} \end{align} The lemma follows by taking union bound on $i$. \end{proof} Lemma \ref{lem:nice} tells us that if at time $t$, $T_{i,t-1}$ is large, then we can get a good estimation of $\mu_i$. Intuitively, if we estimate all $\mu_i$'s pretty well, it is unlikely that we will choose a bad super arm using the approximation oracle. On the other hand, in the case that for some $i$ $T_{i,t-1}$ is small, although we may not have a good estimate of $\mu_i$, it indicates that arm $i$ has not been played for many times, which gives us an upper bound on the number of times that the algorithm plays a bad super arm containing arm $i$. Based on this idea, it is crucial to find a sampling threshold, which separates these two cases. Now we need to define the way that we count the sampling times of each arm $i$. \begin{mydef}[Counter for arm $i$]\label{def:counters} We maintain a counter $N_i$ for each arm $i$. Let $N_{i,t}$ be the value of $N_i$ at the end of round $t$ and $N_{i,0} = 0$. $\{N_i\}$ is updated in the following way. \chgins{For a round $t>0$}, let $S_t$ be the super arm selected in round $t$ by the oracle (line~\ref{alg:selectsarm} of Algorithm~\ref{alg:oracleucb}). Round $t$ is {\em bad} if the oracle selects a {\em bad} super arm $S_t\in \mathcal{S}_{\mathrm{B}}$. If round $t$ is bad, let \chgred{ $i = \operatornamewithlimits{argmin}_{j\in \trig{S}_t} N_{j,t-1} \cdot p_j $}. If the above $i$ is not unique, we pick an arbitrary one. Then we increment the counter $N_i$, i.e., $N_{i,t} = N_{i,t-1} + 1$ while not changing other counters $N_j$ with $j \ne i$. If round $t$ is not bad, i.e., $S_t\notin \mathcal{S}_{\mathrm{B}}$, no counter $N_i$ is incremented. \end{mydef} Note that the counter $N_i$ is for the purpose of analysis, and its maintenance is not part of the algorithm. Intuitively, for each round $t$ where a bad super arm $S_t$ is played, we increment exactly one counter $N_i$, where $i$ is selected among all possibly triggered base arms $\trig{S}_t$ such that the current value of \chgred{ $N_i \cdot p_i$} is the lowest. In the special case when $p_i=1$ for some $i\in [m]$, we know that $i\not \in \trig{S}\setminus S$ for any super arm $S$. Therefore, whenever arm $i$ is selected to increment its counter $N_i$ in a round $t$, $i$ must have been played in round $t$, and thus we have $T_{i,t}\ge N_{i,t}$ for any $i\in [m]$ with $p_i=1$ and all time $t$. However, this may not holds for $i\in [m]$ with $p_i < 1$, that is, it is possible that in a round $t$ a base arm $i$ is not triggered but its counter $N_i$ is incremented. In every bad round, exactly one counter in $\{N_i\}$ is incremented, so the total number of bad rounds in the first $n$ rounds is exactly $\sum_{i}N_{i,n}$. Below we give the definition of refined counters. \begin{mydef}[Refined counters]\label{def:refinedcounters} Each time $N_{i}$ gets updated, one of the bad super arms that could trigger $i$ is played. We further separate $N_i$ into a set of counters as follows: \[\forall l\in [K_i],\, N_{i,n}^l = \sum_{\chgins{t=1}}^n \mathbb{I}\{S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}\}.\] That is, each time $N_i$ is updated, we also record which bad super arm is played. \end{mydef} With these counters in hands, we shall define the two stages ``sufficiently sampled'' and ``under-sampled'' using the sampling threshold, which further split the counter $N_{i,n}^l$ into two counters. \begin{mydef}[Sufficiently sampled and under-sampled]\label{def:sufunder} Consider time horizon $n$ and current time $t \le n$. For the refined counter $N_{i,n}^l$'s, we separate them into sufficiently sampled part and under-sampled part, as defined below. When counter $N_{i,t}^l$ is incremented at time $t$, i.e, $S_t = S_{i,{\mathrm{B}}}^l$, we inspect the counter $N_{i,t-1}$. If $N_{i,t-1} > \ell_n(\Delta^{i,l},p_i)$, we say that the bad super arm $S_{i,{\mathrm{B}}}^l$ is {\em sufficiently sampled} (with respect to base arm $i$); otherwise, it is {\em under-sampled} (with respect to base arm $i$). Thus counter $N_{i,n}^l$ is separated into the following sufficiently sampled part and under-sampled part: \begin{align*} N_{i,n}^{l, suf} =& \sum_{\chgins{t=1}}^n \mathbb{I}\{S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, N_{i,t-1} > \ell_n(\Delta^{i,l},p_i)\}, \nonumber \\ N_{i,n}^{l, und} =& \sum_{\chgins{t=1}}^n \mathbb{I}\{S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, N_{i,t-1} \le \ell_n(\Delta^{i,l},p_i)\}. \end{align*} \end{mydef} Following the definition, we have $N_{i,n}^{l,und}\leq \ell_n(\Delta^{i,l},p_i)$, and \chgins{$N_{i,n} =\sum_{l\in [K_i]} (N_{i,n}^{l, suf} + N_{i,n}^{l, und})$}. Using this notation, the total reward at time horizon $n$ is at least \chgins{ \begin{equation} \label{eqn:reward} n\cdot \alpha \cdot {\mathrm{opt}}_{{\boldsymbol \mu}} - \sum_{i\in [m], K_i>0} \sum_{l\in [K_i]} (N_{i,n}^{l, suf} + N_{i,n}^{l, und}) \cdot \Delta^{i,l}. \end{equation}} To get an upper bound on the regret, we want to upper bound $N_{i,n}^{l, suf}$ and $ N_{i,n}^{l, und}$ separately. Before doing that, we prove an important connection as follows. \begin{mylem}[Connection between $N_{i,t-1}$ and $T_{i,t-1}$] \label{lemma:connection} Let $n$ be the time horizon. For every round $t$ with $\chgins{0} < t \le n$, every base arm $i \in [m]$, every $\Delta >0$, \chgred{ and every integer $k > \ell_n(\Delta,p_i)$, we have, \begin{equation} \Pr\left \{ N_{i,t-1} =k, T_{i,t-1} \leq \frac{6\cdot \ln t} {f^{-1}(\Delta)^2} \right \}\leq \frac{1}{ t^3}. \label{eq:NandT} \end{equation} Moreover, if $p_i$=1, we have \[\Pr\left \{ N_{i,t-1} =k, T_{i,t-1} \leq \frac{6\cdot \ln t} {f^{-1}(\Delta)^2} \right \}=0. \] } \end{mylem} \begin{proof} Fix a base arm $i$. The case of $p_i=1$ is trivial since in this case $T_{i,t-1} \ge N_{i,t-1} $ and $n \ge t$. Now we only consider the case of $0< p_i < 1$. In a run of CUCB algorithm (Algorithm~\ref{alg:oracleucb}), let $t^{(j)}$ be the round number at which counter $N_i$ is incremented for the $j$-th time. Suppose that in round $t^{(j)}$, super arm $S^{(j)}$ is played. Note that both $t^{(j)}$ and $S^{(j)}$ are random, depending on the randomness of the outcomes of base arms and the triggering of base arms from super arms in all historical rounds. Let $X^{(j)}$ be the Bernoulli random variable indicating whether arm $i$ is triggered by the play of super arm $S^{(j)}$ in round $t^{(j)}$. \chgins{If in a run of the CUCB algorithm counter $N_i$ is only incremented a finite number of times, let $N_{i,\infty}$ denote the final value of the counter $N_i$ in this run. In this case, we simply define $X^{(j)}=1$ for all $j> N_{i,\infty}$. For convenience, when $j> N_{i,\infty}$, we denote the corresponding super arm $S^{(j)} = \bot$. Thus, for any $\ell \ge 1$, $\sum_{j=1}^{\ell} X^{(j)}$ is well defined. } \chgins{For all $0 < t\le n$, since $T_{i,t-1}$ is the number of times $i$ is triggered by the end of round $t-1$, we have \begin{equation} \label{eq:counter} \sum_{j=1}^{N_{i,t-1}} X^{(j)} \le T_{i,t-1}. \end{equation} } \chgins{ We now show that for any $j\ge 1$, $\mathbb{E}[X^{(j)} \mid X^{(1)}, \ldots, X^{(j-1)} ]\ge p_i$. Fixing a super arm $A\in {\cal S}$, if super arm $S^{(j)}$ played in round $t^{(j)}$ is $A$, then conditioned on the event $S^{(j)}=A$, in this round whether arm $i$ is triggered or not only depends on the randomness of triggering base arms after playing $A$, and is independent of randomness in previous rounds. In other words, we have \begin{equation} \Pr\left\{X^{(j)}=1 \mid S^{(j)}=A, X^{(1)}, \ldots, X^{(j-1)}\right\} = \Pr\left\{X^{(j)}=1 \mid S^{(j)}=A \right\} = p_i^A \ge p_i. \label{eq:pi} \end{equation} By the law of total probability, we have \begin{align} &\mathbb{E}[X^{(j)} \mid X^{(1)}, \ldots, X^{(j-1)} ] \nonumber \\ & = \Pr\left\{X^{(j)}=1 \mid X^{(1)}, \ldots, X^{(j-1)} \right\} \nonumber \\ & = \sum_{A \in {\cal S}} \Pr\left\{S^{(j)}=A\right\}\cdot \Pr\left\{X^{(j)}=1 \mid S^{(j)}=A, X^{(1)}, \ldots, X^{(j-1)} \right\} \nonumber \\ & \ \ \ \ + \Pr\left\{S^{(j)}= \bot\right\}\cdot \Pr\left\{X^{(j)}=1 \mid S^{(j)}=\bot, X^{(1)}, \ldots, X^{(j-1)}\right\} \nonumber \\ & \ge p_i \sum_{A \in {\cal S}} \Pr\left\{S^{(j)}=A\right\} + \Pr\left\{S^{(j)}= \bot\right\}\cdot 1 \label{eq:twoparts}\\ & \ge p_i, \nonumber \end{align} where the first part of the Inequality Eq.~\eqref{eq:twoparts} comes from Eq.~\eqref{eq:pi}, and the second part comes from our definition that when $S^{(j)}= \bot$, it means that the counter $N_i$ stops before reaching $j$ and $X^{(j)}=1$ in this case. } \chgred{ With the result that for any $j\ge 1$, $\mathbb{E}[X^{(j)} \mid X^{(1)}, \ldots, X^{(j-1)} ]\ge p_i$, we apply the multiplicative Chernoff bound (Fact~\ref{chernoffLemma}) to obtain that for any $\ell \ge 1$, $0<\delta < 1$, \chgred{ \begin{equation} \label{eq:chernoffpi} \Pr\left\{\sum_{j=1}^\ell X^{(j)}\leq \ell \cdot p_i (1-\delta) \right\}\leq e^{-\delta^2 \ell p_i/2}. \end{equation} } We are now ready to carry out the following derivation for any $0 < t \le n$, $i \in [m]$, $\Delta >0$, and integer $k > \ell_n(\Delta,p_i)$: \begin{align} & \Pr\left \{ N_{i,t-1} =k, T_{i,t-1}\leq \frac{6\cdot \ln t} {f^{-1}(\Delta)^2} \right \} \nonumber \\ & \leq \Pr\left \{ N_{i,t-1} =k, \sum_{j=1}^{N_{i,t-1}} X^{(j)} \leq \frac{6\cdot \ln t} {f^{-1}(\Delta)^2} \right \} & \mbox{\{by Eq.~\eqref{eq:counter}\}} \nonumber \\ & \leq \Pr\left \{\sum_{j=1}^{k} X^{(j)} \leq \frac{6\cdot \ln t} {f^{-1}(\Delta)^2} \right \} \nonumber \\ & \leq \Pr\left \{ \sum_{j=1}^{\lceil \ell_n(\Delta,p_i) \rceil} X^{(j)} \leq \frac{6\cdot \ln t} {f^{-1}(\Delta)^2} \right \} \nonumber \\ & \leq \Pr\left \{ \sum_{j=1}^{\lceil \ell_t(\Delta,p_i) \rceil} X^{(j)} \leq \frac{6\cdot \ln t} {f^{-1}(\Delta)^2} \right \}. \label{eq:lem2_1} & \mbox{\{$n\ge t \Rightarrow \ell_n(\Delta,p_i) \ge \ell_t(\Delta,p_i) $\}} \end{align} If $f^{-1}(\Delta)^2\leq \frac12$, let $\delta=\frac12$, we know $\ell_t(\Delta,p_i)=\frac{12\cdot \ln t} {f^{-1}(\Delta)^2 \cdot p_i}$, so \begin{align} \eqref{eq:lem2_1}& = \Pr\left \{ \sum_{j=1}^{\lceil \ell_t(\Delta,p_i) \rceil} X^{(j)} \leq \ell_t(\Delta,p_i)\cdot p_i \cdot \frac12 \right \} \nonumber \\ &\leq \Pr\left \{ \sum_{j=1}^{\lceil \ell_t(\Delta,p_i) \rceil} X^{(j)} \leq \lceil \ell_t(\Delta,p_i) \rceil \cdot p_i \cdot \frac12 \right \} \nonumber \\ &\leq e^{-\lceil\ell_t(\Delta,p_i)\rceil p_i /8} & \mbox{\{by Eq.~\eqref{eq:chernoffpi}\}} \nonumber \\ & \leq e^{-\ell_t(\Delta,p_i) p_i /8} =e^{-\frac{3\ln t }{2 f^{-1}(\Delta)^2}} \leq e^{-3\ln t }=\frac{1}{ t^3}. \nonumber \end{align} If $f^{-1}(\Delta)^2> \frac12$, we know $\ell_t(\Delta,p_i)=\frac{24\cdot \ln t} {p_i}$. Now let $\delta=1-\frac{1}{4f^{-1}(\Delta)^2}\geq \frac12$, which means $1-\delta=\frac{1}{4f^{-1}(\Delta)^2}$. So we have, \begin{align*} \eqref{eq:lem2_1}&= \Pr\left \{ \sum_{j=1}^{\lceil \ell_t(\Delta,p_i) \rceil} X^{(j)} \leq \frac{24\ln t}{ 4f^{-1}(\Delta)^2\cdot p_i}\cdot p_i \right \} \\ &= \Pr\left \{ \sum_{j=1}^{\lceil \ell_t(\Delta,p_i) \rceil} X^{(j)} \leq \ell_t(\Delta,p_i)\cdot p_i \cdot (1-\delta) \right \} \\&\leq e^{-\ell_t(\Delta,p_i) p_i /8} & \mbox{\{by Eq.~\eqref{eq:chernoffpi}\}} \\ &= e^{-3\ln t }=\frac{1}{ t^3}. \end{align*} Therefore, Inequality~\eqref{eq:NandT} holds. } \end{proof} Recall that a nice run at time $t$ (Definition~\ref{def:nicerun}, denoted as $\mathcal{N}_t$) means that the difference between the empirical mean and the actual mean is bounded by the standard difference $\Lambda_{i,t}$ for every arm $i\in [m]$ \chgins{ ($\forall i\in [m], \, |\hat{\mu}_{i,T_{i,t-1}} -\mu_i| \le \Lambda_{i,t}$)}. By Lemma \ref{lem:nice}, we know that with probability $1-\frac{2m}{t^2}$, $\mathcal{N}_t$ holds. According to line~\ref{alg:adjustCUCB} of Algorithm~\ref{alg:oracleucb}, we have \chgins{$\bar{\mu}_{i,t} = \min\{\hat \mu_{i,T_{i,t-1}} + \Lambda_{i,t}, 1\}$}. Thus, we have \begin{align} \mathcal{N}_t \Rightarrow \forall i\in [m],\, \bar{\mu}_{i,t} - \mu_i \,\chgins{\ge}\, 0, \label{eqn:differencelowerbound}\\ \mathcal{N}_t \Rightarrow \forall i\in \trig{S}_t,\, \bar{\mu}_{i,t} -\mu_i \,\chgins{\le}\, 2 \Lambda_t. \label{eqn:differenceupperbound} \end{align} Meanwhile, by Definition \ref{def:standdif}, we know that for any $i\in [m]$, $l\in [K_i]$ and any time $t$: \begin{align}\label{eqn:ilget} \left\{S_t = S_{i,{\mathrm{B}}}^l, \forall s\in \trig{S}_t, T_{s,t-1} >\frac{6\ln t}{f^{-1}(\Delta^{i,l})^2} \right\} \Rightarrow \Lambda^{i,l} > \Lambda_t. \end{align} With the previous observations, we have the following lemma. Informally, it says that in a nice run in round $t$, it is impossible that the algorithm would select a bad super arm $S_t$ using the oracle, which outputs a correct $\alpha$-approximation answer, while every arm in $\trig{S}_t$ has been tested for enough times. \begin{mylem}[Impossible case]\label{lem:impossible} Let $F_t$ be the indicator defined in Definition \ref{def:nonalphaoutput}. For any $i\in [m]$, $l\in [K_i]$ and any time $t$, the event $\left\{\mathcal{N}_t, \neg F_t, S_t = S_{i,{\mathrm{B}}}^l, \forall s\in \trig{S}_t, T_{s,t-1} >\frac{6\ln t}{f^{-1}(\Delta^{i,l})^2} \right\}$ is empty. \end{mylem} \begin{proof} Indeed, if all the conditions hold, we have: \begin{align*} r_{{\boldsymbol \mu}}(S_t) + f(2\Lambda^{i,l}) >& r_{{\boldsymbol \mu}}(S_t) +f(2\Lambda_{t}) &\mbox{\{ strict monotonicity of $f(\cdot)$ and Eq.(\ref{eqn:ilget})\}}\\ \geq & r_{\bar{{\boldsymbol \mu}}_t}(S_t) &\mbox{\{bounded smoothness property and Eq.(\ref{eqn:differenceupperbound})\}} \\ \geq &\alpha\cdot {{\mathrm{opt}}_{\bar{{\boldsymbol \mu}}_t}} & \mbox{\{$\neg F_t \Rightarrow$ $S_t$ is an $\alpha$ approximation w.r.t $\bar{{\boldsymbol \mu}}_t$ \}} \\ \geq &\alpha \cdot r_{\bar{{\boldsymbol \mu}}_t}(S_{\boldsymbol \mu}^*) &\mbox{\{definition of ${\mathrm{opt}}_{\bar{{\boldsymbol \mu}}_t}$\}} \\ \geq & \alpha\cdot r_{{\boldsymbol \mu}}(S_{\boldsymbol \mu}^*) = \alpha\cdot {\mathrm{opt}}_{{\boldsymbol \mu}}. &\mbox{\{ monotonicity of $r_{{\boldsymbol \mu}}(S)$ and Eq.(\ref{eqn:differencelowerbound})\}} \end{align*} So we have \begin{align} r_{{\boldsymbol \mu}}(S_{i,{\mathrm{B}}}^l)+f(2\Lambda^{i,l})> \alpha \cdot {\mathrm{opt}}_{\boldsymbol \mu}. \label{eqn:min_Delta_il} \end{align} However, by Definition~\ref{def:standdif}, $f(2\Lambda^{i,l})=f(f^{-1}(\Delta^{i,l}))=\Delta^{i,l}$. Thus, Inequality (\ref{eqn:min_Delta_il}) contradicts the definition of $\Delta^{i,l}$ in Definition~\ref{def:delta}. \end{proof} Now we are ready to prove the bound on sufficiently sampled part. Recall that $p^* = \min_{i\in [m]} p_i$. \begin{mylem}\label{lem:boundonsuffpart}[Bound on sufficiently sampled part] For any time horizon $n > m$, \begin{equation} \label{eqn:suf} \mathbb{E}\left[\sum_{i\in [m],K_i>0} \sum_{l\in [K_i]} N_{i,n}^{l, suf}\right] \leq (1-\beta)n + \chgred{ \frac{(2+\mathbb{I}\{p^* < 1\})m\pi^2}{6}}. \end{equation} \end{mylem} \begin{proof} From Definition~\ref{def:sufunder} on $N_{i,n}^{l,suf}$, we have \begin{align} &\mathbb{E}\left[\sum_{i\in [m],K_i>0} \sum_{l\in [K_i]} N_{i,n}^{l, suf}\right] \\ &= \mathbb{E}\left[ \sum_{i\in [m],K_i>0} \sum_{l\in [K_i]} \sum_{t=1}^n \mathbb{I}\left \{S_t= S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, N_{i,t-1} > \ell_n\left (\Delta^{i,l}, p_i\right )\right \}\right]\nonumber\\ &\le\sum_{i\in [m],K_i>0} \sum_{l\in [K_i]}\sum_{t=1}^n \Pr\left \{ S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, \forall s \in \trig{S}_t, N_{s,t-1} > \ell_n\left (\Delta^{i,l}, \chgred{ p_s}\right ) \right \}, \nonumber \end{align} where the last inequality is due to our way of updating counter $N_i$ by Definition~\ref{def:counters}: When $N_i$ is incremented in round $t$ such that $N_{i,t} > N_{i,t-1}$, we know that $N_{i,t-1} \cdot p_i$ has the lowest value among all $N_{s,t-1} \cdot p_s$ for $s\in \trig{S}_t$, \chgred{ and thus $N_{i,t-1} > \ell_n\left (\Delta^{i,l}, p_i\right )$ implies that for $s\in \trig{S}_t$, $N_{s,t-1} \ge N_{i,t-1} \cdot p_i /p_s > \ell_n\left (\Delta^{i,l}, p_i\right ) \cdot p_i /p_s = \ell_n\left (\Delta^{i,l}, p_s\right )$. To prove the lemma, it is sufficient to show that for any $\chgins{0} < t \le n$, \begin{align} &\sum_{i\in [m],K_i>0} \sum_{l\in [K_i]}\Pr\left \{ S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, \forall s \in \trig{S}_t, N_{s,t-1} > \ell_n\left (\Delta^{i,l}, \chgred{ p_s}\right ) \right \} \label{eqn:foralls} \\ &\leq (1-\beta)+\frac{(2+\mathbb{I}\{p^* < 1\})m}{ t^2}.\label{eqn: N>l} \end{align} This is because we may then take the union bound on all $t$'s, and get a bound of $$ \sum_{\chgins{t=1}}^n \left( (1-\beta)+\frac{3m}{ t^2} \right) \le (1-\beta)n+\frac{(2+\mathbb{I}\{p^* < 1\})m\pi^2}{6}. $$ Thus, in order to prove our claim, it suffices to prove Inequality (\ref{eqn: N>l}). We first split Eq.\eqref{eqn:foralls} into two parts: \begin{align} & \sum_{i\in [m],K_i>0} \sum_{l\in [K_i]} \Pr\left \{ S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, \forall s \in \trig{S}_t, N_{s,t-1} > \ell_n\left (\Delta^{i,l}, \chgred{ p_s}\right ) \right \} \nonumber\\ =& \sum_{i\in [m],K_i>0} \sum_{l\in [K_i]} \Pr\left \{ S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, \forall s \in \trig{S}_t, N_{s,t-1} > \ell_n\left (\Delta^{i,l},p_s\right ) , T_{s,t-1} > \frac{6\cdot \ln t} {f^{-1}(\Delta^{i,l})^2}\right \} \nonumber \\&+ \sum_{i\in [m],K_i>0} \sum_{l\in [K_i]} \Pr\left \{ S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, \forall s \in \trig{S}_t, N_{s,t-1} > \ell_n\left (\Delta^{i,l},p_s\right ) , \exists s \in \trig{S}_t, T_{s,t-1} \leq \frac{6\cdot \ln t} {f^{-1}(\Delta^{i,l})^2} \right \}. \nonumber \\ =&\Pr\left \{\exists i\in[m], \exists l\in [K_i], S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, \forall s \in \trig{S}_t, N_{s,t-1} > \ell_n\left (\Delta^{i,l},p_s\right ) , T_{s,t-1} > \frac{6\cdot \ln t} {f^{-1}(\Delta^{i,l})^2}\right \} \nonumber \\&+ \Pr\left \{\exists i\in[m], \exists l\in [K_i], S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, \forall s \in \trig{S}_t, N_{s,t-1} > \ell_n\left (\Delta^{i,l},p_s\right ) , \exists s \in \trig{S}_t, T_{s,t-1} \leq \frac{6\cdot \ln t} {f^{-1}(\Delta^{i,l})^2} \right \}, \label{eqn:uniqueil} \end{align} where the last equality is due to that the events $\{ S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}\}$ for all $i\in [m]$ and $l\in [K_i]$ are mutually exclusive, since $N_{i,t}>N_{i,t-1}$ determines the unique $i$ (at most one $N_i$ is incremented in each round by Definition~\ref{def:counters}) and then $S_t = S_{i,{\mathrm{B}}}^l$ determines the unique $l$. For the first term in Eq.\eqref{eqn:uniqueil}, we apply Lemma \ref{lem:impossible} and have: \begin{align} &\forall i\in[m]\, \forall l\in[K_i],\, \Pr \left\{\mathcal{N}_t, \neg F_t, S_t=S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, \forall s\in \trig{S}_t, \right. \left. T_{s,t-1} >\frac{6\cdot \ln t} {f^{-1}(\Delta^{i,l})^2} \right\} = 0 \Rightarrow \nonumber \\ &\Pr\left\{\mathcal{N}_t, \neg F_t, \exists i\in[m], \exists l\in [K_i], S_t=S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, \forall s\in \trig{S}_t, \right. \left. T_{s,t-1} >\frac{6\cdot \ln t} {f^{-1}(\Delta^{i,l})^2} \right\} = 0 \Rightarrow \nonumber \\ &\Pr \left\{\exists i\in[m], \exists l\in [K_i], S_t=S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, \forall s\in \trig{S}_t, \right. \left. T_{s,t-1} >\frac{6\cdot \ln t} {f^{-1}(\Delta^{i,l})^2} \right\} \nonumber \\ & \ \ \ \leq \Pr[F_t \lor \neg \mathcal{N}_t] \leq (1-\beta)+\frac{2m}{ t^2}. \label{eq:FNt} \end{align} The inequality in Eq.\eqref{eq:FNt} uses the definition of $F_t$ (Definition~\ref{def:nonalphaoutput}) and Lemma~\ref{lem:nice}. For the second term in Eq.\eqref{eqn:uniqueil}, we have: \begin{align} &\Pr\left \{\exists i\in[m], \exists l\in [K_i], S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, \forall s \in \trig{S}_t, N_{s,t-1} > \ell_n\left (\Delta^{i,l},p_s\right ), \exists s \in \trig{S}_t, T_{s,t-1} \leq \frac{6\cdot \ln t} {f^{-1}(\Delta^{i,l})^2} \right \} \nonumber \\ &\le \Pr\left \{\exists i\in[m], \exists l\in [K_i], \exists s \in \trig{S}_t, N_{s,t-1} > \ell_n\left (\Delta^{i,l},p_s\right ), T_{s,t-1} \leq \frac{6\cdot \ln t} {f^{-1}(\Delta^{i,l})^2} \right \} \nonumber \\ &\le \sum_{s \in \trig{S}_t} \sum_{k=1}^{t-1}\Pr\left \{\exists i\in[m], \exists l\in [K_i], N_{s,t-1}=k, N_{s,t-1} > \ell_n\left (\Delta^{i,l},p_s\right ), T_{s,t-1} \leq \frac{6\cdot \ln t} {f^{-1}(\Delta^{i,l})^2} \right \}. \label{eqn:fixNtoj} \end{align} Let $\Delta^*(s,k)= \min_{i\in[m], l\in [K_i], \ell_n(\Delta^{i,l},p_s)<k} \Delta^{i,l}$, and $\Delta^*(s,k)=\emptyset$ if the condition of $\min$ is not satisfied. Since $f^{-1}(\Delta)$ decreases when $\Delta$ decreases, we know that when the event $\{\exists i\in[m], \exists l\in [K_i], N_{s,t-1}=k, N_{s,t-1} > \ell_n\left (\Delta^{i,l},p_s\right ), T_{s,t-1} \leq \frac{6\cdot \ln t} {f^{-1}(\Delta^{i,l})^2} \}$ is non-empty, it is included in the event $\{N_{s,t-1}=k, T_{s,t-1} \leq \frac{6\cdot \ln t}{f^{-1}(\Delta^*(s,k))^2} \}$. Therefore, we have \begin{align} \eqref{eqn:fixNtoj} & \le \sum_{s \in \trig{S}_t} \sum_{k\in [t-1], \Delta^*(s,k)\ne \emptyset}\Pr\left \{N_{s,t-1}=k, T_{s,t-1} \leq \frac{6\cdot \ln t}{f^{-1}(\Delta^*(s,k))^2}\right \} \nonumber \\ & \le \sum_{s \in \trig{S}_t} \sum_{k\in [t-1]} \frac{\mathbb{I}\{p_i < 1\}}{ t^3} &\mbox{\{by Lemma~\ref{lemma:connection}\}} \nonumber \\ &\le \frac{\mathbb{I}\{p^* < 1\}m}{t^2}. \label{eqn:splitterm2} \end{align} Combining Eq.\eqref{eq:FNt} and Eq.\eqref{eqn:splitterm2}, we obtain Eq.\eqref{eqn: N>l}. } \end{proof} Now we consider the bound on under-sampled part, i.e., the number of times that the played bad super arms are under-sampled. For a particular arm $i$, its counter $N_i$ will increase from \chgins{$0$} to ${\ell}_n(\Delta^{i,K_i},p_i)$ before it is sufficiently sampled. Assume $N_{i,t-1} \in ({\ell}_n(\Delta^{i,j-1},p_i),{\ell}_n(\Delta^{i,j},p_i)]$ when $N_i$ is incremented at time $t$ with an {\em under-sampled} super arm $S_{i,B}^l$. We can conclude that $\Delta^{i,l}\le\Delta^{i,j}$, which will be used as an upper bound for the regret. Otherwise, we must have $\Delta^{i,l} \ge \Delta^{i,j-1}$ and $S_{i,B}^l$ is already {\em sufficiently sampled}. To simplify the notation, set $\ell_n(\Delta^{i,0},p_i) = 0$. \chgins{Notice that $N_{i,0}=0$ for all $i$. For each base arm $i$, the boundary case of $0 = N_{i,t-1} < N_{i,t}$ occurs in only one round in a run, and we treat it separately by using $\Delta^{i}_{\max}$ as the regret for this case. } \chgins{For the rest, we} break the range of the counter $N_{i,t-1}$ \chgins{with $N_{i,t-1}>0$} into discrete segments, i.e., $(\ell_n(\Delta^{i,j-1},p_i), \ell_n(\Delta^{i,j},p_i)]$ for $j\in [K_i]$. Let us assume that the round $t$ is bad and $N_{i,t}$ is incremented. Assume $N_{i,t-1} \in (\ell_n(\Delta^{i,j-1},p_i), \ell_n(\Delta^{i,j},p_i)]$ for some $j$. Notice that we are only interested in the case that $S_t$ is under-sampled. In particular, if this is indeed the case, $S_t = S_{{\mathrm{B}}}^{i,l}$ for some $l \geq j$. (Otherwise, $S_t$ is sufficiently sampled based on the counter $N_{i,t-1}$.) Therefore, we will suffer a regret of $\Delta^{i,l} \leq \Delta^{i,j}$ (See Definition \ref{def:delta}). Consequently, for counter $N_{i,t}$ in range $(\ell_n(\Delta^{i,j-1},p_i), \ell_n(\Delta^{i,j},p_i)]$, we will suffer a total regret for those under-sampled arms at most $(\ell_n(\Delta^{i,j},p_i)-\ell_n(\Delta^{i,j-1},p_i))\cdot \Delta^{i,j}$ in rounds that $N_{i,t}$ is incremented. \begin{mylem}[Bound on under-sampled part] \label{lem:boundundersampled} For any time horizon $n>m$, we have, \begin{equation} \sum_{i\in[m],K_i>0}\sum_{l\in [K_i]} N_{i,n}^{l,und}\cdot \Delta^{i,l} \leq \sum_{i\in[m],K_i>0}\left (\ell_n(\Delta^i_{\min},p_i) \Delta^i_{\min} + \int_{\Delta^i_{\min}}^{\Delta^i_{\max}} \ell_n(x,p_i) \mathrm{d}x \chgins{+\Delta^{i}_{\max}} \right ).\label{eqn:und} \end{equation} \end{mylem} \begin{proof} It suffices to show that for any arm $i \in [m]$ with $K_i >0$, \[\sum_{l\in [K_i]} N_{i,n}^{l,und}\cdot \Delta^{i,l} \leq \ell_n(\Delta^i_{\min},p_i) \Delta^i_{\min} + \int_{\Delta^i_{\min}}^{\Delta^i_{\max}} \ell_n(x,p_i) \mathrm{d}x\chgins{+\Delta^{i}_{\max}}.\] Now, by definition and discussion on the interval that $N_{i,t-1}$ lies in, we have \begin{align} &\sum_{l\in [K_i]} N_{i,n}^{l,und}\cdot \Delta^{i,l} \nonumber \\ & = \sum_{\chgins{t=1}}^n \sum_{l\in [K_i]}\mathbb{I}\{S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, N_{i,t-1} \le \ell_n(\Delta^{i,l},p_i)\}\cdot \Delta^{i,l} \nonumber\\ & \chgins{ = \sum_{\chgins{t=1}}^n \sum_{l\in [K_i]}\mathbb{I}\{S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, 0 < N_{i,t-1} \le \ell_n(\Delta^{i,l},p_i)\}\cdot \Delta^{i,l}} \nonumber \\ & \ \ \ \chgins {+ \sum_{\chgins{t=1}}^n \sum_{l\in [K_i]}\mathbb{I}\{S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}=0 \}\cdot \Delta^{i,l}} \nonumber\\ & \chgins{ \le \sum_{\chgins{t=1}}^n \sum_{l\in [K_i]}\mathbb{I}\{S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, 0 < N_{i,t-1} \le \ell_n(\Delta^{i,l},p_i)\}\cdot \Delta^{i,l} +\Delta^{i}_{\max} } \nonumber \\ & = \sum_{\chgins{t=1}}^n \sum_{l\in [K_i]} \sum_{j=1}^l \mathbb{I}\{S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, N_{i,t-1} \in (\ell_n(\Delta^{i,j-1},p_i), \ell_n(\Delta^{i,j},p_i) ] \} \cdot \Delta^{i,l} \chgins{+\Delta^{i}_{\max}}\nonumber\\ & \le \sum_{\chgins{t=1}}^n \sum_{l\in [K_i]} \sum_{j=1}^{l} \mathbb{I}\{S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, N_{i,t-1} \in (\ell_n(\Delta^{i,j-1},p_i), \ell_n(\Delta^{i,j},p_i) ] \} \cdot \Delta^{i,\boldsymbol{j}}\chgins{+\Delta^{i}_{\max}} \label{eqn:undersplit} \\ &\le \sum_{\chgins{t=1}}^n \sum_{l\in [K_i]} \sum_{j\in [K_i]} \mathbb{I}\{S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, N_{i,t-1} \in (\ell_n(\Delta^{i,j-1},p_i), \ell_n(\Delta^{i,j},p_i) ] \} \cdot \Delta^{i,{j}}\chgins{+\Delta^{i}_{\max}} \nonumber\\ &= \sum_{\chgins{t=1}}^n \sum_{j\in [K_i]} \mathbb{I}\{S_t \in \mathcal{S}_{i,{\mathrm{B}}}, N_{i,t}>N_{i,t-1}, N_{i,t-1} \in (\ell_n(\Delta^{i,j-1},p_i), \ell_n(\Delta^{i,j},p_i) ] \} \cdot \Delta^{i,{j}}\chgins{+\Delta^{i}_{\max}}. \label{eqn:undermerge} \end{align} The Inequality~\eqref{eqn:undersplit} holds since $\Delta^{i,j}\geq \Delta^{i,l}$ for $j\leq l$. Equality~\eqref{eqn:undermerge} is by first switching summations and then merging all $S_{i,{\mathrm{B}}}^l$ into $\mathcal{S}_{i,{\mathrm{B}}}$. We may now switch the summations again, and get \begin{align} (\ref{eqn:undermerge})=& \sum_{j\in [K_i]} \sum_{\chgins{t=1}}^n\mathbb{I}\{S_t \in \mathcal{S}_{i,{\mathrm{B}}}, N_{i,t}>N_{i,t-1}, N_{i,t-1} \in (\ell_n(\Delta^{i,j-1},p_i), \ell_n(\Delta^{i,j},p_i) ] \} \cdot \Delta^{i,j}\chgins{+\Delta^{i}_{\max}} \nonumber \\ \chgred{\leq}& \chgred{\sum_{j\in [K_i]} (\lfloor \ell_n(\Delta^{i,j},p_i)\rfloor - \lfloor \ell_n(\Delta^{i,j-1},p_i)\rfloor)\cdot \Delta^{i,j}\chgins{+\Delta^{i}_{\max}}} \label{eqn:underrelax} \\ \chgred{\leq} & \chgred{\sum_{j\in [K_i]} (\ell_n(\Delta^{i,j},p_i) - \ell_n(\Delta^{i,j-1},p_i))\cdot \Delta^{i,j}\chgins{+\Delta^{i}_{\max}}.} \label{eqn:underrelax2} \end{align} Inequality~\eqref{eqn:underrelax} uses a relaxation on the indicators. \chgred{ In Inequality~\eqref{eqn:underrelax2}, for every $j\ge 2$, we relax the part of $(\ell_n(\Delta^{i,j-1},p_i) - \lfloor \ell_n(\Delta^{i,j-1},p_i)\rfloor)\cdot \Delta^{i,j}$ to $(\ell_n(\Delta^{i,j-1},p_i) - \lfloor \ell_n(\Delta^{i,j-1},p_i)\rfloor)\cdot \Delta^{i,j-1}$.} Now we simply expand the summation, and some terms will be cancelled. Then, we upper bound the new summation using an integral: \begin{align} \eqref{eqn:underrelax2}=& \ell_n(\Delta^{i,K_i},p_i) \Delta^{i,K_i}+\sum_{j\in [K_i-1]} \ell_n(\Delta^{i,j},p_i) \cdot( \Delta^{i,j} -\Delta^{i,j+1})\chgins{+\Delta^{i}_{\max}} \nonumber \\ \leq& \ell_n(\Delta^{i,K_i},p_i) \Delta^{i,K_i} + \int_{\Delta^{i,K_i}}^{\Delta^{i,1}} \ell_n(x,p_i) \mathrm{d}x\chgins{+\Delta^{i}_{\max}} \label{eq:integralinq} \\ = & \ell_n(\Delta^i_{\min},p_i) \Delta^i_{\min} + \int_{\Delta^i_{\min}}^{\Delta^i_{\max}} \ell_n(x,p_i) \mathrm{d}x\chgins{+\Delta^{i}_{\max}}. \label{eq:tightint} \end{align} Inequality~\eqref{eq:integralinq} comes from the fact that $\ell_n(x,p_i)$ is decreasing in $x$. \end{proof} Finally we are ready to prove our main theorem. We just need to combine the upper bounds from the sufficiently sampled part and the under-sampled part together. \begin{proof}[Proof of Theorem~\ref{thm:cucb individual}] Using the counters defined in Definition \ref{def:refinedcounters}, we may get the expectation of the regret by computing the expectation of the value of the counters after the $n$-th round. More specifically, according to Definition \ref{def:regretdef}, the expected regret is the difference between $n \cdot \alpha \cdot \beta\cdot {\mathrm{opt}}_{{\boldsymbol \mu}}$ and the expected reward, which is at least $\alpha \cdot n\cdot {\mathrm{opt}}_{{\boldsymbol \mu}}$ minus the expected loses from playing bad super arms. Therefore, combining with Eq.(\ref{eqn:suf}) and Eq.(\ref{eqn:und}), the overall regret of our algorithm is \begin{align} & Reg^A_{{\boldsymbol \mu},\alpha,\beta}(n) \nonumber \\ & \leq \mathbb{E} \left[n \cdot \alpha \cdot \beta\cdot {\mathrm{opt}}_{{\boldsymbol \mu}} - \left(\alpha \cdot n\cdot {\mathrm{opt}}_{{\boldsymbol \mu}} - \sum_{i\in[m], K_i>0} \left( \sum_{l\in [K_i]} (N_{i,n}^{l, suf} + N_{i,n}^{l, und}) \cdot \Delta^{i,l}\right)\right)\right]\label{eqn:combinetwoparts}\\ & \leq \Delta_{\max} \cdot \mathbb{E} \left[ \sum_{i\in[m], K_i>0} \sum_{ l\in [K_i]} N_{i,n}^{l, suf}\right] \nonumber \\ & \ \ \ + \sum_{i\in[m], K_i>0} \left( \ell_n(\Delta^i_{\min},p_i) \Delta^i_{\min} + \int_{\Delta^i_{\min}}^{\Delta^i_{\max}} \ell_n(x,p_i) \mathrm{d}x\chgins{+\Delta^{i}_{\max}}\right) - (1-\beta)\cdot n\cdot \alpha \cdot {\mathrm{opt}}_{{\boldsymbol \mu}}\nonumber\\ & \leq \sum_{i\in[m], K_i>0}\left( \ell_n(\Delta^i_{\min},p_i) \Delta^i_{\min} + \int_{\Delta^i_{\min}}^{\Delta^i_{\max}} \ell_n(x,p_i) \mathrm{d}x\right) + \chgred{\left(\frac{(2+\mathbb{I}\{p^* < 1\})\pi^2}{6}+1\right)\cdot m\cdot \Delta_{\max} } \nonumber\\ & \ \ \ +(1-\beta)n \cdot \Delta_{\max} - (1-\beta)\cdot n\cdot \alpha \cdot {\mathrm{opt}}_{{\boldsymbol \mu}}\label{eq:neednonnegative}\\ & \leq \sum_{i\in[m], K_i>0}\left( \ell_n(\Delta^i_{\min},p_i) \Delta^i_{\min} + \int_{\Delta^i_{\min}}^{\Delta^i_{\max}} \ell_n(x,p_i) \mathrm{d}x \right) + \chgred{ \left(\frac{(2+\mathbb{I}\{p^* < 1\})\pi^2}{6}+1\right)\cdot m\cdot \Delta_{\max}}. \label{eq:regretend} \end{align} The last step of derivation from Eq.\eqref{eq:neednonnegative} to Eq.\eqref{eq:regretend} uses the fact that all rewards are nonnegative and thus $\Delta_{\max} \le \alpha \cdot {\mathrm{opt}}_{{\boldsymbol \mu}}$ by Definition~\ref{def:delta}. \end{proof} \subsubsection{Proof of Theorem~\ref{thm:worstbound}} The proof of Theorem~\ref{thm:worstbound} relies on the tight regret bound for the leading $\ln n$ term given by Theorem~\ref{thm:cucb individual}. \begin{proof}[Proof of Theorem~\ref{thm:worstbound}] We first prove the case of $p^*=1$. Following the proof of Theorem~\ref{thm:cucb individual}, we only need to consider the base arms that are played when they are under-sampled. Following the intuition, we need to quantify when $\Delta$ is too small. In particular, we measure the threshold for $\Delta^i_{\min}$ based on $N_{i,n}$, i.e., the counter of arm $i$ at time horizon $n$. Let $\{n_j \mid j \in [m]\}$ be a set of possible counter values at time horizon $n$. Our analysis will then be conditioned on event ${\cal E} = \{\forall j\in [m], N_{j,n} = n_j\}$. For an arm $i\in [m]$ with $K_i > 0$, we have \begin{align*} &\sum_{l\in [K_i]} N_{i,n}^{l,und}\cdot \Delta^{i,l} \mid {\cal E} \\=& \sum_{\chgins{t=1}}^n \sum_{l\in [K_i]}\mathbb{I}\{S_t = S_{i,{\mathrm{B}}}^l, N_{i,t}>N_{i,t-1}, N_{i,t-1} \le \ell_n(\Delta^{i,l},1)\, \mid {\cal E} \}\cdot \Delta^{i,l} \nonumber \end{align*} With $f(x) = \gamma x^\omega$, we have $f^{-1}(x) = \left(\frac{x}{\gamma}\right)^{1/\omega}$. Define $\Delta^*(n_i) = \left(\frac{6\gamma^{2/\omega} \ln n}{n_i}\right)^{\omega/2}$, i.e., ${\ell}_n(\Delta^*(n_i), 1) = n_i$. Now we consider two cases. Case (1): $\Delta_{\min}^i > \Delta^*(n_i)$. Following the same derivation as in the proof of Lemma~\ref{lem:boundundersampled} (notice that the same derivation still works when conditioned on event $\cal E$), we have \begin{align} \sum_{l\in [K_i]} N_{i,n}^{l,und}\cdot \Delta^{i,l} \mid {\cal E} & \leq \ell_n(\Delta^i_{\min},1) \Delta^i_{\min} + \int_{\Delta^i_{\min}}^{\Delta^i_{\max}} \ell_n(x,1) \mathrm{d}x \chgins{+\Delta^{i}_{\max}} \label{eq:ponecase1b}\\ & = \frac{6\gamma^{\frac{2}{\omega}} \ln n}{(\Delta^i_{\min})^{\frac{2}{\omega}-1}} + \frac{\omega}{2-\omega} 6 \gamma^{\frac{2}{\omega}} \ln n\left((\Delta^i_{\min})^{1-\frac{2}{\omega}} - (\Delta^i_{\max})^{1-\frac{2}{\omega}} \right) \chgins{+\Delta^{i}_{\max}} \nonumber \\ & \le \frac{2}{2-\omega}\cdot \frac{6 \cdot \gamma^{\frac{2}{\omega}} \ln n}{ (\Delta_{\min}^i)^{\frac{2}{\omega}-1}} \leq \frac{2\gamma}{2-\omega}\cdot (6\ln n)^{\omega/2}n_i^{1-\omega/2} \chgins{+\Delta^{i}_{\max}}. \label{eq:ponecase1e} \end{align} The last inequality above is by replacing $\Delta_{\min}^i$ with $\Delta^*(n_i)$. Case (2): $\Delta_{\min}^i \leq \Delta^*(n_i)$. Let $l^* = \min\{ l\in [K_i] \mid \Delta^{i,l} \le \Delta^*(n_i) \}$. Notice that $\Delta^{i,l^*} \leq \left(\frac{6\gamma^{2/\omega} \ln n}{n_i}\right)^{\omega/2}$. We follow the same derivation as in the proof of Lemma~\ref{lem:boundundersampled}, and then we critically use the fact that the counter $N_i$ cannot go beyond $n_i$ (in the first term in Inequality~\eqref{eq:criticalni}): \begin{align} &\sum_{l\in [K_i]} N_{i,n}^{l,und}\cdot \Delta^{i,l} \mid {\cal E}\nonumber\\ \le & \sum_{j\in [K_i]} \sum_{\chgins{t=1}}^n\mathbb{I}\{S_t \in \mathcal{S}_{i,{\mathrm{B}}}, N_{i,t}>N_{i,t-1}, N_{i,t-1} \in (\ell_n(\Delta^{i,j-1},1), \ell_n(\Delta^{i,j},1) ] \mid {\cal E} \} \cdot \Delta^{i,j} \chgins{+\Delta^{i}_{\max}} \label{eq:ponecase2b} \\ \le & \sum_{j \ge l*} \sum_{\chgins{t=1}}^n\mathbb{I}\{S_t \in \mathcal{S}_{i,{\mathrm{B}}}, N_{i,t}>N_{i,t-1}, N_{i,t-1} \in (\ell_n(\Delta^{i,j-1},1), \ell_n(\Delta^{i,j},1) ] \mid {\cal E}\} \cdot \Delta^*(n_i) \chgins{+\Delta^{i}_{\max}} \nonumber \\ & + \sum_{j \in [l*-1]} \sum_{\chgins{t=1}}^n\mathbb{I}\{S_t \in \mathcal{S}_{i,{\mathrm{B}}}, N_{i,t}>N_{i,t-1}, N_{i,t-1} \in (\ell_n(\Delta^{i,j-1},1), \ell_n(\Delta^{i,j},1) ] \mid {\cal E} \} \cdot \Delta^{i,j} \chgins{+\Delta^{i}_{\max}}\nonumber \\ \le & (n_i - \ell_n(\Delta^{i,l^*-1},1))\cdot \Delta^*(n_i) + \sum_{j\in [l^*-1]} (\ell_n(\Delta^{i,j}, 1) - \ell_n(\Delta^{i,j-1}, 1))\cdot \Delta^{i,j} \chgins{+\Delta^{i}_{\max}} \label{eq:criticalni}\\ \leq& n_i \cdot \Delta^*(n_i) + \int_{\Delta^*(n_i)}^{\Delta^{i,1}} \ell_n(x, 1) \mathrm{d}x \chgins{+\Delta^{i}_{\max}} \leq \frac{2\gamma}{2-\omega}\cdot (6\ln n)^{\omega/2}n_i^{1-\omega/2} \chgins{+\Delta^{i}_{\max}}.\label{eqn:und2} \end{align} Therefore, Eq.(\ref{eqn:und2}) holds in both cases. We then have \begin{align} \sum_{i\in [m], K_i > 0}\sum_{l\in [K_i]} N_{i,n}^{l,und}\cdot \Delta^{i,l} \mid {\cal E} &\leq \frac{2\gamma}{2-\omega}\cdot (6\ln n)^{\omega/2} \cdot \sum_{i\in [m], K_i > 0} n_i^{1-\omega/2} \chgins{+\Delta^{i}_{\max}} \nonumber\\ &\leq \frac{2\gamma}{2-\omega}\cdot (6m\ln n)^{\omega/2} \cdot n^{1-\omega/2}\chgins{+\Delta^{i}_{\max}}.\label{eq:underInd} \end{align} The last inequality comes from Jensen's inequality and $\sum_i n_i \leq n$. Since the final inequality does not depend on $n_i$, we can drop the condition $\cal E$ above. With the bound on the under-sampled part given in Inequality~\eqref{eq:underInd}, we combine it with the result on sufficiently sampled part given in Lemma~\ref{lem:boundonsuffpart}, then we can following the similar derivation as shown from Eq.\eqref{eqn:combinetwoparts} to Eq.\eqref{eq:regretend} to derive the distribution-independent regret bound given in Theorem~\ref{thm:worstbound} for the case of $p^*=1$. We now prove the case of $p^* < 1$. The proof is essentially the same, but with a different definition of $\ell_n(\Delta,p)$. \chgred{ For convenience, we relax $\ell_n(\Delta,p) = \max\left (\frac{12\cdot \ln n}{(f^{-1}(\Delta))^2\cdot p}, \frac{24\cdot \ln n}{p} \right )$ to $\frac{12\cdot \ln n}{(f^{-1}(\Delta))^2\cdot p} + \frac{24\cdot \ln n}{p}$.} In this case, we define $\Delta^*_i(n_i) = \left(\frac{12\gamma^{2/\omega} \ln n}{p_i n_i}\right)^{\omega/2}$. For Case (1): $\Delta_{\min}^i > \Delta^*_i(n_i)$, following the same derivation as Eq.\eqref{eq:ponecase1b}-\eqref{eq:ponecase1e} except that we use $\ell_n(\cdot,p_i)$ instead of $\ell_n(\cdot,1)$ (Definition~\ref{def:samplthreshold}), we have \[ \sum_{l\in [K_i]} N_{i,n}^{l,und}\cdot \Delta^{i,l} \mid {\cal E}\le \frac{2\gamma}{2-\omega}\cdot \left(\frac{12\ln n}{p_i}\right)^{\omega/2}n_i^{1-\omega/2} + \chgred{\frac{24\ln n}{p_i} } \cdot \Delta^i_{\max} \chgins{+\Delta^{i}_{\max}}. \] For Case (2): $\Delta_{\min}^i \leq \Delta^*_i(n_i)$, again following the same derivation Eq.\eqref{eq:ponecase2b}-\eqref{eqn:und2} except that we use $\ell_n(\cdot,p_i)$ instead of $\ell_n(\cdot,1)$,, we have \[ \sum_{l\in [K_i]} N_{i,n}^{l,und}\cdot \Delta^{i,l} \mid {\cal E} \le \frac{2\gamma}{2-\omega}\cdot \left(\frac{12\ln n}{p_i}\right)^{\omega/2}n_i^{1-\omega/2} + \chgred{\frac{24\ln n}{p_i} } \cdot \Delta^i_{\max} \chgins{+\Delta^{i}_{\max}}. \] Together, we have \begin{align*} &\sum_{i\in [m], K_i > 0}\sum_{l\in [K_i]} N_{i,n}^{l,und}\cdot \Delta^{i,l} \mid {\cal E} \\ & \le \frac{2\gamma}{2-\omega}\cdot \left(\frac{12\ln n}{p^*}\right)^{\omega/2} \sum_{i\in [m], K_i > 0} n_i^{1-\omega/2} + \sum_{i\in [m], K_i > 0} \chgred{\frac{24\ln n}{p_i}} \cdot \Delta^i_{\max} \\ & \le \frac{2\gamma}{2-\omega}\cdot \left(\frac{12 m \ln n}{p^*}\right)^{\omega/2} n^{1-\omega/2} + \sum_{i\in [m]} \chgred{\frac{24\ln n}{p_i} } \cdot \Delta_{\max} \chgins{+\Delta^{i}_{\max}}. \end{align*} Finally, combining Lemma~\ref{lem:boundonsuffpart} and the derivation for the regret bound as shown from Eq.\eqref{eqn:combinetwoparts} to Eq.\eqref{eq:regretend}, we obtain the regret bound for the case of $p^* < 1$. \end{proof} \subsection{Discussions} We may further improve the bound in Theorem \ref{thm:cucb individual} as follows, when all the triggering probabilities are $1$. \paragraph{Improving the coefficient of the leading term when $\forall i, p_i=1 $.} In general, we can set $\bar{\mu}_i = \hat{\mu}_i +\sqrt{y/(2T_{i})}$ for some $y$ in line~6 in the CUCB algorithm. The corresponding regret bound obtained is \[ \sum_{i\in [m], K_i>0} \left( \frac{2\cdot y}{(f^{-1}(\Delta_{\min}^i))^2} \cdot \Delta^{i}_{\min} + \int_{\Delta^{i}_{\min}}^{\Delta^{i}_{\max}} \frac{2\cdot y}{(f^{-1}(x))^2} \mathrm{d}x \right) + \left(1 + \sum_{\chgins{t=1}}^n\frac{2t}{e^{-y}} \right)\cdot m \cdot \Delta_{\max}. \] What we need is to make sure the term $\sum_{\chgins{t=1}}^n\frac{2t}{e^{-y}}$ in the above regret bound converges. We can thus set $y$ appropriately to guarantee convergence while improving the constant in the leading term. One way is setting $y=(1+c)\ln t$ with a constant $c>1$, or equivalently setting $\bar{\mu}_i = \hat{\mu}_i +\sqrt{(1+c)\ln t/(2T_{i})}$, so that $\sum_{\chgins{t=1}}^n\frac{2t}{e^{-y}} = 2\sum_{\chgins{t=1}}^n t^{-c} \le 2\zeta(c) $, where $\zeta(c)=\sum_{t=1}^\infty \frac{1}{t^{c}}$ is the Riemann's zeta function, and has a finite value when $c>1$. Then the regret bound is \[ \sum_{i\in [m], K_i>0 } \left( \frac{2\cdot(1+c)\cdot\ln n}{(f^{-1}(\Delta_{\min}^i))^2} \cdot \Delta^{i}_{\min} + \int_{\Delta^{i}_{\min}}^{\Delta^{i}_{\max}} \frac{2\cdot(1+c)\cdot\ln n}{(f^{-1}(x))^2} \mathrm{d}x \right) + (2\cdot \zeta(c)+1)\cdot m \cdot \Delta_{\max}. \] We can also further improve the constant factor from $2(1+c)$ to $4$ by setting $\bar{\mu}_i = \hat{\mu}_i +\sqrt{\frac{2\ln t + \ln\ln t}{2T_{i}}}$ at the cost of a second order $\ln\ln n$ term as in~\cite{Garivier2011}, with regret at most \[ \sum_{i\in [m], K_i>0} \left( \frac{2 \cdot(2\ln n +\ln\ln n)}{(f^{-1}(\Delta_{\min}^i))^2} \cdot \Delta^{i}_{\min} + \int_{\Delta^{i}_{\min}}^{\Delta^{i}_{\max}} \frac{2\cdot(2\ln n +\ln\ln n)}{(f^{-1}(x))^2} \mathrm{d}x \right) + (1+2\ln\ln n)\cdot m \cdot \Delta_{\max}. \] This is because $\sum_{\chgins{t=1}}^n\frac{1}{t\ln t}\leq \int_{m}^{n} \frac{1}{t\ln t} \mathrm{d}t\leq \ln\ln n$ when $m >e$. \paragraph{Comparing to classical MAB.} As we discussed earlier, the classical MAB is a special instance of our CMAB framework in which each super arm is a simple arm, $p_i=1$ for all $i\in [m]$, function $f(\cdot)$ is the identity function, and $\alpha=\beta=1$. Notice that $\Delta_{\max}^i = \Delta_{\min}^i$. Thus, by Theorem~\ref{thm:cucb individual}, the regret bound of the classical MAB is \begin{equation} \label{eq:mabnew} \sum_{i\in [m],\Delta^i>0} \frac{6\ln n }{\Delta^i} + \left( \frac{\pi^2}{3}+1 \right) \cdot m \cdot \Delta_{\max}, \end{equation} where $\Delta^i=\max_{j\in [m]} \mu_j-\mu_i$. Comparing with the regret bound in Theorem~1 of~\cite{AuerCF02}, we see that we even have a better coefficient $\sum_{i\in [m],\Delta^i>0} 6/\Delta^i$ in the leading $\ln n$ term than the one $\sum_{i\in [m],\Delta^i>0} 8/\Delta^i$ in the original analysis of UCB1.\footnote{We remark that the constant of UCB1 has been tightened to the optimum~\citep{Garivier2011}.} The improvement is due to a tighter analysis, and is the reason that we obtained improved regret over~\cite{Yi2012}. \chgins{Thus, the regret upper bound of our CUCB algorithm when applying to the classical MAB problem is at the same level (up to a constant factor) as UCB1, which is designed specifically for the MAB problem.} \vspace{0pt} \section{Applications} \label{sec:app} In this section, we describe two applications with non-linear reward functions as well as the class of linear reward applications that fit our CMAB framework. Notice that, the probabilistic maximum coverage bandit and social influence maximization bandit are also instances of the online submodular maximization problem, which can be addressed in the adversarial setting by~\cite{Streeter2008}, but we are not aware of their counterpart in the stochastic setting. \vspace{0pt} \subsection{Probabilistic maximum coverage bandit} The online advertisement placement application discussed in the introduction can be modeled by the bandit version of the probabilistic maximum coverage (PMC) problem. PMC has as input a weighted bipartite graph $G=(L,R,E)$ where each edge $(u,v)$ has a probability $p(u,v)$, and it needs to find a set $S\subseteq L$ of size $k$ that maximizes the expected number of activated nodes in $R$, where a node $v\in R$ can be activated by a node $u\in S$ with an independent probability of $p(u,v)$. In the advertisement placement scenario, $L$ is the set of web pages, $R$ is the set of users, and $p(u,v)$ is the probability that user $v$ clicks the advertisement on page $u$. PMC problem is NP-hard, since when all edge probabilities are $1$, it becomes the NP-hard Maximum Coverage problem. Using submodular set function maximization technique~\citep{NWF78}, it can be easily shown that there exists a deterministic $(1-1/e)$ approximation algorithm for the PMC problem, which means that we have a $(1-1/e,1)$-approximation oracle for PMC. The PMC bandit problem is that edge probabilities are unknown, and one repeatedly selects $k$ targets in $L$ in multiple rounds, observes all edge activations and adjusts target selection accordingly in order to maximize the total number of activated nodes over all rounds. We can formulate this problem as an instance in the CMAB framework. Each edge $(u,v)\in E$ represents an arm, and each play of the arm is a $0$-$1$ Bernoulli random variable with parameter $p_{u,v}$. A super arm is the set of edges $E_S$ incident to a set $S\subseteq L$ of size $k$. The reward of $E_S$ is the number of activated nodes in $R$, which is the number of nodes in $R$ that are incident to at least one edge in $E_S$ with outcome $1$. Since all arms are independent Bernoulli random variables, we know that the expected reward only depends on the probabilities on all edges. In particular we have that the expected reward $r_{{\boldsymbol \mu}}(E_S)=\sum_{v\in R} (1-\prod_{u\in L, (u,v)\in E_S}(1-p(u,v)))$. Note that this expected reward function is not linear in ${\boldsymbol \mu}=\{p(u,v)\}_{(u,v)\in E}$. For all arm $i\in E$, we have $p_i=1$, that is, we do not have probabilistically triggered arms. The monotonicity property is straightforward. The bounded smoothness function is $f(x) = |E|\cdot x$, i.e., increasing all probabilities of all arms in a super arm by $x$ can increase the expected number of activated nodes in $V$ by at most $|E|\cdot x$. Since $f(\cdot)$ is a linear function, the integral in Eq.(\ref{eqn:detailed regret bound}) has a closed form. In particular, by Theorem~\ref{thm:cucb individual}, we know that the distribution-dependent $(1-1/e,1)$-approximation regret bound of our CUCB algorithm on PMC bandit is \vspace{-1mm} \[ \sum_{i\in E, K_i>0} \frac{12\cdot |E|^2\cdot \ln n}{\Delta^i_{\min}} +\left(\frac{\pi^2}{3}+1\right)\cdot |E| \cdot \Delta_{\max}. \] Notice that all edges incident to a node $u\in L$ are always played together. In other words, these edges can share one counter. We call these arms (edges) as {\em clustered arms}. It is possible to exploit this property to improve the coefficient of the $\ln n$ term, so that the summation is not among all edges but only nodes in $L$. (See Section 4.1 and the supplementary material of~\cite{CWY13} for the regret bound and analysis for the case of clustered arms). From Theorem~\ref{thm:worstbound}, we also have the distribution-independent regret bound of \[ \sqrt{24 |E|^{3} n \ln n} + \left(\frac{\pi^2}{3}+1\right)\cdot |E| \cdot \Delta_{\max}. \] Note that for the PMC bandit, $\Delta_{\max}$ is at most the number of vertices covered in $R$, and thus $\Delta_{\max} \le |R|$. \vspace{0pt} \subsection{Combinatorial bandits with linear rewards} \label{sec:linear} \cite{Yi2012} studied the {\em Learning with Linear Reward} policy (LLR). Their formulation is close to ours except that their reward function must be linear. In their setting, there are $m$ underlying arms. There are a finite number of super arms, each of which consists of a set of underlying arms $S$ together with a set of coefficients $\{w_{i,S} \mid i\in S\}$. The reward of playing super arm $S$ is $\sum_{i\in S}w_{i,S} \cdot X_i$, where $X_i$ is the random outcome of arm $i$. The formulation can model a lot of bandit problems appeared in the literature, e.g., multiple plays, shortest path, minimum spanning tree and maximum weighted matching. Our framework contains such linear reward problems as special cases.\footnote{To include the linear reward case, we allow two super arms with the same set of underlying arms to have different sets of coefficients. This is fine as long as the oracle could output super arms with appropriate parameters.} In particular, let $L=\max_S |S|$ and $a_{\max}=\max_{i,S} w_{i,S}$, and we have the bounded smoothness function $f(x) = a_{\max}\cdot L \cdot x$. In this setting we have $p_i=1$ for all $i\in [m]$. By applying Theorem~\ref{thm:cucb individual}, the regret bound is \[ \left( \sum_{ i\in[m], K_i>0}\frac{12\cdot a_{\max}^2\cdot L^2 \cdot \ln n}{\Delta_{\min}^i}\right) + \left(\frac{\pi^2}{3}+1\right)\cdot m \cdot \Delta_{\max}. \] Our result significantly improves the coefficient of the leading $\ln n$ term comparing to Theorem 2 of~\citep{Yi2012} in two aspects: (a) we remove a factor of $L+1$; and (b) the coefficient $\sum_{ i\in[m], \Delta_{\min}^i >0}1/\Delta_{\min}^i$ is likely to be much smaller than $m\cdot\Delta_{\max}/(\Delta_{\min})^2$ in~\citep{Yi2012}. This demonstrates that while our framework covers a much larger class of problems, we are still able to provide much tighter analysis than the one for linear reward bandits. Moreover, applying Theorem~\ref{thm:worstbound} we can obtain distribution-independent bound for combinatorial bandits with linear rewards, which is not provided in~\citep{Yi2012}: \[ a_{\max} L \sqrt{24m n \ln n} + \left(\frac{\pi^2}{3}+1\right)\cdot m \cdot \Delta_{\max}. \] Note that, for the class of linear bandits, the reward is at most $a_{\max}\cdot L$, and thus $\Delta_{\max}\le a_{\max}\cdot L$. \chgins{ We remark that, in a latest paper, \citet{KWAS15} show that the above regret bounds can be improved to $O(L \log n \sum_i 1 / \Delta_{\min}^i)$ for distribution-dependent regret and $O(\sqrt{L m n \log n})$ for distribution-independent regret, respectively, which are tight (up to a factor of $\sqrt{\log n}$ for the distribution-independent bound). The improvement is achieved by a weaker and non-uniform sufficient sampling condition --- in our analysis, we require all relevant base arms of a super arm $S_t$ played in round $t$ to be sufficiently sampled to ensure that $S_t$ cannot be a bad super arm (Lemma~\ref{lem:impossible}), but in \citep{KWAS15}, they relax this and show that it is enough to have sufficiently many base arms to be sampled sufficiently many times, while the rest arms only need to satisfy some weaker sufficient sampling condition. The intuition is that due to linear reward summation, as long as many base arms are sufficiently sampled and the rest have a weaker sufficiently sampled condition, the sum of the errors would be still small enough to guarantee that a good super arm is selected by the oracle. However, it is unclear if this technique can be applied to non-linear reward functions satisfying our bounded smoothness assumption, since the estimate error of each base arm may not linearly affect the estimate error in the expected reward. } \subsection{Application to social influence maximization} \label{sec:infmax} In social influence maximization with the independent cascade model \citep{kempe03}, we are given a directed graph $G=(V,E)$, where every edge $(u,v)$ is associated with an unknown {\em influence probability} $p_{u,v}$. Initially, a seed set $S\subseteq V$ are selected and activated. In each iteration of the diffusion process, each node $u$ activated in the previous iteration has one chance of activating its inactive outgoing neighbor $v$ independently with probability $p_{u,v}$. The reward of $S$ after the diffusion process is the total number of activated nodes in the end. Influence maximization is to find a seed set $S$ of at most $k$ nodes that maximize the expected reward, also referred to as the {\em influence spread } of seed set $S$. \cite{kempe03} show that the problem is NP-hard and provide an algorithm with approximation ratio $1-1/e-\varepsilon$ with success probability ($1-1/|E|$) for any fixed $\varepsilon >0$. This means that we have a $(1-1/e-\varepsilon,1-1/|E|)$-approximation oracle. In the CMAB framework, we do not know the activation probabilities of edges and want to learn them during repeated seed selections while maximizing overall reward. Each edge in $E$ is considered as a base arm, and a super arm in this setting is the set $E_S$ of edges incident to the seed set $S$. Note that these edges will be deterministically triggered, but other edges not in $E_S$ may also be triggered, and the reward is related to all the triggered arms. Therefore, this is an instance where arms may be probabilistically triggered, and thus $p_i<1$ for some $i\in E$. It is straightforward to see that the expected reward function is still a function of probabilities on all edges, and the monotonicity holds. However, bounded smoothness property is nontrivial to argue, as we will show in the following lemma. \begin{mylem} The social influence maximization instance satisfies the bounded smoothness property with bounded smoothness function $f(x)=|E||V|x$. \label{lem:social} \end{mylem} \begin{proof} For the social influence maximization bandit, the expectation vector ${\boldsymbol \mu}$ is the vector of all probabilities on all edges. For a seed set $S\subseteq V$, the corresponding super arm is the set $E_S$ of edges incident to vertices in $S$. Without loss of generality, we assume that for any edge $i\in E$, its probability $\mu_i>0$. Then for super arm $E_S$, the set of base arms that can be triggered by $E_S$, denoted as $\trig{E}_S$, is exactly the set of edges reachable from seed set $S$ (an edge $(u,v)$ reachable from a set $S$ means its starting vertex $u$ is reachable from $S$). By Definition~\ref{def:assumptions}, to show bounded smoothness with bounded smoothness function $f(x)=|E||V|x$, we need to show that for any two expectation vectors ${\boldsymbol \mu}$ and ${\boldsymbol \mu}'$ and for any $\Lambda > 0$, we have $|r_{{\boldsymbol \mu}}(E_S) - r_{{\boldsymbol \mu}'}(E_S)| \leq f(\Lambda)$ if $\max_{i\in \trig{E}_S}|\mu_i - \mu_i'|\le \Lambda$. Since we know that monotonicity holds, it is sufficient to assume that for all $i\in \trig{E}_S$, $\mu_i = \mu'_i + \Lambda$. This is because without loss of generality, we can assume $r_{{\boldsymbol \mu}}(E_S) \ge r_{{\boldsymbol \mu}'}(E_S)$, and if $\mu_i < \mu'_i + \Lambda$ we can increase $\mu_i$ and decrease $\mu'_i$ such that $\mu_i = \mu'_i + \Lambda$, and this only increase the gap between $r_{{\boldsymbol \mu}}(E_S)$ and $r_{{\boldsymbol \mu}'}(E_S)$. Thus, henceforth let us assume that $i\in \trig{E}_S$, $\mu_i = \mu'_i + \Lambda$. Starting from ${\boldsymbol \mu}'$, we take one edge $i_1$ in $\trig{E}_S$, and increase $\mu'_{i_1}$ to $\mu'_{i_1}+\Lambda = \mu_{i_1}$ to get a new vection ${\boldsymbol \mu}^{(1)}$. Suppose the edge $i_1$ is $(u_1, v_1)$. Comparing ${\boldsymbol \mu}'$ with ${\boldsymbol \mu}^{(1)}$, the only difference is that the probability on edge $(u_1, v_1)$ increases by $\Lambda$. For the influence spread of seed set $S$, the above change increases the activation probability of $v_1$ and every node reachable from $v_1$ by at most $\Lambda$. Thus the total increase of influence spread is at most $|V| \Lambda$. Then we select the second edge $i_2$ in $\trig{E}_S$ and increases its probability by $\Lambda$. By the same argument, the influence spread increases at most $|V|\Lambda$. Repeating the above process, after selecting all edges in $\trig{E}_S$, we obtain probability vector ${\boldsymbol \mu}^{(s)}$ where $s = |\trig{E}_S|$, and the increase in influence spread is at most $s|V|\Lambda$. Comparing vector ${\boldsymbol \mu}^{(s)}$ with ${\boldsymbol \mu}$, they are the same on all edges in $\trig{E}_S$, and may only differ in the rest of edges. However, since the rest of edges cannot be reachable from $S$, their difference will not affect the influence spread of $S$. Therefore, we know that the difference between influence spread $r_{{\boldsymbol \mu}}(E_S)$ and $r_{{\boldsymbol \mu}'}(E_S)$ is at most $s|V|\Lambda \le |E||V| \Lambda$. This concludes that if we use function $f(x)=|E||V|x$, the bounded smoothness property holds. \end{proof} \paragraph{Remark.} In Section 4.2 of~\citep{CWY13}, we made a claim that social influence maximization bandit satisfies the bounded smoothness property (with function $f(x)=|E||V|x$) that does not consider probabilistically triggered arms, that is, it satisfies the property that for any two expectation vectors ${\boldsymbol \mu}$ and ${\boldsymbol \mu}'$ and for any $\Lambda > 0$, $|r_{{\boldsymbol \mu}}(E_S) - r_{{\boldsymbol \mu}'}(E_S)| \leq f(\Lambda)$ if $\max_{i\in E_S}|\mu_i - \mu_i'|\le \Lambda$. This claim is incorrect. For example, all edges in $E_S$ could have the same probability (and thus we could have $\Lambda$ to be arbitrarily small), but other edges reachable from $E_S$ have different probabilities, and thus the gap between $r_{{\boldsymbol \mu}}(E_S)$ and $r_{{\boldsymbol \mu}'}(E_S)$ will not be arbitrarily small and cannot be bounded by $f(\Lambda)$ for any continuous $f$ tending to zero when $\Lambda$ tends to zero. \chgred{With $f(x)=|E||V|x$, we have $\ell_n(\Delta,p)= \max\left (\frac{12\cdot \ln n}{(f^{-1}(\Delta))^2\cdot p}, \frac{24\cdot \ln n}{p} \right ) = \max \left (\frac{12 |V|^2|E|^2 \ln n}{\Delta^2\cdot p}, \frac{24\cdot \ln n}{p} \right )$. Since $\Delta$ is at most $\Delta_{\max}$ in the regret bound and $\Delta_{\max}\le |V|$, it is clear that we have $\ell_n(\Delta,p)= \frac{12 |V|^2|E|^2 \ln n}{\Delta^2\cdot p}$. Then applying Theorem \ref{thm:cucb individual}, we know that the distribution-dependent $(1-1/e-\varepsilon,1-1/|E|)$-approximation regret bound of the CUCB algorithm on influence maximization is:} \[ \sum_{i\in E, K_i>0} \frac{24\cdot |V|^2|E|^2\cdot \ln n}{\Delta^i_{\min} \cdot p_i} \chgred{+\left(\frac{\pi^2}{2}+1\right)\cdot |E| \cdot \Delta_{\max}}. \] \chgred{With Theorem~\ref{thm:worstbound} (and further using $\ell_n(\Delta,p)= \frac{12 |V|^2|E|^2 \ln n}{\Delta^2\cdot p}$ instead of the relaxed $\ell_n(\Delta,p)= \frac{12 |V|^2|E|^2 \ln n}{\Delta^2\cdot p} + \frac{24\cdot \ln n}{p}$ as in the proof of Theorem~\ref{thm:worstbound}), we obtain the distribution-independent bound:} \[ |V|\sqrt{\frac{48|E|^3 n \ln n}{p^*} } + \chgred{\left(\frac{\pi^2}{2}+1\right)\cdot |E| \cdot \Delta_{\max}}. \] \vspace{0pt} \section{Conclusion} \label{sec:conclude} In this paper, we propose the first general stochastic CMAB framework that accommodates a large class of nonlinear reward functions among combinatorial and stochastic arms, and it even accommodates probabilistically triggered arms such as what occurs in the viral marketing application. We provide CUCB algorithm with tight analysis on its distribution-dependent and distribution-independent regret bounds and applications to new practical combinatorial bandit problems. There are many possible future directions from this work. One may study the CMAB problems with Markovian outcome distributions on arms, or the restless version of CMAB, in which the states of arms continue to evolve even if they are not played. \chgins{ Another direction is to investigate if some of the results in this paper are tight or can be further improved. For example, for the nonlinear bounded smoothness function $f(x) = \gamma \cdot x^\omega$ with $\omega < 1$, if our bound in Theorem~\ref{thm:worstbound} is tight or can be improved; and for the case of probabilistic triggering, if the regret bound dependency on $1/p_i$ is necessary. For the latter case, one may also look into improvement specifically for the influence maximization application. } \chgins{For nonlinear reward functions, currently we assume that the expected reward is a function of the expectation vector of base arms. One may also look into the more general cases where the expected reward depends not only on the expected outcomes of base arms.}
{'timestamp': '2016-03-30T02:03:25', 'yymm': '1407', 'arxiv_id': '1407.8339', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8339'}
arxiv
\section{Introduction}\label{sect:intro} \begin{quote} \textit{``Good pitching will always stop good hitting and vice-versa.''} \end{quote} \begin{flushright} \footnotesize---Casey Stengel \end{flushright}\vspace*{6pt} Getting a hit off of a major league pitcher is one of the hardest tasks in all of sports. Consider the fact that a batter in possession of detailed knowledge of a~pitcher's processes for determining pitches to throw would have a large advantage for exploiting that pitcher to get on base [\citet{bbcoach}]. Pitchers apparently reveal an enormous amount of information regarding their behaviour through their historical game data [\citet{tap}]. However, making effective use of this data is challenging. This manuscript uses statistical and machine learning techniques to: (i) represent specific pitcher and general pitching behaviour by Markov processes whose transition probabilities are estimated, (ii) generate optimal batting strategies against these processes, both in the general and pitcher-specific sense, (iii) evaluate those strategies on data not used in their creation, (iv) investigate the implication of the strategies on pitcher exploitability, and (v) establish the viability of the use of algorithmically/empirically-derived batting strategies in real-world settings. These goals are accomplished by a detailed analysis of two seasons of US Major League Baseball pitch-by-pitch data. Parsimony assumptions are necessary to appropriately represent a pitcher's behaviour. For each pitcher, it is assumed that their pitch behaviour is stochastic and governed by one-step Markovian assumptions on the pitch count. Specifically, each of the twelve unique nonterminal states of the pitch count are modeled as a Markov process. It is further assumed that the relevant transition probabilities can be estimated by data of observed pitch selections at the twelve unique pitch counts. It should be noted that the transition could be estimated for a particular pitcher based on their historical data, or historical data for a representative collection of pitchers to investigate general pitching behaviour. It is herein demonstrated that a pitcher's decisions can be exploited by a data-informed batting strategy that takes advantage of their mistakes at each pitch count in the at-bat. To elaborate, if indeed a pitcher's behaviour is well modeled by a Markov process on the pitch count, a batter informed of the relevant transition probabilities is presented with a Markov Decision Process (MDP) to swing or stay at a given pitch count. Optimal batting strategies for MDPs can be found by a Reinforcement Learning (RL) algorithm. RL is a subset of artificial intelligence for finding (Value Iteration) and evaluating (Policy Evaluation) optimal strategies in stochastic settings governed by Markov processes. It has been used successfully in sports gamesmanship, via the study of offensive play calling in American football [\citet {ndp}]; see Section \ref{sect:ndpdisc} for further discussion. The RL Value Iteration algorithm applied to the pitcher-specific Markov transition probabilities yields a pitcher-specific batting strategy. In the event that the Markov transition probabilities were estimated from a representative collection of pitchers, a general optimal batting strategy would result from RL Value Iteration. An important component of the development of optimal batting strategy is their evaluation. To this end, RL Policy Evaluation is used to investigate the performance of batting strategies on pitcher-specific and general Markov transition probabilities estimated from data not used in the RL Value Iteration algorithm to develop the strategies. A schematic of the analysis pipeline is given in Figure \ref{fig:diagram}. \begin{figure} \includegraphics{712f01.eps} \caption{A schematic of the Reinforcement Learning Value Iteration and Policy Evaluation analysis of two seasons of MLB data.}\label{fig:diagram} \end{figure} In addition to evaluating the batting strategies on new data, comparison of the performance of the pitcher-specific and general batting strategies yields important information on the utility of an optimal, data-informed batting strategy against a specific pitcher. To this point, a pitcher has been \textit{exploited} if Policy Evaluation suggests that the pitcher-specific optimal batting strategy against them is superior to the general optimal batting strategy, with their difference or ratio estimating the degree of exploitability. The term ``exploited'' is used in the sense that an opposing batter would be well served in carefully studying that pitcher's historical data, rather than executing a general strategy. Given this framework, it is possible to investigate hypotheses on general pitcher exploitability using permutation tests. However, the nature of the tests requires assumptions on the direction of the alternative. Under the assumption that all pitchers are not equally exploitable, the hypothesis that pitchers can be exploited more than 50\% of the time can be investigated. This hypothesis was not rejected at a 5\% error rate. Under the assumption that all pitchers are equally exploitable, the hypothesis was rejected. It is our opinion that the assumption of unequal exploitability is better suited for baseball's at-bat setting (see Section \ref{sect:comps}). Thus, this manuscript is the first to provide statistical evidence in support of strategizing against specific pitchers instead of a group of pitchers. To highlight the utility of an optimal pitcher-specific batting strategy for an exploitable pitcher, a data-driven validation was conceived. This validation associates spatial trajectories with the pitch-type that was employed. The spatial component is a classifier that estimates the pitch-type of a batter-parameterized spatial trajectory after training over the respective pitcher's actual pitch trajectories. The estimated pitch-type selects the batting action from the exploited pitcher's pitcher-specific batting strategy (Section \ref{sect:stratspat}; the schematic diagram outlining this process is provided in Figure \ref{fig:strategy}). The simulation therefore uses the spatial and strategic component to realistically simulate a batter's performance when facing an exploited pitcher. The batter's actual and simulated statistics when facing the respective pitcher are then compared using typical baseball statistics. It was found that heuristically-labeled ``elite'' batters' simulated statistics are worse than their actual statistics. However, it was also found that the (also heuristically-labeled) ``nonelite''\setcounter{footnote}{1}\footnote{In our study, nonelite batters are excellent players, some having participated in the MLB All-Star game.} batters' simulated statistics were greatly improved from their actual statistics. The simulation results suggest that an exploited pitcher's pitcher-specific strategies are useful for nonelite batters. The manuscript is laid out as follows: The section immediately following this paragraph provides a very brief demonstration of Reinforcement Learning algorithms to help stimulate understanding, Section \ref{sect:ndp} discusses the strategic component, which applies Reinforcement Learning algorithms to Markov processes to compute \textit {and} evaluate the respective batting strategies, and Section \ref{spatdesc} discusses the spatial component, which simulates a specific batter's performance using an exploited pitcher's pitcher-specific batting strategy. Section \ref{methods} provides the methodology used to produce the results given in Section \ref{results}. \begin{figure} \includegraphics{712f02.eps} \caption{GridWorld. The values in the right grid are determined using Policy Evaluation with a policy that randomly selects one of the four actions at each state. Reprinted with permission from Richard S. Sutton and Andrew G. Barto, Reinforcement Learning: An Introduction, published by The MIT Press.}\label{fig:gw} \end{figure} \subsection*{Reinforcement Learning tutorial}\label{sect:toy} Reinforcement Learning focuses on the problem of \textit {decision-making facing uncertainty}, which are settings where the decision-maker (agent) interacts with a new, or unfamiliar, environment. The agent continually interacts with the environment by selecting actions, where the environment then responds to these actions and presents new scenarios to the agent [\citet{sb}]. This environment also provides \textit{rewards}, which are numerical values that act as feedback for the action selected by the agent in the environment. At time-unit \textit{t}, the agent is given the environment's state $s_t \in\mathcal{S}$, and selects action $a_t \in\mathcal{A}(s_t)$, where $\mathcal{A}(s_t)$ is the set of all possible actions that can be taken at state $s_t$. Selecting this action increments the time-unit, giving the agent a reward of $r_{t+1}$ and also causing it to transition to state $s_{t+1}$. Reinforcement Learning methods focus on how the agent changes its decision-making as a consequence of its experiment in the respective environment. The agent's goal is to use its knowledge of the environment to maximize its reward over the long run. Specifying the environment therefore defines an instance of the Reinforcement Learning problem [\citet{sb}] that can be studied further. \textit{GridWorld} (Figure \ref{fig:gw}) is a canonical example that illustrates how Reinforcement Learning algorithms can be applied to various settings. In this example, there are four equiprobable actions that can be taken at each square (state): left, right, up and down, where each action is selected at random Any action taken at either square A or B yields a reward of $+10$ and $+5$, respectively, and transports the user to square A$^\prime$ or B$^\prime$, respectively. For all other squares, a reward of 0 is given for actions that do not result in falling off the grid, where the latter outcome results in a reward of~$-1$. The negative values in the lower parts of the grid demonstrate that the expected reward of square A is below its immediate reward because after we are transported to square A$^\prime$, we are likely to fall off the grid. Conversely, the expected reward of square B is higher than its immediate reward because after we are transported to square B$^\prime$, the possibility of running off the grid is compensated for by the possibility of running into square A or B [\citet{sb}]. Employing Reinforcement Learning algorithms in various real-world settings allows us to ``balance'' the immediate and future rewards afforded by the outcomes at each state with their respective probabilities. This approach enables the computation of a sequence of actions, or \textit{policy}, that maximize the immediate reward while considering the consequences of these actions. \section{Strategic component---Reinforcement Learning in baseball (RLIB)}\label{sect:ndp} \subsection{Markov processes}\label{subsect:markov} Let $\{X^{(t)} \}$ be a Markov process with finite state space ${\cal S} = \{E_1, \ldots, E_n\}$ where the states represent pitch counts. We assume stationary transition probabilities. That is, $p_{E_k \rightarrow E_j} = P(X^{(t)} = E_j | X^{(t-1)} = E_{k})$ for $E_j, E_k \in{\cal S}$ is the same for all $t$ [\citet{feller}]. Figure \ref{fig:markovrep} displays the Markov transition diagram omitting the absorbing states (hit, out and walk). We define optimal policies as a set of actions that maximize the expected reward at every state in a Markov process. Conditioning on a batter's action at a state yields the probability distribution for the immediate and future state. Since the at-bat always starts from the $s_0 = \{0,0\}$ state, the long-term reward is defined as \begin{equation} \label{eqn:vf} J^*(s_0) = \max_{\pi= \{u^0,\ldots, u^T \}} \mathbb{E} \Biggl\{\sum_{t=0}^T g\bigl(s_t, u^t,s_{t+1}\bigr) \Big| s_0 = \{0,0\}, \pi \Biggr\}, \end{equation} where: \begin{itemize} \item$\{s_t\}$ is the sequence of states, or pitch counts, in the state space $\mathcal{S}$ visited by the batter for the respective at-bat. We define the set of \textit{terminal states}---that is, states that conclude the at-bat---as $\mathcal{E} = \{\mathrm{O},\mathrm{S},\mathrm {D},\mathrm{T},\break\mathrm{HR}, \mathrm{W}\} \subset\mathcal{S}$, where \textup{O, S, D, T, HR, W} are abbreviations for Out, Single, Double, Triple, Home Run and Walk, respectively. \item$\pi= \{u^0,\ldots, u^T\}$ is the best batting strategy that contains the batting actions that maximize the expected reward of every state. Since the batter can Swing or Stand at each state, it follows that $u= \mathrm{Swing}$ or $u= \mathrm{Stand}$ for each nonterminal state \item$g(s_t,u^t,s_{t+1})$ is the reward function whose output reflects the batter's preference of transitioning to state $s_{t+1}$ when selecting the best batting action $u^t$ from state $s_t$. The reward function used in our study is \[ g(i,u,j) = \cases{ 0, &\quad$\mbox{if \textit{j}${}={}$\{O\} or $j \in\mathcal{S}\cap\mathcal {E}^c$},$\vspace*{2pt} \cr 1, &\quad$\mbox{if \textit{j}${}={}$\{W\} and \textit{u}${}={}$Stand},$ \vspace*{2pt} \cr 2, &\quad$ \mbox{if \textit{j}${}={}$\{S\} and \textit{u}${}={}$Swing},$ \vspace*{2pt} \cr 3, &\quad$\mbox{if \textit{j}${}={}$\{D\} and \textit{u}${}={}$Swing},$ \vspace*{2pt} \cr 4, &\quad$\mbox{if \textit{j}${}={}$\{T\} and \textit{u}${}={}$Swing},$ \vspace*{2pt} \cr 5, &\quad$\mbox{if \textit{j}${}={}$ \{HR\} and \textit{u}${}={}$Swing}$ } \qquad\forall i \notin\mathcal{E}. \] Further information on our formulation of the reward function can be found in Section \ref{sect:stratdisc}. \end{itemize} \begin{figure} \includegraphics{712f03.eps} \caption{Our view of an at-bat as a Markov process, where each oval denotes the state $\{B,S\}$ in the at-bat, where $B$ and $S$ are the number of balls and strikes, respectively, arrows represent transitions, and $t$ is the time unit that is the number of pitches thrown in the respective at-bat. Asterisks denote that some states at the respective time-unit are still valid transitions at higher time-units---that is, if a batter fouls off a pitch at $t=3$ in the $\{1,2\}$ pitch count, they will still be in this state at $t=4$. We omit the terminal (absorbing) states for neatness.} \label{fig:markovrep} \end{figure} \begin{figure} \includegraphics{712f04.eps} \caption{Illustration of the two-stage process of computing and evaluating the batting strategy that is computed over the input training data. This strategy is then given as input, along with the test data's transition probability matrix $P^{\textsc{\scriptsize Test}}$, to the Policy Evaluation algorithm, which outputs the expected rewards for each state when following batting strategy~$\pi$.} \label{fig:strategy} \end{figure} Equation (\ref{eqn:vf}) can be viewed as the maximized expected reward of state $\{0,0\}$ when following batting strategy $\pi$, which is comprised of actions that maximize the expected reward over all of the at-bats $\{s_t\}$ given as input [\citet{ndpref}]. To find the batting actions that comprise the best batting strategy, we find the batting action $u$ that satisfies the optimal expected reward function for state $i$ [\citet{ndpref}]: \begin{equation} \label{eqn:opvalstate} J^*(i) = \max_{u \in U} \biggl[ \sum _{j \in\mathcal{S}} P_u^{\textsc {\scriptsize{Training}}}(i,j) \bigl(g(i,u,j) + J^*(j)\bigr) \biggr]\qquad \forall i \in \mathcal{S}\cap\mathcal{E}^c, \end{equation} where $P_u^{\textsc{\scriptsize Training}}(i,j)$ is an estimated probability of transitioning from state \textit{i} to \textit{j} when selecting batting action \textit{u} on the pitch-by-pitch data and $J^*(i)$ is the maximized expected reward of state $i$ when selecting the action $u$ that achieves this maximum. The Value Iteration algorithm, shown in Figure \ref{fig:valueiteration}, solves for the batting actions that satisfy equation (\ref{eqn:opvalstate}). Intuitively, the algorithm keeps iterating until the state's reward function is close to its optimal reward function $J^*$, where in the limit $J^* = \lim_{k\to\infty }J^k(i)\ \forall i \in\mathcal{S}$ [\citet{ndp}]. The algorithm terminates upon satisfying the convergence criterion $\Delta< \varepsilon $, where $\varepsilon= 2.22\times10^{-16}$ is the machine-epsilon predefined in the MATLAB programming language; this epsilon ensures that the reward functions of each state have approximately 15--16 digits of precision. The Policy Evaluation algorithm, shown in Figure \ref{fig:pealg}, uses the best batting strategy $\pi$ on a different season of the respective pitcher's pitch-by-pitch data to calculate the expected reward of each state in the at-bat, given by \begin{equation} \label{eqn:peeq} J^\pi(i) = \sum_{j \in\mathcal{S}} P_{\pi(i)}^{\textsc{\scriptsize Test}}(i,j) \bigl[g\bigl(i,\pi(i),j\bigr) + J^\pi(j) \bigr]\qquad \forall i \in\mathcal{S} \cap \mathcal{E}^c, \end{equation} where $J^\pi(i)$ is the expected reward of state $i$ when following the batting strategy~$\pi$. \begin{figure} \label{fig:valueiter}\vspace*{-20pt} \begin{pseudocode}[ruled]{Value Iteration}{P^{\textsc {\scriptsize Training}},g,\mathcal{S}, U} \REPEAT \Delta= 0 \\ \FOREACH i \in\mathcal{S}\cap\mathcal{E}^c \DO\\ \hspace*{8pt} v \gets J(i) \\ \hspace*{8pt} J(i) \gets\max_u \sum_{j} P_u^{\textsc{\scriptsize Training}}(i,j)[g(i,u,j) + J(j)] \\ \hspace*{8pt} \Delta\gets\max(\Delta, |v - J(i)|) \\ \UNTIL(\Delta< \varepsilon) \\ \OUTPUT{\mathrm{deterministic\ policy}\ \pi= \{u^0, \ldots, u^{n-1}\} } \end{pseudocode}\vspace*{-20pt} \caption{The Value Iteration algorithm outputs the batting strategy $\pi$ that maximizes the expectation at each state over the input data. Reprinted with permission from Richard S. Sutton and Andrew G. Barto, Reinforcement Learning: An Introduction, published by The MIT Press.} \label{fig:valueiteration} \end{figure} \begin{figure}[b]\vspace*{-20pt} \begin{pseudocode}[ruled]{Policy Evaluation}{P^{\textsc {\scriptsize Test}},g,\mathcal{S}, \pi} \REPEAT \Delta= 0 \\ \FOREACH i \in\mathcal{S}\cap\mathcal{E}^c \DO\\ \hspace*{8pt}v \gets J(i) \\ \hspace*{8pt}J(i) \gets \sum_{j} P_{\pi (i)}^{\textsc{\scriptsize Test}}(i,j) [g(i,\pi(i),j) + J(j)] \\ \hspace*{8pt}\Delta\gets\max(\Delta, |v - J(i)|) \\ \UNTIL(\Delta< \varepsilon) \\ \OUTPUT{\mathrm{J}^\pi} \end{pseudocode}\vspace*{-20pt} \caption{The Policy Evaluation algorithm, that calculates the expected rewards of every state when using the batting strategy $\pi $, given by $J^\pi\in\mathbb{R}^n$, on the input data. Reprinted with permission from Richard S. Sutton and Andrew G. Barto, Reinforcement Learning: An Introduction, published by The MIT Press.} \label{fig:pealg} \end{figure} The transition probability matrices estimated via the training and test data, represented by $P_u^{\textsc{\scriptsize Training}}(i,j)$ and $P_u^{\textsc{\scriptsize Test}}(i,j)$ in equations (\ref{eqn:opvalstate}) and (\ref {eqn:peeq}), respectively, are the transition probabilities used by Value Iteration and Policy Evaluation to compute and evaluate, respectively, the best batting strategy, $\pi$. The batting strategies are estimated against probability transitions matrices computed from either a population of at-bats for one season of a single pitcher's data (pitcher-specific batting strategy) or one season of a population of pitchers' data (general batting strategy; see Section \ref{sect:stratmeth}). Policy Evaluation therefore allows a quantitative comparison of the pitcher-specific and general batting strategies, $\pi^p$ and $\pi ^g$, on the same transition probabilities representing the pitcher's decision-making. Equation (\ref{eqn:peeq}) shows that the $\{0,0\}$ state's expected reward, denoted by $J(\{0,0\})$, requires the expected reward of every other state to be calculated first. It follows that $J(\{0,0\})$ is the expected reward of the entire at-bat. Thus, a pitcher is exploited if and only if $J^{\pi^p}(\{0,0\}) \geq J^{\pi ^g}(\{0,0\})$ [\citet{sb}] (see Section \ref{sect:comps}). \subsection{Models}\label{sect:models} The generality of the Markov process allows us to propose models with various degrees of resolution, which depends on the number of phenomena considered at each state. Below we outline two models of information resolution as useful starting points. \subsubsection{Simple RLIB (SRLIB)} \label{desc1} Initially, we represented a pitcher's decisions by conditioning the pitch outcome (reflected by the future pitch count) on the batter's action at the previous pitch count. SRLIB therefore has $n = |\mathcal {S}_S\cap\mathcal{E}^c| = 12$ nonterminal states \begin{eqnarray*} \mathcal{S}_S &=& \bigl\{\{0,0\},\{1,0\},\{2,0\},\{3,0\},\{ 0,1\},\{0,2\},\{1,1\},\{1,2\},\{2,1\},\{2,2\},\\ &&\hspace*{157pt}\{3,1\},\{3,2\},\mathrm {O},\mathrm{S},\mathrm{D},\mathrm{T},\mathrm{HR},\mathrm{W} \bigr\}. \end{eqnarray*} \subsubsection{Complex RLIB (CRLIB)}\label{desc2} CRLIB conditions the pitcher's selected pitch-type at the current pitch count on both the pitch-type and batting actions at the previous pitch count. We observed that the MLB GameDay system gave as many as 8 pitch-types for one pitcher. We therefore generalized pitch-types to four categories: fastball-type, curveball/changeup, sinking/sliding, and knuckleball/unknown pitches. Assuming the set of pitch-types is $\mathcal{T}$, our abstraction admits at most four pitch-types for every pitcher---that is, $|\mathcal {T}| \leq4$. The inclusion of pitch-types results in state space $\mathcal{S}_C = \{\mathcal{S}_S \cap\mathcal{E}^c\} \times\mathcal{T} \cup\mathcal {E}$, where every nonterminal state incorporates the four pitch-types at each pitch count, giving $n = |\{\mathcal{S}_S\cap\mathcal{E}^c\} \times\mathcal{T}| = 48$ nonterminal states, \begin{eqnarray*} \mathcal{S}_C& =& \bigl\{\{0,0\},\{1,0\},\{2,0\},\{3,0\},\{ 0,1\},\{0,2\},\{1,1\},\{1,2\},\{2,1\},\{2,2\},\\ &&\hspace*{243pt} \{3,1\},\{3,2\} \bigr\}\\ &&{} \times\mathcal{T} \cup\mathcal{E}. \end{eqnarray*} We represent the expected reward of the $\{0,0\}$ state as the weighted average over the expected rewards of the four pitch types associated with the $\{0,0\}$ state: \[ J^{\pi}\bigl(\{0,0\}\bigr) = \frac{1}{K}\sum _{t_i \in\mathcal{T}} K_{t_i}J^{\pi }\bigl(\{0,0\}\times t_i\bigr), \] where $K_{t_i}$ is the number of times pitch-type $t_i$ was thrown in the test data and $K$ is the total number of pitches in the test data. \begin{figure} {\fontsize{9.5}{11.8}\selectfont \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lc@{}} $ \pi_{\mathrm{SRLIB}}^p = \left[ \matrix{ \{0,0\} \vspace*{2pt}\cr \{1,0\} \vspace*{2pt}\cr \{2,0\} \vspace*{2pt}\cr \{3,0\} \vspace*{2pt}\cr \{0,1\} \vspace*{2pt}\cr \{0,2\} \vspace*{2pt}\cr \{1,1\} \vspace*{2pt}\cr \{1,2\} \vspace*{2pt}\cr \{2,1\} \vspace*{2pt}\cr \{2,2\} \vspace*{2pt}\cr \{3,1\} \vspace*{2pt}\cr \{3,2\}} \right] = \left[ \matrix{ 0 \vspace*{2pt}\cr 1 \vspace*{2pt}\cr 0 \vspace*{2pt}\cr 0 \vspace*{2pt}\cr 0 \vspace*{2pt}\cr 0 \vspace*{2pt}\cr 0 \vspace*{2pt}\cr 0 \vspace*{2pt}\cr 1 \vspace*{2pt}\cr 0 \vspace*{2pt}\cr 0 \vspace*{2pt}\cr 0}\right] $& $ \pi_{\mathrm{CRLIB}}^p = \left[ \matrix{ \left[ \matrix{ 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 }\right ]^{\top} \vspace*{2pt}\cr [ \mathrm{null} ]^{\top} \vspace*{2pt}\cr \left[ \matrix{ 0 & 0 & 1 & 1 & 1 & 0 & 0 & 0 & 1 & 0 & 1 & 0 } \right]^{\top} \vspace*{2pt}\cr [ \mathrm{null} ]^{\top} } \right] $\\\\ $ \pi_{\mathrm{SRLIB}}^g = \left[\matrix{ \{0,0\} \vspace*{2pt}\cr \{1,0\} \vspace*{2pt}\cr \{2,0\} \vspace*{2pt}\cr \{3,0\} \vspace*{2pt}\cr \{0,1\} \vspace*{2pt}\cr \{0,2\} \vspace*{2pt}\cr \{1,1\} \vspace*{2pt}\cr \{1,2\} \vspace*{2pt}\cr \{2,1\} \vspace*{2pt}\cr \{2,2\} \vspace*{2pt}\cr \{3,1\} \vspace*{2pt}\cr \{3,2\} } \right] = \left[ \matrix{ 0 \vspace*{2pt}\cr 0 \vspace*{2pt}\cr 1 \vspace*{2pt}\cr 1 \vspace*{2pt}\cr 0 \vspace*{2pt}\cr 0 \vspace*{2pt}\cr 0 \vspace*{2pt}\cr 0 \vspace*{2pt}\cr 0 \vspace*{2pt}\cr 0 \vspace*{2pt}\cr 0 \vspace*{2pt}\cr 0} \right] $& $ \pi_{\mathrm{CRLIB}}^g = \left[ \matrix{ \left[ \matrix{ 0 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & 1 }\right ]^{\top} \vspace*{2pt}\cr \left[ \matrix{ 0 & 0 & 0 & 1 & 0 & 0 & 1 & 1 & 1 & 0 & 1 & 1 }\right ]^{\top} \vspace*{2pt}\cr \left[ \matrix{ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 1 & 1 & 1 }\right ]^{\top} \vspace*{2pt}\cr [ \mathrm{null} ]^{\top}} \right] $ \end{tabular*}} \caption{The pitcher-specific and general strategies, denoted by $\pi^p$ and $\pi^g$, respectively, computed on SRLIB and CRLIB for the 2009 season. CRLIB's pitcher-specific batting strategy for Roy Halladay had an empty second and fourth row because the MLB GameDay system reported he did not throw any Sinking/sliding or Knuckleball/unknown type pitches in the training data; a similar argument holds for the general batting strategy's fourth row.} \label{fig:policies} \end{figure} \subsection{Illustration of batting strategies}\label{illust} We now illustrate the batting strategies that are produced by either SRLIB or CRLIB, respectively. As shown in Figure \ref{fig:policies}, SRLIB and CRLIB have \textit{n}-dimensional and ($n \times4$)-dimensional batting strategies, respectively. The action at each state is represented by a binary value corresponding to Stand (0) and Swing (1). For the strategies given in Figure \ref{fig:policies}, CRLIB/SRLIB's pitcher-specific batting strategy exploited Roy Halladay on the 2010 test data. However, only CRLIB exploits Halladay on the 2008 test data, presumably because it incorporates information about his pitch selection, as it is believed that pitchers often rely on their ``best pitches'' in specific pitch counts. For example: If Halladay throws a fastball in the $\{2,2\}$ pitch count, $\pi^p_{\mathrm{SRLIB}}$ selects the batting action $u=\operatorname{Stand}$, whereas $\pi^p_{\mathrm{CRLIB}}$ selects $u=\operatorname{Swing}$. In comparison to the SRLIB model, we see that the inclusion of pitch type gives the CRLIB model an enriched representation that can improve a batter's opportunity of reaching base. \subsection{Comparing an ``intuitive'' and general batting strategy}\label{sect:comps} We show that the general batting strategy is a more competitive baseline performance measure than an intuitive batting strategy. This intuitive batting strategy selects the action Swing at states $\{1,0\},\{ 2,0\},\{3,0\},\{2,1\},\{3,1\}$, and Stand in states $\{0,0\},\{1,1\},\{ 1,2\}, \{2,2\},\{3,2\},\{0,1\},\{0,2\}$. In other words, the intuitive batting strategy reflects the intuition that the batter should only swing in a batter's count;\footnote{Please see \hyperref[sect:lingo]{Appendix} for baseball terminology.} we show that these types of batting strategies are inferior to statistically computed ones, such as the general batting strategy. After performing Policy Evaluation for both batting strategies, we observed that the general batting strategy outperformed the intuitive batting strategy 146 out of 150 times. The general batting strategy's dominant performance justifies its selection as the competitive baseline performance measure. Thus, we cannot assume that the pitcher-specific batting strategy will perform better than, or even equal to, the general batting strategy when performing Policy Evaluation on the respective pitcher's test data. Since each pitcher's ``best pitch(es)'' can vary, it follows that the probability distributions over future states from the current state will also vary, especially in states with a batter's count. This is a consequence of the uniqueness of each pitcher's behaviour, which is reflected through their pitch selection at each state in the at-bat, and thereby quantified in their respective transition probabilities. This is personified by R.~A. Dickey, as he only has one ``best pitch'' (knuckleball) and throws other pitch types to make his behaviour less predictable. Thus, when Dickey's knuckleball is ineffective, an optimal policy will recommend swinging at every nonknuckle pitch, as it is computed over data that shows an improved outcome for the batter. In contrast, pitchers that consistently throw more than one pitch type for strikes, such as Roy Halladay, are more difficult to exploit via the pitcher-specific batting strategy because the improved outcome in swinging at their ``weaker'' pitches is marginal in comparison to pitchers that consistently throw fewer pitch types for strikes. Given that the pitcher-specific and general batting strategies are computed over different populations,\footnote{Section \ref{sect:intro}, second last paragraph of page 2.} and each at-bat contains information about the respective pitcher's behaviour, it follows that pitchers are not equally susceptible to being exploited in an empirical setting. If the pitcher-specific batting strategy performs equal to the general batting strategy, the competitiveness/dominance of the latter over intuitively-constructed batting strategies ensures that the respective pitcher is still \textit{exploited} because the intuitive batting strategy can be viewed as the standard strategy that is employed in baseball. Let $\pi^i$ be the intuitive batting strategy and assume that the pitcher-specific batting strategy performs equal to the general batting strategy. By transitivity, $J^{\pi^g}(\{0,0\}) \gg J^{\pi^i}(\{0,0\})$, and $J^{\pi^p}(\{0,0\}) == J^{\pi^g}(\{0,0\})$, then $J^{\pi^p}(\{0,0\}) \gg J^{\pi^i}(\{0,0\})$. \section{Spatial component}\label{spatdesc} A spatial component is introduced to highlight the utility of the exploited pitchers' pitcher-specific batting strategies. The spatial component associates the pitch-type based on the respective pitch's spatial trajectory, where this trajectory is parameterized specifically to the batter being simulated. Thus, the spatial component predicts the pitch-type for the batter-parameterized spatial trajectory given as input. This allows us to simulate a batter's performance when they use the exploited pitcher's pitcher-specific batting strategy against the respective pitcher (see Figure~\ref{fig:spatmodel}). The spatial information for each pitch contains the three-dimensional acceleration, velocity, starting and ending positions. This information is obtained from the MLB GameDay system after it fits a quadratic polynomial to 27 instantaneous images representing the pitch's spatial trajectory. These pictures are taken by cameras on opposite sides of the field. The MLB GameDay system therefore performs a quadratic fit to the trajectory data. There are two problems with this fit. First, acceleration is assumed to be constant, which is certainly not true. Second, there exists a near-perfect correlation between variables obtained from the fit (such as velocity and the end location of a pitch) and the independent variable (acceleration) used to produce this fit. Figure \ref{fig:olspred} displays pitch locations along with predicted values from regression with velocity or acceleration as predictors and location as the response. \begin{figure} \includegraphics{712f08.eps} \caption{The actual (square) and predicted (circle) locations for Tim Lincecum's pitches in the 2009 season, when performing OLS regression on break angle, initial velocity, and break length features to predict the end location of each pitch. The rectangle in the center of the plot represents the strike zone.}\label {fig:olspred} \end{figure} \begin{figure}[b] \includegraphics{712f09.eps} \caption{Illustrating our spatial model, where $\alpha$ is parameterized according to the batter, $K_{\mathrm{training}}$ denotes the number of pitches in the respective pitcher's training data, and 300 represents the $m=100$ three-dimensional points that describe the pitch trajectory. Here, the Learner is a quadratic kernel Support Vector Machine (SVM).} \label{fig:spatmodel} \end{figure} We see that the quadratic fit severely limits the use of each pitch's spatial trajectory. To address this limitation, we use the instantaneous positions of every pitch trajectory to predict the pitch type. \subsection{Batter-parameterized pitch identification} We add $\alpha$-scaled noise, where $\alpha$ is a batter-specific parameter, to the original spatial trajectory of each pitch to represent the respective batter's believed trajectories. This is achieved by first drawing independent, identically distributed noise from the uniform distribution on the $[-1,1]$ interval, which is then multiplied by the parameter $\alpha$, and finally added to the \textit {m} evenly-spaced, three-dimensional, instantaneous positions of the original (true) pitch trajectory. For the batter's believed trajectories to accurately represent their pitch-identification ability, $\alpha$ is defined as the number of strikeouts divided by the number of plate appearances on the same year which the batting strategy is computed on. Only considering strikeouts is justified by the fact that any recorded out from putting the ball in play implies that a player identified the ball accurately enough to achieve contact. In contrast, a batter that strikes out either failed to identify the pitch as a strike or failed to establish contact with the ball. Thus, adding $\alpha$-scaled noise to original trajectory reproduces a batter's believed trajectory. The training data's true trajectories are given as input to a Support Vector Machine (SVM) [\citet{vapnik}, Hastie, Tibshirani and Friedman (\citeyear{htf})] with a quadratic kernel, where each trajectory's $m=100$ three-dimensional instantaneous positions form a single data point that has an associated pitch-type. The SVM algorithm then computes a spatial classifier, which is composed of coefficients $\bolds\beta= [\beta_0,\ldots,\beta_{300}]$, that best separates the training data's original trajectories according to pitch-type, usually with high accuracy.\footnote{Training accuracies are provided in Table \ref{fig:spatrez}.} \begin{sidewaystable} \tablewidth=\textwidth \caption{The annual statistics from the 2008, 2009 and 2010 seasons for the 25 pitchers used in our evaluation\protect\tabnoteref[*]{ttl1}} \label{fig:stats} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ld{1.2}d{1.3}d{2.0}d{2.0}d{3.1}d{1.2}d{1.3}d{2.0}d{2.0}d{3.1}d{1.2}d{1.3}d{2.0}d{2.0}d{3.1}@{}} \hline & \multicolumn{5}{c}{\textbf{2008}} & \multicolumn{5}{c}{\textbf{2009}} & \multicolumn{5}{c@{}}{\textbf{2010}} \\[-6pt] & \multicolumn{5}{c}{\hrulefill} & \multicolumn{5}{c}{\hrulefill} & \multicolumn{5}{c@{}}{\hrulefill} \\ \multicolumn{1}{@{}l}{\textbf{Player}} & \multicolumn{1}{c}{\textbf{ERA}} & \multicolumn{1}{c}{\textbf{WHIP}} & \multicolumn{1}{c}{\textbf{W}} & \multicolumn{1}{c}{\textbf{L}} & \multicolumn{1}{c}{\textbf{IP}} & \multicolumn{1}{c}{\textbf{ERA}} & \multicolumn{1}{c}{\textbf{WHIP}} & \multicolumn{1}{c}{\textbf{W}} & \multicolumn{1}{c}{\textbf{L}} & \multicolumn{1}{c}{\textbf{IP}} & \multicolumn{1}{c}{\textbf{ERA}} & \multicolumn{1}{c}{\textbf{WHIP}} & \multicolumn{1}{c}{\textbf{W}} & \multicolumn{1}{c}{\textbf{L}} & \multicolumn{1}{c@{}}{\textbf{IP}} \\ \hline Roy Halladay & 2.78 & 1.053 & 20 & 11 & 246.0 & 2.79 & 1.126 & 17 & 10 & 239.0 & 2.44 & 1.041 & 21 & 10 & 250.2 \\ Cliff Lee & 2.54 & 1.110 & 22 & 3 & 223.1 & 3.22 & 1.243 & 14 & 13 & 231.2 & 3.18 & 1.003 & 12 & 9 & 212.1 \\ Cole Hamels & 3.09 & 1.082 & 14 & 10 & 227.1 & 4.32 & 1.286 & 10 & 11 & 193.2 & 3.06 & 1.179 & 12 & 11 & 208.2 \\ Jon Lester & 3.21 & 1.274 & 16 & 6 & 210.1 & 3.41 & 1.230 & 15 & 8 & 203.1 & 3.25 & 1.202 & 19 & 9 & 208.0 \\ Zack Greinke & 3.47 & 1.275 & 13 & 10 & 202.1 & 2.16 & 1.073 & 16 & 8 & 229.1 & 4.17 & 1.245 & 10 & 14 & 220.0 \\ Tim Lincecum & 2.62 & 1.172 & 18 & 5 & 227.0 & 2.48 & 1.047 & 15 & 7 & 225.1 & 3.43 & 1.272 & 16 & 10 & 212.1 \\ CC Sabathia & 2.70 & 1.115 & 17 & 10 & 253.0 & 3.37 & 1.148 & 19 & 8 & 230.0 & 3.18 & 1.191 & 21 & 7 & 237.2 \\ Johan Santana & 2.53 & 1.148 & 16 & 7 & 234.1 & 3.13 & 1.212 & 13 & 9 & 166.2 & 2.98 & 1.170 & 11 & 9 & 199.0 \\ Felix Hernandez & 3.45 & 1.385 & 9 & 11 & 200.2 & 2.49 & 1.135 & 19 & 5 & 238.8 & 2.27 & 1.057 & 13 & 12 & 249.2 \\ Chad Billingsley & 3.14 & 1.336 & 16 & 10 & 200.2 & 4.03 & 1.319 & 12 & 11 & 196.1 & 3.57 & 1.278 & 12 & 11 & 191.2 \\ Jered Weaver & 4.33 & 1.285 & 11 & 10 & 176.2 & 3.75 & 1.242 & 16 & 8 & 211.0 & 3.01 & 1.074 & 13 & 12 & 224.1 \\ Clayton Kershaw & 4.26 & 1.495 & 5 & 5 & 107.2 & 2.79 & 1.229 & 8 & 8 & 171.0 & 2.91 & 1.179 & 13 & 10 & 204.1 \\ Chris Carpenter & 1.76 & 1.304 & 0 & 1 & 15.1 & 2.24 & 1.007 & 17 & 4 & 192.2 & 3.22 & 1.179 & 16 & 9 & 235.0 \\ Matt Garza & 3.70 & 1.240 & 11 & 9 & 184.2 & 3.95 & 1.261 & 8 & 12 & 203.0 & 3.91 & 1.251 & 15 & 10 & 204.2 \\ Adam Wainwright & 3.20 & 1.182 & 11 & 3 & 132.0 & 2.63 & 1.210 & 19 & 8 & 233.0 & 2.42 & 1.051 & 20 & 11 & 230.1 \\ Ubaldo Jimenez & 3.99 & 1.435 & 12 & 12 & 198.2 & 3.47 & 1.229 & 15 & 12 & 218.0 & 2.88 & 1.155 & 19 & 8 & 221.2 \\ Matt Cain & 3.76 & 1.364 & 8 & 14 & 217.2 & 2.89 & 1.181 & 14 & 8 & 217.2 & 3.14 & 1.084 & 13 & 11 & 223.1 \\ Jonathan Sanchez & 5.01 & 1.449 & 9 & 12 & 158.0 & 4.24 & 1.365 & 8 & 12 & 163.1 & 3.07 & 1.231 & 13 & 9 & 193.1 \\ Roy Oswalt & 3.54 & 1.179 & 17 & 10 & 208.2 & 4.12 & 1.241 & 8 & 6 & 181.1 & 2.76 & 1.025 & 13 & 13 & 211.2 \\ Justin Verlander & 4.84 & 1.403 & 11 & 17 & 201.0 & 3.45 & 1.175 & 19 & 9 & 240.0 & 3.37 & 1.163 & 18 & 9 & 224.1 \\ Josh Johnson & 3.61 & 1.351 & 7 & 1 & 87.1 & 3.23 & 1.158 & 15 & 5 & 209.0 & 2.30 & 1.105 & 11 & 6 & 183.2 \\ John Danks & 3.32 & 1.226 & 12 & 9 & 195.0 & 3.77 & 1.283 & 13 & 11 & 200.1 & 3.72 & 1.216 & 15 & 11 & 213.0 \\ Edwin Jackson & 4.42 & 1.505 & 14 & 11 & 183.1 & 3.62 & 1.262 & 13 & 9 & 214.0 & 4.47 & 1.395 & 10 & 12 & 209.1 \\ Max Scherzer & 3.05 & 1.232 & 0 & 4 & 56.0 & 4.12 & 1.344 & 9 & 11 & 170.1 & 3.50 & 1.247 & 12 & 11 & 195.2 \\ Ted Lilly & 4.09 & 1.226 & 17 & 9 & 204.2 & 3.10 & 1.056 & 12 & 9 & 177.0 & 3.62 & 1.079 & 10 & 12 & 193.2 \\ \hline \end{tabular*} \tabnotetext[*]{ttl1}{Please see \hyperref[sect:lingo]{Appendix} for baseball terminology.} \end{sidewaystable} The spatial classifier allows pitch-type identification to be standardized across batters, because the respective batter's believed trajectory is only identified as the correct pitch-type if it is similar to the original trajectory. If the believed trajectory differs enough from the original trajectory, it will be identified as the incorrect pitch-type; this is reflective of players with higher $\alpha $ values that strike out often. We can therefore view the spatial classifier as an oracle. \section{Methods and evaluation}\label{methods} \subsection{Strategic component}\label{sect:stratmeth} For our evaluation, we use 3 years of pitch-by-pitch data for 25 elite\footnote{We remind readers that our definition of elite is heuristically defined.} pitchers, as shown in Table \ref{fig:stats}. We evaluated the batting strategies performance for all six unique combinations of the training and test data, which gave a total of $25\times6 = 150$ pitcher-specific batting strategies. The data was obtained from MLB's GameDay system, which provided three complete seasons of pitching data, containing the pitch outcome, pitch-type, number of balls and strikes, and the batter's actions. The technical details of the data collection and formatting process, which is necessary before applying the Reinforcement Learning algorithms, are provided in the supplement [\citet{suppref}]. Initially the general batting strategy was trained over all pitchers data for the respective season, where it was observed that the general batting strategy outperformed the pitcher-specific batting strategies on the respective season by a significant margin. In other words, training the general batting strategy over all of the pitchers' annual data led to invalidation of the hypothesis, regardless of whether pitchers were equally exploitable. Given that the general batting strategy was trained over a much larger data set than the pitcher-specific batting strategy, we sought a way to standardize the training data used to compute the general batting strategy, which is described in the following paragraph. We acknowledge that in real-world settings, each of the batting strategies should be trained over \textit {all} available information, as this information improves the resolution and precision of the probability estimates exploited by the batting strategy. The size of the general batting strategy's training data is approximately equal to the average number of pitches thrown by the 25 pitchers in the respective season, where every pitcher's at-bats in this data set were randomly sampled from all of their at-bats for the respective season. To ensure the general batting strategy's training data is representative of all pitchers' data for the respective season, sampling terminates after adding an at-bat for which the total number of pitches exceeds the proportion of pitches that should be contributed by the pitcher. For example, Roy Halladay threw 3319 pitches in 2009, and all 25 pitchers threw a total of 80,879 pitches. Roy Halladay therefore contributes $\lceil{0.04103\times3235.16}\rceil= 133$ pitches to the data set. Repeating this process for all 25 pitchers 2009 data gives a data set comprised of 3276 pitches. To address the possibility that the aggregate data sample contains unrepresentative at-bats for pitcher(s), which would misrepresent the performance of the general batting strategy, the aggregate data sample was independently constructed 10 times, where the general batting strategy was computed against each of the 10 (training) data samples. Thus, the general batting strategy performance is the average over the 10 general batting strategies' expected rewards on the test data. We evaluate the hypothesis under two different assumptions: all pitchers are equally susceptible to being exploited, and all pitchers are \textit{not} equally susceptible to being exploited, where we believe the latter assumption is more relevant to the real-world setting (see Section \ref{sect:comps} for our explanation). The null hypothesis is the same under either assumption, but the alternative hypothesis $H_1$ is slightly different: \begin{longlist} \item[$H_0$:]$p=\frac{1}{2}$. The pitcher-specific and general batting strategy are equally likely to exploit the respective pitcher. \item[$H_1$:]$p>\frac{1}{2}$. The pitcher-specific batting strategy will perform: \begin{enumerate}[\quad] \item[]\textit{strictly} better than the general batting strategy more than 50\% of the time (assuming that pitchers are \textit {equally} exploitable). \item[] better than \textit{or equal to} the general batting strategy more than 50\% of the time (assuming that pitchers are \textit{not} equally exploitable). \end{enumerate} \end{longlist} For both hypotheses, the \textit{p}-value calculation is given by \[ P(X > M) = \sum_{i=M+1}^{150} \pmatrix{150\cr i} p^i(1-p)^{150-i}, \] where \textit{M} is the number of pitcher-specific batting strategies that exploit the respective pitcher(s). Under the assumption that the pitchers are equally exploitable, $H_0$ could \textit{not} be rejected; when assuming that pitchers are not equally exploitable, $H_0$ was rejected \textit{only} for the CRLIB model ($P(X > M) = 3e\mbox{--}2$, $M=87$). When Policy Evaluation is performed on the pitcher-specific or general batting strategy, the pitch-type thrown at the current pitch count is given before selecting the batting action. It follows that Policy Evaluation implicitly assumes that the pitch-types are always identified correctly. This was a desirable assumption because it only considers the strategic aspect of the at-bat when calculating the expected rewards for the respective strategy. It follows that the hypothesis evaluation is completely independent of the batters used in the evaluation. \subsection{Simulating batting strategies with the spatial component}\label{sect:stratspat} We define the chance threshold as the proportion of the majority pitch-type thrown in the training data, which serves as a baseline for a batter's pitch-type identification ability. We only simulate batters whose believed trajectories from the test data are classified with an accuracy above the chance threshold. This stipulation reflects our requirement that a batter must be able to identify pitch-types better than guessing the majority pitch-type. Table \ref{fig:spatrez} provides the classification accuracies for the batters included in our simulation. \begin{sidewaystable} \tablewidth=\textwidth \caption{Evaluating the pitch identification ability on the 2009 (test) data, after training the spatial classifier on 2010 data. The accuracy is the number of correctly predicted pitch-types on the respective batter's believed trajectories from the 2009 season, after only observing the original trajectories from 2010. The chance threshold is provided to show ``how much better'' the batter is doing than blindly guessing one class\protect\tabnoteref[*]{ttl2}}\label{fig:spatrez} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccccc@{}} \hline &&& \multicolumn{2}{c}{\textbf{Accuracy}} && \\[-6pt] &&& \multicolumn{2}{c}{\hrulefill} && \\ \multicolumn{1}{@{}l}{\textbf{Batter}} & \multicolumn{1}{c}{\textbf{Pitcher}} & \multicolumn{1}{c}{$\bolds{\alpha}$} & \multicolumn{1}{c}{\textbf{Training}} & \multicolumn{1}{c}{\textbf{Test}} & \multicolumn{1}{c}{\textbf{Chance threshold}}& \multicolumn{1}{c@{}}{\textbf{\# of PA (in 2009)}}\\ \hline Miguel Cabrera & Zack Greinke & 0.1466 & $2776/2903$ (95.63\%) & $3135/3376$ (92.86\%) & $2005/3376$ (59.39\%) & 14 \\ Joey Votto & Roy Oswalt & 0.1929 & $3050/3374$ (90.4\%) & $1926/3151$ (61.12\%) & $1787/3151$ (56.71\%) & 12 \\ Joe Mauer & Justin Verlander & 0.0908 & $3545/3633$ (97.58\%) & $3664/3794$ (96.57\%) & $2553/3794$ (67.29\%) & 14 \\ Ichiro Suzuki & CC Sabathia & 0.1175 & $3154/3736$ (84.42\%) & $3089/3985$ (71.86\%) & $2405/3095$ (54.99\%) & 11 \\ Jose Bautista & Jon Lester & 0.1698 & $3047/3263$ (93.38\%) & $2486/3397$ (73.18\%) & $2423/3397$ (71.33\%) & 11 \\ Derek Jeter & Matt Garza & 0.1434 & $3201/3331$ (96.1\%) & $3125/3288$ (95.04\%) & $2336/3288$ (71.05\%) & 14 \\ Prince Fielder & Matt Cain & 0.1933 & $3265/3782$ (95.85\%) & $3019/3177$ (95.03\%) & $1986/3177$ (62.51\%) & \phantom{0}9 \\ Matt Holliday & Clayton Kershaw & 0.1378 & 3291/3328 (98.89\%) & 2872/3062 (93.79\%) & 2163/3062 (70.64\%) & \phantom{0}8 \\ Ryan Howard & Tim Lincecum & 0.2532 & $3633/3870$ (93.88\%) & $3047/3338$ (91.28\%) & $1874/3338$ (56.14\%) & \phantom{0}7 \\ Mark Teixeira & Cliff Lee & 0.1713 & $3292/3427$ (96.06\%) & $3134/3965$ (79.04\%) & $2542/3965$ (64.11\%) & 14 \\ Nick Markakis & Jon Lester & 0.1311 & $3047/3263$ (93.38\%) & $2475/3397$ (72.86\%) & $2423/3397$ (71.33\%) & 13 \\ Carlos Gonzalez & Matt Cain & 0.2123 & $3265/3782$ (95.85\%) & $3008/3177$ (94.68\%) & $1986/3177$ (62.51\%) & \phantom{0}7 \\ Evan Longoria & Roy Halladay & 0.1876 & $3712/3782$ (98.15\%) & $3146/3319$ (94.79\%) & $2445/3319$ (73.67\%) & 23 \\ Brandon Philips & Chris Carpenter & 0.1208 & $2884/3420$ (84.33\%) & $1438/2623$ (54.82\%) & $1227/2623$ (46.78\%) & 11 \\ Manny Ramirez & Jonathan Sanchez & 0.1879 & $3420/3529$ (96.91\%) & $2391/2724$ (87.78\%) & $1866/2724$ (68.50\%) & 11 \\ Adrian Gonzalez & Matt Cain & 0.1645 & $3265/3782$ (95.85\%) & $3042/3177$ (95.75\%) & $1986/3177$ (62.51\%) & \phantom{0}7 \\ Carl Crawford & CC Sabathia & 0.1569 & $3154/3736$ (84.42\%) & $3061/3985$ (76.81\%) & $2405/3985$ (60.35\%) & 13 \\ Troy Tulowitzki & Clayton Kershaw & 0.1475 & $3291/3328$ (98.89\%) & $2883/3062$ (94.15\%) & $2163/3062$ (70.64\%) & 14 \\ Matt Kemp & Jonathan Sanchez & 0.2545 & $3420/3529$ (96.91\%) & $2394/2724$ (87.89\%) & $1866/2724$ (68.50\%) & 11 \\ Alex Rodriguez & Roy Halladay & 0.1647 & $3712/3782$ (98.15\%) & $3147/3319$ (94.82\%) & $2445/3319$ (73.67\%) & 18 \\ \hline \end{tabular*} \tabnotetext[*]{ttl2}{Please see \hyperref[sect:lingo]{Appendix} for baseball terminology.} \end{sidewaystable} We use the spatial component to evaluate twenty prominent batters. Among these batters, ten are considered elite and ten are considered to be nonelite. We simulate each batter's performance against an exploited pitcher when using the respective pitcher-specific batting strategy. For every at-bat that is simulated, the spatial component first predicts the pitch-type using the respective batter's believed trajectory. Then, this predicted pitch-type is used with the current state to select the appropriate action from the pitcher-specific batting strategy; see Figure~\ref{fig:both}. After identifying the pitch-type and selecting the batting action, the conditional distribution over the future states in the at-bat becomes determined. We assign the future states ``bin'' lengths that are equal to the probability of transitioning to their respective states, where each bin is a disjoint subinterval on [0,1]. We then generate a random value from the uniform distribution on the [0,1] interval and select the future state whose subinterval contains this random value. To ensure that the performance of the batter versus pitcher is representative of each state's distribution over future states, every at-bat is simulated 100 times. \section{Results}\label{results} \subsection{Strategic component} The number of pitcher-specific batting strategies that exploited the respective pitcher are given in Table \ref{fig:ranks}. The raw results for SRLIB/CRLIB are given in Tables \ref{fig:sRLIBres} and \ref {fig:cRLIBres}, respectively. \begin{figure} \includegraphics{712f10.eps} \caption{Illustrating the simulation for a batter using an exploited pitcher's pitcher-specific batting strategy. The spatial classifier's predicted pitch-type is used to select the row that contains the batting actions for the respective pitch-type, and the current pitch count is used to select the batting action for this pitch-type.} \label{fig:both} \end{figure} \begin{table}[b] \caption{The number of exploited pitchers using the respective train/test data partitions}\label{fig:ranks} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccccc@{}} \hline & \multicolumn{6}{c@{}}{\textbf{Year of computed batting strategy}} \\[-6pt] & \multicolumn{6}{c@{}}{\hrulefill} \\ \multicolumn{1}{@{}l}{\textbf{Model}} & \multicolumn{2}{c}{\textbf{2008}} & \multicolumn {2}{c}{\textbf{2009}} & \multicolumn{2}{c}{\textbf{2010}} \\ \hline & 2009 & 2010 & 2008 & 2010 & 2008 & 2009 \\ SRLIB & 11 & 10 & 5 & 12 & 11 & 14 \\ CRLIB & 12 & 15 & 11 & 16 & 16 & 16 \\ \hline \end{tabular*} \end{table} \begin{sidewaystable} \tablewidth=\textwidth \caption{Values obtained from SRLIB after training on one year of data and testing on another. Superscripts $\pi^p, \pi^g$ denote the expected reward from the $\{0,0\}$ state when following the pitcher-specific or general batting strategy. The bolded pitcher-specific batting strategies are batting strategies that exploit the respective pitcher on the respective training and test dataset pair}\label{fig:sRLIBres} {\fontsize{8.3}{10.3}{\selectfont \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccccccccccc@{}} \hline & \multicolumn{4}{c}{\textbf{Training on 2008 data}} & \multicolumn{4}{c}{\textbf{Training on 2009 data}} & \multicolumn{4}{c@{}}{\textbf{Training on 2010 data}} \\[-6pt] & \multicolumn{4}{c}{\hrulefill} & \multicolumn{4}{c}{\hrulefill} & \multicolumn{4}{c@{}}{\hrulefill} \\ & \multicolumn{2}{c}{\textbf{2009}} & \multicolumn{2}{c}{\textbf{2010}} & \multicolumn{2}{c}{\textbf{2008}} & \multicolumn{2}{c}{\textbf{2010}} & \multicolumn {2}{c}{\textbf{2008}} & \multicolumn{2}{c}{\textbf{2009}} \\[-6pt] & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c}{\hrulefill} & \multicolumn {2}{c}{\hrulefill} & \multicolumn{2}{c@{}}{\hrulefill} \\ \textbf{Player}& \multicolumn{1}{c}{$\bolds{J^{\pi^g}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^p}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^g}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^p}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^g}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^p}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^g}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^p}}$} &\multicolumn{1}{c}{$\bolds{J^{\pi^g}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^p}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^g}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^p}}$}\\ \hline Roy Halladay & 0.655 & 0.604 & 0.546 & 0.491 & 0.659 & 0.569 & 0.569 & $\mathbf{0.766}$& 0.699 & 0.560 & 0.638 & $\mathbf{0.707}$\\ Cliff Lee & 0.692 & $\mathbf{0.706}$ & 0.566 & $\mathbf{0.622}$ & 0.680 & 0.622 & 0.558 & 0.499& 0.678 & 0.664 & 0.707 & 0.571\\ Cole Hamels & 0.716 & $\mathbf{0.768}$ & 0.814 & 0.795 & 0.731 & 0.700 & 0.807 & 0.764& 0.724 & 0.719 & 0.700 & 0.680\\ Jon Lester & 0.713 & $\mathbf{0.764}$ & 0.876 & 0.847 & 0.742 & 0.737 & 0.831 & 0.718& 0.739 & $\mathbf{0.741}$ & 0.710 & 0.709\\ Zack Greinke & 0.642 & 0.608 & 0.747 & $\mathbf{0.835}$ & 0.795 & 0.688 & 0.739 & 0.719& 0.824 & $\mathbf{0.836}$ & 0.607 &$\mathbf{0.672}$\\ Tim Lincecum & 0.649 & $\mathbf{0.694}$ & 0.822 & 0.785 & 0.717 & 0.694 & 0.778 & 0.723& 0.686 & 0.589 & 0.653 & 0.565\\ CC Sabathia & 0.810 & 0.718 & 0.802 & 0.698 & 0.657 & 0.550 & 0.792 & $\mathbf{0.821}$& 0.593 & 0.550 & 0.825 & $\mathbf{0.836}$\\ Johan Santana & 0.785 & $\mathbf{0.862}$ & 0.773 & 0.703 & 0.680 & $\mathbf{0.694}$ & 0.774 & $\mathbf{0.838}$ & 0.651 & $\mathbf{0.773}$ & 0.744 & $\mathbf{0.852}$\\ Felix Hernandez & 0.721 & $\mathbf{0.784}$ & 0.823 & 0.786 & 0.777 & 0.765 & 0.815 & 0.786 & 0.717 & 0.662 & 0.760 & 0.613\\ Chad Billingsley & 0.802 & $\mathbf{0.865}$ & 0.788 & $\mathbf{0.812}$ & 0.750 & $\mathbf{0.790}$ & 0.792 & $\mathbf{0.812}$ & 0.752 & $\mathbf {0.785}$ & 0.792 & $\mathbf{0.860}$\\ Jered Weaver & 0.860 & 0.841 & 0.691 & $\mathbf{0.734}$ & 0.762 & $\mathbf{0.770}$ & 0.704 & $\mathbf{0.711}$& 0.770 & 0.759 & 0.883 & 0.840\\ Clayton Kershaw & 0.738 & 0.719 & 0.716 & 0.667 & 0.909 & $\mathbf {1.125}$ & 0.710 & 0.691 & 0.996 & 0.800 & 0.757 & $\mathbf{0.837}$\\ Chris Carpenter & 0.751 & 0.640 & 0.691 & $\mathbf{0.732}$ & 0.757 & 0.692 & 0.753 & $\mathbf{0.791}$& 0.667 & $\mathbf{0.944}$ & 0.809 & $\mathbf{0.914}$\\ Matt Garza & 0.827 & 0.792 & 0.794 & $\mathbf{0.794}$ & 0.725 & 0.622 & 0.779 & $\mathbf{0.834}$& 0.692 & 0.622 & 0.797 & $\mathbf{0.880}$\\ Adam Wainwright & 0.689 & $\mathbf{0.690}$ & 0.692 & 0.648 & 0.609 & 0.578 & 0.694 & $\mathbf{0.738}$& 0.554 & $\mathbf{0.636}$ & 0.707 & 0.705\\ Ubaldo Jimenez & 0.735 & 0.709 & 0.767 & $\mathbf{0.771}$ & 0.867 & 0.850 & 0.751 & 0.741& 0.881 & $\mathbf{0.968}$ & 0.741 & $\mathbf {0.755}$\\ Matt Cain & 0.753 & $\mathbf{0.878}$ & 0.665 & 0.610 & 0.828 & $\mathbf {0.897}$ & 0.693 & 0.610& 0.815 & $\mathbf{0.854}$ & 0.755 & $\mathbf {0.774}$\\ Jonathan Sanchez & 0.894 & 0.842 & 0.850 & 0.805 & 0.794 & 0.672 & 0.842 & $\mathbf{1.096}$& 0.791 & 0.672 & 0.968 & $\mathbf{1.165}$\\ Roy Oswalt & 0.710 & 0.639 & 0.787 & 0.750 & 0.876 & 0.667 & 0.777 & 0.651& 1.022 & 0.967 & 0.687 & 0.666\\ Justin Verlander & 0.769 & 0.763 & 0.757 & $\mathbf{0.758}$ & 0.883 & 0.758 & 0.758 & 0.755& 0.930 & 0.914 & 0.758 & $\mathbf{0.776}$\\ Josh Johnson & 0.683 & 0.661 & 0.673 & $\mathbf{0.701}$ & 0.716 & 0.691 & 0.689 & $\mathbf{0.755}$& 0.658 & $\mathbf{0.691}$ & 0.684 & $\mathbf {0.764}$\\ John Danks & 0.813 & $\mathbf{0.845}$ & 0.807 & $\mathbf{0.820}$ & 0.772 & 0.692 & 0.812 & $\mathbf{0.868}$& 0.758 & $\mathbf{0.855}$ & 0.819 & $\mathbf{0.877}$\\ Edwin Jackson & 0.916 & $\mathbf{1.053}$ & 0.854 & 0.725 & 0.948 & 0.928 & 0.840 & 0.802 & 0.987 & 0.930 & 0.966 & 0.929\\ Max Scherzer & 0.843 & 0.707 & 0.794 & 0.732 & 0.854 & 0.728 & 0.789 & $\mathbf{0.804}$& 0.847 & $\mathbf{0.899}$ & 0.868 & 0.774\\ Ted Lilly & 0.714 & 0.568 & 0.740 & 0.666 & 0.774 & 0.770 & 0.689 & 0.613 & 0.792 & 0.780 & 0.708 & 0.690\\ \hline \end{tabular*}}} \end{sidewaystable} \begin{sidewaystable} \tablewidth=\textwidth \caption{Values obtained from CRLIB after training on one year of data and testing on another. Superscripts $\pi^p, \pi^g$ denote the expected reward from the $\{0,0\}$ state when following the pitcher-specific or general batting strategy. The bolded pitcher-specific batting strategies are batting strategies that exploit the respective pitcher on the respective training and test dataset pair}\label{fig:cRLIBres {\fontsize{8.3}{10.3}{\selectfont \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccccccccccc@{}} \hline & \multicolumn{4}{c}{\textbf{Training on 2008 data}} & \multicolumn{4}{c}{\textbf{Training on 2009 data}} & \multicolumn{4}{c@{}}{\textbf{Training on 2010 data}} \\[-6pt] & \multicolumn{4}{c}{\hrulefill} & \multicolumn{4}{c}{\hrulefill} & \multicolumn{4}{c@{}}{\hrulefill} \\ & \multicolumn{2}{c}{\textbf{2009}} & \multicolumn{2}{c}{\textbf{2010}} & \multicolumn{2}{c}{\textbf{2008}} & \multicolumn{2}{c}{\textbf{2010}} & \multicolumn {2}{c}{\textbf{2008}} & \multicolumn{2}{c}{\textbf{2009}} \\[-6pt] & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c}{\hrulefill} & \multicolumn {2}{c}{\hrulefill} & \multicolumn{2}{c@{}}{\hrulefill} \\ \textbf{Player}& \multicolumn{1}{c}{$\bolds{J^{\pi^g}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^p}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^g}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^p}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^g}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^p}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^g}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^p}}$} &\multicolumn{1}{c}{$\bolds{J^{\pi^g}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^p}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^g}}$} & \multicolumn{1}{c}{$\bolds{J^{\pi^p}}$}\\ \hline Roy Halladay & 0.644 & 0.594 & 0.603 & 0.585 & 0.544 & $\mathbf{0.575}$ & 0.642 & $\mathbf{0.784}$& 0.538 & $\mathbf{0.558}$ & 0.568 & $\mathbf {0.765}$\\ Cliff Lee & 0.564 & 0.534 & 0.532 & $\mathbf{0.595}$ & 0.600 & 0.562 & 0.522 & 0.478 & 0.627 & $\mathbf{0.700}$ & 0.536 & $\mathbf{0.557}$\\ Cole Hamels & 0.644 & $\mathbf{0.701}$ & 0.622 & $\mathbf{0.664}$ & 0.540 & 0.537 & 0.595 & 0.484& 0.526 & $\mathbf{0.634}$ & 0.653 & 0.617\\ Jon Lester & 0.625 & 0.587 & 0.651 & $\mathbf{0.720}$ & 0.547 & 0.527 & 0.600 & 0.531& 0.556 & $\mathbf{0.588}$ & 0.570 & $\mathbf{0.610}$\\ Zack Greinke & 0.526 & 0.465 & 0.630 & $\mathbf{0.668}$ & 0.632 & $\mathbf{0.643}$ & 0.636 & $\mathbf{0.637}$& 0.658 & $\mathbf{0.762}$ & 0.499 & $\mathbf{0.559}$\\ Tim Lincecum & 0.531 & $\mathbf{0.555}$ & 0.657 & 0.497 & 0.590 & $\mathbf{0.650}$ & 0.565 & $\mathbf{0.580}$ & 0.578 & $\mathbf{0.583}$ & 0.543 & $\mathbf{0.545}$\\ CC Sabathia & 0.602 & 0.543 & 0.604 & $\mathbf{0.604}$ & 0.514 & $\mathbf{0.657}$ & 0.546 & $\mathbf{0.659}$& 0.458 & $\mathbf{0.581}$ & 0.588 & $\mathbf{0.615}$\\ Johan Santana & 0.569 & $\mathbf{0.591}$ & 0.510 & $\mathbf{0.533}$ & 0.538 & $\mathbf{0.650}$ & 0.526 & $\mathbf{0.533}$& 0.482 & $\mathbf {0.575}$ & 0.519 & $\mathbf{0.604}$\\ Felix Hernandez & 0.580 & $\mathbf{0.607}$ & 0.523 & $\mathbf{0.564}$ & 0.602 & 0.551 & 0.529 & $\mathbf{0.565}$ & 0.526 & 0.504 & 0.577 & 0.556\\ Chad Billingsley & 0.581 & $\mathbf{0.597}$ & 0.608 & 0.576 & 0.565 & $\mathbf{0.573}$ & 0.598 & $\mathbf{0.626}$& 0.513 & 0.490 & 0.532 & 0.463\\ Jered Weaver & 0.612 & 0.590 & 0.516 & $\mathbf{0.555}$ & 0.554 & $\mathbf{0.575}$ & 0.497 & $\mathbf{0.634}$& 0.573 & 0.546 & 0.638 & $\mathbf{0.666}$\\ Clayton Kershaw & 0.452 & 0.318 & 0.527 & 0.477 & 0.733 & 0.435 & 0.506 & $\mathbf{0.536}$& 0.812 & 0.506 & 0.390 & $\mathbf{0.543}$\\ Chris Carpenter & 0.542 & 0.508 & 0.638 & 0.506 & 0.459 & 0.000 & 0.686 & $\mathbf{0.882}$& 0.288 & 0.269 & 0.597 & $\mathbf{0.640}$\\ Matt Garza & 0.641 & 0.639 & 0.611 & $\mathbf{0.647}$ & 0.539 & 0.500 & 0.663 & $\mathbf{0.670}$ & 0.574 & $\mathbf{0.589}$ & 0.597 & $\mathbf {0.631}$\\ Adam Wainwright & 0.608 & 0.590 & 0.595 & 0.527 & 0.620 & $\mathbf {0.785}$ & 0.589 & 0.588& 0.464 & $\mathbf{0.504}$ & 0.601 & 0.546\\ Ubaldo Jimenez & 0.547 & $\mathbf{0.636}$ & 0.529 & $\mathbf{0.565}$ & 0.597 & $\mathbf{0.690}$ & 0.497 & $\mathbf{0.632}$& 0.604 & 0.560 & 0.594 & $\mathbf{0.597}$\\ Matt Cain & 0.586 & $\mathbf{0.658}$ & 0.478 & $\mathbf{0.521}$ & 0.600 & 0.593 & 0.552 & 0.463& 0.491 & $\mathbf{0.554}$ & 0.575 & $\mathbf {0.597}$\\ Jonathan Sanchez & 0.730 & $\mathbf{0.730}$ & 0.585 & 0.543 & 0.590 & 0.478 & 0.558 & $\mathbf{0.773}$& 0.593 & 0.447 & 0.729 & $\mathbf {0.861}$\\ Roy Oswalt & 0.621 & 0.534 & 0.498 & $\mathbf{0.510}$ & 0.564 & 0.453 & 0.471 & $\mathbf{0.473}$& 0.598 & $\mathbf{0.646}$ & 0.588 & 0.542\\ Justin Verlander & 0.601 & 0.493 & 0.524 & 0.480 & 0.597 & 0.502 & 0.518 & $\mathbf{0.541}$& 0.619 & 0.597 & 0.547 & 0.546\\ Josh Johnson & 0.519 & $\mathbf{0.631}$ & 0.472 & $\mathbf{0.520}$ & 0.667 & $\mathbf{0.762}$ & 0.505 & $\mathbf{0.519}$& 0.582 & $\mathbf {0.594}$ & 0.554 & 0.544\\ John Danks & 0.682 & $\mathbf{0.749}$ & 0.537 & 0.492 & 0.518 & 0.512 & 0.502 & 0.478& 0.502 &$\mathbf{0.538}$ & 0.642 & $\mathbf{0.656}$\\ Edwin Jackson & 0.659 & $\mathbf{0.886}$ & 0.657 & 0.635 & 0.712 & $\mathbf{0.785}$ & 0.617 & 0.575 & 0.708 & $\mathbf{0.758}$ & 0.750 & 0.692\\ Max Scherzer & 0.667 & 0.585 & 0.533 & $\mathbf{0.634}$ & 0.415 & 0.326 & 0.536 & 0.516 & 0.401 & $\mathbf{0.537}$ & 0.690 & $\mathbf{0.710}$\\ Ted Lilly & 0.547 & $\mathbf{0.614}$ & 0.624 & $\mathbf{0.636}$ & 0.592 & 0.516 & 0.589 & 0.522& 0.576 & 0.507 & 0.497 & 0.429\\ \hline \end{tabular*}}} \end{sidewaystable} It is apparent that no relationship exists between the performance of the pitcher-specific batting strategy and the train/test dataset pair that it was computed and evaluated on. This shows that the exploited pitchers' pitcher-specific batting strategies do not rely on seasonal statistics from either the training or test data. Instead, these batting strategies rely on the pitcher's decision-making, which is presumably reflected through the pitcher's pitch selection at each pitch count. It follows that these characteristics are not reflected in the respective pitcher's seasonal statistics. The inclusion of pitch-types in the CRLIB model resulted in a larger number of exploited pitchers than SRLIB. This suggests the degree to which a pitcher's pitch selection is influenced by the pitch count. We use the spatial component to simulate the batter's performance against an exploited pitcher when using the pitcher-specific batting strategy, which illustrates utility of these batting strategies in actual players' decision-making. \subsection{Simulating batting strategies with the spatial component} We chose Miguel Cabrera, Joey Votto, Joe Mauer, Ichiro Suzuki, Jose Bautista, Adrian Gonzalez, Carl Crawford, Matt Holliday, Manny Ramirez and Alex Rodriguez as our elite batters, and Derek Jeter, Ryan Howard, Mark Teixeira, Nick Markakis, Brandon Philips, Carlos Gonzalez, Prince Fielder, Matt Kemp, Evan Longoria and Troy Tulowitzki as our nonelite batters. We used CRLIB's strategies from the 2010/2009 train/test dataset pair, where each batter's $\alpha$ is calculated from the 2010 season, which is used to construct the respective batter's believed trajectories on the 2009 data (for the respective pitcher). The actual and simulated statistics accrued by the elite batters are provided in Tables \ref{fig:actualbatstats9} and \ref{fig:rez09}, respectively. \begin{table} \caption{The actual statistics of the elite batters when facing the respective pitcher in the 2009 season\protect\tabnoteref[*]{ttl6}}\label{fig:actualbatstats9} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccccccccc@{}} \hline \textbf{Batter} & \textbf{Pitcher} & \textbf{PA} & \textbf{AB} & \textbf{H} & \textbf{BB} & \textbf{SO} & \textbf{AVG} & \textbf{OBP} & \textbf{SLG} \\ \hline Miguel Cabrera & Zack Greinke & 14 & 14 & 2 & 0 & 5 & 0.143 & 0.143 & 0.286 \\ Joey Votto & Roy Oswalt & 12 & 12 & 4 & 0 & 2 & 0.333 & 0.333 & 0.500 \\ Joe Mauer & Justin Verlander & 14 & 12 & 4 & 2 & 3 & 0.333 & 0.429 & 0.917 \\ Ichiro Suzuki & CC Sabathia & 12 & 10 & 4 & 2 & 3 & 0.400 & 0.500 & 0.600 \\ Jose Bautista & Jon Lester & 11 & \phantom{0}8 & 1 & 3 & 2 & 0.125 & 0.364 & 0.125 \\ {Adrian Gonzalez} & {Matt Cain} & \phantom{0}7 & \phantom{0}7 & 6 & 0 & 1 & 0.857 & 0.857 & 1.714 \\ Carl Crawford & CC Sabathia & 13 & 13 & 4 & 0 & 4 & 0.308 & 0.308 & 0.538 \\ Matt Holliday & Clayton Kershaw & \phantom{0}8 & \phantom{0}5 & 2 & 3 & 2 & 0.400 & 0.625 & 1.025 \\ Manny Ramirez & Jonathan Sanchez & 11 & \phantom{0}9 & 5 & 2 & 1 & 0.556 & 0.636 & 1.111 \\ Alex Rodriguez & Roy Halladay & 18 & 17 & 6 & 1 & 2 & 0.353 & 0.389 & 0.471 \\ \hline \end{tabular*} \tabnotetext[*]{ttl6}{Please see \hyperref[sect:lingo]{Appendix} for baseball terminology.} \end{table} \begin{table} \caption{Simulated performance of the elite batters on the 2009 season using the strategic and spatial components, both of which are trained on 2010 data\protect\tabnoteref[*]{ttl7}}\label{fig:rez09} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccccccc@{}} \hline \textbf{Batter} & \textbf{Pitcher} & \textbf{AB} & \textbf{H} & \textbf{BB} & \textbf{SO} & \textbf{AVG} & \textbf{OBP} & \textbf{SLG} \\ \hline Miguel Cabrera & Zack Greinke & 911 & 295 & 0 & \phantom{0}93 & 0.324 & 0.324 & 0.538 \\ Joey Votto & Roy Oswalt & 655 & 136 & 0 & 200 & 0.208 & 0.208 & 0.379 \\ Joe Mauer & Justin Verlander & 723 & 169 & 0 & 127 & 0.234 & 0.234 & 0.390 \\ Ichiro Suzuki & CC Sabathia & 775 & 237 & 0 & 138 & 0.306 & 0.306 & 0.452 \\ Jose Bautista & Jon Lester & 701 & 198 & 0 & 181 & 0.282 & 0.282 & 0.413 \\ Adrian Gonzalez & Matt Cain & 136 & \phantom{0}39 & 0 & \phantom{00}0 & 0.287 & 0.287 & 0.515 \\ Carl Crawford & CC Sabathia & 978 & 280 & 0 & 231 & 0.286 & 0.286 & 0.457 \\ Matt Holliday & Clayton Kershaw & 755 & 187 & 0 & 158 & 0.247 & 0.247 & 0.358 \\ Manny Ramirez & Jonathan Sanchez & 635 & 321 & 0 & \phantom{0}93 & 0.506 & 0.506 & 0.624 \\ Alex Rodriguez & Roy Halladay & 662 & 234 & 0 & \phantom{0}81 & 0.353 & 0.353 & 0.523 \\ \hline \end{tabular*} \tabnotetext[*]{ttl7}{Please see \hyperref[sect:lingo]{Appendix} for baseball terminology.} \end{table} \begin{table}[b] \caption{The actual statistics of the nonelite batters when facing the respective pitcher in the 2009 season\protect\tabnoteref[*]{ttl8}}\label{fig:stactualbatstats9} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccccccccc@{}} \hline \textbf{Batter} & \textbf{Pitcher} & \textbf{PA} & \textbf{AB} & \textbf{H} & \textbf{BB} & \textbf{SO} & \textbf{AVG} & \textbf{OBP} & \textbf{SLG} \\ \hline Derek Jeter & Matt Garza & 14 & 14 & 3 & 0 & 2 & 0.214 & 0.214 & 0.357 \\ Ryan Howard & Tim Lincecum & \phantom{0}7 & \phantom{0}7 & 2 & 0 & 4 & 0.286 & 0.286 & 0.429 \\ Mark Teixeira & Cliff Lee & 14 & 13 & 2 & 0 & 3 & 0.154 & 0.214 & 0.231 \\ Nick Markakis & Jon Lester & 13 & 13 & 1 & 0 & 6 & 0.077 & 0.077 & 0.077 \\ Brandon Philips & Chris Carpenter & 11 & 10 & 1 & 3 & 2 & 0.100 & 0.182 & 0.282 \\ Carlos Gonzalez & Matt Cain & 14 & 13 & 3 & 1 & 4 & 0.231 & 0.286 & 0.231 \\ Troy Tulowitzki & Clayton Kershaw & 14 & 13 & 0 & 1 & 6 & 0.000 & 0.071 & 0.000 \\ Matt Kemp & Jonathan Sanchez & 11 & 11 & 3 & 0 & 0 & 0.273 & 0.273 & 0.364 \\ Evan Longoria & Roy Halladay & 23 & 17 & 4 & 4 & 4 & 0.235 & 0.348 & 0.235 \\ Prince Fielder & Matt Cain & \phantom{0}9 & \phantom{0}7 & 1 & 1 & 1 & 0.143 & 0.222 & 0.286 \\ \hline \end{tabular*} \tabnotetext[*]{ttl8}{Please see \hyperref[sect:lingo]{Appendix} for baseball terminology.} \end{table} \begin{table} \caption{Simulated performance of the nonelite batters on the 2009 season using the spatial and strategic components, both of which are trained on 2010 data\protect\tabnoteref[*]{ttl9}}\label{fig:strez09} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccccccc@{}} \hline \textbf{Batter} & \textbf{Pitcher} & \textbf{AB} & \textbf{H} & \textbf{BB} & \textbf{SO} & \textbf{AVG} & \textbf{OBP} & \textbf{SLG} \\ \hline Derek Jeter & Matt Garza & \phantom{0}257 & 110 & \phantom{00}0 & \phantom{00}0 & 0.428 & 0.428 & 0.656 \\ Ryan Howard & Tim Lincecum & \phantom{0}487 & 137 & \phantom{00}0 & 131 & 0.281 & 0.281 & 0.413 \\ Mark Teixeira & Cliff Lee & \phantom{0}301 & \phantom{0}93 & \phantom{00}0 & \phantom{0}66 & 0.309 & 0.309 & 0.495 \\ Nick Markakis & Jon Lester & \phantom{0}925 & 383 & 100 & 125 & 0.415 & 0.522 & 0.520 \\ Brandon Philips & Chris Carpenter & \phantom{0}269 & 161 & \phantom{00}0 & \phantom{00}0 & 0.599 & 0.599 & 1.115 \\ Carlos Gonzalez & Matt Cain & \phantom{0}283 & \phantom{0}86 & \phantom{00}0 & \phantom{0}59 & 0.304 & 0.304 & 0.435 \\ Troy Tulowitzki & Clayton Kershaw & 1017 & 216 & \phantom{00}0 & 176 & 0.212 & 0.212 & 0.306 \\ Matt Kemp & Jonathan Sanchez & \phantom{0}602 & 166 & \phantom{00}0 & 261 & 0.276 & 0.276 & 0.372 \\ Evan Longoria & Roy Halladay & 1309 & 429 & \phantom{00}0 & 153 & 0.328 & 0.328 & 0.503 \\ Prince Fielder & Matt Cain & \phantom{0}450 & 124 & \phantom{00}0 & 115 & 0.276 & 0.276 & 0.429 \\ \hline \end{tabular*} \tabnotetext[*]{ttl9}{Please see \hyperref[sect:lingo]{Appendix} for baseball terminology.} \end{table} When comparing the elite batters' simulated statistics to their actual statistics on the 2009 test data's at-bats, the simulated statistics do not show an appreciable performance improvement in comparison to the actual statistics. We evaluated the performance of the ten nonelite batters to preclude the possibility that an exploited pitcher's pitcher-specific batting strategy is detrimental to an elite hitter's ability to get on base. These nonelite batters are of course exceptional hitters, but are not considered as elite at other aspects of the game. If following an exploited pitcher's pitcher-specific batting strategy is detrimental to elite hitters, then nonelite hitters may still benefit. Comparing the nonelite batters' actual statistics to their simulated statistics, shown in Tables \ref{fig:stactualbatstats9} and \ref{fig:strez09}, respectively, the simulated statistics are superior to the actual statistics for all of the batters. This suggests that the exploited pitchers' pitcher-specific batting strategies are beneficial for nonelite players. Considering that Joe Mauer, Ichiro Suzuki, Joey Votto, Manny Ramirez and Alex Rodriguez are generational talents, it is possible that elite batters make atypical decisions that only they can benefit from.\looseness=1 \subsection{Discussion} Before discussing the limiting factors on the experiment, we briefly mention that the batter's decision-making can be exploited in a similar manner: Batter-specific behaviour could be modeled as a stochastic process. Reinforcement Learning could then be used to obtain optimal pitching strategies against both specific batters and the general population of batters. This idea is relegated to future work. \subsubsection{Potential limitations: Strategic component}\label{sect:stratdisc} The reward function gives a higher reward for a single than a walk, reflecting the idea that a batter should not be indifferent between a walk and a single. This is because a single advances baserunners that are not on first base, whereas a walk does not. We acknowledge that there are cases, such as when there are no baserunners or one baserunner on first base, where a single should be considered equivalent to a walk. However, it is desirable to compute a batting strategy that maximizes a batter's expectation of reaching base while also trying to win the game; advancing runners is critical to winning in baseball. In contrast, the slugging percentage (SLG) calculation can be interpreted as a reward function that quantifies the batter's preference of a single, double, triple and home run as 1, 2, 3 and 4, while ignoring walks. Given that the On-base Plus Slugging (OPS) metric is often used to measure a player's ability, but does not consider walks and hits as a function of the batting action, it was felt that the reward function used in the study must address this shortcoming by giving a reward of 1 for a walk; by doing so, all outcomes are considered by the same reward function, where the lowest nonzero reward is a walk, which addresses the shortcomings of OPS. It is possible that performance can be improved by tuning the reward function through Inverse Reinforcement Learning (IRL) [\citet {irl}], which can recover the optimal reward function. One caveat with IRL, however, is that it requires a near-optimal policy to recover the optimal reward function, which suggests that a good reward function is first required to develop a near-optimal policy. We therefore see an interdependence between the optimal policy and reward function, where addressing this interdependence is a focal point of Reinforcement Learning research. Under the assumption that all pitchers are \textit{not} equally exploitable, the results show that strategizing against a specific pitcher is statistically better than strategizing against a group of the pitchers more than 50\% of the time; assuming that pitchers are \textit{equally} susceptible to being exploited by either strategy, the hypothesis was rejected. However, we argue the statistically significant result under the assumption of unequal susceptibility is stronger because each pitcher has unique behaviour that is reflected in the transition probabilities in each state of the at-bat (see Section \ref{sect:comps} for further information). Given that only two fewer pitchers are exploited under the assumption that pitchers are equally susceptible to being exploited, which resulted in rejection of our hypothesis, it is possible that evaluating the hypothesis over a larger number of pitchers would result in a nonrejection under \textit {both} assumptions with the CRLIB model. Important parts of the data provided by MLB's GameDay system were incomplete. There were cases where the at-bat's pitch sequence consisted of one (or more) pitches that did not have a pitch-type. For the 610,130 at-bats in the database, there were 32,632 pitches concluded for the at-bat without providing the pitch-type. This was detrimental to CRLIB because the last pitch of an at-bat determined the terminal state, and the pitch-type determines the state being transitioned from. We therefore skipped over pitches with missing pitch-types and simply incremented the pitch count by observing whether the unlabeled pitch was a ball or strike. We also observed that the 2008 season of data contained many more pitch-types than the 2009 and 2010 seasons for the same pitcher, which suggested that the GameDay system data was maturing in its initial years; it's feasible that future work using newer data will report even better results than those in this article. Using the four generalized pitch-types mentioned in Section \ref{desc2} may have a large impact on our results. However, there are 15 different pitch-types in the GameDay system, and it is unreasonable to give CRLIB $15 \times12 + 6$ states due to issues that would arise with data sparsity, as we did not want to use any sampling techniques. A potential criticism of our batting strategy evaluations is that they are evaluated over an entire season of data. We emphasize the fact that we are not assuming that a pitcher does not adjust to the pitcher-specific batting strategy. After initially using the pitcher-specific batting strategy in the real world, we update the strategy using online learning algorithms, such as State--Action--Reward--State--Action (SARSA) [\citet{sb}]. Online learning algorithms update and recompute the pitcher-specific batting strategy using the pitch-by-pitch data after the pitcher adjusts to being exploited by the initial batting strategy. We use a season of pitch-by-pitch data to show the potential of our approach when the pitcher does not know they are being exploited. Training and testing our model over two different seasons of pitch-by-pitch data for the same pitcher shows that the pitcher-specific batting strategy's performance is not a consequence of luck. \subsubsection{Potential limitations: Simulating batting strategies with spatial component} Readers may argue that assuming the batter can hit the pitch if it is identified correctly is not representative of the at-bat setting. However, we are simulating the at-bat setting in a probabilistic manner, which means that there is no guarantee that the batting action will yield a fortuitous outcome. This is because batters reach base less than being out over an entire season, and this is reflected by the large probability of the out state. We do not consider predicting the end location of pitches because there are two assumptions that we do not agree with: we are assuming that the pitch-type and current state are related to a pitch's end location, and we are assuming that the pitch's end location is related to the pitch-type, neither of which are true. In the real world, batters rarely know where the pitch is going. Instead, they rely on identifying the pitch-type prior to making the choice of swinging or not. The limitations of the spatial component stem from the absence of the raw spatial information for each pitch Another issue some may have with the spatial component is that, in conjunction with an exploited pitcher's pitcher-specific batting strategy, our model fails to produce walks in all but one case. The lack of walks is a result of CRLIB's pitcher-specific strategy suggesting that the batters swing in pitch counts where there are three balls. Swinging at pitch counts with three balls maximizes the batter's expectation because pitchers do not want to walk the batter. We mentioned that our model puts a higher priority on advancing baserunners, and it is possible that this prioritization decreased the OBP and AVG statistics. This decrease is explained by the fact that the batters are swinging in states with large expected rewards, which can only be reached with a base hit. Additionally, the actual number of pitches thrown in the at-bat may be a limitation on achieving walks in our simulation. For example, assume that the actual 2009 data shows that the batter chose to swing in a certain pitch count, and this swing led to them being out. Let us also assume that exploited pitcher's pitcher-specific batting strategy selects the batting action ``stand.'' If this pitch is not thrown for a strike, the at-bat is incomplete because there are no more pitches left. A similar limitation that arises is when the batter identifies a pitch at the respective pitch count in the test data, but the training data did not contain a case with this pitch count and pitch-type. For example, the batter identifies the pitch as a fastball in a $\{3,0\}$ count, but the training data only contained curveballs being thrown from the $\{3,0\}$ count. In either of these situations, we skip the at-bat.\footnote{We define ``skipped'' as the termination of the current simulation. This at-bat is only simulated again if the 100 simulation limit has not been exceeded.} These examples illustrate how real-world data can be limiting on a simulation. \subsubsection{Reinforcement Learning in football}\label{sect:ndpdisc} Patek and Bertsekas (\citeyear{ndp}) used Reinforcement Learning to simulate the offensive play calling for a simplified version of American Football. They computed an optimal policy for the offensive team by giving generated sample data (that was representative of typical play) as input to their model. The optimal policy suggested running, passing and running plays when the distance from line of scrimmage and ``our'' own goal line was between 1 and 65 yards, 66 yards and 94 yards, and 95 and 100 (touchdown) yards. The optimal policy produced an expected reward of $-0.9449$ points when starting from the twenty yard line. This meant that if the ``our'' team received the ball at the twenty yard line every time, they would lose the game. It is possible that the result could have produced a positive expected reward if real-world data was used, but this data was not available at the time. The appealing property of Reinforcement Learning is that it allows the evaluation of arbitrary strategies given as input to the Policy Evaluation algorithm. One strategy that was reflective of good play-calling in football produced a slightly worse expected reward ($-1.27$ points) than the optimal policy. Considering that this strategy was intuitive, manually constructed and did not perform much worse than the optimal strategy, Reinforcement Learning provides a platform for investigating the strategic aspects in sports. After all, every team's goal is to devise a strategy that maximizes the team's opportunity to win the game. Reinforcement Learning's applicability to baseball is tantalizing because team performance depends on individual performance. The distinguishing aspect of Reinforcement Learning in baseball (from football) is the scope of the strategy: in football, a policy reflective of ``good'' play-calling does not change significantly with the opponent. In baseball, the batting strategy changes significantly with the opponent, as the batting strategy is pitcher-specific. Using an exploited pitcher's pitcher-specific batting strategy against the respective pitcher should increase the team's opportunity of winning the game, as it increases the batter's expectation of reaching base. \section{Conclusion}\label{conc} This article shows how Reinforcement Learning algorithms [\citet {ndp,ndpref,sb}] can be applied to Markov Decision Processes [\citet {lawler}] to statistically analyze baseball's at-bat setting. With the wealth of information provided at the pitch-by-pitch level, evaluating a player's decision-making ability is no longer unrealistic. Earlier work alluded to the amount of information contained in real-world baseball data being a limiting factor for analysis [\citet{mcb} and \citet{oera}]. Noting this, what is particularly impressive about CRLIB's statistically significant result, which is produced under the assumption that pitchers are \textit{not} equally susceptible to being exploited (See Section \ref{sect:stratdisc}), is that each pitcher-specific batting strategy was computed using a few thousand samples.\vadjust{\goodbreak} In many previous baseball articles, authors have used Markov Chain Monte Carlo (MCMC) techniques to produce a sufficient number of samples to test their model [\citet{breakdown,bayes,bask}]. Currently, this is the only model that uses only the real-world pitch-by-pitch data to produce a result that is both intuitive and supported with algorithmic statistics. Baseball has a rich history of elite batters making decisions that nonelite batters cannot. This is exemplified by Vladimir Guerrero, a future first-ballot hall of fame ``bad-ball hitter,'' swinging at a pitch that bounced off the dirt for a base hit during an MLB game. It is therefore possible that elite players do not benefit from an exploited pitcher's pitcher-specific batting strategy because they make instinctual decisions. Given that the nonelite batters' simulated statistics are superior to their actual statistics, using the exploited pitchers' pitcher-specific batting strategies would be incredibly useful in a real MLB game. We feel that modeling the at-bat setting as a Markov Decision Process to statistically analyze baseball players' decision-making will change talent evaluation at the professional level. \begin{appendix}\label{app} \section*{Appendix: Baseball definitions}\label{sect:lingo} \begin{enumerate \item[] A \textit{Plate Appearance \textup{(}PA\textup{)}} is when the batter has completed their turn batting. \item[] An \textit{at-bat \textup{(}AB\textup{)}} is when a player takes their turn to bat against the opposition's pitcher. Unlike Plate Appearances, at-bats do not include sacrifice flies, walks, being hit by a pitch or interference by a catcher. \item[] A \textit{Hit \textup{(}H\textup{)}} is when a player reaches base by putting the ball into play. \item[] A \textit{Walk \textup{(}BB\textup{)}} is when a player reaches base on four balls thrown by the pitcher. \item[] The [\textit{pitch}] \textit{count} is the current ``state'' of the at-bat. This is quantified by the number of balls and strikes, denoted by $B$ and $S$, respectively, thrown by the pitcher. This is numerically represented as B--S, where $0 \leq B \leq4$, $0 \leq S \leq3$ and $B,S \in\mathbb{Z}_+$, where $\mathbb{Z}_+$ is the set of $\mathit{positive}$ integers. Note that an at-bat has ended if any one of the conditions is true: \begin{itemize} \item$(B=4)\cap(S < 3)$ (referred to as a walk) \item$(B < 4) \cap(S=3)$ (a strikeout) \item$(B<4) \cap(S<3)$ \textit{and} the batter hit the ball inside the field of play. This results in two disjoint outcomes for the batter: out or hit. There is a special other case we mention below. \end{itemize} \item[] A \textit{Foul} is when a player hits the ball outside the field of play. If $S < 2$, then the foul is counted as a strike. When $S=2$ and the next pitch results in a foul, then $S = 2$. That is, if a ball is hit for a foul with two strikes, the count remains at two strikes. However, if a foul ball is caught by an opposing player before it hits the ground, the batter is out regardless of the count. \item[] A \textit{Batter's count} is defined as a pitch count that favors the batter---that is, the number of balls are greater than the number of strikes (exception of the 3--2 count, which is referred to as a full count). \item[] A \textit{Baserunner} is a player who is on base during his team's at-bat. \item[] A \textit{Runner in Scoring Position (RISP)} is a baserunner who is on second or third base. This is because when an at-bat results in more than a double, the baserunner on second base can score. \item[] \textit{Walks plus hits per inning pitched (WHIP)} is a measurement of how many baserunners a pitcher allows per inning. It is the sum of the total number of walks and hits divided by the number of innings pitched. \item[] \textit{Earned Run Average (ERA)} is the average number of earned runs a pitcher has given up for every nine innings pitched. \item[] \textit{On Base Percentage (OBP)} is a statistic which represents the number of times a player reaches base either through a walk or hit when divided by their total number of at-bats. \item[] \textit{Slugging Percentage (SLG)} is a measure of the hitter's power. It assigns rewards 1, 2, 3 and 4 for a single, double, triple and home run. SLG is a weighted average of these outcomes. \item[] \textit{On-base Plus Slugging (OPS)} is the sum of the On-base Percentage and Slugging Percentage---that is, OPS${} = {}$OBP${} + {}$SLG. \end{enumerate} \end{appendix} \section*{Acknowledgments}\label{acknowl} The following acknowledgments are strictly on the behalf of Gagan Sidhu: I would like to dedicate this work to a Statistical pioneer, Dr. Leo Breiman (1928--2005), whose fiery and objective writing style allowed the Statistical learning community to garner recognition. This work would not have been considered statistics without Dr. Breiman's \textit{Statistical Science} article that delineated algorithmic and classical statistical methods. Big thanks to Dr. Michael Bowling (University of Alberta) for both supervising and mentoring this project in its infancy, Dr. Brian Caffo for selflessly senior-authoring this paper, and Dr. Paddock, the Associate editor and reviewers for providing helpful comments. Last, thanks to Lauren Styles for assisting in marginalizing my posterior distribution. \begin{supplement}[id=suppA] \stitle{Supplement to ``MONEYBaRL: Exploiting pitcher decision-making using Reinforcement Learning''} \slink[doi]{10.1214/13-AOAS712SUPP} \sdatatype{.pdf} \sfilename{aoas712\_supp.pdf} \sdescription{A high-level overview of the technical details of the implementation used in this article.} \end{supplement}
{'timestamp': '2014-08-01T02:09:16', 'yymm': '1407', 'arxiv_id': '1407.8392', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8392'}
arxiv
\section{Introduction} \label{sec:intro} It is widely believed that the origin of life required the formation of sets of molecules able to collectively self-replicate, as well as of compartments able to undergo fission and proliferate, i.e.{\em protocells}~\citep{Szostak:2001xw,Rasmussen:2004aa,Rasmussen2003}. In particular, in order to observe a lifelike behavior it was necessary that some of the chemical reactions were coupled to the rate of proliferation of the compartments. Several protocell architectures have been proposed~\citep{Carletti:2008rm,Filisetti2010b,Ganti:2003aa,Luisi2006,Mansy:2008kx,Morowitz1988,Munteanu:2006vn,Rasmussen2003,Rocheleau:2007gf,Segre2000,Serra:2007aa,Sole:2007jw,Stano2010,Szostak:2001xw}, most of them identifying the compartment with a lipid vesicle that may spontaneously fission under suitable circumstances. On the other hand, many distinct models were proposed to describe sets of reactions involving randomly generated molecules~\citep{R.J.Bagley:1991ys,Farmer1986,Hordijk2010,Kauffman:1986mi}. In many cases, although this is not in principle required, it is assumed that only {\em catalyzed} reactions take place at a significant rate, therefore these sets are also termed {\em catalytic reaction sets} (briefly, CRSs). It is worth noting that the appearance of new molecules implies the appearance of new reactions involving those new molecules, so that both the set of molecular types and the set of reactions change in time. Hence, it is possible that at a certain time a set of molecules able to catalyze each other's formation emerges~\citep{Farmer1986,Hordijk2010,Kauffman:1986mi}, and we will refer to it as an {\em autocatalytic set} (ACS). It can be noticed that a CRS can contain one or more ACSs, or none. \\ Even though some models of protocell actually describe the coupling between reaction networks and the dynamics of a lipid container, they consider only a fixed set of molecular species and reactions~\citep{Carletti:2008rm,Mansy2009,Serra:2006aa,Zhu:2009kx}, hence providing an incomplete representation of this complex interplay. Conversely, while there are several studies on collectively self replicating sets of molecules in a {\em continuously stirred open-flow tank reactor}, CSTR~\citep{R.J.Bagley:1991ys,hordijk-2002,Jain:2001xw,Stadler1991,Stadler1990,Stadler1995} including our own~\citep{Filisetti2011a,Serra2013,Filisetti2011b}, they provide only limited information about the behavior of a protocell. Therefore, in order to develop a framework that may unify the CRSs and the protocell modeling approaches, it is necessary i) to analyze the behavior of CRSs in a vesicle, and ii) to investigate the coupling of the evolving chemical population with the growth of the lipid container and its fission. In this paper we propose a step towards the first goal, while deferring the second one to a further work. In particular, we here analyze the behavior of a dynamical model of CRSs in a simplified model of a non-growing vesicle. To the best of our knowledge this is a novel approach.\\ A few important remarks. Let us first observe that the CSTR is not an {\em a-priori} good model of a protocell for at least two reasons: $i)$ in general, in protocells there is no constant inflow and $ii)$ protocells have semipermeable membranes, which allow the inflow/outflow of some, but not all, molecular types. On the contrary, in open flow reactors all that is contained in the inflow enters the reactor and all that is dissolved in the reactor can be washed out in the outflow.\footnote{Limitations on the outflow can be modeled in a chemostat e.g. by supposing that all the molecules that are larger than a certain size precipitate and cannot be washed away.} Another important limit of the CSTR concerns its evolvability. It has been argued~\citep{Wesson1991,Morris2003} that the presence of different asymptotic dynamical states and the ability to shift between them may be essential to achieve the viable evolution of the first forms of life. Recent works~\citep{Vasas2012} have found that, in models of catalytic reaction networks in CSTRs, generally only one of these states is found, apart from fluctuations~\citep{Dai2009}.\\ Furthermore, in order to accomplish the goal of this work, we need to better specify both the model of catalytic reactions sets and that of the protocell. As far as the former is concerned, we have studied the dynamics of random sets of molecules by revisiting a model by Kauffman, who proposed an interesting way to build new molecular species from the existing ones (see section~\ref{sec:model} for a description). The original version of the model relied on purely graph-theoretical arguments~\citep{Kauffman:1986mi}, which are important, but fail to appreciate the effects of the dynamics, including noise, fluctuations and small-number effects. The dynamics has been later introduced by Farmer et al.~\citep{R.J.Bagley:1991ys,Farmer1986}, who described the kinetics by using ordinary differential equations. However, this formalism does not account for the chance of a species to become extinct in a finite amount of time, as it may instead well happen (so the reaction graph may grow but never shrinks). In order to overcome these limitations, Bagley proposed an empirical correction by setting to zero the concentration values that happen to fall below a certain threshold~\citep{R.J.Bagley:1991ys}. In our works we rather use from the very beginning a stochastic approach to analyze the dynamics, the well-known Gillespie algorithm~\citep{Gillespie:2007vn,Gillespie:1977fv}, in order to deal in a rigorous way with low concentrations and with their fluctuations.\\ Note that the Kauffman model largely relies upon randomness. In particular, every polymer in the system has a fixed probability (that may vanish) to catalyze any possible reaction. Therefore, in different simulations the same species can catalyze different reactions leading to the formation of different {\em~\lq\lq chemistries\rq\rq}. Thus, this is exactly the language we choose: a set of tuples $\left \{species, catalysis, reaction\right \}$, where the species catalyzes the reaction, will be called~~\lq\lq chemistry\rq\rq, because it describes a possible artificial world.\footnote{It is worthwhile to notice that the presence of the~\lq\lq catalysis\rq\rq~within the tuple allows the possibility for a species to catalyze more than one reaction and for a reaction to be catalyzed by more than one species.} We can then simulate different chemistries and look for generic properties of the set of chemistries; but in a different series of experiments we can also keep the chemistry fixed, and simulate various time histories. In principle, these may differ, since the discovery of a given catalyst at an early phase in a finite system might channel the following evolution in a way or another. Since the number of molecules of some species may be very small, it is not in principle legitimate to ignore this aspect, and our stochastic model is particularly well suited to analyze it, as it will be shown in Section~\ref{sec:model}. Of course, there can be conditions where all the simulations of a given chemistry converge asymptotically to the same chemical mixture.\\ Moving now to the protocell model, note that they are usually based on lipid vesicles, i.e. approximately spherical structures with an aqueous interior and a membrane composed by a lipid bilayer, which spontaneously form when lipids are mixed with water under certain conditions~\citep{Cans:2008ek,Dominak:2007gd,Hanczyc2003,Luisi2006,citeulike:1586749,Munteanu:2006vn,Polozova2005117}. Even though different protocell architectures have been proposed, we will here consider the simplest model, namely that in which all the key reactions take place in the aqueous phase \textit{inside} the protocell. It would be indeed straightforward to model the coupling between some of these molecules and the growth of the protocell following an approach similar to that of our previous studies~\citep{Carletti:2008rm,Filisetti2010b,Serra:2006aa}. Yet, the main objective of the present work is that of studying the dynamics of CRSs embedded in a vesicle, so we will simplify our treatment by ignoring the growth dynamics of the protocell, and keeping its volume fixed. This implies that our study will be limited to time intervals that are short with respect to those describing the growth of the whole protocell.\\ The selective character of membranes is a key ingredient of our model: we will suppose for simplicity that all (and only) the molecules that are shorter than a certain length can cross the membrane. The transmembrane motion of the permeable species is here supposed to be driven by the difference of their concentrations in the internal aqueous volume of the protocell and in the external aqueous environment. We will assume that transmembrane diffusion is extremely fast, so that there is always equilibrium between the concentrations of the species that can cross the membrane; this adiabatic hypothesis could be easily relaxed in the future. Furthermore, we assume that protocells are turgid, so that the constant-volume approximation implies that we will also neglect issues related to osmotic pressure. Another related aspect of the model is that, since it is assumed that the permeable species are at equilibrium, while the non-permeable ones never cross the barriers, infinite concentration growth is possible; this is obviously a nonphysical behavior, so the model validity is limited in time. All these simplifications, which will be removed in subsequent studies, are also justified by the fact that our main goal is that of studying how the dynamics of CRSs are affected by being embedded in a vesicle.\\ This model can be used in order to investigate the behavior of the system in different conditions and to address some important questions. The first and perhaps most important one is the reason why compartments seem to be necessary for life. Indeed, the very first studies on self-replicating molecules~\citep{Eigen1977a,Dyson:1985uq,Kauffman:1986mi,Jain:1998fk} were not interested in this aspect, so the CRSs were supposed to exist, e.g., in a pond or in a beaker. Yet life seems to require compartments, that are ubiquitous. It is then important to understand whether there are major differences between what may happen in a protocell and what happens in the bulk phase. It would be unconvincing to postulate {\em a priori} that the internal and external environments are different. It is indeed more likely to assume that the vesicles form in a pre-existing aqueous environment, so the average internal milieu is essentially the same as the external one.\footnote{It has been observed that some superconcentration phenomena can take place under particular circumstances~\citep{DeSouza2012,Serra2013a} but we will neglect them here.} Then, if a membrane surrounds a portion of the fluid, what can happen that makes a difference?\\ Let us first observe that protocells are small (their typical linear dimensions ranging from $0.1$ to $10 \mu m$). If we imagine that a population of protocells exists, and they are not~\lq\lq overcrowed\rq\rq, their total internal volume will typically be much smaller than the total external volume (this is {\em a fortiori} true for an isolated one). Moreover, every point in the interior of a protocell is not allowed to be far away from the surface of the protocell that contains it. These observations imply that the effect of surfaces will be much larger within protocells then outside them. Suppose for example that the membrane hosts some catalytic activities, so that important molecules are synthesized close to its boundaries, both inside and outside, and diffuse freely. If the membrane width is much smaller than the protocell radius, then the internal and external surface areas are very close to each other, but the external volume is much larger than the external one: therefore the internal concentrations will be much higher than those in the external environment. In this case, the system behavior in the interior can be significantly different from the external one~\citep{Serra2013a}. Note also that this effect may be different for different molecules: the formation of some of them might be catalyzed by the membrane, while others might be unaffected: so even the relative concentrations of different chemicals may differ in the two cases.\\ Indeed, there are important protocell models that are based on such an active catalytic role of the membrane~\citep{Rasmussen2003}. In these cases it is easy to understand what the role of the protocell is, since it provides essential catalysts and a way to keep their products closer. But protocells might be able to give rise to an internal environment different from the bulk even if the catalytic activity is absent. The reason for this seemingly counterintuitive behavior is, once again, the smallness of the protocells. Note that we are considering a case where new molecules are formed (from those that are already in the interior of the protocell plus those that can cross the semipermeable membrane). If the concentrations are not too high, it is likely that the total numbers of newly formed molecules are quite low, so that different protocells might host different groups of molecules. It might even happen that a molecular type is present in some protocells and not in others.\\ In order to get a feeling for this possibility, let us provide some realistic estimates of the number of molecules of different types that can be present in a protocell. Let us consider typical vesicles (linear dimension about $1\mu m$) and small ones ($0.1\mu m$). Typical concentrations of macromolecules may be in the millimolar to nanomolar range; the excepted numbers of molecules in a single protocell are therefore given in table~\ref{tab:expNumofMols}. \begin{center} \begin{table} \begin{tabular}{|c|c|c|c|c|c|} \hline & $1M$ & $1mM$ & $0.1mM$ & $1\mu M$ & $1nM$\\ \hline Typical ($1 \mu^{3}$) & $10^{8}$ & $10^{5}$ & $10^{4}$ & $10^{2}$ & $0.1$\\ \hline Small ($10^{-3} \mu^{3}$) & $10^{5}$ & $10^{2}$ & $10$ & $0.1$ & $10^{-4}$\\ \hline \end{tabular} \caption{excepted number of molecules of a given species in a given protocell; rows refer to protocell volumes, columns to concentrations.} \label{tab:expNumofMols} \end{table} \end{center} Let us recall that these numbers refer to the excepted values, but there are fluctuations that may be relevant when small numbers are involved. For example, in the case of a $1\mu M$ concentration in small vesicles, there will be on average $1$ molecule every $10$ cells: it is apparent that different protocells will have widely different initial compositions. We therefore come to the conclusion that the creation of small compartments can allow the formation of a population of different individuals out of the fluctuations of an environment that looks macroscopically homogeneous. While not yet sufficient, this is definitely a necessary condition for darwinian evolution to take place (obviously supposing that the compartments can divide and that their division rate depends upon composition). Moreover, in small stochastic systems it may also happen that there are different trajectories stemming from the same initial conditions, due to the order in which new molecules are synthesized. These aspects of protocell dynamics are very important and our model, in spite of its current limitations, is well suited to explore the related phenomena. It is indeed possible to analyze the different possible stochastic effects, that include: \begin{enumerate}[(i)] \item the path dependency induced by the random order in which new molecules are generated, with particular regard to the low concentration effects: if a catalyst is discovered in advance with respect to another, the system evolution may be different; this can be studied by comparing different simulations referring to the same chemistry, starting from the same initial conditions; \item the differences induced by different initial conditions, randomly generated from the same distribution; \item the different behaviors of distinct chemistries: in the real world the rules of the chemistry are given, but in the kind of analysis performed here it is also interesting to understand how different chemistries may affect the behavior of the system and the diversity of a population of protocells. As, for example, the role of {\em RAF sets} \citep{Hordijk2010,Hordijk:2004vl,Hordijk2012} in the overall dynamics. \end{enumerate} In Section~\ref{sec:results} we present the results of the simulations on the model. In the concluding Section~\ref{sec:final} we will discuss the main findings of this paper, and we will propose further analysis and refinement of the models. \newpage \section{Main features of the model} \label{sec:model} \paragraph{Entities and interactions.} \label{sec:entInt} The model describes an open system in which simple molecules interact with each other through elementary catalyzed reactions. The basic entities of the system are monomers and polymers, identified by ordered strings of letters oriented from left to right taken from a finite alphabet (e.g. $A, B, C, \ldots$). We will refer to the~\lq\lq letters\rq\rq~also as bricks, while the term monomer will be reserved to those molecular types that are composed of a single brick. Every species $x_i,i=1,2,\ldots,N$ composing the entire set of species $X=[x_1,x_2,\ldots,x_N]$ is characterized by its specific amount (either quantity or concentration), denoted by $\hat{x}_{i}$. The number of copies of a specific species defines its number of molecules. The two basic reactions are: \textit{i)} cleavage, i.e. the cutting of a species composed of more than one brick into two shorter species (e.g. $ABBA \rightarrow A + BBA$) and \textit{ii)} condensation, i.e. the concatenation of two species in a longer one (e.g. $BBA + AAB \rightarrow BBAAAB$). A key assumption of the model is that any reaction occurs only if catalyzed by one of its specific catalysts; hence we exclude the presence of spontaneous reactions by assuming sufficiently high activation energy for each reaction. In particular, condensation requires an intermediate reaction in which a temporary complex between the catalyst and the substrate is formed. A further restriction regarding catalysis imposes that only species that are composed of at least a minimum number of bricks can be catalysts. Additionally, we neglect the presence of backward reactions (exception made for the dissociation reaction of intermediate complexes) by hypothesizing that the Gibbs energy $\Delta G$ for any reaction is sufficiently large. A schematic representation of the various reaction types is given in Fig. 1.\\ \begin{figure}[htp] \centering \begin{tabular}{c} \includegraphics[scale=0.3]{schemino.pdf} \end{tabular} \label{fig:rctscheme} \caption{Schematic representation of the two possible reaction types, namely condensations and cleavages. $S, S_1$ and $S_2$ represent the substrates of a reaction, $C$ is a species with catalytic function, $S_{1}C$ is the transient complex that is formed in the first step of the condensation and $P, P_1$ and $P_2$ stand for the products of a reaction. $K_{cleav}, K_{comp}, K_{diss}$ and $K_{cond}$ respectively stand for the kinetic rates of cleavage, complex formation, complex dissociation and final condensation.} \end{figure} \paragraph{The reaction network.} \label{sec:rctnet} Provided that a catalyst for the reaction exists, each species in the system could condensate with any other species in the system, or be split at any cutting point into smaller species. The cardinality of the set $R$ of all the conceivable reactions for the system, at a given time, is therefore given by: \begin{equation} \hat{R}=\sum_{i=1}^{N}(L_{(x_{i})}-1)+N^{2} \label{eq:conceivableRcts} \end{equation} where $N$ is the cardinality of $X$ and $L_{(x_{i} )}$ is the length of $x_i$ (i.e. the number of bricks of that specific species). The first term of Eq.~\ref{eq:conceivableRcts} refers to the conceivable cleavages and the second one to the conceivable condensations. Hence, the set of reactions that are actually allowed, i.e. the~~\lq\lq chemistry\rq\rq~of the system, is determined by the catalysts involved in the various reactions. Following Kauffman, we define the chemistry of the system at random. In this regard, any species $x_i$ has a finite fixed probability $p_i$ of being chosen as catalyst of a randomly chosen reaction among those belonging to $\hat{R}$. It is worth stressing that, although the reaction network is built probabilistically, it remains invariant in time; in other words, once a species is chosen to be the catalyst of a given reaction, that species will always be catalyst for that reaction. Further details concerning the structures of the model can be found in~\citep{Filisetti:2010fk,Filisetti2011b}. \paragraph{The dynamics.} \label{sec:dynamics} The system's dynamics is simulated by means of an extension of the well-known Gillespie algorithm~\citep{Gillespie:2007vn,Gillespie:1977fv} for the stochastic simulation of chemical reaction systems, in which we allow the appearance of novel species and reactions that are not present in the system in the initial conditions. In fact, cleavage and condensation of elements either present within the protocell or entering it from the external environment can generate new species, which, in turn, can be involved in new reactions, both as catalysts and substrates. \paragraph{The container: the introduction of the protocell.} \label{sec:protocell} In its classical formulation~\citep{R.J.Bagley:1991ys}, the catalytic reaction network is modeled within a continuous stirred-tank reactor (CSTR), in which the ingoing and outgoing fluxes could be adjusted according to the experimental needs. In this work, we introduce a major modification of the model by introducing a semi-permeable membrane that separates the catalytic reaction network from the external environment (see Fig.~\ref{fig:protocell}).\\ \begin{figure}[htp] \centering \begin{tabular}{c} \includegraphics[scale=0.4]{protocellula.eps} \end{tabular} \label{fig:protocell} \caption{Schematic representation of the semi-permeable membrane as conceived in our model of protocell. The membrane is here represented as a lipid bilayer that shapes a spherical vesicle. In this example, only the species shorter than 3 letters can cross the membrane, entering or leaving the internal compartment, the dynamics of which is actually simulated in our model of catalytic reaction networks. On the opposite, longer species are confined either inside or outside the vesicle.} \end{figure} The semi-permeable membrane is here modeled by allowing only some species to enter and leave the protocell, namely those that are shorter than an arbitrary length $L_{perm}$. All the species that are longer than $L_{perm}$ either remain entrapped within the protocell or never enter it from the outside. Another important assumption is that the concentration of the permeable molecules is homogeneous both inside and outside the protocell, and that they take the same value. That is, we assume infinitely fast diffusion both in the bulk phases and across the membrane, so that the chemical potentials of the permeable species are the same. The species that can cross the membrane will be also defined, from now on, as the {\em buffered} species. In this work, we consider the volume of the protocell to be constant, while it is planned to introduce protocell size and duplication dynamics in further developments of the model. We also remark that in this model the transport processes in a vesicle are treated in a way that, albeit simplified, parallels their actual dynamics. While small flow reactors have also been proposed as protocell models~\citep{Hordijk2012,Vasas2012}, they are indeed not well suited, since they require a constant inflow that has no physical analogue in a vesicle, and usually also allow the outflow of all the solutes. \begin{algorithm}[H] \caption{Formal definition of the model as multiset-rewriting system.} \label{alg:driver} \begin{algorithmic}[1] \STATE {let $\Psi$ be the alphabet of symbols denoting monomers, $A, B, C ...$;} \STATE {the $\Theta^*$ and $\Xi^*$ be the (infinite) set of all finite-length non-empty {\em polymers} and {\em substrate-catalyst complexes} over $\Psi$, and let us denote by $P \cdot Q$ (resp. $P \_Q$, substrate-catalyst) the polymer (resp. complex) obtained by concatenating polymers $P$ and $Q$;} \STATE{ let the state of the system be multiset $\Phi\equiv P_1 \mid P_2\mid...\mid P_n$ counting the occurrences of each polymer/complex $P_i \in \{\Theta^* \cup \Xi^*\}$;} \STATE consider the following reaction schema with variables $X, Y$ and $Z$, in a multiset-rewriting notation: \\ \begin{itemize} \itemsep1pt \parskip0pt \parsep0pt \item {\bf [A: Cleavage]} \\ $R_{cl}: X \cdot Y \mid Z\mapsto X \mid Y \mid Z$ \\ \COMMENT{$Z$ is the catalyst, $X \cdot Y$ is the polymer breaking to $X$ and $Y$} \\ \item {\bf [B1: Complex formation]} \\$R_{cf}: X|Y \mapsto X \_ Y$ \\ \item {\bf [B2: Complex dissociation]} \\ $R_{cd}: X \_ Y \mapsto X\mid Y$ \item {\bf [B3: Final condensation]} \\ $R_{fc}: X \_ Y \mid Z \mapsto X \cdot Z \mid Y$\\ \COMMENT{$X$ and $Z$ are substrates, $Y$ is the catalyst, $X\_Y$ is the substrate-catalyst complex, $X \cdot Z$ the polymer composed by $X$ and $Z$} \end{itemize} Variable polymers ($X \cdot Y$) take values in $\Theta^*$, whereas complexes ($X \_Y$) in $\Xi^*$. \STATE (Reactions generation) an {\em instantiation map} $\varphi$ is evaluated via standard pattern matching to transform the above schema in all the possible rewriting rules \[ {\cal R}^{\varphi} = R_{cl}^{\Phi}\cup R_{cf}^{\Phi} \cup R_{cd}^{\Phi} \cup R_{fc}^{\Phi} \] for multiset $\Phi$. The map $\varphi$, which assigns values to $X, Y$ and $Z$, is required to be {\em maximal} and {\em univocal}, i.e. it must yield all the possible rewriting rules applicable in $\Phi$ and instantiated consistently (via deterministic association) for any of its evaluation. \STATE $\Phi$ and ${\cal R}^{\varphi}$ yield a Continuous-time Markov Chain. By firing a reaction in ${\cal R}^{\varphi}$ via the classical Gillespie algorithm a new state of the system is generated. In this particular implementation of the model, polymers shorter than 3 are fed and cannot be instantiated as catalysts (see Appendix \ref{app:app1}). The simulation proceeds with the new state from previous step. \end{algorithmic} \end{algorithm} \section{Results of the simulations} \label{sec:results} The preliminary experiments on the protocell model were performed by keeping fixed some key structural parameters (see the Appendix for the details) and creating different random chemistries. In particular, we here present the details of two specific chemistries, which were specifically selected among many (on a total of 10 simulated chemistries) because they exhibit very specific dynamical properties. In this regard, it is first important to introduce the concept of {\em RAF set}, which be fundamental in the description of these systems. Following Hordijk et al.~\citep{Hordijk2010,Hordijk:2004vl,Hordijk2012}, given the entire chemistry, a subset of reactions $\mathcal{R}$ is: $(i)$ \textit{Reflexively autocatalytic} (RA) if every reaction in $\mathcal{R}$ is catalyzed by at least one other reaction belonging to $\mathcal{R}$, $(ii)$ \textit{Food-generated} (F) if every substrate in $\mathcal{R}$ can be produced from the food set \textit{F} by means of the reactions belonging to $\mathcal{R}$, $(iii)$ \textit{Reflexively autocatalytic and F-generated} (RAF) if both the previous conditions are satisfied. The chemistries of the two presented protocells differ for the presence/absence of a RAF set (RAF in short from now on): in particular, in the first protocell ($CH1$) no RAFs are present, whereas in the second protocell ($CH2$) a RAF formed by an autocatalysis consuming molecules from the food set is present. In order to assess the behavior of the system, a method to measure the {\em similarity} between two different states of the system is that proposed by Kaneko~\citep{Kaneko:2006eu} and is based on the comparison of the vectors that describe their chemical compositions. Let us define the k-dimensional vectors $C_{j}(t)=[c_{j,1}(t),c_{j,2}(t),...,c_{j,N} (t)]$ and $C_{k}=[c_{k,1} (t),c_{k,2} (t),...,c_{k,N} (t)]$ whose components are the concentrations of the species present at time $t$ in systems $j$ and $k$ respectively. Same positions in vectors refer to same species, hence species present in system $j$ that are not present in $k$ have concentration equal to 0 and viceversa. The similarity between the two systems is then computed by means of the normalized inner product: \begin{equation} \Theta_{t}=cos^{-1}\left(\frac{\vec{C_j}(t) \cdot \vec{C_k}(t)}{||C_j(t)|| \cdot ||C_k(t)||}\right) \label{eq:angle} \end{equation} where $\Theta_{t}$ is the angle between the two vectors measured at the time $t$. Throughout this paper, angles will be measured in degrees. \subsection{Low concentration effects} \label{sec:pathDep} In this section we investigate the low concentration effects in protocells. To this end, the selected chemistries are tested with respect to 4 different initial uniform concentrations of the chemical species present inside the vesicle: in detail, the initial concentration of all the non-buffered species is equal to: $1 mM$, $0.1 mM$, $0.01 mM$ and $1 \mu M$. Conversely, the amount of each buffered species is always fixed to $1 mM$. Notice that, in general, the protocell model presented here does not lead to stationary chemical distributions. Indeed, situations are possible where some particular species indefinitely increases its concentration: an example is the RAF set in $CH2$, where a particular species catalyses its own formation using two buffered species as substrates: in this case an exponential growth is achieved. Another simple case could be the linear growth of a species produced directly from the buffered species by means of a catalyst not involved in other reactions, i.e. present in constant concentration. Of course, more complex situations are possible, even not directly originating from the food set. Yet, many simulations show a transient in which the chemicals distribution rapidly change followed by a long quasi-equilibrium, where changes are limited to small adjustments. By applying the parameters adopted in the present work, such a state is already achieved in $2500$ seconds, except for the case of very low concentrations ($1\mu M$) \begin{center} \begin{table} \footnotesize \begin{tabularx}{\textwidth}{|c|X|X|X|X|X|X|X|} \hline Conc & Mol- ecules per species & \multicolumn{2}{ |X| }{$CH1$} & \multicolumn{2}{ |X| }{$CH2$} & \multicolumn{2}{ |X| }{$CH2$ (no RAF)}\\ \hline Molarity & Average & $\Theta_{3000}$ (mean) & $\Theta_{3000}$ (max.) & $\Theta_{3000}$ (mean) & $\Theta_{3000}$ (max.) & $\Theta_{3000}$ (mean) & $\Theta_{3000}$ (max.) \\ \hline (Cond.1) $1mM$ & 600 & 0.41 & 0.68 & 0.06 & 0.19 & 0.57 & 0.96 \\ \hline (Cond.2) $0.1mM$ & 60 & 2.34 & 5.86& 0.18 & 0.52 & 1.69 & 2.78 \\ \hline (Cond.3) $0.01mM$ & 6 & 7.71 & 15.28 & 9.69 & 21.86 & 6.48 & 11.21 \\ \hline (Cond.4) $1\mu M$ & 1 & 11.15 & 19.35 & 3.67 & 11.91 & 9.44 & 15.35 \\ \hline \end{tabularx} \caption{In the table the average and the maximum values of $\Theta_{3000}$ relative to 10 distinct simulations of each of the $4$ different initial conditions (rows in the table) are shown. The measures are reported for the 2 different chemistries: the one without RAFs and the one with RAFs, for which they are also computed without taking into account the species belonging to the RAF, column~~\lq\lq CH2 (no RAFs)\rq\rq. The $4$ conditions differ in the average magnitude of the initial concentrations of the initial set of molecular species not belonging to the buffered flux (the food set). A realization of each of the 4 initial concentration is drawn at random from a Poisson distribution, according to the given parameters, and is maintained invariant across the 10 different runs.} \label{tab:angleALL} \end{table} \end{center} \paragraph{Diversity.}In table~\ref{tab:angleALL} some statistics on how $\Theta$ varies according to the different cases are shown and, in particular, it is possible to appreciate an increase of the dissimilarity among protocells in correspondence with a decrease on the initial concentration, as indicated by the average and the maximum value of $\Theta$ between all the runs of each specific chemistry and specific initial condition, computed at time $t=3000$.\footnote{Exceptionally for the case $1\mu M$, $\Theta$ is not computed after 3000 second but when at least $5000$ reactions have occurred within the simulation. The reason for this is that the low concentrations involve a so slow dynamics that $3000$ seconds are not enough in order to observe significant chemical changes.} Since these runs are characterized by identical chemistries and identical initial conditions, the angle reported here is indeed the result of dynamical evolutions that differ only for the simulation random seed. It is worth remarking that the lower is the concentration profile, the higher is the distance among the final distributions,\footnote{In regard to $CH2$ we are here considering the value of $\Theta$ excluding the species belonging to the RAF set (last columns of the table). Since the molecules belonging to the RAF set reach a concentration much greater with respect to the other molecules, considering them in the angle computation would misrepresent the distance among the simulations.} i.e. the angle $\Theta$ reaches its maximum value with regard to very low initial concentrations (e.g. $1$ molecule per species on average). It is interesting to notice that the displayed low concentration effects with respect to the overall similarity of the system are found in both chemistries, hinting at a generic property of such systems, independently of the possible presence of RAF sets. \paragraph{The influence on RAF set dynamics.} The asynchronous framework implies that only one reaction occurs at the time. Given that RAFs in general involve more than one reaction, in order to detect their presence we analyze the system in a time interval \textit{(i)} sufficiently large to let a significant number of reactions to occur, yet \textit{(ii)} not embracing the whole simulation (in order to avoid the presence of too rare reactions); It is worth stressing that since the analysis are made {\em ex post} with respect to the simulation of the system, they do not affect the simulated dynamics, but just the way of representing it. In fig.~\ref{fig:traces}, we show the presence (or the absence) of the RAF of $CH2$ every $10$ seconds, by using a time window of $5$ seconds,\footnote{We set the sampling frequency and the time threshold of the windows by taking advantage from several initial model threads, not essential to the comprehension of this article.} with respect to the 4 aforementioned different average concentrations.\\ Note that in all the initial conditions the autocatalytic species has a concentration higher than zero, thus the corresponding RAF is always able to achieve its own growth viability. From Fig.~\ref{fig:traces} it is possible to observe the strong correlation between the average concentration of the species within the protocell and the presence of RAFs. As long as the concentration decreases, so does the probability of detecting a RAF, yet in the long run in most of the simulations RAFs eventually emerge. \begin{figure}[htp] \centering \begin{tabular}{c} \includegraphics[scale=4.8]{1_cond_trace_BN}\\ \includegraphics[scale=4.8]{2_cond_trace_BN}\\ \includegraphics[scale=4.8]{3_cond_trace_BN}\\ \includegraphics[scale=4.8]{4_cond_trace_BN}\\ \end{tabular} \caption{From the top to the bottom the four traces, accounting for conditions $1, 2, 3$ and $4$ of the chemistry 2, i.e. the one containing the RAF set, depicting the presence of the RAF during the simulation (time flows from left to right, each row represents a different run of the same condition). The black zones stands for the absence of the RAF set, while gray zones denote the presence of the RAF. It is important to remark that RAFs are searched in a dynamic network created with the reactions occurred in a mobile time window of 5 seconds. } \label{fig:traces} \end{figure} \subsection{Sensitivity to initial conditions} \label{sec:difInitConc} We here analyze the effects of variations in the initial concentrations of the single species present within the protocells, while maintaining their average concentration fixed. We simulate 10 different variations of the single species concentrations for both the case of average concentration equal to $0.01mM$ (condition $3$) and average concentration $1\mu M$ (condition 4). In Fig.~\ref{fig:angleintime} we display the variation of the similarity in time for each couple of simulations, with respect to both conditions, in order to provide a picture of the sensitivity of the overall diversity to the initial conditions. Note that the very low concentrations of condition $4$ (in average, only one molecule for each species) imply that in certain protocell realizations some species are missing: in particular, each simulation starts from a different set of species composed of, on average, $40$ species, on the possible $62$. This may explain the very high values of $\Theta_{0}$ with respect to condition $4$ (Fig. \ref{fig:angleintime}). Besides, one can see that condition $4$ shows an evident bifurcation (Fig.~\ref{fig:angleintime}b). Given that in some simulations, because of the low concentration effects, the autocatalytic species (and so the RAF) can be present or absent in the initial condition, the system can indeed reach different regions of the state space, leading to deeply different histories. On the opposite, condition $3$ shows the aforementioned regulatory activity of the always active RAF. \begin{figure}[htp] \centering \begin{tabular}{c} \includegraphics[scale=0.3]{c3_angle_intime}{\tiny(a)} \includegraphics[scale=0.3]{c4_angle_intime}{\tiny(b)}\\ \end{tabular} \caption{The angles between each couple of different simulations in time, for condition $3$ ($0.01mM$ - left panel) and condition $4$ ($1\mu M$ - right panel).} \label{fig:angleintime} \end{figure} Finally, it is important to remark that during each simulation many species disappear and many other appear, so a compact way to follow the process is that of monitoring, during each run, the variation of the angle $\Theta_{T^{0}\rightarrow T^{t}}$ between the initial and the current chemical setting (Fig.~\ref{fig:anglefromt0}a). The graph indicates that $\Theta_{0 \rightarrow 3000}$ approaches a value close to $80$ degrees, which means a quasi-orthogonality of the system with respect to the initial condition. The dynamics of the system, in term of molecular concentrations, leading to such a divergence from the beginning is shown in Fig.~\ref{fig:anglefromt0}b. It is reasonable to hypothesize that the clear inversions in the trajectories of the concentrations of certain species may be responsible for this phenomenon. \begin{figure}[htp] \centering \begin{tabular}{c} \includegraphics[scale=0.28]{CH1_t0t3k_graph}{\tiny(a)} \includegraphics[scale=0.28]{g_ch1_c1_s1}{\tiny(b)}\\ \end{tabular} \caption{On the left panel the average angle (and the standard deviation) $\Theta_{T_{0}\rightarrow T_{t}}$ measured from $T_{0}$ to $T_{t}$ for each chemical distribution, within each single run of conditions $1$~(average molarity $1mM$) and $2$~(average molarity $0.1mM$), is shown. It is worthwhile to remark that $\Theta=90$ stands for a complete orthogonality between the chemical distributions. In order to appreciate the convergence towards a quasi-orthogonality, on the right panel the concentration of the species in time of a particular simulation are shown (Simulation: CH2, condition 1, run 1). The exponential growth concentration of the autocatalytic species is shown with a limit of $3mM$.} \label{fig:anglefromt0} \end{figure} \section{Conclusion and further developments} \label{sec:final} In this paper we introduced a simplified model of a non-growing protocell and we investigated the behavior of a stochastic model of catalytic reaction networks in such an environment. To the best of our knowledge this is a novel approach. The crucial importance of the small size of the protocell has been stressed, and the effects of the fact that some chemicals can be present in low numbers have been investigated. While a broader analysis is ongoing, we have here shown that it is possible to reach different compositions of the chemical species, in the particular case in which some species are present in the bulk at low concentrations. We have also shown that there are two different, possibly overlapping reasons for this diversity: $(i)$ the random sequence of molecular events involving those species and $(ii)$ the random differences in their initial concentrations. We have also stressed the importance of RAF sets in influencing the overall dynamics. There are several ways in which this work might seed further research. The most obvious is that of relaxing the physical limitations that have been considered, e.g. infinitely fast diffusion, yet we do not except that this may change the major conclusions summarized above. Obviously, a very interesting direction is that of considering a protocell that is able to grow and divide. The processes involved in protocell growth and replication are indeed complex and, in particular, a necessary condition for its existence and replication is the coupling between the rates of molecules replication and cell growth. We have shown elsewhere~\citep{Carletti:2008rm,Filisetti2010b,Serra:2006aa} that the very existence of this coupling suffices to guarantee (under very general conditions) that, in the long run, the rate of cell division and that of duplication of the replicating molecules converge to the same value, thereby allowing sustainable growth of a population of protocells.\footnote{This property was proved earlier by Munteanu et al. for the Los Alamos bug mode~\citep{Munteanu:2006aa}.} However, those results were achieved by supposing a fixed set of genetic memory molecules, with some possible extinction. It could be sound to extend this approach to the case where there are evolving chemical reaction sets and to verify whether synchronization occurs. An important aspect to be addressed in the case of growing vesicles is also the effect of volume growth on the concentrations of the various chemicals: a preliminary investigation can be found in~\cite{Carletti2012}. Besides, we have not here explicitly considered the possibly catalytic role of membranes that, as it has been discussed in section~\ref{sec:intro}, might be a major cause of the difference between the intracellular environment(s) and the bulk. In a fixed volume model this effect can be lumped in the effective reaction rates, but if we consider a growing protocell we have to take into account the differences between surfaces and volumes. This might also lead to interesting phenomena that will be analyzed in future developments. To conclude, different protocells may host different mixtures of molecular species, even if they share the same chemistry (i.e., they~~\lq\lq inhabit the same world\rq\rq). It might be extremely interesting to model the behavior of populations of different protocells of this kind, which may show different growth rates, but may also undergo phenomena like coalescence, exchange of material, etc.~Thus, further investigations will be indeed necessary to assess different generations of protocell populations and their possible evolution pathways.\\ Last but not least, it will be interesting to extend these studies to other protocell architectures like e.g. the Los Alamos bug, Gard models, and others. \section{Acknowledgements} Stuart Kauffman, Norman Packard and Wim Hordijk kindly shared with us their deep understanding of autocatalytic sets in several useful discussions. Useful discussions with Ruedi F\"uchslin, Davide De Lucrezia, Timoteo Carletti, Andrea Roli and Giulio Caravagna are also gratefully acknowledged. The authors are also grateful to Giulia Begal for kindly drawing the image of Fig.~\ref{fig:protocell}. C.D. wishes to acknowledge the project SysBionet (12-4-5148000-15; Imp. 611/12; CUP: H41J12000060001; U.A. 53) for the financial support of the work.\\ The final publication is available at Springer via http://dx.doi.org/10.1007/s11047-014-9445-6\\\\
{'timestamp': '2014-08-01T02:12:21', 'yymm': '1407', 'arxiv_id': '1407.8508', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8508'}
arxiv
\section{Introduction} In high-throughput data analysis, selecting informative features from tens of thousands of measured features is a difficult problem. Incorporating pathway or network information into the analysis has been a promising approach. Generally the setup of the problem contains two pieces of information. The first is the measurements of the features in multiple samples, typically with a clinical outcome associated with each sample. The second piece of information is a network depicting the biological relationship between the features, which is based on existing biological knowledge. The network could contain information such as protein interaction, transcriptional regulation, enzymatic reaction and signal transduction, etc. [\citet{cerami2011pathway}]. Some methods are developed using the available network topology for high-throughput data analysis. These methods incorporate the gene-pathway relationships or gene network information into a parametric/regression model. The primary goal is to identify either the important pathways or the genes that are strongly associated with clinical outcomes of interest. For example, there are a series of works [\citeauthor{wei2007markov} (\citeyear{wei2007markov,wei2008markov}); \citeauthor{wei2010network} (\citeyear{wei2010network})] that model the gene network using a Discrete or Gaussian Markov random field (DMRF or GMRF). \citet{li2008network} and \citet{pan2010incorporating} used the gene network to build penalties in a regression model for gene pathway selection. \citet{ma2010incorporating} incorporated the gene co-expression network in identification of caner prognosis markers using a survival model. \citet{li2010bayesian} and \citet {stingo2011incorporating} developed Bayesian linear regression models using MRF priors or Ising priors that capture the dependent structure of transcription factors or the gene network/pathway. Recently, \citet {jacob2012more} proposed a powerful graph-structured two-sample test to detect differentially expressed genes. Although regression models are widely used for the selection of the gene subnetwork that is associated with an outcome variable, in some situations the question of interest is to study the expressional behavior of genes, for example, periodicity, without an outcome variable. In other situations, the experimental design is more complex than simple case-control. For example, some gene expression studies involve longitudinal/functional measurements for which the parametric models [\citeauthor{leng2006classification} (\citeyear{leng2006classification}); \citeauthor{zhou2010analysis} (\citeyear{zhou2010analysis}); \citeauthor{breeze2011high} (\citeyear{breeze2011high})] or the multivariate testing procedure [\citet{jacob2012more}] may not be applicable without a major modification. A straightforward approach to this problem is to perform large-scale simultaneous hypothesis testing on gene behavior. A set of genes can be selected based on the testing statistics or $p$-values, where a correct choice of a null distribution for those correlated testing statistics [\citeauthor{efron2004large} (\citeyear{efron2004large,efron2010correlated})] should be used. However, this approach ignores the gene network information that is useful to identify the subnetwork of genes with the particular expressional behavior. Due to the diverse behavior of neighboring genes on the network, it is generally believed that genes in close proximity on a network are likely to have joint effects on biological/medical outcomes or have similar expressional behavior. This motivates the needs of analyzing the large-scale testing statistics or statistical estimates incorporating the network information. Another motivation is that a linear regression or parametric model of gene expression levels might not be suitable in some cases. For example, we may be interested in finding subnetworks of genes that have nonlinear relations with an outcome without specifying a parametric form. To address these problems, a simple framework can be adopted. First, a certain statistic is computed for each feature without considering the network structure. The statistic can come from a test of nonlinear association, a test of periodic behavior or a certain regression model. After obtaining the feature-level statistics, a mixture model that takes into account the network structure can be used to select interesting features/subnetworks. More recently, \citet{qu2012hierarchical} developed a Bayesian semiparametric model to take into account dependencies across genes by extending a mixture model to a regression model over the generated pseudo-covariates. This method could be sensitive to the choices of the pseudo-covariates. \citet {wei2012bayesian} proposed a Bayesian joint model of multiple gene networks using a two-component Gaussian mixture model with a MRF prior. This approach assumes the Gaussian distribution for each component which might not fit the data very well in other applications. To mitigate problems of the current methods, we propose a Bayesian nonparametric mixture model for large-scale statistics incorporating network information. Specifically, the gene specific statistics are assumed to fall into two classes: ``unselected'' and ``selected,'' corresponding to whether the statistics are generated from a null distribution, with prior probabilities $p_0$ and $p_1 = 1- p_0$. A statistic has density either $f_0(r)$ or $f_1(r)$ depending on its class, where $f_0(r)$ represents ``unselected'' density and $f_1(r)$ represents ``selected'' density. Thus, without knowing the classes, the statistics follow a mixture distribution: \begin{equation}\label{eq:lFDRmodel} p_0 f_0(r) + p_1 f_1(r). \end{equation} As suggested by \citet{efron2010correlated}, it is reasonable to assume statistics are normally distributed. This justifies the use of a Dirichlet process mixture (DPM) of normal distributions to estimate both $f_0(x)$ and $f_1(x)$. Note that different from \citet {wei2012bayesian}, our model does not assume that $f_0$ and $f_1$ directly take the form of a normal density function. The DPM model has been discussed extensively and widely used in Bayesian statistics [\citeauthor{antoniak1974mixtures} (\citeyear{antoniak1974mixtures}); \citeauthor{escobar1994estimating} (\citeyear{escobar1994estimating}); \citeauthor{escobar1995bayesian} (\citeyear{escobar1995bayesian}); \citeauthor{muller2004nonparametric} (\citeyear{muller2004nonparametric});\break \citeauthor{dunson2010nonparametric} (\citeyear{dunson2010nonparametric})], due to the availability of efficient computational techniques [\citeauthor{neal2000markov} (\citeyear{neal2000markov}); \citeauthor{ishwaran2001gibbs} (\citeyear{ishwaran2001gibbs}); \citeauthor{wang2011fast} (\citeyear{wang2011fast})] and the nonparametric nature with good performance on density estimation. The DPM has been extended to make inference for differential gene expression [\citet{do2005bayesian}] and estimate positive false discovery rates [\citet{tang2007nonparametric}] but without incorporating the network information. In our model, we assign an Ising prior [\citet{li2010bayesian}] to class labels of all genes according to the dependent structure of the network. As discussed previously, the class label only takes two values, ``selected'' and ``unselected,'' while a DPM model is equivalent to an infinity mixture model [\citeauthor{neal2000markov} (\citeyear{neal2000markov}); \citeauthor{ishwaran2001gibbs} (\citeyear{ishwaran2001gibbs,ishwaran2002approximate})], based on which we develop a posterior computation algorithm. Our method selects genes and gene subnetworks automatically during the model fitting. To reduce the computational cost, we propose two fast computation algorithms that approximate the posterior distribution either using finite mixture models or guided by a standard DPM model fitting, for which we develop a hierarchical ordered distribution clustering (HODC) algorithm. It essentially performs clustering on ordered density functions. The fast computation algorithms can be tailored from any routine algorithms for the standard DPM model and combined with the HODC algorithm. Also, we suggest two approaches to choosing the hyperparameters in the model. To the best of our knowledge, our work is among the very first to extend the DPM model to incorporate the gene network for gene selections. Our method has the following features: (1) It provides a general framework for gene selection based on large-scale statistics using the network information. It can be used for detecting a particular expressional/functional behavior, as well as the association with a clinical/biological outcome. (2) It produces good uncertainty estimates of gene selection from a Bayesian perspective, taking into account the variability from many sources. (3) It introduces more flexibility on model fitting adaptive to data in light of the advantages of Bayesian nonparametric modeling. It is more robust than a parametric model (e.g., two-component Gaussian mixture model) which is sensitive to model assumptions. (4) The fast computational algorithms have been developed for the posterior inference approximation. From our experience, achieving a similar accuracy, it can be 50--150 times (depending on the number of genes in the analysis) faster than the standard Markov chain Monte Carlo (MCMC) algorithm. For a data set more than 2000 genes, the analysis can be done within half an hour using a typical personal computer. (5) Compared with the standard DPM model, our model achieves much better selection accuracy in the simulation studies and provides much more interpretable and biologically meaningful results in the analysis of Spellman yeast cell cycle microarray data. One potential issue of our method is that it only allows the borrowing of information based on the network vicinity, without considering possible compensatory effects between neighboring genes. Such issues can be addressed by downstream analyses after a small number of genes/subnetworks are selected. The rest of paper is organized as follows. In Section~\ref{sec:model} we describe the proposed model and an equivalent model representation. We discuss the choice of priors and the details of the posterior computation algorithms for gene selection. In Section~\ref{sec:fast} we introduce fast computational algorithms for approximating posterior computation. In Section~\ref{sec:app} we analyze an example data set, the Spellman yeast cell cycle microarray data. We evaluate the performance of our model via simulation studies in Section~\ref{sec: simulation}, where we compare our results with a standard DPM model ignoring the network information. We conclude the paper with discussions and future directions in Section~\ref{sec:disc}. \section{The model}\label{sec:model} Let $n$ be the total number of genes in our analysis. For $i = 1,\ldots , n$, let $r_i$ denote a statistic for gene $i$. It represents either a functional behavior or the association with a clinical outcome. For the association analysis, it is common to have an outcome $Y$ and a gene expression profile $X_i$ for each gene, $i$. As an alternative to a regression model, we can produce statistics for each gene, that is, $r_i = s(X_i, Y)$, where $s(\cdot, \cdot)$ can be a covariance function or other dependence test statistics. For a large-scale testing problem, we usually obtain $p$-values, $p_1, \ldots, p_n$, which can be transformed to normally distributed statistics, that is, $r_i = -\Phi ^{-1}(p_i)$, where $\Phi(r)$ denotes the cumulative distribution function for the standard normal distribution. This transformation is a monotone transformation and it ensures the ``selected'' genes have a larger value of $r_i$. Let $z_i$ be the class label for gene selection, where $z_i = 1$ if gene $i$ is selected and $z_i = 0$ is unselected. For $i, j = 1,\ldots, n$, let $c_{ij}$ denote the gene network configuration, where $c_{ij} = 1$ if gene $i$ and $j$ are connected, $c_{ij} = 0$ otherwise. Write $\br= (r_1, \ldots, r_n)'$, $\bz= (z_1, \ldots, z_n)'$ and $\bC= (c_{ij})$. In our model, $\br$ and $\bC$ are observed data, and $\bz$ is a latent vector of our primary interest. \subsection{A network based DPM model for gene selection} As suggested by \citet{efron2010correlated}, we assume $r_i$'s are normally distributed. Let $\mN(\mu, \sigma^2)$ denote a normal distribution with mean $\mu$ and standard deviation $\sigma$. Let $\cDP (G, \alpha)$ represent a Dirichlet process with base measure $G$ and scalar precision $\alpha$. Given the class label $\bz$, we consider the following DPM model: for $i = 1, 2, \ldots, n$ and $k = 0, 1$, \begin{eqnarray} \bigl[ r_i \mid\mu_i, \sigma^2_i \bigr] &\sim& \mN\bigl(\mu_{i}, \sigma ^2_{i} \bigr),\nonumber \\ \label{eq:DPMmodel}\bigl[ \bigl(\mu_i, \sigma^2_i \bigr)\mid z_i = k , G_k \bigr] &\sim& G_k, \\ G_k &\sim& \cDP[G_{0k}, \tau_k], \nonumber \end{eqnarray} where $\mu_i$ and $\sigma^2_i$ are latent mean and variance parameters for each $r_i$. The random measure $G_k$ and the base measure $G_{0k}$ are both defined on $(-\infty, +\infty)\times(0, +\infty)$. We specify $G_{0k} = \mN(\gamma_k, \xi^2_k) \times\mIG(\alpha_k, \beta_k)$, where $\mIG(\alpha, \beta) $ denotes an inverse gamma distribution with shape $\alpha$ and scale $\beta$. Note that given latent parameters $\mu_i, \sigma^2_i$, the statistic $r_i$ is conditionally independent of $z_i$. By integrating out $(\mu_i, \sigma ^2_i)$, we build the conditional density of $r_i$ given $z_i = k$ in \eqref{eq:lFDRmodel}, that is, \begin{equation}\label{eq:density} f_k(r) = \int\pi(r\mid\btheta) \,d G_k (\btheta), \quad\quad\pi(r \mid \btheta) = \frac{1}{\sigma}\phi \biggl(\frac{r-\mu}{\sigma} \biggr), \end{equation} where $\btheta= (\mu, \sigma^2)$ and $\phi(r)$ is the standard Gausian density function. This provides a Bayesian nonparametric construction of $f_k(r)$. To incorporate the network structure, we assign a weighted Ising prior to~$\bz$: \begin{equation}\label{eq:zPrior} \quad\pi(\bz\mid\bpi, \bvarrho,\bomega, \bC) \propto\exp \Biggl[ \sum _{i=1}^n \biggl( \widetilde\omega_i \log (\pi _{z_i}) + \varrho_{z_i} \sum _{j \neq i} \omega_j c_{ij} I[z_i=z_j] \biggr) \Biggr], \end{equation} where $\bpi= (\pi_0, \pi_1)$ with $0< \pi_1 = 1 - \pi_0 < 1$, $\bvarrho= (\varrho_0, \varrho_1)$ with $\varrho_k > 0$ for $k = 0,1$, $\bomega= (\omega_1, \ldots, \omega_n)'$ with $\omega_i>0$ for $i = 1,\ldots, n$, and $\widetilde\omega_i = \sum_{j=1}^n c_{ij} \omega _j /\break \sum_{j=1}^n c_{ij}$. The indicator function $I[\cA] = 1$ if event $\cA $ is true, $I[\cA] = 0$ otherwise. The parameter $\bpi$ controls the sparsity of $\bz$, and the parameter $\bvarrho$ characterizes the smoothness of $\bz$ over the network. For each gene $i$, a weight $\omega_i$ is introduced to control the information inflow to gene $i$ from other connected genes, which can adjust the prior distribution of $z_i$ based on biologically meaningful knowledge, if any. The term $\widetilde\omega_i$ is introduced to balance the contribution from $\bpi$ and $\bvarrho$ to the prior probability of $\bz$. When $\bvarrho=(0,0)$ and $\bomega= (1,\ldots ,1)'$, the latent class labels $z_{i}$'s are independent identically distributed as Bernoulli with parameter $\pi_1$. \subsection{Model representations} As discussed by \citet{neal2000markov}, the DPM models can also be obtained by taking the limit as the number of components goes to infinity. With a similar fashion, we construct an equivalent model representation of \eqref{eq:DPMmodel} for efficient posterior computations. Let $\mDiscrete(\ba, \bb)$ denote a discrete distribution taking values in $\ba= (a_1, \ldots, a_L)'$ with probability $\bb= (b_1, \ldots, b_L)'$, that is, if $\xi\sim\mDiscrete(\ba, \bb)$, then $\mPr(\xi= a_l) = b_l$, for $l = 1,\ldots, L$. Let $\mDirichlet (\balpha )$ denote a Dirichlet distribution with parameter $\balpha$. Let $L_k$, for $k = 0, 1$, represent the number of components for density $f_k(r)$. We define the index sets $\ba_0 = (-L_0+1, -L_0+2, \ldots, 0)$ and $\ba_1 = (1, 2,\ldots, L_1)$. Let $\bq_{0} = (q_{-L_0+1},q_{-L_0+2},\ldots, q_{0})$ and $\bq_{1} = (q_{1},\ldots, q_{L_1})$ with\vspace*{-3pt} $\sum_{g\in\ba_k} q_{g} = 1$. Let $\bone_{n} = (\underbrace{1,\ldots,1}_n)$. Then model \eqref{eq:DPMmodel} is equivalent to the following model, as $L_0\go\infty$ and $L_1 \go \infty$: \begin{eqnarray}\label{eq:finiteModel} [ r_i \mid g_i, \wbtheta ] &\stackrel{\mathrm{i.i.d.}} {\sim}& \mN\bigl(\wmu _{g_i},\wsigma^2_{g_i}\bigr),\nonumber \\ {[g_i \mid z_i = k, \bq_k ]}& \stackrel{\mathrm{i.i.d.}} {\sim}& \mDiscrete (\ba _k, \bq_k), \nonumber \\[-8pt]\\[-8pt] \wbtheta_{g} &\sim& G_{0k} \quad\quad \mbox{for } g\in \ba_k, \nonumber \\ \bq_k &\sim& \mDirichlet(\tau_k\bone_{L_k}/L_k), \nonumber \end{eqnarray} where $\wbtheta= \{\wbtheta_g\}_{g\in\ba_0 \cup\ba_1}$ and $\wbtheta _{g} = (\wmu_{g}, \wsigma^2_{g})$. The index $g_i$ indicates the latent class associated with each data point $r_i$. Write $\bg= (g_1, \ldots, g_n)$ and $\bz= (z_1,\ldots, z_n)$. For each class, $g$, the parameter $\wbtheta_\mathrm{c}$ determines the distribution of $r_i$ from that class. The conditional distributions of $g_i$ and $\wbtheta_{g_i}$ given $z_i = 0$ and $z_i = 1$ are different. Based on model \eqref{eq:finiteModel}, the conditional density of $f_k(r)$ in \eqref{eq:density} becomes \begin{equation}\label{eq:f_k} f_k(r) = \sum_{g \in\ba_k} \frac{q_{g}}{\wsigma_g} \phi \biggl(\frac {r-\wmu_g}{\wsigma_g} \biggr). \end{equation} This further implies that given $L_0$ and $L_1$, the marginal distribution of $r_i$ also has a form of finite mixture normals, that is, \begin{equation}\label{eq:marginal} \pi(r) = \sum_{k=0}^1 p_k f_k(r) = \sum_{g=-L_0+1}^{L_1} \frac{\wq _g}{\wsigma_g}\phi \biggl(\frac{r-\wmu_g}{\wsigma_g} \biggr), \end{equation} where $\wq_g = p_0q_g$ if $g\leq0$, $\wq_g = p_1q_g$ otherwise. Model \eqref{eq:finiteModel} is not identifiable for $z_i$ in the sense that if we switch the gene selection class label ``$0$'' and ``$1$,'' the marginal distribution of $r_i$ \eqref{eq:marginal} is unchanged. Without loss of generality, we assume that the ``selected gene'' should be more likely to have large statistics compared to the ``unselected genes.'' Thus, we impose an order restriction on the parameter $\wbtheta $, for $g = -L_0+1 ,\ldots, L_1$, \begin{equation} \wmu_g < \wmu_{g+1}. \end{equation} This also sorts out the nonidentifiability of parameter $\wbtheta$. In many cases, the functional behaviors of some genes are strongly evident from prior biological knowledge. Whether or not those genes are selected is not necessarily determined by other genes in the network. Those genes are likely to be the hubs of the networks, thus, the determination of the status of these genes might help select genes in their neighborhood. This suggests that it is reasonable to preselect a small amount of genes that can be surely elicited by biologists from their experience and knowledge. We refer to them as ``surely selected'' (SS) genes. These genes are usually associated with very large statistics. We evaluate the performance via the simulation studies in Section~\ref{subsec:s2}. \subsection{Posterior computation} In model \eqref{eq:finiteModel}, given $L_0$ and $L_1$, we have the full conditional distribution of $g_i = g$ and $z_i = k$ given $\bg _{-i} = (g_1, \ldots, g_{i-1},\break g_{i+1},\ldots, g_{n})$, $\bz_{-i} = (z_1, \ldots, z_{i-1}, z_{i+1}, \ldots, z_n)$ and data $\br$: \begin{eqnarray}\label{eq:fullconditional} &&\pi(g_i = g, z_i = k \mid\bg_{-i}, \bz_{-i}, \br, \wbtheta ) \nonumber \\ &&\quad\quad\propto\frac{1}{\wsigma_g} \phi \biggl(\frac{r_i - \wmu _g}{\wsigma _g} \biggr) \frac{n_{-ig}+\tau_k/L_k}{\tau_k + m_k -1} \\ &&\quad\quad\quad{}\times\exp \biggl( \widetilde\omega_i \log( \pi_{k}) + \varrho_{k} \sum_{j \neq i} \omega_j c_{ij} I[z_j = k] \biggr), \nonumber \end{eqnarray} where $m_k = \sum_{i=1}^nI[z_i=k]$ is the number of genes in class $k$ and $n_{-ig} = \sum_{j \neq i} I[g_{j} = g]$ represents the number of $g_{j}$ for $j\neq i$ that are equal to $g$. As $L_0 \go\infty$ and $L_1\go\infty$, if $(g, k) = (g_{j}, z_{j})$ for some $j\neq i$, then \begin{eqnarray}\label{eq:g_i=g} &&\pi(g_i = g, z_i = k \mid\bg_{-i}, \bz_{-i}, \br, \wbtheta) \nonumber \\ &&\quad\quad\propto\frac{n_{-ig}}{\tau_k + m_k -1} \exp \biggl( \widetilde \omega_i \log( \pi_{k}) + \varrho_{k} \sum_{j \neq i} \omega_j c_{ij} I[z_j = k] \biggr) \\ &&\quad\quad\quad{}\times \frac{1}{\wsigma_g} \phi \biggl(\frac{r_i - \wmu _g}{\wsigma _g} \biggr) \nonumber \end{eqnarray} and \begin{eqnarray} \label{eq:g_ineqg} &&\pi(g_i \neq g_j, z_i \neq z_j \mbox{ for all } j\neq i \mid \bg_{-i}, \bz_{-i}, \br, \wbtheta) \nonumber \\ &&\quad\quad\propto\frac{\tau_k}{\tau_k + m_k -1} \exp \biggl( \widetilde \omega_i \log( \pi_{k}) + \varrho_{k} \sum_{j \neq i} \omega_j c_{ij} I[z_j = k] \biggr) \\ &&\quad\quad\quad{} \times\frac{\Gamma(\alpha_k+1/2)\beta_k^{\alpha _k}}{{\sqrt {2\pi}\Gamma(\alpha_k)\xi_k}} \int\phi \biggl(\frac{\mu-\gamma _k }{\xi _k} \biggr) \biggl( \beta_k+\frac{1}{2}(r_i -\mu)^2 \biggr)^{-(\alpha _k+1/2)} \,d \mu, \nonumber \end{eqnarray} where the integral can be efficiently computed by the Gaussian quadrature method in practice. See Section A in the supplemental article [\citet{zhao2014bayesian}] for the derivations of equations \eqref{eq:g_i=g} and \eqref{eq:g_ineqg}. The full conditionals of $\wmu_g$ and $\wsigma^2_g$ for $g\in\{g_1, \ldots, g_n \}$ are given by \begin{eqnarray} \bigl[\wmu_g \mid\wsigma^2_g, \br \bigr]&\sim&\mN \biggl(\frac{\wsigma ^2_g\gamma_k + \xi^2_k\sum_{i:g_i = g}r_i}{\wsigma^2_g+\xi_k^2n_g}, \frac{\wsigma^2_g\xi^2_k}{\wsigma^2_g+\xi^2_k n_g} \biggr), \label {eq:cond_mu} \\ \bigl[\wsigma^2_g \mid\wmu_g, \br \bigr] &\sim&\mIG \biggl(\alpha_k+ \frac {n_g}{2}, \beta_k + \frac{1}{2}\sum_{i: g_i = g} (r_i - \wmu_g)^2 \biggr), \label{eq:cond_sigma} \end{eqnarray} where $k = I[g>0]$ and $n_g = \sum_{i=1}^n I[g_i = g]$. We summarize this algorithm in Section B.1 in the supplemental article [\citet {zhao2014bayesian}] and refer to it as NET-DPM-1. It is computationally intensive when $n$ is very large. To mitigate this problem, we propose two fast algorithms to fit finite mixture models (FMM) with appropriate choices of the number of components. \subsection{Fast computation algorithms}\label{sec:fast} \subsubsection{FMM approximation} When $L_1$ and $L_0$ fit the data well, we can accurately approximate the infinite mixture model \eqref{eq:DPMmodel} by the FMM \eqref {eq:finiteModel}. Given a fixed $L_0$ and $L_1$, it is straightforward to perform posterior computation for model \eqref{eq:finiteModel} based on \eqref{eq:fullconditional}. We refer to this algorithm as NET-DPM-2 (see Section B.2 in the supplemental article [\citet{zhao2014bayesian}] for details). This algorithm does not change the dimension of $\wbtheta $ over iterations. In this sense, it simplifies the computation. Also, in order to keep computation efficient, we search for smaller values of $L_0$ and $L_1$ which fit the data well. This can be achieved under the guidance of a DPM density fitting for which we introduce an algorithm in the next section. \subsubsection{Hierarchical ordered density clustering} Without using the network information, a DPM model fitting on data $\br $ provides an approximation to the marginal density \eqref {eq:marginal}. It generates posterior samples for mixture densities, where the mean number of components should be close to $L_0+L_1$. Let us focus on one sample. Suppose $L_0+L_1$ is equal to the number of components in this sample. To further obtain an estimate of $L_0$ and $L_1$ for this sample, we need to partition the $L_0+L_1$ components into two classes. Thus, we propose an algorithm to cluster a set of ordered densities. We call it hierarchical ordered density clustering (HODC). Here, the density order is determined by the mean location of that density. For example, a set of Gaussian density functions are sorted according to their mean parameters. Similar to the classical hierarchical clustering analysis, we define a distance metric of density functions: \begin{equation} d\bigl(f, f'\bigr) = \int_{-\infty}^{+\infty} \bigl[f(x) - f'(x)\bigr]^2 \,d x, \end{equation} where $f$ and $f'$ are two univariate density functions. Let $\cP= \{ (\hmu_g, \hsigma^2_g, \hp_g)\}_{g=1}^{L_0+L_1}$ denote parameters for $L_0+L_1$ Gaussian densities, where $\hmu_g < \hmu_{g+1}$, $g=1,2,\dots ,L_0+L_1-1$. This is the input data to the HODC algorithm totally consisting of $L_0+L_1 - 2$ steps. At the $m$ step, there are $L_0+L_1-m$ clusters of densities and let $\bs^{(m)}_l$, for $l = 1,\ldots, L_0+L_1-m$, denote the density indices in cluster $l$. To simplify, we define \begin{equation}\label{eq:wphi} \wphi(r; \bs,\cP) =\sum_{g\in\bs} \frac{\hp_{g}}{\hsigma_g} \phi \biggl(\frac{r - \hmu_g}{\hsigma_g} \biggr) \Big/\sum_{g \in\bs}\hp _{g}, \end{equation} which represents a mixture of Gaussian densities, where the components indexed by $\bs$ are a subset of $\{\phi[(r-\hat\mu_g)/\hat\sigma _g]/\hsigma_g\}_{g = 1}^{L_0+L_1}$.\vadjust{\goodbreak} \noindent\textbf{\underline{HODC}:} \begin{itemize} \item[]{\bf Input:} Parameters for a mixture of Gaussian densities, that is, $\cP$. \vspace{0.2cm} \item[]{\bf Initialization:} Set $m = 0$ and $\bs_l^{(0)} = \{l\}$, for $l = 1,2,\ldots, L_0+L_1$; \vspace{0.2cm} \item[] Repeat the following steps until $m =L_0+L_1-2$: \begin{itemize} \item[]{\bf Step 1:} Find \[ l^{(m)} = \arg\min_{l} d \bigl(\wphi\bigl(\cdot; \bs^{(m)}_{l},\cP\bigr), \wphi \bigl(\cdot; \bs^{(m)}_{l+1},\cP\bigr) \bigr). \] \item[]{\bf Step 2:} For $l = 1, 2,\ldots, L_0+L_1-m-1$, set \begin{eqnarray*} \bs_l^{(m+1)} = \cases{ \bs_l^{(m)} &\quad \mbox{if } $l< l^{(m)}$,\vspace*{2pt} \cr \bs_l^{(m)}\cup \bs_{l+1}^{(m)} &\quad\mbox{if } $l=l^{(m)}$,\vspace*{2pt} \cr \bs_{l+1}^{(m)} &\quad\mbox{if } $l>l^{(m)}$. } \end{eqnarray*} \item[]{\bf Step 3:} Set $m = m+1$. \end{itemize} \item[]{\bf Output:} $\{\bs_l^{(m)}\}_{l=1}^{L_0+L_1-m}$ for $m = 1, 2, \ldots, L_0+L_1-2$. \end{itemize} Figure~\ref{fig:HODC} illustrates the HODC algorithm. The algorithm stops when $m = L_0+L_1-2$, where the ordered density components are partitioned into two classes indexed by $\bs^{(m)}_{1}$ and $\bs ^{(m)}_{2}$. This\vspace*{-1pt} suggests that the number of indices in $\bs _{k+1}^{(m)}$, denoted by $|\bs_{k+1}^{(m)}|$, is an estimate for $L_k$ in model \eqref{eq:finiteModel}. By running the HODC, we can obtain one $L_k$ estimate for each posterior sample generated from a DPM fitting. We take the average of $L_k$ estimates over all the posterior samples as the input of NET-DPM-2. The HODC also provides an approximation to $f_k(r)$ in \eqref{eq:f_k}, that is, $\wphi(r;\bs_{k+1}^{(m)},\cP)$. This implies that we can further simplify the computation with the algorithm in the following section. \begin{figure} \includegraphics{719f01.eps} \caption{An illustration of the HODC algorithm for six density components: the HODC starts with clustering densities 1 and 2 as a mixture density labeled as 7, since the ``distance'' between 1 and 2 is shorter than all other adjacent density pairs. Then the HODC computes the ``distance'' between densities 3 and 7, densities 3 and 4, \ldots, to proceed the clustering. Following this procedure, the HODC ends up with clustering densities 1, 2, 3 as a mixture density (labeled as 8) and 4, 5, 6 as another mixture density (labeled as 10).}\label{fig:HODC} \end{figure} \subsubsection{FMM guided by a DPM model fitting} From a DPM model fitting, we obtain $V$ posterior samples of the parameters for the marginal density of $\br$. We denote them as $\cP_v = \{(\hmu_{vg}, \hsigma^2_{vg}, \hp_{vg})\}_{g=1}^{L_{v0}+L_{v1}}$, for $v = 1,2,\ldots, V$. For\vspace*{1pt} each $\cP_v$, the HODC algorithm partitions $L_{v0}+L_{v1}$ components into two classes, where the class-specific components are indexed by $\ba_{v,0}$ and $\ba_{v,1}$. This leads to $V$ approximations of $f_k(r)$, that is, $\wphi(r; \ba_{v,k},\cP_v)$. Given $f_k(r)$, our proposed gene selection model reduces to \begin{equation} [ r_i \mid z_i = k ] \stackrel{\mathrm{i.i.d.}} {\sim} f_k(r)\label {eq:simpleModel} \end{equation} for $i = 1,2,\ldots, n$ and $k = 0, 1$, and $\bz$ follows \eqref {eq:zPrior}. To make inference on the posterior distribution of $\bz$ by combining all $V$ approximations of $f_k(r)$, we consider \begin{equation} \pi(\bz\mid\br) \approx\frac{1}{V} \sum_{v=1}^V \pi (\bz \mid\br , \wbphi_v ), \end{equation} where $\wbphi_v = \{\wphi(r; \ba_{v,0},\cP_v), \wphi(r; \ba _{v,1},\cP _v)\}$. For each $v$, the full conditional of $z_i$ is given by \begin{eqnarray}\label{eq:fast_z_cond} &&\pi(z_i = k \mid\bz_{-i}, \br, \wbphi_v) \nonumber \\[-8pt]\\[-8pt] &&\quad\quad\propto\wphi(r_i; \ba_{v,k},\cP_v)\exp \biggl( \widetilde\omega _i \log (\pi_{k}) + \varrho_{k} \sum_{j \neq i} \omega_j c_{ij} I[z_j = k] \biggr). \nonumber \end{eqnarray} We refer to this algorithm as NET-DPM-3 (see Section B.3 in the supplemental article [\citet{zhao2014bayesian}] for details). It is extremely fast with a moderate~$V$. Since the marginal density is estimated without using the network information, it might introduce bias on the distribution of $z_i$ and underestimate the variability of $z_i$. From our experience, those issues do not affect the selection accuracy much. Some examples are provided in Section~\ref{sec: simulation}. \subsection{The choice of hyperparameters} To proceed NET-DPMs, we need to specify the hyperparameters $\bpi$, $\bvarrho$ and $\bomega$ in \eqref{eq:zPrior}. We assume that $\bomega$ is prespecified according to biological information. In this paper, we choose equal weight, that is, $\bomega= \bone_n$ without incorporating any biological prior knowledge. We suggest two approaches to choosing $\bpi$ and $\bvarrho$: (1) we assign hyperpriors on $\bpi$ and $\bvarrho $ and make posterior inference; (2) for a set of possible choices of $\bpi$ and $\bvarrho$, we employ the Bayesian model averaging. The details are provided in Section C in the supplemental article [\citet {zhao2014bayesian}]. \section{Application}\label{sec:app} To demonstrate the behavior of our method, we apply the proposed method to the analysis of the Spellman yeast cell cycle microarray data set [\citet{spellman1998comprehensive}]. The data set is intended to detect genes with periodic behavior along the procession of the cell cycle. It has been extensively used in the development of computational methods. The network is summarized from the Database of Interacting Proteins (DIP) [\citet{xenarios2002dip}]. We use the high-confidence connections between yeast proteins from the DIP. Eventually, the network contains 2031 genes, where the mean, median, maximum and minimum edges per gene are 3.948, 2, 57 and 1, respectively. There is no outcome variable in the cell-cycle data set. In this demonstration we focus on the selection of genes with periodic behavior in light of the network. It is\vadjust{\goodbreak} known that such genes show different phase shifts along the cell cycle and may not be correlated with each other [\citet{yu2010exploratory}]. We first perform the Fisher's exact $G$ test for periodicity [\citet{wichert2004identifying}] for each gene. We then transform the $p$-values to normal quantiles, $r_i=-\Phi^{-1} (p_i)$ for gene $i$. We apply the fully Bayesian inference (NET-DPM-1), one fast computation approach (NET-DPM-3) and the standard DPM model fitting (STD-DPM) to this data set. For the NET-DPM-1, set $\tau_0=10$, $\tau_1=2$; following the results by STD-DPM, set $\gamma_k=\omu_k, \xi _k^2=\osigma_k^2, \beta_k=10, \alpha_k=\osigma^2_k/\xi_k^2+1$ with $k=0,1$, where $\{ \omu_k\}$ and $\{\osigma^2_k\}$ are preliminary estimations by the STD-DPM. We also conduct a sensitivity analysis for the hyperparameters specification (see the details in Section E in the supplemental article [\citet{zhao2014bayesian}]) to verify the robustness of the proposed methods. For both methods, the choices of $\pi_0$ and $\bvarrho$ for the model averaging algorithm are $(0.75,0.8,0.85,0.9)$ and $(0.5,1,5,10,15)\times(0.5,1,5,10,15)$ with restriction $\varrho_0<\varrho_1$. We run all the algorithms 5000 iterations with 2000 burn-in. In this article, the standard DPM fitting is obtained by an R package: {\tt{DPpackage}} and all the proposed algorithms are implemented in R. Table~\ref{table:real} presents the gene selection results based on three methods in a two-by-two table format. The number of the ``selected'' genes by the NET-DPM-1, the NET-DPM-3 and the STD-DPM are 201, 216 and 114, respectively. The summation of the diagonal elements of the table comparing the NET-DPM-3 and the NET-DPM-1 is larger than that for NET-DPM-3 and the STD-DPM. This indicates a stronger agreement between the two algorithms for NET-DPM. \begin{table} \tablewidth=260pt \caption{Gene selection results by the three methods for the cell cycle data set}\label{table:real \begin{tabular*}{260pt}{@{\extracolsep{\fill}}lcccc@{}} \hline & \multicolumn{2}{c}{\textbf{NET-DPM-1}}&\multicolumn {2}{c@{}}{\textbf {STD-DPM}} \\[-5pt] & \multicolumn{2}{c}{\hrulefill}&\multicolumn{2}{c@{}}{\hrulefill}\\ & \textbf{Selected}& \textbf{Unselected}& \textbf{Selected}& \textbf {Unselected}\\ \hline NET-DPM-3 &&&& \\ \quad Selected &170 & \hphantom{00}46& 100 & \hphantom{0}116\\ \quad Unselected &\hphantom{0}31& 1784 & \hphantom{0}14 & 1801 \\ \hline \end{tabular*} \end{table} \begin{figure} \includegraphics{719f02.eps} \caption{A subnetwork composed of genes with periodic behavior. The subnetwork consists of 135 genes. Red nodes: genes functionally involved in the M-phase of cell cycle; blue node: genes functionally involved in the interphase of cell cycle; green nodes: genes functionally involved in both M and interphase of cell cycle.}\label{fig:app} \end{figure} We focus our discussion on the NET-DPM-3 results. After removing all unselected genes, as well as selected genes not connected to any other selected genes, 163 of the 216 genes fall into 11 subnetworks. Of the 11 subnetworks, 10 are very small, each containing 5 or less genes. The remaining subnetwork contains 135 genes. Considering the purpose of the study is to find genes with periodic behavior, and most such genes are functionally related and regulated by the cell cycle process, this result is expected. We present the subnetwork in Figure~\ref{fig:app}. Sixty-one of the 135 genes belong to the mitotic cell cycle process based on gene ontology [\citet{ashburner2000gene}]. The yeast mitotic cell cycle can be roughly divided into the M phase and the interphase, which contains S and G phases [\citet{ashburner2000gene}]. We do not further divide the interphase because the number of genes annotated to its descendant nodes are small. Among the 135 genes, 45 are annotated to the M phase, and 21 are annotated to the interphase. By coloring the M phase genes in red, the interphase genes in blue and the genes annotated to both phases in green, we see that the majority of the selected M phase genes are clustered on the subnetwork, while the selected interphase genes are somewhat scattered, with 7 falling into a small but tight cluster. \begin{figure}[t!] \includegraphics{719f03.eps} \caption{A portion of the subnetwork shown in Figure \protect\ref {fig:app}, together with the immediate neighbors of the selected genes. Upper panel: NET-DPM-3 results; lower panel: STD-DPM results. The node labels indicate the gene name; circles and triangles represent ``selected'' and ``unselected'' genes; colors denote the value of the normal quantiles; a star in superscript represents the genes functionally annotated to the cell cycle process. Dash lines denote connections to genes not shown in the figure.}\label{fig:app2} \end{figure} We show part of the subnetwork detected by the NET-DPM-3 with the corresponding one under the STD-DPM in Figure~\ref{fig:app2}, where the genes that are linked by a dashed line are connected to other genes that are not shown in the figure. In this subnetwork, the gene selection results by the NET-DPM-1 agree with the NET-DPM-3 except for only one gene ``YML064'' for which the NET-DPM-1 does not select it with probability 0.478, while the NET-DPM-3 selects it with probability 0.687. This implies that both methods provide large uncertainty on this gene. Comparing the top panel (our method, NET-DPM-3) and bottom panel (STD-DPM), we observe a number of genes selected by NET-DPM but not by STD-DPM, and almost all such genes are cell cycle-related (denoted by a star by the ORF name). Examples include YAL041W (CLS4), which is required for the establishment and maintenance of polarity and critical in bud formation [\citeauthor{chenevert1994identification} (\citeyear{chenevert1994identification}); \citeauthor{cherry2012saccharomyces} (\citeyear{cherry2012saccharomyces})]. The gene only shows moderate periodic behavior, as denoted by the color of the node. However, due to its links to other genes that have strong periodic behavior, it is selected by our method as an interesting gene. Another example is YFL008W (SMC1). It is a subunit of the cohesion complex, which is essential in sister chromatid cohesion of mitosis and meiosis. The complex is also involved in double-strand DNA break repair [\citeauthor{strunnikov1999structural} (\citeyear{strunnikov1999structural}); \citeauthor{cherry2012saccharomyces} (\citeyear{cherry2012saccharomyces})]. Similar to CLS4, the periodic behavior of SMC1 is not strong enough. It is only selected when the information is borrowed from linked genes that are functionally related and show strong periodic behavior. A number of other cell cycle-related genes in Figure~\ref{fig:app2} are in a similar situation, for example, YBR106W, YDR052C, YJL157C, YGL003C and YMR076C. These examples clearly show the benefit of utilizing the biological information stored in the network structure. To assess the functional relevance of the selected genes globally, we resort to mapping the genes onto gene ontology biological processes [\citet{ashburner2000gene}]. We limit our search to the GO Slim terms using the mapper of the Saccharomyces Genome Database [\citet {cherry2012saccharomyces}]. The full result is listed in the supplementary file. Clearly, the overrepresented GO Slim terms are centered around cell cycle. Here we discuss some GO terms that are nonredundant. Among the 216 selected genes, 70 (32.4\%, compared to 4.5\% among all genes) belong to the process response to DNA damage stimulus (GO:0006974). The term shares a large portion of its genes with DNA recombination (GO:0006310) and DNA replication (GO:0006260) processes, which are integral to the cell cycle. Sixty-seven of the selected genes (31.0\%, compared to 4.7\% among all genes) belong to the process mitotic cell cycle (GO:0000278). Twenty-six of the 67 genes are shared with response to DNA damage stimulus (GO:0006974). Forty-one of the selected genes (19.0\%, compared to 3.0\% among all genes) belong to the process regulation of cell cycle (GO:0051726), among which 29 also belong to mitotic cell cycle (GO:0000278). Thirty-one of the selected genes (14.4\%, compared to 2.6\% among all genes) belong to the process meiotic cell cycle (GO:0051321), among which 12 are shared with mitotic cell cycle (GO:0000278). Other major enriched terms include chromatin organization (12.5\%, compared to 3.5\% overall), cytoskeleton organization (12.5\%, compared to 3.4\% overall), regulation of organelle organization (9.7\%, compared to 2.4\% overall) and cytokinesis (7.9\%, compared to 1.7\% overall). These terms clearly show strong relations with the yeast cell cycle. \section{Simulation studies}\label{sec: simulation} In this section we illustrate the performance of our methods (NET-DPMs) using simulation studies with various network structures and data settings compared with other methods. In Simulation\vadjust{\goodbreak} 1 we study the similarity between the fully computational algorithm NET-DPM-1 and two fast computation approaches NET-DPM-$x$, $x=2,3$, in terms of gene selection accuracy and uncertainty estimations. Each of the three algorithms can be used along with one of the two methods for choosing hyperparameters: the posterior inference and model averaging. In Simulation 2 we focus on the gene network selection under a particular network structure and two types of simulated data to demonstrate the flexibility of the proposed methods. In both simulations we compare the NET-DPMs with a STD-DPM combined with the HODC algorithm without using any network information. In Section D in the supplemental article [\citet{zhao2014bayesian}], we also demonstrate the flexibility of the proposed methods by conducting a simulation on the selection of genes that are strongly associated with an outcome variable, and compare our NET-DPMs with a network based Bayesian variable selection (NET-BVS) proposed by \citet{li2010bayesian}. \begin{figure}[b] \includegraphics{719f04.eps} \caption{Partial network structure with the dash lines representing connections to other nodes not shown in the figure.}\label{figure:simu1_sub} \end{figure} \subsection{Simulation 1}\label{subsec:s1} In this simulation we investigate the performance of the proposed algorithms using a simulated data set that mimic the real data in Section~\ref{sec:app}. We generate a scale-free network with 1000 genes based on the rich-get-rich algorithm [\citet {barabasi1999emergence}], that is, $n = 1000$. Two hub genes with 64 and 69 connections to other genes are in this network; the mean and median edges per gene are 1.998 and 1. The partial network structure with the two hub genes included is shown in Figure~\ref{figure:simu1_sub}. From the network structure, we generate $\bz$ from the Ising model \eqref{eq:zPrior} with the sparsity parameter $\pi _0=0.8$ and smoothness parameters $\bvarrho=(\varrho_0, \varrho_1)=(5, 10)$. For $i = 1,\ldots, n$, in light of the results in Section~\ref{sec:app}, we simulate data $r_i$ given $z_i$ from the empirical distributions (Figure~\ref{fig:appdensity}) of the test statistics for ``selected'' and ``unselected'' genes in the Spellman yeast cell cycle microarray data. As shown in Section~\ref{sec:app}, the NET-DPM-3 (Scenario 1) and the STD-DPM (Scenario 2) provide different gene selections results. We set both scenarios as the truth to simulate data. \begin{figure} \includegraphics{719f05.eps} \caption{Empirical distributions of ``selected'' genes (upper panel) and ``unselected'' genes (lower panel) in the Spellman yeast cell cycle data estimated by the NET-DPM-3 (right panel) and the STD-DPM (left panel).}\label{fig:appdensity} \end{figure} We apply the NET-DPM-$x$, for $x=1,2,3$, and the STD-DPM to the simulated data set. To choose the sparsity and smoothness parameters, the NET-DPM-1 and the NET-DPM-3 are both combined with model averaging, where the possible choices of $\pi_0$ and $\bvarrho$ are $(0.75,0.8,0.85,0.9)$ and $(1,5,10,20,50)\times(1,5,10,20,50)$, while the NET-DPM-2 is combined with the posterior inference on $(\pi _0,\bvarrho)$. As for other hyperparameters, we specify $\tau_k, \xi_k, \gamma_k, \beta_k, \alpha_k; k=0,1$ the same way as in the data application for the NET-DPM-$x$, for $x=1,2$. With random starting values, each algorithm is run 10 times under 10,000 iterations with 2000 burn-in. For each gene $i$, the mode of the marginal posterior probability of $z_i$ is taken to determine whether gene $i$ is selected or not. The selection performance for each method based on the average of the 10 runs is presented in Table~\ref{table:simu1}. We also compare the posterior probability estimates of $\bz$ between different algorithms under Scenario 1 in Figure~\ref{figure:simu1}. \begin{table} \tabcolsep=0pt \caption{Gene selection accuracy in Simulation 1}\label{table:simu1} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccc@{}} \hline & \textbf{STD-DPM} & \textbf{NET-DPM-1} & \textbf{NET-DPM-2} &\textbf{NET-DPM-3}\\ \hline &\multicolumn{4}{c@{}}{Scenario 1}\\ True positive rate & 0.893 & 0.973 & 0.920 & 0.920\\ False positive rate & 0.292 & 0.001 & 0.000 & 0.006\\ False discovery rate & 0.801 & 0.014 & 0.000 & 0.080\\[3pt] &\multicolumn{4}{c@{}}{Scenario 2}\\ True positive rate & 1.000 & 1.000 & 1.000 & 1.000\\ False positive rate & 0.232 & 0.000 & 0.000 & 0.007\\ False discovery rate & 0.741 & 0.000 & 0.000 & 0.085\\[6pt] Typical computation time (hrs) & 0.100 & 8.500 & 2.800 & 0.150\\ \hline \end{tabular*} \end{table} \begin{figure}[b] \includegraphics{719f06.eps} \caption{Marginal posterior probabilities of the class labels of all 1000 genes by the different methods: NET-DPM-3 vs. NET-DPM-2 (left panel) and NET-DPM-2 vs. NET-DPM-1 (right panel). The probability values are jittered by tiny random noises for better presenting.}\label{figure:simu1} \end{figure} \begin{figure} \includegraphics{719f07.eps} \caption{Partial simulated gene network structure: the blue nodes represent ``selected'' genes and the red nodes represent ``unselected'' genes. Dash lines denote connections to genes not shown in the figure. A subnetwork of interest includes nodes 1, 2, 3, 4 and 5, which are encircled by a rectangle frame.}\label{figure:simu2} \end{figure} From Table~\ref{table:simu1}, it is clear that the NET-DPMs achieve a better selection performance than the STD-DPM method under both scenarios. The STD-DPM without using the gene network information provides an extreme high false discovery rate in each scenario. This implies that it is critical to incorporate the gene network information to control FDR. Table~\ref{table:simu1} also suggests the NET-DPM-2 and the NET-DPM-3 approximate the NET-DPM-1 very well in terms of the gene selection accuracy with a substantial lower computational cost (3.4 GHz CPU, 8~GB Memory, Windows System). In addition, a comparison between the NET-DPM-2 and the NET-DPM-3 shows that the Bayesian model averaging over hyperparameters $(\pi_0,\bvarrho)$ provides an efficient alternative to the standard Bayesian posterior inference procedure. For the posterior probability estimates, the NET-DPM-2 and the NET-DPM-3 achieve a good agreement, as shown in the left panel of Figure~\ref{figure:simu1}. However, in the right panel of Figure~\ref{figure:simu1}, compared with the NET-DPM-1, the NET-DPM-3 tends to provide larger probability estimates for the ``selected'' genes, but smaller probability estimates for ``unselected'' genes. This implies the fast computation approaches underestimate the uncertainty of gene selection. \subsection{Simulation 2}\label{subsec:s2} In this simulation we demonstrate the flexibility of the proposed methods and their ability to identify subnetworks of interest. We consider a 94-gene network which consists of an 11-gene subnetwork by design and an 83-gene scale-free network simulated from the rich-get-rich algorithm. The mean and median edges per node for the whole network are 2.02 and 1. Figure~\ref{figure:simu2} shows the designed 11-gene subnetwork, where genes 5, 6 and 11 are connected with three other genes from the 83 gene scale-free network. Rather than simulating from priors, we directly specify the class label $\bz$ as $z_i = 1$ for $i\in\{1,2,3,4, 5, 8,9,10\}$, $z_i = 0$ otherwise. In Figure~\ref{figure:simu2} the blue nodes represent the ``selected'' genes and the red nodes are ``unselected'' genes. In addition, all other genes in the scale-free network (not shown in the figure) are ``unselected.'' The gene subnetwork of interest includes genes 1, 2, 3, 4 and 5, which are encircled by a rectangle frame in Figure~\ref{figure:simu2}. The null distribution for ``unselected'' $r_i$ is specified as a standard normal distribution: $ [ r_i \mid z_i = 0 ]\sim\mN(0, 1)$. For the distribution of ``selected'' genes, we consider two settings: \begin{eqnarray*} \mbox{Gaussian data:}&\quad\quad& [ r_i \mid z_i = 1 ] \sim0.4 \times\mN (3,1)+0.6\times\mN(2,0.5), \\ \mbox{Non-Gausian data:}&\quad\quad& [ r_i \mid z_i = 1 ] \sim0.4\times \mG (5,2)+0.6\times\mG(6,3), \end{eqnarray*} where $\mG(a,b)$ denotes a gamma distribution with shape $a$ and rate $b$. According to the above procedure, we simulate 100 data sets for each type of data. We apply the NET-DPM-3 and the STD-DPM to each data set. We utilize the model averaging for choosing hyperparameters and a set of possible choices are given by $\{1, 2, 5, 10, 15\}$ for both $\varrho_0$ and $\varrho_1$, and \{0.8, 0.85, 0.9, 0.95\} for $\pi_0$. We run 10,000 iterations with 2000 burn-in on each data set for both methods. In each simulated data set, we predetermine one gene as a ``sure selected'' gene. It has the largest number of connections with the ``selected'' genes estimated by the STD-DPM model. Table~\ref{table:simu2} summarizes the selection accuracy of the gene subnetwork based on the 100 simulated data sets for each type of data. It is clear that the NET-DPM-3 provides much higher accuracy of the subnetwork selection than the STD-DPM. The NET-DPM-3 achieves a more than 60\% accuracy rate in correctly identifying the subnetwork with an additional low false positive and false negative occurrences regardless of the type of data. This verifies the overall better performance of NET-DPM-3 than the STD-DPM in terms of identifying the gene subnetwork and the robustness of the proposed methods on different types of data. \begin{table} \caption{Selection accuracy of gene subnetwork\protect\tabnoteref{ta} by TPR (true positive rate), FPR (false positive rate) and FDR (false discovery rate) in Simulation 2}\label{table:simu2} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccccc@{}} \hline & \multicolumn{3}{c}{\textbf{Gaussian data}} & \multicolumn {3}{c@{}}{\textbf{Non-Gaussian data}}\\[-5pt] & \multicolumn{3}{c}{\hrulefill} & \multicolumn{3}{c@{}}{\hrulefill }\\ \textbf{Method}&\textbf{TPR}& \textbf{FPR}& \textbf{FDR} & \textbf{TPR}& \textbf{FPR} & \textbf{FDR}\\ \hline NET-DPM-3 & 63\%& 11\% & 15\% & 60\%& \hphantom{0}5\% &\hphantom{0}8\% \\ STD-DPM & 15\% & 33\% & 69\% & 17\% & 26\% & 60\%\\ \hline \end{tabular*} \tabnotetext{ta}{For gene subnetwork selection, the TPR is defined as the percentage of exactly selecting the correct network. The FPR is the percentage of selecting a larger network containing the correct network and at least one more other gene that has connection to the network. The FDR is the proportion of falsely selecting a larger network among all the network discoveries (selecting a correct or larger network).} \vspace*{-3pt} \end{table} \section{Discussion}\label{sec:disc} In the article we propose a Bayesian nonparametric mixture model for gene/gene subnetwork selection. Our model extends the standard DPM model incorporating the gene network information to significantly improve the accuracy of the gene selections and reduce the false discovery rate. We demonstrate that the proposed method has the ability to identify the subnetworks of genes and individual genes with a particular expressional behavior. We also show that it is able to select genes which are strongly associated with clinical variables. We develop a posterior computation algorithm along with two fast approximation approaches. The posterior inference can produce more accurate uncertainty estimates of gene selection, while the fast computing algorithms can achieve a similar gene selection accuracy. Due to the nonparametric nature, our method has the flexibility to fit various data types and has robustness to model assumptions.\vadjust{\goodbreak} When we observe gene expression data along with measurements of a clinical outcome, we need to create statistics to perform the selection of genes that are strongly associated with the clinical outcome. The choice of the statistics is crucial to the performance of our methods. To model the relationship between the clinical outcome and gene expression data, much literature suggests a linear regression model [\citeauthor{li2008network} (\citeyear{li2008network}); \citeauthor{pan2010incorporating} (\citeyear{pan2010incorporating}); \citeauthor{li2010bayesian} (\citeyear{li2010bayesian}); \citeauthor{stingo2011incorporating} (\citeyear{stingo2011incorporating})], from which we produce testing statistics or coefficient estimates as the candidates. For instance, as we suggest in Section D in the supplemental article [\citet{zhao2014bayesian}], the most straightforward approach is to fit simple linear regression on each gene and use the $t$-statistics as the input data to our methods. However, there is no scientific evidence that the relationship between gene expression profiles and the clinical outcome should follow a linear regression model. Without making this assumption, we may test the independence between each gene expression profile and the clinical outcome via a nonparametric model suggested by \citet{einmahl2008tests} and use our model to fit the testing statistics. Other potential choices of statistics for the nonlinear problems include mutual information statistics [\citet{peng2005feature}] and maximal information coefficient (MIC) statistics [\citet{reshef2011detecting}]. Although the development of our method is motivated by gene selection problems, our method can conduct variable selection for a general purpose and it has broad applications. For example, functional neuroimaging studies (e.g., fMRI and PET) usually produce large-scale statistics, one for each voxel in the brain. Those statistics are used to localize the brain activity regions related to particular brain functions. This essentially is a voxel selection problem to which our method is applicable, where the networks may be defined according to the spatial locations of the voxels. In addition to this, we discuss two future directions: \begin{longlist} \item[(1)] It is common that we have multiple hypothesis tests for each gene, and we have interest in jointly analyzing these statistics. This motivates an extension of the current NET-DPM model from one dimension to multiple dimensions for multivariate large-scale statistics. \item[(2)] The selection of one gene might be affected by not only the genes that are directly connected to it, but also the genes close to it over the network. It would be interesting to extend the prior specifications of the class label by incorporating a network distance. This should provide more biologically meaningful results. \end{longlist} \section*{Acknowledgments} The authors would like to thank the Editor, the Associate Editor and two referees for their helpful suggestions and constructive comments that substantially improved this manuscript. \begin{supplement}[id=suppA] \stitle{Supplement to ``A Bayesian nonparametric mixture model for selecting genes and gene subnetworks''} \slink[doi]{10.1214/14-AOAS719SUPP} \sdatatype{.pdf} \sfilename{aoas719\_supp.pdf} \sdescription{In this online supplemental article we provide (A) derivations of the proposed methods, (B) details of the main algorithms for posterior computations, (C) details of posterior inference for hyperparameters, (D) additional simulation studies and (E) sensitivity analysis.} \end{supplement}
{'timestamp': '2014-08-01T02:09:27', 'yymm': '1407', 'arxiv_id': '1407.8399', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8399'}
arxiv
\section{Introduction} \emph{Patrolling} is a well-studied task in robotics. A set of mobile agents move around a given area to protect or supervise it, with the goal of ensuring that each point in the area is visited frequently enough~% \cite{Chevaleyre04,Collins13,esa2011,ElmaliachSK2008,YanovskiWB2003}. While many authors study heuristic patrolling strategies for various settings and analyze their performance through experiment, recent studies on theoretical optimality of strategies have revealed that there are interesting questions and intricacies even in the simplest settings~\cite{esa2011,pasqualetti_franchi_bullo_2010}. One of the fundamental problems considered by Czyzowicz et al.~% \cite{esa2011} is to patrol a line segment (called the \emph{fence}) using $k$ mobile agents with given speeds. They showed that the simple partition-based strategy, which is used as parts of many strategies in more general problems~% \cite{Chevaleyre04, Collins13, ElmaliachSK2008, pasqualetti_franchi_bullo_2010}, is optimal in this setting for $k=2$. They conjectured that it is also optimal for every $k$. In this paper, we prove that the conjecture holds for $k = 3$ (Section~\ref{section: optimal}), but fails in general (Section~\ref{sec:k=6}). \paragraph{Formal description of fence patrolling.} We are given a line segment of length $l$, which is identified with the interval $[0, l]$. A set of points (mobile agents) $a_1, a_2, \dots , a_k$ move along the segment. They can move in both directions, and can pass one another. The speed of each agent~$a _i$ may vary during its motion, but its absolute value is bounded by the predefined maximum speed $v _i$. The position of agent $a _i$ at time $t$ is denoted $a _i (t)$. Thus, the motion of the agent $a _i$ is described by a function $a _i \colon [0, \infty) \to [0, l]$ satisfying $ |a_i(t) - a_i(t+\epsilon)| \leq v_i \cdot \epsilon $ for any $t \ge 0$ and $\epsilon >0$. A \emph{strategy} (or \emph{schedule}) is given by a $k$-tuple of such functions $a _i$. For a position $x \in [0, l]$ and time $t ^* \in [0, \infty)$, the agent $a _i$ is said to \emph{cover} $(x; t ^*)$ if $a _i(t) = x$ for some $t \in [t^* - 1, t^*)$. A strategy is said to \emph{patrol} the segment $[0, l]$ if for any $x \in [0, l]$ and $t ^* \in [1, \infty)$, some agent $a _i$ covers $(x; t ^*)$. Given the speeds $v_1$, \ldots, $v_k$, we want a strategy that patrols the longest possible fence. This is equivalent, through scaling, to fixing the length of the fence and minimizing the time, often called the \emph{idle time}, during which some point is left unattended by any agent. \paragraph{The partition-based strategy.} An obvious strategy for fence patrolling is as follows: partition the fence $[0, l]$ into $k$ segments, proportionally to the maximum speeds $v _1$, \ldots, $v _k$, and let each agent $a_i$ patrol the $i$th segment by alternately visiting both endpoints with its maximum speed. We call this the \emph{partition-based strategy}. Since each agent $a_i$ can patrol a segment of length $v _i / 2$, the partition-based strategy can patrol a segment of length $l = (v _1 + \dots + v _k) / 2$. Czyzowicz et al.~\cite{esa2011} observed that this is optimal when $k=2$. They conjectured that it is also the case for every $k$, that is, a segment of length $l > (v _1 + \dots + v _k) / 2$ cannot be patrolled. In this paper, we disprove this conjecture by demonstrating $k=6$ agents that patrol a fence of length greater than $(v _1 + \dots + v _k) / 2$ (Theorem~\ref{thm:k=6}). On the other hand, we show that the partition-based strategy is optimal when $k=3$ (Theorem~\ref{thm:k=3}). \section{The partition-based strategy is not always optimal} \label{sec:k=6} \begin{figure} \begin{center} \includegraphics[scale=.77]{./figures/six_guards_1.pdf}% \hfill \includegraphics[scale=.77]{./figures/six_guards_2.pdf}% \hfill \includegraphics[scale=.77]{./figures/six_guards_3.pdf}% \caption{% Six agents patrolling a longer fence than they would with the partition-based strategy. } \label{figure: six agents} \end{center} \end{figure} Fig.~\ref{figure: six agents} shows six agents with speeds $1$, $1$, $1$, $1$, $7 / 3$, $1 / 2$ who patrol a fence of length $7 / 2$. The fence is placed horizontally and time flows upwards. The region covered by each agent is shown shaded (i.e., the agent itself moves along the lower edge of each shaded band of height~$1$). This strategy is periodic in the sense that each agent repeats its motion every $7$ unit times. The four agents with speed~$1$, shown in the diagram on the left, visit the two endpoints alternately. The region covered by them is shown again by the dotted lines in the middle diagram, where another agent with speed $7 / 3$ covers most of the remaining region, but misses some small triangles. They are covered by the last agent with speed $1 / 2$ in the diagram on the right. Note that the partition-based strategy with these agents would only patrol the length $(1 + 1 + 1 + 1 + 7 / 3 + 1 / 2) / 2 = 41 / 12 < 7 / 2$. Thus, \begin{figure} \begin{center} \includegraphics[scale=.85]{./figures/nine_guards_2.pdf}% \\[10pt] \includegraphics[scale=.85]{./figures/nine_guards_3.pdf}% \caption{% Six agents with speed~$5$ (top) and three agents with speed~$1$ (bottom) together patrolling a longer fence than they would with the partition-based strategy. } \label{figure: nine agents} \end{center} \end{figure} \begin{theorem}\label{thm:k=6} There are settings of agents' speeds for which the partition-based strategy is not optimal. \end{theorem} Note that the above example for $k = 6$ agents easily implies the non-optimality of the partition-based strategy for each $k \geq 6$: we can, for example, modify the above strategy by extending the fence to the right and adding a seventh agent who is just fast enough to cover the extended part by moving back and forth. Another example involving more agents but perhaps simpler is shown in Fig.~\ref{figure: nine agents}, where six agents with speed~$5$ and three with speed~$1$ patrol a fence of length $50 / 3$ using a periodic strategy, with period $10 / 3$. Here, the six fast agents in the first diagram work in two groups of three in a synchronized way. The region covered by them is shown again in the second diagram in dotted lines, where the missed small triangular regions are covered by the three slow agents. The partition-based strategy would only achieve $33 / 2$. \section{Cases where the partition-based strategy is optimal} \label{section: optimal} Before proving the optimality of the partition-based strategy for three agents (Section~\ref{sec:k=3}), we brief\textcompwordmark ly discuss the much simpler cases of equal-speed agents (Section~\ref{section: one speed}) and two agents (Section~\ref{sec:k=2}). \subsection{Agents with equal speeds} \label{section: one speed} In the homogeneous setting where all agents have the same speed~$v$, it is relatively easy to prove that the partition-based strategy is optimal. This is true more generally when there are regions that do not have to be visited frequently~% \cite{Collins13}, as well as in related settings where the time and locations are discretized in a certain way~% \cite[Section III]{pasqualetti_franchi_bullo_2010}. For the sake of completeness, we provide a short proof for our setting: \begin{theorem} \label{thm:onespeed} If all agents have the same speed, the partition-based strategy is optimal. \end{theorem} \begin{proof} We proceed by induction on the number $k$ of agents. We may assume that the agents never switch positions, so that $a _1 (t) \leq \dots \leq a _k (t)$ for all $t$. This is because two agents passing each other could as well just turn back. Under this assumption, the agent~$a _1$ must visit the point~$0$ once in every unit time, and hence is confined to the interval $[0, v / 2]$. The rest of the fence must be patrolled by the other $k - 1$ agents, who, by the induction hypothesis, cannot do better than the partition-based strategy which patrols the length $(k - 1) v / 2$. Thus the total length is bounded by $v / 2 + (k - 1) v / 2 = k v / 2$. \end{proof} \subsection{Two agents} \label{sec:k=2} Although the optimality of the partition-based strategy for two agents was already pointed out in \cite{esa2011}, we present an alternative proof here. Some ideas in the proof will be used for three agents (Section~\ref{sec:k=3}) and also for the weighted setting (Section~\ref{section: final}). \begin{theorem} \label{thm:k=2} For two agents, the partition-based strategy is optimal. \end{theorem} \begin{proof} Suppose that this was false. That is, suppose that there is a strategy where agents $a_1$ and $a_2$ patrol $[0, l]$ for some $l > (v _1 + v _2) / 2$. We may assume that $v _1 \geq v _2$. Let $l _i = v _i l / (v _1 + v _2)$ for $i = 1$, $2$. Note that $l = l_1 + l_2$, and that it takes time longer than $1 / 2$ for agent $a _i$ to travel the distance~$l _i$. For any time $t \geq 0$, each agent must visit an endpoint ($0$ or $l$) some time after $t$. To see this, let $t _0 > t$ be a time at which the endpoint~$0$ is visited. Then $(l; t _0 + 1 / 2)$ cannot be covered by this same agent, and thus is covered by the other agent. Hence, the slower agent $a _2$ visits an endpoint, say $0$, at some time $t _2 > 1$. This implies that $(l _2; t _2 + 1 / 2)$ cannot be covered by $a _2$. It must therefore be covered by $a _1$, that is, $a _1$ must visit $l _2$ at some time $ t _1 \in [t _2 - 1 / 2, t _2 + 1 / 2) $. This implies that $(l; t_1 + 1 / 2)$ is not covered by $a _1$. But it is not covered by $a _2$ either, because $ t _1 + 1 / 2 \in [t _2, t _2 + 1) $ and the agent $a _2$ cannot travel the distance $l _1 + l _2$ in unit time (see Fig.~\ref{fig:00}). This is a contradiction. \end{proof} \begin{figure} \begin{center} \includegraphics[scale=1.0]{./figures/figure00new.pdf} \caption{Proof of Theorem~\ref{thm:k=2}} \label{fig:00} \end{center} \end{figure} \subsection{Three agents} \label{sec:k=3} In this section, we show that Czyzowicz et al.'s conjecture is true for three agents: \begin{theorem} \label{thm:k=3} For three agents, the partition-based strategy is optimal. \end{theorem} For a contradiction, suppose that agents $a_1$, $a_2$, $a_3$ with speeds $v_1 \geq v_2 \geq v_3$ patrol $[0, l]$, where $l > (v_1 + v_2 + v_3) / 2$. For $i=1, 2, 3$ let $l_i = v_i l / (v_1 + v_2 + v_3)$, so that $l = l_1 + l_2 + l_3$ and $l _i > v _i / 2$. We start with some lemmas about the coverage of endpoints. \begin{lemma}\label{clm:02} For any $t^* \geq 0$, at least two different agents visit $0$ after the time $t^*$, and at least two different agents visit $l$ after the time $t^*$. \end{lemma} \begin{proof} Let $\{i, j, k\} = \{1, 2, 3\}$, and assume that $a_i$ is the only agent that visits $0$ after time $t^*$. This forces it to stay (after time $t ^* + 1 / 2$) in the part $[0, l _i]$, so the remaining part $[l_i, l]$ of length $l_j + l_k$ has to be patrolled by $a_j$ and $a_k$, contradicting Theorem~\ref{thm:k=2}. The same argument applies to the other endpoint $l$. \end{proof} \begin{lemma}\label{clm:03} For any $t^* \geq 0$, each agent visits at least one of $0$ and $l$ after the time $t^*$. \begin{figure} \begin{center} \includegraphics[scale=1.0]{./figures/figure01new.pdf} \caption{Proof of Lemma~\ref{clm:03}} \label{fig:01} \end{center} \end{figure} \end{lemma} \begin{proof} Let $\{i, j, k\} = \{1, 2, 3\}$, and assume that $a_i$ does not visit $0$ after $t^*$. By Lemma~\ref{clm:02}, both $a_j$ and $a_k$ visit $0$ infinitely often after $t^*$. Thus, $a_j(t_j) = a_k(t_k) =0$ for some $t_j, t_k > t^* + 1 / 2$ with $t_j \leq t_k \leq t_j + 1$ (see Fig.~\ref{fig:01}). The pair $(l; t_j + l / v _j)$ is not covered by $a_j$, because $(t _j + l / v _j) - (t _j - l / v _j) > 1$. It is not covered by $a _k$ either, because \begin{equation*} \biggl( t_j + \frac{l}{v_j} \biggr) - \biggl( t_k - \frac{l}{v_k} \biggr) > t _j + \frac{v _j + v _k}{2 v _j} - t _k + \frac{v _j + v _k}{2 v _k} = (t _j - t _k) + 1 + \frac 1 2 \biggl( \frac{v_k}{v_j} + \frac{v_j}{v_k} \biggr) \geq 1. \end{equation*} Hence, it must be covered by $a_i$, which means that $a_i$ visits $l$ after the time $t^*$. \end{proof} \begin{lemma}\label{clm:04} Suppose that $a_2(t_2) = a_3(t_3) = 0$ (resp.~$= l$) for some $t_2, t_3 > 1$. Then, \begin{itemize} \item $a_1(t_1) = 0$ (resp.~$= l$) for some $t _1 \in (t _2, t _3)$ if $t_2 \leq t_3$, and \item $a_1(t_1) = 0$ (resp.~$= l$) for some $t _1 \in (t _3, t _2)$ if $t_2 \geq t_3$. \end{itemize} \end{lemma} \begin{proof} Assume that there are $t_3 \geq t_2 > 1$ such that $a _2 (t _2) = a _3 (t _3) = 0$ and $a _1 (t _1) \neq 0$ for any $t _1 \in (t _2, t _3)$. We may then retake $t_2$ and $t_3$, if necessary, and have $t_3 - t_2 \leq 1$ (see Fig.~\ref{fig:02}). \begin{figure} \begin{center} \includegraphics[scale=1.0]{./figures/figure02new.pdf} \caption{Proof of Lemma~\ref{clm:04}} \label{fig:02} \end{center} \end{figure} By the same argument as the proof of Lemma~\ref{clm:03}, the pair $(l_2+l_3; t_2 + (l_2 + l_3) / v_2)$ is covered by neither $a_2$ nor $a_3$. More precisely, it is not covered by $a_2$, because $\bigl( t_2 + (l_2 + l_3) / v_2 \bigr) - \bigl( t_2 - (l_2 + l_3) / v_2 \bigr) > 1$, and it is not covered by $a_3$ either, because \begin{equation*} \biggl( t_2 + \frac{l_2 + l_3}{v_2} \biggr) - \biggl( t_3 - \frac{l_2 + l_3}{v_3} \biggr) > t _2 + \frac{v _2 + v _3}{2 v _2} - t_3 + \frac{v _2 + v _3}{2 v_3} = (t_2- t_3) + 1 + \frac 1 2 \biggl( \frac{v_3}{v_2} + \frac{v_2}{v_3} \biggr) \geq 1. \end{equation*} Hence, it must be covered by $a_1$, which means that $a_1(t_1) = l_2 + l_3$ for some $t _1 \in [t _2 + (l _2 + l _3) / v _2 - 1, t _2 + (l _2 + l _3) / v _2)$. Since $v_1 \geq v_2 \geq v_3$, $(l; t_1 + l_1 / v_1)$ is covered by none of $a_1, a_2$, and $a_3$, which is a contradiction. The argument is similar when $t_2 \geq t_3$ and when $a_2(t_2) = a_3(t_3) = l$. \end{proof} By Lemmas~\ref{clm:03} and~\ref{clm:04}, it happens infinitely often that one of the endpoints is visited by $a _1$ and then immediately by $a _2$. Let us focus on one occurrence of this event, sufficiently later in time (time $1 + l / v_3$ is enough), which, without loss of generality, happens at the endpoint~$0$. That is, we fix $t _1$ and $t _2$ with $1 + l / v_3 < t_1 \leq t_2 \leq t_1 + 1$ such that $a _1 (t _1) = a _2 (t _2) = 0$ and no agent visits $0$ during the time interval $(t _1, t _2)$. Note that we choose $1 + l / v_3$ so that every value of time appearing in the proof is at least $1$. Now we split into two cases. \subsubsection*{Case I: $v_1 \geq 2v_2+v_3$} \label{sec:k=3case1} The pair $(l_1 + l_2 - l_3; t_1 + \frac{l_1 + l_2 - l_3}{v_1})$ is not covered by $a_1$, because $ \bigl( t_1 + \frac{l_1 + l_2 - l_3}{v_1} \bigr) - \bigl( t_1 - \frac{l_1 + l_2 - l_3}{v_1} \bigr) = 2 \cdot \frac{l_1 + l_2 - l_3}{v_1} \geq \frac{2 l_1}{v_1} > 1 $. It is not covered by $a_2$ either, because \begin{align*} \biggl( t _1 + \frac{l _1 + l _2 - l _3}{v _1} \biggr) - \biggl( t _2 - \frac{l _1 + l _2 - l _3}{v _2} \biggr) & > t _1 + \frac{v _1}{2 v _1} - t _2 + \frac{v _1 + v _2 - v _3}{2 v _2} \\ & = (t _1 - t _2) + 1 + \frac{v _1 - v _3}{2 v _2} \geq 1. \end{align*} Hence, it must be covered by $a_3$ (Fig.~\ref{fig:03}), \begin{figure} \begin{center} \includegraphics[scale=1.0]{./figures/figure03new.pdf} \caption{Case of $v_1 \geq 2v_2+v_3$} \label{fig:03} \end{center} \end{figure} which means that $a_3(t_3) = l_1 + l_2 - l_3$ for some $t_3 \in [t_1 + \frac{l_1 + l_2 - l_3}{v_1}-1, t_1 + \frac{l_1 + l_2 - l_3}{v_1})$. If $t_3 + \frac{2l_3}{v_3} \leq t_1 + \frac{l}{v_1}$, then $(l; t_3 + \frac{2l_3}{v_3})$ is not covered by any of $a_1$, $a_2$, $a_3$ (see Fig.~\ref{fig:03}). Otherwise, $(l; t_1 + \frac{l}{v_1})$ is not covered by any of $a_1$, $a_2$, $a_3$ (not by $a _3$ because $ (t_1 + \frac{l}{v_1}) - (t_3 - \frac{2l_3}{v_3}) > t _3 - (t _3 - 1) = 1 $). \subsubsection*{Case II: $v_1 \leq 2v_2+v_3$} \label{sec:k=3case2} This is the harder case and takes up the rest of this section. Again, let $t_1$ and $t_2$ be such that $1 + \frac{l}{v_3} < t_1 \leq t_2 \leq t_1 + 1$ and $a_1(t_1) = a_2(t_2) = 0$. \begin{lemma}\label{clm:10} $a_2(t) \neq l$ for any $t \in [t_1 - \frac{l}{v_1}, t_1 + \frac{l}{v_1}]$. \end{lemma} \begin{proof} The pair $(l; t_1 + l / v _1)$ is not covered by $a_1$, because $(t _1 + l / v _1) - (t _1 - l / v _1) > 1$. It is not covered by $a _2$ either, because \begin{equation*} \biggl( t_1 + \frac{l}{v_1} \biggr) - \biggl( t_2 - \frac{l}{v_2} \biggr) > t _1 + \frac{v _1 + v _2}{2 v _1} - t _2 + \frac{v _1 + v _2}{2 v _2} = (t _1 - t _2) + 1 + \frac 1 2 \biggl( \frac{v_2}{v_1} + \frac{v_1}{v_2} \biggr) \geq 1. \end{equation*} Hence, it must be covered by $a_3$, i.e., $a_3$ visits $l$ at some time $ t' \in [t_1 + \frac{l}{v_1} - 1, t_1 + \frac{l}{v_1}) \subseteq [t_1 - \frac{l}{v_1}, t_1 + \frac{l}{v_1}] $. If we assume that $a _2(t) = l$ for some time $t \in [t_1 - \frac{l}{v_1}, t_1 + \frac{l}{v_1}]$, then, by Lemma~\ref{clm:04}, $a _1 (t'') = l$ for some $t'' \in (t, t') \subseteq (t_1 - \frac{l}{v_1}, t_1 + \frac{l}{v_1})$ (or $t'' \in (t', t) \subseteq (t_1 - \frac{l}{v_1}, t_1 + \frac{l}{v_1})$). This contradicts that $a_1 (t_1) = 0$ and $|t_1 - t''| < \frac{l}{v_1}$. Therefore, we conclude that $a _2$ cannot visit $l$ during $[t_1 - \frac{l}{v_1}, t_1 + \frac{l}{v_1}]$. \end{proof} \begin{lemma}\label{clm:05} $a_3(t) \neq l_1+l_2$ for any $t \in [t_1 - \frac{l_2 + l_3}{v_1}, t_1 + \frac{l_2 + l_3}{v_1}]$ (see Fig.~\ref{fig:04}). \begin{figure} \begin{center} \includegraphics[scale=1.0]{./figures/figure04new.pdf} \caption{Lemmas~\ref{clm:05} and~\ref{clm:06}} \label{fig:04} \end{center} \end{figure} \end{lemma} \begin{proof} Assume that $a_3(t) = l_1+l_2$ for some $t \in [t_1 - \frac{l_2 + l_3}{v_1}, t_1 + \frac{l_2 + l_3}{v_1}]$. Then, since $[t -\frac{1}{2}, t +\frac{1}{2}] \subseteq [t_1 - \frac{l}{v_1}, t_1 + \frac{l}{v_1}]$, neither $a_1$ nor $a_3$ covers $(l; t + \frac{1}{2})$. Furthermore, by Lemma~\ref{clm:10}, $(l; t + \frac{1}{2})$ is not covered by $a_2$ either. This is a contradiction. \end{proof} \begin{lemma}\label{clm:06} $a_3(t) = l_1+l_2$ for some $t$ such that $t_1 + \frac{l_2 + l_3}{v_1} < t < t_1 + \frac{l_1 + l_2}{v_1}$ (see Fig.~\ref{fig:04}). \end{lemma} \begin{proof} The pair $(l_1+l_2; t_1 + \frac{l_1 + l_2}{v_1})$ is not covered by $a_1$, because $\bigl( t_1 + \frac{l_1 + l_2}{v_1} \bigr) - \bigl( t_1 - \frac{l_1 + l_2}{v_1} \bigr) > 1$. It is not covered by $a_2$ either, because \begin{equation*} \biggl( t_1 + \frac{l_1 + l_2}{v_1} \biggr) - \biggl( t_2 - \frac{l_1 + l_2}{v_2} \biggr) > t _1 + \frac{v _1 + v _2}{2 v _1} - t _2 + \frac{v _1 + v _2}{2 v _2} = (t _1- t _2) + 1 + \frac 1 2 \biggl( \frac{v_2}{v_1} + \frac{v_1}{v_2} \biggr) \geq 1. \end{equation*} Hence, it must be covered by $a_3$, which means that $a_3(t) = l_1 + l_2$ for some $ t \in [t_1 + \frac{l_1 + l_2}{v_1} - 1, t_1 + \frac{l_1 + l_2}{v_1})$. Since $ \frac{l _1 + l _2}{v _1} + \frac{l_2 + l_3}{v_1} = \frac{l _1 + 2 l _2 + l _3}{v _1} > \frac{v _1 + 2 v _2 + v _3}{2 v _1} \geq 1 $ by the assumption $v_1 \leq 2 v_2 + v_3$, we have $t_1 + \frac{l_1 + l_2}{v_1} - 1 > t_1 - \frac{l_2 + l_3}{v_1}$. Hence, by Lemma~\ref{clm:05}, $a_3(t) = l_1 + l_2$ for some $t$ such that $t_1 + \frac{l_2 + l_3}{v_1} < t < t_1 + \frac{l_1 + l_2}{v_1}$. \end{proof} Let $t_3$ be the minimum value such that $a_3(t_3) = l_1 + l_2$ and $t_1 + \frac{l_2 + l_3}{v_1} < t_3 < t_1 + \frac{l_1 + l_2}{v_1}$ (see Fig.~\ref{fig:04}). \begin{lemma}\label{clm:07} $a_3(t)=l$ for some $t \in [t_1 + \frac{l}{v_1} - 1, t_3 - \frac{l_3}{v_3}]$. \end{lemma} \begin{proof} The pair $(l; t_1 + \frac{l}{v_1})$ is not covered by $a_1$, because $\bigl( t_1 + \frac{l}{v_1} \bigr) - \bigl( t_1 - \frac{l}{v_1} \bigr) > 1$. By Lemma~\ref{clm:10}, it is not covered by $a_2$ either. Hence, $a_3(t) = l$ for some $t \in [t_1 + \frac{l}{v_1}-1, t_1 + \frac{l}{v_1})$. On the other hand, since $a_3(t_3) = l_1 + l_2$, we have $a_3(t) \neq l$ for any $t$ such that $t_3 - \frac{l_3}{v_3} < t < t_3 + \frac{l_3}{v_3}$. By combining them, we obtain the claim. \end{proof} Let $t'_3$ be the maximum value such that $a_3(t'_3)=l$ and $t'_3 \in [t_1 + \frac{l}{v _1} - 1, t_3 - \frac{l_3}{v_3}]$. Then, $(l_1 + l_2; t_3)$ is not covered by $a_3$, because $t_3 > (t'_3 - \frac{l_3}{v_3}) + 1$ and $t'_3 + \frac{l_3}{v_3} > t_1 - \frac{l_2 + l_3}{v_1}$. It is not covered by $a_1$ either, because \begin{equation*} t_3 > t_1 + \frac{l_2 + l_3}{v_1} > \biggl( t_1 - \frac{l_1 + l_2}{v_1} \biggr) + 1 \end{equation*} by $v_1 \leq 2v_2 + v_3$. Hence, it is covered by $a_2$, which means that $a_2 (t'_2) = l_1 + l_2$ for some $t'_2$ such that $t_3 - 1 \leq t'_2 < t_3$ (see Fig.~\ref{fig:05}). \begin{figure} \begin{center} \includegraphics[scale=1.0]{./figures/figure05new.pdf} \caption{Construction of $t'_3$, $t'_2$, and $t'_1$} \label{fig:05} \end{center} \end{figure} Since $(l_1; t'_2 + \frac{l_2}{v_2})$ is not covered by $a_2$ or $a_3$, it is covered by $a_1$, which means that $a_1(t'_1) = l_1$ for some $t'_1$ such that $t'_2 + \frac{l_2}{v_2} - 1 \leq t'_1 < t'_2 + \frac{l_2}{v_2}$. In this case, $(0; t'_1 + \frac{l_1}{v_1})$ is not covered by any of $a_1$, $a_2$, and $a_3$, which is a contradiction. We have proved Theorem~\ref{thm:k=3}. \section{Final remarks} \label{section: final} The partition-based strategy is widely used as part of multi-agent patrolling strategies. We studied its theoretical optimality in one of the simplest settings: the terrain is a line segment, and the agents are points with given maximal speeds. \paragraph{The weighted setting.} It may be natural to consider the \emph{weighted} version of the problem where each agent has a different power of influence. That is, the idle time $T_i > 0$ depends on the agent $a_i$, and is called the \emph{weight} of $a_i$. The setting we have been dealing with in the previous sections is the special case where $T _i = 1$ for all $i$. In the general setting, we say that $a_i$ \emph{covers} the pair $(x; t^*)$ if $a_i(t) = x$ for some $t \in [t^* -T_i, t^*)$. The agents $a _1$, \ldots, $a _k$ are said to \emph{patrol} $[0, l]$ if for any $x \in [0, l]$ and $t ^* \in [\max_i ( T_i ), \infty)$, the pair $(x; t ^*)$ is covered by some $a _i$. As in the unweighted case, we can consider the partition-based strategy. This time, each agent $a_i$ is assigned a segment of length proportional to the weighted speed $v_i T_i$. Theorem~\ref{thm:onespeed} remains true in this general setting: the partition-based strategy is optimal when the agents have different weights $T _i$ but the same speed~$v$. To see this, suppose that we could patrol a fence of length $l = \alpha + \sum _{i = 1} ^k v T _i / 2$ for some $\alpha > 0$. Let $\tau = 2 \alpha / k v$. Since an agent of weight $T _i$ can be simulated by $\lceil T _i / \tau \rceil$ agents of weight~$\tau$ moving in parallel, this fence can be patrolled by $\kappa = \sum _{i = 1} ^k \lceil T _i / \tau \rceil$ agents, all with weight~$\tau$ (and speed~$v$). This contradicts (a suitably rescaled version of) Theorem~\ref{thm:onespeed}, since $ l = k \tau v / 2 + \sum _{i = 1} ^k T _i v / 2 = \sum _{i = 1} ^k (T _i / \tau + 1) v \tau / 2 > \kappa v \tau / 2 $. Theorem~\ref{thm:k=2} (optimality of the partition-based strategy for two agents) also remains true for weighted agents: the proof goes through if we set $l _i = v _i T _i l / (v _1 T _1 + v _2 T _2)$ instead. However, Theorem~\ref{thm:k=3} (optimality of the partition-based strategy for three agents) fails for the weighted setting. To see this, consider our first example for Theorem~\ref{thm:k=6} (Fig.~\ref{figure: six agents}), and regard the four agents in the left diagram as one agent with weight $4$. \paragraph{Summary of our results.} Thus, our current knowledge can be summarized as follows. \begin{itemize} \item The partition-based strategy is optimal when all agents (possibly weighted) have the same speed (Theorem~\ref{thm:onespeed}), but not when there are two distinct speeds (Fig.~\ref{figure: nine agents}). \item The partition-based strategy is optimal when there are two agents with different speeds and weights (Theorem~\ref{thm:k=2}), but not when there are three (Fig.~\ref{figure: six agents}). \item The partition-based strategy is optimal when there are three agents with the same weight (Theorem~\ref{thm:k=3}), but not when there are six (Fig.~\ref{figure: six agents}). \end{itemize} The third part settles a conjecture of Czyzowicz et al.~\cite{esa2011}, but our proof for three agents is already quite involved and seems hard to generalize. It remains open whether the partition-based strategy is optimal for four and five (unweighted) agents. \paragraph{Related work and generalizations.} We considered the patrolling problem in one of its most basic forms: the terrain to be patrolled is a line segment, every point in the terrain must be visited, and each agent is a point with a maximum speed. The problem setting can be generalized in many ways. Another simple terrain that has been studied in Czyzowicz et al.~\cite{esa2011} is a cycle, where again it turns out that simple strategies may not be optimal (see also Dumitrescu, Ghosh and T\'oth~\cite{Dumitrescu2014}). Collins et al.~\cite{Collins13} study the patrolling problem where only part of the fence needs to be visited frequently. Chen, Dumitrescu and Ghosh~\cite{Chen13} and Czyzowicz et al.~\cite{visibility} discuss agents with some visibility. Czyzowicz et al.~\cite{beach} study the setting where agents can move faster when walking without watching (although their problem is to cover the line segment just once, rather than patrolling perpetually). For practical purposes, it is important to consider decentralized settings where agents need to cooperate with limited global knowledge or computational power~\cite{suzuki-yamashita}. The fact that the partition-based strategy is not always optimal may be bad news in this context, since it is one of the simplest strategies to be realized in a distributed way, using systems of self-stabilizing robots, e.g., in models of ``bouncing robots''~\cite{bounce}. Thus a natural question to ask next is whether and how movements better than the partition-based strategy can be realized in various distributed settings. \paragraph{A revised conjecture.} Since the partition-based strategy covers each $(x; t) \in [0, l] \times [1, \infty)$ only doubly, it achieves a $2$-approximation (for the problem of finding the longest possible fence that can be patrolled). That is, no strategy patrols a fence longer than $v _1 + \dots + v _k$ (in the unweighted setting). Although we have shown that the partition-based strategy is not always optimal, it may still be somewhat close to being optimal, given that it is outperformed only slightly by our examples for Theorem~\ref{thm:k=6}. In other words, the following may be the case, with a constant~$c$ fairly close to $1 / 2$: \begin{conjecture} There is a constant $c < 1$ such that for any $k$ and any $v _1$, \ldots, $v _k$, no strategy can patrol a fence longer than $c (v _1 + \dots + v _k)$. \end{conjecture} The partition-based strategy gives a lower bound of $1 / 2$ for such a constant $c$. Our first example (Fig.~\ref{figure: six agents}) gives $21/41 = 0.5121\ldots {}$. After a preliminary version of this paper~\cite{isaac} was presented, Chen, Dumitrescu and Ghosh~\cite{Chen13} (see also Dumitrescu, Ghosh and T\'oth~\cite{Dumitrescu2014}) improved this bound to $25/48 = 0.5208\ldots {}$. Determining the least $c$ is an interesting question. \paragraph{Note added for the arXiv version.} Kawamura and Soejima~\cite{soejima} recently announced a lower bound of $2 / 3$. The above conjecture still remains open. \paragraph{Acknowledgements.} We thank Yoshio Okamoto for suggesting this research. We also thank Taisuke Izumi, Kohei Shimane, Yushi Uno and the anonymous referees for helpful comments.
{'timestamp': '2014-08-01T02:00:39', 'yymm': '1407', 'arxiv_id': '1407.8194', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8194'}
arxiv
\section{Background} The classical variance component model has been a powerful tool for mapping quantitative trait loci (QTL) in pedigrees. Polygenic effects are effectively modeled by introducing an additive genetic variance component operating on the kinship coefficient matrix. With unknown or dubious pedigree structure, global kinship coefficients can be accurately estimated from dense markers using either the genetic relationship matrix (GRM) or the method of moments. In GWAS (genome-wide association studies), the two alleles of a SNP (single nucleotide polymorphism) shift trait means and can be tested as a fixed effect. However, fitting a variance component model is computationally challenging, especially when it has to be done for a large number of markers. In the newly released version of the {\sc Mendel}\ software \citep{Lange13Mendel}, Option 29 implements an ultra-fast score test for pedigree GWAS. Score tests require no additional iteration under the alternative model. Only SNPs with the most promising score-test p-values are further subject to likelihood ratio testing (LRT), thus achieving a good compromise between speed and power for large scale QTL analysis. In this paper, we demonstrate the capabilities of {\sc Mendel}\ on the genetic analysis workshop 19 (GAW19) sequencing data. \section{Methods} QTL association mapping typically invokes the multivariate normal distribution to model the observed $T$-variate trait $\boldsymbol{Y} \in \mathbb{R}^{n \times T}$ over a pedigree of $n$ individuals. The standard model \citep{Lange02GeneticsBook} collects the means of the responses $\mathrm{vec}(\boldsymbol{Y})$ into a vector $\boldsymbol{\nu}$ and the corresponding covariances into a matrix $\boldsymbol{\Sigma}$ and represents the loglikelihood of a pedigree as \begin{eqnarray*} L & = & -\frac{1}{2} \ln \det \boldsymbol{\Sigma} -\frac{1}{2}[\mathrm{vec}(\boldsymbol{Y})-\boldsymbol{\nu}]^t \boldsymbol{\Sigma}^{-1}[\mathrm{vec}(\boldsymbol{Y})-\boldsymbol{\nu}], \end{eqnarray*} where the covariance matrix is typically parametrized as $\boldsymbol{\Sigma} = 2 \boldsymbol{\Sigma}_a \otimes \boldsymbol{\Phi} + \boldsymbol{\Sigma}_d \otimes \boldsymbol{\Delta}_7 + \boldsymbol{\Sigma}_h \otimes \boldsymbol{H} + \boldsymbol{\Sigma}_e \otimes \boldsymbol{I}$. Here $\boldsymbol{\Phi}$ is the global kinship matrix capturing additive polygenic effects, and $\boldsymbol{\Delta}_7$ is a condensed identity coefficient matrix capturing dominance genetic effects. For $\boldsymbol{\Phi}$, {\sc Mendel}\ can use (a) the theoretical kinship matrix from provided pedigree structures, (b) SNP-based estimates for the kinship of pairs of people within each pedigree, or (c) SNP-based estimates for the entire global kinship matrix ignoring pedigree information. To estimate kinship coefficients from dense SNP data, {\sc Mendel}\ employs either the genetic relationship matrix (GRM) or the method of moments \citep{Day-Williams11LinkageWoPedigree,Lange14NextGenStatGene}. The household effect matrix $\boldsymbol{H}$ has entries $h_{ij}=1$ if individuals $i$ and $j$ are in the same household and 0 otherwise. Individual environmental contributions and trait measurement errors are incorporated via the identity matrix $\boldsymbol{I}$. QTL fixed effects are captured through the mean component $\boldsymbol{\nu} = \boldsymbol{A} \boldsymbol{\beta}$ for some predictor matrix $\boldsymbol{A}$ and vector of regression coefficients $\boldsymbol{\beta}$. To test a SNP against a $T$-variate trait, $\boldsymbol{A}$ is augmented with $T$ extra columns holding the allele counts at the SNP, and the corresponding regression coefficients are jointly tested for association \citep{Lange05association}. For longitudinal measurements of covariates such as {\tt smoke}, {\tt age} and {\tt BPMed}, we may either assume time varying effect sizes or constrain their effect sizes at different time points to be the same. The latter tactic leads to a more parsimonious and interpretable model and can be easily enforced by setting appropriate parameter constraints in {\sc Mendel}'s control file, which lists the user's choice of model parameters. In {\sc Mendel}, SNPs with the most impressive score test p-values (top 10 by default) are further tested by the more accurate, but slower, likelihood ratio method, thus achieving a good compromise between speed and power for large-scale QTL analysis. We refer readers to our companion manuscript \citep{Zhou13PedScore} for more model and implementation details. \section{Results for Family Data} Our analyses are based on the genotype calls for 959 individuals (464 directly sequenced and the rest imputed) provided in the {\tt chrX-geno.csv.gz} files. Section~\ref{sec:size-power} is a size and power study of the simulated traits in all 200 replicates (SIMPHEN.1-200). Section~\ref{sec:real-dbp} is the whole genome QTL analysis for the real, systolic (SBP) and diastolic (DBP) blood pressure traits. \subsection{Size and power study using simulated traits (SIMPHEN.1--200)} \label{sec:size-power} The power to detect the six functional variants in the {\tt MAP4} gene on chromosome 3 are evaluated from the 200 simulation replicates of the trivariate traits SBP and DBP. Type I errors are evaluated from the univariate Q1 trait, which does not involve a major gene. Our analysis includes covariates {\tt sex}, {\tt age}, {\tt BPMed}, {\tt Smoke}, and their pairwise interactions, and uses the theoretical kinship matrix as the additive polygenic variance component. We constrain the covariate effects to be equal across 3 time points. Table~\ref{table:map4-pvalues} shows that the type I error is well controlled. Not surprisingly the power for detecting the two rare functional variants 3-47913455 and 3-47957741 is extremely low. \begin{table} \centering {\footnotesize \begin{tabular}{ccccccrccccc} \toprule & & \multicolumn{3}{c}{($\text{DBP}_1$, $\text{DBP}_2$,$\text{DBP}_3$)} & \phantom & \multicolumn{3}{c}{$(\text{SBP}_1,\text{SBP}_2,\text{SBP}_3)$} & \phantom & \multicolumn{1}{c}{Q1} \\ \cmidrule{3-5} \cmidrule{7-9} \cmidrule{11-11} SNP & MAF & $\beta_{\text{DBP}}$ & \%Var & Power & \phantom & $\beta_{\text{SBP}}$ & \%Var & Power & \phantom & Size \\ \midrule 3-47913455 & 0.0049 & -5.4633 & 0.0036 & $0.05 \pm 0.02$ & \phantom & -8.7001 & 0.0044 & $0.06 \pm 0.02$ & \phantom & $0.06 \pm 0.02$ \\ 3-47956424 & 0.3777 & -1.4951 & 0.0117 & $0.35 \pm 0.03$ & \phantom & -2.3810 & 0.0143 & $0.42 \pm 0.03$ & \phantom & $0.03 \pm 0.01$ \\ 3-47957741 & 0.0016 & -5.0841 & 0.0024 & $0.04 \pm 0.01$ & \phantom & -8.0964 & 0.0030 & $0.06 \pm 0.02$ & \phantom & $0.06 \pm 0.02$ \\ 3-47957996 & 0.0301 & -4.6435 & 0.0122 & $0.82 \pm 0.03$ & \phantom & -7.3946 & 0.0149 & $0.89 \pm 0.02$ & \phantom & $0.05 \pm 0.01$ \\ 3-48040283 & 0.0318 & -6.2235 & 0.0229 & $0.84 \pm 0.03$ & \phantom & -9.9107 & 0.0278 & $0.89 \pm 0.02$ & \phantom & $0.05 \pm 0.01$ \\ 3-48040284 & 0.0131 & -6.9531 & 0.0091 & $0.47 \pm 0.04$ & \phantom & -11.0726 & 0.0111 & $0.56 \pm 0.06$ & \phantom & $0.04 \pm 0.01$ \\ \bottomrule \end{tabular} } \caption{Empirical power for testing trivariate DBP and SBP traits and empirical type I error for testing the univariate Q1, based on simulation data in files SIMPHEN.1--SIMPHEN.200.} \label{table:map4-pvalues} \end{table} \subsection{QTL analysis of the real, 8-variate phenotype ($\text{DBP}_i, \text{SBP}_i, i=1,2,3,4$)} \label{sec:real-dbp} SBPs and DBPs measured at 4 time points are available for 1389 members from 20 extended families. The largest family contains 107 individuals; the smallest, 27. Genotypes at 8,348,674 SNPs were available on 959 of the individuals. We analyzed all SNPs and pedigrees together for the 8-variate trait ($\text{SBP}_i,\text{DBP}_i,i=1,2,3,4$). Our model includes covariates {\tt sex}, {\tt age}, {\tt BPMed}, {\tt Smoke}, and their pairwise interactions and we constrain the covariate effects to be equal across 4 time points. The log-likelihoods of the null model (no SNPs included) using the theoretical kinship, GRM within pedigrees, or GRM across all individuals are -11675.95, -11696.90, and -11698.71 respectively, indicating that the provided pedigree information captures additive genetic effects adequately. The results summarized below use the theoretical kinship matrix. To read in all the data and run standard quality control (QC) procedures took just under 5 minutes. QC excluded 10,603 SNPs and 110 individuals based on genotyping success rates below 98\%. The remaining 8,338,071 SNPs and 849 individuals are analyzed. The subsequent ped-GWAS analysis ran in 73 minutes for all results reported in Table~\ref{table:realpheno-DBP-SBP}. Because we excluded rare SNPs with low minor allele frequencies ($< 0.03$) across 849 individuals, p-values were calculated for only 3,084,046 SNPs. Accordingly the genome-wide significance threshold is $1.62 \times 10^{-8}$ or 7.79 on the $\log_{10}$ scale; the threshold for a false discovery rate (FDR) of 0.05 is $4.19 \times 10^{-8}$ or 7.38 on the $\log_{10}$ scale. Estimates for environmental effects and their interactions under the null model (no SNPs included) are listed in the top panel of Table~\ref{table:realpheno-DBP-SBP}. The middle panel displays the Manhattan and QQ plots. The genomic inflation factor of 1.023 indicates no systematic bias. One SNP passes the Bonferroni corrected genome-wide significance level, and three SNPs pass the FDR 0.05 threshold. They are listed in the bottom panel of Table~\ref{table:realpheno-DBP-SBP}. SNP 1-142617328 has a Hardy-Weinberg equilibrium (in founders) p-value less than $10^{-22}$, indicating possible genotyping error. The remaining two significant SNPs occur at 118,783,424 and 118,767,564 base pairs, respectively, on chromosome 11. Both show a MAF of 0.02778 in 413 founders. Since their MAFs in all 849 individuals are higher than 0.03, they were not removed in the filtering stage. \begin{table}[th!] \centering {\footnotesize \begin{tabular}{@{} lrr @{}} \toprule Mean effects & $\text{SBP}_1,\text{SBP}_2,\text{SBP}_3,\text{SBP}_4,$ & $\text{DBP}_1,\text{DBP}_2,\text{DBP}_3,\text{DBP}_4$ \\ \midrule $\beta_{\text{Sex}}$ & 10.21 & 4.24 \\ $\beta_{\text{Age}_i}$ & 0.32 & 0.02 \\ $\beta_{\text{BPMed}_i}$ & 3.11 & 10.07 \\ $\beta_{\text{Smoke}_i}$ & 1.53 & 1.84 \\ $\beta_{\text{Sex}_i \times \text{BPMed}_i}$ & -3.20 & -1.84 \\ $\beta_{\text{Sex}_i \times \text{Smoke}_i}$ & 0.30 & -0.73 \\ $\beta_{\text{Sex}_i \times \text{Age}_i}$ & 0.41 & 0.14 \\ $\beta_{\text{BPMed}_i \times \text{Smoke}_i}$ & 3.83 & 2.43 \\ $\beta_{\text{BPMed}_i \times \text{Age}_i}$ & 0.01 & -0.35 \\ $\beta_{\text{Smoke}_i \times \text{Age}_i}$ & -0.06 & -0.06 \\ \bottomrule \end{tabular} } $$ \begin{array}{m{3.25in}m{3.25in}} \includegraphics[width=3.25in]{manhanttan_4dbp4sbp_theoretical_kinship} & \includegraphics[width=2.75in]{qqplot_4dbp4sbp_theoretical_kinship} \end{array} $$ {\footnotesize \begin{tabular}{rrrccc} \toprule SNP & Chr. & Base Pair & MAF in founders & $-\log_{10}(\text{p-value})$ & HW p-value \\ \midrule 11-118783424 & 11 & 118,783,424 & 0.02778 & 7.84 & 0.7665 \\ 11-118767564 & 11 & 118,767,564 & 0.02778 & 7.68 & 0.7665 \\ 1-142617328 & 1 & 142,617,328 & 0.49074 & 7.38 & 0.0000 \\ \bottomrule \end{tabular} } \caption{Multivariate QTL analysis of the real, 8-variate trait ($\text{SBP}_i,\text{DBP}_i, i=1,2,3,4$) from the family data with 849 individuals and 3.1 million SNPs (after filtering). Top: estimated mean effects under the null model (no SNPs included) using the theoretical kinship matrix for the additive polygenic variance component. Middle: Manhattan plot (left) and QQ plot (right). The horizontal line represents the genome-wide significance level. Bottom: Three SNPs that pass the FDR 0.05 threshold. The top SNP, 11-118783424, also passes the genome-wide significance level. The total run time on a laptop with an Intel Core i7 2.6 GHz CPU and 16 GB RAM is {\bf 78 minutes}.} \label{table:realpheno-DBP-SBP} \end{table} \subsection{Genome-wide eQTL analysis of 20,634 expression traits} Genome-wide measures of 20,634 gene expression levels in peripheral blood mononuclear cells (PBMCs) from the first study examination are provided for 643 individuals in the family data. The formidable task of exhaustive eQTL analysis (20,634 expressions vs 8,338,071 SNPs) can be easily managed using {\sc Mendel}. We submitted 20 parallel jobs to a cluster and finished the complete analysis in about 30 hours. In all eQTL runs, SNPs and individuals with genotyping success rate $\le 0.98$ are excluded from analysis. Rare variants with MAF $\le 0.01$ in all individuals are also excluded. This leaves 641 individuals and 4,199,714 SNPs. The theoretical kinship matrix is used for the additive polygenic variance component. Our analysis includes covariates {\tt sex}, {\tt age}, {\tt BPMed}, {\tt Smoke}, and their pairwise interactions. Initialization takes about 5 minutes; the subsequent genome-wide QTL mapping of each expression trait takes about 1 to 2 minutes. The left panel of Figure~\ref{fig:eQTL-summary} displays a histogram of genomic inflation factors from 20,634 genome-wide QTL analyses. They are well-concentrated around 1 and indicate no or little systematic bias. The right panel shows the top hits that satisfy a set of stringent criteria listed in the figure caption. Note that the whole eQTL significance level is set at $0.05/20634/4199714=5.77 \times 10^{-13}$. \begin{figure}[t] \centering $$ \begin{array}{cc} \includegraphics[width=3in]{eqtl_lambda_hist} & \includegraphics[width=3in]{eqtl_hits_2D} \end{array} $$ \caption{Summary of the eQTL analysis. Left: Histogram of the genomic inflation factors $\lambda_{GC}$. Right: Top expression-SNP hits from the eQTL analysis. Each dot represents an expression-SNP association that satisfies: genomic inflation factor $\lambda_{GC}<1.1$, $\text{p-value}<5.77 \times 10^{-13}$, SNP Hardy-Weinberg test (in founders) p-value $>10^{-8}$, SNP MAF in 641 individuals $>0.01$, and the expression probe is annotated in the {\tt EXPR\_MAP.csv} file. Dot size and color vary according to their p-values on the $\log_{10}$ scale. Total run time (20,634 expressions vs 8,338,071 SNPs) on a cluster with 20 parallel jobs is about {\bf 30 hours}.} \label{fig:eQTL-summary} \end{figure} \section{Results for Unrelated Data} A second data set consists of exome sequence calls, blood pressure phenotypes at a single time point, and simulated phenotypes on a large set of unrelated individuals. Like the family data set, these individuals are Mexican Americans; however, they were independently ascertained and do not overlap with the family data set. \subsection{Size and power study using simulated traits (SIMPHEN.1--200)} \label{sec:unrel-size-power} 200 simulation replicates of the trait SBPs and DBP are provided. However, GAW19 organizers did not distribute the exact simulation details, except stating that ``The set of causal variants is somewhat different since this is exome data rather than the full sequence data that was provided last time, and so not all of the GAW18 variants, regulatory ones in particular, are present in the new dataset." This precludes a precise size and power study. For ease of comparison, we test the same 6 variants displayed in Table~\ref{table:map4-pvalues} (for family data) against the bivariate trait (SBP,DBP) for all 200 simulation replicates and report the rejection rates in Table~\ref{table:unrel-map4-pvalues}. In the model we include covariates {\tt sex}, {\tt age}, {\tt BPMed}, {\tt Smoke}, and their pairwise interactions and use the SNP-based genetic relation matrix for modeling additive polygenic inheritance. \begin{table} \centering {\footnotesize \begin{tabular}{llcc} \toprule SNP Name in Family Data & SNP Name in Unrelated Data & MAF in Unrelated Data & Rejection Rate \\ \midrule 3-47913455 & not found & \\ 3-47956424 & rs1137524 & 0.3435 & 1.00 (0.00) \\ 3-47957741 & rs138046751 & 0.0005 & 0.09 (0.02) \\ 3-47957996 & rs2230169 & 0.0229 & 1.00 (0.00) \\ 3-48040283 & rs11711953 & 0.0281 & 1.00 (0.00) \\ 3-48040284 & var\_3\_48040284 & 0.0070 & 0.12 (0.02) \\ \bottomrule \end{tabular} } \caption{Empirical rejection rates (standard errors in parenthesis) for testing 5 variants in the MAP4 gene against the bivariate (SBP,DBP) trait, based on simulation data in files SIMPHEN.1-SIMPHEN.200 for 1943 unrelated individuals. The first two columns contrast the SNP names of the same variants in the family and unrelated data respectively.} \label{table:unrel-map4-pvalues} \end{table} \subsection{QTL analysis of the real, bivariate phenotypes (DBP and SBP)} \label{sec:runrel-real-dbp} The phenotypes SBP and DBP measured at the first examination are available for 1943 unrelated American Mexicans. We analyzed all SNPs and bivariate traits (SBP, DBP). To read in all the data and run standard QC procedures took 1 minute and 16 seconds. QC excluded 10,191 SNPs and 93 individuals based on genotyping success rates below 98\%. The remaining 1,701,575 SNPs and 1,850 individuals are analyzed. The subsequent ped-GWAS analysis ran in 37 minutes and 5 seconds and included all of the results plotted in Table~\ref{table:unrel-realpheno-DBP-SBP}. Since we exclude rare variants with MAF $\le 0.01$ in all individuals, p-values were calculated for 52,314 SNPs. Accordingly, the genome-wide significance threshold is $9.56 \times 10^{-7}$ or 6.02 on the $\log_{10}$ scale. Estimated environmental effects and their interactions and variance components under the null model (no SNPs included) are listed in the top panel of Table~\ref{table:unrel-realpheno-DBP-SBP}. The bottom panel displays the Manhattan and QQ plots. The genomic inflation factor of 1.001 indicates no systematic bias. No SNPs pass the genome-wide significance level or FDR 0.05 threshold. \begin{table}[ht!] \centering {\footnotesize \begin{tabular}{@{} lrr @{}} \toprule Mean effects & SBP & DBP \\ \midrule $\mu$ & 94.87 (1.62) & 78.46 (0.95) \\ $\beta_{\text{Sex}}$ & 10.90 (1.63) & 4.62 (0.95) \\ $\beta_{\text{Age}}$ & 0.43 (0.05) & -0.13 (0.03) \\ $\beta_{\text{Sex} \times \text{Age}}$ & 0.38 (0.06) & 0.08 (0.04) \\ \midrule Var. comp. & $\boldsymbol{\Sigma}_a$ = $\begin{pmatrix} 43.15 & 17.03 \\ 17.03 & 12.07 \end{pmatrix}$ & $\boldsymbol{\Sigma}_e$ = $\begin{pmatrix} 294.88 & 113.90 \\ 113.90 & 102.61 \end{pmatrix}$ \\ \bottomrule \end{tabular} } $$ \begin{array}{m{3.25in}m{3.25in}} \includegraphics[width=3.25in]{manhanttan_unrel_sbpdbp_grmall} & \includegraphics[width=2.75in]{qqplot_unrel_sbpdbp_grmall} \\ \end{array} $$ \caption{QTL analysis of the real, bivariate (SBP, DBP) trait for 1850 unrelated individuals and 52,314 SNPs with MAF $> 0.01$. Top: Mean effects (standard errors in parenthesis) and variance components under the null model using GRM with all individuals. Bottom: Manhattan plot (left) and QQ plot (right). The horizontal line represents the genome-wide significance level; no SNPs pass this level. Total run time on a laptop with Intel Core i7 2.6 GHz CPU and 16 GB RAM is {\bf 39 minutes}.} \label{table:unrel-realpheno-DBP-SBP} \end{table} \section{Conclusions} All analyses in this article use {\sc Mendel}\ v14.3, which is freely available at \url{www.genetics.ucla.edu/software}. Pedigree GWAS (Option 29) in {\sc Mendel}\ proves to be an extremely efficient and versatile implementation for large-scale QTL analysis. Most competing programs ignore multivariate traits and outliers altogether. See \citep{Zhou13PedScore} for a side-by-side comparison with the {\sc FaST-LMM} program. Here we have emphasized {\sc Mendel}'s flexibility in specifying the global kinship matrix, adjusting for confounding, and capturing interactions. These assets, plus its raw speed, make it an ideal environment for QTL mapping. {\sc Mendel}\ continues to mature, and geneticists are advised to give it a second look for genetic analysis \citep{Lange13Mendel}. \section*{Acknowledgments} The authors gratefully acknowledge the NIH grants GM053275 and HG006139 and the NSF grant DMS-1310319.
{'timestamp': '2014-08-01T02:04:29', 'yymm': '1407', 'arxiv_id': '1407.8259', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8259'}
arxiv
\section{Introduction}\label{sec:intro} Finding shortest paths quickly is an essential part of many real-world businesses like maps services and programming of mobile GPS navigation devices. In these applications, Dijkstra's algorithm proved much too slow, especially since typical road maps contain millions of vertices and edges. However, since road maps undergo little changes, a preprocessing based approach seems reasonable. In this spirit, \citet{journal-Pel00} suggested constructing a distributed data structure in advance, allowing later distance queries to be answered in sublinear time. This distributed data structure comprises a (short) label for each vertex such that the distance between two vertices can be inferred from their respective labels. Previous work on distance labeling has been focused on finding small labels in polynomial time on a variety of graph classes~% \cite{journal-BG0 ,journal-CDV0 ,conf-GP0 ,journal-GP0 ,journal-GPPR0 ,conf-AKM01% } or on general graphs~% \cite{journal-TZ05% ,journal-GPPR04% } (see also the survey of \citet{journal-GPel03}). \citet{conf-AFGW10,conf-ADGW11} described the following preprocessing: each vertex~$v$ receives, as a label, a list of vertices~$x$ with their distance~$d(x,v)$ to~$v$ such that, for each two vertices~$u$ and~$v$, there is a vertex (the ``hub'') on a shortest $u$-$v$-path that is in both, the label of~$u$ and the label of~$v$. Once all labels have been computed, the distance between~$u$ and~$v$ is the minimum over all vertices~$x$ occurring in the intersection of the labels of~$u$ and~$v$ of the sum of $d(x,u)$ and~$d(x,v)$. In this work, we focus on the computational complexity of this preprocessing. In particular, when the goal is to minimize the overhead storage needed for the labeling, it involves solving (the optimization variant of) the following problem. \problem% {A graph~$G=(V,E)$ and an integer~$k$.} {Is there an assignment~$\ell:V\to\pot{V}$ such that~$\sum_{v\in V}|\ell(v)|\leq k$ and for all $u,v\in V$, some vertex of some shortest $u$-$v$-path in~$G$ is in $\ell(u)\cap\ell(v)$ (specifically, we allow~$u=v$, thereby requiring~$\ell$ to be reflexive)?} {\textsc{Optimal Hub Labeling}\xspace}{OHL\xspace}{def:OHL} \looseness=-1 \noindent While \citet{conf-AFGW10} conjectured that OHL\xspace is NP-hard, no hardness-proof was known to date. We present a polynomial-time reduction of the well-known \textsc{Vertex Cover}\xspace problem to OHL\xspace, thereby demonstrating its NP-hardness. Since an optimal hub-labeling can be verified by computing the lengths of all shortest paths and comparing them to the distances of each vertex to its hubs, OHL\xspace is also contained in NP, implying NP-completeness for the problem. Our work falls in line with \citet{report-BCKKW10} who proved various exact preprocessing problems NP-hard that were designed to speed up routing or distance queries. To motivate, they point out that the majority of the known results in this area are heuristic and only few results about exact computational complexity are known. \citet{journal-CHKZ03} provide an exception to this observation, proving that a preprocessing variant called \emph{2-hop cover} that is quite similar to hub labeling is NP-hard. Unfortunately, we were unable to reuse their prove to prove OHL\xspace NP-hard. \subsection{Preliminaries} \looseness=-1 Let~$G=(V,E)$ be a graph and let~$\ell:V\to\pot{V}$ be a mapping. We say that~$\ell$ \emph{covers} a shortest path~$p$ between two vertices~$u,v\in V$ \emph{with} a vertex~$x$ if~$x$ is on~$p$ and~$x\in\ell(u)\cap\ell(v)$. If~$x$ is either clear from context or unknown, then we simply say $p$ is \emph{covered by}~$\ell$. If, for each $u,v\in V$ some shortest $u$-$v$-path in~$G$ is covered by~$\ell$ (including degenerate cases where~$u=v$), then we call~$\ell$ a \emph{hub-labeling} of~$G$. When clear from context, we drop the suffix ``of~$G$''. Slightly abusing notation, we identify~$\ell$ with the set of pairs~$(x,y)$ with~$y\in\ell(x)$. Thus, the \emph{size} of~$\ell$ is~$|\{(x,y)\mid y\in\ell(x)\}|$, denoting the total number of assignments of~$\ell$. Finally, $\ell$ is said to be \emph{optimal} if no hub labeling of~$G$ is strictly smaller than~$\ell$. We use~$\ell^{-1}$ to denote~$\{(x,y)\mid (y,x)\in\ell\}$. For brevity, we abbreviate size-2 sets~$\{u,v\}$ to~$uv$ and sets~$\{1,2,\ldots,i\}$ to~$[i]$. \section{Detailed Reduction} In this section, we give the reduction of \textsc{Vertex Cover}\xspace to \textsc{Optimal Hub Labeling}\xspace, explain details, and prove its correctness. To this end, we establish a general form that optimal solutions for the created instance of OHL\xspace can be assumed to have. We show that the way in which the shortest paths are covered corresponds to a vertex cover of the input graph. \begin{const}\label{const:reduction} Let~$(G'=(V',E'),k')$ be an instance of \textsc{Vertex Cover}\xspace and let~$\gamma:=8|V'|+3|E'|+k'+2$. We construct an instance~$(G=(V,E),k)$ of OHL\xspace as follows. \begin{inparaenum}[1.] \item Add $\gamma$ new isolated vertices~$w_i$, \item add a new universal vertex~$w$, \item rename each~$v\in V'$ to~$v_1$, \item add a private neighbor~$v_2$ to each~$v_1$, and \item add a private neighbor~$v_3$ to each~$v_2$. \end{inparaenum} More formally, \begin{align*} W & := \{w_1,w_2,\ldots,w_\gamma\}\\ V & := \{w\}\cup W\cup\{v_1,v_2,v_3 \mid v\in V'\}\\ E & := \bigcup_{v\in V'}\{wv_1,v_1v_2,v_2v_3\}\cup\bigcup_{x\in W}\{wx\}\cup\bigcup_{uv\in E'}\{u_1v_1\} \end{align*} Finally, let $k := 3\gamma-1$. An example of the construction is sketched in \autoref{fig:reduction}. \end{const} \def\decorate#1#2{% \pgfmathsetmacro{\decoa}{#2+25} \pgfmathsetmacro{\decob}{#2-20} \pgfmathsetmacro{\decoc}{#2-50} \path[edge] (#1) -- ++(\decoa:0.4); \path[edge] (#1) -- ++(\decob:0.5); \path[edge] (#1) -- ++(\decoc:0.4); } \def\vertgadgettrue#1#2#3#4{% \vertgadget{#1}{#2}{#3}{#4} \decorate{u#3}{180-#4} \draw (w#3) edge[hub, bend right] (v#3); \draw (w#3) edge[hub, bend left] (u#3); \draw (v#3) edge[hub, bend right] (u#3); } \def\vertgadgetfalse#1#2#3#4{% \vertgadget{#1}{#2}{#3}{#4} \decorate{u#3}{180-#4} \draw (u#3) edge[hub, bend left] (v#3); \draw (w#3) edge[hub, bend right] (v#3); } \begin{figure}[t] \centering \subfloat[]{ \begin{tikzpicture}[scale=.6, node distance=6mm, bend angle=50] \vertgadget{0}{0}{1}{0} \vertgadgetlabeled{2}{2.8}{2}{0}{u} \vertgadget{4}{0}{3}{0} \vertgadget{8}{0}{4}{0} \draw[edge] (u1) -- (u2) -- (u3); \draw[edge] (u1) edge [bend right] (u3); \draw[edge] (u3) edge [bend right] (u4); \end{tikzpicture} \label{fig:reduction} } \hspace{15mm} \begin{tabular}[b]{c} \subfloat[]{ \begin{tikzpicture}[node distance=6mm] \vertgadgettrue{0}{0}{1}{0} \end{tikzpicture} \label{fig:vg true} }\\[10mm] \subfloat[]{ \begin{tikzpicture}[node distance=6mm] \vertgadgetfalse{0}{0}{1}{0} \end{tikzpicture} \label{fig:vg false} } \end{tabular} \caption[Example of Construction]{\autoref{fig:reduction} shows the result of \autoref{const:reduction} for $G'=$ \raisebox{-2pt}{ \resizebox{!}{12pt}{ \begin{tikzpicture}[scale=.6] \node[vertex] (a) at (7,3) {}; \node[vertex] (b) at (7.5,3.7) {} edge (a); \node[vertex] (c) at (8,3) {} edge (a) edge (b); \node[vertex] (d) at (9,3) {} edge (c); \end{tikzpicture} } }\hspace{-1.2mm}. Vertices $w$ and~$w_i$ are omitted. The closed neighborhood of any triangular vertex ($v_3$ for each~$v\in V'$) is a proper subset of the closed neighborhood of the adjacent round vertex. % \autoref{fig:vg true} and \ref{fig:vg false} show possible partial solutions $\ell_v$ (dashed arcs) for the ``vertex gadget'' of~$v\in V'$: \autoref{fig:vg true} represents choosing~$v$ for the vertex cover, \autoref{fig:vg false} represents not choosing~$v$.} \label{fig:vertex gadget} \end{figure} \looseness=-1 Given a hub labeling~$\ell$ for~$G$, for each~$v\in V'$, we define~$\ell_v:=\ell\cap\{(v_i,v_j)\mid i,j\in[3] \wedge i\ne j\}$ to denote the set of non-reflexive assignments of~$\ell$ in the vertex gadget of~$v$ and, for each~$uv\in E'$, we define~$\ell_{uv}:=\ell\cap\{(u_i,v_j),(v_j,u_i)\mid i,j\in[3]\}$ to denote the set of assignments of~$\ell$ between the vertex gadgets of~$u$ and~$v$. Note that, for each~$v\in V'$, $|\ell_v|\geq 2$ since a single assignment cannot cover the shortest paths~$(v_1,v_2)$ and~$(v_2,v_3)$ (see \autoref{fig:vg true} and \ref{fig:vg false}). Likewise, for all~$uv\in E'$, $|\ell_{uv}|\geq 3$ since, for each~$i\in [3]$ the unique shortest $u_i$-$v_i$-path in~$G$ requires a different assignment between the vertex gadgets of~$u$ and~$v$ (see \autoref{fig:edge gadget}). \begin{lemma}\label{obs:normalized} Let~$(G,k)$ be a yes-instance of OHL\xspace constructed by \autoref{const:reduction}. Then, there is an optimal hub labeling~$\ell$ for~$G$ such that \begin{compactenum}[(1)] \item\label{obs:subsets} for all~$u,v\in V$ with~$N_G[u]\subset N_G[v]$, $u\notin\ell(v)$, \item\label{obs:universals} $\ell^{-1}(w)=V$ and $\ell^{-1}(x) = \{x\}$ for all~$x\in W$, \item\label{obs:vertex internal} for all~$v\in V'$, $v_1\in\ell(v_2)\Rightarrow |\ell_v|>2$, and \item\label{obs:VC} for all~$uv\in E'$, $u_1\notin\ell(u_2) \wedge v_1\notin\ell(v_2) \Rightarrow |\ell_{uv}|>3$. \end{compactenum} We call such a hub labeling \emph{normalized}. \end{lemma} \begin{proof} Let~$\ell$ be an optimal hub labeling. For each of the properties in \autoref{obs:normalized}, we suppose that~$\ell$ has all previous properties. Then, we transform~$\ell$, in each step achieving one of the properties in \autoref{obs:normalized} without destroying any of the previous properties, or increasing the size of~$\ell$. Thus, the result is a normalized optimal hub labeling. \begin{compactdesc} \item[\eqref{obs:subsets}:] Let~$u,v\in V$ with~$N[u]\subset N[v]$, let~$z\in V\setminus\{u\}$, and assume that~$u$ is in a shortest $v$-$z$-path~$p$ of~$G$. Then, $p=(v,u,x,\ldots,z)$. However, since~$x\in N[u]$ implies~$x\in N[v]$, we know that~$p$ is not a shortest path. Thus, removing~$u$ from~$\ell(v)$ uncovers only the path~$(u,v)$, which can then be covered by adding~$v$ to~$\ell(u)$. Clearly, this modification does not destroy \eqref{obs:subsets} for any pair of vertices. \item[\eqref{obs:universals}:] By \eqref{obs:subsets}, we know that~$W\subseteq\ell^{-1}(w)$. Furthermore, each~$x\in W$ occurs only in shortest paths that end with~$x$. Since all these paths contain~$w$, we can replace $x$ with~$w$ in each assignment of~$\ell$ except for the reflexive~$(x,x)$ without loosing \eqref{obs:subsets}. % Now, since $\sum_{x\in W}3= 3\gamma>k$, there is some~$x\in W$ with~$|\ell(x)|<3$, implying~$\ell(x)=\{x,w\}$. Then, since~$\ell^{-1}(x)=\{x\}$ and all vertices in~$V$ have a shortest path to~$x$, we conclude~$\ell^{-1}(w)=V$. \item[\eqref{obs:vertex internal}] Let~$v_1\in\ell(v_2)$ for some~$v\in V'$. Then, to cover the shortest paths $(v_2,v_3)$ and $(v_1,v_2,v_3)$, $\ell_v$ contains two different assignments, each of which differs from~$(v_2,v_1)$ (see \autoref{fig:vg true}). Thus, we conclude~$|\ell_v|>2$. \item[\eqref{obs:VC}] Let~$uv\in E'$ such that~$u_1\notin\ell(u_2)$ and~$v_1\notin\ell(v_2)$. Then, for each of the following shortest paths, $\ell_{uv}$ contains a different assignment (see \autoref{fig:eg false}): $(u_1,v_1)$, $(u_2,u_1,v_1)$, $(u_1,v_1,v_2)$, $(u_2,u_1,v_1,v_2)$. Thus, we conclude~$|\ell_{uv}|>3$.\qedhere \end{compactdesc} \end{proof} \def\cellcolor{gray!20}{\cellcolor{gray!20}} \def\boldsymbol{w}{\boldsymbol{w}} Intuitively speaking, covering $(v_1,v_2)$ with~$v_1$ for some~$v\in V'$ induces more cost (by \eqref{obs:vertex internal}) and will correspond to choosing~$v$ into a vertex cover of~$G'$. However, by \eqref{obs:VC}, choosing neither~$u$ nor~$v$ for any~$uv\in E'$ also induces more cost, allowing us to just take one of $uv$ into the vertex cover instead. \begin{figure}[t] \centering \subfloat[]{ \begin{tikzpicture}[node distance=6mm] \vertgadgettrue{0}{3}{1}{0} \vertgadgettrue{0}{0}{2}{0} \draw (u1) edge (u2); \draw (u2) edge[hub,bend left] (u1); \draw (v2) edge[hub] (u1); \draw (w2) edge[hub] (u1); \end{tikzpicture} \label{fig:eg both} } \hspace{10mm} \subfloat[]{ \begin{tikzpicture}[node distance=6mm] \vertgadgettrue{0}{3}{1}{0} \vertgadgetfalse{0}{0}{2}{0} \draw (u1) edge (u2); \draw (u2) edge[hub,bend left] (u1); \draw (v2) edge[hub] (u1); \draw (w2) edge[hub] (u1); \end{tikzpicture} \label{fig:eg true} } \hspace{10mm} \subfloat[]{ \begin{tikzpicture}[node distance=6mm] \vertgadgetfalse{0}{3}{1}{0} \vertgadgetfalse{0}{0}{2}{0} \draw (u1) edge (u2); \draw (u2) edge[hub,bend left] (u1); \draw (v2) edge[hub] (v1); \draw (v2) edge[hub] (u1); \draw (v1) edge[hub] (u2); \end{tikzpicture} \label{fig:eg false} } \caption{\looseness=-1 Illustration of a gadget corresponding to some edge~$uv\in E'$ ($u$ on top, $v$ below) with a possible partial solution~$\ell_{uv}$ (dashed arcs). The figures correspond to different vertex covers of~$G$: choosing both~$u$ and~$v$ (\autoref{fig:eg both}) or choosing~$u$ but not~$v$ (\autoref{fig:eg true}). Choosing neither~$u$ nor~$v$ (\autoref{fig:eg false}) causes additional assignments in~$\ell_{uv}$, implying~$|\ell_{uv}|>3$ (see \autoref{obs:normalized}\eqref{obs:VC}).} \label{fig:edge gadget} \end{figure} \def\ensuremath{\ell_{\text{raw}}}{\ensuremath{\ell_{\text{raw}}}} \begin{lemma}\label{lem:VC is HL} Let~$X$ be a size-$k'$ vertex-cover of~$G'$. Then, there is a size-$k$ hub labeling for~$G$. \end{lemma} \begin{proof} Let~$f:E'\to V'$ be a function mapping each~$uv\in E'$ to some vertex in~$uv\cap X$. We will use $f$ to ``break ties'' between two vertices in~$X$ that are adjacent in~$G'$. Let~$\ell',\ell''$ be assignments such that (see \autoref{fig:vg true}, \ref{fig:vg false}, and \ref{fig:edge gadget}) \begin{compactenum} \item for all~$v\in X$ and~$i\in[3]$, set~$\ell'(v_i)=\{v_j\mid 1\leq j<i\}$, \item for all~$v\in V'\setminus X$, set~$\ell'(v_1)=\ell'(v_3)=\{v_2\}$ and~$\ell'(v_2)=\emptyset$, and \item for all~$uv\in E'$ with~$f(uv)=v$ and all~$i\in[3]$, set~$\ell''(u_i)=\{v_1\}$. \end{compactenum} Then, let~$\ell:=\ell'\cup\ell''\cup\{(x,x),(x,w)\mid x\in V\}$. % Since~$|X|\leq k'$, we have~ \begin{align*} |\ell'\cup\ell''| & = 3|X|+2|V'\setminus X|+3|E'|\leq 2|V'|+3|E'|+k'\text{, implying}\\ |\ell| & \leq 2|V'|+3|E'|+k'+2(3|V'|+\gamma)+1= 3\gamma-1 \end{align*} In the following, we show that all shortest paths of~$G$ are covered by~$\ell$. First, all shortest paths of length 0 are covered by~$\ell$. Second, for each~$v\in V'\setminus X$, the shortest paths~$(v_1,v_2)$, $(v_2,v_3)$, and~$(v_1,v_2,v_3)$ are covered with~$v_2$ and, for each~$v\in X$, the shortest paths~$(v_1,v_2)$ and~$(v_1,v_2,v_3)$ are covered with~$v_1$ and the shortest path~$(v_2,v_3)$ is covered with~$v_2$. Third, for each~$uv\in E'$ with $f(uv)=v$ and all~$i,j\in[3]$, the unique shortest $u_i$-$v_j$-path in~$G'$ is covered with~$v_1$. Since for each~$uv\notin E'$ and all~$i,j\in[3]$, there is a shortest $u_i$-$v_j$-path containing~$w$ and all shortest paths containing~$w$ are covered with~$w$, we conclude that~$\ell$ is indeed a hub labeling for~$G$ and its cost is at most~$3\gamma-1=k$. \end{proof} \begin{lemma}\label{lem:HL is VC} Let~$\ell$ be a normalized optimal hub labeling for~$G$ and let~$|\ell|\leq k$. Then, there is a size-$k'$ vertex cover for~$G'$. \end{lemma} \begin{proof} First, let~$\ell_1:=\{(x,x),(x,w)\mid x\in V\}$ and note that, by \autoref{obs:normalized}\eqref{obs:universals}, $\ell_1\subseteq\ell$. Then, $|\ell\setminus\ell_1|\leq 3\gamma-1 - 2\cdot(3|V'|+\gamma)-1=\gamma-6|V'|-2=2|V'|+3|E'|+k'$. To break ties, let~$f:E'\to V'$ be an arbitrary function with~$f(uv)\in uv$ for each~$uv\in E'$. Let~$X_1:=\{v \in V'\mid |\ell_v|>2\}$ and~$X_2:=\{f(uv) \in V'\mid |\ell_{uv}|>3\}$. Since, for each~$v\in V'$, we have~$|\ell_v|\geq 2$ and~$\ell_v\cap\ell_1=\emptyset$ and, for each~$uv\in E'$, we have~$|\ell_{uv}|\geq 3$, $\ell_{uv}\cap\ell_1=\emptyset$, and~$(\ell_u\cup\ell_v)\cap\ell_{uv}=\emptyset$, we conclude \begin{align*} |\ell\setminus\ell_1| & \geq \sum_{v\in V'}|\ell_v|+\sum_{uv\in E'}|\ell_{uv}|\\ & \geq 3|X_1|+2(|V'|-|X_1|)+4|X_2|+3(|E'|-|X_2|)\\ & =2|V'|+3|E'|+|X_1|+|X_2|, \end{align*} directly implying~$|X_1\cup X_2|\leq k'$. To see that~$X_1\cup X_2$ is a vertex cover for~$G'$, assume there is some~$uv\in E'$ such that~$uv\cap(X_1\cup X_2)=\emptyset$. Then, since~$u,v\notin X_1$, \autoref{obs:normalized}\eqref{obs:vertex internal} implies~$u_1\notin\ell(u_2)$ and~$v_1\notin\ell(v_2)$. But, since~$u,v\notin X_2$, \autoref{obs:normalized}\eqref{obs:VC} implies~$u_1\in\ell(u_2)$ or~$v_1\in\ell(v_2)$, a contradiction. \end{proof} With \autoref{obs:normalized}, \autoref{lem:VC is HL} and \autoref{lem:HL is VC} imply the main theorem which, since \textsc{Vertex Cover}\xspace is NP-hard on planar graphs, holds also for apex graphs. \begin{theorem} \textsc{Optimal Hub Labeling}\xspace is NP-complete, even on apex graphs. \end{theorem} \let\oldthebibliography=\thebibliography \let\endoldthebibliography=\endthebibliography \renewenvironment{thebibliography}[1]{% \begin{oldthebibliography}{#1}% \setlength{\parskip}{0ex}% \setlength{\itemsep}{0ex}% \footnotesize }{ \end{oldthebibliography}% } \bibliographystyle{abbrvnat}
{'timestamp': '2014-08-01T02:08:48', 'yymm': '1407', 'arxiv_id': '1407.8373', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8373'}
arxiv
\section{Introduction} \label{sec:introduction} Discourse parsing is the task of identifying the presence, the specific type, and possibly the hierarchical structure of discourse relations in the text. For most discourse parsers, regardless of the adopted theoretical framework, discourse segmentation, which aims to determine the boundaries of discourse units, constitutes the first stage in the pipeline workflow. Therefore, the accuracy of the discourse segmentation model is crucial to the overall performance. For parsers following Rhetorical Structure Theory (RST) \cite{Mann1988}, this first stage corresponds to segmenting the input text into non-overlapping elementary discourse units (EDUs). Previous work on EDU segmentation has demonstrated a strong correlation between the lexico-syntactic structure and the discourse boundaries. Indeed, EDUs are frequently clauses, suggesting that EDU segmentation is just a syntactic operation. However, \newcite{Carlson2001} have enumerated a number of exceptions to clause-based EDU segmentation. For example, clauses that are subjects or objects of a main verb are not EDUs. Therefore, the sentence \begin{quote} \textit{Deciding what constitutes ``terrorism'' can be a legalistic exercise.} \end{quote} consists of one single EDU, instead of two EDUs segmented before \textit{can}. So simply relying on syntactic information is not sufficient for EDU segmentation, and more sophisticated approaches need to be taken. Recent work on RST-style discourse segmentation, including \newcite{fisher-roark:2007:ACLMain} and \newcite{xuanbach-leminh-shimazu:2012:SIGDIAL2012}, report $F_1$ scores over 90\% on identifying in-sentence boundaries. However, given the importance of the segmentation model, we seek further improvement, to help reduce error propagation to downstream components. Previous attempts at RST-style discourse segmentation typically rely on token-centered features, i.e., features that describe the characteristics of a single token, possibly capturing some context via features such as $n$-grams, to determine whether an EDU boundary should be inserted before each particular token. In contrast, we hypothesize that both the preceding and following tokens should be equally taken into account when making decisions of whether a boundary should be inserted in between. Moreover, since individual decisions are interrelated, we hypothesize that it is helpful to incorporate features which encode global characteristics of the segmentation. We obtain these global features by performing a two-pass segmentation. Our experiments show that our pairing features as well as global features are useful for better EDU boundary recognition. Moreover, experimenting with two different segmentation frameworks, namely, sequential labeling based on Conditional Random Fields (CRFs), and a sequence independent binary classification using Logistic Regression (LR) and Support Vector Machines (SVMs), we show that the usefulness of our pairing and global features is observable across different frameworks and classifiers. \section{Background} \label{sec:rst} Rhetorical Structure Theory (RST) \cite{Mann1988} is probably the most widely accepted framework for discourse study. In RST, a text is represented by a hierarchical tree structure, in which leaf nodes are EDUs, and internal nodes are larger text spans constituting multiple EDUs related by specific discourse relations, e.g., \textsc{Contrast} and \textsc{Explanation}. \begin{figure} [\textbf{Then, by voice vote, the Senate voted a pork-barrel bill},]${e}_1$ [\textbf{approved Thursday by the House},]${e}_2$ [\textbf{for domestic military construction}.]${e}_3$ \begin{flushright} wsj\_0623 \end{flushright} \centering \includegraphics[width=0.9\columnwidth]{disTree-crop} \caption{An example sentence composed of three EDUs, with its RST discourse tree representation shown below.} \label{fig:exampleRSTTree} \end{figure} For example, Figure \ref{fig:exampleRSTTree} shows a text fragment with one sentence and three EDUs. EDUs are segmented by square brackets, and the RST-style discourse tree is shown below the text. $e_1$ and $e_2$ are related by an \textsc{Elaboration} relation, where $e_1$ is more salient, called the \textit{nucleus}, while $e_2$ is called the \textit{satellite}. Then, the text span $(e_1-e_2)$ is related to $e_3$ by a \textsc{Same-Unit} relation, which is a multi-nuclear relation, in the sense that the two arguments, $(e_1-e_2)$ and $e_3$, are equally salient. This paper is focused on the problem of EDU segmentation. The problem is formulated as finding proper EDU boundaries in the text, and extracting the token sequence in between two adjacent boundaries as one single EDU. These EDUs serve as the bottom-level discourse units in an RST-style discourse tree, which is the ultimate output of a discourse parser. Therefore, EDU segmentation is the first stage of RST-style discourse parsing. \section{Related Work} \label{sec:relatedWork} Conventionally, the task of automatic EDU segmentation is formulated as: given a sentence, the segmentation model identifies the boundaries of the composite EDUs by predicting whether a boundary should be inserted before each particular token in the sentence. In particular, previous work on discourse segmentation typically falls into two major frameworks. The first is to consider each token in the sentence sequentially and independently. In this framework, the segmentation model scans the sentence token by token, and uses a binary classifier, such as a support vector machine or logistic regression, to predict whether it is appropriate to insert a boundary before the token being examined. Examples following this framework include \newcite{Soricut:2003}, \newcite{subba2007automatic}, \newcite{fisher-roark:2007:ACLMain}, and \newcite{Joty:2012:NDF:2390948.2391047}. The second is to frame the task as a sequential labeling problem. In this framework, a given sentence is considered as a whole, and the model assigns a label to each token, indicating whether this token is the beginning of an EDU. Conventionally, the class label $B$ is assigned to those tokens which serve as the \textit{beginning} of an EDU, and the label $C$ is assigned to other tokens. Because EDUs cannot cross sentence boundaries, the first token in the sentence is excluded in this labeling process since it is trivially the beginning of an EDU. For example, Figure \ref{fig:labeling} illustrates this sequential labeling process. The example sentence consists of 23 tokens, separated by whitespaces, and the last 22 tokens are considered in the sequential labeling process. Each token is assigned a label, $B$ or $C$, by the labeling model. If the token is labeled as $B$, e.g., the token \textit{that} and the token \textit{to} in boldface, an EDU boundary is formed before it. Therefore, the sentence is segmented into three EDUs, indicated by the square bracket pairs. A representative work following this sequential labeling framework is \newcite{Hernault:2010:SMD:2175352.2175383}, in which the sequential labeling is implemented using Conditional Random Fields (CRFs). \begin{figure} \begin{framed} [ Some analysts are concerned , however , ] [ \textbf{that} Banco Exterior may have waited too long ] [ \textbf{to} diversify from its traditional export-related activities . ] (\textbf{wsj\_0616})\\ Label sequence: C C C C C C \textbf{B} C C C C C C C \textbf{B} C C C C C C C \end{framed} \caption{An example of a sentence with three EDUs. The tokens are separated by whitespaces and the EDUs are segmented by square brackets. The corresponding label sequence for the tokens (excluding the first token) is shown below the sentence.} \label{fig:labeling} \end{figure} An interesting exception to the above two major frameworks is \newcite{xuanbach-leminh-shimazu:2012:SIGDIAL2012}'s reranking model, which obtains the best segmentation performance reported so far: for the $B$ class, the $F_1$ score is 91.0\% and the macro-average over the $B$ and $C$ classes is 95.1\%. The idea is to train a ranking function whose input is the $N$-best output of a base segmenter and outputs a reranked ordering of these $N$ candidates. In their work, Bach et al.\@ utilized a similar CRF-based segmenter to Hernault et al.\@'s as a base segmenter. Because the reranking procedure is almost orthogonal to the implementation of the base segmenter, it is worthwhile to explore the enhancement of base segmenters for further performance improvement. With respect to base segmenters, which typically adopt the two major frameworks introduced previously, the best performance is reported by \newcite{fisher-roark:2007:ACLMain}, with an $F_1$ score of 90.5\% for recognizing in-sentence EDU boundaries (the $B$ class), using three individual feature sets: basic finite-state features, full finite-state features, and context-free features. Existing segmentation models, as introduced in the beginning of this section, have certain limitations. First, the adopted feature sets are all centered on individual tokens, such as the part-of-speech of the token, or the production rule of the highest node in the syntactic tree which the particular token is the lexical head of. Although contextual information can be partially captured via features such as $n$-grams or part-of-speech $n$-grams, the representation capacity of these contextual features might be limited. In contrast, we hypothesize that, instead of utilizing features centered on individual tokens, it is beneficial to equally take into account the information from pairs of adjacent tokens, in the sense that the elementary input unit of the segmentation model is a pair of tokens, in which each token is represented by its own set of features. Moreover, existing models never re-consider their previous segmentation decisions, in the sense that the discourse boundaries are obtained by running the segmentation algorithm only once. However, since individual decisions are interrelated, by performing a second pass of segmentation incorporating features which encode global characteristics of the segmentation, we may be able to correct some incorrect segmentations of the initial run. Therefore, in this work, we propose to overcome these two limitations by our pairing features and a two-pass segmentation procedure, to be introduced in Section \ref{sec:methodology}. \section{Methodology} \label{sec:methodology} Figure \ref{fig:segmentationCRF} shows our segmentation model in the form of a linear-chain Conditional Random Field. Each sentence is represented by a single linear chain. For each pair of adjacent tokens in a sentence, i.e., $T_{i-1}$ and $T_i$, there is an associated binary node $L_i$ to determine the label of the pair, i.e., the existence of a boundary in between: if $L_i=B$, an EDU boundary is inserted before $T_i$; if $L_i=C$, the two adjacent tokens are considered a continuous portion in an EDU. \begin{figure} \centering \includegraphics[width=\columnwidth]{CRF} \caption{Our segmentation model in the form of a linear-chain CRF. The first layer consists of token nodes $T_i$'s, $1 \leq i \leq t$, and the second layer represents the label $L_i$ of each pair of tokens $T_{i-1}$ and $T_i$.} \label{fig:segmentationCRF} \end{figure} We choose a CRF-based model to label the whole sequence of tokens in a sentence, because a CRF is capable of taking into account the sequential information in the context, and solving the problem of determining boundaries in one single pass, which has been shown to be effective by \newcite{Hernault:2010:SMD:2175352.2175383} and \newcite{xuanbach-leminh-shimazu:2012:SIGDIAL2012}. This sequential labeling framework is also beneficial to the training process, in the sense that no additional effort needs to be made to deal with the sparsity of EDU boundaries in the data, which is usually an issue for traditional binary classifiers. As introduced previously, our segmentation model differs from previous work on RST-style discourse segmentation in two important ways. First, rather than using a feature representation centered on a single token (possibly with some specifically designed features to partially incorporate contextual information), our boundary nodes take the input from a pair of adjacent tokens, to fully incorporate contextual information, allowing competition between neighboring tokens as well. Secondly, rather than producing predictions of EDU boundaries by one pass of model application, we adopt a two-pass segmentation algorithm, which works as follows. We first apply our segmentation model once for each sentence. We then perform a second pass of segmentation, by considering some \textbf{global features} (to be described in Section \ref{sec:features}) derived from the initial segmentation. The intuition behind these novel global features is that whether a given token should be tagged as an EDU boundary sometimes depends on the neighboring EDU boundaries. For example, as suggested by \newcite{Joty:2012:NDF:2390948.2391047}, since EDUs are often multi-word expressions, the distance between the current token and the neighboring boundaries can be a useful indication. In addition, it is also helpful to know whether the tokens between the current token and the neighboring boundary form a valid syntactic constituent. Since these global indicators are available only if we have an initial guess of EDU boundaries, a second pass of segmentation is necessary. Our two-pass segmentation procedure might seem similar to Bach et al.\@'s reranking, in the sense that the segmentation takes two steps to produce final predictions. However, as discussed in Section \ref{sec:relatedWork}, in Bach et al.\@'s model, the reranking stage is almost orthogonal to the base segmentation stage, while in our two-pass model, the two stages are homogeneous and can serve as an enhancement to the base segmentation stage in the reranking framework. \section{Features} \label{sec:features} As shown in Figure \ref{fig:segmentationCRF}, each boundary node $B_i$ in the linear-chain CRF takes the input of a pair of adjacent tokens, $T_i$ and $T_{i+1}$, in the sentence. Each such pair is encoded using a list of surface lexical and syntactic features, as shown in Table \ref{table:features}. The features are partitioned into three subsets: basic features, global features, and contextual features, where the basic and contextual features are applicable for both the first and second pass, and the global features are applicable for the second pass only. \begin{table}[t] \centering \begin{tabular}{p{7cm}} \toprule \multicolumn{1}{c}{\textbf{Basic features (for both passes)}}\\ \midrule The part-of-speech tag and the lemma of $T_i$ / $T_{i+1}$.\\\midrule Whether $T_i$ / $T_{i+1}$ is the beginning or the end of the sentence.\\\midrule The top syntactic tag of the largest syntactic constituent starting from or ending with $T_i$ / $T_{i+1}$.\\\midrule The depth of the largest syntactic constituent starting from or ending with $T_i$ / $T_{i+1}$.\\\midrule The top production rule of the largest syntactic constituent starting from or ending with $T_i$ / $T_{i+1}$.\\ \midrule \multicolumn{1}{c}{\textbf{Global features (for the second pass)}}\\\midrule The part-of-speech tag and the lemma of the left / right neighboring EDU boundary.\\\midrule The distance to the left / right neighboring EDU boundary.\\\midrule Number of syntactic constituents formed by the tokens between $T_i$ / $T_{i+1}$ and the left / right neighboring EDU boundary.\\\midrule The top syntactic tag of the lowest syntactic subtree that spans from $T_i$ / $T_{i+1}$ to the left / right neighboring EDU boundary.\\ \midrule \multicolumn{1}{c}{\textbf{Contextual features (for both passes)}}\\\midrule The previous and the next feature vectors.\\ \bottomrule \end{tabular} \caption{The list of features used in segmentation.} \label{table:features} \end{table} \section{Comparison with Other Models} \label{sec:comparisonWithBaselines} We first study how our proposed two-pass discourse segmenter based on pairing features performs against existing segmentation models. In this experiment, we train our linear-chain CRF models on the RST Discourse Treebank (RST-DT) \cite{Carlson2001}, which is a large discourse corpus annotated in accordance with RST. By convention, the corpus is partitioned into a training set of 347 documents and a test set of 38 documents. The detailed characteristics of the corpus are shown in Table \ref{table:characteristics}. \begin{table} \centering \begin{tabular}{lrr} \toprule & \textbf{Training} & \textbf{Test}\\ \midrule \# of documents & 347 & 38\\ \# of sentences & 7,455 & 992\\ \# of EDUs & 18,765 & 2,346\\ \# of in-sentence boundaries & 11,310 & 1,354\\ \bottomrule \end{tabular} \caption{Characteristics of the training and the test set in RST-DT.} \label{table:characteristics} \end{table} The data are preprocessed using Charniak and Johnson's reranking parser \cite{charniak-johnson:2005:ACL} to obtain syntactic structures. Our linear-chain CRFs are designed using CRFSuite \cite{CRFsuite}, which is a fast implementation of linear-chain CRFs. To apply our two-pass segmentation strategy (introduced in Section \ref{sec:methodology}), we first train our model by representing each sentence with a single linear chain, using the basic features and the contextual features as shown in Table \ref{table:features}. For both the training and the test set, we apply the trained one-pass model to obtain an initial EDU segmentation for each sentence. We then derive global features from this initial segmentation, and train our second-pass CRF model, together with the basic and the contextual features. Two evaluation methods have been used in this task: the first is to evaluate the precision, recall, and $F_1$ scores of retrieving the in-sentence boundaries (the $B$ class), which is the class that we care more about. The second is to evaluate the performance of both the two classes, $B$ and $C$, based on the macro-averaged precision, recall, and $F_1$ scores of retrieving each class. \begin{table}[t] \centering \begin{tabular}{lccc} \toprule \textbf{Model} & \textbf{Precision} & \textbf{Recall} & \textbf{$F_1$ score}\\ \midrule CRFSeg & 91.5 & 87.6 & 89.5\\\midrule SPADE & 85.4 & 84.1 & 84.7\\ S\&E & 85.6 & 86.6 & 86.1\\ Joty et al.\@ & 88.0 & \textbf{92.3} & 90.1\\ F\&R & 91.3 & 89.7 & 90.5\\\midrule Reranking & 91.5 & 90.4 & 91.0\\\midrule Ours & \textbf{92.8} & \textbf{92.3} & \textbf{92.6}\\\midrule \textit{Human} & \textit{98.5} & \textit{98.2} & \textit{98.3}\\ \bottomrule \end{tabular} \caption{Performance (\%) of our two-pass segmentation model in comparison with other baseline models and human performance, evaluated on the $B$ class.} \label{table:performanceBClass} \end{table} Table \ref{table:performanceBClass} demonstrates the performance evaluated on the $B$ class. We compare against several other segmentation models. In the first section, \textbf{CRFSeg} \cite{Hernault:2010:SMD:2175352.2175383} is a model that adopts a similar CRF-based sequential labeling framework as ours, but with no pairing and global features involved. The second section lists four previous works following the framework of independent binary classification for each token, including \textbf{SPADE} \cite{Soricut:2003}, \textbf{S\&E} \cite{subba2007automatic}, \textbf{Joty et al.}\@ \cite{Joty:2012:NDF:2390948.2391047}, and \textbf{F\&R} \cite{fisher-roark:2007:ACLMain}. The last model, \textbf{Reranking} \cite{xuanbach-leminh-shimazu:2012:SIGDIAL2012}, implements a discriminative reranking model by exploiting subtree features to rerank the $N$-best outputs of a base CRF segmenter, and obtained the best segmentation performance reported so far\footnote{The results of the baseline models in Tables \ref{table:performanceBClass} and \ref{table:performanceBCClasses} are the ones originally reported in the papers cited, not from our re-implementation.}. As can be seen, in comparison to all the baseline models, our two-pass model obtains the best performance on all three metrics across two classes. In fact, we obtain the same recall as Joty et al.\@, but our precision is noticeably higher than theirs. With respect to the $F_1$ score, our model achieves an error-rate reduction of 17.8\% over the best baseline, i.e., \textbf{Reranking}, and approaches to level of 95\% of human performance on this task\footnote{The human performance is measured by \newcite{Soricut:2003}.}. Moreover, since the reranking framework of Bach et al.\@ is almost orthogonal to our two-pass methodology, in the sense that our two-pass segmentation model can serve as a stronger base segmenter, further improvement can be expected by plugging our two-pass model into the reranking framework. \begin{table} \centering \begin{tabular}{lcccc} \toprule \textbf{Model} & \textbf{Class} & \textbf{Prec} & \textbf{Rec} & \textbf{$F_1$}\\ \midrule \multirow{3}{*}{CRFSeg} & $B$ & 91.5 & 87.6 & 89.5\\ & $C$ & 99.0 & 99.3 & 99.2\\ \cmidrule{2-5} & Macro-Avg & 95.2 & 93.5 & 94.3\\ \midrule \multirow{3}{*}{Reranking} & $B$ & 91.5 & 90.4 & 91.0\\ & $C$ & 99.3 & 99.4 & 99.2\\ \cmidrule{2-5} & Macro-Avg & 95.4 & 94.9 & 95.1\\ \midrule \multirow{3}{*}{Ours} & $B$ & \textbf{92.8} & \textbf{92.3} & \textbf{92.6}\\ & $C$ & \textbf{99.5} & \textbf{99.5} & \textbf{99.5}\\ \cmidrule{2-5} & Macro-Avg & \textbf{96.1} & \textbf{95.9} & \textbf{96.0}\\ \bottomrule \end{tabular} \caption{Performance (\%) of our two-pass segmentation model in comparison with other segmentation models and human performance, evaluated on the $B$ and $C$ classes and their macro-average.} \label{table:performanceBCClasses} \end{table} Table \ref{table:performanceBCClasses} demonstrates the performance evaluated on both classes and their macro-average. Only two baseline models, CRFSeg and Reranking, reported their performance based on this evaluation, so other models are not included in this comparison. As can be seen, among the three models considered here, our two-pass segmentation model with pairing features performs the best not only on the $B$ class but also on the $C$ class, resulting in a macro-averaged $F_1$ score of 96.0\%. \section{Error Propagation to Discourse Parsing} \label{sec:inParsing} As introduced in Section \ref{sec:introduction}, discourse segmentation is the very first stage in an RST-style discourse parser. Therefore, it is helpful to evaluate how the overall performance of discourse parsing is influenced by the results of different segmentation models. \begin{table} \begin{tabular}{llccc} \toprule Level & Segmentation & Span & Nuc & Rel\\\midrule \multirow{3}{*}{Intra} & Joty et al.\@ & 78.7 & 70.8 & 60.8\\ & Ours & \textbf{85.1} & \textbf{77.5} & \textbf{66.8}\\ \cmidrule{2-5} & Manual & 96.3 & 87.4 & 75.1\\\midrule \multirow{3}{*}{Multi} & Joty et al.\@ & \textbf{71.1} & 49.0 & 33.2\\ & Ours & \textbf{71.1} & \textbf{49.6} & \textbf{33.7}\\ \cmidrule{2-5} & Manual & 72.6 & 50.3 & 34.7\\\midrule \multirow{3}{*}{Text} & Joty et al.\@ & 75.4 & 61.7 & 49.1\\ & Ours & \textbf{78.7} & \textbf{64.8} & \textbf{51.8}\\ \cmidrule{2-5} & Manual & 85.7 & 71.0 & 58.2\\ \bottomrule \end{tabular} \caption{The result of discourse parsing using different segmentation. The performance is evaluated on intra-sentential, multi-sentential, and text level separately, using the unlabeled and labeled F-score.} \label{table:inParsing} \end{table} We use the state-of-the-art RST-style discourse parser \cite{feng-hirst:2014:ACL2014} as the target discourse parser, and feed the parser with three sets of EDUs: (1) \textbf{manual}: the gold-standard EDUs as in the annotation of RST-DT; (2) \textbf{Joty et al.}, which is the EDUs segmented using the released version of \newcite{Joty:2012:NDF:2390948.2391047}'s segmenter\footnote{The code is vailable at \url{http://alt.qcri.org/discourse/Discourse_Parser_Dist.tar.gz}. Note that, in this released version, sentence splitting is incorporated as part of the preprocessing procedure of the software. For the sake of fair comparison, to rule out the complication of different sentence splitting between their software and our own models, we modified their code to ensure all EDU segmenters are fed with the same set of sentences as input.}; and (3) \textbf{ours}: the EDUs segmented using our own model. To evaluate the performance, we use the standard unlabeled and labeled F-score for Span, Nuclearity, and Relation, as defined by \newcite{MarcuBook2000}. Moreover, to further illustrate the effect of automatic segmentation on different levels of the text, we conduct the evaluation on the intra-sentential, multi-sentential, and text level separately. On the intra-sentential level, the evaluation units are discourse subtrees which do not cross sentence boundaries. On the multi-sentential level, all discourse subtrees which span at least two sentences are considered. On the text level, all discourse subtrees are evaluated. The results are shown in Table \ref{table:inParsing}. As can be seen, on the intra-sentential level, the influence of segmentation is significant. Evaluated on Span, Nuclearity, and Relation, using our own segmentation results in a $~10$\% difference in F-score ($p <.01$ in all cases)\footnote{All significance tests are performed using the Wilcoxon signed-rank test.}, while the difference is even larger when using Joty et al.\@'s segmentation. Nonetheless, the overall parsing performance is significantly better ($p<.01$) when using our segmentation model than using Joty et al.\@'s. However, the difference between using manual and automatic segmentation almost disappears when evaluated on multi-sentential level. In fact, the absolute difference on all metrics is less than 1\% and insignificant as well. Actually, this is not a surprising finding: Most discourse constituents in an RST-style discourse parse tree conform to sentence boundaries. Moreover, the target discourse parser we adopt in this experiment takes a two-stage parsing strategy: in the first stage, sentences are processed to form sentence-level discourse subtrees, which in turn serve as the basic processing unit in the second parsing stage. Therefore, due to the nature of the RST-style discourse trees and the particular parsing algorithm in the target discourse parser, the influence of different segmentations is very much confined within sentence boundaries, and thus has little effect on higher levels of the tree. Based on the analysis, the influence of segmentation on the text level is almost entirely attributed to its influence on the intra-sentential level. \section{Feature Analysis} \label{sec:featureFrameworkAnalysis} In this section, we study the effect of our pairing and global features, the two distinct characteristics of our two-pass segmentation model, on the overall performance, and their generality across different segmentation frameworks. \subsection{Feature Ablation across Different Frameworks} First, starting from our full model, we perform a series of feature ablation experiments. In each of these experiments, we remove one of the component features or their combinations from the feature set in training, and evaluate the performance of the resulting model. \paragraph{Removing pairing features ($-p$)} By removing pairing features, our CRF-based segmentation model shown in Figure \ref{fig:segmentationCRF} reduces to the one shown in Figure \ref{fig:segmentationCRFNoPairing}, in which the input to each label node $L_i$ is a single token $T_i$, rather than a pair of adjacent tokens $T_{i-1}$ and $T_i$. Note that the first token $T_1$ is excluded in the sequence because there always exists an EDU boundary (the beginning of the sentence) before $T_1$. In accordance, the features listed in Table \ref{table:features} now reduce to features describing each single token $T_i$. \begin{figure} \centering \includegraphics[width=0.75\columnwidth]{CRF-no-pairing-crop} \caption{Our segmentation model with no pairing features. The first layer consists of token nodes $T_i$'s, and the second layer represents the label $L_i$ of the single token $T_i$, representing whether an EDU boundary exists before the token.} \label{fig:segmentationCRFNoPairing} \end{figure} \paragraph{Removing global features ($-g$)} By removing global features, our two-pass segmentation model reduces to a simple one-pass model, in which only the basic and contextual features in Table \ref{table:features} are used in training the model. \paragraph{Removing both features ($-pg$)} In this case, our model reduces to a simple one-pass model, in which only the basic and contextual features are used, and all features are based on each individual token $T_i$, rather than the token pair $T_i$ and $T_{i+1}$. Moreover, we wish to explore the generality of our pairing features and the two-pass strategy, by evaluating their effects across different segmentation frameworks. In particular, since our two-pass segmentation model itself is a CRF-based sequential labeling model, in this experiment, we also study the effect of removing pairing and global features in the framework of independent binary classification. Recall that in the framework of independent binary classification, each token (excluding $T_1$) in a sentence is examined independently in a sequence, and a binary classifier is used to predict the label for that token. Figure \ref{fig:binaryFramework} shows our models in the framework of independent binary classification. If pairing features are enabled, as shown in Figure \ref{fig:binaryPairing}, in each classification, a pair of adjacent tokens, rather than a single token, are examined, and the classifier predicts whether an EDU boundary exists in between. If pairing features are disabled, the model reduces to the one shown in Figure \ref{fig:binaryNoPairing}. In this experiment, we explore two underlying classifiers in independent binary classification: Logistic Regression (LR) and a linear-kernel Support Vector Machine (SVM). We implement these two classifiers using Scikit-learn \cite{scikit-learn}. For LR, all parameters are kept to their default values, while for SVM, we use auto class-weights, which are adjusted based on the distribution of different classes in the training data, to overcome the sparsity of class $B$ in the dataset. \begin{figure} \centering \begin{subfigure}[b]{0.45\columnwidth} \centering \includegraphics[scale=0.4]{Binary-crop} \caption{With pairing features.} \label{fig:binaryPairing} \end{subfigure} ~ \begin{subfigure}[b]{0.45\columnwidth} \centering \includegraphics[scale=0.4]{Binary-no-pairing-crop} \caption{No pairing features.} \label{fig:binaryNoPairing} \end{subfigure} \caption{Our segmentation model in the framework of independent binary classification.} \label{fig:binaryFramework} \end{figure} \begin{table} \centering \begin{tabular}{lccc} \toprule \textbf{Model} & \textbf{Precision} & \textbf{Recall} & \textbf{$F_1$ score}\\ \midrule CRF & 92.8 & 92.3 & 92.6\\ LR & \textbf{92.9} & 92.2 & 92.5\\ SVM & 92.6 & \textbf{92.8} & \textbf{92.7}\\ \midrule CRF${}^{-p}$ & 91.3 & 91.1 & 91.2\\ LR${}^{-p}$ & 91.0 & 90.5 & 90.7\\ SVM${}^{-p}$ & 90.4 & 92.5 & 91.4\\ \midrule CRF${}^{-g}$ & 92.5 & 91.0 & 91.7\\ LR${}^{-g}$ & 91.7 & 91.0 & 91.3\\ SVM${}^{-g}$ & 84.7 & 94.7 & 89.4\\ \midrule CRF${}^{-pg}$ & 87.0 & 82.5 & 84.7\\ LR${}^{-pg}$ & 86.9 & 83.0 & 84.9\\ SVM${}^{-pg}$ & 70.5 & 94.6 & 80.8\\ \bottomrule \end{tabular} \caption{The effect of removing pairing features ($-p$), removing global features ($-g$), and removing both ($-pg$), in comparison with the full model in the first section, across different segmentation frameworks. CRF stands for our standard two-pass segmentation models based on linear-chain CRFs, while LR and SVM stand for two different classifiers in the framework of independent binary classification.} \label{table:featureFrameworkAnalysis} \end{table} Table \ref{table:featureFrameworkAnalysis} demonstrates the results of our feature analysis. The first section lists the performance of our full model in different segmentation frameworks. As can be seen, our full models perform similarly across different frameworks, where the absolute difference in $F_1$ is less than 0.2\% and insignificant. This is consistent with \newcite{Hernault:2010:SMD:2175352.2175383}'s finding that, when a large number of contextual features are incorporated, binary classifiers such as SVM can achieve competitive performance with CRFs. The second section lists the performance of our models with no pairing features ($-p$). For all three resulting models, CRF${}^{-p}$, LR${}^{-p}$, and SVM${}^{-p}$, their performance is significantly poorer ($p < .01$) than their corresponding full model in the first section. A similar trend is observed when global features are removed ($-g$) in the third section. However, with respect to the underlying frameworks themselves, SVM is significantly worse than CRF and LR ($p < .01$), while such a significant difference is not observable when pairing features are removed. Finally, when both sets of features are removed ($-pg$), as shown in the last section, the performance of our models drops drastically (from above 90\% to below 85\%). This suggests that the pairing and global features, which have an important effect on the performance by themselves, are even more important in their combination. In this experiment, we demonstrate that the pairing features and the global features have individual effect in improving the overall segmentation performance, and such an improvement is significant. Moreover, we observe similar effects across different frameworks, which suggests the generality of these two novel aspects of our segmentation model. \subsection{Error Analysis} \label{subsec:errorAnalysis} \begin{table} \centering \begin{tabular}{lrrrr} \toprule & & \multicolumn{2}{c}{CRF}\\ \cmidrule{3-4} & & $\neg$\textbf{Error} & \textbf{Error} & \textbf{Total}\\ \cmidrule{3-5} \multirow{2}{*}{CRF${}^{-p}$} & $\neg$\textbf{Error} & 20357 & 52 & 20409\\ & \textbf{Error} & 100 & 149 & 249\\ \cmidrule{2-5} & \textbf{Total} & 20457 & 201 & 20658\\ \midrule\midrule & & \multicolumn{2}{c}{CRF}\\ \cmidrule{3-4} & & $\neg$\textbf{Error} & \textbf{Error} & \textbf{Total}\\ \cmidrule{3-5} \multirow{2}{*}{CRF${}^{-g}$} & $\neg$\textbf{Error} & 20436 & 0 & 20436\\ & \textbf{Error} & 21 & 201 & 222\\ \cmidrule{2-5} & \textbf{Total} & 20457 & 201 & 20658\\ \midrule\midrule & & \multicolumn{2}{c}{CRF${}^{-p}$}\\ \cmidrule{3-4} & & $\neg$\textbf{Error} & \textbf{Error} & \textbf{Total}\\ \cmidrule{3-5} \multirow{2}{*}{CRF${}^{-g}$} & $\neg$\textbf{Error} & 20339 & 97 & 20436\\ & \textbf{Error} & 70 & 152 & 222\\ \cmidrule{2-5} & \textbf{Total} & 20409 & 249 & 20658\\ \bottomrule \end{tabular} \caption{Comparisons of error between our CRF-based segmentation models with different feature settings.} \label{table:errorAnalysis} \end{table} \begin{figure*} \begin{framed} [ `` Oh , I bet ] [ it 'll be up 50 points on Monday , '' ] [ said Lucy Crump , a 78-year-old retired housewife in Lexington , Ky. ] (\textbf{CRF})\\ [ `` Oh , ] [ I bet ] [ it 'll be up 50 points on Monday , '' ] [ said Lucy Crump , a 78-year-old retired housewife in Lexington , Ky. ] (\textbf{CRF${}^{-p}$}) \end{framed} \begin{framed} [ They argue ] [ that the rights of RICO defendants and third parties ] [ not named in RICO indictments ] [ have been unfairly damaged . ] (\textbf{CRF})\\ [ They argue ] [ that the rights of RICO defendants and third parties ] [ not named in RICO \mbox{indictments} have been unfairly damaged . ] (\textbf{CRF${}^{-g}$}) \end{framed} \caption{Example sentences where the full model (\textbf{CRF}) is correct while the weaker model, (\textbf{CRF${}^{-p}$}) or (\textbf{CRF${}^{-g}$}), makes mistakes.} \label{fig:exampleErrors} \end{figure*} We now conduct a token-by-token error analysis to study the distributions of the errors made by our CRF-based models with different feature settings. In particular, we evaluate the labeling errors made on each token in the test set by our fully-fledged two-pass segmentation model or the models trained with pairing or global features removed. Here, we restrict our comparisons to models following the sequential labeling framework, i.e., the CRF-based models with $-p$ or $-g$ superscript in Table \ref{table:featureFrameworkAnalysis}. Once again, all tokens which are the beginning of the sentence are not included in this analysis. The results are shown in Table \ref{table:errorAnalysis}. One interesting observation is that, as demonstrated in the second section of the table, on top of CRF${}^{-g}$, by adding global features, our full model is able to correct the 21 errors made by CRF${}^{-g}$ while introducing no additional errors in the process. In addition, as illustrated in the third section of the table, pairing and global features are almost complementary to each other, in the sense that the 39\% of the errors made by CRF${}^{-p}$ occur on cases where CRF${}^{-g}$ is correct, and reciprocally, 32\% of errors made by CRF${}^{-g}$ happen on cases where CRF${}^{-p}$ is correct. Finally, in Figure \ref{fig:exampleErrors}, we show some example sentences, which our fully-fledged two-pass segmentation model labels correctly, while the weaker models make some errors. \section{Conclusion and Future Work} \label{sec:conclusions} In this paper, we developed a two-pass RST-style discourse segmentation model based on linear-chain CRFs. In contrast to the typical approach to EDU segmentation, which relies on token-centered features in modeling, the features in our segmenter are centered on pairs of tokens, to equally take into account the information from the previous and the following token surrounding a potential EDU boundary position. Moreover, we propose a novel two-pass segmentation strategy. After the initial pass of segmentation, we obtain a set of global features to characterize the segmentation result in a whole, which are considered in the second pass for better segmentation. Comparing with several existing discourse segmentation models, we achieved the best performance on identifying both the boundaries and non-boundaries. Moreover, we studied the effect of our novel pairing and global features, and demonstrated that these two sets of features are both important to the overall performance, and such importance is observable across different segmentation frameworks and classifiers. Finally, we experimented with our segmentation model as a plug-in in the state-of-the-art RST-style text-level discourse parser \cite{feng-hirst:2014:ACL2014} and evaluated its influence to the overall parsing accuracy. We found that the automatic segmentation has a huge influence on the parsing accuracy, when evaluated on intra-sentential level; however, such an influence is very minor on multi-sentential level. For future work, we wish to explore the incorporation of our two-pass segmentation model into the reranking framework of \newcite{xuanbach-leminh-shimazu:2012:SIGDIAL2012}. Since our model is shown to be a stronger base segmenter, with the reranking procedure, further improvement in segmentation accuracy may be expected. \section*{Acknowledgments} This work was financially supported by the Natural Sciences and Engineering Research Council of Canada and by the University of Toronto. \bibliographystyle{acl}
{'timestamp': '2014-08-01T02:01:20', 'yymm': '1407', 'arxiv_id': '1407.8215', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8215'}
arxiv
\section{Computational details for the flu application} \section{Imputing principal strata membership, potential outcomes, and $ITT$ effects}\label{app:postmis} The full conditional distribution of principal strata membership is given by \begin{align} \Pr(S_i=a\mid Y_i=y, T_i=t, Z_i=z, X_i=x, \phi, \theta) &\propto \pi_A(x)\gamma_{a}^{11}(x)^{y}(1-\gamma_{a}^{11}(x))^{1-y}\mathbb{1}(Z_i=T_i=1)\\ \Pr(S_i=n\mid Y_i=y, T_i=t, Z_i=z, X_i=x, \phi, \theta) &\propto \pi_N(x)\gamma_{n}^{00}(x)^{y}(1-\gamma_{n}^{00}(x))^{1-y}\mathbb{1}(Z_i=T_i=0)\\ \Pr(S_i=c\mid Y_i=y, T_i=t, Z_i=z, X_i=x, \phi, \theta) &\propto \pi_C(x)\gamma_{c}^{tz}(x)^{y}(1-\gamma_{c}^{tz}(x))^{1-y}\mathbb{1}(Z_i=T_i) \end{align} Note that observations with $Z_i=1, T_i=0$ ($Z_i=0,\ T_i=1)$ are never takers (always takers) with probability one, and observations with $T_i=Z_i=1$ ($T_i=Z_i=0$) are either compliers or always takers (never takers). Finally, given an observation's PS membership, the missing potential outcome is sampled from its full conditional, which is just \[ \Pr(Y_i(t, 1-z)=1\mid T_i=t, Z_i=z, X_i=x, S_i=s, \phi, \theta) = \gamma_s^{t(1-z)}(x) . \] The $ITT$ effects can be computed from the completed data using the following alternative expressions: \begin{align} ITT_c &= \frac{ \sum_{i=1}^n \mathbb{1}(S_i=c)[Z_i\{Y_i-Y_i(0,0)\}+ (1-Z_i)\{Y_i(1,1) - Y_i\}] }{ \sum_{i=1}^n \mathbb{1}(S_i=c) }\\ ITT_n &= \frac{ \sum_{i=1}^n \mathbb{1}(S_i=n)[Z_i\{Y_i-Y_i(0,0)\}+ (1-Z_i)\{Y_i(0,1) - Y_i\}] }{ \sum_{i=1}^n \mathbb{1}(S_i=n) }\\ ITT_c &= \frac{ \sum_{i=1}^n \mathbb{1}(S_i=a)[Z_i\{Y_i-Y_i(1,0)\}+ (1-Z_i)\{Y_i(1,1) - Y_i\}] }{ \sum_{i=1}^n \mathbb{1}(S_i=a) } \end{align} \subsection{Causal Inference in a Binary Instrumental Variables Model} Let $Z_i, T_i$, and $Y_i$ be the observed values of the treatment assignment (or encouragement, or instrument), treatment received, and outcome for observation $i$, respectively. Let $X_i$ be a vector of baseline covariates. In the flu data, $Z_i=1$ if encouragement (the reminder) was administered, $T_i=1$ if the vaccine was administered, and $Y_i=1$ if the patient was \emph{not} hospitalized. As in \cite{Angrist1996} and \cite{Hirano2000} define the \emph{potential outcomes} $T_i(z)$ and $ Y_i(t,z)$ as the treatment assignment that would have been observed had we fixed $Z_i=z$ and the outcome we would have observed fixing $T_i=t, Z_i=z$, respectively. We will suppress indexing by $i$ for population quantities. We make the stable unit treatment value assumption (SUTVA) \citep{Angrist1996}, i.e. that there is no interference between units and no alternative versions of treatment. \footnote{\cite{Hirano2000} point out that in an infectious disease application with individuals as the unit of randomization this assumption is unlikely to hold exactly, but constitutes a reasonable first order approximation.} Mathematically, SUTVA implies that $T_i(\mathbf{z})=T_i(z_i)$ and $Y_i(\mathbf{t}, \mathbf{z})=Y_i(t_i, z_i)$, where $\mathbf{z}, \mathbf{t}$ are vectors of instrument/encouragement assignment and treatments received (respectively) for the entire sample. In this application the complete vector of binary response variables is \begin{equation} U_i=(T_i(0), T_i(1), Y_i(0,0), Y_i(0,1), Y_i(1,0), Y_i(1,1))', \end{equation} the collection of treatments and outcomes under all possible experimental conditions. However, we observe only $T_i\equiv T_i(Z_i)$ and $Y_i\equiv Y_i(T_i(Z_i), Z_i)$, where $Z_i$ is randomly assigned at the study outset. We can define compliance types or principal strata $S$ based on the possible values for $(T(1), T(0))$ -- see Table \ref{tab:comptype}. \begin{table} \begin{center} \begin{tabular}{cc|ll} $T(1)$ & $T(0)$ & $S$ (Compliance Type) & ~ \\ \hline 0 & 0 & Never Taker & (n) \\ 1 & 1 & Always Taker & (a) \\ 1 & 0 & Complier & (c) \\ 0 & 1 & Defier & (d) \\ \end{tabular} \caption{Compliance types, or principal strata, defined by response patterns across levels of $Z$.} \label{tab:comptype} \end{center} \end{table} We will assume that the encouragement $Z$ is ignorable or randomly assigned (as it is in the flu data). We also assume that there are no defiers (``monotonicity of compliance"), i.e., $ \Pr(S=d\mid \mathbf{X})=0$. In the current setting a defier would be a patient who would \emph{only} receive the vaccine if the reminder was \emph{not} administered, which is quite unlikely. Let $\pi_s(x) = \Pr(S=s\mid \mathbf{X})$ and $\gamma^{tz}_s(x) = \Pr( Y(t,z)=1\mid S=s, \mathbf{X})$ denote the principal strata and potential outcome probability models. Under the above assumptions the potential outcome and principal strata distributions are linked to the joint distribution of observables by the following equations. \begin{align} \Pr(T=1\mid Z=0, \mathbf{X}) &= \pi_a(\mathbf{X})\label{eq:mon-1},\\ \Pr(T=1\mid Z=1, \mathbf{X}) &= \pi_c(\mathbf{X}) + \pi_a(\mathbf{X})\label{eq:mon-2},\\ \Pr(Y=1\mid T=0, Z=0, \mathbf{X}) &= [\pi_c(\mathbf{X})\gamma^{00}_c(\mathbf{X}) + \pi_n(\mathbf{X})\gamma^{00}_n(\mathbf{X})]/[\pi_c(\mathbf{X}) + \pi_n(\mathbf{X})]\label{eq:mon-3},\\ \Pr(Y=1\mid T=1, Z=1, \mathbf{X}) &= [\pi_c(\mathbf{X})\gamma^{11}_c(\mathbf{X}) + \pi_a(\mathbf{X})\gamma^{11}_a(\mathbf{X})]/[\pi_c(\mathbf{X}) + \pi_a(\mathbf{X})]\label{eq:mon-4},\\ \Pr(Y=1\mid T=0, Z=1, \mathbf{X}) &= \gamma^{01}_n(\mathbf{X}),\\ \Pr(Y=1\mid T=1, Z=0, \mathbf{X}) &= \gamma^{10}_a(\mathbf{X})\label{eq:mon-last}. \end{align} \cite{Richardson2010} derive this mixture relationship between principal strata/potential outcome distributions and the observable joint in detail under a range of assumptions about the latent variables (see also \cite{Imbens1997a} and \cite{Richardson2011}). The probabilities on the left hand side completely determine the joint distribution of observables ($Y$ and $T$ given $Z$) and hence constitute a basis for $\phi$. Clearly $\pi$, $\gamma^{01}_n$ and $\gamma^{10}_a$ are one-to-one maps from $\phi$, and are point identified as well. However, $\gamma^{00}_c,\ \gamma^{00}_n,\ \gamma^{11}_c,$ and $ \gamma^{11}_a$ are not. For example, at any point in covariate space $\gamma^{11}_c(x)$ and $\gamma^{11}_a(x)$ must lie on the line segment given by the intersection of the line in equation \eqref{eq:mon-4} and $[0,1]\times [0,1]$, but the data are wholly uninformative about their position on that line segment. In particular, the range of $\gamma^{11}_a(x)$ is \begin{equation} \left( \min\left( 0, \frac{\pi_a(x)+\pi_c(x)}{\pi_a(x)}p_{1\mid 11}(x) - \frac{\pi_c(x)}{\pi_a(x)} \right),\, \max\left( 1, \frac{\pi_a(x)+\pi_c(x)}{\pi_a(x)}p_{1\mid 11}(x) \right) \right)\label{eq:gbound} \end{equation} where $p_{1\mid 11}(x) = \Pr(Y=1\mid T=1, Z=1,\mathbf{X})$. The situation is exactly the same for $\gamma^{00}_c(x)$ and $\gamma^{00}_n(x)$, with the line given by \eqref{eq:mon-3} and bounds similar to \eqref{eq:gbound} (large sample bounds on causal effects within principal strata were introduced by \cite{zhang2003estimation}; see \cite{Richardson2011} for bounds under monotonicity and other assumptions, as well as further references). Point identification for the remaining parameters is often obtained through further assumptions on the distribution of the potential outcomes. The \emph{stochastic exclusion restriction} for compliance type $s$ posits that there is no direct effect of $Z$ on $Y$; that is, $\gamma^{i0}_s = \gamma^{i1}_s$ for $i=0,1$ \citep{Hirano2000}. From \eqref{eq:mon-1}-\eqref{eq:mon-last} it is clear that this achieves point identification for the entire distribution of the potential outcomes. \cite{Hirano2000} anticipated failures of the exclusion restrictions, noting that a reminder about flu shots might also prompt physicians to counsel patients about other preventative measures to avoid contracting the flu. They propose relaxing the exclusion restrictions and resolving the resulting nonidentifiability through prior probability modeling. In this sense our approach and theirs are philosophically similar, but our framework affords us significant flexibility in choosing the model for $\phi$ while transparently embedding prior information about $\theta$, which is difficult to do in their modeling setup. In our subsequent analysis we will avoid imposing any exclusion restrictions. \subsection{Model Specification} Our model for observables decomposes into a treatment model and an outcome given treatment model, i.e., $P(Y,T\mid Z, \mathbf{X}) = P(T\mid Z, \mathbf{X})P(Y \mid T, Z, \mathbf{X})$. We assign each of these a probit BART prior. For the treatment model, randomization of treatment assignment and monotonicity of compliance imply that $\Pr(T=1\mid Z=1, \mathbf{X}) \geq \Pr(T=1\mid Z=0, \mathbf{X})$ for all $\mathbf{X}$ (see equations \eqref{eq:mon-1} and \eqref{eq:mon-2}). We enforce this constraint by rejecting samples from BART where this condition fails at any point in covariate space. More elaborate approaches to enforcing monotonicity are possible but beyond the scope of the present paper. \subsubsection{Partially identified parameters} Recall that we have two pairs of unidentified parameters, $(\gamma^{00}_c, \gamma^{00}_n)$ and $(\gamma^{11}_c,\gamma^{11}_a)$. Fixing one element of each pair would solve the identification problem, so we can take $\theta = (\gamma^{00}_n,\gamma^{11}_a)$ without loss of generality. This is in contrast to \cite{Hirano2000}, who specify a strongly parametric probability model for all four of the unidentified parameters. We consider three priors on $\theta$. All three are of the form \begin{equation} (\mbox{logit}\{\gamma^{00}_n(\mathbf{X})\}, \mbox{logit}\{\gamma^{11}_a(\mathbf{X})\})' = \mu\{\phi(\mathbf{X})\} + h(\mathbf{X})\beta + \epsilon(x)\label{eq:theta-3}. \end{equation} with $\mu(\phi(\mathbf{X})) = (\mbox{logit}\{\gamma^{01}_n(\mathbf{X})\}, \mbox{logit}\{\gamma^{10}_a(\mathbf{X})\})'$, $h(\mathbf{X})=1$ and $\beta=(b_a, -b_n)$. This centers our prior at a proportional odds model, where the reminder increases the odds of a positive outcome by a factor of $\exp(b_a)$ or $\exp(b_n)$ in always or never takers (respectively) at any covariate value. A natural way to complete this prior is to take $b_s\sim N(0, \sigma_s^2)$ for $s=a,n$ which centers the prior at the exclusion restrictions and expresses prior beliefs about plausible effect sizes through $\sigma_s^2$. For illustration we take $\sigma_s=0.1$ or $0.25$ for the current application. \cite{Hirano2000} estimate principal strata-independent total effects of COPD around -0.35 on the log odds scale, so the more diffuse prior covers a plausible range of possible effect sizes for the direct effect of a reminder within non-compliers. We would expect any direct beneficial effect of the reminder on the subsequent hospitalization to be smaller than the detrimental effect of a serious chronic disease like COPD purely on substantive grounds. In the flu application we also have some prior information about likely effect directions, which we can also incorporate in the prior. Any direct effect from the reminder is most likely to be positive, since the reminder probably encourages doctors and patients to take other preventative measures beyond the vaccine. Additionally, \cite{Hirano2000} speculate that the exclusion restriction for never takers is more plausible than for always takers since perceived risk is a key driver of compliance behavior, with low-risk patients more likely to be never takers. A more nuanced view is that the direct effect should be \emph{larger} for always takers than never takers --- even though never takers probably have lower risk on average, we should not rule out the possibility of high-risk never takers who refuse the vaccine due to cost, safety or other concerns. A prior for $\theta$ that reflects these beliefs is $(b_a, b_n)\sim \mbox{{\small\textsc{N}}}(b_0, \Sigma_b)\mathbb{1}(b_a>0, b_n>0)$. For the analysis in the sequel we will take $b_0 = (0.05, 0.0)'$, $\Sigma_b = \mbox{diag}(0.13^2, 0.05^2)$. In additional simulations we find that results are insensitive to plausible values of $\mbox{Cov}(b_a, b_n)$. These particular numerical values were chosen The prior mode is $b_0$, the prior mean is about $(0.125, 0.04)$, and the marginal $90^{th}$ percentile is about 0.25 for $b_a$ and 0.08 for $b_n$. The prior scale for $b_a$ is calibrated so that (with high probability) $b_a$ is smaller in magnitude than the effect of COPD on the hospitalization as reported by \cite{Hirano2000} (the posterior mean was generally around -0.35, SD 0.15). We will call this the ``informed" prior. For all three priors we set $v=0.025$. \subsection{Results} We fit the model described in the previous section to the flu vaccine data, using age and COPD as covariates. Figure \ref{fig:psmembership} shows the probability of belonging to each principal stratum as a function of age and COPD along with marginal 90\% credible intervals. We find a fairly sharp break in compliance behavior at age 65 (the probability of being a never-taker drops, and seems to be shifted largely to always takers), which appears to hold regardless of COPD status. Possible explanations include patients or providers giving more weight to age-based vaccination guidelines, or better insurance coverage and increased access to services in the older cohort. Figure \ref{fig:outcometz} shows the outcome distributions by age, COPD, and the treatment assigned and received. There is clear evidence of an age/COPD interaction; this is due at least in part to the study design, where all participants under 65 have at least one chronic disease (possibly COPD). This also means that the 65+ population is on average less likely to he hospitalized than the younger cohort, explaining the seemingly paradoxical decrease in the estimated probability of hospitalization at age 65 in the ``No COPD" group. \begin{figure} \begin{center} \includegraphics[width=5in]{flu-figure/PSMembershipTrunc.pdf} \caption{Principal strata memberhsip probabilities by age and COPD, including marginal 90\% credible intervals}\label{fig:psmembership} \end{center} \end{figure} \begin{figure} \begin{center} \includegraphics[width=3.5in]{flu-figure/OutcomeByTZ.pdf} \caption{Log odds of a positive outcome (no hospitalization) by age, COPD, and treatment assignment/receipt}\label{fig:outcometz} \end{center} \end{figure} \subsubsection{Causal effects} We are primarily interested in (partially identified) sample causal effects. As in \cite{Hirano2000} we will consider estimating the intention-to-treat (ITT) effect in each principal stratum: \begin{equation} ITT_s = \frac{1}{n_s}\sum_{i: S_i=s} (Y_i(T_i(1), 1) - Y_i(T_i(0), 0)). \end{equation} where $n_s$ is the number of observations with compliance type $S$. Given a sample from the marginal distribution for $\phi$, and a sample from $\theta$, we can impute each observation's missing principal strata membership and the unobserved potential outcome. With the completed data it is straightforward to compute the sample ITT effects. Computational details are provided in Appendix \ref{app:postmis} We compare results under our three priors to three models from \cite{Hirano2000}: the model with no exclusion restrictions (``none"), both exclusion restrictions (``both"), or the never-taker exclusion restriction (``n"). The ``Hirano (none)" model has very wide standard deviations, which are driven by their use of diffuse, ``off-the-shelf" priors. Their marginal prior for the direct effect of the reminder is approximately normal with mean zero and standard deviation 1.5, which puts significant prior probability on implausible values such as large and/or negative direct effects. Such vague priors are inappropriate for partially identified parameters. In contrast, the BART models all give similar results. The ``BART (0.1)" and ``BART (0.25)" models differ mainly in the width of the posterior standard errors, and then only slightly. The ``BART (0.25)" model assumes that with high probability the magnitude of any direct effect on the log odds is within $\pm 0.5$ -- compare this to the COPD effect, which is estimated to increase the log odds of hospitalization by about 0.35. The ``informed" prior restricts the population effects to be positive but small, which tends to shrink the $ITT_c$ effect toward zero -- the overall $ITT$ effect is identified, so positive effects in the other principal strata lead necessarily to smaller $ITT_c$ estimates than unrestricted models. The substantive conclusion is largely unchanged: there is only modest evidence for the effectiveness of the vaccine, particularly if we assume the direct effect of the reminder is similar in always-takers and compliers. This is unsurprising given the sample size of $n=2,861$, weakness of the encouragement (Fig. \ref{fig:psmembership}), and relative rarity of the outcome (about 8\% of the study participants were hospitalized). However, unlike \cite{Hirano2000} we conclude that the $ITT_c$ effect is actually fairly robust to plausible deviations from the exclusion restrictions. \begin{figure} \begin{center} \includegraphics[width=5.25in]{flu-figure/flures.pdf} \caption{Posterior mean and standard deviations for the sample ITT effects in each principal stratum. ``BART (0.1)" and ``BART (0.25)" use the conditional prior centered at the exclusion restrictions with $\sigma_a=\sigma_n=0.1$ or $0.25$, respectively. ``BART (informed)" includes all prior information. The ``Hirano" models are from \cite{Hirano2000}; the ``n" model assumes the exclusion restriction in never-takers, the ``both" model imposes both exclusion restrictions and the ``none" model has no exclusion restrictions.}\label{fig:flures} \end{center} \end{figure} \subsection{Causal Inference in a Binary Instrumental Variables Model} Let $Z_i, T_i$, and $Y_i$ be the observed values of the treatment assignment (or encouragement, or instrument), treatment received, and outcome for observation $i$, respectively. Let $X_i$ be a vector of baseline covariates. In the flu data, $Z_i=1$ if encouragement (the reminder) was administered, $T_i=1$ if the vaccine was administered, and $Y_i=1$ if the patient was \emph{not} hospitalized. As in \cite{Angrist1996} and \cite{Hirano2000} define the \emph{potential outcomes} $T_i(z)$ and $ Y_i(t,z)$ as the treatment assignment that would have been observed had we fixed $Z_i=z$ and the outcome we would have observed fixing $T_i=t, Z_i=z$, respectively. We will suppress indexing by $i$ for population quantities. We make the stable unit treatment value assumption (SUTVA) \citep{Angrist1996}, i.e. that there is no interference between units and no alternative versions of treatment. \footnote{\cite{Hirano2000} point out that in an infectious disease application with individuals as the unit of randomization this assumption is unlikely to hold exactly, but constitutes a reasonable first order approximation.} Mathematically, SUTVA implies that $T_i(\mathbf{z})=T_i(z_i)$ and $Y_i(\mathbf{t}, \mathbf{z})=Y_i(t_i, z_i)$, where $\mathbf{z}, \mathbf{t}$ are vectors of instrument/encouragement assignment and treatments received (respectively) for the entire sample. In this application the complete vector of binary response variables is \begin{equation} U_i=(T_i(0), T_i(1), Y_i(0,0), Y_i(0,1), Y_i(1,0), Y_i(1,1))', \end{equation} the collection of treatments and outcomes under all possible experimental conditions. However, we observe only $T_i\equiv T_i(Z_i)$ and $Y_i\equiv Y_i(T_i(Z_i), Z_i)$, where $Z_i$ is randomly assigned at the study outset. We can define compliance types or principal strata $S$ based on the possible values for $(T(1), T(0))$ -- see Table \ref{tab:comptype}. \begin{table} \begin{center} \begin{tabular}{cc|ll} $T(1)$ & $T(0)$ & $S$ (Compliance Type) & ~ \\ \hline 0 & 0 & Never Taker & (n) \\ 1 & 1 & Always Taker & (a) \\ 1 & 0 & Complier & (c) \\ 0 & 1 & Defier & (d) \\ \end{tabular} \caption{Compliance types, or principal strata, defined by response patterns across levels of $Z$.} \label{tab:comptype} \end{center} \end{table} We will assume that the encouragement $Z$ is ignorable or randomly assigned (as it is in the flu data). We also assume that there are no defiers (``monotonicity of compliance"), i.e., $ \Pr(S=d\mid \mathbf{X})=0$. In the current setting a defier would be a patient who would \emph{only} receive the vaccine if the reminder was \emph{not} administered, which is quite unlikely. Let $\pi_s(x) = \Pr(S=s\mid \mathbf{X})$ and $\gamma^{tz}_s(x) = \Pr( Y(t,z)=1\mid S=s, \mathbf{X})$ denote the principal strata and potential outcome probability models. Under the above assumptions the potential outcome and principal strata distributions are linked to the joint distribution of observables by the following equations. \begin{align} \Pr(T=1\mid Z=0, \mathbf{X}) &= \pi_a(\mathbf{X})\label{eq:mon-1},\\ \Pr(T=1\mid Z=1, \mathbf{X}) &= \pi_c(\mathbf{X}) + \pi_a(\mathbf{X})\label{eq:mon-2},\\ \Pr(Y=1\mid T=0, Z=0, \mathbf{X}) &= [\pi_c(\mathbf{X})\gamma^{00}_c(\mathbf{X}) + \pi_n(\mathbf{X})\gamma^{00}_n(\mathbf{X})]/[\pi_c(\mathbf{X}) + \pi_n(\mathbf{X})]\label{eq:mon-3},\\ \Pr(Y=1\mid T=1, Z=1, \mathbf{X}) &= [\pi_c(\mathbf{X})\gamma^{11}_c(\mathbf{X}) + \pi_a(\mathbf{X})\gamma^{11}_a(\mathbf{X})]/[\pi_c(\mathbf{X}) + \pi_a(\mathbf{X})]\label{eq:mon-4},\\ \Pr(Y=1\mid T=0, Z=1, \mathbf{X}) &= \gamma^{01}_n(\mathbf{X}),\\ \Pr(Y=1\mid T=1, Z=0, \mathbf{X}) &= \gamma^{10}_a(\mathbf{X})\label{eq:mon-last}. \end{align} \cite{Richardson2010} derive this mixture relationship between principal strata/potential outcome distributions and the observable joint in detail under a range of assumptions about the latent variables (see also \cite{Imbens1997a} and \cite{Richardson2011}). The probabilities on the left hand side completely determine the joint distribution of observables ($Y$ and $T$ given $Z$) and hence constitute a basis for $\phi$. Clearly $\pi$, $\gamma^{01}_n$ and $\gamma^{10}_a$ are one-to-one maps from $\phi$, and are point identified as well. However, $\gamma^{00}_c,\ \gamma^{00}_n,\ \gamma^{11}_c,$ and $ \gamma^{11}_a$ are not. For example, at any point in covariate space $\gamma^{11}_c(x)$ and $\gamma^{11}_a(x)$ must lie on the line segment given by the intersection of the line in equation \eqref{eq:mon-4} and $[0,1]\times [0,1]$, but the data are wholly uninformative about their position on that line segment. In particular, the range of $\gamma^{11}_a(x)$ is \begin{equation} \left( \min\left( 0, \frac{\pi_a(x)+\pi_c(x)}{\pi_a(x)}p_{1\mid 11}(x) - \frac{\pi_c(x)}{\pi_a(x)} \right),\, \max\left( 1, \frac{\pi_a(x)+\pi_c(x)}{\pi_a(x)}p_{1\mid 11}(x) \right) \right)\label{eq:gbound} \end{equation} where $p_{1\mid 11}(x) = \Pr(Y=1\mid T=1, Z=1,\mathbf{X})$. The situation is exactly the same for $\gamma^{00}_c(x)$ and $\gamma^{00}_n(x)$, with the line given by \eqref{eq:mon-3} and bounds similar to \eqref{eq:gbound} (large sample bounds on causal effects within principal strata were introduced by \cite{zhang2003estimation}; see \cite{Richardson2011} for bounds under monotonicity and other assumptions, as well as further references). Point identification for the remaining parameters is often obtained through further assumptions on the distribution of the potential outcomes. The \emph{stochastic exclusion restriction} for compliance type $s$ posits that there is no direct effect of $Z$ on $Y$; that is, $\gamma^{i0}_s = \gamma^{i1}_s$ for $i=0,1$ \citep{Hirano2000}. From \eqref{eq:mon-1}-\eqref{eq:mon-last} it is clear that this achieves point identification for the entire distribution of the potential outcomes. \cite{Hirano2000} anticipated failures of the exclusion restrictions, noting that a reminder about flu shots might also prompt physicians to counsel patients about other preventative measures to avoid contracting the flu. They propose relaxing the exclusion restrictions and resolving the resulting nonidentifiability through prior probability modeling. In this sense our approach and theirs are philosophically similar, but our framework affords us significant flexibility in choosing the model for $\phi$ while transparently embedding prior information about $\theta$, which is difficult to do in their modeling setup. In our subsequent analysis we will avoid imposing any exclusion restrictions. \subsection{Model Specification} Our model for observables decomposes into a treatment model and an outcome given treatment model, i.e., $P(Y,T\mid Z, \mathbf{X}) = P(T\mid Z, \mathbf{X})P(Y \mid T, Z, \mathbf{X})$. We assign each of these a probit BART prior. For the treatment model, randomization of treatment assignment and monotonicity of compliance imply that $\Pr(T=1\mid Z=1, \mathbf{X}) \geq \Pr(T=1\mid Z=0, \mathbf{X})$ for all $\mathbf{X}$ (see equations \eqref{eq:mon-1} and \eqref{eq:mon-2}). We enforce this constraint by rejecting samples from BART where this condition fails at any point in covariate space. More elaborate approaches to enforcing monotonicity are possible but beyond the scope of the present paper. \subsubsection{Partially identified parameters} Recall that we have two pairs of unidentified parameters, $(\gamma^{00}_c, \gamma^{00}_n)$ and $(\gamma^{11}_c,\gamma^{11}_a)$. Fixing one element of each pair would solve the identification problem, so we can take $\theta = (\gamma^{00}_n,\gamma^{11}_a)$ without loss of generality. This is in contrast to \cite{Hirano2000}, who specify a strongly parametric probability model for all four of the unidentified parameters. We consider three priors on $\theta$. All three are of the form \begin{equation} (\mbox{logit}\{\gamma^{00}_n(\mathbf{X})\}, \mbox{logit}\{\gamma^{11}_a(\mathbf{X})\})' = \mu\{\phi(\mathbf{X})\} + h(\mathbf{X})\beta + \epsilon(x)\label{eq:theta-3}. \end{equation} with $\mu(\phi(\mathbf{X})) = (\mbox{logit}\{\gamma^{01}_n(\mathbf{X})\}, \mbox{logit}\{\gamma^{10}_a(\mathbf{X})\})'$, $h(\mathbf{X})=1$ and $\beta=(b_a, -b_n)$. This centers our prior at a proportional odds model, where the reminder increases the odds of a positive outcome by a factor of $\exp(b_a)$ or $\exp(b_n)$ in always or never takers (respectively) at any covariate value. A natural way to complete this prior is to take $b_s\sim N(0, \sigma_s^2)$ for $s=a,n$ which centers the prior at the exclusion restrictions and expresses prior beliefs about plausible effect sizes through $\sigma_s^2$. For illustration we take $\sigma_s=0.1$ or $0.25$ for the current application. \cite{Hirano2000} estimate principal strata-independent total effects of COPD around -0.35 on the log odds scale, so the more diffuse prior covers a plausible range of possible effect sizes for the direct effect of a reminder within non-compliers. We would expect any direct beneficial effect of the reminder on the subsequent hospitalization to be smaller than the detrimental effect of a serious chronic disease like COPD purely on substantive grounds. In the flu application we also have some prior information about likely effect directions, which we can also incorporate in the prior. Any direct effect from the reminder is most likely to be positive, since the reminder probably encourages doctors and patients to take other preventative measures beyond the vaccine. Additionally, \cite{Hirano2000} speculate that the exclusion restriction for never takers is more plausible than for always takers since perceived risk is a key driver of compliance behavior, with low-risk patients more likely to be never takers. A more nuanced view is that the direct effect should be \emph{larger} for always takers than never takers --- even though never takers probably have lower risk on average, we should not rule out the possibility of high-risk never takers who refuse the vaccine due to cost, safety or other concerns. A prior for $\theta$ that reflects these beliefs is $(b_a, b_n)\sim \mbox{{\small\textsc{N}}}(b_0, \Sigma_b)\mathbb{1}(b_a>0, b_n>0)$. For the analysis in the sequel we will take $b_0 = (0.05, 0.0)'$, $\Sigma_b = \mbox{diag}(0.13^2, 0.05^2)$. In additional simulations we find that results are insensitive to plausible values of $\mbox{Cov}(b_a, b_n)$. These particular numerical values were chosen The prior mode is $b_0$, the prior mean is about $(0.125, 0.04)$, and the marginal $90^{th}$ percentile is about 0.25 for $b_a$ and 0.08 for $b_n$. The prior scale for $b_a$ is calibrated so that (with high probability) $b_a$ is smaller in magnitude than the effect of COPD on the hospitalization as reported by \cite{Hirano2000} (the posterior mean was generally around -0.35, SD 0.15). We will call this the ``informed" prior. For all three priors we set $v=0.025$. \subsection{Results} We fit the model described in the previous section to the flu vaccine data, using age and COPD as covariates. Figure \ref{fig:psmembership} shows the probability of belonging to each principal stratum as a function of age and COPD along with marginal 90\% credible intervals. We find a fairly sharp break in compliance behavior at age 65 (the probability of being a never-taker drops, and seems to be shifted largely to always takers), which appears to hold regardless of COPD status. Possible explanations include patients or providers giving more weight to age-based vaccination guidelines, or better insurance coverage and increased access to services in the older cohort. Figure \ref{fig:outcometz} shows the outcome distributions by age, COPD, and the treatment assigned and received. There is clear evidence of an age/COPD interaction; this is due at least in part to the study design, where all participants under 65 have at least one chronic disease (possibly COPD). This also means that the 65+ population is on average less likely to he hospitalized than the younger cohort, explaining the seemingly paradoxical decrease in the estimated probability of hospitalization at age 65 in the ``No COPD" group. \begin{figure} \begin{center} \includegraphics[width=5in]{flu-figure/PSMembershipTrunc.pdf} \caption{Principal strata memberhsip probabilities by age and COPD, including marginal 90\% credible intervals}\label{fig:psmembership} \end{center} \end{figure} \begin{figure} \begin{center} \includegraphics[width=3.5in]{flu-figure/OutcomeByTZ.pdf} \caption{Log odds of a positive outcome (no hospitalization) by age, COPD, and treatment assignment/receipt}\label{fig:outcometz} \end{center} \end{figure} \subsubsection{Causal effects} We are primarily interested in (partially identified) sample causal effects. As in \cite{Hirano2000} we will consider estimating the intention-to-treat (ITT) effect in each principal stratum: \begin{equation} ITT_s = \frac{1}{n_s}\sum_{i: S_i=s} (Y_i(T_i(1), 1) - Y_i(T_i(0), 0)). \end{equation} where $n_s$ is the number of observations with compliance type $S$. Given a sample from the marginal distribution for $\phi$, and a sample from $\theta$, we can impute each observation's missing principal strata membership and the unobserved potential outcome. With the completed data it is straightforward to compute the sample ITT effects. Computational details are provided in Appendix \ref{app:postmis} We compare results under our three priors to three models from \cite{Hirano2000}: the model with no exclusion restrictions (``none"), both exclusion restrictions (``both"), or the never-taker exclusion restriction (``n"). The ``Hirano (none)" model has very wide standard deviations, which are driven by their use of diffuse, ``off-the-shelf" priors. Their marginal prior for the direct effect of the reminder is approximately normal with mean zero and standard deviation 1.5, which puts significant prior probability on implausible values such as large and/or negative direct effects. Such vague priors are inappropriate for partially identified parameters. In contrast, the BART models all give similar results. The ``BART (0.1)" and ``BART (0.25)" models differ mainly in the width of the posterior standard errors, and then only slightly. The ``BART (0.25)" model assumes that with high probability the magnitude of any direct effect on the log odds is within $\pm 0.5$ -- compare this to the COPD effect, which is estimated to increase the log odds of hospitalization by about 0.35. The ``informed" prior restricts the population effects to be positive but small, which tends to shrink the $ITT_c$ effect toward zero -- the overall $ITT$ effect is identified, so positive effects in the other principal strata lead necessarily to smaller $ITT_c$ estimates than unrestricted models. The substantive conclusion is largely unchanged: there is only modest evidence for the effectiveness of the vaccine, particularly if we assume the direct effect of the reminder is similar in always-takers and compliers. This is unsurprising given the sample size of $n=2,861$, weakness of the encouragement (Fig. \ref{fig:psmembership}), and relative rarity of the outcome (about 8\% of the study participants were hospitalized). However, unlike \cite{Hirano2000} we conclude that the $ITT_c$ effect is actually fairly robust to plausible deviations from the exclusion restrictions. \begin{figure} \begin{center} \includegraphics[width=5.25in]{flu-figure/flures.pdf} \caption{Posterior mean and standard deviations for the sample ITT effects in each principal stratum. ``BART (0.1)" and ``BART (0.25)" use the conditional prior centered at the exclusion restrictions with $\sigma_a=\sigma_n=0.1$ or $0.25$, respectively. ``BART (informed)" includes all prior information. The ``Hirano" models are from \cite{Hirano2000}; the ``n" model assumes the exclusion restriction in never-takers, the ``both" model imposes both exclusion restrictions and the ``none" model has no exclusion restrictions.}\label{fig:flures} \end{center} \end{figure} \section{Introduction} This paper develops an approach for estimating partially identified parameters in nonlinear regression settings. Our approach is based on a decomposition of the probability function into an identified and a partially identified component \citep{Kadane1975}. This representation permits us to employ flexible (nonlinear) models when inferring the identified component; in our applications we utilize Bayesian tree-based priors for the regression functions \citep{chipman2010bart, Hill2012}. For the partially identified portion of the model, informative priors are crucial, so checking the sensitivity of posterior inferences to model specification is vital. In our proposed framework, this sensitivity analysis is straightforward, and may be conducted under many different models for the partially identified parameters using only one set of samples from the marginal posterior of the identified parameters. Our motivating application comes from the corporate accounting literature, where there is substantial interest in determining what fraction of U.S. firms engage in financial misconduct (such as misstated earnings); e.g. \cite{Dyck2013}. Inferring the prevalence of misconduct is complicated by an inherent partial observability---not all cases of misconduct are discovered. Any treatment of this problem will therefore need to analyze how company attributes impact the probability of misconduct being discovered in addition to the probability of the misconduct itself taking place. As further evidence of the generality of our approach, we also include a reanalysis of a published dataset (from a broken randomized encouragement study of flu vaccine) in the supplementary material. The remainder of this section collects necessary background material, providing an overview of the concept of partial identification (specifically its treatment from a Bayesian perspective) and describing the empirical data we will analyze. Section \ref{Kadane} lays out our framework more generally and fixes notation. Section \ref{empirical} describes the results of our data analysis. \subsection{Partial identification} \input{partial_ID_lit_review_short} \subsection{Application: inferring the prevalence of accounting misconduct} Since 1982, the United States Securities and Exchange Commission (SEC) has released public notices called Accounting and Auditing Enforcement Releases, or AAERs. AAERs are financial reports ``related to enforcement actions concerning civil lawsuits brought by the Commission in federal court and notices and orders concerning the institution and/or settlement of administrative proceedings" \citep{SECwebsite}. Informally, AAERs comprise a list of publicly traded firms that the SEC has cited for misconduct in one form or another. For brevity, we adopt the nomenclature ``cheating'' and ``caught'', with the understanding that ``cheating" is operationally defined as any accounting anomaly that would lead to an AAER being issued, were it explicitly brought to the SEC's attention. This interpretation entails that no ``caught" firms did not ``cheat", by definition. Our goal is to provide an estimate of the prevalence of accounting misconduct in the U.S. economy, defined as all actual (caught) and potential (uncaught) AAERs. Predicting which companies are likely to cheat, on the basis of observable firm characteristics, is complicated by the fact that there are potentially many instances of misconduct of which the SEC is unaware. Thus, we do not directly observe which firms cheat, but merely the subset of cheating firms that were {\it caught} doing so. A naive regression analysis would therefore only speak to the question of which attributes are predictive of getting caught cheating. To complete the analysis, one must incorporate knowledge or conjectures concerning the impact firm attributes have on the likelihood of misconduct being discovered. \section{Partially observable binary response vectors}\label{Kadane} Problems with a similar structure to our accounting application appear in the literature under the heading of ``partially observed binary data". Regression models for such data have been studied in many different fields, going by various names. For example, \cite{Lancaster1996} considers the case where the observation model is covariate independent under the name ``contaminated case-control", building on \cite{prentice1979logistic}. \cite{poirier1980partial} studies such data under the rubric of ``partially observed bivariate probit models", building on the work of \cite{Heckman1976,Heckman1978,Heckman1979}. Our analysis is similar to the approach taken in \cite{Wang2013}, which adapts the bivariate probit model of \cite{poirier1980partial} for the securities fraud problem. Whereas these earlier references considered particular parametric models, such as the probit model, and studied identification conditions in that setting, we proceed in the more generic setting of nonlinear regression models, which leads to partially identified parameters. Our approach will be to confront this partial identification with informative priors. \subsection{Reparametrization in partially identified models} As in \cite{Dawid1979,GelfandSahu1999} and \cite{gustafson2005model}, we will work with a reparameterization of $\tau$ into an identified component $\phi$ and an unidentified component $(\theta, \eta)$. We write the unidentified component as two parameters: $\theta$, which appears in our estimand of interest, and $\eta$, which is a nuisance parameter. We will refer to $\phi$, $\phi(\mathbf{X})$ or $\phi_{\mathbf{X}}$ (respectively, $\theta$, $\theta(\mathbf{X})$ or $\theta_{\mathbf{X}}$ and $\eta$, $\eta(\mathbf{X})$ or $\eta_{\mathbf{X}}$) depending on context. We will use $\phi$ when the dependence on $\mathbf{X}$ is inessential, we will use $\phi(\mathbf{X})$ to emphasize that $\phi$ is a function of $\mathbf{X}$, and we will use $\phi_{\mathbf{X}}$ to refer to point-wise evaluations of $\phi(\mathbf{X})$. The joint distribution over data and parameters in a partially identified model can be written as \begin{equation} \begin{split} \pi(\eta, \theta, \phi, y) & = f(y \mid \eta, \theta, \phi)\pi(\eta, \theta, \phi),\\ & = f(y \mid \phi)\pi(\eta, \theta, \phi),\\ & = f(y \mid \phi)\pi(\phi)\pi(\eta, \theta \mid \phi),\\ \end{split} \end{equation} where the conditional independence implied in moving from the first line to the second line constitutes a definition of partial identification. It follows that the joint posterior distribution of the identified component $\phi$ and the unidentified component $(\theta, \eta)$ can be written as \begin{equation}\label{composition} \begin{split} \pi(\eta, \theta, \phi \mid y) &= \frac{f(y \mid \phi)\pi(\phi)\pi(\eta, \theta \mid \phi)}{f(y)}\\ & = \frac{f(y \mid \phi)\pi(\phi)}{f(y)}\pi(\eta, \theta \mid \phi)\\ & = \pi(\phi \mid y)\pi(\eta, \theta \mid \phi). \end{split} \end{equation} Theorem 5 of \cite{Kadane1975} shows rigorously that the parameter space of any model can be decomposed in this way. Essentially, there are three cases to consider. If the model is fully identified, then $(\eta, \theta)$ is empty, meaning it is a degenerate/constant random variable. When the model has fully unidentified elements, the support of $\pi(\eta, \theta \mid \phi)$ does not depend on $\phi$; the data inform about $(\eta, \theta)$ only via the presumed prior dependence represented in the choice of $\pi(\eta, \theta \mid \phi)$. In the partially identified case, which we focus on here, $\pi(\eta, \theta \mid \phi)$ has support restrictions that do depend on $\phi$; we will denote this $\phi$-dependent support by $\Omega(\phi)$. Our approach will be to directly specify $\pi(\eta, \theta \mid \phi)$ with support $\Omega(\phi)$. The tractability of our approach depends on being able to construct $\pi(\eta, \theta \mid \phi)$ in a way that permits convenient sampling. Our empirical analysis (Section \ref{cparm}) provides a specific example where this approach is successful (with additional computational details in the appendix). Although this type of reparameterization is not novel, it has been employed in the literature mainly as a way to study large sample behavior of posterior distributions in partially identified models; see, for example, \cite{gustafson2005model,gustafson2010bayesian} and \cite{florens2011bayesian}. Most authors suggest using priors on $\tau$ to induce the priors on $(\phi, \theta)$, or simply elect to do indirect inference for $\theta$ using only $\phi$ by computing posteriors over $\Omega(\phi)$. We consider a different approach, working directly in the $(\phi, \theta)$ parameterization and specifying priors as $\pi(\theta\mid\phi)\pi(\phi)$. This allows us to be fully nonparametric where the data are informative (i.e., on $\phi$), and exploit the conditional independence in \eqref{composition} to conduct computationally efficient sensitivity analysis. \subsection{Partially observed multivariate binary regression models}\label{sec:binreg} The general structure of the problem is as follows: The complete data consist of binary vectors $U=(U_1,\dots U_k)$, of which only certain subsets are simultaneously observable. Interest is in some functional $p(\mathbf{X})$ of the entire joint distribution $p(U_1,\dots U_k\mid \mathbf{X})$. Due to the partial observability, $p(\mathbf{X})$ must be reconstructed from an identified function $\phi(\mathbf{X})$ and an unidentified function $\theta(\mathbf{X})$. Specializing to our corporate accounting analysis, let $Z_i$ indicate ``cheating" in firm-year $i$ and let $W_i$ indicate ``getting caught" in firm-year $i$, ($U_1 = W$ and $U_2 = Z$). We assume that with some probability, cheaters get caught, but that there are no firms who get caught when they are not cheating (this is consistent with our operational definition of ``cheating"). Additonally, the data are ``presence-only'' in that we have no confirmation that any given firm is certainly non-cheating. The parameter of interest is the marginal firm-year probability of cheating, \begin{equation} p(\mathbf{X})=\Pr(Z =1\mid \mathbf{X}) = \frac{\Pr(W=1, Z=1\mid \mathbf{X})}{\Pr(W=1\mid Z=1, \mathbf{X})} \end{equation} from which we may determine the overall prevalence of cheating across all firms as \begin{equation}\label{alpha} \alpha \equiv \displaystyle \sum_i \mbox{Pr}(Z_i=1 \mid \mathbf{X}_i) = \sum_i \frac{\mbox{Pr}(Z_i=1, W_i = 1 \mid \mathbf{X}_i)}{\mbox{Pr}(W_i = 1 \mid Z_i = 1, \mathbf{X}_i)}. \end{equation} Equivalently, for each firm-year we observe $Y_i \equiv Z_iW_i$ instead of $(Z_i, W_i)$, where $Y_i$ indicating whether a firm received an AAER (cheated and got caught), giving \begin{equation} \phi(\mathbf{X}) = \mbox{Pr}(Z=1, W = 1 \mid \mathbf{X}) = \mbox{Pr}(Y = 1 \mid \mathbf{X}); \;\;\; \theta(\mathbf{X}) = \mbox{Pr}(W = 1 \mid Z = 1, \mathbf{X}). \end{equation} As $\phi(\mathbf{X})$ is simply the (conditional) probability of the observed binary data $Y$, it is point identified. In our application, we estimate $\phi(\mathbf{X})$ using the BART model described in the Appendix. BART has been shown empirically to be an excellent default nonlinear regression method, with a demonstrated ability to handle many noise variables and strong nonlinearities \citep{chipman2010bart, Hill2012}. The partial identification of $p(\mathbf{X})$ arises simply because $0 \leq p(\mathbf{X}) \leq 1$. Given $\phi(\mathbf{X})$, the posterior on $p(\mathbf{X})$ is defined by the prior over $\theta(\mathbf{X})$, truncated to regions satisfying \begin{equation}\label{partial_ineq} 0 \leq \frac{\phi(\mathbf{X})}{\theta(\mathbf{X})} \leq 1, \end{equation} for all $\mathbf{X} \in \mathcal{X}$. In other words, in our applied setting, $\Omega(\phi(\mathbf{X})) = \{\theta(\mathbf{X}) \mid \phi(\mathbf{X}) \leq \theta(\mathbf{X}) \}$. \subsection{A Gaussian process model for the partially identified regression} Furnishing prior information regarding $\theta(\mathbf{X})$ in a predictor-dependent manner strongly motivates the use of simple parametric models. For starters, consider the construction \begin{equation} F^{-1}\{\theta(\mathbf{X})\} = h(\mathbf{X})\beta,\label{eq:theta-1} \end{equation} where $F^{-1}$ is a link function and $h$ denotes some transformation or subset of the covariate vector. A prior over $\theta(\mathbf{X})$ is induced by a prior over $\beta$. A chief difficulty with this type of specification is that nonlinear (possibly discontinuous) regression models for $\phi(\mathbf{X})$ impose complex support restrictions on $\beta$ --- indeed, some samples from the posterior for $\phi(\mathbf{X})$ may contradict the model for $\theta(\mathbf{X})$ entirely, meaning that they imply a set of bounds for $\theta(\mathbf{X})$ such that no feasible $\beta$ exists. To address this problem, we expand the prior over $\theta(\mathbf{X})$ to acknowledge that \eqref{eq:theta-1} is only a guess as to the form of the regression function. Specifically, we \emph{center} our model for $\theta(\mathbf{X})$ at \eqref{eq:theta-1} by assuming that \begin{equation} F^{-1}\{\theta(\mathbf{X})\} \mid \phi(\mathbf{X}), \eta(\mathbf{X}) \sim \mathcal{GP}\left(h(\mathbf{X})\beta, \Sigma_{\mathcal{X}}\right)\mathbb{1}((\theta(\mathbf{X}), \eta(\mathbf{X})) \in\Omega\{\phi(\mathbf{X})\})\label{eq:theta-2} \end{equation} for all $\mathbf{X}\in \mathcal{X}$, where $\mathcal{GP}(m, \Sigma_{\mathcal{X}})$ is a Gaussian process with mean $m$ and covariance $\Sigma_{\mathcal{X}}$. In this set-up, $\beta$ may be fixed or given a prior distribution, in which case we equate $\eta := \beta$. For the purpose of computing $\alpha$ as in (\ref{alpha}), the prior \eqref{eq:theta-2} applied to the observed data points reduces to a multivariate normal prior (conditional on $\beta$) truncated according to (\ref{partial_ineq}). In our empirical analysis, we choose $\Sigma_{\mathcal{X}} = \sigma^2 \mbox{I}$. Note that this independence is in terms of design points, not in terms of observations: $\theta_{\mathbf{X}_i} = \theta_{\mathbf{X}_j}$ if $\mathbf{X}_i = \mathbf{X}_j$, even if $i \neq j$. That is, draws from the prior \eqref{eq:theta-2} are non-smooth functions, as distinct from observation-level errors. Under this simplification, sampling from $\left(\theta_{\mathbf{X}}\mid \beta, \phi_{\mathbf{X}}\right)$ reduces to drawing samples from independent truncated univariate normal distributions. The more complicated case of a smooth Gaussian process prior (e.g., one with a squared exponential covariance function) would require draws from a multivariate truncated normal distribution; reasonably efficient Hamiltonian Monte Carlo algorithms have been developed for this task \citep{HMC} but we do not pursue this direction here. \subsection{Simulated example}\label{sec:ex} Before turning to the subject-specific prior we developed for our empirical application, it is instructive to consider how our approach performs in a situation where we know what the right answers ought to be. To this end, we consider a simulated data set based on the competing approach of \cite{Wang2013}, which also analyzes the SEC data. \cite{Wang2013} builds off \cite{poirier1980partial}, which considers a latent Gaussian utility formulation of the bivariate probit model: \begin{equation}\label{biprobit} \begin{pmatrix} Z^*\\ W^* \end{pmatrix} \sim \mbox{{\small\textsc{N}}}(\mu(\mathbf{X}), \mbox{C}_{\rho}) \end{equation} where $\mu(\mathbf{X}) = (\gamma_0 + \mathbf{X}^t\gamma, \beta_0 + \mathbf{X}^t\beta)$ and $\mbox{C}_{\rho}$ is a 2-by-2 correlation matrix with correlation parameter $\rho$. The observed bivariate binary data is then $Z := \mathbb{1}(Z^* > 0)$ and $W := \mathbb{1}(W^* > 0)$. Specifically, \cite{poirier1980partial} establishes that (subject to certain exclusion restrictions) the parameters of the model ($\gamma$, $\beta$ and the correlation parameter $\rho$) are still identified even when only $Y := ZW$ is observed. \cite{Wang2013} proposes to leverage this result, while deviating from the latent utility formulation. In particular, despite making a ``no false positives" assumption (as we do here), \cite{Wang2013} continues to equate $\Pr(Z^* > 0 \mid \mathbf{X})$ with the probability of cheating, which corresponds to the somewhat arbitrary model: \begin{equation}\label{wang} \begin{split} \Pr(\textrm{cheat, caught})&= \Phi(\gamma_0 + \mathbf{X}^t\gamma, \beta_0 + \mathbf{X}^t \beta, \rho)\\ \Pr(\textrm{cheat, not caught})&= \Phi(\gamma_0 + \mathbf{X}^t\gamma) - \Phi(\gamma_0 + \mathbf{X}^t\gamma, \beta_0 + \mathbf{X}^t \beta, \rho)\\ \Pr(\textrm{not cheat, caught})&=0\\ \Pr(\textrm{not cheat, not caught})&= 1 - \Phi(\gamma_0 + \mathbf{X}^t\gamma). \end{split} \end{equation} In other words, \cite{Wang2013} identifies $\gamma$ from the first equation above, invoking the result of \cite{poirier1980partial}, and then proceeds to interpret $\gamma$ as the parameter from a bivariate probit model {\em without} the no false positives assumption. While there is nothing formally wrong with this model, it would seem to defy justification. All the same, if (\ref{wang}) is in fact the correct model, it is instructive to observe what our approach gives up to it. Conversely, if (\ref{wang}) is used in a misspecified setting, how do its results compare to ours? To investigate, we simulated $n = 2000$ observations from the following two models. First, we generated data according to (\ref{wang}) by drawing $Y := WZ$ with $(W, Z)$ coming from a bivariate probit model with $\gamma_0 = \beta_0 = -1/2$, $\gamma = (-1, 3/4, 0)$, $\beta = (-3/4,0,-1/2)$, and $\rho = 1/2$, with $\mathbf{X}_1$ drawn from a $\mbox{Uniform}(-\pi/2, \pi/2)$ distribution, and $\mathbf{X}_2$ and $\mathbf{X}_3$ drawn from a $\mbox{Uniform}(-3\pi/2, 3\pi/2)$ distribution (independently). This specification of $\gamma$ and $\beta$ satisfies the exclusion restriction of \cite{poirier1980partial}, in that distinct predictor variables are omitted from each linear equation in the probit mean function. A Bayesian specification of \cite{Wang2013}, with vague conjugate priors for $\beta$ and $\gamma$ and a uniform prior on $(-1,1)$ for $\rho$, was fit using a Gibbs sampler algorithm with a Metropolis-Hastings update for $\rho$. Our modular prior approach proceeds by fitting the BART model (with default priors as described in \cite{chipman2010bart}) to the observed data $(Y_i, \mathbf{X}_i)$ and constructing the posterior estimate of $\Pr(Z_i \mid \mathbf{X}_i)$ by dividing posterior samples of $\phi_{\mathbf{X}}$ by draws of $\theta_{\mathbf{X}}$ from (\ref{eq:theta-2}), with diagonal covariance $\sigma^2 \mbox{I}$ with $\sigma = 0.1$ and mean function set to match the true $\Pr(W = 1 \mid Z = 1)$ implied by (\ref{wang}). See the appendix for further computational details regarding model fitting. The results are depicted in Figure \ref{synthfig1}. As expected, the \cite{Wang2013} model, which achieves point-identification when it is correctly specified, yields much more accurate inference compared to our approach. Meanwhile, even with a correct surveillance model in this case, there persists a modicum of unresolved uncertainty, which reflects that in our model the estimand is only partially identified. Additionally, we see the impact of the BART prior pulling the estimated probabilities towards $1/2$ in regions near the edges where there are fewer data points. \begin{figure} \begin{center} \includegraphics[width=3.25in]{fig/linear_cheat_plot.pdf} \caption{Estimated probability of cheating versus the actual probability of cheat on the normal linear predictor scale for each of $n = 2000$ data points. Black solid dots show the modular prior approach, which loosely surrounds the diagonal, demonstrating the unresolved uncertainty in the partial identification approach. The solid gray dots correspond to the \cite{Wang2013} model, which is correctly specified in this example; they hew more tightly to the diagonal.}\label{synthfig1} \end{center} \end{figure} Our second demonstration deviates from the linear probit model by specifying $\mu(\mathbf{X}) = (0.5 + \sin{(\mathbf{X} + \pi)}^t\beta, \sin{(\mathbf{X})}^t\gamma)$ for the same values of $\gamma$ and $\beta$. The \cite{Wang2013} model is fit with the predictor variables unadjusted. The modular prior approach is fit the same as before, using the correctly specified surveillance model. The results are depicted in Figure \ref{synthfig2}. As might be expected, under misspecification the \cite{Wang2013} model badly mis-estimates the true $\Pr(Z_i = 1 \mid \mathbf{X}_i)$. Our approach, with good prior information, still does not achieve point identification, but manages to avoid the gross mis-fit of the \cite{Wang2013} model by successfully recovering the nonlinear identified component from the data. \begin{figure} \begin{center} \includegraphics[width=3.25in]{fig/sine_cheat_plot.pdf} \caption{Estimated probability of cheating versus the actual probability of cheat on the normal linear predictor scale for each of $n = 2000$ data points. Black solid dots show the modular prior approach, which loosely surrounds the diagonal, demonstrating the unresolved uncertainty in the partial identification approach. The solid gray dots correspond to the \cite{Wang2013} model, which is incorrectly specified in this example; they grossly diverge from the diagonal.}\label{synthfig2} \end{center} \end{figure} Naturally, if we had supplied invalid surveillance models, our approach may have been far off the mark in both cases. The point of this demonstration is merely that proceeding in a partially identified fashion is a more conservative course of action than choosing an implausible model on the grounds that --- {\em should it happen to be correct} --- it would deliver the desired point identification. \section{Analysis of AAER data, 2004-2010}\label{empirical} Our data are aggregated from three main sources. First, the AAER response variable was obtained from the Center for Financial Reporting and Management (CFRM) at Berkeley's Haas School of Business. Detailed information about the full data set can be found in \cite{dechow2011predicting}. Second, additional firm attributes are obtained from the CompuStat North America Annual Fundamentals database via the Wharton Research Data Service (WRDS). These data are then merged with the AAERs using Global Company Key (GVKEY) by year. Specifically, the covariates considered are: \begin{itemize}\addtolength{\itemsep}{-0.5\baselineskip} \item fiscal year, \item cash, \item net income, \item capital investments, \item SIC industry code, \item qui tam dummy variable. \end{itemize} \noindent Cash, net income and capital investments are all recorded as a fraction of the firm's total assets. Standard industrial classifications are given in terms of ten major divisions, denoted A-J by the Occupational Safety and Health Administration. The {\em qui tam} dummy variable is derived from the SIC codes; it denotes if a firm is in an industry where persons responsible for revealing misconduct are eligible to receive some part of any award resulting from subsequent prosecution. Similar to \cite{dyck2008corporate} and \cite{jayaraman2010whistle}, our qui tam variable is set to one for firms with SIC code 381x, 283x, 37xx, 5122 or 80xx, which includes healthcare providers and pharmaceutical firms, and airplane, missile, and tank manufacturers. It is reasonable to suppose that firms in these industries have a greater likelihood of any misconduct being exposed as a result of incentivized employees. Finally, a keyword search at the Financial Times web page (www.ft.com) was conducted on each company name and the number of search results was recorded by year. This variable provides a crude measure of media exposure. Although discrepancies between firm names as recorded in CompuStat and firm names as reported in Financial Times articles lead to measurement error of this variable, it still provides a reasonable proxy for name recognition and cultural visibility. Most firms will never be mentioned in any news article; a few firms are routinely mentioned in the press. To adjust for the fact that web traffic has increased over that period, we normalize the search results count by the total number of hits across all companies in a given year. We restrict our analysis to U.S. firms who had positive net income for the given year, considering the period between 2004 and 2010, for a total of $6,641$ unique firms and a total of $n=25,889$ total firm-year observations. \subsection{Surveillance model}\label{selection} The unidentified function $\theta(\mathbf{X})$ can be thought of as a ``surveillance" probability; it encodes which attributes invite (discourage) SEC scrutiny, making cheaters more (less) likely to be caught. Its effect is to inflate the probability of cheating, which is intuitive since the proportion of caught cheaters $\phi(x)$ represents an obvious lower bound on the proportion of actual cheaters. Our surveillance model takes the form reported in expression (\ref{eq:theta-2}) with $\Sigma_{\mathcal{X}} = \sigma^2 \mbox{I}$ and using a logit link. We scale and shift all variables to reside on the unit interval, taking shifted log transformations of the financial times search hits and net income. We chose to place nonzero coefficients on the (fiscal) year of misconduct, media exposure (as measured by Financial Times search hits), income, cash, and a dummy for qui tam industries. We have specific reasons to expect that these variables are important determinants of the surveillance probability, allowing us to chose informative values for $\beta$. First, note that the frequency of AAERs is substantially higher in earlier years; see Figure \ref{aaers}. AAERs may be filed retroactively, so the opportunity to discover and report misconduct in a given year increases over time. Fitting a curve to the data in Figure \ref{aaers} suggests a coefficient $\beta_{fyear} = -2.5$. Observe that this makes the posterior probability of cheating approximately constant across the years examined, which seems plausible. \begin{figure} \begin{center} \includegraphics[width=3in]{sec-figure/aaer_rate.pdf} \end{center} \caption{AAERs appear more common in more distant years, but this is likely because they may be filed retroactively.}\label{aaers} \end{figure} Second, it is reasonable to assume that media attention naturally draws SEC scrutiny \citep{miller2006press}. The SEC has a vested interest in catching and making examples of any high-profile cheaters. We set $\beta_{FThits}=2$, implying approximately a six-fold difference in the probability of misconduct being discovered between a company with no media exposure and the company with the highest media exposure. Similarly, we set $\beta_{quitam}=1$, implying approximately a two-fold increase in misconduct being discovered for companies in qui tam industries where employees are incentivized to report misconduct. These observations constitute the subjective information contained in our first observation model (A). To determine the intercept term, consider the following argument: AAERs are quite rare, with an aggregate incidence in our sample of only 0.5\%. Potentially this is because very few firms exhibit actionable misconduct, but more likely it is because the SEC has limited resources to identify and pursue violations. Accordingly, one sensible calibration method would be fix the mean probability of discovery across all firms. Fixing this quantity and the other elements of $\beta$, we may then solve for the intercept $\beta_0$. In the case of model A, fixing the average discovery rate to 30\% gives $\beta_0 = 0$. After obtaining posterior samples under model A, we observe that cash appears to have a negative impact on the probability of cheating. In contrast, net income appears to have a positive impact on the probability of cheating. We might surmise that these trends are due to unadjusted surveillance probabilities. For example, one could argue that having large amounts of cash on hand (relative to total assets) provides a measure of ``wiggle room" that makes certain kinds of misconduct harder to discover. Likewise, firms with high income are more likely to draw SEC attention than firms with smaller income streams. To compare our results under these narratives, we specify a second surveillance model (B), with $\beta_{cash} = -1.5$ and $\beta_{income} = 2.5$. Setting the intercept for model B to match the 30\% discovery rate of model A gives $\beta_0 = -0.85$. Surveillance models A and B are shown side-by-side in Table \ref{surveillance}. \begin{table} \begin{center} \begin{tabular}{c|cccccc} &Intercept&Fiscal year &FT.com hits&cash&net income&qui tam\\ \hline $\beta_A$ & $\;\;\;0$& $-2.5$&$2$&$0$& $0$& $1$\\ $\beta_B$ &$-0.85$&$-2.5$& $2$&$-1.50$&$2.5$&$ 1$\\ \end{tabular}\caption{Regression coefficients defining surveillance models A and B. They differ in their intercept terms and their cash and net income coefficients. The intercepts have been adjusted to obtain an average misconduct discovery rate of 30\%}\label{surveillance} \end{center} \end{table} \subsubsection{Upper bounding cheating}\label{cparm} Finally, we introduce an additional parameter $c$ that allows us to interject prior information concerning an upper bound on the probability of cheating. Recall that the partial identification in this application is driven by the inequality $\mbox{Pr}(Z = 1 \mid \mathbf{X}) = \frac{\phi(\mathbf{X})}{\theta(\mathbf{X})} \leq 1$, which implies $\phi(\mathbf{X}) \leq \theta(\mathbf{X})$; the left hand side of this latter inequality is identified by the data. Extremely high probabilities of cheating are implausible, motivating us to consider alternative truncations: $\mbox{Pr}(Z = 1 \mid \mathbf{X}) = \frac{\phi(\mathbf{X})}{\theta(\mathbf{X})} \leq c$, which implies $\phi(\mathbf{X})/c \leq \theta(\mathbf{X})$ for $c \geq \phi(\mathbf{X})$ for all $\mathbf{X}$. Because $\phi(\mathbf{X})$ is identified, the data may contradict any particular value of $c$ by violating $c \geq \phi(\mathbf{X})$ for some $\mathbf{X}$. That is, $\eta := c$ and $\Omega\{\phi(\mathbf{X})\} = \{ (c, \theta(\mathbf{X})) \mid \phi(\mathbf{X})/c \leq \theta(\mathbf{X}) \leq 1\}$. Note that $\eta := c$ is ``global" in that it implies inequalities across all values of $\mathbf{X}$, whereas $\theta_{\mathbf{X}}$ can take distinct values at distinct $\mathbf{X}$ locations. We specify $\pi(c \mid \phi(\mathbf{X})) \propto \mbox{Beta}\left(10 c_0, 10(1-c_0) \right)\mathbb{1}\{c \geq\sup_{\mathbf{X}} \phi(\mathbf{X})\}$. The prior mean $c_0$ captures prior beliefs about the upper bound on $\mbox{Pr}(Z = 1 \mid \mathbf{X})$, the probability of cheating for any firm. This permits us to specify $\pi(\theta_{\mathbf{X}} \mid c, \phi_{X}) \propto \mbox{{\small\textsc{N}}}(h(\mathbf{X})\beta, \sigma^2)\mathbb{1}\{\theta_{\mathbf{X}} \geq \phi_{\mathbf{X}}/c\}$; joint samples of $(c, \theta_{\mathbf{X}})$ are thereby guaranteed to lie in $\Omega(\phi_{\mathbf{X}})$. Our surveillance models allow us to include prior information in the form of subject matter knowledge about the impact of various covariates. We are also able to include additional subjective prior information about $\sum_i \mbox{Pr}(W_i = 1 \mid Z_i = 1, \mathbf{X}_i)$ --- the overall average probability of a cheating firm getting caught --- via the intercept terms, and $\mbox{max}_i \mbox{Pr}(Z_i = 1 \mid \mathbf{X}_i)$ --- an upper probability on any firm cheating --- via the prior on $c$. Further computational details are included in the Appendix. \subsection{Results} We conduct a sensitivity analysis by varying the parameters $\sigma$ and $c$ for both model coefficients $\beta_A$ and $\beta_B$ above. Specifically, we consider two settings of each ($\sigma \in \lbrace 0.25,0.5 \rbrace$ and $c \in \lbrace 0.4,0.8 \rbrace$) for a total of eight candidate models. We study the impact these choices have on both $\mbox{Pr}(Z=1 \mid \mathbf{X})$ as a function of individual predictor variables, and also on the overall misconduct prevalence $\alpha$. Figure \ref{SICboxplot} shows the posterior distribution of the adjusted cheating prevalence under the different models. As can be seen in the top panel, increasing $\sigma$ or $c$ alone has little effect on the overall adjusted cheating prevalence. These two parameters control different aspects of the surveillance uncertainty: a high $c$ implies that any probability of cheating is plausible, whereas a high $\sigma$ allows large deviations from the specified surveillance model logistic term. Note that with the range of $c$ and $\sigma$ chosen, neither surveillance model yields overall prevalence of misconduct greater than 15\%. The bottom panel of Figure \ref{SICboxplot} shows the posterior prevalence for each different SIC code under the two priors, fixing $(\sigma=0.25, c = 0.4)$. Under both priors, SIC category D, representing ``electricity, gas, steam and air conditioning supply'', shows much lower cheating prevalence than categories (B,E,H), which correspond to ``mining and quarrying'', ``water supply, sewerage, waste management and remediation activities'', and ``transportation and storage'' respectively. \begin{figure} \begin{center} \includegraphics[width=\textwidth]{sec-figure/boxplots.pdf}\\ \includegraphics[width=\textwidth]{sec-figure/SICboxplot.pdf} \end{center} \caption{Top panel: posterior cheating prevalence, white corresponding to the raw (unadjusted) prevalence, pink to prior A and blue to prior B. The four boxplots within each prior correspond to the following combinations for $c$ and $\sigma$ (from left to right): $(\sigma=0.25,c = 0.4),\;(\sigma=0.25, c = 0.8 ),\;(\sigma=0.5, c=0.4),\;(\sigma=0.5, c= 0.8)$. Bottom panel: Posterior cheating prevalence in companies within each SIC code, pink corresponding to prior A and blue to prior B for $(\sigma=0.25,c=0.4)$. }\label{SICboxplot} \end{figure} Because BART is nonlinear, summary plots of the impact of individual covariates are challenging to visualize, even if the surveillance model is relatively simple, such as our linear logistic specification. It is instructive, therefore, to examine the implied probability of cheating as one varies individual covariates, for a given firm. That is, how does $\mbox{Pr}(Z=1 \mid \mathbf{X})$ change as a function of $x_j$ while holding $x_{-j}$ fixed? To demonstrate this approach, we focus on a specific firm, ConAgra Foods of Omaha, Nebraska (simply because it yields illustrative plots). Figure \ref{VaryPriorVarySC} shows $\mbox{Pr}(Z=1 \mid \mathbf{X})$, varying media attention, cash, and net income under priors A and B and for various combinations of $c$ and $\sigma$. As expected, the surveillance model coefficients on cash and net income reverse the associated slope of the probability of cheating. High values of both $\sigma$ and $c$ results in posterior credible intervals of up to 40\% probability of cheating for some values of net income. We have reported here only a small number of the possible variations one would presumably want to investigate; we make no claims that models A and B are ideal or even necessarily good or realistic models. Rather, our sensitivity analysis demonstrates a range of possible comparisons that one might undertake when investigating how various assumptions interact with the data via the identified portion of the model. An important upshot of our analysis is that the surveillance model intercept terms---which govern the average probability of misconduct discovery (getting caught) across firm---and the parameter $c$--- which defines the upper bound $\mbox{Pr}(Z_i =1 \mid \mathbf{X}_i) \leq c$ for all $i$ --- play dominant roles in determining the inferred overall prevalence of misconduct. For our choices of 30\% misconduct discovery probability and $c = 0.4$ or $c=0.8$, we find that no more than 15\% of firms engage in accounting misconduct. Incidentally, this result is consistent with that of \cite{Dyck2013}, who put the prevalence at between 4.74\% to 15\%, based on a clever natural experiment resulting from the dissolution of the large accounting firm Arthur Andersen and the subsequent re-audit of its clients following the Enron scandal. Unavailability of their exact data, as well as the unavailability of the data of \cite{Wang2013} at the time of writing, means that we cannot compare their precise estimates with those from our model. However, our partial identification analysis suggests that any similar analysis is likely to yield similar conclusions in the matter of overall prevalence. After all, there is only so much information in the available data, with the rest coming from auxiliary assumptions about the surveillance probability, whether those assumptions are explicit, as in our model, implicit, as in the joint likelihood assumed by \cite{Wang2013}, or based on supplementary evidence, as in \cite{Dyck2013}. To the extent that these various approach supply similar assumptions, they will yield similar conclusions. Our approach, by layering such assumptions over the data {\em ex post}, permits systematic sensitivity analysis rather than one-off comparisons of published studies whose authors are committed to one particular approach. \begin{figure} \begin{center} \includegraphics{sec-figure/priorAB.pdf} \end{center} \caption{$\mbox{Pr}(Z=1 \mid \mathbf{X})$ varying $x_j$ while holding $x_{-j}$ fixed (at the values of ConAgra Foods) under two surveillance models A (pink) and B (blue). Lines depict the median and shaded areas depict 90\% credibility intervals. Each row represents a different covariate; the three columns correspond to the following $(c, \sigma)$ combinations (from left to right): $(c=0.4,\sigma=0.25),\;(c=0.8,\sigma=0.25),\;(c=0.8,\sigma=0.5)$. }\label{VaryPriorVarySC} \end{figure} \section{Discussion} Working directly with modular priors in partially identified settings has several advantages. First, it allows identified parameters to be modeled flexibly, permitting the data to be maximally informative, while simultaneously allowing the analyst to specify informative priors for the underidentified components of the model. It may appear that this tactic stands in contrast to the approach of \cite{gustafson2010bayesian} (for example) which advocates working with a scientific model directly in the $\tau$ parametrization. However, nothing in our approach precludes the use of such subject-specific information. Rather, we argue that typical prior specifications for $\tau$ do not allow separately modulating the prior informativeness on the identified and unidentified components; by working directly in the $(\phi, \theta)$ representation, we achieve precisely this sort differential informativeness. Nonetheless, one should always be mindful of the implied prior on $\tau$. Specifically, analysts can use intuitions regarding $\tau$ as a tool for vetting priors over $(\phi, \theta)$, by checking (via simulation) that they are consistent with available knowledge in the $\tau$ representation. In many applications, such as the one studied in this paper, the $(\phi, \theta)$ representation is itself readily interpretable (in this case, the ``cheating probability" and the ``surveillance probability", respectively). Second, when an interpretable parameterization of the modular parameters is available (as it is in our application), the modular prior approach facilitates efficient sensitivity analyses. Sensitivity analysis is good practice generally, and vital when the data are completely uninformative about certain aspects of the model. Being able to conduct such analyses without refitting the entire model can be a tremendous practical advantage, particularly when fitting sophisticated nonlinear regression models to the identified component. Finally, while we have not emphasized it in our applications, our use of modular priors allows us to not only conduct sensitivity analyses, but also perform model checking on the unidentified component. By computing ``residuals" for our model of $\theta(\mathbf{X})$ based on the support function $\Omega\{\phi(\mathbf{X})\}$ we can learn about areas in the covariate space where our prior model is contradicted by the data---that is, regions where the model places significant mass outside $\Omega\{\phi(\mathbf{X})\}$. This is a unique opportunity in partially identified models that, to our knowledge, has not been exploited in the existing literature. Performing these model checks in our applications did not raise any red flags, but they would indicate potential problems in situations such as our example in section \ref{sec:ex}. We expect these methods to be useful in other contexts with partially observed data, including traditional missing data settings (nonignorable unit or item survey nonresponse, dropout, or measurement error) \citep{rubin1976inference, little1987statistical, Daniels2008}, causal inference with observational data or imperfectly randomized study designs \citep{imbens1997bayesian, barnard2003principal, greenland2005multiple, McCandless2007, McCandless2012}, and ecological inference \citep{duncan1953alternative, shively1969ecological,AchenShively199505, king2013solution}, to name just a few. Our approach allows practitioners to consider much more sophisticated regression modeling for identified parameters while taking a principled approach to the lack of identification, and promotes the routine use of sensitivity analysis and model checking due to the ease with which they are implemented. For an illustration of our approach applied to an imperfectly randomized study of flu vaccine efficacy, see the supplementary material. \singlespace \bibliographystyle{plainnat} \section{Computational details for the flu application} \section{Imputing principal strata membership, potential outcomes, and $ITT$ effects}\label{app:postmis} The full conditional distribution of principal strata membership is given by \begin{align} \Pr(S_i=a\mid Y_i=y, T_i=t, Z_i=z, X_i=x, \phi, \theta) &\propto \pi_A(x)\gamma_{a}^{11}(x)^{y}(1-\gamma_{a}^{11}(x))^{1-y}\mathbb{1}(Z_i=T_i=1)\\ \Pr(S_i=n\mid Y_i=y, T_i=t, Z_i=z, X_i=x, \phi, \theta) &\propto \pi_N(x)\gamma_{n}^{00}(x)^{y}(1-\gamma_{n}^{00}(x))^{1-y}\mathbb{1}(Z_i=T_i=0)\\ \Pr(S_i=c\mid Y_i=y, T_i=t, Z_i=z, X_i=x, \phi, \theta) &\propto \pi_C(x)\gamma_{c}^{tz}(x)^{y}(1-\gamma_{c}^{tz}(x))^{1-y}\mathbb{1}(Z_i=T_i) \end{align} Note that observations with $Z_i=1, T_i=0$ ($Z_i=0,\ T_i=1)$ are never takers (always takers) with probability one, and observations with $T_i=Z_i=1$ ($T_i=Z_i=0$) are either compliers or always takers (never takers). Finally, given an observation's PS membership, the missing potential outcome is sampled from its full conditional, which is just \[ \Pr(Y_i(t, 1-z)=1\mid T_i=t, Z_i=z, X_i=x, S_i=s, \phi, \theta) = \gamma_s^{t(1-z)}(x) . \] The $ITT$ effects can be computed from the completed data using the following alternative expressions: \begin{align} ITT_c &= \frac{ \sum_{i=1}^n \mathbb{1}(S_i=c)[Z_i\{Y_i-Y_i(0,0)\}+ (1-Z_i)\{Y_i(1,1) - Y_i\}] }{ \sum_{i=1}^n \mathbb{1}(S_i=c) }\\ ITT_n &= \frac{ \sum_{i=1}^n \mathbb{1}(S_i=n)[Z_i\{Y_i-Y_i(0,0)\}+ (1-Z_i)\{Y_i(0,1) - Y_i\}] }{ \sum_{i=1}^n \mathbb{1}(S_i=n) }\\ ITT_c &= \frac{ \sum_{i=1}^n \mathbb{1}(S_i=a)[Z_i\{Y_i-Y_i(1,0)\}+ (1-Z_i)\{Y_i(1,1) - Y_i\}] }{ \sum_{i=1}^n \mathbb{1}(S_i=a) } \end{align} \subsection{Causal Inference in a Binary Instrumental Variables Model} Let $Z_i, T_i$, and $Y_i$ be the observed values of the treatment assignment (or encouragement, or instrument), treatment received, and outcome for observation $i$, respectively. Let $X_i$ be a vector of baseline covariates. In the flu data, $Z_i=1$ if encouragement (the reminder) was administered, $T_i=1$ if the vaccine was administered, and $Y_i=1$ if the patient was \emph{not} hospitalized. As in \cite{Angrist1996} and \cite{Hirano2000} define the \emph{potential outcomes} $T_i(z)$ and $ Y_i(t,z)$ as the treatment assignment that would have been observed had we fixed $Z_i=z$ and the outcome we would have observed fixing $T_i=t, Z_i=z$, respectively. We will suppress indexing by $i$ for population quantities. We make the stable unit treatment value assumption (SUTVA) \citep{Angrist1996}, i.e. that there is no interference between units and no alternative versions of treatment. \footnote{\cite{Hirano2000} point out that in an infectious disease application with individuals as the unit of randomization this assumption is unlikely to hold exactly, but constitutes a reasonable first order approximation.} Mathematically, SUTVA implies that $T_i(\mathbf{z})=T_i(z_i)$ and $Y_i(\mathbf{t}, \mathbf{z})=Y_i(t_i, z_i)$, where $\mathbf{z}, \mathbf{t}$ are vectors of instrument/encouragement assignment and treatments received (respectively) for the entire sample. In this application the complete vector of binary response variables is \begin{equation} U_i=(T_i(0), T_i(1), Y_i(0,0), Y_i(0,1), Y_i(1,0), Y_i(1,1))', \end{equation} the collection of treatments and outcomes under all possible experimental conditions. However, we observe only $T_i\equiv T_i(Z_i)$ and $Y_i\equiv Y_i(T_i(Z_i), Z_i)$, where $Z_i$ is randomly assigned at the study outset. We can define compliance types or principal strata $S$ based on the possible values for $(T(1), T(0))$ -- see Table \ref{tab:comptype}. \begin{table} \begin{center} \begin{tabular}{cc|ll} $T(1)$ & $T(0)$ & $S$ (Compliance Type) & ~ \\ \hline 0 & 0 & Never Taker & (n) \\ 1 & 1 & Always Taker & (a) \\ 1 & 0 & Complier & (c) \\ 0 & 1 & Defier & (d) \\ \end{tabular} \caption{Compliance types, or principal strata, defined by response patterns across levels of $Z$.} \label{tab:comptype} \end{center} \end{table} We will assume that the encouragement $Z$ is ignorable or randomly assigned (as it is in the flu data). We also assume that there are no defiers (``monotonicity of compliance"), i.e., $ \Pr(S=d\mid \mathbf{X})=0$. In the current setting a defier would be a patient who would \emph{only} receive the vaccine if the reminder was \emph{not} administered, which is quite unlikely. Let $\pi_s(x) = \Pr(S=s\mid \mathbf{X})$ and $\gamma^{tz}_s(x) = \Pr( Y(t,z)=1\mid S=s, \mathbf{X})$ denote the principal strata and potential outcome probability models. Under the above assumptions the potential outcome and principal strata distributions are linked to the joint distribution of observables by the following equations. \begin{align} \Pr(T=1\mid Z=0, \mathbf{X}) &= \pi_a(\mathbf{X})\label{eq:mon-1},\\ \Pr(T=1\mid Z=1, \mathbf{X}) &= \pi_c(\mathbf{X}) + \pi_a(\mathbf{X})\label{eq:mon-2},\\ \Pr(Y=1\mid T=0, Z=0, \mathbf{X}) &= [\pi_c(\mathbf{X})\gamma^{00}_c(\mathbf{X}) + \pi_n(\mathbf{X})\gamma^{00}_n(\mathbf{X})]/[\pi_c(\mathbf{X}) + \pi_n(\mathbf{X})]\label{eq:mon-3},\\ \Pr(Y=1\mid T=1, Z=1, \mathbf{X}) &= [\pi_c(\mathbf{X})\gamma^{11}_c(\mathbf{X}) + \pi_a(\mathbf{X})\gamma^{11}_a(\mathbf{X})]/[\pi_c(\mathbf{X}) + \pi_a(\mathbf{X})]\label{eq:mon-4},\\ \Pr(Y=1\mid T=0, Z=1, \mathbf{X}) &= \gamma^{01}_n(\mathbf{X}),\\ \Pr(Y=1\mid T=1, Z=0, \mathbf{X}) &= \gamma^{10}_a(\mathbf{X})\label{eq:mon-last}. \end{align} \cite{Richardson2010} derive this mixture relationship between principal strata/potential outcome distributions and the observable joint in detail under a range of assumptions about the latent variables (see also \cite{Imbens1997a} and \cite{Richardson2011}). The probabilities on the left hand side completely determine the joint distribution of observables ($Y$ and $T$ given $Z$) and hence constitute a basis for $\phi$. Clearly $\pi$, $\gamma^{01}_n$ and $\gamma^{10}_a$ are one-to-one maps from $\phi$, and are point identified as well. However, $\gamma^{00}_c,\ \gamma^{00}_n,\ \gamma^{11}_c,$ and $ \gamma^{11}_a$ are not. For example, at any point in covariate space $\gamma^{11}_c(x)$ and $\gamma^{11}_a(x)$ must lie on the line segment given by the intersection of the line in equation \eqref{eq:mon-4} and $[0,1]\times [0,1]$, but the data are wholly uninformative about their position on that line segment. In particular, the range of $\gamma^{11}_a(x)$ is \begin{equation} \left( \min\left( 0, \frac{\pi_a(x)+\pi_c(x)}{\pi_a(x)}p_{1\mid 11}(x) - \frac{\pi_c(x)}{\pi_a(x)} \right),\, \max\left( 1, \frac{\pi_a(x)+\pi_c(x)}{\pi_a(x)}p_{1\mid 11}(x) \right) \right)\label{eq:gbound} \end{equation} where $p_{1\mid 11}(x) = \Pr(Y=1\mid T=1, Z=1,\mathbf{X})$. The situation is exactly the same for $\gamma^{00}_c(x)$ and $\gamma^{00}_n(x)$, with the line given by \eqref{eq:mon-3} and bounds similar to \eqref{eq:gbound} (large sample bounds on causal effects within principal strata were introduced by \cite{zhang2003estimation}; see \cite{Richardson2011} for bounds under monotonicity and other assumptions, as well as further references). Point identification for the remaining parameters is often obtained through further assumptions on the distribution of the potential outcomes. The \emph{stochastic exclusion restriction} for compliance type $s$ posits that there is no direct effect of $Z$ on $Y$; that is, $\gamma^{i0}_s = \gamma^{i1}_s$ for $i=0,1$ \citep{Hirano2000}. From \eqref{eq:mon-1}-\eqref{eq:mon-last} it is clear that this achieves point identification for the entire distribution of the potential outcomes. \cite{Hirano2000} anticipated failures of the exclusion restrictions, noting that a reminder about flu shots might also prompt physicians to counsel patients about other preventative measures to avoid contracting the flu. They propose relaxing the exclusion restrictions and resolving the resulting nonidentifiability through prior probability modeling. In this sense our approach and theirs are philosophically similar, but our framework affords us significant flexibility in choosing the model for $\phi$ while transparently embedding prior information about $\theta$, which is difficult to do in their modeling setup. In our subsequent analysis we will avoid imposing any exclusion restrictions. \subsection{Model Specification} Our model for observables decomposes into a treatment model and an outcome given treatment model, i.e., $P(Y,T\mid Z, \mathbf{X}) = P(T\mid Z, \mathbf{X})P(Y \mid T, Z, \mathbf{X})$. We assign each of these a probit BART prior. For the treatment model, randomization of treatment assignment and monotonicity of compliance imply that $\Pr(T=1\mid Z=1, \mathbf{X}) \geq \Pr(T=1\mid Z=0, \mathbf{X})$ for all $\mathbf{X}$ (see equations \eqref{eq:mon-1} and \eqref{eq:mon-2}). We enforce this constraint by rejecting samples from BART where this condition fails at any point in covariate space. More elaborate approaches to enforcing monotonicity are possible but beyond the scope of the present paper. \subsubsection{Partially identified parameters} Recall that we have two pairs of unidentified parameters, $(\gamma^{00}_c, \gamma^{00}_n)$ and $(\gamma^{11}_c,\gamma^{11}_a)$. Fixing one element of each pair would solve the identification problem, so we can take $\theta = (\gamma^{00}_n,\gamma^{11}_a)$ without loss of generality. This is in contrast to \cite{Hirano2000}, who specify a strongly parametric probability model for all four of the unidentified parameters. We consider three priors on $\theta$. All three are of the form \begin{equation} (\mbox{logit}\{\gamma^{00}_n(\mathbf{X})\}, \mbox{logit}\{\gamma^{11}_a(\mathbf{X})\})' = \mu\{\phi(\mathbf{X})\} + h(\mathbf{X})\beta + \epsilon(x)\label{eq:theta-3}. \end{equation} with $\mu(\phi(\mathbf{X})) = (\mbox{logit}\{\gamma^{01}_n(\mathbf{X})\}, \mbox{logit}\{\gamma^{10}_a(\mathbf{X})\})'$, $h(\mathbf{X})=1$ and $\beta=(b_a, -b_n)$. This centers our prior at a proportional odds model, where the reminder increases the odds of a positive outcome by a factor of $\exp(b_a)$ or $\exp(b_n)$ in always or never takers (respectively) at any covariate value. A natural way to complete this prior is to take $b_s\sim N(0, \sigma_s^2)$ for $s=a,n$ which centers the prior at the exclusion restrictions and expresses prior beliefs about plausible effect sizes through $\sigma_s^2$. For illustration we take $\sigma_s=0.1$ or $0.25$ for the current application. \cite{Hirano2000} estimate principal strata-independent total effects of COPD around -0.35 on the log odds scale, so the more diffuse prior covers a plausible range of possible effect sizes for the direct effect of a reminder within non-compliers. We would expect any direct beneficial effect of the reminder on the subsequent hospitalization to be smaller than the detrimental effect of a serious chronic disease like COPD purely on substantive grounds. In the flu application we also have some prior information about likely effect directions, which we can also incorporate in the prior. Any direct effect from the reminder is most likely to be positive, since the reminder probably encourages doctors and patients to take other preventative measures beyond the vaccine. Additionally, \cite{Hirano2000} speculate that the exclusion restriction for never takers is more plausible than for always takers since perceived risk is a key driver of compliance behavior, with low-risk patients more likely to be never takers. A more nuanced view is that the direct effect should be \emph{larger} for always takers than never takers --- even though never takers probably have lower risk on average, we should not rule out the possibility of high-risk never takers who refuse the vaccine due to cost, safety or other concerns. A prior for $\theta$ that reflects these beliefs is $(b_a, b_n)\sim \mbox{{\small\textsc{N}}}(b_0, \Sigma_b)\mathbb{1}(b_a>0, b_n>0)$. For the analysis in the sequel we will take $b_0 = (0.05, 0.0)'$, $\Sigma_b = \mbox{diag}(0.13^2, 0.05^2)$. In additional simulations we find that results are insensitive to plausible values of $\mbox{Cov}(b_a, b_n)$. These particular numerical values were chosen The prior mode is $b_0$, the prior mean is about $(0.125, 0.04)$, and the marginal $90^{th}$ percentile is about 0.25 for $b_a$ and 0.08 for $b_n$. The prior scale for $b_a$ is calibrated so that (with high probability) $b_a$ is smaller in magnitude than the effect of COPD on the hospitalization as reported by \cite{Hirano2000} (the posterior mean was generally around -0.35, SD 0.15). We will call this the ``informed" prior. For all three priors we set $v=0.025$. \subsection{Results} We fit the model described in the previous section to the flu vaccine data, using age and COPD as covariates. Figure \ref{fig:psmembership} shows the probability of belonging to each principal stratum as a function of age and COPD along with marginal 90\% credible intervals. We find a fairly sharp break in compliance behavior at age 65 (the probability of being a never-taker drops, and seems to be shifted largely to always takers), which appears to hold regardless of COPD status. Possible explanations include patients or providers giving more weight to age-based vaccination guidelines, or better insurance coverage and increased access to services in the older cohort. Figure \ref{fig:outcometz} shows the outcome distributions by age, COPD, and the treatment assigned and received. There is clear evidence of an age/COPD interaction; this is due at least in part to the study design, where all participants under 65 have at least one chronic disease (possibly COPD). This also means that the 65+ population is on average less likely to he hospitalized than the younger cohort, explaining the seemingly paradoxical decrease in the estimated probability of hospitalization at age 65 in the ``No COPD" group. \begin{figure} \begin{center} \includegraphics[width=5in]{flu-figure/PSMembershipTrunc.pdf} \caption{Principal strata memberhsip probabilities by age and COPD, including marginal 90\% credible intervals}\label{fig:psmembership} \end{center} \end{figure} \begin{figure} \begin{center} \includegraphics[width=3.5in]{flu-figure/OutcomeByTZ.pdf} \caption{Log odds of a positive outcome (no hospitalization) by age, COPD, and treatment assignment/receipt}\label{fig:outcometz} \end{center} \end{figure} \subsubsection{Causal effects} We are primarily interested in (partially identified) sample causal effects. As in \cite{Hirano2000} we will consider estimating the intention-to-treat (ITT) effect in each principal stratum: \begin{equation} ITT_s = \frac{1}{n_s}\sum_{i: S_i=s} (Y_i(T_i(1), 1) - Y_i(T_i(0), 0)). \end{equation} where $n_s$ is the number of observations with compliance type $S$. Given a sample from the marginal distribution for $\phi$, and a sample from $\theta$, we can impute each observation's missing principal strata membership and the unobserved potential outcome. With the completed data it is straightforward to compute the sample ITT effects. Computational details are provided in Appendix \ref{app:postmis} We compare results under our three priors to three models from \cite{Hirano2000}: the model with no exclusion restrictions (``none"), both exclusion restrictions (``both"), or the never-taker exclusion restriction (``n"). The ``Hirano (none)" model has very wide standard deviations, which are driven by their use of diffuse, ``off-the-shelf" priors. Their marginal prior for the direct effect of the reminder is approximately normal with mean zero and standard deviation 1.5, which puts significant prior probability on implausible values such as large and/or negative direct effects. Such vague priors are inappropriate for partially identified parameters. In contrast, the BART models all give similar results. The ``BART (0.1)" and ``BART (0.25)" models differ mainly in the width of the posterior standard errors, and then only slightly. The ``BART (0.25)" model assumes that with high probability the magnitude of any direct effect on the log odds is within $\pm 0.5$ -- compare this to the COPD effect, which is estimated to increase the log odds of hospitalization by about 0.35. The ``informed" prior restricts the population effects to be positive but small, which tends to shrink the $ITT_c$ effect toward zero -- the overall $ITT$ effect is identified, so positive effects in the other principal strata lead necessarily to smaller $ITT_c$ estimates than unrestricted models. The substantive conclusion is largely unchanged: there is only modest evidence for the effectiveness of the vaccine, particularly if we assume the direct effect of the reminder is similar in always-takers and compliers. This is unsurprising given the sample size of $n=2,861$, weakness of the encouragement (Fig. \ref{fig:psmembership}), and relative rarity of the outcome (about 8\% of the study participants were hospitalized). However, unlike \cite{Hirano2000} we conclude that the $ITT_c$ effect is actually fairly robust to plausible deviations from the exclusion restrictions. \begin{figure} \begin{center} \includegraphics[width=5.25in]{flu-figure/flures.pdf} \caption{Posterior mean and standard deviations for the sample ITT effects in each principal stratum. ``BART (0.1)" and ``BART (0.25)" use the conditional prior centered at the exclusion restrictions with $\sigma_a=\sigma_n=0.1$ or $0.25$, respectively. ``BART (informed)" includes all prior information. The ``Hirano" models are from \cite{Hirano2000}; the ``n" model assumes the exclusion restriction in never-takers, the ``both" model imposes both exclusion restrictions and the ``none" model has no exclusion restrictions.}\label{fig:flures} \end{center} \end{figure} \subsection{Causal Inference in a Binary Instrumental Variables Model} Let $Z_i, T_i$, and $Y_i$ be the observed values of the treatment assignment (or encouragement, or instrument), treatment received, and outcome for observation $i$, respectively. Let $X_i$ be a vector of baseline covariates. In the flu data, $Z_i=1$ if encouragement (the reminder) was administered, $T_i=1$ if the vaccine was administered, and $Y_i=1$ if the patient was \emph{not} hospitalized. As in \cite{Angrist1996} and \cite{Hirano2000} define the \emph{potential outcomes} $T_i(z)$ and $ Y_i(t,z)$ as the treatment assignment that would have been observed had we fixed $Z_i=z$ and the outcome we would have observed fixing $T_i=t, Z_i=z$, respectively. We will suppress indexing by $i$ for population quantities. We make the stable unit treatment value assumption (SUTVA) \citep{Angrist1996}, i.e. that there is no interference between units and no alternative versions of treatment. \footnote{\cite{Hirano2000} point out that in an infectious disease application with individuals as the unit of randomization this assumption is unlikely to hold exactly, but constitutes a reasonable first order approximation.} Mathematically, SUTVA implies that $T_i(\mathbf{z})=T_i(z_i)$ and $Y_i(\mathbf{t}, \mathbf{z})=Y_i(t_i, z_i)$, where $\mathbf{z}, \mathbf{t}$ are vectors of instrument/encouragement assignment and treatments received (respectively) for the entire sample. In this application the complete vector of binary response variables is \begin{equation} U_i=(T_i(0), T_i(1), Y_i(0,0), Y_i(0,1), Y_i(1,0), Y_i(1,1))', \end{equation} the collection of treatments and outcomes under all possible experimental conditions. However, we observe only $T_i\equiv T_i(Z_i)$ and $Y_i\equiv Y_i(T_i(Z_i), Z_i)$, where $Z_i$ is randomly assigned at the study outset. We can define compliance types or principal strata $S$ based on the possible values for $(T(1), T(0))$ -- see Table \ref{tab:comptype}. \begin{table} \begin{center} \begin{tabular}{cc|ll} $T(1)$ & $T(0)$ & $S$ (Compliance Type) & ~ \\ \hline 0 & 0 & Never Taker & (n) \\ 1 & 1 & Always Taker & (a) \\ 1 & 0 & Complier & (c) \\ 0 & 1 & Defier & (d) \\ \end{tabular} \caption{Compliance types, or principal strata, defined by response patterns across levels of $Z$.} \label{tab:comptype} \end{center} \end{table} We will assume that the encouragement $Z$ is ignorable or randomly assigned (as it is in the flu data). We also assume that there are no defiers (``monotonicity of compliance"), i.e., $ \Pr(S=d\mid \mathbf{X})=0$. In the current setting a defier would be a patient who would \emph{only} receive the vaccine if the reminder was \emph{not} administered, which is quite unlikely. Let $\pi_s(x) = \Pr(S=s\mid \mathbf{X})$ and $\gamma^{tz}_s(x) = \Pr( Y(t,z)=1\mid S=s, \mathbf{X})$ denote the principal strata and potential outcome probability models. Under the above assumptions the potential outcome and principal strata distributions are linked to the joint distribution of observables by the following equations. \begin{align} \Pr(T=1\mid Z=0, \mathbf{X}) &= \pi_a(\mathbf{X})\label{eq:mon-1},\\ \Pr(T=1\mid Z=1, \mathbf{X}) &= \pi_c(\mathbf{X}) + \pi_a(\mathbf{X})\label{eq:mon-2},\\ \Pr(Y=1\mid T=0, Z=0, \mathbf{X}) &= [\pi_c(\mathbf{X})\gamma^{00}_c(\mathbf{X}) + \pi_n(\mathbf{X})\gamma^{00}_n(\mathbf{X})]/[\pi_c(\mathbf{X}) + \pi_n(\mathbf{X})]\label{eq:mon-3},\\ \Pr(Y=1\mid T=1, Z=1, \mathbf{X}) &= [\pi_c(\mathbf{X})\gamma^{11}_c(\mathbf{X}) + \pi_a(\mathbf{X})\gamma^{11}_a(\mathbf{X})]/[\pi_c(\mathbf{X}) + \pi_a(\mathbf{X})]\label{eq:mon-4},\\ \Pr(Y=1\mid T=0, Z=1, \mathbf{X}) &= \gamma^{01}_n(\mathbf{X}),\\ \Pr(Y=1\mid T=1, Z=0, \mathbf{X}) &= \gamma^{10}_a(\mathbf{X})\label{eq:mon-last}. \end{align} \cite{Richardson2010} derive this mixture relationship between principal strata/potential outcome distributions and the observable joint in detail under a range of assumptions about the latent variables (see also \cite{Imbens1997a} and \cite{Richardson2011}). The probabilities on the left hand side completely determine the joint distribution of observables ($Y$ and $T$ given $Z$) and hence constitute a basis for $\phi$. Clearly $\pi$, $\gamma^{01}_n$ and $\gamma^{10}_a$ are one-to-one maps from $\phi$, and are point identified as well. However, $\gamma^{00}_c,\ \gamma^{00}_n,\ \gamma^{11}_c,$ and $ \gamma^{11}_a$ are not. For example, at any point in covariate space $\gamma^{11}_c(x)$ and $\gamma^{11}_a(x)$ must lie on the line segment given by the intersection of the line in equation \eqref{eq:mon-4} and $[0,1]\times [0,1]$, but the data are wholly uninformative about their position on that line segment. In particular, the range of $\gamma^{11}_a(x)$ is \begin{equation} \left( \min\left( 0, \frac{\pi_a(x)+\pi_c(x)}{\pi_a(x)}p_{1\mid 11}(x) - \frac{\pi_c(x)}{\pi_a(x)} \right),\, \max\left( 1, \frac{\pi_a(x)+\pi_c(x)}{\pi_a(x)}p_{1\mid 11}(x) \right) \right)\label{eq:gbound} \end{equation} where $p_{1\mid 11}(x) = \Pr(Y=1\mid T=1, Z=1,\mathbf{X})$. The situation is exactly the same for $\gamma^{00}_c(x)$ and $\gamma^{00}_n(x)$, with the line given by \eqref{eq:mon-3} and bounds similar to \eqref{eq:gbound} (large sample bounds on causal effects within principal strata were introduced by \cite{zhang2003estimation}; see \cite{Richardson2011} for bounds under monotonicity and other assumptions, as well as further references). Point identification for the remaining parameters is often obtained through further assumptions on the distribution of the potential outcomes. The \emph{stochastic exclusion restriction} for compliance type $s$ posits that there is no direct effect of $Z$ on $Y$; that is, $\gamma^{i0}_s = \gamma^{i1}_s$ for $i=0,1$ \citep{Hirano2000}. From \eqref{eq:mon-1}-\eqref{eq:mon-last} it is clear that this achieves point identification for the entire distribution of the potential outcomes. \cite{Hirano2000} anticipated failures of the exclusion restrictions, noting that a reminder about flu shots might also prompt physicians to counsel patients about other preventative measures to avoid contracting the flu. They propose relaxing the exclusion restrictions and resolving the resulting nonidentifiability through prior probability modeling. In this sense our approach and theirs are philosophically similar, but our framework affords us significant flexibility in choosing the model for $\phi$ while transparently embedding prior information about $\theta$, which is difficult to do in their modeling setup. In our subsequent analysis we will avoid imposing any exclusion restrictions. \subsection{Model Specification} Our model for observables decomposes into a treatment model and an outcome given treatment model, i.e., $P(Y,T\mid Z, \mathbf{X}) = P(T\mid Z, \mathbf{X})P(Y \mid T, Z, \mathbf{X})$. We assign each of these a probit BART prior. For the treatment model, randomization of treatment assignment and monotonicity of compliance imply that $\Pr(T=1\mid Z=1, \mathbf{X}) \geq \Pr(T=1\mid Z=0, \mathbf{X})$ for all $\mathbf{X}$ (see equations \eqref{eq:mon-1} and \eqref{eq:mon-2}). We enforce this constraint by rejecting samples from BART where this condition fails at any point in covariate space. More elaborate approaches to enforcing monotonicity are possible but beyond the scope of the present paper. \subsubsection{Partially identified parameters} Recall that we have two pairs of unidentified parameters, $(\gamma^{00}_c, \gamma^{00}_n)$ and $(\gamma^{11}_c,\gamma^{11}_a)$. Fixing one element of each pair would solve the identification problem, so we can take $\theta = (\gamma^{00}_n,\gamma^{11}_a)$ without loss of generality. This is in contrast to \cite{Hirano2000}, who specify a strongly parametric probability model for all four of the unidentified parameters. We consider three priors on $\theta$. All three are of the form \begin{equation} (\mbox{logit}\{\gamma^{00}_n(\mathbf{X})\}, \mbox{logit}\{\gamma^{11}_a(\mathbf{X})\})' = \mu\{\phi(\mathbf{X})\} + h(\mathbf{X})\beta + \epsilon(x)\label{eq:theta-3}. \end{equation} with $\mu(\phi(\mathbf{X})) = (\mbox{logit}\{\gamma^{01}_n(\mathbf{X})\}, \mbox{logit}\{\gamma^{10}_a(\mathbf{X})\})'$, $h(\mathbf{X})=1$ and $\beta=(b_a, -b_n)$. This centers our prior at a proportional odds model, where the reminder increases the odds of a positive outcome by a factor of $\exp(b_a)$ or $\exp(b_n)$ in always or never takers (respectively) at any covariate value. A natural way to complete this prior is to take $b_s\sim N(0, \sigma_s^2)$ for $s=a,n$ which centers the prior at the exclusion restrictions and expresses prior beliefs about plausible effect sizes through $\sigma_s^2$. For illustration we take $\sigma_s=0.1$ or $0.25$ for the current application. \cite{Hirano2000} estimate principal strata-independent total effects of COPD around -0.35 on the log odds scale, so the more diffuse prior covers a plausible range of possible effect sizes for the direct effect of a reminder within non-compliers. We would expect any direct beneficial effect of the reminder on the subsequent hospitalization to be smaller than the detrimental effect of a serious chronic disease like COPD purely on substantive grounds. In the flu application we also have some prior information about likely effect directions, which we can also incorporate in the prior. Any direct effect from the reminder is most likely to be positive, since the reminder probably encourages doctors and patients to take other preventative measures beyond the vaccine. Additionally, \cite{Hirano2000} speculate that the exclusion restriction for never takers is more plausible than for always takers since perceived risk is a key driver of compliance behavior, with low-risk patients more likely to be never takers. A more nuanced view is that the direct effect should be \emph{larger} for always takers than never takers --- even though never takers probably have lower risk on average, we should not rule out the possibility of high-risk never takers who refuse the vaccine due to cost, safety or other concerns. A prior for $\theta$ that reflects these beliefs is $(b_a, b_n)\sim \mbox{{\small\textsc{N}}}(b_0, \Sigma_b)\mathbb{1}(b_a>0, b_n>0)$. For the analysis in the sequel we will take $b_0 = (0.05, 0.0)'$, $\Sigma_b = \mbox{diag}(0.13^2, 0.05^2)$. In additional simulations we find that results are insensitive to plausible values of $\mbox{Cov}(b_a, b_n)$. These particular numerical values were chosen The prior mode is $b_0$, the prior mean is about $(0.125, 0.04)$, and the marginal $90^{th}$ percentile is about 0.25 for $b_a$ and 0.08 for $b_n$. The prior scale for $b_a$ is calibrated so that (with high probability) $b_a$ is smaller in magnitude than the effect of COPD on the hospitalization as reported by \cite{Hirano2000} (the posterior mean was generally around -0.35, SD 0.15). We will call this the ``informed" prior. For all three priors we set $v=0.025$. \subsection{Results} We fit the model described in the previous section to the flu vaccine data, using age and COPD as covariates. Figure \ref{fig:psmembership} shows the probability of belonging to each principal stratum as a function of age and COPD along with marginal 90\% credible intervals. We find a fairly sharp break in compliance behavior at age 65 (the probability of being a never-taker drops, and seems to be shifted largely to always takers), which appears to hold regardless of COPD status. Possible explanations include patients or providers giving more weight to age-based vaccination guidelines, or better insurance coverage and increased access to services in the older cohort. Figure \ref{fig:outcometz} shows the outcome distributions by age, COPD, and the treatment assigned and received. There is clear evidence of an age/COPD interaction; this is due at least in part to the study design, where all participants under 65 have at least one chronic disease (possibly COPD). This also means that the 65+ population is on average less likely to he hospitalized than the younger cohort, explaining the seemingly paradoxical decrease in the estimated probability of hospitalization at age 65 in the ``No COPD" group. \begin{figure} \begin{center} \includegraphics[width=5in]{flu-figure/PSMembershipTrunc.pdf} \caption{Principal strata memberhsip probabilities by age and COPD, including marginal 90\% credible intervals}\label{fig:psmembership} \end{center} \end{figure} \begin{figure} \begin{center} \includegraphics[width=3.5in]{flu-figure/OutcomeByTZ.pdf} \caption{Log odds of a positive outcome (no hospitalization) by age, COPD, and treatment assignment/receipt}\label{fig:outcometz} \end{center} \end{figure} \subsubsection{Causal effects} We are primarily interested in (partially identified) sample causal effects. As in \cite{Hirano2000} we will consider estimating the intention-to-treat (ITT) effect in each principal stratum: \begin{equation} ITT_s = \frac{1}{n_s}\sum_{i: S_i=s} (Y_i(T_i(1), 1) - Y_i(T_i(0), 0)). \end{equation} where $n_s$ is the number of observations with compliance type $S$. Given a sample from the marginal distribution for $\phi$, and a sample from $\theta$, we can impute each observation's missing principal strata membership and the unobserved potential outcome. With the completed data it is straightforward to compute the sample ITT effects. Computational details are provided in Appendix \ref{app:postmis} We compare results under our three priors to three models from \cite{Hirano2000}: the model with no exclusion restrictions (``none"), both exclusion restrictions (``both"), or the never-taker exclusion restriction (``n"). The ``Hirano (none)" model has very wide standard deviations, which are driven by their use of diffuse, ``off-the-shelf" priors. Their marginal prior for the direct effect of the reminder is approximately normal with mean zero and standard deviation 1.5, which puts significant prior probability on implausible values such as large and/or negative direct effects. Such vague priors are inappropriate for partially identified parameters. In contrast, the BART models all give similar results. The ``BART (0.1)" and ``BART (0.25)" models differ mainly in the width of the posterior standard errors, and then only slightly. The ``BART (0.25)" model assumes that with high probability the magnitude of any direct effect on the log odds is within $\pm 0.5$ -- compare this to the COPD effect, which is estimated to increase the log odds of hospitalization by about 0.35. The ``informed" prior restricts the population effects to be positive but small, which tends to shrink the $ITT_c$ effect toward zero -- the overall $ITT$ effect is identified, so positive effects in the other principal strata lead necessarily to smaller $ITT_c$ estimates than unrestricted models. The substantive conclusion is largely unchanged: there is only modest evidence for the effectiveness of the vaccine, particularly if we assume the direct effect of the reminder is similar in always-takers and compliers. This is unsurprising given the sample size of $n=2,861$, weakness of the encouragement (Fig. \ref{fig:psmembership}), and relative rarity of the outcome (about 8\% of the study participants were hospitalized). However, unlike \cite{Hirano2000} we conclude that the $ITT_c$ effect is actually fairly robust to plausible deviations from the exclusion restrictions. \begin{figure} \begin{center} \includegraphics[width=5.25in]{flu-figure/flures.pdf} \caption{Posterior mean and standard deviations for the sample ITT effects in each principal stratum. ``BART (0.1)" and ``BART (0.25)" use the conditional prior centered at the exclusion restrictions with $\sigma_a=\sigma_n=0.1$ or $0.25$, respectively. ``BART (informed)" includes all prior information. The ``Hirano" models are from \cite{Hirano2000}; the ``n" model assumes the exclusion restriction in never-takers, the ``both" model imposes both exclusion restrictions and the ``none" model has no exclusion restrictions.}\label{fig:flures} \end{center} \end{figure} \subsection{Data} Our data are aggregated from three main sources. First, the AAER response variable was obtained from the Center for Financial Reporting and Management (CFRM) at Berkeley's Haas School of Business. Detailed information about the full data set can be found in \cite{dechow2011predicting}. Second, additional firm attributes are obtained from the CompuStat North America Annual Fundamentals database via the Wharton Research Data Service (WRDS). These data are then merged with the AAERs using Global Company Key (GVKEY) by year. Specifically, the features considered are: \begin{itemize}\addtolength{\itemsep}{-0.5\baselineskip} \item fiscal year, \item cash, \item net income, \item capital investments, \item SIC industry code, \item qui tam dummy variable. \end{itemize} \noindent Cash, net income and capital investments are all recorded as a fraction of the firm's total assets. Standard industrial classifications are given in terms of ten major divisions, denoted A-J by the Occupational Safety and Health Administration. The {\em qui tam} dummy variable is derived from the SIC codes; it denotes if a firm is in an industry where persons responsible for revealing misconduct are eligible to receive some part of any award resulting from subsequent prosecution. Similar to \cite{dyck2008corporate} and \cite{jayaraman2010whistle}, our qui tam variable is set to one for firms with SIC code 381x, 283x, 37xx, 5122 or 80xx, which includes healthcare providers and pharmaceutical firms, and airplane, missile, and tank manufacturers. It is reasonable to suppose that firms in these industries have a greater likelihood of any misconduct being exposed as a result of incentivized employees. Finally, a keyword search at the Financial Times web page (www.ft.com) was conducted on each company name and the number of search results was recorded by year. This variable provides a crude measure of media exposure. Although discrepancies between firm names as recorded in CompuStat and firm names as reported in Financial Times articles lead to measurement error of this variable, it still provides a reasonable proxy for name recognition and cultural visibility. Most firms will never be mentioned in any news article; a few firms are routinely mentioned in the press. To adjust for the fact that web traffic has increased over that period, we normalize the search results count by the total number of hits across all companies in a given year. We restrict our analysis to U.S. firms who had positive net income for the given year, considering the period between 2004 and 2010, for a total of $6,641$ unique firms and a total of $n=25,889$ total firm-year observations. \subsection{Model specification} Let $Z_i$ indicate ``cheating" in firm-year $i$ and let $W_i$ indicate ``getting caught" in firm-year $i$. We assume that with some probability cheaters get caught, but there are no firms who get caught when they are not cheating (this is consistent with our operational definition of ``cheating"). Additonally, the data is ``presence-only'' in that we have no confirmation that any given firm is for sure non-cheating. We would like to infer $\Pr(Z_i\mid \mathbf{X})$, which would allow us to compute an aggregate estimate of cheating prevalence over 2004-2010: \begin{equation} \alpha \equiv \displaystyle \sum_i \mbox{Pr}(Z_i=1 \mid \mathbf{X}_i) = \displaystyle\sum_i \frac{\mbox{Pr}(Z_i=1, W_i = 1 \mid \mathbf{X}_i)}{\mbox{Pr}(W_i = 1 \mid Z_i = 1, \mathbf{X}_i)}. \end{equation} Because we only obtain measurements on firms who cheated and got caught, the data are only informative about $\Pr(Z_i=1, W_i=1\mid \mathbf{X})$. Equivalently, for each firm-year we observe $Y_i \equiv Z_iW_i$ instead of $(Z_i, W_i)$, where $Y_i$ indicating whether a firm received an AER (cheated and got caught). Specifically, this is equivalent to the case described in Section \ref{sec:binreg}, with $U_1 = W$ and $U_2 = Z$. To cast this in the framework described in Section \ref{Kadane}, denote \begin{equation} \phi(\mathbf{X}) = \mbox{Pr}(Z=1, W = 1 \mid \mathbf{X}) = \mbox{Pr}(Y = 1 \mid \mathbf{X}); \;\;\; \theta(\mathbf{X}) = \mbox{Pr}(W = 1 \mid Z = 1, \mathbf{X}). \end{equation} Here $\phi(x)$ is simply the distribution of the observed data, and is point identified. We estimate it using the BART model with default priors, except we set $k=3$. This choice shrinks $\phi(\mathbf{X})$ more strongly away from zero or one, which is particularly important in regions of predictor space with very few observations. In particular, it is unrealistic to expect that any company is {\em certain} to both cheat and get caught. The remaining parameter $\theta(x)$ is not identified and an informative prior must be supplied. \subsection{Simulated example}\label{sec:ex} Before turning to the subject-specific prior we developed for our empirical application, it is instructive to consider how our approach performs in a situation where we know what the right answers ought to be. For this purpose we have design a simulated data set emulating the model in \cite{Wang2013}. This will be useful later when comparing our results to those in \cite{Wang2013} on the SEC data. \subsubsection{A partially observed bivariate probit model} Inspired by the approach of \cite{Poirier1980}, \cite{Wang2013} proposes a bivariate probit model for the $(W, Z)$ pairs described above. In this formulation \subsection{Surveillance model} The unidentified function $\theta(\mathbf{X})$ can be thought of as a ``surveillance" probability; it encodes which attributes invite (discourage) SEC scrutiny, making cheaters more (less) likely to be caught. Its effect is to inflate the probability of cheating, which is intuitive since the proportion of caught cheaters $\phi(x)$ represents an obvious lower bound on the proportion of actual cheaters. Our surveillance model takes the form reported in expression (\ref{eq:theta-2}) with $\epsilon_i \iid \mbox{{\small\textsc{N}}}(0, \sigma^2)$ and using a logit link. Some care is required when specifying $h(\mathbf{X})$. Although BART is invariant to monotone transformations, the linear form of the surveillance model is not so it becomes important to choose transformations of the covariates so that the impact of firm features is plausibly scaled and we can specify reasonable values of $\beta$. We therefore scale and shift all variables to reside on the unit interval, taking shifted log transformations of the financial times search hits and net income. We chose to place nonzero coefficients on the (fiscal) year of misconduct, media exposure (as measured by Financial Times search hits), income, cash, and a dummy for qui tam industries. We have specific reasons to expect that these variables are important determinants of the surveillance probability, allowing us to chose informative values for $\beta$. First, note that the frequency of AAERs is substantially higher in earlier years; see Figure \ref{aaers}. AAERs may be filed retroactively, so the opportunity to discover and report misconduct in a given year increases over time. Fitting a curve to the data in Figure \ref{aaers} suggests a coefficient $\beta_{fyear} = -2.5$. Observe that this makes the posterior probability of cheating approximately constant across the years examined, which seems plausible. \begin{figure} \begin{center} \includegraphics[width=3in]{sec-figure/aaer_rate.pdf} \end{center} \caption{AAERs appear more common in more distant years, but this is likely because they may be filed retroactively.}\label{aaers} \end{figure} Second, it is reasonable to assume that media attention naturally draws SEC scrutiny \citep{miller2006press}. The SEC has a vested interest in catching and making examples of any high-profile cheaters. We set $\beta_{FThits}=2$, implying approximately a six-fold difference in the probability of misconduct being discovered between a company with no media exposure and the company with the highest media exposure. Similarly, we set $\beta_{quitam}=1$, implying approximately a two-fold increase in misconduct being discovered for companies in qui tam industries where employees are incentivized to report misconduct. These observations constitute the subjective information contained in our first observation model (A). To determine the intercept term, consider the following argument: AAERs are quite rare, with an aggregate incidence in our sample of only 0.5\%. Potentially this is because very few firms exhibit actionable misconduct, but more likely it is because the SEC has limited resources to identify and pursue violations. Accordingly, one sensible calibration method would be fix the mean probability of discovery across all firms. Fixing this quantity and the other elements of $\beta$, we may then solve for the intercept $\beta_0$. In the case of model A, fixing the average discovery rate to 30\% gives $\beta_0 = 0$. After obtaining posterior samples under model A, we observe that cash appears to have a negative impact on the probability of cheating. In contrast, net income appears to have a positive impact on the probability of cheating. We might surmise that these trends are due to unadjusted surveillance probabilities. For example, one could argue that having large amounts of cash on hand (relative to total assets) provides a measure of ``wiggle room" that makes certain kinds of misconduct harder to discover. Likewise, firms with high income are more likely to draw SEC attention than firms with smaller income streams. To compare our results under these narratives, we specify a second surveillance model (B), with $\beta_{cash} = -1.5$ and $\beta_{income} = 2.5$. Setting the intercept for model B to match the 30\% discovery rate of model A gives $\beta_0 = -0.85$. Surveillance models A and B are shown side-by-side in Table \ref{surveillance}. \begin{table} \begin{center} \begin{tabular}{c|cccccc} &Intercept&Fiscal year &FT.com hits&cash&net income&qui tam\\ \hline $\beta_A$ & $\;\;\;0$& $-2.5$&$2$&$0$& $0$& $1$\\ $\beta_B$ &$-0.85$&$-2.5$& $2$&$-1.50$&$2.5$&$ 1$\\ \end{tabular}\caption{Regression coefficients defining surveillance models A and B. They differ in their intercept terms and their cash and net income coefficients. The intercepts have been adjusted to obtain an average misconduct discovery rate of 30\%}\label{surveillance} \end{center} \end{table} \subsubsection{Upper bounding cheating}\label{cparm} Finally, we introduce an additional parameter $c$ to enforce a stochastic upper bound on the probability of cheating. Recall that the partial identification in this application is driven by the inequality $\mbox{Pr}(Z = 1 \mid \mathbf{X}) = \frac{\phi(\mathbf{X})}{\theta(\mathbf{X})} \leq 1$, which implies $\phi(\mathbf{X}) \leq \theta(\mathbf{X})$; the left hand side of this latter inequality is identified by the data. Extremely high probabilities of cheating are implausible, motivating us to consider alternative truncations: $\mbox{Pr}(Z = 1 \mid \mathbf{X}) = \frac{\phi(\mathbf{X})}{\theta(\mathbf{X})} \leq c$, which implies $\phi(\mathbf{X})/c \leq \theta(\mathbf{X})$ for $c \geq \phi(\mathbf{X})$. Because $\phi(\mathbf{X})$ is identified, the data may contradict any particular value of $c$ by violating $c \geq \phi(\mathbf{X})$ so $c$ is itself partially identified. We continue our modular prior approach, placing a $\mbox{Beta}\left(10 c_0, 10(1-c_0)\right)$ prior on $c$, which {\em a posteriori} is sampled to obey the truncation implied by $\phi(\mathbf{X})$. Intuitively, the prior mean $c_0$ captures prior beliefs about the upper bound on $\mbox{Pr}(Z = 1 \mid \mathbf{X})$, the probability of cheating for any firm. Our surveillance models allow us to include prior information in the form of subject matter knowledge about the impact of various covariates. We are also able to include additional subjective prior information about $\sum_i \mbox{Pr}(W_i = 1 \mid Z_i = 1, \mathbf{X}_i)$ --- the overall average probability of a cheating firm getting caught --- via the intercept terms, and $\mbox{max}_i \mbox{Pr}(Z_i = 1 \mid \mathbf{X}_i)$ --- an upper probability on any firm cheating --- via the prior on $c$. It would be difficult to acheive all these simultaneously without using the modular prior approach, which also facilitated the sensitivity analysis described below and a number of other iterations over candidate surveillance models that we do not have space to describe here. \subsection{Results} We conduct a sensitivity analysis by varying the parameters $\sigma$ and $c$ for both model coefficients $\beta_A$ and $\beta_B$ above. Specifically, we consider two settings of each ($\sigma \in \lbrace 0.25,0.5 \rbrace$ and $c \in \lbrace 0.4,0.8 \rbrace$) for a total of eight candidate models. We study the impact these choices have on both $\mbox{Pr}(Z=1 \mid \mathbf{X})$ as a function of individual predictor variables, and also on the overall misconduct prevalence $\alpha$. Figure \ref{SICboxplot} shows the posterior distribution of the adjusted cheating prevalence under the different models. As can be seen in the left-hand panel, increasing $\sigma$ or $c$ alone has little effect on the overall adjusted cheating prevalence. These two parameters control different aspects of the surveillance uncertainty: a high $c$ implies that any probability of cheating is plausible, whereas a high $\sigma$ allows large deviations from the specified surveillance model logistic term. Note that with the range of $c$ and $\sigma$ chosen, neither surveillance model yields overall prevalence of misconduct greater than 15\%. The right-hand panel of Figure \ref{SICboxplot} shows the posterior prevalence for each different SIC code under the two priors, fixing $(\sigma=0.25, c = 0.4)$. Under both priors, SIC category D, representing ``electricity, gas, steam and air conditioning supply'', shows much lower cheating prevalence than categories (B,E,H), which correspond to ``mining and quarrying'', ``water supply, sewerage, waste management and remediation activities'', and ``transportation and storage'' respectively. \begin{figure} \begin{center} \includegraphics[width=\textwidth]{sec-figure/boxplots.pdf}\\ \includegraphics[width=\textwidth]{sec-figure/SICboxplot.pdf} \end{center} \caption{Top panel: posterior cheating prevalence, white corresponding to the raw (unadjusted) prevalence, pink to prior A and blue to prior B. The four boxplots within each prior correspond to the following combinations for $c$ and $\sigma$ (from left to right): $(\sigma=0.25,c = 0.4),\;(\sigma=0.25, c = 0.8 ),\;(\sigma=0.5, c=0.4),\;(\sigma=0.5, c= 0.8)$. Bottom panel: Posterior cheating prevalence in companies within each SIC code, pink corresponding to prior A and blue to prior B for $(\sigma=0.25,c=0.4)$. }\label{SICboxplot} \end{figure} Because BART is nonlinear, summary plots of the impact of individual covariates are challenging to visualize, even if the surveillance model is relative simple, such as our linear logistic specification. It is instructive, therefore, to examine the implied probability of cheating as one varies individual covariates, for a given firm. That is, how does $\mbox{Pr}(Z=1 \mid \mathbf{X})$ change as a function of $x_j$ while holding $x_{-j}$ fixed? To demonstrate this approach, we focus on a specific firm, ConAgra Foods of Omaha, Nebraska (simply because it yields illustrative plots). Figure \ref{VaryPriorVarySC} shows $\mbox{Pr}(Z=1 \mid \mathbf{X})$, varying media attention, cash, and net income under priors A and B and for various combinations of $c$ and $\sigma$. As expected, the surveillance model coefficients on cash and net income reverse the associated slope of the probability of cheating. High values of both $\sigma$ and $c$ results in posterior credible intervals of up to 40\% probability of cheating for some values of net income. We have reported here only a small number of the possible variations one would presumably want to investigate; we make no claims that models A and B are ideal or even necessarily good or realistic models. Rather, our sensitivity analysis demonstrates a range of possible comparisons that one might undertake when investigating how various assumptions interact with the data via the identified portion of the model. An important upshot of our analysis is that the surveillance model intercept terms---which govern the average probability of misconduct discovery (getting caught) across firm---and the parameter $c$--- which defines the upper bound $\mbox{Pr}(Z_i =1 \mid \mathbf{X}_i) \leq c$ for all $i$ --- play dominant roles in determining the inferred overall prevalence of misconduct. For our choices of 30\% misconduct discovery probability and $c = 0.4$ or $c=0.8$, we find that no more than 15\% of firms engage in accounting misconduct. \begin{figure} \begin{center} \includegraphics{sec-figure/priorAB.pdf} \end{center} \caption{$\mbox{Pr}(Z=1 \mid \mathbf{X})$ varying $x_j$ while holding $x_{-j}$ fixed (at the values of ConAgra Foods) under two surveillance models A (pink) and B (blue). Lines depict the median and shaded areas depict 90\% credibility intervals. Each row represents a different covariate; the three columns correspond to the following $(c, \sigma)$ combinations (from left to right): $(c=0.4,\sigma=0.25),\;(c=0.8,\sigma=0.25),\;(c=0.8,\sigma=0.5)$. }\label{VaryPriorVarySC} \end{figure} \subsection{Data} Our data are aggregated from three main sources. First, the AAER response variable was obtained from the Center for Financial Reporting and Management (CFRM) at Berkeley's Haas School of Business. Detailed information about the full data set can be found in \cite{dechow2011predicting}. Second, additional firm attributes are obtained from the CompuStat North America Annual Fundamentals database via the Wharton Research Data Service (WRDS). These data are then merged with the AAERs using Global Company Key (GVKEY) by year. Specifically, the features considered are: \begin{itemize}\addtolength{\itemsep}{-0.5\baselineskip} \item fiscal year, \item cash, \item net income, \item capital investments, \item SIC industry code, \item qui tam dummy variable. \end{itemize} \noindent Cash, net income and capital investments are all recorded as a fraction of the firm's total assets. Standard industrial classifications are given in terms of ten major divisions, denoted A-J by the Occupational Safety and Health Administration. The {\em qui tam} dummy variable is derived from the SIC codes; it denotes if a firm is in an industry where persons responsible for revealing misconduct are eligible to receive some part of any award resulting from subsequent prosecution. Similar to \cite{dyck2008corporate} and \cite{jayaraman2010whistle}, our qui tam variable is set to one for firms with SIC code 381x, 283x, 37xx, 5122 or 80xx, which includes healthcare providers and pharmaceutical firms, and airplane, missile, and tank manufacturers. It is reasonable to suppose that firms in these industries have a greater likelihood of any misconduct being exposed as a result of incentivized employees. Finally, a keyword search at the Financial Times web page (www.ft.com) was conducted on each company name and the number of search results was recorded by year. This variable provides a crude measure of media exposure. Although discrepancies between firm names as recorded in CompuStat and firm names as reported in Financial Times articles lead to measurement error of this variable, it still provides a reasonable proxy for name recognition and cultural visibility. Most firms will never be mentioned in any news article; a few firms are routinely mentioned in the press. To adjust for the fact that web traffic has increased over that period, we normalize the search results count by the total number of hits across all companies in a given year. We restrict our analysis to U.S. firms who had positive net income for the given year, considering the period between 2004 and 2010, for a total of $6,641$ unique firms and a total of $n=25,889$ total firm-year observations. \subsection{Model specification} Let $Z_i$ indicate ``cheating" in firm-year $i$ and let $W_i$ indicate ``getting caught" in firm-year $i$. We assume that with some probability cheaters get caught, but there are no firms who get caught when they are not cheating (this is consistent with our operational definition of ``cheating"). Additonally, the data is ``presence-only'' in that we have no confirmation that any given firm is for sure non-cheating. We would like to infer $\Pr(Z_i\mid \mathbf{X})$, which would allow us to compute an aggregate estimate of cheating prevalence over 2004-2010: \begin{equation} \alpha \equiv \displaystyle \sum_i \mbox{Pr}(Z_i=1 \mid \mathbf{X}_i) = \displaystyle\sum_i \frac{\mbox{Pr}(Z_i=1, W_i = 1 \mid \mathbf{X}_i)}{\mbox{Pr}(W_i = 1 \mid Z_i = 1, \mathbf{X}_i)}. \end{equation} Because we only obtain measurements on firms who cheated and got caught, the data are only informative about $\Pr(Z_i=1, W_i=1\mid \mathbf{X})$. Equivalently, for each firm-year we observe $Y_i \equiv Z_iW_i$ instead of $(Z_i, W_i)$, where $Y_i$ indicating whether a firm received an AER (cheated and got caught). Specifically, this is equivalent to the case described in Section \ref{sec:binreg}, with $U_1 = W$ and $U_2 = Z$. To cast this in the framework described in Section \ref{Kadane}, denote \begin{equation} \phi(\mathbf{X}) = \mbox{Pr}(Z=1, W = 1 \mid \mathbf{X}) = \mbox{Pr}(Y = 1 \mid \mathbf{X}); \;\;\; \theta(\mathbf{X}) = \mbox{Pr}(W = 1 \mid Z = 1, \mathbf{X}). \end{equation} Here $\phi(x)$ is simply the distribution of the observed data, and is point identified. We estimate it using the BART model with default priors, except we set $k=3$. This choice shrinks $\phi(\mathbf{X})$ more strongly away from zero or one, which is particularly important in regions of predictor space with very few observations. In particular, it is unrealistic to expect that any company is {\em certain} to both cheat and get caught. The remaining parameter $\theta(x)$ is not identified and an informative prior must be supplied. \subsection{Simulated example}\label{sec:ex} Before turning to the subject-specific prior we developed for our empirical application, it is instructive to consider how our approach performs in a situation where we know what the right answers ought to be. For this purpose we have design a simulated data set emulating the model in \cite{Wang2013}. This will be useful later when comparing our results to those in \cite{Wang2013} on the SEC data. \subsubsection{A partially observed bivariate probit model} Inspired by the approach of \cite{Poirier1980}, \cite{Wang2013} proposes a bivariate probit model for the $(W, Z)$ pairs described above. In this formulation \subsection{Surveillance model} The unidentified function $\theta(\mathbf{X})$ can be thought of as a ``surveillance" probability; it encodes which attributes invite (discourage) SEC scrutiny, making cheaters more (less) likely to be caught. Its effect is to inflate the probability of cheating, which is intuitive since the proportion of caught cheaters $\phi(x)$ represents an obvious lower bound on the proportion of actual cheaters. Our surveillance model takes the form reported in expression (\ref{eq:theta-2}) with $\epsilon_i \iid \mbox{{\small\textsc{N}}}(0, \sigma^2)$ and using a logit link. Some care is required when specifying $h(\mathbf{X})$. Although BART is invariant to monotone transformations, the linear form of the surveillance model is not so it becomes important to choose transformations of the covariates so that the impact of firm features is plausibly scaled and we can specify reasonable values of $\beta$. We therefore scale and shift all variables to reside on the unit interval, taking shifted log transformations of the financial times search hits and net income. We chose to place nonzero coefficients on the (fiscal) year of misconduct, media exposure (as measured by Financial Times search hits), income, cash, and a dummy for qui tam industries. We have specific reasons to expect that these variables are important determinants of the surveillance probability, allowing us to chose informative values for $\beta$. First, note that the frequency of AAERs is substantially higher in earlier years; see Figure \ref{aaers}. AAERs may be filed retroactively, so the opportunity to discover and report misconduct in a given year increases over time. Fitting a curve to the data in Figure \ref{aaers} suggests a coefficient $\beta_{fyear} = -2.5$. Observe that this makes the posterior probability of cheating approximately constant across the years examined, which seems plausible. \begin{figure} \begin{center} \includegraphics[width=3in]{sec-figure/aaer_rate.pdf} \end{center} \caption{AAERs appear more common in more distant years, but this is likely because they may be filed retroactively.}\label{aaers} \end{figure} Second, it is reasonable to assume that media attention naturally draws SEC scrutiny \citep{miller2006press}. The SEC has a vested interest in catching and making examples of any high-profile cheaters. We set $\beta_{FThits}=2$, implying approximately a six-fold difference in the probability of misconduct being discovered between a company with no media exposure and the company with the highest media exposure. Similarly, we set $\beta_{quitam}=1$, implying approximately a two-fold increase in misconduct being discovered for companies in qui tam industries where employees are incentivized to report misconduct. These observations constitute the subjective information contained in our first observation model (A). To determine the intercept term, consider the following argument: AAERs are quite rare, with an aggregate incidence in our sample of only 0.5\%. Potentially this is because very few firms exhibit actionable misconduct, but more likely it is because the SEC has limited resources to identify and pursue violations. Accordingly, one sensible calibration method would be fix the mean probability of discovery across all firms. Fixing this quantity and the other elements of $\beta$, we may then solve for the intercept $\beta_0$. In the case of model A, fixing the average discovery rate to 30\% gives $\beta_0 = 0$. After obtaining posterior samples under model A, we observe that cash appears to have a negative impact on the probability of cheating. In contrast, net income appears to have a positive impact on the probability of cheating. We might surmise that these trends are due to unadjusted surveillance probabilities. For example, one could argue that having large amounts of cash on hand (relative to total assets) provides a measure of ``wiggle room" that makes certain kinds of misconduct harder to discover. Likewise, firms with high income are more likely to draw SEC attention than firms with smaller income streams. To compare our results under these narratives, we specify a second surveillance model (B), with $\beta_{cash} = -1.5$ and $\beta_{income} = 2.5$. Setting the intercept for model B to match the 30\% discovery rate of model A gives $\beta_0 = -0.85$. Surveillance models A and B are shown side-by-side in Table \ref{surveillance}. \begin{table} \begin{center} \begin{tabular}{c|cccccc} &Intercept&Fiscal year &FT.com hits&cash&net income&qui tam\\ \hline $\beta_A$ & $\;\;\;0$& $-2.5$&$2$&$0$& $0$& $1$\\ $\beta_B$ &$-0.85$&$-2.5$& $2$&$-1.50$&$2.5$&$ 1$\\ \end{tabular}\caption{Regression coefficients defining surveillance models A and B. They differ in their intercept terms and their cash and net income coefficients. The intercepts have been adjusted to obtain an average misconduct discovery rate of 30\%}\label{surveillance} \end{center} \end{table} \subsubsection{Upper bounding cheating}\label{cparm} Finally, we introduce an additional parameter $c$ to enforce a stochastic upper bound on the probability of cheating. Recall that the partial identification in this application is driven by the inequality $\mbox{Pr}(Z = 1 \mid \mathbf{X}) = \frac{\phi(\mathbf{X})}{\theta(\mathbf{X})} \leq 1$, which implies $\phi(\mathbf{X}) \leq \theta(\mathbf{X})$; the left hand side of this latter inequality is identified by the data. Extremely high probabilities of cheating are implausible, motivating us to consider alternative truncations: $\mbox{Pr}(Z = 1 \mid \mathbf{X}) = \frac{\phi(\mathbf{X})}{\theta(\mathbf{X})} \leq c$, which implies $\phi(\mathbf{X})/c \leq \theta(\mathbf{X})$ for $c \geq \phi(\mathbf{X})$. Because $\phi(\mathbf{X})$ is identified, the data may contradict any particular value of $c$ by violating $c \geq \phi(\mathbf{X})$ so $c$ is itself partially identified. We continue our modular prior approach, placing a $\mbox{Beta}\left(10 c_0, 10(1-c_0)\right)$ prior on $c$, which {\em a posteriori} is sampled to obey the truncation implied by $\phi(\mathbf{X})$. Intuitively, the prior mean $c_0$ captures prior beliefs about the upper bound on $\mbox{Pr}(Z = 1 \mid \mathbf{X})$, the probability of cheating for any firm. Our surveillance models allow us to include prior information in the form of subject matter knowledge about the impact of various covariates. We are also able to include additional subjective prior information about $\sum_i \mbox{Pr}(W_i = 1 \mid Z_i = 1, \mathbf{X}_i)$ --- the overall average probability of a cheating firm getting caught --- via the intercept terms, and $\mbox{max}_i \mbox{Pr}(Z_i = 1 \mid \mathbf{X}_i)$ --- an upper probability on any firm cheating --- via the prior on $c$. It would be difficult to acheive all these simultaneously without using the modular prior approach, which also facilitated the sensitivity analysis described below and a number of other iterations over candidate surveillance models that we do not have space to describe here. \subsection{Results} We conduct a sensitivity analysis by varying the parameters $\sigma$ and $c$ for both model coefficients $\beta_A$ and $\beta_B$ above. Specifically, we consider two settings of each ($\sigma \in \lbrace 0.25,0.5 \rbrace$ and $c \in \lbrace 0.4,0.8 \rbrace$) for a total of eight candidate models. We study the impact these choices have on both $\mbox{Pr}(Z=1 \mid \mathbf{X})$ as a function of individual predictor variables, and also on the overall misconduct prevalence $\alpha$. Figure \ref{SICboxplot} shows the posterior distribution of the adjusted cheating prevalence under the different models. As can be seen in the left-hand panel, increasing $\sigma$ or $c$ alone has little effect on the overall adjusted cheating prevalence. These two parameters control different aspects of the surveillance uncertainty: a high $c$ implies that any probability of cheating is plausible, whereas a high $\sigma$ allows large deviations from the specified surveillance model logistic term. Note that with the range of $c$ and $\sigma$ chosen, neither surveillance model yields overall prevalence of misconduct greater than 15\%. The right-hand panel of Figure \ref{SICboxplot} shows the posterior prevalence for each different SIC code under the two priors, fixing $(\sigma=0.25, c = 0.4)$. Under both priors, SIC category D, representing ``electricity, gas, steam and air conditioning supply'', shows much lower cheating prevalence than categories (B,E,H), which correspond to ``mining and quarrying'', ``water supply, sewerage, waste management and remediation activities'', and ``transportation and storage'' respectively. \begin{figure} \begin{center} \includegraphics[width=\textwidth]{sec-figure/boxplots.pdf}\\ \includegraphics[width=\textwidth]{sec-figure/SICboxplot.pdf} \end{center} \caption{Top panel: posterior cheating prevalence, white corresponding to the raw (unadjusted) prevalence, pink to prior A and blue to prior B. The four boxplots within each prior correspond to the following combinations for $c$ and $\sigma$ (from left to right): $(\sigma=0.25,c = 0.4),\;(\sigma=0.25, c = 0.8 ),\;(\sigma=0.5, c=0.4),\;(\sigma=0.5, c= 0.8)$. Bottom panel: Posterior cheating prevalence in companies within each SIC code, pink corresponding to prior A and blue to prior B for $(\sigma=0.25,c=0.4)$. }\label{SICboxplot} \end{figure} Because BART is nonlinear, summary plots of the impact of individual covariates are challenging to visualize, even if the surveillance model is relative simple, such as our linear logistic specification. It is instructive, therefore, to examine the implied probability of cheating as one varies individual covariates, for a given firm. That is, how does $\mbox{Pr}(Z=1 \mid \mathbf{X})$ change as a function of $x_j$ while holding $x_{-j}$ fixed? To demonstrate this approach, we focus on a specific firm, ConAgra Foods of Omaha, Nebraska (simply because it yields illustrative plots). Figure \ref{VaryPriorVarySC} shows $\mbox{Pr}(Z=1 \mid \mathbf{X})$, varying media attention, cash, and net income under priors A and B and for various combinations of $c$ and $\sigma$. As expected, the surveillance model coefficients on cash and net income reverse the associated slope of the probability of cheating. High values of both $\sigma$ and $c$ results in posterior credible intervals of up to 40\% probability of cheating for some values of net income. We have reported here only a small number of the possible variations one would presumably want to investigate; we make no claims that models A and B are ideal or even necessarily good or realistic models. Rather, our sensitivity analysis demonstrates a range of possible comparisons that one might undertake when investigating how various assumptions interact with the data via the identified portion of the model. An important upshot of our analysis is that the surveillance model intercept terms---which govern the average probability of misconduct discovery (getting caught) across firm---and the parameter $c$--- which defines the upper bound $\mbox{Pr}(Z_i =1 \mid \mathbf{X}_i) \leq c$ for all $i$ --- play dominant roles in determining the inferred overall prevalence of misconduct. For our choices of 30\% misconduct discovery probability and $c = 0.4$ or $c=0.8$, we find that no more than 15\% of firms engage in accounting misconduct. \begin{figure} \begin{center} \includegraphics{sec-figure/priorAB.pdf} \end{center} \caption{$\mbox{Pr}(Z=1 \mid \mathbf{X})$ varying $x_j$ while holding $x_{-j}$ fixed (at the values of ConAgra Foods) under two surveillance models A (pink) and B (blue). Lines depict the median and shaded areas depict 90\% credibility intervals. Each row represents a different covariate; the three columns correspond to the following $(c, \sigma)$ combinations (from left to right): $(c=0.4,\sigma=0.25),\;(c=0.8,\sigma=0.25),\;(c=0.8,\sigma=0.5)$. }\label{VaryPriorVarySC} \end{figure}
{'timestamp': '2015-03-10T01:01:36', 'yymm': '1407', 'arxiv_id': '1407.8430', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8430'}
arxiv
\section*{Abstract} In order to keep up with the increasing demands for capacity, cellular networks are becoming increasingly dense and heterogeneous. Dense deployments are expected to provide a linear capacity scaling with the number of small cells deployed due to spatial reuse gains. However in practice network capacity is severely limited in dense networks due to interference. The primary reason is that the current LTE control plane deployment model has very high latency and is unable to cope with the demand of implementing interference management techniques that require coordination on a millisecond timeframe. This paper presents SwiftC\xspace, a novel low-latency control plane design for LTE networks. SwiftC\xspace's novel contribution is a design for efficiently sending and receiving control plane messages over the LTE spectrum itself, thus creating a direct and low-latency coordination signaling link between small cells and the macro cell. SwiftC\xspace builds on recent work in full duplex radios and shows via prototype implementations that a low latency control plane can be built over the existing LTE network without wasting licensed spectrum. We also show the benefits of SwiftC\xspace in implementing complex interference management techniques, and show that with SwiftC\xspace small cell deployments can achieve almost a linear capacity scaling with every small cell deployed. \section{Background} \subsection{LTE Small Cells and the Control Plane} The 3GPP LTE standards define two base station types (also called evolved NodeBs or eNBs) that are meant for small cell deployments~\cite{bib:3gppbs} - medium range eNBs (metro or micro cells) and local area eNBs (pico cells), see Table~\ref{tab:small_cell}. Future urban outdoor networks are expected to be increasingly heterogeneous with these small cells deployed within existing macro cell coverage areas to increase network capacity and extend service coverage. Typical deployment models suggest deploying around 4-12 small cells per macro sector, or 12-36 small cells per macro eNB assuming a 3-sector macro eNB. With increasing density, there is going to be an increasing need for coordination between groups of small cells as well as between small cells and macrocells in order to use the radio resources more efficiently. \begin{table}[h] \centering \caption{Typical urban small cell properties} \begin{tabular}{|c|c|c|} \hline & \textbf{Microcell} & \textbf{Picocell} \\ \hline \textbf{Max Tx power} & +38dBm & +24dBm \\ \textbf{Range} & 200-500m & 50-100m \\ \textbf{Location} & Outdoor & Indoor/Outdoor \\ \textbf{Simul. Active Users} & 32-64 & 32-64 \\ \hline \end{tabular} \label{tab:small_cell} \end{table} The 3GPP LTE standards specify a control plane for LTE to implement interference coordination and other network management functions. The control plane is built on an X2 interface that interconnects neighboring base stations~\cite{bib:3gppx2}. X2 is a logical point-to-point interface that can be switched over the existing IP transport network that is serving as the backhaul for the base station to the operator's packet core network. The typical organization of the control plane has the macro eNB acting as the logically centralized point with network and user state information being fed via the X2 interface to this coordinator. However, in many cases, the X2 interface is directly used to connect two neighboring small cells when they need to make a localized control decision such as handovers. So the LTE control plane is hybrid; distributed for certain functions (handovers) and logically centralized for some others (interference, load management etc). In this paper we will focus on the interference management aspects of the control plane design since that is typically the most important factor that determines overall network performance and spectral efficiency. The latency and bandwidth of the control plane is therefore dictated primarily by the quality of the backhaul link technology and network used to connect the BSes to the packet core network. While operators typically invest significantly in providing macro BS with dedicated fiber backhaul, they cannot do so for small cells because of their smaller coverage area. The economics of a small cell (in terms of its coverage area and the number of users it can support at any time) does not justify deploying dedicated fiber links to each cell. Further small cells are often deployed in urban hotspots (e.g. bus stops, concerts, downtown etc) where digging and deploying fiber is prohibitively expensive or not possible due to city regulations. Hence operators are forced to use any available backhaul including cable connections, DSL lines etc that are leased from another network operator such as Comcast. The IP latency of these links from any small cell BS to a neighboring BS or to the macro coordinator is on the order of 20-30ms. Bandwidth is typically not an issue since these links are capable of providing 100Mbps speeds which is sufficient for LTE small cells. Some companies have recently proposed using microwave frequencies (5-10GHz) for building point to point backhaul links. However typically these links do not work well for small cell deployments in urban areas. Most city areas where one might deploy a small cell are likely to be concrete jungles, with no direct line of sight path available between neighboring small cells or to the macro eNB. Without LOS, links built on these higher frequencies do not work well since signals at these frequencies do not travel through walls and lose a lot of strength upon reflection. \subsection{Interference Management in the LTE Control Plane} While deploying small cells is becoming increasingly necessary to keep up with the ever-increasing demand for capacity, more small cells also means more cell-edges in the network and therefore more problems of inter-cell interference given that LTE is designed for a frequency reuse of 1. LTE and LTE-Advanced (LTE-A) specify several schemes for interference management, each requiring varying degrees of coordination between neighboring base stations and thereby having different latency and bandwidth requirements over the control plane. \textit{Inter-Cell Interference Coordination} (ICIC) is specified in Releases 8/9 and involves frequency and power domain coordination whereby certain resource blocks are avoided by one cell (or used to serve core users at lower powers) so that they can be used by the edge users of neighboring cells. ICIC requires semi-static coordination on the order of a few seconds and is not sensitive to control plane latencies that is on the order of tens of milliseconds, and also has negligible bandwidth requirements compared to, for example, handover~\cite{bib:x2}. Recently, ICIC has been extended to time domain in \textit{enhanced Inter-Cell Interference Coordination} (eICIC) wherein the macrocell stops using the traffic channel in \textit{Almost Blank Subframes [ABS]} (but keeps broadcasting essential signaling and information at very low power), thereby allowing small cells to serve those UEs who would have otherwise experienced strong interference from the macrocell. Depending on the data traffic demand, the ABS pattern needs to be coordinated on the order of 40ms~\cite{bib:ofdmabook}. In Release 9, the semi-static coordination in ICIC is enhanced to dynamic coordination in Coordinated Multi-Point (CoMP) where resources can be coordinated as rapidly as on a per 1ms sub-frame basis. One form of CoMP is \textit{Coordinated Scheduling/Beamforming} (CS/CB) where neighboring cells coordinate user scheduling and beamforming decisions with each other. The more attractive form of CoMP is \textit{Joint Transmission} (JT), a sub-category of Joint Processing where data to a single UE is transmitted from multiple cells to improve the received signal quality and/or actively cancel interference for other UEs. To do so, the cells have to exchange channel state information (CSI) from each cell to each UE for which transmissions are being coordinated, and then calculate the precoding vectors to use. CoMP requires significantly more backhaul bandwidth - one estimate suggests 770kbps of control information per X2 interface between tri-cell base stations coordinating every 1ms in CS/CB, and several Mbps more of forwarded user data in JT~\cite{bib:qcx2} - as well as a lower control plane latency on the order of a millisecond, and also requires tight synchronization between the coordinating base stations. It is important to mention here that while ICIC, eICIC and CS/CB essentially try to \textit{avoid} or reduce interference, CoMP-JT tries to \textit{exploit} the interfering links to provide capacity gains over other schemes. So ideally, operators want to use CoMP-JT and achieve the higher capacity gains. In the next section, we discuss the impact of the practical control plane latencies on the performance of interference management and specifically CoMP\footnote{In the rest of the paper, by CoMP we will mean CoMP-JT.} to motivate the need for a low-latency control plane. . \section{Conclusion} SwiftC\xspace shows that by physically decoupling the LTE data and control planes, and by using LTE spectrum itself to implement the control plane, it is possible to design and implement sophisticated network and interference management strategies in dense LTE cellular networks. We are currently working on building a testbed that embeds SwiftC\xspace and evaluating the benefits with real world traffic. We are also exploring how to integrate other network management functions such as load management, handoffs etc into the SwiftC\xspace control plane. \section{Design} \label{sec:design} SwiftC\xspace is a control plane design for heterogenous and dense cellular networks consisting of macro and small cells capable of providing moderate bandwidths (on the order of an Mbps) at very low latencies (on the order of a millisecond). Its main component is a novel design for low-latency physical backhaul connectivity to the macro base station for control signaling that enables the use of CoMP and other latency-sensitive network management mechanisms. SwiftC\xspace's key architectural insight is to \emph{physically} decouple the LTE data and control planes in the backhaul. As we saw before, the LTE control plane requires extremely low latencies on the order of 2-3 ms, but is not bandwidth intensive. The LTE data plane on the other hand is less latency sensitive (latencies on the order of 20-30ms are fine for most data traffic and even VoLTE voice calls), but is quite bandwidth sensitive (requires several hundreds of Mbps backhaul connectivity). By physically coupling the data and control planes (i.e. using the same physical backhaul connectivity) and layering both control and data signaling on top, we end up with a situation where the small cell backhaul has to provide \emph{both} very high bandwidth and extremely low latency. Such a stringent requirement limits the backhaul options available to operators, they are forced to use direct fiber links since thats the only technology that can provide the combination of high bandwidth, low latency and reliability that LTE networks need. Such fiber deployments however are prohibitively expensive (imagine deploying fiber in an urban environment such as Manhattan), and have prevented small cell deployments from happening at scale. SwiftC\xspace physically decouples the LTE data and control planes. The key insight is to use the existing LTE macro network itself as the physical layer technology for control plane backhaul. In other words, SwiftC\xspace's control plane signaling happens on LTE frequencies itself between the macrocell and the small cells. By doing so, small cells gain a direct connection to the macro-cell control plane coordinator and an extremely low latency link (on the order of 2-3ms). Operators are then free to choose data plane backhaul that is high bandwidth but doesnt have to satisfy the stringent latency requirements. Such backhaul options are more easily available in the form of cable networks, ADSL and even public fiber networks switched over another operator's wireline networks. SwiftC\xspace does not require additional frequency bands as it creates a control plane within the LTE spectrum itself. However the challenge is that we may now be using extremely scarce and expensive LTE spectrum for control signaling. The key contribution of this paper is a design that enables a very efficient control plane design using existing LTE spectrum. SwiftC\xspace's control plane logical architecture is similar to current LTE deployments and hence it can be easily deployed. As before each small cell connects to a logically centralized coordinator which is deployed at the macrocell within whose coverage area the small cells are located. The small cells use SwiftC\xspace to send and receive control signals from the coordinator. The coordinator is reponsible for making all radio network management decisions. \subsection{SwiftC\xspace Backhaul Design} \label{subsec:backhaul} The key idea in designing SwiftC\xspace's control plane backhaul is to use the existing LTE spectrum itself for control signaling with the macro. In other words, each small cell sends and receives control messages (such as channel state measurements, decisions on which small cells should coordinate using CoMP and how etc.) to and from the coordinating macro on the same LTE spectrum that is used for data transmission. To implement this, each small cell is equipped with a UE (phone) radio, which it uses to connect with the macro base station just like any other phone. It uses this connection to send and receive control messages. Such a design has several attractive properties. First it is extremely simple to deploy, since a macro network is already architected to talk to phones, adding control links to each small cell is trivial. Second, it works quite well in urban non line-of-sight environments because it uses LTE frequencies and physical layer protocols which were designed to work well in such environments. Further it requires no additional spectrum unlike other microwave backhaul based solutions. A natural question however is whether we are using valuable LTE spectrum for control signaling. To see why this might happen, we have to look at how an LTE small cell operates. We focus on LTE FDD (frequency division duplexing)~\cite{bib:3gppphy} small cells in this paper, but the same arguments apply for TDD LTE (Time Division Duplexing). FDD LTE has two frequencies, one for the uplink which is used by the UEs to transmit to the eNB (both macro and small cells), and the other is the downlink which is used by the eNB to transmit to the UEs. However with SwiftC\xspace's design, a small cell eNB also acts as a phone which connects to the macro eNB. This implies that the small cell may have to transmit on the uplink frequency to the macro eNB while it is receiving data from the UEs that are connected to it on the same uplink frequency, and the reverse on the downlink frequency. A natural design choice is to separate the control transmissions/receptions from the small cell eNB to the macro in time with the data transmissions/receptions from the UEs connected to the small cell. In other words turn the small cell into a half duplex LTE mesh node to coordinate transmit and receive. However this can be extremely wasteful. For example to implement CoMP in an urban deployment, small cells have to exchange channel state information with the macro eNB at a rate of 5Mbps or so (assuming walking mobility and the need to send updates at least every 2ms). While the small cell is sending this information to the macro eNB, it cannot receive from its own UEs and throughput is significantly reduced. In fact, we find that sending such control information means that the small cell cannot listen to its own UEs for 25\% of the time. Further such scheduling in the small cell is extremely complex to build because in effect the small cell has to schedule its own transmissions and receptions around when the macro eNB schedules the small cell to transmit/receive control messages to/from it. Our key innovation is to leverage recent work on full duplex radios to turn each small cell into a dual full-duplex radio that can act simultaneously as an eNB (to its clients) and UE (to a macro eNB), see Figure~\ref{fig:arch}. In other words, a small cell equipped with SwiftC\xspace would be able to send control information to a macro eNB while listening to its own clients on the uplink, and at the same time would also be able to receive control signals from the macro eNB while serving its own UEs on the downlink. Thus, the SwiftC\xspace control plane can effectively coexist with the small cell user plane without hurting its capacity. In order to enable this coexistence, SwiftC\xspace must cancel the self-interference caused by the transmission of the small cell eNB at its UE receiver (i.e., on the downlink), and similarly the transmission of its UE at its eNB receiver (i.e, on the uplink), as shown in Figure~\ref{fig:arch}. \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.23]{./figures/arch.png} \caption{Block Diagram: A small cell equipped with SwiftC\xspace. To the existing eNB radio, SwiftC\xspace adds an UE radio and self-interference cancellation units for uplink and downlink. As a result, a SwiftC\xspace small cell can act as an eNB on one side (send/receive data to/from clients) and UE on the other (send/receive control to/from a macro coordinator).} \label{fig:arch} \end{center} \end{figure} \subsubsection*{How much self-interference cancellation is needed?} \label{subsubsec:cancellation} Each of the uplink and downlink self-interference canceling units must be able to reduce the maximum transmit power to the noise floor at the corresponding receiver over the entire bandwidth of operation (any residual interference below the noise floor does not affect performance). Consequently, the total self-interference cancellation required for each Tx-Rx pair i.e., uplink Tx-Rx and downlink Tx-Rx, is the difference between the \textit{maximum Tx power} and the \textit{Rx noise floor} (expressed in dBm). \textbf{Rx noise floor:} The receiver noise floor depends on the bandwidth B and the noise figure NF of the receiver, and can be estimated as -174dBm/Hz (thermal noise at 290K) + 10log$_{10}$(B) + NF (in dB), see Table~\ref{tab:noise_floor}. \begin{table}[h] \begin{center} \caption{Typical receiver noise floors} \begin{tabular}{|c|c|c|c|c|} \hline & & \multicolumn{3}{c|}{Receiver noise floor (dBm)} \\ \cline{3-5} Receiver & NF & 5MHz & 10MHz & 20MHz \\ \hline \textbf{Small cell eNB} & 5dB & $-$102 & $-$99 & $-$96 \\ \hline \textbf{Small cell UE} & 9dB$^*$ & $-98$ & $-$95 & $-$92 \\ \hline \end{tabular} \label{tab:noise_floor} \end{center} {\small $^*$assuming it to be the same as for a conventional UE} \end{table} \textbf{Max Tx power}: \textit{First}, on the uplink, we observe that a small cell UE can be expected to experience much lower path losses to a macro eNB than a conventional UE since it would typically be located 10m or higher above the ground, and can therefore afford to transmit at a lower power. In fact, using the 3GPP Spatial Channel Model (SCM)~\cite{bib:3gppscm}, we find that the channels seen by an urban microcell UE (12.5m high) located at the edge of a 1km-radius macrocell (32m high) can be expected to be as much as 30dB stronger on average than by a conventional UE (1.5m high) at the same distance, see Figure~\ref{fig:channelUEcdf} (Left). We also find that at 23dBm, the maximum specified Tx power for UEs, the Rx SNR at the macro eNB is nearly 50\% likely to be in excess of the maximum useful SNR ($\sim$18dB, corresponding to the highest MCS for uplink i.e., 64QAM and 0.85 code), thereby leading to a wastage of power, see Figure~\ref{fig:channelUEcdf} (Right). Instead, if the small cell UE lowers its Tx power by 5dB, it can reduce the likelihood of power wastage by 25\% and yet stay connected for more than 95\% of the time (note that these are the worst case estimates - the small cell is located farthest from the macrocell). Thus a practical estimate for the maximum Tx power of a small cell UE is 18dBm. \textit{Second}, on the downlink, we believe the expected transmit power used will be around 30dBm. The reason is that typical small cell deployments are for covering hotspots such as bus-stops, and hence the coverage area required is small. Further small cells are expected to be deployed on light poles, walls etc, and hence cannot afford to be big and heavy. Using transmit powers higher than 30dBm results in big and hot power amplifiers that require large boxes to cool them and make it infeasible to build a ``small" cell. Therefore most actual small cell deployments will have compact base stations that have a transmit power around 30dBm (1 watt). \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.22]{./figures/small_cell_ch_quality.png} \caption{(Left) An illustration of channel gains seen by a small cell UE (12.5m high) and a conventional UE (1.5m high) to a macro eNB (32m high) located 1km away. (Right) Cdf of Rx SNR at the macro eNB for two different small cell UE Tx powers (23dBm and 18dBm).} \label{fig:channelUEcdf} \end{center} \end{figure} \vspace{-2.5mm} Table~\ref{tab:cancellation} summarizes the self-interference cancellation requirements for SwiftC\xspace. It is important to mention here that although wider bandwidth systems require lesser cancellation owing to their higher noise floor, in practice it is more difficult to match the cancellation blocks over wider bandwidths and hence, self-interference cancellation is practically much harder in wider bandwidth systems. \begin{table}[h] \begin{center} \caption{SwiftC\xspace: Cancellation requirements} \begin{tabular}{|c|c|c|c|c|} \hline & Max & \multicolumn{3}{c|}{Cancellation required (in dB)} \\ \cline{3-5} Band & P$_{\text{transmit}}$ & 5MHz & 10MHz & 20MHz \\ \hline \textbf{Uplink} & 18dBm & 120 & 117 & 114 \\ \hline \textbf{Downlink} & 30dBm$^*$ & 128 & 125 & 122 \\ \hline \end{tabular} \label{tab:cancellation} \end{center} {\small $^*$assuming the small cell is a microcell} \end{table} \subsubsection*{How does SwiftC\xspace achieve this cancellation?} SwiftC\xspace leverages recent work on full-duplex radios~\cite{bib:full-duplex} and employs a combination of analog and digital cancellation blocks to provide the required self-interference cancellation on both uplink and downlink frequencies. In a nutshell, the self-interference in each Tx-Rx pair consists of (1) about 65-70dB of transmitter (broadband) noise generated by the components of the analog RF Tx front end, which must be necessarily canceled in the analog domain (by taking a copy from where it is generated), and (2) about 50-55dB of the remaining Tx signal which consists of nearly 20dB of residual non-linearities (after analog cancellation) and 30-35 dB of linear components, and can be canceled in the digital domain. We refer the readers to~\cite{bib:full-duplex} for the details of the algorithms used to design the analog and the digital cancellation blocks that can meet the above requirements. In Section~\ref{sec:eval}, we build a prototype and demonstrate that SwiftC\xspace can indeed provide the required self-interference cancellation with only a marginal (1.7dB) increase in noise floor. \subsection{Increasing efficiency} \label{subsec:efficiency} One of the major concerns with SwiftC\xspace is whether it expends a lot of scarce LTE spectrum for coordination. We have described how SwiftC\xspace can leverage full duplex radios to ensure that no capacity is lost at the small cell. However, SwiftC\xspace does consume some macrocell resources both on the uplink and the downlink, and addressing this overhead is a key aspect in the design of SwiftC\xspace. In the following discussion, we show how we can exploit the properties of SwiftC\xspace's physical backhaul medium itself, namely the LTE physical layer, to increase the efficiency of SwiftC\xspace. \subsubsection*{How can we optimize the overhead on macro resources?} \textit{First}, we note that the channels a macro eNB would see to the small cell UEs over SwiftC\xspace can be expected to be \textit{much more static} and of \textit{much better quality} than to mobile UEs located at comparable distances. This is because the small cells are typically installed 10m or higher above the ground and hence their path losses are significantly lower~\cite{bib:3gppscm}, see Figure~\ref{fig:channelUEcdf} (Left). In addition to making a case for introducing higher modulation and coding schemes for this special category of small cell UEs to exploit the naturally good channel quality, this offers the advantage of \textit{requiring much lesser time-frequency resources for communicating a given amount of control information}. For e.g., using 3GPP SCM~\cite{bib:3gppscm}, we find that from the perspective of a macrocell, providing 1 Mbps of average uplink throughput to a small cell UE located at the edge (1km away) is equivalent to denying only 183.4 Kbps of uplink throughput to a UE located just 500m away and just 39.0 Kbps to a UE located at the cell-edge. Thus, using the wireless physical layer as the backhaul medium works to SwiftC\xspace's advantage by \textit{lowering the effective overhead} it incurs on macrocell capacity. \textit{Second}, we observe that depending on the control information, which mostly relates to some form of channel state information (recall that SwiftC\xspace is intended for communicating control information that changes on the order of 1ms), there exists a scope for exploiting redundancies in the control information itself to \textit{optimize the overhead}. For example, when a small cell has to forward the CSI of its clients over an LTE resource block (consisting of 12 sub-channels) to the macro coordinator, it can exploit the strong correlation between the narrow-band LTE sub-channels ($\sim$15KHz) to compress the information. Similarly, even though the channels decorrelate much faster over time in dense urban environments, we find that non-trivial compression can also be achieved across time by scheduling clients over consecutive sub-frames on the same sub-channels. In essence, if $\vec{h}^T$ = $[h_0, h_2, \cdots, h_{N-1}]$ represents the channel coefficients seen by a client to a small cell eNB across $N$ consecutive sub-channels in a given sub-frame (or $N$ consecutive sub-frames over a given sub-channel), then the small cells can transform $\vec{h}$ into another domain using an appropriate sparsity transform $T$ such that the resulting sequence $\widetilde{\vec{h}} = T\vec{h}$ is sparse. As a result, $\widetilde{\vec{h}}$ can be represented using much fewer bits than $\vec{h}$ for a given level of distortion. Note that these compressions can also be performed for SwiftC\xspace by the clients themselves before feeding back their CSI to the small cells, but that might require firmware changes to the current LTE UEs. Since we want to keep the design of SwiftC\xspace independent of UEs, we let the small cells optimize the representation of the control information before sending over SwiftC\xspace. \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.22]{./figures/corr_illustration.png} \caption{Estimates of correlation across adjacent sub-channels (top) and sub-frames (bottom) for a randomly placed UE, obtained by averaging over a particular realization of the channel over 512 sub-channels and 500 sub-frames. The plots on the right are zoomed-in versions of the plots on the left and show a strong correlation over a block of 12 time/frequency slots.} \label{fig:correlation} \end{center} \end{figure} Although we do not deal with optimal sparsity transforms in this paper, we show in Section~\ref{sec:eval} that the following simple and practical encoding scheme can reduce the overhead of SwiftC\xspace to a negligible fraction of the macrocells capacity on the uplink. If $q$ bits of magnitude and $q$ bits of phase are required to reliably represent a channel coefficient, the Channel Quality Indicator CQI and Channel Phase Indicator CPI can belong to one of $2^q$ quantization levels. In order to encode and send each coefficient along consecutive sub-channels or sub-frames, send the first coefficient of the series $h_0$ using $q+q$ bits, and then send the CQI of subsequent coefficient $h_n$ as (1) bit \texttt{0}, if CQI$_n$ = CQI$_{n-1}$, (2) bits \texttt{10}, if CQI$_n$ $-$ CQI$_{n-1}$ = -1, (3) bits \texttt{11}, if CQI$_n$ $-$ CQI$_{n-1}$ = 1, or (4) $q$ bits otherwise (and similarly for CPI) . This scheme essentially encodes the \textit{increment} using Huffman coding if the increment is within one quantization level, otherwise it \textit{refreshes} it i.e., sends the full $2q$ bits for the coefficient. In Section~\ref{sec:eval}, we show that this scheme works very well in practice because for typical LTE OFDM channels, the increments over one sub-channel or sub-frame is less than one quantization level with a very high probability (with an increment of 0 being more likely than an increment of $\pm1$). In addition, we note that there typically exists significant intra-site correlation between the channels of a user to the different antennas of a small cell as well as inter-site correlation between the channels seen to neighboring cells~\cite{bib:3gppscm}, which can be exploited similarly for lowering the overhead further, if needed. Also, we note that the control information on the downlink will usually be a few bits per interface per sub-frame, usually representing a decision index or a network state indicator, for e.g. PMI for interference management. Combined with the facts that a macro eNB typically has a much larger transmit SNR and sees very strong channels to the small cell UEs, we believe that SwiftC\xspace will have a negligible impact on the overall downlink capacity of the macrocell. \subsection{Illustration: Interference management with SwiftC\xspace} Now that we have described the design of SwiftC\xspace, we take up a typical example of a dense cellular network consisting of a macrocell and several smalls and illustrate how SwiftC\xspace can be used for interference coordination in small cells. \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.23]{./figures/hetnet.png} \caption{Illustration of an urban hetnet. A 3-microcell cluster (equipped with SwiftC\xspace) is deployed in a sector of a tri-sector macrocell.} \label{fig:hetnet} \end{center} \end{figure} \vspace{-2.5mm} Figure~\ref{fig:hetnet} illustrates a variety of interference scenarios in an urban microcell cluster deployed within a sector of a 3-sector macrocell. Clients A and B are edge users in their respective microcells and see strong interference from their neighboring micro eNBs. Client C lies in the core of microcell 3 but might be seeing strong interference from the macro eNB. Client D is a high mobility client who happens to be within the coverage area of microcell 2 at this instant. A typical network interference management scheme might choose to \begin{Enumerate} \item let client D be served by the macro eNB even though it lies within the microcell cluster since it is not going to stay in the cluster for long anyway. \item let client C be served by microcell 3, and \texttt{AVOID} or reduce interference from the macro eNB (for e.g., eICIC) if its interference is strong, otherwise \texttt{IGNORE} interference. \item \texttt{EXPLOIT} interference for client A using CoMP joint transmission by microcells 1 and 2. \item \texttt{EXPLOIT} interference for client B using CoMP joint transmission by all three microcells. \end{Enumerate} While clients C and D can be served with little or no control signaling between the different eNBs, the microcells need to coordinate on the order of a millisecond to serve clients A and B using CoMP. If the microcells are equipped with SwiftC\xspace, this low-latency coordination is simple to execute. Figure~\ref{fig:coordination} summarizes the coordination mechanism for a $2\times 2$ scenario. (a) The clients report to their serving micro eNBs on the uplink their respective channels to the two micro eNBs. (b) The micro UEs process and forward the compressed CSI via SwiftC\xspace on the uplink. The macro eNB replies back with coordination parameters (PMI, powers, schedules etc.) on the downlink. All this time while the micro UE is communicating with the macro eNB, SwiftC\xspace's self-interference cancellation blocks ensure that the micro eNB can keep communicating with its other clients as usual both on the uplink and the downlink. (c) The micro eNBs precode and jointly transmit to the clients on the downlink. \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.22]{./figures/coordination_quickc.png} \caption{Illustration of coordination over SwiftC\xspace.} \label{fig:coordination} \end{center} \end{figure} \vspace{-2.5mm} \subsection{SwiftC\xspace: Latency Guarantees} Since SwiftC\xspace uses LTE data channels to carry control traffic, it inherits the user-plane latency that LTE itself guarantees. However, there are a few significant differences that promise to make SwiftC\xspace's latency guarantees even better. \textit{First}, since SwiftC\xspace carries critical control information, the macro eNB can prioritize this traffic including pre-allocating resource blocks, which would mean lesser processing delays and lesser waiting times. Consequently, SwiftC\xspace can provide a best-case one-way latency of 1 TTI (Transmission Time Interval), which is 1ms in current LTE standards, and an average one-way latency of 1.5 TTIs that includes an average waiting time of 0.5 TTI until the start of the next sub-frame. \textit{Second}, as the wireless channel that SwiftC\xspace operates over is significantly stronger (owing to lower path losses at the heights at which small cells are typically installed), SwiftC\xspace traffic can be expected to suffer lesser re-transmissions and can consequently guarantee a better average latency. \textit{Third}, our simulations have shown the typical control packets to be lesser than 0.5ms in duration, so the latency of SwiftC\xspace is largely limited by the TTI defined in current standards and will automatically improve as the standards evolve to support shorter transmissions. Since one use of the control plane involves one use each of SwiftC\xspace's uplink and downlink, SwiftC\xspace can provide a best-case latency of 2 TTIs (= 2ms in current standards) and an average two-way latency of 3 TTIs. The total coordination latency however includes the sum of the feedback and processing delays, and can be expected to be 1-2ms higher. Figure~\ref{fig:timeline} shows a typical coordination timeline for the example illustrated in Figure~\ref{fig:coordination}. \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.22]{./figures/timeline.png} \caption{Example of a coordination timeline (cf. Figure~\ref{fig:coordination}).} \label{fig:timeline} \end{center} \end{figure} \vspace{-2.5mm} \section{Evaluation} \label{sec:eval} In this section, we \begin{Enumerate} \item design a prototype of SwiftC\xspace's backhaul and demonstrate that it can provide the highest self-interference cancellation required at the widest bandwidth supported by LTE (namely 122dB at 20MHz). \item evaluate the bandwidth requirements of the SwiftC\xspace plane and show that it translates to a negligible overhead in terms of the overall macro capacity. \item simulate the performance of interference coordination techniques such a CoMP in a dense LTE macrocell (containing several microcells) and show that the overall network capacity using SwiftC\xspace can scale linearly with density ($N\times$ increase with $N$ small cells), something that the current X2 over IP control planes fall way short of providing. \end{Enumerate} \subsection{Implementation of SwiftC\xspace} We design and build a prototype of SwiftC\xspace to evaluate its novel physical backhaul design for the LTE control plane. The goal is to show that it is possible to implement a full duplex LTE small cell that connects to the macro cell as a UE for sending and receiving conrol plane traffic. The primary determinant of this is whether SwiftC\xspace can implement the self-interference cancellation needed to build the full duplex capability with the small cell eNB and the UE. To experimentally verify this, we build a prototype with the following components, see Figure~\ref{fig:setup}: \begin{Itemize} \item a \textit{transmitter} (implemented using a vector signal generator) that transmits standard OFDM signals at 2.4GHz over 20MHz, the widest bandwidth that LTE supports. \item an \textit{RF power amplifier} that boosts the transmit power to 30dBm, the maximum that a SwiftC\xspace-equipped small cell radio is expected to transmit at. \item a \textit{Tx antenna} and an \textit{Rx antenna} that act as the SwiftC\xspace Tx-Rx pair, and correspond respectively to the antennas on the small UE radio and the small cell eNB radio on the uplink and vice-versa on the downlink. \item an \textit{analog cancellation board} which implements fixed delay lines and programmable attenuators that can execute the analog cancellation algorithm proposed in~\cite{bib:full-duplex}. \item a \textit{receiver} (implemented by a spectrum analyzer) that converts the analog received signal into digital I-Q samples. The widely-used software radios such as USRPs and WARPs typically have very poor noise floors ($\sim-85$dBm over 20MHz) and do not let us demonstrate the functioning of SwiftC\xspace for typical UE and eNB radios whose noise floors are at least 5-7dB better, see Table~\ref{tab:noise_floor}. Therefore we use a commercial radio test equipment (-90dBm noise floor at 20MHz) for implementing our receiver. \item a \textit{digital cancellation block} implemented in software (MATLAB) using the algorithm proposed in~\cite{bib:full-duplex} that acts on I-Q samples from the spectrum analyzer. \end{Itemize} \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.23]{./figures/setup.png} \caption{Experimental setup of a SwiftC\xspace Tx-Rx pair.} \label{fig:setup} \end{center} \end{figure} Our goal here is to show that SwiftC\xspace can provide the required self-interference cancellation required on both uplink and downlink over the widest bandwidth (20MHz) that LTE supports. Note that self-interference cancellation is more difficult when the bandwidth is larger since matching the response of the cancellation blocks to wider bandwidths is practically much harder. Figure~\ref{fig:expcancellation} shows the cancellation performance of our prototype. The transmit signal is a standard LTE-like OFDM signal at 2.4GHz and 32dBm (35dBm at power amplifier output followed by a 3dB cable loss). The analog cancellation board reduces the signal to -40dBm (72dBm cancellation) while the digital cancellation board clears up another 50dB of self-interference to reduce it to the noise floor. The result is 122dB of total cancellation, the maximum that SwiftC\xspace needs to provide at 20MHz, see Table~\ref{tab:cancellation}. The effective increase in noise floor, as measured from the samples after digital cancellation, is 1.7dB. \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.5]{./figures/wideband_120.png} \caption{Self-interference cancellation provided by SwiftC\xspace prototype. The 32dBm transmit signal over 20MHz is reduced in steps by 72dB (analog cancellation) and 50dB (digital cancellation) to the noise floor at -90dBm.} \label{fig:expcancellation} \end{center} \end{figure} Note that the cancellation requirement on the uplink is smaller (only 114dB at 20MHz) and can be achieved by this same setup, although we omit any experimental results for the uplink since our radio test equipment cannot emulate the noise floors of commercial eNB radios. In the rest of this section, we treat the self-interference cancellation blocks as a blackbox that raises by the noise floor at the small cell eNB and the small cell UE radios by 1.7dB. Next we turn to simulations to evaluate the performance of the SwiftC\xspace control plane in practical LTE small cell deployments. The simulations use the same deployment conditions and channel models that are used by the LTE standards body to evaluate new proposals for standardization, and hence are considered to be quite representative. Further, its infeasible except for the largest operators to actually be able to deploy a full scale system implementation of SwiftC\xspace and evaluate it under realistic conditions. Hence we turn to detailed simulations. \subsection{SwiftC\xspace benchmarks} In this subsection, we benchmark SwiftC\xspace on the following two aspects. \begin{Enumerate} \item How much control traffic does SwiftC\xspace need to support, assuming that resources would need to be coordinated on per 1ms sub-frame basis and that CSI is going to be the dominant form of control information? (Section~\ref{subsec:traffic}) \item What overhead does this traffic incur on the uplink capacity of the macrocell? (Section~\ref{subsec:impact_macro}) \end{Enumerate} \subsubsection{Bandwidth requirements} \label{subsec:traffic} In order to estimate the bandwidth requirements of SwiftC\xspace, we analyze from the perspective of a single small cell. A small cell serves its clients by allocating each of them one or more resource blocks (RBs), each consisting of 12 sub-channels, for one or more sub-frames. Let us look at how many bits would be needed to represent the channel state information of a client over an RB in each sub-frame (i.e., per eNB-UE antenna pair). Each channel coefficient can be reliably represented using 6 magnitude bits and 6 phase bits, i.e. the channel quality indicator (CQI) and the channel phase indicator (CPI) each belongs to one of 64 levels (current LTE systems use a 4-bit CQI feedback, but we have observed that advanced functions like CoMP need a more precise representation in order to avoid precoding errors). Consequently, we need $12\times12$ uncompressed bits to represent the channel coefficients per RB per 1ms, which translates to a rate of 144Kbps for one RB and 14.4Mbps for a 20MHz LTE system (100 RBs). This is of course too high a requirement from a single small cell (note that a macrocell would need to support several such small cells within each sector) and needs to be reduced in a way that does not affect the quality of control information. \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.22]{./figures/freq_compr.png} \caption{Probabilities of increments of CQI/CPI across consecutive sub-channels} \label{fig:freq_compr} \end{center} \end{figure} However, as we show in Figure~\ref{fig:freq_compr}, CQIs and CPIs hardly ever change by more than one quantization level over one sub-channel. In fact, with 6+6 bits of quantization, they remain the same with a 73\% probability and change by $\pm$1 level with a 24.5\% probability. With such strong correlation, a simple sparsity transform such as the Fourier transform can provide significant compression at almost no increase in distortion i.e., we can represent the channels across a resource block just by 6+6 bits of their mean (dc coefficient) which carries most of the information. In addition, if we use the simple encoding scheme that we had described in Section~\ref{subsec:efficiency} for exploiting correlation across sub-frames, we would require 4.47+3.47 bits on average for every sub-frame after the first, using the probabilities computed in Figure~\ref{fig:time_compr}. \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.22]{./figures/time_compr.png} \caption{Probabilities of increments of CQI/CPI across consecutive sub-frames} \label{fig:time_compr} \end{center} \end{figure} As a result, the total requirement over SwiftC\xspace can be expected to be around 10Kbps per RB. Since each small cell is expected to share the channels seen by each of its clients not just to itself but also to at least 1-2 neighboring cells and assuming each small cell would need coordination for $\sim50\%$ of its radio resources (the remaining resources would typically be used with \texttt{IGNORE} for core users or \texttt{AVOID} i.e., eICIC, with the macro), the effective required rate is going to be $\sim3\times0.5\times10$ Kbps per RB. This means that at the highest rate of coordination (i.e., per 1ms) with up to 2 neighbors for each client and for carrying full resolution channel state information without any increase in distortion, SwiftC\xspace would need to support about 15Kbps per RB, or equivalently 1.5Mbps over 20MHz. The above analysis is for the average case scenario. In the worst case scenario, the control signaling rate would be a factor of two higher since that corresponds to using coordination over the entire set of resource blocks. Due to its full duplex nature, having to send such control signaling traffic to the macrocell from the small cell has almost no impact on the small cell's capacity itself, we are getting this control signaling for free by transmitting at the same time the small cell is receiving on the uplink frequency. However we do consume macrocell resources, whose impact we quantify next. \subsubsection{Impact on macrocell capacity} A single macrocell can be expected to cover 4 or more small cells within each sector, so the total uplink capacity that it needs to provide for SwiftC\xspace can be expected to be in excess of 6Mbps. Does that mean SwiftC\xspace robs 6Mbps or more of uplink capacity straight from the UEs who could have otherwise used the resources in SwiftC\xspace's absence? The answer is not really, and the reason as we had mentioned in Section~\ref{subsec:efficiency} is that the small cell UEs typically see much stronger and static channels, and can very often operate at the highest modulation and coding rate even when deployed at the edge of the macrocell, while the corresponding rates over the same time-frequency resources are much lower for UEs located closer to the ground. Figure~\ref{fig:impact_macro} shows the average \textit{loss} in the capacity of an UE connected to the macrocell, and located at 500m and 1000m away, as a function of the capacity requirements of SwiftC\xspace. For e.g., even for an UE located in the core of the macrocell, providing 6Mbps on the uplink to SwiftC\xspace is equivalent to denying only 1.1Mbps to the UE. \label{subsec:impact_macro} \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.23]{./figures/impact_macro.png} \caption{Average loss of uplink capacity for an UE connected to the macrocell as a function of the SwiftC\xspace capacity requirements.} \label{fig:impact_macro} \end{center} \end{figure} The main takeaway from this analysis is that although SwiftC\xspace requires to carry control traffic on the order of several hundreds of Kbps or even a few Mbps on the data channels of the macrocell, the impact on the UE uplink throughput is much lesser. \subsection{Interference management with SwiftC\xspace} In order to demonstrate the interference coordination benefits that SwiftC\xspace can provide, we simulate an urban hetnet consisting of a macrocell of 1km radius and a variable number of microcells deployed within the coverage area of the macrocell. The simulation parameters are summarized in Table~\ref{tab:simpar}. We generate 1000 users over the region distributed uniformly at random, and randomly assign them a velocity out of 1kmph, 5kmph and 30kmph (each velocity corresponds to a different coherence time and therefore sees different rates of fading). We implement a simple scheduler that works broadly as follows for each user. \begin{Itemize} \item if the user is moving at 30kmph, it associates it with the macrocell irrespective of its proximity to microcells. Otherwise, \item if the strongest channel seen by the user (in terms of Rx SNR) to any eNB is at least 15 dB stronger than the second strongest, it associates the user with that eNB who serves it using \texttt{IGNORE} (i.e., by treating interference as noise). Else, \item if the second strongest channel is at least 15dB better than the third strongest (if not, if the third strongest is 15dB better than the 4th strongest), it associates the user with the two (or three) strongest eNBs who serve it using CoMP. Else, \item if there are four or more very strong interferers, one or more of them \texttt{AVOID} interference such that the rest can serve using CoMP. \item if there are multiple users associated to an eNB, it uses round-robin scheduling for serving the users. \end{Itemize} Note that the above scheduling need not be the best way of managing interference in a network and there might optimal schedulers that can provide higher network capacities; however, our focus here is solely on demonstrating the link-level gains that coordination techniques such as CoMP can provide when they have a low-latency control plane like SwiftC\xspace at their disposal. \begin{table}[h] \centering \caption{Simulation Parameters} \begin{tabular}{|c|c|c|} \hline \textbf{Parameter} & \textbf{Value/Setting} \\ \hline Cellular Layout & 1 macro (1km) \\ (Radius) & Variable micro (200-600m)\\ \hline Channel Model & 3GPP SCM~\cite{bib:3gppscm}\\ \hline Carrier Frequency & 2GHz \\ \hline LOS & None \\ \hline Bandwidth & 5MHz (OFDM) \\ \hline Tx power (dBm)$^\dagger$ & 62, 30, 18$^*$ \\ \hline Rx noise floor (dBm)& -105, -102, -98$^*$\\ \hline Height (m) & 32, 12.5, 1.5$^*$\\ \hline UE velocity (kmph) & 1, 5, 30 \\ \hline \end{tabular} \label{tab:simpar} \end{table} \vspace{-2.5mm} {\small $^\dagger$includes antenna gains} {\small $^*$macrocell, microcell, UE respectively} \medskip We use a MATLAB implementation~\cite{bib:matlab} of the 3GPP Spatial Channel Model (SCM)~\cite{bib:3gppscm} for generating the time-varying channel matrices. We use OFDM with 512 subcarriers over 5MHz, since the SCM documentation claims that the model might not be suitable for systems with wider than 5MHz bandwidths. \subsubsection{Impact on overall network capacity} In order to evaluate the impact that a low-latency control plane like SwiftC\xspace can have on the overall capacity of a network, we simulate our test macrocell network with increasing number of microcells (2-7) deployed per sector. We compare the performance of a hetnet using the SwiftC\xspace plane for coordination with \begin{Enumerate} \item an \textit{ideal} network where each cell has its own piece of spectrum to operate over without causing interference to anyone else (note that coordination techniques like CoMP strive to make an interference-dominant network perform as if it were an ideal interference-free network). The capacity of this network benchmarks the capacity scaling that is desired out of small cell deployments. \item a hetnet using the X2 over IP control plane. We assume that such a control plane has a one-way latency of 10ms from a small cell to the packet core network, and hence a total latency of 20ms. \end{Enumerate} Figure~\ref{fig:network_gains} shows the overall network capacity for the three cases (Ideal, with SwiftC\xspace, with X2 over IP) normalized by the capacity of a single macrocell network. The ideal capacity scales more than linearly (i.e. with N cells, the capacity is more than N times the capacity of a 1-cell network) due to the strong diversity gains in cell-splitting. Although the network capacity with the SwiftC\xspace plane does not provide the ideal-like diversity gains, it does result in a nearly linear capacity scaling with density ($\sim19\times$ with 21 small cells), something that the network with X2 over IP clearly is not capable of (only 12$\times$ with 21 small cells). \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.22]{./figures/network_gains.png} \caption{Overall network capacity in units of the capacity of a 1-macrocell network. With SwiftC\xspace, the overall network capacity scales almost linearly with the number of small cells, while current control architecture based on X2 over IP fall way behind.} \label{fig:network_gains} \end{center} \end{figure} \vspace{-2.5mm} \subsubsection{Impact on coordination gains} The total network capacity includes the macrocell capacity and a component of the small cell capacity that is delivered through techniques like \texttt{IGNORE} and \texttt{AVOID} which do not depend on the control plane quality. In order to scrutinize the specific impact on coordination gains that SwiftC\xspace can provide with respect to a standard X2 over IP control plane, we zoom into the component of network capacity that is delivered through CoMP transmissions. Figure~\ref{fig:comp_gains} shows the relative gains from CoMP (as a \% of the plot maximum) obtained via coordinating over (1) SwiftC\xspace and (2) X2 over IP. As the number of microcells deployed within a sector increases from 3 to 7, the CoMP gains using SwiftC\xspace relative to X2 over IP increase from 38\% to 78\%. Note that most of the CoMP transmissions happen for edge users who see strong interference from one or more neighboring cells, so these results also imply that the SwiftC\xspace plane can enable a significant increase in cell-edge throughput and thus effectively tackle the problem of high interference in dense networks. \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.22]{./figures/comp_gains.png} \caption{Relative capacities from CoMP transmissions using SwiftC\xspace and X2 over IP.} \label{fig:comp_gains} \end{center} \end{figure} \squeezeup \section{Introduction} Dense cellular networks with several small cells deployed per macrocell are expected to provide significant gains, increasing capacity almost linearly with every deployed small cell. The benefits come from two factors: clients are closer to the base station (BS) leading to higher SNR links, and the load per BS is significantly lower due to the smaller coverage area leading to higher per user throughput and higher spatial reuse. Consequently, there is tremendous interest from industry to move towards such architectures~\cite{bib:metrocell},~\cite{bib:nanogsm} and preliminary deployments have already begun. A big challenge however is the lack of licensed spectrum. Ideally, operators would like to operate adjacent small cells on different frequencies so as to avoid interference and get the capacity scaling benefits. Unfortunately, licensed spectrum is scarce and expensive. For example, Verizon and AT\&T own only 20MHz of contiguous downlink spectrum each licensed for LTE in the 700MHz band, which is too small to divide into multiple channels efficiently (dividing requires guard bands which can be quite wasteful given the limited spectrum widths). Consequently, adjacent small cells are expected to operate on the same channel. In industry parlance, this is referred to as network deployments with a spectrum reuse factor of one, which is how current LTE networks are being deployed. The problem therefore is that small cells are going to cause significant interference to each other as well as to the macro BS whose larger coverage area spans the small cell coverage areas. Further, since licensed spectrum is typically in the lower carrier frequencies (700-900MHz or 1.8GHz), radio signals propagate farther, and thus interference is exacerbated. Left unmanaged, interference will severely limit network capacity and prevent small cells from achieving the expected linear capacity scaling. To cope, the cellular standards body 3GPP has introduced several control plane mechanisms to manage interference. The default mode is to just ignore the interference (i.e., treat it as noise) and this is in fact the most widely used mechanism today, but as we will show in Section~\ref{sec:motivation}, in this case network capacity is severely limited by interference. Recently, a newer set of mechanisms known as eICIC (enhanced Inter Cell Interference Coordination) has been introduced which essentially tries to schedule transmissions from the macro BS and the small cells in different time-frequency slots so that they avoid interfering with each other. A final more sophisticated mechanism is CoMP (Coordinated Multi Point), which attempts to exploit interference by jointly coding the transmission across multiple small cell BSes such that these BSes mimic a large MIMO antenna array. This mechanism requires the exchange of channel state information between the BSes, coordination on a joint pre-coding vector at all the BSes and synchronized transmission. This mechanism can provide large benefits, and unlike the other two mechanisms, can in fact turn interference into an advantage rather than a liability Our problem thesis in this paper is that the current control plane and deployment architecture for the radio access network (RAN) in cellular networks is not capable of realizing the interference coordination mechanisms described above. The key challenge is latency. The LTE control plane is based on the X2 interface~\cite{bib:3gppx2} which is a logical interface defined over the physical backhaul links used to connect the BSes back to the packet core of the operator. The physical backhaul links use a variety of technologies, mostly out of necessity. Given the density of small cell deployments, and the fact that they have to be deployed in urban areas, operators are forced to use whatever backhaul connectivity is available (ranging from cable networks to DSL to public fiber if its available). All of these physical network options exhibit latencies of 10-15ms to the cellular packet core in the best case, and often much higher. Such high latencies pose problems in managing interference. Specifically, our analysis in Section~\ref{sec:motivation} shows that with such latencies, network performance can often be worse with interference management mechanisms such as CoMP than without! The reason is that these mechanisms depend upon neighboring BSes coordinating with each other by exchanging channel state information and making joint scheduling and coding decisions. However such coordination has to occur at the same granularity as channel coherence times, which is around $4-5$ms (90\% coherence) even for static and walking mobility users in urban environments. Hence a coordination latency of 10ms would mean that the channel state information that was shared is only about 80\% correlated with the actual channel during transmission (or in other words, has a \textit{staleness} of 20\%, as we define later). Staleness shows up as increased interference and decrease in SINR, reducing network capacity. The effect is worsened in dense networks because the increase in interference from staleness is proportional to the channel strength, which is by definition high in dense networks. To tackle this problem, in this paper we present the design and implementation of a novel low-latency and efficient control plane, SwiftC\xspace, for cellular networks. SwiftC\xspace's key architectural insight is to \emph{physically} decouple the control and data plane backhaul connectivity and use different connectivity options for them. We argue that imposing the requirement that a single backhaul technology satisfy the stringent latency requirement that the LTE control plane requires and also the high bandwidth requirement that the data plane desires leads to unnecessarily expensive and complex backhaul designs, which in turn makes small cells expensive or infeasible to deploy. We argue that its in fact better to design the backhaul for the control plane separately to satisfy the low latency requirement. SwiftC\xspace's physical control plane design is built on the LTE air interface itself as the physical technology, in other words we use the macro LTE network itself as the control plane backhaul network for the small cell. Consequently SwiftC\xspace inherits the latency guarantees that LTE itself provides, namely 1ms best case latency if needed for urgent transmissions (the size of the LTE subframe). The natural concern with this approach of course is whether we are using up scarce LTE spectrum to build a control plane. In this paper we present a novel design for the small cells that allows us to build this control plane almost for free by leveraging recent work on full duplex radios. Specifically, we enable each small cell to connect to the macro base station as if it is a phone, on the same frequencies it is using for serving clients connected to itself. The idea is that when the small cell is receiving transmissions from the phones connected to it on the uplink frequency, it can turn around and transmit control frames to the macro base station at the same time on the same frequency because of full duplex capability. The idea works analogously in the downlink direction, at the same time as the small cell is receiving control messages from the macro BS on the downlink frequency, it can transmit to the phones connected to it. Hence no capacity is lost at the small cell, and the control is piggybacked on the same frequencies. Meanwhile the data plane backhaul can be provided using whatever connectivity is available as long as it has sufficient bandwidth, it does not have to also satisfy the low latency requirement at the same time. We design and implement SwiftC\xspace and show the benefits of such a low latency control plane in managing interference in dense cellular networks. We show that with SwiftC\xspace, overall network capacity can scale almost linearly with the number of small cells deployed. Finally, we note that recently some operators such as China Mobile have proposed C-RAN~\cite{bib:cran}, an architecture where the entire baseband of multiple base stations is centralized and processed in a datacenter. The idea is that each base station would only be a simple radio, and they would send/receive IQ digital samples itself from the centralized datacenter. So all the signal processing and protocol handling is done completely in the centralized location, and consequently C-RAN can definitely implement all of the above interference control mechanisms easily. However C-RAN is extremely expensive and in many scenarios impossible to deploy. This is because C-RAN requires that every base station be connected by direct fiber links with less than 5ms latency with several gigabits of bandwidth. Such a fiber deployment is extremely expensive, and in many cases infeasible in Europe and the US because cities have already been built out. SwiftC\xspace is also architecturally simpler. Operators now have the flexibility to chose whatever backhaul is available for data backhaul without having to worry about whether that option can satisfy the stringent requirements for the RAN control plane. We believe this can greatly simplify small cell deployment. \section{Is the current control plane sufficient for LTE?} \label{sec:motivation} In this section, we show via detailed simulations and analysis that the current LTE control plane design is incapable of scaling to meet the control signaling needs for dense small cell heterogeneous networks. As described in the previous section, in current deployments, the control plane latency is on the order of tens of milliseconds, whereas bandwidth is plentiful (around 100Mbps or more). We show that with such latencies, control plane functionality such as CoMP for managing interference would work poorly and in fact hurt the performance of the network. Intuitively, the reason is the coherence time of the channels. An empirical estimate of the 90\% coherence time for an urban outdoor user walking at 5kmph is 4-5ms~\cite{bib:rappaport}, a fact that is corroborated by~\cite{bib:matlab}. Thus, a 10ms latency implies that the shared channel state information (CSI) is only about 80\% correlated with the true channel by the time it is transported over the X2 control interface. We find that such \textit{staleness} in CSI causes the average network capacity with CoMP to drop by as much as 40\% or more and is in fact worse than doing nothing (i.e. ignoring interference) for core users and avoiding interference (i.e. by time-division) for edge users. We briefly present our findings below. \subsection{Impact of control plane latency} We consider an urban microcell deployment and focus on the canonical 3-cell topology shown in Figure~\ref{fig:sim_topo} with 3 mobile clients, one per each cell, that are being served at any time. We use a MATLAB implementation~\cite{bib:matlab} of the 3GPP Spatial Channel Model (SCM)~\cite{bib:3gppscm} for generating the time-varying $3\times 3$ channel matrices. The simulation parameters are summarized in Table~\ref{tab:simpar}. The coordination-based joint transmission procedure (CoMP-JT) is summarized in Figure~\ref{fig:comp_summary}. The coordination mechanism is abstracted out in Step 2 of the figure - the design of the coordination plane will be the focus of the next section, all that matters for the analysis in this section is the coordination latency $L$ which is treated as a variable. We make use of a practical and nearly optimal \textit{soft interference nulling} precoder~\cite{bib:sin} to precode user data before joint transmission. \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.28]{./figures/simulation_topology.png} \caption{A $3\times 3$ urban microcell cluster} \label{fig:sim_topo} \end{center} \end{figure} \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.23]{./figures/comp_summary.png} \caption{CoMP Joint Transmission. In order to focus on the impact of coordination latency alone, we do not incorporate any channel estimation errors here, so $\widehat{H}_0 = H$. The soft interference nulling precoder $B$ is computed from a stale version $H_0$ of the channel when the true channel is $H_L$.} \label{fig:comp_summary} \end{center} \end{figure} Figure~\ref{fig:density} shows the average capacity scaling for different latencies as a function of the number of uniformly spaced microcells required to cover a circular region of 2km radius. In other words, the horizontal axis represents decreasing microcell radii which is a proxy for increasing density. Note that these latencies represent the total delay between the time the channels are estimated and the time they are used for precoding and transmission, and are usually at least 1ms higher than the control plane latency due to the feedback and other processing delays in between (so the Latency = 1ms curve actually represents a zero-latency control plane and so on). The small cell industry expects a linear increase in network capacity with the addition of each small cell base station. With interference coordination techniques like CoMP, as the Latency = 0-2ms curves show us, the linear scaling is indeed possible with near-instantaneous coordination (the scaling is actually more than linear because cell splitting provides significant diversity gains in addition to linear multiplexing gains). However, the capacity scaling drops very quickly with density as the total latency exceeds 5ms. Specifically, for the parameters used in this simulation, we find that the average network capacity drops by as much as 40\% when the total latency is 10ms and 50\% when it is 20ms. \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.22]{./figures/capacity_scaling.png} \scriptsize \caption{Average network capacity with CoMP vs (a proxy for) density. Each point on the x-axis decreasingly corresponds to a microcell radius between 600 and 200m.} \label{fig:density} \end{center} \end{figure} We explore another question - does coordination at higher latencies provide any gain at all over the simpler techniques of ignoring or avoiding interference? If yes, how do these gains vary with user location (cell-core vs cell-edge)? In order to find an answer, we zoom into a specific microcell of radius 200m and evaluate the average capacity achievable with CoMP-JT for different coordination latencies as well as with \texttt{IGNORE} (i.e. treat interference as noise) and \texttt{AVOID} (i.e. time division between the base stations). Figure~\ref{fig:test_distance} plots the different average capacities per cell normalized by the average \texttt{AVOID} capacity at each user location when the users are symmetrically moved along the dotted lines in Figure~\ref{fig:sim_topo}. Qualitatively, we observe that (1) the gains from coordination are significant only for edge users while \texttt{IGNORE} works almost as well for the core users. This makes sense because core users anyway see negligible interference (as compared to the direct signal strength), so coordinating with the neighboring base stations does not provide significant benefits. (2) when the coordination latency is too high, the simpler technique of \texttt{AVOID} outperforms CoMP for edge-users. (3) while coordination holds great potential for improving cell-edge throughput, it is also at the cell-edge where it is the most vulnerable to latency, indicated by the largest percentage drop from the zero-latency capacity. Conceptually, this happens because the interfering links are the strongest at the edge, so any error due to staleness shows up as a large increase in the effective noise floor (the next subsection makes this notion clearer). \begin{figure}[htpb] \begin{center} \includegraphics[scale = 0.27]{./figures/plot_cr_200.png} \scriptsize \caption{Average gains from coordination as a function of user distance from the serving base station. The capacity at each user location is normalized by the capacity that can be achieved by AVOID (i.e. time division between base stations).} \label{fig:test_distance} \end{center} \end{figure} These observations and results collectively tell us that (1) interference management techniques based on dynamic coordination, like CoMP-JT, can help us realize the promise of linear network capacity increase with small cells, and (2) in order to extract the maximum value out of such techniques, the coordination latency inevitably needs to be on the order of a 2-3 milliseconds (the lower the better). \subsubsection*{Impact of coordination latency: An analytical view} One might wonder if the drastic impact of coordination latency illustrated in the previous subsection is an artifact of the specific choice of simulation parameters. It is not. In this subsection, we argue analytically that such performance limits are in fact fundamental to dense urban networks. In order to analyze the impact of coordination latency, we need a model for how the channels change over time. We adopt a correlated block fading channel model as described below. Such a model, in addition to being analytically tractable, captures the one essential piece needed to understand the impact of coordination latency - the correlation between the current and the delayed CSI. Let $T_c(\rho)$ denote the $\rho\%$-coherence time of a single-tap channel (an OFDM sub-channel is effectively single-tap). The correlated block fading model assumes that the channel stays constant over a period of one $T_c(\rho)$, referred to as a \textit{slot}, and changes with correlation $\rho$ at the beginning of the next slot. Therefore, \begin{equation} h_{T_c(\rho)} = \rho \cdot h_0 + z_{T_c(\rho)}, |\rho| \leq 1 \label{eq:time_model} \end{equation} where $z_{T_c(\rho)}$ is independent of $h_0$ and $\Ex[z_{T_c(\rho)}]$ $=$ 0 given that the complex baseband channels are zero-mean at all times. Assuming the channel is wide sense stationary, if $\sigma_h^2$ $\triangleq$ $\Ex[|h_0|^2]$, we must have $\Ex\big[|h_{T_c(\rho)}|^2\big]$ $=$ $\Ex\big[|h_0|^2\big]$, and therefore $\Ex\big[|z_{T_c(\rho)}|^2\big]$ = $(1 - \rho^2)\sigma_h^2$. Note that $\rho$ is a parameter of this block fading model and controls the granularity of discretizing the continuous-time channel - the closer $\rho$ is chosen to 1, the smaller will be $T_c(\rho)$ for a given channel and the finer will be the modeling of the channel variations. Using this model, if $L$ represents the latency of coordination between any pair of base stations (in order to keep the expressions simple, we will consider $L$ in multiples of $T_c(\rho)$), then the channel $h_L$ at $t = L$ is related to the channel $h_0$ shared at $t = 0$ as \begin{equation} \label{eq:latency_model} h_L = \rho^{L/T_c(\rho)}h_0 + z_{L} \end{equation} where $\Ex[|z_L|^2] = \big(1 - \rho^{2L/T_c(\rho)}\big)\sigma_h^2$. The term $\rho_L \triangleq \rho^{L/T_c(\rho)}$ represents the channel correlation across a time interval $\Delta t = L$ and measures how correlated the \textit{stale} CSI is to the actual channel at $t=L$. Let us define $S_L\triangleq (1-\rho_L)$ as the \textit{staleness} at $t=L$ of the CSI that was shared at $t=0$. As an example, if the current channel is 90\% correlated with the channel at some previous time, then by the above definition the previous CSI will be said to be 10\% stale currently. The variance of the error due to staleness can thus be expressed as $(1 - (1-S_L)^2)\sigma_h^2$. Now we are all set to argue why the impact of a given coordination latency $L$ is much more pronounced in dense urban networks. In urban areas, the coherence times are typically smaller due to the inherent dynamism in the environment itself, which means that for a given $L$, the staleness $S_L = 1-\rho^{L/T_c(\rho)}$ ($|\rho|\leq 1$) is higher. In addition, if the network is dense, the links are typically stronger (since the clients are closer to the base stations), and hence $\sigma_h^2$ is higher. Therefore, in dense and urban networks, the problem gets compounded and the error $(1 - (1-S_L)^2)\sigma_h^2$ due to a given latency $L$ is much higher. As the network becomes denser, the higher errors in CSI lead to higher errors in the precoding vectors which in turn lead to the huge capacity drops that we saw earlier in Figures~\ref{fig:density} and~\ref{fig:test_distance}. We would also like to clarify here that, for example, a 10\% staleness (or equivalently, 90\% correlation) is not the same as a 10\% error in channel coefficients. As we explained above, a 10\% staleness actually results in a $\big(1 - (1-0.1)^2\big)$ or 19\% error relative to the channel coefficients.
{'timestamp': '2014-08-01T02:03:59', 'yymm': '1407', 'arxiv_id': '1407.8242', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8242'}
arxiv
\section{Introduction} \label{sec1} Genome-Wide Association Studies (GWAS) of binary traits can include related individuals from known pedigrees [\citet {Barrett2008,Willer2008}]. In case--control studies, GWAS generally increase power by collecting cases with affected relatives, and may therefore find it cost-effective to genotype these related cases as well. Furthermore, GWAS may target families because the appropriate association tests are robust to population stratification [\citet {Ewens2008}], the families have previously been collected for linkage analyses, the genetic variants can be called more accurately [\citet {Wang2007}], or the effects of parental imprinting can be evaluated [\citet{Wilkinson2007}]. There are two general approaches for evaluating GWAS with related individuals from known pedigrees [\citet{Ott2011}, Manichai\-kul et~al. (\citeyear{Manichaikul2012})]. The first approach combines two independent tests, a family-based test [\citet{Sham2002,Lange2003,L2000}], such as the transmission-disequilibrium test, and a population-based test of association. Methods exist for combining these two tests so the resulting analysis is robust to population stratification [\citet {Zheng2010,Won2012,Mirea2012,Manichaikul2012}]. The second approach, which potentially sacrifices robustness for improved power, calculates a single test statistic of association that accounts for the correlated genotypes among relatives [\citet {Bourgain2003,Thornton2007,Slager2001}]. Our focus is on the second approach and we derive a single test statistic which can use principal components [\citet{Price2006}] to correct for population stratification when necessary. Until now, standard GWAS analyses have focused on the individual. For each individual, a study records their genotype and disease status. If all individuals were unrelated, the appropriate test statistic would simply be the correlation between an individual's genotype and disease status [\citet{Hirschhorn2005}]. However, when some individuals are related, a test statistic should correct for the dependence among genotypes and allow for the minor allele frequency (MAF) at a causal SNP to be higher in controls with affected relatives, as compared to randomly ascertained controls [\citet {Thornton2007,Bourgain2003,Zhu2012}]. The more-powerful Quasi-Likelihood Score (mQLS) statistic [\citet{Thornton2007}], an extension of the QLS [\citet{Bourgain2003}], accomplishes both objectives. However, because these statistics consider only the overall Identity By Descent (IBD) status between two individuals, they cannot allow for the MAF at a causal SNP to be higher in controls that share both alleles (IBD${}={}$2) with an affected sibling, as compared to controls that share no alleles (IBD${}={}$0) with an affected sibling. We introduce a GWAS analysis that takes a different perspective and focuses on the founder chromosomes within each family. For each founder chromosome, we effectively identify its allele (at a given SNP) and the proportion of individuals carrying the SNP from that chromosome who are affected. This step is made possible by recent advances in IBD mapping and haplotyping [\citet{Browning2010,Peters2012,He2013}]. We suggest a chromosome-based Quasi Likelihood Score (cQLS) statistic that, at its simplest, measures the correlation between a binary indicator for the minor allele and the proportion of individuals affected. Formally, this test statistic is a partial score statistic from the retrospective likelihood that includes local IBD status among the observed data. The cQLS effectively leverages local IBD to improve power in GWAS with a large number of family-based controls. Furthermore, the derivation of the cQLS as a score statistic shows how to appropriately handle families of arbitrary pedigrees, include phenotype data from ungenotyped relatives, accommodate covariates, and allow for arbitrary models (e.g., logistic, liability threshold) linking disease risk and genotype status. In addition to these useful features, the cQLS also permits permutation-based measures of statistical significance. Accounting for relatedness in permutation methods of subject-centric approaches has proven exceptionally difficult [\citet{Wang2011}]. In the next section, we define cQLS, describe the simulated data sets for testing its performance, and introduce a GWAS of Late-Onset Alzheimer's Disease (LOAD) conducted by the National Institute of Aging and the National Cell Repository for Alzheimer's Disease (NIA-LOAD/NCRAD) [\citet{Lee2008,Wijsman2011}]. In the third section, we evaluate the performance of the cQLS in simulated data sets and the NIA-LOAD/NCRAD data set. In addition to showing the potential benefit of cQLS, simulations evaluate the power gained by genotyping affected siblings, as compared to randomly ascertained cases, and demonstrate the diminished benefit of recruiting cases with a family history of disease when searching for SNPs with small effects [\citet {Ionita-Laza2011,Hattersley8,Teng1999}]. In the final section, we conclude with a brief discussion. \section{Methods} \subsection{cQLS: Definition} We consider a case--control study that contains $N_{\mathrm{Fam}}$ families, labeled $j=1,\ldots,N_{\mathrm{Fam}}$. Within family $j$, all genotyped chromosomes are assumed to arise from a family-specific set of $n_j$ founder chromosomes, labeled $k=1,\ldots,n_j$. We denote the total number of chromosomes by $N_T$: \begin{equation} N_T = \sum_{j} n_j. \end{equation} For a given SNP, we let $Y_{jk}=1$ if the unique founder chromosome $k$ in family $j$ has a minor allele, and $Y_{jk}=0$ otherwise. Note that the subscripts ``$j_1 k$'' and ``$j_2 k$'' refer to different founder chromosomes from different families. For our discussion here, we will assume that $Y_{jk}$ is uniquely identifiable given the observed genetic data and that we can identify, with certainty, those individuals in family $j$ who inherited the SNP from founder chromosome $k$. Both assumptions will be relaxed in the \hyperref[app]{Appendix}. Furthermore, we will let $T_{jik'k}=1$ if the $k'$th copy ($k' \in\{1,2\}$) of the specified SNP in individual $i$ is descended from founder chromosome~$k$, and $T_{jik'k}=0$ otherwise. We let $A_{ji}=1$ if individual $i$ is affected, and $A_{ji}=0$ otherwise. For each founder SNP, we have $Y_{jk}$, indicating the presence or absence of a minor allele, and $C_{jk} = \sum_{i,k'}T_{jik'k}A_{ji}$, a count of the number of affected individuals with that SNP. If we expect that the minor allele increases disease risk, then the presence of a minor allele should be associated with a larger number of affected individuals. Therefore, the squared correlation between $Y_{jk}$ and $C_{jk}$ should be high. The proposed test statistic is a variation of this squared correlation. Instead of using the count, $C_{jk}$, we use a version that normalizes each individual's affection status to their expected affection status under the null hypothesis of no association, \begin{equation} \label{piEq} Z_{jk} = \sum_i \sum _{k'} T_{jik'k} \biggl(A_{ji}- \frac{\hat{\pi}_{0}}{1-\hat {\pi}_{0}}(1-A_{ji})\biggr), \end{equation} where $\hat{\pi}_{0}$ is our estimate of the prevalence of the disease in the population. We presume there are established estimates of $\hat {\pi}_{0}$ available in the literature. In the \hyperref[app]{Appendix}, we show how we can modify the expected affection status when other characteristics are known. We further show how we can make specific individuals, such as those with a family history of disease, carry more weight in the analysis by effectively increasing their contribution to $Z_{jk}$. We denote the average of all observed values of $Z_{jk}$ by \begin{equation} \bar{Z} \equiv\frac{\sum_{j,k} Z_{jk}}{N_T}. \end{equation} Finally, we define a normalized version of the allele for chromosome $k$, \begin{equation} Y^{\dagger}_{jk}=Y_{jk}-\hat{\phi}, \end{equation} where \begin{equation} \hat{\phi} \equiv\frac{\sum_{j,k} Y_{jk}}{N_T} \end{equation} and is our estimate of $\phi$, the minor allele frequency in the population, under the null hypothesis. As promised, our chromosome-based Quasi-Likelihood Score (cQLS) statistic is then proportional to the squared correlation between $Y^{\dagger}$ and $Z$, \begin{equation} \mathrm{cQLS} \equiv\frac{(\sum_{j,k} (Z_{jk}-\bar{Z}) Y^{\dagger}_{jk})^2 } { \sum_{j,k} (Z_{jk}-\bar{Z})^2 \hat{\phi}(1-\hat{\phi})}. \label{ss} \end{equation} Because $\operatorname{var}(Y^{\dagger}_{jk})$ is calculated as $\hat{\phi}(1-\hat{\phi })$, equation (\ref{ss}) requires the assumption of the Hardy--Weinberg Equilibrium (HWE). Therefore, the version of cQLS defined by equation (\ref{ss}) is appropriate in an ideal scenario where the genotypes and phenotypes of all individuals are known, $Y_{jk}$ can be identified for all families and chromosomes, and HWE holds. In the \hyperref[app]{Appendix}, we define a more robust cQLS that allows for violations in all three assumptions. \subsection{Assigning chromosomes} To calculate cQLS, we need to determine $T_{jik'k}$, or the identity of the two chromosomes in individual $i$ for all $i,j,k'$, and $k$ at each SNP. We perform this calculation in three steps. First, we phase subjects using BEAGLE [\citet{Browning2011}], a software package for analysis of large-scale genetic data sets. Second, we detect shared segments within a family using GERMLINE [\citet{Gusev2009}], a software package for discovering long shared segments of Identity-By-Descent (IBD). In the third step, we convert the IBD status to $T_{jik'k}$. The algorithm for this final step is described in Appendix \ref{algo}. \subsection{Simulations} Our three aims are to (1) assess the benefit of chromo\-some-based association tests (2) assess the value of genotyping an affected sibling and~(3) assess the benefit of genotyping cases known to have affected siblings. For our simulations, we assume that the liability threshold model accurately describes disease risk. In the liability threshold model, a complex disease results from an underlying, normally distributed, phenotype, or liability. When an individual's liability exceeds a specific threshold, the individual is affected. In our scenario, the liability, $\mathbf{L}_{j}$, for individuals in nuclear family $j$ can be described by a linear function of their genotypes $\mathbf{G}_{j}$, where $G_{ji}$ is the number of minor alleles for individual $i$, $\mathbf{G}_{j} = [ { G_{j1}\enskip \cdots \enskip G_{jN_j}} ]^t$, and the superscript $t$ indicates transpose. Here, $\mathbf {E}_{j}$ accounts for environmental factors, while $\mathbf{F}_{j}$ accounts for background genetic correlation: \begin{equation} \mathbf{L}_{j}=\beta_G (\mathbf{G}_{j}-2 \bolds{\phi}) + \mathbf{E}_{j} + \beta_F \mathbf{F}_{j}, \end{equation} where \begin{equation} \left[\matrix{ E_{j1} \vspace*{2pt} \cr E_{j2} \vspace*{2pt} \cr \vdots\vspace*{2pt} \cr E_{jN_j} }\right] \sim N \left( \left[\matrix{ 0 \vspace*{2pt} \cr 0\vspace*{2pt} \cr \vdots \vspace*{2pt} \cr 0 }\right] , \left[\matrix{ 1 & 0 & \cdots& 0 \vspace*{2pt} \cr 0 & 1 & \cdots& 0 \vspace*{2pt} \cr \vdots\vspace*{2pt} \cr 0 & 0 & \cdots& 1 }\right] \right) \end{equation} and \begin{equation} \left[\matrix{ F_{j1} \vspace*{2pt} \cr F_{j2} \vspace*{2pt} \cr F_{j3} \vspace*{2pt} \cr \vdots\vspace*{2pt} \cr F_{jN_j}}\right ] \sim N\left( \left[\matrix{ 0 \vspace*{2pt} \cr 0\vspace*{2pt} \cr 0\vspace*{2pt} \cr \vdots\vspace*{2pt} \cr 0 }\right] , \left[\matrix{ 1 & 0 & 0.5 & \cdots& 0.5 \vspace*{2pt} \cr 0 & 1 & 0.5 & \cdots& 0.5 \vspace*{2pt} \cr 0.5 & 0.5 & 1 & \cdots& 0.5\vspace*{2pt} \cr \vdots& \vdots& \vdots& \ddots& \vdots\vspace*{2pt} \cr 0.5 & 0.5 & 0.5 & \cdots& 1 }\right] \right). \end{equation} Here, $N_j$ is the number of individuals in family $j$, and individuals $j1$ and $j2$ are the parents. The liability threshold model will assign all individuals with $L_{ji}$ exceeding the population's 95th percentile to have the disease. We chose $\beta_G$ so that the corresponding OR for each additional minor allele was between 1.02 and 1.36. We chose $\beta_F$ so that the sibling recurrence risk ratio, $\lambda_S$, was 1.5, 2 or 5 when $\beta_G=0$. Note that the magnitude of the sibling recurrence risk ratio, as defined here, is independent of the strength of the tested SNP. To calculate $\beta_F$, we numerically solved the following equation: \begin{equation} \int_{F_2^{-1}(0.95)}^{\infty} \biggl[\int_{F_2^{-1}(0.95)}^{\infty} f_1(x|y)\, \partial x\biggr] f_2(y) \,\partial y = 0.05 \lambda_S, \end{equation} where $F_2$ and $f_2$ are the cumulative distribution and density of $N(0,1+\beta^2_F)$, and $f_1(x|y)$ is the density of $N(\beta^2_F y/(2(1+\beta^2_F)),(1+2\beta^2_F+1.75\beta^4_F)/(1+ \beta^2_F))$. The MAF in the population was fixed at 0.1, and genotypes were simulated under HWE. Our simulated studies, summarized in Table~\ref{simStudy}, collect families and/or unrelated cases and controls. The first five studies all start by identifying and genotyping 10,000 unrelated, randomly ascertained controls (R.A. controls). By randomly ascertained, we mean that we have no knowledge of their family history of disease. Study 1 further genotypes 5000 unrelated, randomly ascertained cases (R.A. cases). Study 2 genotypes 5000 unrelated cases (F.H. cases) with a family history of disease, specifically with an affected sibling. Study 3 genotypes both the 5000 R.A. cases and the 5000 F.H. cases. Study 4 genotypes 10,000 R.A. cases and 5000 F.H. cases. Studies 5 and 6 genotype 1 sibling of each proband. Study 5 genotypes the 5000 R.A cases, 5000 F.H. cases and their affected siblings. Study 6 includes 10,000 unrelated cases with an unaffected sibling and their unaffected siblings. Study 7 genotypes multiple relatives of each proband. Specifically, study 7 genotypes the 10,000 F.H. cases, their affected siblings and two unaffected siblings. Studies 6 and 7 highlight the potential power gain for cQLS in scenarios where only family-based controls are available. \begin{table} \caption{Each evaluated study design, labeled 1 through 7, genotypes different types of cases and controls. The first set of columns lists the number of randomly ascertained cases (Random), identified cases---or probands---with a family history (Fam. His.), and affected siblings of probands (Sib. 1) genotyped for the given study. The second set of columns lists the number of randomly ascertained controls (Rand.), unaffected ``older'' siblings (Sib. 1) and unaffected ``younger'' siblings (Sib. 2) genotyped for the given study. Studies 1 and 2 are used to assess the benefit of genotyping individuals with a family history of disease. Studies 3, 4 and 5 are used to assess the benefit of genotyping siblings of probands. Studies 6 and 7 are used to assess chromosome-based tests} \label{simStudy} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccccc@{}} \hline & \multicolumn{3}{c}{\textbf{Cases}} & \multicolumn{3}{c@{}}{\textbf{Controls}}\\[-6pt] & \multicolumn{3}{c}{\hrulefill} & \multicolumn{3}{c@{}}{\hrulefill} \\ \textbf{Study}& \textbf{Random} & \textbf{Fam. His.} & \textbf{Sib. 1} & \textbf{Random} & \textbf{Sib. 1} & \textbf{Sib. 2} \\ \hline 1&\phantom{0.}5000&\phantom{0000.}0&\phantom{0000.}0&10,000&\phantom{0000.}0&\phantom{0000.}0\\ 2&\phantom{0000.}0&\phantom{0.}5000&\phantom{0000.}0&10,000&\phantom{0000.}0&\phantom{0000.}0\\ 3&\phantom{0.}5000&\phantom{0.}5000&\phantom{0000.}0&10,000&\phantom{0000.}0&\phantom{0000.}0\\ 4&10,000&\phantom{0.}5000&\phantom{0000.}0&10,000&\phantom{0000.}0&\phantom{0000.}0\\[3pt] \multicolumn{7}{c}{Multiple family members genotyped}\\ 5&\phantom{0.}5000&\phantom{0.}5000&\phantom{0.}5000&10,000&\phantom{0000.}0&\phantom{0000.}0\\ 6&\phantom{0000.}0&10,000&\phantom{0000.}0&\phantom{0000.}0&10,000&\phantom{0000.}0\\ 7&\phantom{0000.}0&10,000&10,000&\phantom{0000.}0&10,000&10,000\\ \hline \end{tabular*} \end{table} For various combinations of $\beta_G$, $\lambda_S$ and study design, we simulated 10,000 data sets and calculated the FBAT test statistic [\citet {L2000}], mQLS [\citet{Bourgain2003,Thornton2007}] and cQLS for each data set. The power was defined as the proportion of $p$-values that were below the $10^{-7}$ threshold, a common threshold for GWAS. By using 10,000 data sets, the standard errors for our estimates of power are bounded by 0.01. A short description of FBAT and mQLS are provided in Appendix \ref{mQLSFBAT}. Previous comparisons [\citet{Manichaikul2012}] of the available test statistics have demonstrated that, among currently available options, mQLS is consistently a top performer and the appropriate reference for comparison. For all simulations, the cQLS statistic was calculated using the true IBD of all chromosomes within each family. Moreover, the tested SNP was assumed to be the causal SNP. We also evaluated the effect of mistakes in IBD assignment on the power of the cQLS statistic. For a proportion of sibling sets, we randomly assigned the IBD status for each individual in that set, ensuring only that the IBD status was consistent with the observed genotypes. We then recalculated the power for Studies 6 and 7 with $\lambda_S=1.5$. We examined the scenarios where 2\%, 5\% and 8\% of sibling sets were allowed to have errors. To test the accuracy of the $p$-value, we simulated $10^7$ data sets under the null distribution for study designs 5, 6 and 7, where the mQLS and cQLS statistics differ, assuming $\lambda_S=5$. For computational efficiency, we included only 1000 subjects and only examined larger thresholds of $10^{-3}$ and $10^{-4}$. \subsection{NIA-LOAD} The details of the NIA-LOAD/NCRAD GWAS of Late Onset Alzheimer's Disease (LOAD) have been described elsewhere [\citet{Wijsman2011}]. Briefly, the study recruited families with multiple affected individuals. Specifically, probands were required to have a diagnosis of Alzheimer's Disease after the age of 60, have a sibling with a similar diagnosis and an additional biologically-related family member available for genotyping. In these families, additional relatives over the age of 50 were recruited regardless of cognitive status. Study participants were then genotyped using Illumina's Human610Quadv1B BeadChips (Illumina, San Diego, CA, USA). We augmented the genotypes by imputing SNPs in the APOE region that have been previously associated with LOAD [\citet{Bertram2007}] using IMPUTE2 software version 2.2.2 [\citet{Howie2009}], with prephasing by SHAPEIT software version~1 [\citet {Delaneau2013}] and version 3 of the 1000 Genomes Project data as the reference set. At each imputed SNP, we assigned the most likely genotypes that were consistent with IBD status. In order to create a study guaranteed to be robust to population stratification, we focused on 115 sets of siblings and pruned each set so that it had an equal number of cases and controls. \section{Results} \subsection{cQLS vs mQLS} Chromosome-based test statistics had higher power, as compared to mQLS and FBAT, to detect associations when the study included cases and controls from the same family (Figure~\ref{fig1}). We first consider simulations where the disease had a relatively low sibling relative risk of $\lambda_S=1.5$. If the GWAS included pairs of siblings (study 6), one affected and one unaffected, then a SNP that would be detected by cQLS in 75\% of such studies would only be detected by QLS in 51\% [Figure~\ref{fig1}(a)]. In studies that included sets of four siblings (study 7), with each set including two affected and two unaffected individuals, when cQLS provided a power of 0.75, QLS provided a power of 0.36 [Figure~\ref{fig1}(c)]. When we simulated a disease with a high sibling relative risk ($\lambda _S=5$), the power gained from using cQLS decreased. For study designs 6 and 7, mQLS achieved a power of 0.59 and 0.63 for SNPs where cQLS achieved a power of 0.75 [Figure~\ref{fig1}(b), (d)]. \begin{figure}[t!] \includegraphics{715f01.eps} \caption{The power for cQLS (blue), mQLS (red) and FBAT (black) to detect the association between a SNP and the disease as a function of the OR when \textup{(a)} $\lambda_S = 1.5$ in study 6, \textup{(b)} $\lambda_S = 5$ in study 6, \textup{(c)} $\lambda_S = 1.5$ in study 7 and \textup{(d)} $\lambda_S = 5$ in study 7. Studies 6 and 7 correspond to genotyping pairs of siblings and groups of four siblings, respectively. $\lambda_S$ is the sibling relative risk of the disease.} \label{fig1} \end{figure} Errors in IBD assignment decreased the power for association tests using cQLS. With an error rate of 2\%, tests based on cQLS still had higher power for studies 6 and~7. However, with an error rate of 5\%, cQLS performed no better than the other two test statistics in study 6 ($\lambda_S=1.5$). Specifically, when cQLS had a power of 0.75 (SE${} = {}$0.01), QLS provided a similar power of 0.72 (SE${} = {}$0.01). When the error rate reached 8\%, the three test statistics performed similarly in study 7 ($\lambda_S=1.5$), with QLS achieving a power of 0.74 (0.01) when cQLS had a power of 0.75 (0.01). Simulations suggest that the type-I error for the cQLS statistic matched the chosen $\alpha$ threshold when simulating data from the null distribution (Table~\ref{genMod}). \begin{table}[t!] \tabcolsep=0pt \caption{The proportions of $10^7$ null simulations where the cQLS, mQLS and FBAT $p$-values are below the specified $\alpha$ threshold. With $10^7$ simulations, the standard errors for our empirical $\alpha $-levels of $10^{-3}$ and $10^{-4}$ are approximately $10^{-5} = \sqrt {10^{-3}/10^{7}}$ and $3 \times10^{-6} = \sqrt{10^{-4}/10^{7}}$} \label{genMod} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccccc@{}} \hline & \multicolumn{2}{c}{\textbf{cQLS}} & \multicolumn{2}{c}{\textbf{mQLS}} & \multicolumn {2}{c@{}}{\textbf{FBAT}} \\[-6pt] & \multicolumn{2}{c}{\hrulefill} & \multicolumn{2}{c}{\hrulefill} & \multicolumn {2}{c@{}}{\hrulefill} \\ \textbf{Study} & $\bolds{\alpha=10^{-3}}$ & $\bolds{\alpha=10^{-4}}$ & $\bolds{\alpha=10^{-3}}$ & $\bolds{\alpha=10^{-4}}$ & $\bolds{\alpha=10^{-3}}$ & $\bolds{\alpha=10^{-4}}$ \\ \hline 5&$9.81 \times10^{-4}$&$9.65 \times10^{-5}$&$9.79 \times 10^{-4}$&$9.03 \times10^{-5}$&$9.44 \times10^{-4}$&$8.38 \times 10^{-5}$\\ 6&$9.80 \times10^{-4}$&$9.25 \times10^{-5}$&$1.00 \times 10^{-3}$&$1.08 \times10^{-4}$&$9.56 \times10^{-4}$&$1.04 \times 10^{-4}$\\ 7&$9.70 \times10^{-4}$&$1.00 \times10^{-4}$&$9.78 \times 10^{-4}$&$9.68 \times10^{-5}$&$9.62 \times10^{-4}$&$9.28 \times 10^{-5}$\\ \hline \end{tabular*} \vspace*{3pt} \end{table} \begin{figure} \includegraphics{715f02.eps} \caption{\textup{(a)} The power to detect the association between a SNP and the disease, as a function of OR, when the study compares 10,000 randomly ascertained controls with either 5000 R.A. cases (red, study 1) or 5000 F.H. cases (blue, study 2) when the sibling relative risk, $\lambda_S$, is 1.5. \textup{(b)} Same, but with $\lambda_S=5$. For tests of unrelated individuals, all QLS statistics give identical results.} \label{fig2} \end{figure} \subsection{Genotyping F.H. cases vs R.A. cases} Genotyping cases with a family history of disease provides a study with significantly higher power than genotyping randomly ascertained cases. For a disease with a low sibling relative risk ($\lambda_S=1.5$), when the effect size for a SNP was large enough so that the study with all F.H. cases (study 2) had a power of 0.75, a study with all R.A. cases (study 1) had a power of only 0.20 [Figure~\ref{fig2}(a)]. However, as we increase the total heritability, shrinking the proportion of heritability attributable to the tested SNP, the power gained from using F.H. cases is decreased. When $\lambda_S=5$, a SNP with a power of 0.75 in study 2 would have had a power of 0.55 [Figure~\ref{fig2}(b)] in study 1. For interpretation, recall that the sibling relative risk ($\lambda_S$) reflects the heritability from genetic variants other than the tested SNP. Therefore, as Figure~\ref{fig2}(a) and \ref{fig2}(b) show, the power of study 1, which collects R.A. cases, does not depend on $\lambda_S$, but only on the relative risk of the tested SNP. \begin{figure} \includegraphics{715f03.eps} \caption{\textup{(a)} The power to detect the association between a SNP and the disease, as a function of OR, when the study compares 10,000 randomly ascertained controls with either 5000 R.A. cases${} + {}$5000 F.H. cases (blue, study 3), 10,000 R.A. cases${} + {}$5000 F.H. cases (purple, study 4) or 5000 R.A. cases${} + {}$5000 pairs of affected siblings (red, study 5) given a sibling relative risk, $\lambda_S$, of 1.5 and all tests based on the score statistic. \textup{(b)} Same, but with $\lambda_S=5$. \textup{(c)} The power when the study compares 10,000 R.A. controls and either 5000 R.A. cases${} + {}$5000 F.H. cases and the score statistic (blue), 5000 R.A. cases${} + {}$5000 F.H. cases and cQLS (purple), or 5000 R.A. cases${} + {}$5000 pairs of affected siblings and the cQLS (red) given a sibling relative risk, $\lambda_S$, of 1.5. \textup{(d)} Same, but with $\lambda_S=5$.} \label{fig3} \end{figure} \subsection{Genotyping affected sibling} Genotyping the affected siblings of F.H. cases increases the power. The additional genotyping of 5000 siblings, or moving from study 3 and a simple score test to study 5 and cQLS, will increase the power to detect a SNP with OR${}={}$1.15 from 0.57 to 0.75 [Figure~\ref{fig3}(a)]. Each sibling, on average, only offers one new chromosome, but siblings are also F.H. cases and, as such, are enriched for the causal allele. Therefore, genotyping the 5000 siblings promises higher power than genotyping an additional 5000, unrelated, but randomly ascertained cases. Moving from study 3 to study 4, which includes 10,000 R.A. cases and 5000 F.H. cases, only increases the power from 0.57 to 0.63 [Figure~\ref{fig3}(a)]. In studies with a mixture of F.H. cases and R.A. cases, such as study~3, the power of a standard association test can be improved by appropriately upweighting F.H. cases through use of either mQLS or cQLS. When moving from study 3 and cQLS to study 5 and cQLS, the power gain is less impressive, increasing from 0.60 to 0.75 [Figure~\ref{fig3}(c)]. When the total heritability is high and $\lambda_S=5$,\vadjust{\goodbreak} mQLS and cQLS overweight the F.H. cases, and including information about ungenotyped individuals can potentially lower power [Figure~\ref{fig3}(d)]. \subsection{LOAD} In addition to the simulations, we tested 11 SNPs in the APOE region of chromosome 19 for an association with LOAD in participants of the NIA-LOAD/NCRAD GWAS. Table~\ref{MESA} shows that eight of these 11 SNPs were associated with LOAD at a $p$-value below 0.05. In 7 of these 8 SNPs, the test based on the cQLS statistic resulted in a lower $p$-value, as compared to using the mQLS or FBAT statistic. However, all three methods provide similar evidence that these SNPs are associated with Alzheimer's disease. For\vadjust{\goodbreak} the two most strongly associated SNPs, rs429358 and rs4420638, the $p$-values were reduced from $1.23^{-8}$ and $5.23^{-7}$ based on the mQLS statistic, or $5.9^{-8}$ and $1.2^{-6}$ based on the FBAT statistic, to $7.70^{-9}$ and $1.79^{-7}$ based on the cQLS statistic. \begin{table} \caption{The $p$-values test from association tests of Late-Onset Alzheimer's Disease and SNPs in the APOE region among the NIA-LOAD/NCRAD population. The first three columns indicate SNP ID, chromosome and position. The last three columns indicate the $p$-values calculated from the mQLS, FBAT and cQLS statistics} \label{MESA} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lccccc@{}} \hline \textbf{SNP} & \textbf{Chr.} & \textbf{Position} & \textbf{mQLS} $\bolds{p}$\textbf{-value} & \textbf{FBAT} $\bolds{p}$\textbf{-value} & \multicolumn{1}{c@{}}{\textbf{cQLS} $\bolds{p}$\textbf{-value}} \\ \hline rs4806173 & 19 &36,024,925&$8.5\times10^{-1}$&$7.7\times 10^{-1}$&$9.1\times10^{-1}$\\ rs12984928& 19 &36,029,852&$8.5\times10^{-1}$&$7.7\times 10^{-1}$&$9.1\times10^{-1}$\\ rs6857 &19 &45,392,254&$6.0\times10^{-5}$&$5.8\times10^{-6}$&$2.0\times 10^{-5}$\\ rs157582 &19 &45,396,219&$4.7\times10^{-5}$&$4.8\times 10^{-6}$&$1.4\times10^{-5}$\\ rs449647& 19 &45,408,564&$1.9\times10^{-1}$&$2.1\times 10^{-1}$&$7.5\times10^{-2}$\\ rs440446& 19 &45,409,167&$1.8\times10^{-2}$&$2.4\times 10^{-2}$&$2.1\times10^{-2}$\\ rs429358& 19 &45,411,941&$1.2\times10^{-8}$&$5.9\times 10^{-8}$&$7.7\times10^{-9}$\\ rs4420638 &19&45,422,946&$5.2\times10^{-7}$&$1.1\times 10^{-6}$&$1.8\times10^{-7}$\\ rs157580 &19&50,087,106 &$3.9\times10^{-2}$&$3.2\times 10^{-2}$&$1.8\times10^{-2}$\\ rs2075650 &19&50,087,459&$3.0\times10^{-4}$&$7.1\times 10^{-5}$&$1.7\times10^{-4}$\\ rs405509 &19&50,100,676 &$4.5\times10^{-2}$&$2.3\times 10^{-2}$&$4.2\times10^{-2}$\\ \hline \end{tabular*} \end{table} \section{Discussion} Our primary objective was to introduce the chromosome-based Quasi-likelihood Score (cQLS) statistic and demonstrate that it can offer increased power to detect associations in GWAS with related individuals. Specifically, in studies designed to be robust to population stratification, such as those including sibling sets equally divided between cases and controls, statistical power can be increased by over 50\%. The new statistic can also be applied to less robust study designs, but, like GWAS with unrelated individuals, would then require adjusting for population-eigenvectors. The derivation of cQLS as a partial likelihood shows how to easily adjust for covariates in both logistic and liability-threshold models. Although our evaluation has focused on single SNP tests with fixed thresholds for statistical significance (e.g., $10^{-7}$), cQLS can offer a key, additional advantage when testing groups of SNPs in linkage disequilibrium. In GWAS with unrelated individuals, genotypes can be permuted among individuals to obtain permutation-based measures of significance. In GWAS with related individuals, standard methods are not appropriate, as individuals are not independent [\citet{Wang2011}]. However, the founder chromosomes are independent and, therefore, it is straightforward to apply permutation methods with cQLS in GWAS of related individuals. In addition to illustrating the improved power, we designed our simulations to reevaluate our expectations about the use of families in GWAS. First, affected siblings are often not genotyped because adding, on average, only one unique chromosome to the study is thought not to be worth the cost. However, we show that the power gained from genotyping an affected sibling can actually exceed the power from genotyping a randomly ascertained case. Second, it is well known that studies will have higher power when including cases (F.H. cases) with a family history of disease. F.H. cases should be enriched with disease-causing variants. However, we show that when a disease is highly heritable, the enrichment for any specific disease-causing variant is weaker. Thus, the benefit from genotyping cases with a family history of disease is lower, as demonstrated by our comparison of diseases with $\lambda_S=1.5$ and $\lambda_S=5$. Like mQLS, cQLS offers the ability to use phenotyped, but not genotyped family members. Such an advantage could also be gained by imputing the genotype of such individuals and then performing the GWAS using the entire population, with appropriate adjustment for the uncertainty introduced by imputation. However such methods are not easily available and would still not offer the other benefit of cQLS, identifying local IBD. Although cQLS requires calculating haplotypes for determining IBD, the test statistic still focuses on finding associations with single SNPs as opposed to haplotypes. A haplotype analysis [\citet{akey2001}], which looks for associations with a specific haplotype, will decrease power when the causal SNP is directly genotyped, as is likely to be the case when using dense arrays or sequencing. However, having identified the haplotypes, this information can be used to adjust for local ancestry instead of using a more global principal components approach [\citet{wang2011a}]. The cQLS has limitations. First, the statistic will lose power in the presence of IBD error. In our examples, we found an error rate of 5\% was large enough to offset the benefit of cQLS in the smaller studies. A second issue is that this new statistic requires a larger computational investment. Specifically, the first three steps of phasing, detecting shared segments of IBD and calculating $T_{jik'k}$ required a total of 8.8 hours on a single 2.8 GHz Intel X5660 processor for the NIA-LOAD/NCRAD GWAS containing 575003 SNPs. After these initial steps, calculating the cQLS statistic for the NIA-LOAD/NCRAD GWAS required only 3.2 minutes. In comparison, mQLS required 70.4 minutes and FBAT required 11.1 minutes. Both mQLS and FBAT required less time by dividing the genome into 22 regions. For mQLS, we divided the genome into 22 intervals with an equal number of SNPs and for FBAT, we divided the genome into chromosomes. The mQLS program was not designed to handle GWAS, and we would expect that if optimized, performing an mQLS analysis would require less computational time than a cQLS analysis. The benefit of cQLS depends on study design. For those designs that include mixtures of family-based and randomly ascertained controls, the increased power offered by cQLS will be lowered. Therefore, the additional computational cost would offer less value. Second, we have examined cQLS only in nuclear families and simple three-generation families (data not shown) where IBD can be reconstructed with high accuracy. We need further testing to assess the quality of IBD estimates from more distant relationships. Third, cQLS tests for association and, unlike FBAT, will have no power when there is linkage but no association. Although sequencing has removed our reliance on tag SNPs, a linkage analysis may still offer advantages in the presence of epistasis. Finally, we remark that there is no consensus on how to best combine within-family and between-family information in GWAS with related individuals. However, a technical way to address this question would be to examine the full-data likelihood. The derivation of the cQLS (Appendix \ref{deriv}) starts by defining this likelihood. The form of the final test statistic is the likelihood ratio test statistic based on the key partial likelihood, suggesting that the cQLS offers a near optimal combination of the two types of information. \begin{appendix}\label{app} \section{mQLS and FBAT} \label{mQLSFBAT} We compared the performance of a cQLS test to two standard tests: mQLS [\citet{Thornton2007}] and FBAT [\citet{L2000}]. mQLS is a quasi-likelihood score statistic that presumes an individual's expected genotype increases with the sum, over all affected family members, of their kinship coefficients with that individual. A complete, but terse, definition follows. For purposes of defining mQLS, we assume there are $n=N_g+M$ total subjects, of which $N_g$ have been genotyped. We let $\Phi$ be the $(N_g+M) \times(N_g+M)$ matrix of kinship coefficients and $\Phi _{N,M}$ be the submatrix containing the last $M$ columns of the first $N_g$ rows. The phenotype data are coded as $A^{\ddag}$, a column vector of length $N_g+M$ having $i$th entry 1 if individual $i$ is affected, 0 if unknown and $\hat{\pi}_0/(1-\hat{\pi}_0)$ otherwise. $A^{\ddag}_N$ is the vector containing the first $N_g$ elements (e.g., genotyped individuals) and $A^{\ddag}_M$ contains the last $M$ elements. Let $G$ be the vector of observed genotypes\vspace*{1pt} ($\frac{1}{2}G_i \in\{0,0.5,1\}$) for the first $N_g$ individuals. Finally, let~$\mathbf {1}$ be a column vector of 1's. Then mQLS is defined as \begin{equation} \mathrm{mQLS} = \hat{\sigma}^{-2} \bigl(\tfrac{1}{2} G - \hat{ \mu}_0\bigr)^T \alpha\Gamma ^{-1} \alpha^T \bigl(\tfrac{1}{2} G - \hat{\mu}_0\bigr), \end{equation} where \begin{eqnarray} \alpha& = & A^{\ddag}_N + \Phi^{-1} \Phi_{N,M} A^{\ddag}_M, \\ \Gamma& = & \alpha^T \bigl(\Phi A^{\ddag}_n + \Phi_{N,M} A^{\ddag}_M\bigr) - \bigl( \mathbf{1}^T \alpha\bigr)^2\bigl(\mathbf{1}^T \Phi^{-1} \mathbf{1}^T\bigr)^{-1}, \\ \hat{\mu}_0 & = & \hat{p}_{\mathrm{null}} \mathbf{1}, \\ \hat{\sigma}^{-2}_0 & = & \bigl[\tfrac{1}{2} \hat{p}_{\mathrm{null}} (1 - \hat {p}_{\mathrm{null}})\bigr]^{-1}, \\ \hat{p}_{\mathrm{null}} & = & \tfrac{1}{2} \bigl(\mathbf{1}^T \Phi^{-1} \mathbf {1}\bigr)^{-1} \mathbf{1}^T \Phi^{-1} G. \end{eqnarray} For implementation, we downloaded the software from \url{http://galton.uchicago.edu/\textasciitilde mcpeek/software/MQLS/index.html} and, in simulations, set the prevalence of the disease to the ``true'' value. FBAT compares the genotypes observed in the cases to their expected value under the null hypothesis of ``no linkage and no association'' or ``no association, in the presence of linkage,'' conditioned on the parent's genotypes (or the appropriate sufficient statistic if parental genotypes are unknown). For details, we suggest the user's manual for the software downloadable from \url{http://www.biostat.harvard.edu/\textasciitilde fbat/default.html}. \section{cQLS: Derivation} \label{deriv} \subsection{Model assumptions} \label{A1} Without loss of generality, we can assume that all $N_{\mathrm{ind}}$ individuals come from the same family, and therefore drop the subscript $j$ from notation. We further define $\Theta$ to be the set of parameters in the model, including those defining the SNP's effect on the disease. All notation and discussion assume a single SNP under study. We will assume random mating. We will assume \[ P[A_i=1|G_i=2,\mathbf{X}_{i},\Theta] = H_{i}^2 P[A_i=1|G_i=0,\mathbf {X}_i \Theta], \] where $G_i$ is defined as the genotype, or the number of minor alleles, for individual~$i$, $\mathbf{X}_i$ is a vector of covariates, $\Theta$ is a set of parameters, and \begin{equation} H_i = \frac{P[A_i=1|G_i=1,\mathbf{X}_i]}{P[A_i=1|G_i=0,\mathbf{X}_i]}. \end{equation} The immediate consequence is that \[ P[A_i=0|G_i=2,\mathbf{X}_{i},\Theta]=(1- \pi_i)\biggl[\frac{1-H_i\pi_i}{1-\pi _i}\biggr]^2+ \frac{\pi_i}{1-\pi_i}(H_i-1)^2, \] where $\pi_i$ is the probability individual $i$ is affected. For purposes of \textit{deriving} our test statistic, we further assume that $(\pi_i/(1-\pi_i))(H_i-1)^2$ is small or that we can treat the following approximation as an equality without issue: \[ P[A_i=0|G_i=2,\mathbf{X}_{i},\Theta] \approx\biggl(\frac{1-H_i\pi_i}{1-\pi _i}\biggr)^2 P[A_i=0|G_i=0, \mathbf{X}_{i}]. \] The properties of the test statistic, such as being distributed as a $\chi^2_1$ variable under the null, will not depend on this approximation holding. These approximations give us two simplifying results: \begin{eqnarray} P\bigl[Y_1,\ldots,Y_{n}|\mathbf{A},\mathbf{X},M^*, \Theta\bigr]&=&\prod_{k} P\bigl[Y_k| \mathbf{A},\mathbf{X},M^*,\Theta\bigr] \label{ind} \\ P\bigl[Y_k=1|\mathbf{A},\mathbf{X},M^*,\Theta\bigr] &=& \frac{p \prod_i h_i^{\sum _{k'}T_{ik'k}}}{1+p \prod_i h_i^{\sum_{k'}T_{ik'k}}}, \label{theprob} \end{eqnarray} where $h_i = H_i A_i + (1-H_i \pi_i)(1-\pi_i)^{-1}(1-A_i)$, $p = P[Y_i=1]/P[Y_i=0] = \phi/(1-\phi)$ and $M^* = \{T_{ik'k}\dvtx i \in {1,\ldots,N_{\mathrm{ind}}}, k' \in\{1,2\}, k \in\{1,\ldots,n\} \}$ is the IBD architecture. We will derive equations (\ref{ind}) and (\ref{theprob}) in a later section of the \hyperref[app]{Appendix}. \subsection{Probability and score} \label{score} We are interested in the distribution of $\mathbf{Y}$ and $\mathbf {M}^{O}$ given $\mathbf{A}$, $\mathbf{X}$, $S$ and $\Theta$. Here, $S$ is a vector indicating that the individuals were selected for the study and $\mathbf{M}^O$ are the observed values of $\mathbf{M}^*$. The variables $T_{ik'k}$ cannot be identified in family members that are phenotyped, but not genotyped. We have chosen to treat $Y$ as the outcome because we will not need to know the selection procedure used to choose families and we do not need to estimate the nuisance parameter that is the correlation of disease status in the family due to nongenetic similarities. We do note that a full probability would be $P[\mathbf {Y}, \mathbf{M}^{O}, \mathbf{A}, \mathbf{X}|S, \Theta]$ and we ignore $P[ \mathbf{A}, \mathbf{X}|S,\Theta]$ because it carries little information about $\Theta$: \[ P\bigl[\mathbf{Y},\mathbf{M}^{O}|\mathbf{A},\mathbf{X},S,\theta\bigr] = P\bigl[\mathbf {Y}|\mathbf{A},\mathbf{X},\mathbf{M}^{O},S,\theta \bigr] P\bigl[\mathbf {M}^{O}|\mathbf{A},\mathbf{X},S,\theta\bigr]. \] However, we consider only the conditional probability, as this half is far more sensitive to $\Theta$. Also, although not mentioned above, we will make the additional assumption that, conditional on all other information, the genotypes and the characteristics used to select the individuals are independent. Then we know that $S$ drops out of the desired probability: \begin{eqnarray} P\bigl[\mathbf{Y}|\mathbf{A},\mathbf{X},\mathbf{M}^{O},S,\Theta \bigr] &=& \frac {P[\mathbf{Y},S|\mathbf{A},\mathbf{X},\mathbf{M}^{O},\Theta ]}{P[S|\mathbf{A},\mathbf{X},\mathbf{M}^{O},\Theta]} \nonumber \\[-8pt] \\[-8pt] \nonumber &= &P\bigl[\mathbf {Y}|\mathbf{A},\mathbf{X}, \mathbf{M}^{O},\Theta\bigr]. \end{eqnarray} In an upcoming section, we will show that the score statistic for $P[\mathbf{Y}|\mathbf {A},\mathbf{X},\break \mathbf{M}^{O},\Theta]$ is defined by equation (\ref {ss}) when $M^*$ is known. \subsection{Mathematical detail} \subsubsection{Detail for Section \texorpdfstring{\protect\ref{A1}}{B.1}} We first demonstrate equation (\ref{ind}):\vspace*{-1pt} \begin{eqnarray} &&P\bigl[Y_1,\ldots,Y_{n_1}|\mathbf{A},\mathbf{X},M^*, \Theta\bigr] \\[-1pt] &&\qquad=\frac{P[\mathbf{A}|Y_1,\ldots,Y_{n_1},\mathbf{X},\Theta] \prod_k P[Y_k]}{P[\mathbf{A}|\mathbf{X},M^*,\Theta]} \\[-1pt] &&\qquad=\frac{P[\mathbf{A}|\mathbf{Y}=0,\mathbf{X},\Theta] \prod_k \prod_i h_i^{\sum_{k'} G_{ik'} T^{M^*}_{ik'k}} P[Y_k]}{P[\mathbf{A}|M,\mathbf {X},\Theta]} \\[-1pt] &&\qquad=\prod_{k} P[Y_k|\mathbf{A},M, \mathbf{X},\Theta].\vspace*{-1pt} \end{eqnarray} We next demonstrate equation (\ref{theprob}), where we let $\mathbf {Y}_{-k}$ be the vector of all alleles except for $k$:\vspace*{-1pt} \begin{eqnarray} \quad&& P\bigl[Y_k=1|\mathbf{A},\mathbf{X},M^{*},\Theta\bigr] \\[-1pt] &&\qquad =P\bigl[Y_k=1|\mathbf{A},\mathbf{X},M^*,\Theta, \mathbf{Y}_{-k}\bigr] \\[-1pt] &&\qquad=\frac{P[\mathbf{A}|\mathbf{Y}_{-k},Y_k=1,\mathbf{X},M^*,\Theta]P[Y_k=1]} { P[\mathbf{A}|\mathbf{Y}_{-k},\mathbf{X},M^*,\Theta]} \\[-1pt] &&\qquad=\biggl( \frac{P[\mathbf{A}|\mathbf{Y}_{-k},Y_k=1,\mathbf{X},M^*,\Theta ]}{P[\mathbf{A}|\mathbf{Y}_{-k},Y_k=0,\mathbf{X},M^*,\Theta]} \frac{P[Y_k=1]}{P[Y_k=0]}\nonumber\\[-1pt] &&\hspace*{6pt}\qquad\quad{}\times P\bigl[\mathbf{A}|\mathbf{Y}_{-k},Y_k=0,\mathbf {X},M^*,\Theta\bigr]P[Y_k=0]\biggr)\\[-1pt] &&\qquad\quad{}\Big/ { P\bigl[\mathbf{A}|\mathbf{Y}_{-k},\mathbf{X},M^*,\Theta\bigr]} \nonumber \\[-1pt] &&\qquad=\frac{P[\mathbf{A}|\mathbf{Y}_{-k},Y_k=1,\mathbf{X},M^*,\Theta ]}{P[\mathbf{A}|\mathbf{Y}_{-k},Y_k=0,\mathbf{X},M^*,\Theta]} \frac {P[Y_k=1]}{P[Y_k=0]} P\bigl[Y_k=0|\mathbf{A}, \mathbf{X},M^*,\Theta\bigr] \\[-1pt] &&\qquad=\frac{\prod_{i} h_i^{\sum_{k'}T_{ik'k}} P[A_i|\mathbf {Y}_{-k},Y_k=0,\mathbf{X},M^*,\Theta]}{\prod_{i} P[A_i|\mathbf {Y}_{-k},Y_k=0,\mathbf{X},M^*,\Theta]} \frac{P[Y_k=1]}{P[Y_k=0]} \nonumber \\[-9pt] \\[-9pt] \nonumber &&\qquad\quad{}\times P\bigl[Y_k=0|\mathbf{A}, \mathbf{X},M^*,\Theta\bigr] \\[-1pt] &&\qquad=\prod_{i} h_i^{\sum_{k'}T_{ik'k}} \frac{P[Y_k=1]}{P[Y_k=0]} P\bigl[Y_k=0|\mathbf{A},\mathbf{X},M^*,\Theta \bigr].\vspace*{-1pt} \end{eqnarray} \subsubsection{Score statistic: $Y_{jk}$ and $M^*$ can be uniquely identified} \label{YM} The overall probability can be written as the product of the probabilities for each chromosome with the assumptions in place: \begin{equation} P[\mathbf{Y}|D,p,\Theta]= \prod_k P[Y_{k}|D,p,\Theta],\vspace*{-1pt} \end{equation} where $D$ abbreviates the collected data, $D=\{\mathbf{A},\mathbf {X},M^*\}$.\vadjust{\goodbreak} Because we must account for the nuisance parameter $p$, the score statistic for $\Theta$ is equation (\ref{bigmat}) evaluated under the null hypothesis \begin{eqnarray}\label{bigmat}\qquad && - \!\left[\matrix{\displaystyle \sum_{k} \frac{d}{d\Theta} \ell_D(Y_{k}) & \displaystyle\sum _{k} \frac{d}{dp} \ell_D(Y_{k}) }\right] \nonumber \\[-8pt] \\[-8pt] \nonumber &&\qquad{}\times \left[\matrix{\displaystyle \sum_{k} \frac{d}{d^2\Theta} \ell_D(Y_{k}) & \displaystyle\sum _{k} \frac{d}{d\Theta\, dp} \ell_D(Y_{k}) \vspace*{2pt} \cr \displaystyle\sum_{k} \frac{d}{d\Theta\, dp} \ell_D(Y_{k})& \displaystyle\sum_{k} \frac{d}{d^2p} \ell_D(Y_{k}) }\right] ^{-1} \left[\matrix{ \displaystyle\sum_{k} \frac{d}{d\Theta} \ell_D(Y_{k}) \vspace*{2pt} \cr \displaystyle\sum _{k} \frac{d}{dp} \ell_D(Y_{k}) }\right] , \end{eqnarray} where \begin{eqnarray} &\ell_D(Y_{k}) = \log\bigl(P\bigl[Y_{k}| \mathbf{A},\mathbf{X},M^*,p,\Theta\bigr]\bigr). \end{eqnarray} It is straightforward to evaluate the needed derivative \begin{eqnarray} U &\equiv&\sum_k \frac{d}{d\Theta}\bigg|_{H_0} \ell_D(Y_k)= \sum_k Z_k (Y_k-\hat{\phi}), \label{null3} \\ \hat{\phi} &=& \frac{\sum_k Y_k}{\sum_k 1}, \end{eqnarray} where \begin{eqnarray} Z_k &\equiv&\sum_i \sum _{k'} T_{ik'k} \frac{\dot{h}_i}{h_i}, \\ \dot{h}_i &=& \frac{d}{d \Theta} h_i. \end{eqnarray} We can rewrite $U$, so that we can calculate its variance, $\sigma ^2_U$, without computing/inverting the matrix in equation (\ref{bigmat}): \begin{eqnarray} U &\equiv&\sum_k \frac{d}{d\Theta}\bigg|_{H_0} \ell_D(Y_k)= \sum_k (Z_k-\bar {Z}) (Y_k-\hat{\phi}), \label{null5} \\ \bar{Z} &=& \frac{\sum_k Z_k}{\sum_k 1}, \\ \sigma^2_U &=& \phi(1-\phi) \sum _k (Z_k-\bar{Z})^2 \label{HWEvar}. \end{eqnarray} \subsubsection{Score statistic: All individuals are not genotyped and $M^*$ cannot be uniquely identified} \label{missInfo} When all family members are not genotyped, the probability must be averaged over the $B$ possible IBD states \begin{eqnarray} &&P\bigl[\mathbf{Y}|\mathbf{A},\mathbf{X},\mathbf{M}^{O},p,\Theta \bigr] \nonumber \\[-8pt] \\[-8pt] \nonumber &&\qquad= \sum_{b=1}^B P\bigl[\mathbf{Y}| \mathbf{A},\mathbf{X},M^*=m_b,p,\Theta\bigr] P\bigl[m_b|M^O \bigr]. \end{eqnarray} We can take advantage of the equality \begin{eqnarray} \label{eqU1} &&\frac{d}{d \Theta}\bigg|_{H_0} \log\biggl(\sum _b c_b P\bigl[\mathbf{Y}| D(m_b), p, \Theta\bigr]\biggr) \nonumber \\[-8pt] \\[-8pt] \nonumber &&\qquad = \frac{d}{d \Theta}\bigg|_{H_0} \sum _b c_b \log\bigl(P\bigl[\mathbf{Y}| D(m_b), p, \Theta\bigr]\bigr), \end{eqnarray} where we use the abbreviation $c_b=P[m_b|M^O]$ and use $D(m_b)$ because $M^*$ is no longer known. Equation (\ref{eqU1}) shows us that the score for $P[\mathbf{Y}|\mathbf {A},\mathbf{X},\mathbf{M}^{O},p,\Theta]$ is proportional to the score we would observe had there been $N_M$ families, where all families had the observed $\mathbf{Y}$ and $c_bN_M$ of those families had IBD structure $m_b$. Therefore, equation (\ref{null3}) still holds, so long as we now let \begin{equation} Z_k \equiv\sum_i \sum _{k'} P[T_{ik'k}=1] \frac{\dot{h}_i}{h_i}. \end{equation} \subsubsection{Score statistic: $Y_{jk}$ cannot be uniquely identified} \label{UnY} In some scenarios, $Y_{k}$ cannot be uniquely identified given the available genetic information. In these scenarios, we must average the two possibilities to obtain the value of cQLS. As an example, this situation occurs in our simulated studies of sibling pairs. When two siblings have IBD${}={}$1 and are each heterozygous, we cannot determine whether the shared chromosome has the minor or common allele. We focus on this specific example to explain the needed adjustment. Let $Q_j=1$ if the siblings have IBD${} = {}$1 and are both heterozygous. Furthermore, in such a family, let $Y_1$, $Y_2$ and $Y_3$ denote the alleles on the chromosome uniquely in the first brother, in both brothers and uniquely in the second brother, respectively. Let $Z_1$, $Z_2$ and $Z_3$ be the disease variable for each of those chromosomes. We know \begin{eqnarray} &&P\bigl(Q=1| A,X,M^*,p,\Theta\bigr)\\ &&\qquad= P\bigl(\{Y_1,Y_2,Y_3\} =\{1,0,1 \}|A,X,M^*,p,\Theta\bigr) \\ && \qquad\quad{}+ P\bigl(\{Y_1,Y_2,Y_3\}=\{0,1,0 \}|A,X,M^*,p,\Theta\bigr). \end{eqnarray} For families with $Q=1$, we must reevaluate their contribution to the score equations. Under the null hypothesis, we find \begin{eqnarray} &&\frac{d \log(P(Q=1|A,X,M^*,p,\Theta))} { d p} \bigg|_{H_0} \nonumber \\[-8pt] \\[-8pt] \nonumber &&\qquad= (2- \phi) \frac{-{\phi^2}/{p^2}}{1-\phi} + (1+\phi) \frac{\phi}{p^2} \end{eqnarray} and \begin{equation} \frac{d \log(P(Q=1|A,X,M^*,p,\Theta))} { d \Theta}\bigg|_{H_0}= (1-2\phi) Z_2. \end{equation} Our new contributions to the score equations lead us to the following MLE of~$\phi$: \begin{equation} \hat{\phi}=\frac{N_1+N_3}{N_0+N_1+N_3}, \end{equation} where \begin{eqnarray} N_0 &=& \sum_{j,k} 1(Q_j=0) 1(Y_{jk}=0), \\ N_1 &=& \sum_{j,k} 1(Q_j=0) 1(Y_{jk}=1), \\ N_3 &=& \sum_{j,k} 1(Q_j=1). \end{eqnarray} Furthermore, we can rewrite $U$ as \begin{equation} U = \sum_{j,k:Q_j=1} (Z_k-\bar{Z}) (Y_k - \hat{\phi}) + \sum_{j:Q_j=0} (1-2 \hat{\phi}) (Z_2-\bar{Z}) \end{equation} and the score statistic as \begin{equation} \frac{U^2}{\hat{\sigma}^2_U}, \end{equation} where we let $p_u$ be the unique probabilities of each of the eight possible combinations of $\{Y_1,Y_2,Y_3\}$ when IBD${}={}$1, $Z_{j*}$ be the possible corresponding contributions from family $j$, and $\hat{\sigma }^2_U$ be the appropriate estimate of the variance under the null: \begin{eqnarray} p_{u1} &=& \hat{\phi}^3, \\ p_{u2} &=& \hat{\phi}^2 (1-\hat{\phi}), \\ p_{u3} &=& \hat{\phi} (1-\hat{\phi})^2, \\ p_{u4} &=& (1-\hat{\phi})^3, \end{eqnarray} \begin{eqnarray*} Z_{*j1} &=& \Biggl(\sum_{k=1}^3 (Z_k-\bar{Z}) (1- \hat{\phi})\Biggr)^2, \\ Z_{*j2} &=&\Biggl(\sum_{k=1}^3 (Z_k-\bar{Z}) (1- \hat{\phi}) - Z_3+\bar{Z} \Biggr)^2+ \bigl((Z_2-\bar{Z}) (1-\phi) \bigr)^2 \\ && {}+\Biggl(\sum_{k=1}^3 (Z_k- \bar{Z}) (1- \hat{\phi}) - Z_1+\bar{Z}\Biggr)^2, \\ Z_{*j3} &=& \Biggl(\sum_{k=1}^3 (Z_k-\bar{Z}) (1- \hat{\phi}) - Z_2-Z_3+2 \bar{Z}\Biggr)^2+ \bigl((Z_2-\bar{Z}) (1-\phi) \bigr)^2 \\ &&{}+\Biggl(\sum_{k=1}^3 (Z_k- \bar{Z}) (1- \hat{\phi}) - Z_1-Z_2+2\bar{Z} \Biggr)^2, \\ Z_{*j4} &=& \sum_{k=1}^3 \bigl((Z_k-\bar{Z}) (- \hat{\phi})\bigr)^2 \end{eqnarray*} and \begin{equation} \hat{\sigma}^2_U = \hat{\phi} (1-\hat{\phi}) \sum _{j,k:\mathrm{IBD}(j) \ne1} (Z_k-\bar{Z})^2 + \sum _{j:\mathrm{IBD}(j) = 1} \sum_{t=1}^4 p_{ut} Z_{*jt}. \end{equation} Accurate haplotyping would overcome this difficulty and allow us to\break uniquely identify $Y_{jk}$. As we expect haplotyping to become standard practice in the very near future [\citet{Peters2012}], we expect that this step will soon be unnecessary. \subsubsection{Violation of the Hardy--Weinberg Equilibrium} \label{violHWE} Our estimate for the variance of $U$ in equation (\ref{HWEvar}) assumes that the genotypes are in HWE. As an alternative, start by calculating the 16 possible values (one for each genotype) of $U= \sum_k (Z_k-\bar {Z}) (Y_k-\hat{\phi})$ for each family $j$. The second step is to calculate the probability of each of the 16 genotypes. Given these probabilities and the possible values of $U$, it is straightforward to calculate the variance of $U$ for any family under the null hypothesis, conditional on IBD architecture. Currently, this alternative is only available for families with at most four founding chromosomes (e.g., nuclear families) and, therefore, the remaining goal is to estimate $p = \{p_{200},p_{110},p_{101},p_{020},p_{011},p_{002}\}$, where $p_{xyz}$ is the probability that the founding individuals include $x$, $y$ and $z$ individuals with genotypes $G_i=0$, $G_i=1$ and $G_i=2$. We estimate these six probabilities by effectively maximizing $P(Y|M^O,p)$ with the constraints that $p_{xyz} \ge0$ and that $0.25 p_{110} + 0.5 p_{020} + 0.5 p_{101} + 0.75 p_{011} + p_{002} = \hat{\phi}$. Specifically, we minimize the following function: \begin{eqnarray} && 2\biggl(\sum_j 1(n_j = 2) \biggr) (M_2 V_2 - A_2)^2 + 3\biggl( \sum_j 1(n_j = 4) \biggr) (M_3 V_3 - A_3)^2 \nonumber \\[-8pt] \\[-8pt] \nonumber &&\qquad{}+ 4\biggl(\sum_j 1(n_j = 4) \biggr) (M_4 V_4 - A_4)^2, \end{eqnarray} where $M_4$ is a $6 \times6$ identity matrix, \begin{eqnarray*} M_2& =& \left[\matrix{ 1 & 0.5 & 0.25 & 0 & 0 & 0 \vspace*{2pt} \cr 0 & 0.5 & 0.5 & 1 & 0.5 & 0 \vspace*{2pt} \cr 0 & 0 & 0.25 & 0 & 0.5 & 1}\right]\quad\mbox{and}\\ M_3 &=& \left[\matrix{ 1 & 0.25 & 0 & 0 & 0 & 0 \vspace*{2pt} \cr 0 & 0.5 & 0.5 & 0.5 & 0 & 0 \vspace*{2pt} \cr 0 & 0 & 0.5 & 0.5 & 0.5 & 0 \vspace*{2pt} \cr 0 & 0 & 0 & 0 & 0.25 & 1 \vspace*{2pt} \cr 0 & 0.25 & 0 & 0 & 0.5 & 0 }\right] \end{eqnarray*} and $V_2$ is the vector estimating $ \{P(\sum_k Y_k = 0 | n_j = 2),P(\sum_k Y_k = 1 | n_j = 2),P(\sum_k Y_k = 2 | n_j = 2)\}$, $V_3$ estimates $ \{ P(\sum_k Y_k = 0 | n_j = 3),P(\sum_k Y_k = 1, W = 1 | n_j = 3),P(\sum_k Y_k = 2 , W = 1| n_j = 3),P(\sum_k Y_k = 3 | n_j = 3),\break P(\sum_k Y_k = 2, W = 0| n_j = 3)\}$, $V_4$ estimates $ \{P(\sum_k Y_k = 0 | n_j = 4),\break P(\sum_k Y_k = 1 | n_j = 4), P(\sum_k Y_k = 1, G_2 = 1| n_j = 4), P(\sum_k Y_k = 1, G_2 \ne1| n_j = 4), P(\sum_k Y_k = 3 | n_j = 4), P(\sum_k Y_k = 4 | n_j = 4)\}$, $W$ is a binary variable indicating whether all alleles are identifiable, and $\{ G_1,G_2\}$ are the founder genotypes. \subsection{Algorithm for assigning $T_{ijk'k}$} \label{algo} We start by arbitrarily assigning numbers to the chromosomes of the founder individuals and trimming the family so that no two individuals have IBD${} = {}$2. Founder individuals are defined to be the largest group possible such that all pairs of founder individuals have IBD${} = {}$0. Let $A$ be initialized as the founder individuals. Find an individual, $i_3$, in the compliment of $A$, that meets the first of the following possible criteria and follow the assignment mechanism. Add individual $i_3$ to $A$ and then repeat. \begin{enumerate}[(a)] \item[(a)] $i_3$ has IBD${} = {}$1 with two individuals in $A$, say, $i_1$ and $i_2$, that are also IBD${} = {}$1 with each other. Count the number of minor alleles, among individuals $i_1$, $i_2$ and $i_3$, at all loci in the shared region. Assume chromosomes in individuals $i_1$ and $i_2$ have been labeled as $\{1,2\}$ and $\{1,4\}$. \begin{enumerate}[(a)] \item[Option (a1).] If (nearly) all counts are even, the chromosomes in individual $i_3$ are assigned as $\{2,4\}$. \item[Option (a2).] (Nearly). All counts are not even, and individual $i_3$ is either IBD${} = {}$0 with all other individuals in $A$ or IBD${} = {}$1 only with individuals who are IBD${}={}$1 with both $i_1$ and $i_2$. Then the chromosomes in $i_3$ are labeled as $\{1,X\}$, where $X$ is a new chromosome number. \item[Option (a3).] (Nearly). All counts are not even, and individual $i_3$ is IBD${} = {}$1 with at least two more individuals in $A$, say, $i_4$ and $i_5$, that are IBD${} = {}$1 with each other, but IBD${} = {}$0 with both $i_1$ and $i_2$. Then the chromosomes in $i_3$ are labeled as $\{1,5\}$, where we assume the chromosomes in $i_4$ and $i_5$ are labeled as $\{ 5,6\}$ and $\{5,8\}$. \item[Option (a4).] (Nearly). All counts are not even, and individual $i_3$ is IBD${} = {}$1 with exactly one other individual in $A$, say, $i_4$, that is IBD${} = {}$0 with both $i_1$ and $i_2$. Then, we label $i_3$ as $\{1,5\}$, where the chromosomes in individuals $i_4$ have been labeled as $\{5,6\} $. \end{enumerate} \item[(b)] $i_3$ has IBD${} = {}$1 with two individuals in $A$, say, $i_2$ and $i_3$, that share IBD${} = {}$0 with each other. \begin{enumerate}[(a)] \item[Option (b1).] Individual $i_1$ (or $i_2$) has IBD${} = {}$1 with another individual in A, say, $i_4$, in $A$. Then, we label $i_3$ as $\{2,3\}$, where the chromosomes in individuals $i_1$, $i_2$ and $i_4$ have been labeled as $\{1,2\}$, $\{3,4\}$ and $\{1,6\}$. \item[Option (b2).] Individual $i_1$ and $i_2$ have IBD${} = {}$0 with all other individuals in~A. Then, we label $i_3$ as $\{1,3\}$, where the chromosomes in individuals $i_1$ and $i_2$ have been labeled as $\{1,2\} $ and $\{3,4\}$. \end{enumerate} \item[(c)] $i_3$ has IBD${} ={} $1 with only one individual in $A$, say, $i_1$. \begin{enumerate}[(a)] \item[Option (c1).] Individual $i_1$ has IBD${} = {}$1 with another individual in $A$, say, $i_2$. Assign the chromosomes in individual $i_3$ as $\{2,X\} $, where the chromosomes in individuals $i_1$ and $i_2$ have been labeled as $\{1,2\}$ and $\{1,4\}$ and $X$ is a new chromosome number. \item[Option (c2).] Individual $i_1$ has IBD${} ={} $0 with all other individuals in $A$. Assign the chromosomes in individual $i_3$ as $\{2,X\}$, where the chromosomes in individuals $i_1$ have been labeled as $\{1,2\}$ and X is a new chromosome number. \end{enumerate} \end{enumerate} \subsection{Limitations} The standard method for finding an optimal test statistic starts by defining the parameter of interest and then writing out the likelihood of the observed data given this, and possibly other, parameters. In the GWAS discussed here, such a likelihood would necessarily bridge the within-family and between-family information, and immediately show how the two pieces of information should be combined. Here, we have defined this likelihood and shown that the cQLS is derived as the score statistic to a specific partial likelihood. However, as that likelihood shows, we ignore information that can be derived from the observed IBD structure. For example, if all affected siblings are IBD${}={}$2 at a SNP, that provides some evidence of an association between SNP and disease. Although that information is minimal, we are currently looking into methods for capturing and including this independent information as well. By using only the partial likelihood, the cQLS is not guaranteed to result in the most powerful test. \end{appendix} \section*{Acknowledgments} The NIA-LOAD and NCRAD data were downloaded from dbGaP.
{'timestamp': '2014-08-01T02:09:25', 'yymm': '1407', 'arxiv_id': '1407.8398', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8398'}
arxiv
\section{Introduction} Quantum error correction becomes essential for preserving coherent quantum states against not just unintended quantum transformation, but also other unwanted interactions in quantum communication and computation. With quantum error-correcting codes the original quantum information can be recovered correctly when quantum states of quantum bits, \emph{qubits}, carrying the quantum information are transformed by \emph{quantum noise} \cite{Nielsen:2000book}. Unlike a classical binary $[N,K]$ code, which protects one of the $2^K$ discrete messages by encoding it into one of the $2^K$ codewords of length $N$, the quantum state of $K$ qubits is specified by $2^K$ complex coefficients. The purpose of designing quantum error-correcting codes is to encode the $K$ qubit state into an $N$ qubit state in such a way that all $2^K$ complex coefficients are perfectly stored and be able to detect and correct errors. While the importance of quantum error-correcting codes is apparent, initially, many researchers believed the nonexistence of quantum error correction codes and the process of quantum error correction is infeasible. Until the mid 90's, the discovery of the 9-qubit code by Shor \cite{Shor1995} and 7-qubit code by Steane \cite{steane:19962} showed that quantum error correction codes did indeed exist. Their following work in \cite{Calderbank1996,Steane:1996} showed that a class of good quantum codes, namely \emph{Calderbank-Shor-Steane (CSS) codes}, can be constructed from classical linear code $\mathcal{C}$ and its dual-containing code $\mathcal{C}^{\perp}\subset \mathcal{C}$. These findings have led to a rapid evolution in the research of quantum error correction and the design of quantum error-correcting codes. A general theory of quantum error correction and necessary conditions for a quantum system to form a quantum error-correcting code are given in \cite{laf1996,Bennett1996,KnillLaf1997}. An encoding process of $K$ qubits into $N$ qubits is essentially a linear mapping of $\mathcal{H}^{\otimes K}$ onto a $K$-dimensional subspace of $\mathcal{H}^{\otimes N}$, where $\mathcal{H}^{\otimes N}$ denotes the quantum state space of $N$ qubit under tensor product `$\otimes$'. A special finite group of \emph{unitary} transformations of $\mathcal{H}^{\otimes N}$, known as a \emph{Clifford group}, contains all the transformations necessary for encoding quantum codes. Investigation of the connection between \emph{Clifford group} and existing quantum codes has led to a general construction of many new quantum codes. The initial results on this investigation were given in \cite{CalderRainShorSloane1997} and later on in \cite{CalderRainShorSloane1998}. Several standard techniques to construct quantum codes over finite field $\mathbb{F}_2$ and $\mathbb{F}_4$ based on the theory of classical coding are given. Thereafter, various types of quantum error correcting codes have been proposed including the formalism of \emph{stabilizer codes} \cite{Gottesman1996}, \cite{GottesmanThesis}, which yielded many useful insights and permitted a great number of new codes discovered using classical codes, for instance, quantum BCH codes \cite{MGrasslBeth1999}\cite{SAly:2007}, quantum Reed-Solomon codes \cite{MGrasslBethRS}, quantum convolutional codes \cite{Almeida2004} \cite{Grassl:2007} \cite{Forney2005}, codeword stabilized quantum codes \cite{Cross2009}, non-binary quantum stabilizer codes \cite{AshKnill2000} and quantum non-additive codes \cite{Rains:1997} \cite{Smolin:2007}. The conventional \emph{cyclic} codes are good candidates of error-correcting codes in terms of high minimum distance and low encoding complexity \cite{MacWilliams:book1978}. These advantages enable the design of quantum cyclic codes and quantum \emph{shift registers} that have been initially studied in \cite{GrasslBeth2000}. It is known that a conventional $[N, K]$ cyclic code can be fully generated from a unique monic polynomial $G(x)$ of minimal degree $N-K$ over a field $\mathbb{F}_q$. This monic polynomial $G(x)$ is often called the \emph{generator polynomial}. However, the generator polynomial of a cyclic code is not easy to obtain especially in the field of higher order. Moreover, while majority classical cyclic codes attain promising distance property, they tend to have poor sparseness when code length is large. Fortunately, the conventional sparse-graph codes, particularly low-density parity-check (LDPC) \cite{Gallager1963} codes ascertain both the sparseness and a large minimum distance. A well known subclass of LDPC codes, namely \emph{quasi-cyclic} LDPC codes, also possess the simplicity of encoding. However, compared with the design of LDPC codes in classical settings, the commutative constraint (also referred to as \emph{the symplectic inner product} constraint) for quantum codes that sets on a pair of parity-check matrices complicates the design of quantum LDPC codes. In particular, the classical design of LDPC codes utilizing randomness \cite{macKay1999}-\cite{TenBrinkTOC04} is not helpful in the design of quantum LDPC codes. The idea of quantum LDPC codes was first given by Postol in \cite{PostolLDPC}, whereas generalization of quantum LDPC codes was proposed a few years later by MacKay \emph{et al.} \cite{macKay2004}. Since then, a wide range of different types of sparse-graph quantum codes have been designed, \emph{e.g.,} \cite{aly2007}-\cite{kenta2011}. The purpose of the present paper is to investigate efficient methods for designing $[[N,K,d_{min}]]$ quantum stabilizer codes, where the double solid bracket is commonly used to distinguish from a classical $[N,K]$ code. In particular, we focus on the use of \emph{quadratic residue (QR) sets} as our basic building block to explore systematic design techniques for new quantum stabilizer codes. More importantly, by taking full advantages of both conventional cyclic codes and sparse-graph codes, we aim at constructing new structured quantum stabilizer codes of variable code length. To illustrate the potential of our proposed methods, we focus on two particular categories of quadratic residue sets and show that they exhibit different properties under the same commutative constraint. We propose two types of quantum stabilizer codes of length $N=p$ and $N=pk$, respectively, where $p=4n\pm 1$ is the prime modulus of a quadratic residue set for some non-negative integer $n$ and $k$ is the size of the quadratic residue set. We refer to them as Type-I and Type-II quantum stabilizer codes. To illuminate the simplicity of the proposed construction methods, unlike traditional cyclic codes that are generated from a generator polynomial, we design Type-I quantum stabilizer codes from \emph{idempotent polynomial} of quadratic residue sets. Furthermore, we give systematic design methods for Type-II quasi-cyclic stabilizer (QCS) codes by introducing a two step \emph{position-and-lift} operation. In this design, we first place each quadratic residue set into a special format of \emph{Latin square}, as we refer to as a \emph{proto-matrix}. Then, by using \emph{circulant permutation matrices}, we lift the pre-obtained proto-matrix and obtain the parity-check matrix for a Type-II QCS code. The key results of the paper, the design methods for Type-I and Type-II quantum stabilizer codes, can be applied to any quadratic residue set of prime modulus $p = 4n\pm 1$. In addition, we prove that the minimum distance for Type-I stabilizer codes of length $N=4n+1$ is upper bounded by the size of quadratic reside set $k$. Moreover, the code rate for Type-I stabilizer codes of length $N=4n-1$ is determined by $\frac{K}{N}=\frac{k}{p}$, and the code rate approaches $\frac{1}{2}$ as $n$ goes to infinity. Furthermore, in the design of Type-II QCS codes, we use the generator element of quadratic residue sets to construct the proto-matrix. To satisfy the commutative constraint, two proto-matrices need to be \emph{commutative} and \emph{adjunction} of an additional element to the proto-matrix is required for codes with $p=4n-1$, whereas for codes with $p=4n+1$ only one proto-matrix needs to be commutative. By using decomposition of Vandermonde matrix, we show that the dimension of Type-II QCS codes is $k-1$ if $n$ is odd or $2k-1$ if $n$ is even. The organization of the paper is as follow: we review the theory of quantum stabilizer codes in the next Section. In Section III, we give explicit design procedures and analysis for Type-I stabilizer codes of length $N=4n\pm1$ after the preliminaries on quadratic residue sets and its idempotents. Thereafter, we design Type-II QCS codes from quadratic residue sets of modulus $p=4n\pm 1$. Before we conclude in Section VI with further discussions, we present some constructed codes of both Type-I and Type-II stabilizer codes in Section V. \section{Quantum stabilizer group and stabilizer codes} The state of single qubit $\vert\psi\rangle\in\mathcal{H}^{\otimes 1}$ exists in the \emph{superposition} $\vert\psi\rangle=\alpha\vert 0\rangle+\beta\vert 1\rangle$ of two basis states $\vert0\rangle$ and $\vert 1\rangle$, where $\alpha$ and $\beta$ are complex numbers and $\vert\alpha\vert^2+\vert\beta\vert^2=1$. Likewise, the state of $N$ qubit could exist in the form $\alpha_{0}\vert00\ldots0\rangle+\alpha_{1}\vert00\ldots1\rangle+\ldots+\alpha_{2^N - 1}\vert11\ldots1\rangle$, where $\sum_{i=0}^{2^N-1}\vert\alpha_i\vert^2=1$ and $\vert11\ldots1\rangle$ is shorthand for the tensor product $\vert1\rangle\otimes\vert1\rangle\otimes\ldots\otimes\vert1\rangle$. Thus, the quantum state space of $N$ qubits $\mathcal{H}^{\otimes N}$ is a composition of $N$ copies of $\mathcal{H}^{\otimes 1}$ through tensor product, where each copy is corresponds to a qubit. Since the process of \emph{quantum measurement} destroys the superposition state \cite{Nielsen:2000book}, quantum error-correcting codes of stabilizer framework ensure that with partial measurement outcome from \emph{unitary operators}, reliable transmission of encoded states can be achieved. In the rest of the section, a brief overview of quantum stabilizer codes is given. \subsection{Stabilizer group and stabilizer codes} Let $\mathcal{H}^{\otimes N}=\{\vert\psi\rangle\}$ be the quantum state space of $N$ qubits and $\mathcal{P}_1=i^c\{I=[\begin{smallmatrix}1&0\\0&1\end{smallmatrix}],X=[\begin{smallmatrix}0&1\\1&0\end{smallmatrix}],Z=[\begin{smallmatrix}1&0\\0&-1\end{smallmatrix}],Y=iXZ\}$ be the Pauli group that acts on a single qubit, where $i=\sqrt{-1}$ is the imaginary unit and $i^c$ is the overall phase factor with $c\in\{0, 1, 2, 3\}$. {\color{black} The non-identity operators that act on a single qubit imply} \emph{bit error} (X), \emph{phase error} (Z) or both (Y), respectively. Then the $N$-fold tensor product $\left(\otimes\right)$ of $\mathcal{P}_1$ forms an $N$-qubit Pauli group denoted as \begin{align} \mathcal{P}_N = i^c\left\{I,X,Y,Z\right\}^{\otimes N}. \end{align} An element in $\mathcal{P}_{N}$ that acts on a state $\vert\psi\rangle\in\mathcal{H}^{\otimes N}$ can be expressed as an operator $E = i^{c}A^{1}\otimes A^{2}\otimes\ldots\otimes A^{N}$, where each $A^{j}\in\mathcal{P}_1$ for $1\leq j\leq N$. For simple representation, $E = i^{c}A^{1} A^{2}\ldots A^{N}$ and only the non-identity operators $\{X,Z,Y\}$ are identified, \emph{e.g.,} $IXXZZ$ is denoted as $X^{2}X^{3}Z^{4}Z^{5}$. Any two operators of $\mathcal{P}_N$ are either \emph{commute} or \emph{anti-commute}. For two Pauli operators $E,F\in\mathcal{P}_{N}$, we have \begin{align} \label{equ:commutivity} E\circ F &= +1 \hspace{0.5cm} \text{if $EF = F E$}, \notag\\ E\circ F &= -1 \hspace{0.5cm} \text{if $EF = -F E$}, \end{align} where $`\circ '$ represents the commutativity between two operators. Two operators commute if their product shows an $+1$ eigenvalue, otherwise, they anti-commute. Furthermore, every element $E\in\mathcal{P}_N$ squares to $\pm 1$ eigenvalue. A stabilizer group $\mathcal{S}$ is an \emph{Abelian} subgroup of $\mathcal{P}_N$ such that a non-trivial subspace $\mathcal{C_S}$ of $\mathcal{H}^{\otimes N}$ is fixed (or stabilized) by $\mathcal{S}$. The subspace $\mathcal{C}_{\mathcal{S}}$ defines a quantum code space such that \begin{equation*} \mathcal{C}_{\mathcal{S}} = \{|\psi\rangle\in\mathcal{H}^{\otimes N} |\hspace{0.3cm} g|\psi\rangle = |\psi\rangle, \forall g\in\mathcal{S}\}. \end{equation*} If $\mathcal{S}$ is generated by $\mathbf{g}= \{g_1, g_2,\ldots, g_m\}$, where $\bf{g}$ is the $m = N-K$ independent stabilizer generators, the code space $\mathcal{C}_{\mathcal{S}}$ encodes $K$ logical qubits into $N$ physical qubits and it is able to correct $t=\lfloor\frac{d_{min}-1}{2}\rfloor$ errors. This code $\mathcal{C_S}$ is called an $[[N, K, d_{min}]]$ quantum stabilizer code. Note that a quantum stabilizer code $\mathcal{C_S}$ has the following features: \begin{align} 1)\hspace{0.2cm}&-I\notin\mathcal{S}, \notag\\ 2)\hspace{0.2cm}&\text{for any two} \hspace{0.2cm}E,F\in\mathcal{S}, \hspace{0.2cm} E\circ F=+1. \end{align} These properties show that $\mathcal{S}$ needs to be a $+1$ eigenspace spanned by $\mathbf{g}$ (real operators of $\mathcal{P}_N$ are considered only), and $\mathcal{S}$ contains only commuting operators. Let $\mathbb{E}\subset\mathcal{P}_N$ be a collection of Pauli operators. The condition for quantum error correction in \cite{CalderRainShorSloane1997} \cite{GottesmanThesis} is that $\mathbb{E}$ is a set of correctable error operators for $\mathcal{C_S}$ if \begin{align} E^{\dag} F\notin\mathcal{N}(\mathcal{S})\backslash\mathcal{S}, \hspace{0.2cm} \forall E,F\in\mathbb{E}, \end{align} where `$\dag$' is the conjugate transpose of $E$ and $\mathcal{N}(\mathcal{S})$ the \emph{normaliser} of $\mathcal{S}$ in $\mathcal{P}_N$ such that \begin{equation*} \label{secIIB} \mathcal{N}(\mathcal{S}) = \{A\in\mathcal{P}_N | A^{\dag} EA \in \mathcal{S}, \forall E\in\mathcal{S}\}. \end{equation*} Note that $\mathcal{N}(\mathcal{S})$ is a collection of all operators in $\mathcal{P}_N$ that commutes with $\mathcal{S}$ and $\mathcal{S}\subset\mathcal{N}(\mathcal{S})$. Then the minimum distance $d_{min}$ of a stabilzier code is given by \begin{align} d_{min}=min(wt(E)) \hspace{0.2cm}\mathbf{s.t.}\hspace{0.2cm} E\in\mathcal{N}(\mathcal{S})\backslash\mathcal{S}, \end{align} where the \emph{weight}, $wt(*)$, of an operator is the number of positions not equal to Pauli operator $I$. If the stabilizer group $\mathcal{S}$ contains element of weight less than $d_{min}$, then it is a \emph{degenerate} quantum stabilizer code, otherwise, it is a \emph{non-degenerate} quantum stabilizer code. To correct errors of weight $t$ or less, the particular error operator is determined by measuring the set of stabilizer generators $\mathbf{g}$. The measurement outcome, the \emph{error syndrome}, is a list of eigenvalues of length $m$ denote as $\mathcal{M}(E)=\{+1,-1\}^{m}$. When an error $E\in \mathcal{P}_N$ acts on the state $\left|\psi\right\rangle\in\mathcal{C_S}$, the corrupted state $E\left|\psi\right\rangle$ is either in $\mathcal{S}$ or anti-commutes with some operators in the $\mathcal{S}$. This is because any two operators of $\mathcal{P}_N$ commute or anti-commute from (\ref{equ:commutivity}). For a non-degenerate stabilizer code, the error syndrome is unique for every correctable errors $E$, whereas for a degenerate stabilizer code, the error syndrome is not unique. Let $E,F\in\mathcal{P}_N$, the former type of stabilizer codes distinguishes $E$ from $F$ if $EF$ anti-commutes with some elements of $\mathcal{S}$, and the later type cannot since $EF\in\mathcal{S}$, \emph{i.e.,} $E$ and $F$ act in the same way on the state. \subsection{Binary domain and check matrices} It is known that any stabilizer code can be represented in binary domain $\mathbb{F}_2$. Define the mapping $\Phi : \mathcal{P}_N\rightarrow\mathbb{F}_2^{2N}$. Then $\Phi\left(\mathcal{P}_1\right)=\{(0|0), (1|0), (0|1), (1|1)\}$. This implies that any operator $E\in\mathcal{P}_N$ can be uniquely expressed as a binary $2N$-tuples obtained through the mapping, that is \begin{align*} \Phi(E) = i^{\bar{c}}(\mathbf{a} |{\mathbf{b}}), \end{align*} where $\mathbf{a}, \mathbf{b}\in \mathbb{F}_2^{N}$ are two binary $N$-tuples and $i^{\bar{c}}$ is the overall phase factor with $\bar{c}\in\{0, 1, 2, 3\}$. In this representation, $a_j=1$ indicates a bit-error on qubit $j$, $b_j=1$ indicates a phase error on qubit $j$, both errors on the same qubit is represented by $a_j=b_j=1$. For example, \begin{align} \label{equ:exampleOperators} \begin{array}{*{20}{l}} E &= XYYZI \rightarrow \Phi(E)={(1 1 1 0 0|0 1 1 1 0)},\\ F &= XYZYY \rightarrow \Phi(F)={(11011|01111)}. \end{array} \end{align} Since for any stabilizer code $\mathcal{C_S}$, $-I\notin\mathcal{S}$, we ignore the overall phase factor $i^{\bar{c}}$ in our consideration. For any two operators $E=(\mathbf{a}|{\mathbf{b}})$ and $F=(\mathbf{a'}|{\mathbf{b'}})$, where $(\mathbf{a}|\mathbf{b})$ and $(\mathbf{a'}|\mathbf{b'})$ are two distinct binary $2N$-tuples, we know that they must commute or anti-commute, that is $EF=\pm FE$. The sign is determined by $(-1)^{(\mathbf{a}\cdot \mathbf{b'})+(\mathbf{a'}\cdot \mathbf{b})}$, where $(\mathbf{a\cdot b')+(a'\cdot b})$ is known as the commutative constraint or twisted inner product. Hence, two elements commute \emph{iff} their corresponding $2N$-tuple $\mathbf{(a|b)}$ and $\mathbf{(a'|b')}$ satisfies the commutative constraint \begin{align} \label{equ:twistinner} \mathbf{(a\cdot b')+(a'\cdot b)} \equiv 0\left( \bmod 2\right), \end{align} where `$\cdot$' is the usual dot product $(\mathbf{a\cdot b'})=\sum_j a_j b'_j$. Using the same example from (\ref{equ:exampleOperators}), the two operators $E$ and $F$ are commuting pairs since $(11100)\cdot(01111)+(11011)\cdot(01110) \equiv 0\left(\bmod 2\right)$. Denoted by $wt(\mathbf{a|b})$, the weight of an operator $(\mathbf{a|b})=(a_1,a_2,\ldots,a_n|b_1,b_2,\ldots,b_n)\in\mathbb{F}_{2}^{2N}$ is the number of positions $j$ such that at least one of $a_j$ and $b_j$ is $1$. For a stabilizer group $\mathcal{S}$ generated from $m$ independent stabilizer generators $\mathbf{g} = \left\{g_1, g_2,\ldots,g_m\right\}$, define the parity-check matrix $H$ of $\mathcal{S}$ by representing each row of $H$ as $\Phi(g_j)$ for $1\leq j\leq m$ and $g_j\in\mathbf{g}$, the resulting $H$ of size $m\times 2N$ is of the form $H=\left[H_1|H_2\right]$, where \begin{align} H_1=\left[\begin{matrix}{\mathbf{a}_{g_1}}\\{\mathbf{a}_{g_2}}\\\vdots\\{\mathbf{a}_{g_m}}\end{matrix}\right] \hspace{0.2cm}\text{and}\hspace{0.2cm} H_2=\left[\begin{matrix}\mathbf{b}_{g_1}\\\mathbf{b}_{g_2}\\\vdots\\\mathbf{b}_{g_m}\end{matrix}\right]. \end{align} Let $h_i=(\mathbf{a}_{g_i}|\mathbf{b}_{g_i})$ and $h_{i'}=(\mathbf{a}_{g_{i'}}|\mathbf{b}_{g_{i'}})$ be two rows of $H$, where $1\leq i,i'\leq m$ and $i\neq i'$. Since any two elements of $\mathcal{S}$ must commute, $h_i$ and $h_{i'}$ must satisfy the commutative condition given in (\ref{equ:twistinner}). This implies that for $m$ independent stabilizer generators to be commutative, the following constraint, called \emph{Symplectic Inner Product} \cite{macKay2004}, must be satisfied: \begin{equation} \centering \label{equ:symplecticconstraint} H_{1}H_{2}^{T}+H_{2}H_{1}^{T} = \mathbf{0}^{m\times m} \hspace{0.3cm}(\text{mod}\hspace{0.1cm} 2), \end{equation} where $\mathbf{0}^{m\times m}$ is a zero matrix and $`T'$ denotes the transpose of a matrix. We call (\ref{equ:symplecticconstraint}) the SIP constraint for quantum stabilizer codes hereafter. Since $Y=XZ$, denote by $\mathcal{M}_{\mathrm{X}}(E)$ and $\mathcal{M}_{\mathrm{Z}}(E)$ the two binary $m$-tuple error syndromes measured by $H_1$ and $H_2$, respectively, then $\mathcal{M}(E) = \left(\mathcal{M}_{\mathrm{X}}(E)+\mathcal{M}_{\mathrm{Z}}(E)\right)\hspace{0.1cm} (\bmod \hspace{0.1cm}2)$ if we map eigenvalues $+1\rightarrow 0$ and $-1\rightarrow 1$. This indicates that the columns of parity check matrix $H =[ H_1|H_2]$ are error syndromes for error operator $E$ with $wt(E)=1$. Furthermore, consider two different error operators $E,F\in\mathcal{P}_N$ with $wt(E)=wt(F)=1$, a stabilizer code cannot distinguish these two error operators if their product commutes with $\mathcal{S}$. That is, two error operators have the same error syndrome; $\mathcal{M}(E)=\mathcal{M}(F)$ \emph{iff} $\mathcal{M}(EF)=\mathbf{0}^{m}$. \subsection{Encoding of General Stabilizer Code} The linear combinations among rows of parity-check matrix $H$ generate the stabilizer group $\mathcal{S}$ in binary modulo-2 addition. Since the dual-space of $H$ is of dimension $2N-m\equiv\left(2(m+K)-m\right)=m+2K$, the normalizer group $\mathcal{N}(\mathcal{S})$ that commutes with $\mathcal{S}$ can be considered as the dual-space of $\mathcal{S}$ generated by an $(m+2K)\times 2N$ binary matrix. The last $2K$ rows are called \emph{logical operators} $\bar{\textbf{X}}$ and $\bar{\textbf{Z}}$ with $|\bar{\textbf{X}}|=|\bar{\textbf{Z}}|=K$. Note that the choices of $\bar{\textbf{X}}$ and $\bar{\textbf{Z}}$ are non-unique as long as they satisfies \begin{align} \label{logOPproperty} &\bar{X}_i \circ\bar{X}_j= +1, \notag \\ &\bar{Z}_i \circ\bar{Z}_j= +1, \notag \\ &\bar{X}_i \circ\bar{Z}_j= +1, \hspace{0.5cm}\text{for}\hspace{0.5cm} i\neq j, \notag\\ &\bar{X}_i \circ\bar{Z}_j= -1, \hspace{0.5cm}\text{for}\hspace{0.5cm} i=j. \end{align} The operation of encoding a general stabilizer code can be described as \cite{GottesmanThesis} \begin{align} |x_1,x_2,\ldots,x_K\rangle\rightarrow \left(\prod_{1\leq i\leq m}(I+g_i) \right)\bar X_1^{{x_1}}\bar X_2^{{x_2}}\ldots \bar X_K^{{x_K}}|00\ldots 0\rangle, \end{align} where $\bar{X_i}$ is the encoded $X$ operator on the $i$-th qubit. The state $|x_1,x_2,\ldots,x_K\rangle$ is a quantum codeword. The binary $K$-tuples $[x_1,x_2,\ldots,x_K]$ represent one of the $2^K$ possible basis states that can be encoded into. Since a $Z$ operator does not generally affects the basis of a state, only $\bar{X}_i$ operators are used during the encoding process. Recall that the choice of $\bar{\textbf{X}}$ is non-unique. One way to obtain a set of $K$ logical operators $\bar{\textbf{X}}$ or $\bar{\textbf{Z}}$ is to transform the parity-check matrix $H$ of $\mathcal{S}$ into \emph{standard form} \cite{GottesmanThesis}. Hence, \begin{align*} \label{logicOp} {H_{std}} = \begin{array}{r} {{R_{{H_1}}} \{ } \\ {m - {R_{{H_1}}}\{ } \end{array} \left( {\begin{array}{c|c} {\underbrace {\begin{array}{*{20}{c}} I\\ 0 \end{array}}_{{R_{{H_1}}}}\underbrace {\begin{array}{*{20}{c}} {{A_1}}\\ 0 \end{array}}_{m - {R_{{H_1}}}}\underbrace {\begin{array}{*{20}{c}} {{A_2}}\\ 0 \end{array}}_K}&{\underbrace {\begin{array}{*{20}{c}} B\\ D \end{array}}_{{R_{{H_1}}}}\underbrace {\begin{array}{*{20}{c}} {{C_1}}\\ I \end{array}}_{m - {R_{{H_1}}}}\underbrace {\begin{array}{*{20}{c}} {{C_2}}\\ E \end{array}}_K} \end{array}} \right), \end{align*} where $R_{{H_1}}$ is the rank of $H_1$. To satisfy conditions in (\ref{logOPproperty}), we obtain $\bar{\textbf{X}}$ and $\bar{\textbf{Z}}$ as \begin{align} \bar{\bf{X}} = K\{ ( {\underbrace 0_{{R_{{H_1}}}}\underbrace {{E^T}}_{m - {R_{{H_1}}}}\underbrace I_K|\underbrace {C_2^T}_{{R_{{H_1}}}}\underbrace 0_{m - {R_{{H_1}}}}\underbrace 0_K} ) \end{align} and \begin{align} \bar{\bf{Z}}=K\{ ( {\underbrace 0_{{R_{{H_1}}}}\underbrace 0_{m - {R_{{H_1}}}}\underbrace 0_K|\underbrace {A_2^T}_{{R_{{H_1}}}}\underbrace 0_{m - {R_{{H_1}}}}\underbrace I_K} ), \end{align} respectively. \section{Design of Type-I Quantum Stabilizer Codes} In this section, we design Type-I quantum stabilizer codes over the finite field $\mathbb{F}$ of order two by exploiting the notion of quadratic reside sets. The rest of the section is organized in the following way. A preliminary on quadratic residue sets and its idempotents is first introduced. We then design Type-I stabilizer codes for code length $N=4n\pm1$. Hereafter, we denote the rank of a matrix as $Rank(*)$, the dimension of a code as $dim(*)$ and the degree of a polynomial as $deg(*)$. \subsection{Quadratic (Non-) Residue Sets and Idempotent Polynomials} Let $\mathcal{G}_{\mathbb{Z}_p}^{\times}$ be a multiplicative group of order $p$, where $p$ is a prime of the form $p=4n\pm 1$. Denoted by $\mathcal{Q^R}$ and $\mathcal{Q^{NR}}$ the quadratic residue set and quadratic non-residue set, respectively. Take $\alpha$ as a primitive element in $\mathbb{F}_{p}$. Then we have the following. \begin{lemma} \label{lem:QRset} $\mathcal{Q^R} =\{\alpha^{2i} |1\leq i\leq \frac{p-1}{2}\}$ and $\mathcal{Q^{NR}} =\{\alpha^{2i-1} |1\leq i\leq \frac{p-1}{2}\}$ with $\vert\mathcal{Q^R}\vert = \vert\mathcal{Q^{NR}}\vert=\frac{p-1}{2}$. $\blacksquare$ \end{lemma} From \emph{Lemma \ref{lem:QRset}}, we know that $\mathcal{Q^R}\bigcup\mathcal{Q^{NR}}=\mathcal{G}_{\mathbb{Z}_p}^{\times}$ since there are exactly half odd and half even integer numbers in $\mathcal{G}_{\mathbb{Z}_p}^{\times}$. Furthermore, for $1\leq i,i'\leq\frac{p-1}{2}$ and $i\neq i'$, $\alpha^{2i}\cdot\alpha^{2i'}\equiv\alpha^{2i-1}\cdot\alpha^{2i'-1}=\alpha^{0(\bmod 2)}\in\mathcal{Q^R}$ and $\alpha^{2i-1}\cdot\alpha^{2i'}=\alpha^{1(\bmod 2)}\in\mathcal{Q^{NR}}$. We have the following property as a direct consequence of \emph{Lemma \ref{lem:QRset}}. \begin{lemma} For $1\leq i\leq\frac{p-1}{2}$, \label{lem:QRSproperty} \begin{align*} &\alpha^{2i}\mathcal{Q^R}=\alpha^{2i-1}\mathcal{Q^{NR}}\equiv\mathcal{Q^R}, \notag \\ &\alpha^{2i-1}\mathcal{Q^R}=\alpha^{2i}\mathcal{Q^{NR}}\equiv\mathcal{Q^{NR}}. \blacksquare \end{align*} \end{lemma} Let $\mathcal{{\bar Q}^{R}} = \{0, \mathcal{Q^{NR}}\}$ and $\mathcal{{\bar Q}^{NR}} = \{0, \mathcal{Q^{R}}\}$ be the \empty{complementary set} of $\mathcal{Q^R}$ and $\mathcal{Q^{NR}}$, respectively. Then for each $\mathcal{G}_{\mathbb{Z}_p}^{\times}$, we can construct four cyclic codes $\mathcal{C}_R$, $\mathcal{\bar{C}}_R$, $\mathcal{C}_{NR}$ and $\mathcal{\bar{C}}_{NR}$ associated to $\mathcal{Q^R}$, $\mathcal{\bar{Q}^R}$, $\mathcal{Q^{NR}}$ and $\mathcal{\bar{Q}^{NR}}$, respectively. One way to obtain a generator matrix for these codes is to use their \emph{idempotent polynomial}. Define $\{\mathbb{Q}^r(x), \mathbb{\bar{Q}}^r(x), \mathbb{Q}^{nr}(x), \mathbb{\bar{Q}}^{nr}(x)\}\in\mathbb{F}_2[x]/(x^p-1)$ the idempotent polynomial for $\mathcal{C}_R$, $\mathcal{\bar{C}}_R$, $\mathcal{C}_{NR}$ and $\mathcal{\bar{C}}_{NR}$ over $\mathbb{F}_2$ of a prime $p$. Then \begin{align} \label{idempotent} &\mathbb{Q}^r(x)=\sum_{i\in\mathcal{Q^R}} x^i, \hspace{0.5cm} &\mathbb{\bar{Q}}^r(x)=1 + \sum_{i\in\mathcal{Q^{NR}}} x^{i}, \notag \\ &\mathbb{Q}^{nr}(x)=\sum_{i\in\mathcal{Q^{NR}}} x^{i}, \hspace{0.5cm} &\mathbb{\bar{Q}}^{nr}(x)=1 + \sum_{i\in\mathcal{Q^{R}}} x^{i}. \end{align} Let $P$ be the $p\times p$ \emph{circulant permutation matrix} (CPM) \begin{align} \label{equ:cpm} \setlength{\arraycolsep}{4.0pt} \renewcommand{#1}\tabular{#2}}{0.4} P = \left[ {\begin{matrix} 0&1&0& \cdots &0\\ 0&0& 1 & \ddots & \vdots \\ \vdots & \ddots & \ddots & \ddots &0\\ 0& \ddots & \ddots & \ddots &1\\ 1&0& \cdots & 0 & 0 \end{matrix}} \right]. \end{align} The generator matrix for $\mathcal{C}_R$ is obtained as \begin{align} \mathbb{Q}^r(P) = \sum_{i\in\mathcal{Q^R}} P^i, \end{align} where the $i$-th power of $P$ is the $i$-th cyclic shift of $P$, and $P^0=I$ is the identity matrix. The transpose of $\mathbb{Q}^r(x)$ is then given by $\mathbb{Q}^r(x^{-1})$. Hence, in matrix representation, it is equivalent to \begin{align} \mathbb{Q}^r(P)^T = \sum_{i\in\mathcal{Q^R}} P^{-i}. \end{align} Since $\mathcal{C}_R$ is a cyclic code, where each row of $\mathbb{Q}^r(P)$ is a cyclic shift of previous row by one position, $\mathbb{Q}^r(P)$ can be completely characterized in its idempotent polynomial. Similar representations are used for $\mathcal{\bar{C}}_R$, $\mathcal{C}_{NR}$ and $\mathcal{\bar{C}}_{NR}$. \subsection{Type-I Stabilizer codes of length $N=4n-1$} We now look at Type-I stabilizer codes of length $N=4n-1$ by designing multi-weight circulant matrices $H_1$ and $H_2$ from idempotent polynomials in (\ref{idempotent}) first. Then, we analyse the dimension of Type-I stabilizer codes by constructing a pair of sub-matrices $H_1^{sub}$ and $H_2^{sub}$ from $H_1$ and $H_2$. Moreover, we prove the distance of Type-I codes of length $N=4n+1$ is upper bounded by the size of quadratic residue sets. \begin{proposition} \label{prop:typeIb} For an even $n$ and a prime $p=4n-1$, let $H_{1}(x) = \mathbb{\bar{Q}}^{r}(x)$ and $H_{2}(x) = \mathbb{Q}^r(x)$. Then, there exists a pair of sub-matrices $H_1^{sub}$ and $H_2^{sub}$ such that the parity-check matrix $H = [H_{1}^{sub}|H_{2}^{sub}]$ satisfies the SIP constraint with $Rank(H_{1}^{sub})=p-k-1$ and $Rank(H_{2}^{sub}) = p-k$. The resulting parity-check matrix $H$ is a $[[N,K,d_{min}]]=[[p,k,d_{min}=2]]$ Type-I stabilizer code. $\blacksquare$ \end{proposition} \begin{IEEEproof} When $n$ is even, $p=4n-1\equiv -1 \hspace{0.1cm}(\bmod \hspace{0.1cm}8)$, by the $2^{nd}$ Supplement to the Law of Quadratic Reciprocity \cite{Bach:1996}, $2\in\mathcal{Q^{R}}$ and $-1\notin\mathcal{Q^R}$. From (\ref{idempotent}), $H_1(x)=\mathbb{\bar{Q}}^{r}(x)=1 + \sum_{i\in\mathcal{Q^{NR}}}x^{i}$ and $H_2(x)=\mathbb{{Q}}^{r}(x)=\sum_{j\in\mathcal{Q^R}}x^{j}$. Since $-\mathcal{Q^R}=\mathcal{Q^{NR}}$ and for $f(x)=(x^a + x^b)\in\mathbb{F}_2[x]$, $f(x)^2=(x^{a}+x^{b})^2=x^{2a}+x^{2b}$, we have \begin{align} \label{equ:proofpro2} H_1(x)H_2(x^{-1})&=\left(\sum_{j\in\mathcal{Q^R}} x^{-j}\right) + \left(\sum_{j\in\mathcal{Q^R}} x^{-j}\right) \left(\sum_{i\in\mathcal{Q^{NR}}} x^{i}\right) \notag \\ &\equiv \left(\sum_{i\in\mathcal{Q^{NR}}} x^{i}\right) + \left(\sum_{i\in\mathcal{Q^{NR}}} x^{2i}\right). \end{align} By (\ref{lem:QRSproperty}), $\left(\sum_{i\in\mathcal{Q^{NR}}} x^{2i}\right)=\left(\sum_{i\in\mathcal{Q^{NR}}} x^{i}\right)$ because $2\in\mathcal{Q^R}$. Hence, $H_1(x)H_2(x^{-1})=\mathbf{0}\hspace{0.1cm}(\bmod\hspace{0.1cm}2)$. Similarly, $H_2(x)H_1(x^{-1})\equiv\mathbf{0}\hspace{0.1cm}(\bmod\hspace{0.1cm}2)$ implies that $H_1$ and $H_2$ are commuting pairs for even $n$. Since $\mathcal{Q^R}\bigcup\mathcal{Q^{NR}}=\mathcal{G}_{\mathbb{Z}_p}^{\times}$. Then $H_1$ and $H_2$ are complementary matrices, that is \begin{align} \label{equ:allone} H_1+H_2 = \mathbb{I}^{p\times p}, \end{align} where $\mathbb{I}^{p\times p}$ is an all-one matrix of size $p\times p$. Since $\mathcal{M}(E) =\left( \mathcal{M}_X(E)+\mathcal{M}_Z(E)\right)\hspace{0.1cm}(\bmod\hspace{0.1cm}2)$, we have $\mathcal{M}(Y^1)=\mathcal{M}(Y^2)=\ldots =\mathcal{M}(Y^{p})=[1,1,\ldots,1]^{m}$. Thus, this code cannot distinguish two single weight $Y$ operators acting on different qubits. Hence, $d_{min}=2$. \end{IEEEproof} The rank of $H = [H_{1}^{sub}|H_{2}^{sub}]$ constructed from \emph{Proposition \ref{prop:typeIb}} is determined from the following lemma. \begin{lemma}\label{lemma:three} Let $\mathbb{Q}^r\left(x\right):=\sum_{i=1}^{k} x^{d_i}$ and $\mathbb{\bar{Q}}^r(x):=1 + \sum_{i=1}^k x^{-d_i}$, where $d_{1,2,\ldots,k}\in \mathcal{Q^R}$. Then for $n$ is even and $p=4n-1$ is a prime, \begin{align} Rank(\mathbb{Q}^r (x))&=p-k.\\ Rank(\mathbb{\bar{Q}}^r (x))&=p-(k+1). \end{align} $\blacksquare$ \end{lemma} \begin{IEEEproof} For simplicity, write $f\left(x\right)=\mathbb{Q}^r\left(x\right)$. Let $\alpha$ be a primitive $p$-th root of unity in some field $\mathbb{F}_{p}$. To prove the lemma, it is equivalent to find the number of roots of $f(x)$ in $\{1, \alpha, \alpha^2,\ldots, \alpha^{p-1}\}$. Since $p=4n-1\equiv -1 (\bmod \hspace{0.1cm}8)$ when $n$ is even, we shall show that corresponding to each $d_i$ in $\mathcal{Q^R}$, either $\alpha^{d_i}$ or $\alpha^{-d_i}$ is a root of $f(x)$. Since $p$ is not congruent to $1$ modulo $4$, by the $1^{st}$ Supplement to the Law of Quadratic Reciprocity \cite{Bach:1996}, $-1$ is not a quadratic residue, and we have $\{d_1,d_2,\ldots,d_k\}\cup -\{d_1,d_2,\ldots,d_k\} = \mathcal{G}_{\mathbb{Z}_{p}}^{\times}$. Consequently, $\bigcup\limits_{1 \le i \le p - 1} {\{ {\alpha^{{d_i}}},{\alpha^{ - {d_i}}}\} } = \{ \alpha,{\alpha^1}, \cdots ,{\alpha^{p - 1}}\} $. Hence for all $1\leq j\leq p-1$, $f(\alpha^{d_i})+f(\alpha^{-d_i}) = \sum_{j=1}^{k}\alpha^{d_jd_i} + \sum_{j=1}^{k}\alpha^{-d_jd_i} = \sum_{j=1}^{p-1}\alpha^{jd_i} = 1 + \sum_{j=0}^{p-1}\alpha^{jd_i} = 1$, where the last equality holds due to $\alpha^{d_i}\neq 1$ being a root of $x^p-1=\left(x-1\right)\left(x^{p-1}+x^{p_2}+\ldots+x^{1}+1\right)$. Again, by the $2^{nd}$ Supplement to the Law of Quadratic Reciprocity, $2\in \mathcal{Q^R}$ in $\mathcal{G}_{\mathbb{Z}_{p}}^{\times}$. Then the quadratic residue set $\{d_1, d_2,\ldots, d_k\}$ is closed under multiplication by $2$. As a result, $f(\alpha^{2d_i}) = f(\alpha^{d_i})$. This implies that $f(\alpha^{d_i})$ is an element in $\mathbb{F}_2$. Thus, either $f(\alpha^{d_i})=0$ or $1 - f(\alpha^{-d_i})=f(\alpha^{d_i})=1$. We conclude that either $\alpha^{d_i}$ or $\alpha^{-d_i}$ is a root of $f(x)$. Hence, when $n$ is even, $Rank\left( f(x)\right) = p-k$. Similarly, if $f(x)=\mathbb{\bar{Q}}^r(x):=1 + \sum_{i=1}^k x^{-d_i}$ for $-d_{1,2,\ldots, k}\in\mathcal{Q^{NR}}$, then $\{0\}\bigcup\{\alpha^{-d_i}|1\leq i\leq k\}$ are the set of roots for $f(x)$. Hence, $Rank(\mathbb{\bar{Q}}^r(x))=p-(k+1)$. \end{IEEEproof} \begin{corollary} \label{coro:T1Nodd} For an odd $n$ and a prime $p=4n-1$, the parity-check matrix $H = [H_{1}^{sub}|H_{2}^{sub}]$ satisfies the SIP constraint with $Rank(H_{1}^{sub})=p$ and $Rank(H_{2}^{sub}) = p-1$. The resulting parity-check matrix $H$ is a trivial $[[N,K,d_{min}]]=[[p,0,d_{min}]]$ quantum stabilizer code. $\blacksquare$ \end{corollary} \begin{IEEEproof} In this case, $p=4n-1$ is equivalent to $p= 3 \bmod 8$. Denote by $min{(\mathcal{Q^R})}$ the smallest value in $\{d_1,d_2,\ldots,d_k\}$. Then, $f(x)=x^{min(\mathcal{Q^R})}\cdot\sum_{i=1}^{k}x^{(d_i-min(\mathcal{Q^R}))}$. Since $min(\mathcal{Q^R})=1$, there are at most $p-1-min(\mathcal{Q^R})$ non-zero roots of $f(x)$. By the $2^{nd}$ Supplement to the Law of Quadratic Reciprocity, $2\in{\mathcal{Q}^{nr}}$ is a quadratic non-residue in $\mathcal{G}_{\mathbb{Z}_{p}}^{\times}$, hence the order of $2$ in $\mathcal{G}_{\mathbb{Z}_{p}}^{\times}$ is $p-1$. Assume $\alpha^i$ for some $0\leq i\leq p-1$ is also a root of $f(x)$. Since $f(x)$ is a polynomial over field $\mathbb{F}_2$, $f(\alpha^{i\cdot2^j})=f(\alpha^i)^{2^j}=0$ for all $0\leq j\leq p-1$, which implies that there are $p-1$ distinct roots of $f(x)$. But this contradicts to that $f(x)$ has at most $p-1-min(\mathcal{Q^R})< p-1$ non-zero roots. Hence, no roots of $f(x)$ are in the set $\{1, \alpha, \alpha^2,\ldots,\alpha^{p-1}\}$ and $Rank(H_1)=p-K=p$, where $K=0$. By the same argument in \emph{Lemma \ref{lemma:three}}, $Rank(H_{2})=p-1$. \end{IEEEproof} Note that the above analysis also applies to the case when $H_1(x)=\mathbb{\bar{Q}}^{nr}(x)$ and $H_2(x)=\mathbb{Q}^{nr}(x)$. \begin{example}\label{exp:comp1} For $n=2$, $\mathcal{Q^R} = \{1, 2, 4\}$ and ${\mathcal{\bar{Q}^R}} = \{0, 3, 5, 6\}$. Let $H_{1}(x) = \mathbb{\bar{Q}}^r(x)$ and $H_{2}(x) = \mathbb{Q}^r(x)$. We have $H(x) = [1 + {x^3} + {x^5} + {x^6}|{x^1} + {x^2} + {x^4}]$ and $Rank(H_1)=p-k-1=3$ and $Rank(H_2)=p-k=4$. Consider two error operators $E_1,E_2\in\mathcal{P}_N$, where $E_1=IIIYIII$ and $E_2=IIYIIII$, by measuring all four stabilizer generators on each of the operators, we obtain the syndrome $\mathcal{M}(E_1)=[1,1,1,1]^T$ and $\mathcal{M}(E_2)=[1,1,1,1]^T$. Since $\mathcal{M}(E_1)=\mathcal{M}(E_2)$, the code can not distinguish $Y$ errors on arbitrary two qubits. Thus, $2\geq d_{min}$. $\Box$ \end{example} \subsection{Type-I Stabilizer codes of length $N=4n+1$} We now look at another Type-I stabilizer codes of structure $H=[H_1|H_2]$ with length $N=4n+1$. \begin{proposition} \label{prop:DSSTypeIb} For an odd $n$ and a prime $p=4n+1$, let $H_{1}(x) = \mathbb{Q}^r(x)$, $H_{2}(x) = \mathbb{Q}^{nr}(x)$, and $H_1^{sub}$, $H_2^{sub}$ be sub-matrices of $H_1$ and $H_2$, respectively. The parity-check matrix $H = [H_{1}^{sub}|H_{2}^{sub}]$ satisfies the SIP constraint with $Rank(H) = Rank(H_{1}^{sub})=Rank(H_{2}^{sub}) = p-1$. The resulting parity-check matrix $H$ yields a $[[N,K,d_{min}]]=[[p,1, d^{\dag} \geq d_{min} \geq 3]]$ quantum stabilizer code, where $d^{\dag}=min(wt(E))$ for $E\in\mathcal{S}$. $\blacksquare$ \end{proposition} Since $p=4n+1\equiv 1 \hspace{0.1cm}(\bmod\hspace{0.1cm} p)$, by \emph{Theorem 14} in \cite{Ching2011}, matrices $H_1 = [\mathbb{{Q}}^r(P)]$ and $H_2=[\mathbb{{Q}}^{nr}(P)]$ are commutating pairs and have rank $p-1$. Moreover, since $k=\frac{p-1}{2}=2n$, both $H_1$ and $H_2$ are even weight circulant matrices. Hence, we have the following lemma. \begin{lemma} \label{lem:evencodewords} For an odd $n>1$ and a prime $p=4n+1$, let $\mathcal{{C}}_{R}$ and $\mathcal{{C}}_{{NR}}$ be two linear cyclic code spanned by $H_1 = [\mathbb{Q}^r(P)]$ and $H_2=[\mathbb{Q}^{nr}(P)]$, respectively. Then $\mathcal{{C}}_{R}$ and $\mathcal{{C}}_{{NR}}$ are linear \emph{even code} that contain codewords of even weight only. For $a\in\mathcal{{C}}_R$ and $b\in\mathcal{{C}}_{NR}$, $min(wt(a))=min(wt(b))=2$. $\blacksquare$ \end{lemma} \begin{IEEEproof} Let $c_1$, $c_2$ be rows of $H_1$, then \begin{align} \label{equ:minweight} wt(c_1+c_2) = wt(c_1)+wt(c_2)-2wt(c_1\cap c_2). \end{align} Since $\vert\mathcal{Q^R}\vert=k$, we have $wt(c_1)=wt(c_2)=k$ and $2wt(c_1\cap c_2)=0\hspace{0.1cm}(\bmod \hspace{0.1cm} 2)$. Thus, $wt(c_1+c_2)\equiv 0\hspace{0.1cm}(\bmod \hspace{0.1cm} 2)$. By induction, for any codeword $a\in\mathcal{{C}}_R$, $wt(a)=0\hspace{0.1cm}(\bmod \hspace{0.1cm} 2)$. Let $b$ be any codeword of $\mathcal{{C}}_{NR}$. {\color{black} Similarly, we can also show by induction that $wt(b)=0\left(\bmod \hspace{0.1cm}2\right)$}. Thus, $\mathcal{{C}}_{R}$ and $\mathcal{{C}}_{{NR}}$ are even codes with $wt(a)=wt(b)= 0\hspace{0.1cm} (\bmod \hspace{0.1cm} 2)$. We know that an even code has a generator polynomial $G(x)$ that is divisible by $(1+x)$. Thus, any $\mathbb{{Q}}^{r}(x)$ over $\mathbb{F}_2$ is divisible by $(1+x)$. Since $Rank(H_1)=Rank(H_2)=p-1$ and $deg((1+x))=1$, $G(x)=1+x$ is the generator polynomial of $\mathcal{{C}}_R$ for any prime length $p=4n+1$ with an odd $n$. Furthermore, the weight of $G(x)$ is $2$. Therefore, for any codeword $a\in\mathcal{{C}}_R$, we have $wt(a)=\{2i|1\leq i \leq \frac{p-1}{2}\}$ and $min(wt(a))=2$. Similarly, an even code $\mathbb{{Q}}^{nr}(x)$ is also divisible by $G(x)$, which implies that $\mathcal{{C}}_R=\mathcal{{C}}_{NR}$. Hence, the minimum weight of codewords spanned by $H_1$ and $H_2$ is always $2$. \end{IEEEproof} By \emph{Lemma \ref{lem:evencodewords}}, we know that $\mathcal{{C}}_R=\langle\mathbb{{Q}}^r(x)\rangle\equiv\langle G(x)\rangle$ and $\mathcal{{C}}_R=\mathcal{{C}}_{NR}$, where $G(x)=1+x$. Let $H_1^{sub}=\left[ G(P)\right]$ and $H_2^{sub}=\left[\mathbb{{Q}}^{nr}(P)\right]$ with rank $p-1$. By linear operation on rows and columns of $H_1^{sub}$ and $H_2^{sub}$, we transform $H=[H_1^{sub}|H_2^{sub}]$ into its \emph{reduced row-echelon} form \begin{align} \label{equ:h1equal} \setlength{\arraycolsep}{1.5pt} \renewcommand{#1}\tabular{#2}}{0.6} {H_{rref}} = \left[ {\begin{array}{c|c}\underbrace{\begin{matrix} {{I^{\left( {p - 1} \right) \times \left( {p - 1} \right)}}}&{\begin{array}{*{20}{c}} 1\\ 1\\ \vdots \\ 1 \end{array}} \end{matrix}}_{H_1^{sub'}} & H_2^{sub'} \end{array}} \right], \end{align} where $H_1^{sub'}$ and $H_2^{sub'}$ are equivalent matrices for $H_1^{sub}$ and $H_2^{sub}$, respectively. Note that each row of $H_{1}^{sub'}$ is of weight $2$ and the linear combination between any two rows of $H_1^{sub'}$ is also a codeword of weight $2$. Therefore, the total number of weight $2$ codewords ${p \choose 2}$ is the summation of $(p-1)$ and ${p-1\choose 2}$. The corresponding row weight of $H_{2}^{sub'}$ is then determined by the following lemma. \begin{lemma} \label{lem:weightH2sub} Let $c$ be a row of $H_{2}^{sub'}$, where $H_{2}^{sub'}$ is the equivalent matrix of $H_{2}^{sub}$ given in (\ref{equ:h1equal}). Then $min(wt(c))=k$ and $max(wt(c))=k+2$. $\blacksquare$ \end{lemma} \begin{IEEEproof} Let $H_{1}(x) = \mathbb{{Q}}^r(x)$ and $H_{2}(x) = \mathbb{{Q}}^{nr}(x)$. Since $n$ is odd and $p$ is a prime of the form $p=4n+1$, by the $1^{st}$ Supplement to the Law of Reciprocity, $-1\in\mathcal{Q^R}$ and $2\notin\mathcal{Q^R}$. Then by \emph{Lemma \ref{lem:QRSproperty}}, $H_1(x)=H_1{(x^{-1})}$ (resp. $H_2(x)=H_2{(x^{-1})}$) and $H_1(x)^2=H_2(x)$ (resp. $H_2(x)^2 = H_1(x)$), that is, $H_1(x)^2$ (resp. $H_2(x)^2$) it is equivalent to \begin{align} \label{equ:h1h1} H_1H_1^T = kI + (n-1)\mathbb{I}^{p\times p}+H_2\equiv H_2\hspace{0.1cm}(\bmod \hspace{0.1cm}2) \end{align} and \begin{align} \label{equ:h2h2} H_2H_2^T = kI + (n-1)\mathbb{I}^{p\times p}+H_1\equiv H_1 \hspace{0.1cm}(\bmod \hspace{0.1cm}2). \end{align} It can be seen that the maximum and minimum overlapping between a pair of rows in either $H_{1}$ or $H_{2}$ is $n$ and $n-1$, respectively. Thus, using (\ref{equ:minweight}), the row weight of $H_{2}^{sub'}$ is equal to $2k-2n=k$ assuming two rows having the maximum overlapping or to $2k-2(n-1)=k+2$ assuming two rows having the minimum overlapping. \end{IEEEproof} From above, we have the following result. \begin{lemma} \label{coro:weightOP} Let $E\in\mathcal{S}$ be a Pauli operator of weight $wt(E)$, where $\mathcal{S}$ is the stabilizer group spanned by $H=[H_1^{sub}|H_2^{sub}]$. Let $d^{\dag}=min(wt(E))$ be the minimum weight of operator in $\mathcal{S}$. Then we have $d^{\dag}\leq k$. $\blacksquare$ \end{lemma} \begin{IEEEproof} From \emph{Lemma \ref{lem:evencodewords}}, we know that $\mathcal{{C}}_R=\mathcal{{C}}_{NR}$. Thus, for any $E\in\mathcal{S}$, $\Phi(E)=(a|b)\in\mathbb{F}_2^{2N}$ with $a,b\in\mathcal{{C}}_R$. The weight of $E$ is determined by \begin{align} \label{equ:opweight} wt(E)\equiv wt(a|b)=wt(a)+wt(b)-wt(a\cap b). \end{align} Then, the minimum weight, $d^{\dag}$, is given by \begin{align} \label{equ:minweightddag} d^{\dag} = min\{wt(a)+wt(b)-wt(a\cap b)\}. \end{align} Since $min(wt(a))=2$, Equation (\ref{equ:minweightddag}) is equivalent to \begin{align} \label{equ:minweightddag2} d^{\dag}&=min\left\{ \mathop {min }\limits_{a \in {\mathcal{{C}}_R},wt\left( a \right) = 2}\{wt(a)+wt(b)-wt(a\cap b) \}, \mathop {min }\limits_{a \in {\mathcal{{C}}_R},wt\left( a \right) \neq 2}\{wt(a)+wt(b)-wt(a\cap b) \} \right\} \notag\\ &\leq min(wt(a)) + wt[b|wt(a)=2] - wt(a\cap b). \end{align} We know from \emph{Lemma \ref{lem:weightH2sub}} that $max(wt(b))=k+2$ and $min(wt(b))=k$ when $wt(a)=2$. Therefore, \begin{align} \label{equ:minweightddag3} d^{\dag} &\leq min(wt(a)) + min[wt(b)|wt(a)=2] - max(wt(a\cap b)) \notag \\ &\leq 2 + k -min\{wt(a), wt(b)\}\equiv k. \end{align} \end{IEEEproof} To encode such a code, note that Equation (\ref{equ:h1equal}) is already in the standard form given in (\ref{logicOp}), \begin{align} H_{std}={\left(H_1^{sub'}|\hspace{0.1cm} B\hspace{0.2cm} C\right)}, \end{align} where $B$ is a $(p-1)\times(p-1)$ square matrix and $C$ is a single $(p-1)\times 1$ column vector. Therefore, the logical operators $\bar{Z}_1$ and $\bar{X}_1$ for $K=1$ are \begin{align} \label{equ:x1} {\bar{Z}_1}=\left(0,0,\ldots,0 |1,1,\ldots,1 \right) \end{align} and \begin{align} \label{equ:z1} {\bar{X}_1} = \left(0,0,\ldots,0,1|\hspace{0.1cm} C^T \hspace{0.2cm}0\right). \end{align} The minimum distance $d_{min}$ of a stabilizer code that is defined as \begin{align} d_{min} = min(wt(E))\hspace{0.2cm} \textbf{s.t.} \hspace{0.2cm}E\in\mathcal{N}(\mathcal{S})\backslash\mathcal{S}, \end{align} can be determined by the following lemma. \begin{lemma} \label{lem:upperboundforDmin} Let $F\in\mathcal{N}(S)\backslash\mathcal{S}$ be a Pauli operator of weight $wt(F)$. The minimum distance $d_{min}$ is upper bounded by \begin{align} d_{min}=min(wt(F))\leq k-1 \end{align} $\blacksquare$ \end{lemma} \begin{IEEEproof} The subset $\mathcal{N}(\mathcal{S})\backslash\mathcal{S}$ is generated by multiplying $\mathcal{S}$ with ${\bar{X}_1}$, $\bar{Z}_1$ and $\bar{X}_1\bar{Z}_1$. Let $\Phi(\bar{X}_1)=({a}_{\bar{X}_1}|{b}_{\bar{X}_1})$ and $\Phi(\bar{Z}_1)=({a}_{\bar{Z}_1}|{b}_{\bar{Z}_1})$. Let $\Phi(F)=(a'|b')\in\mathbb{F}_2^{2N}$ and $\Phi(E)=(a|b)\in\mathbb{F}_2^{2N}$ be the binary $2N$-tuples for $F\in\mathcal{N}(\mathcal{S})\backslash\mathcal{S}$ and for $E\in\mathcal{S}$, respectively. The binary $N$-tuples $a'$ and $b'$ are determined by one of the linear combinations \begin{align} \label{equ:opcombination} a' &\in \{a+a_{\bar{X}_1}, a+a_{\bar{Z}_1}, a+(a_{\bar{X}_1}+a_{\bar{Z}_1})\}, \notag\\ b' &\in \{b+b_{\bar{X}_1}, b+b_{\bar{Z}_1}, b+(b_{\bar{X}_1}+b_{\bar{Z}_1})\}. \end{align} Since $min(wt(b))=k$ given that $min(wt(a))=2$ for $E\in\mathcal{S}$, the weight of the column vector $C$ in (\ref{equ:z1}) is $wt(C)\geq k$. Thus, we have \begin{align} \label{equ:logopweight} wt(a_{\bar{X}_1}) = 1, \hspace{0.4cm}wt(b_{\bar{X}_1}) \geq k,\notag \\ wt(a_{\bar{Z}_1}) = 0, \hspace{0.4cm}wt(b_{\bar{Z}_1}) = p. \end{align} The minimum distance $d_{min}$ is given by \begin{align} \label{equ:dminupper} d_{min}&=min(wt(F))\equiv min(wt(a'|b')) \notag \\ &=min\{wt(a')+wt(b')-wt(a'\cap b')\}. \end{align} Since either $wt(b)=k+2$ or $wt(b)=k$ given that $min(wt(a))=2$, by considering all the possible cases for the given $wt(b)$ and $min(wt(a))$, Equation (\ref{equ:dminupper}) can be expanded into Equation (\ref{equ:dminbound}) \begin{figure*}[t] \begin{align} \label{equ:dminbound} d_{min}&\leq min\left\{\begin{array}{l}min[wt(a')|wt(a)=2] + wt[b'|min(wt(a')) \hspace{0.1cm}\&\hspace{0.1cm} wt(b)=k] - max(wt(a'\cap b')), \\ min[wt(a')|wt(a)=2] + wt[b'|min(wt(a')) \hspace{0.1cm}\&\hspace{0.1cm} wt(b)=k+2] - max(wt(a'\cap b')), \\ min[wt(b')|wt(b)=k] + wt[a'|min(wt(b')) \hspace{0.1cm}\&\hspace{0.1cm} wt(a)=2] - max(wt(a'\cap b')), \\ min[wt(b')|wt(b)=k+2] + wt[a'|min(wt(b')) \hspace{0.1cm}\&\hspace{0.1cm} wt(a)=2] - max(wt(a'\cap b')) \end{array}\right\}. \end{align} \hrulefill \end{figure*} By using (\ref{equ:opcombination}) and (\ref{equ:logopweight}), the upper bound for $d_{min}$ is \begin{align} d_{min}&\leq min\left\{k, k+2, k, k-1\right\}\notag\\ &\leq k-1. \end{align} We have now completed the proof. \end{IEEEproof} The lower bound on the minimum distance $d_{min}$ can be interpreted as the following. Since \begin{align} H_{1}(x) + H_2(x) = \mathbb{{Q}}^r(x) + \mathbb{{Q}}^{nr}(x)=\sum_{i=1}^{p-1}x^i, \end{align} we have \begin{align} H_1+H_2 = \mathbb{{Q}}^r(P) + \mathbb{{Q}}^{nr}(P)=\sum_{i=1}^{p-1}P^i=\mathbb{I}^{\mathcal{G}_{\mathbb{Z}_p}^{\times}}. \end{align} Let $E\in\mathcal{N}(\mathcal{S})\backslash\mathcal{S}$ have weight $wt(E)=1$. Then for $1\leq i\leq p$, $\{\mathcal{M}_Z(E_i)|\mathcal{M}_X(E_i)|\mathcal{M}(E_i)\}=[\mathbb{{Q}}^{nr}(P)|\mathbb{{Q}}^r(P)\hspace{0.1cm}$ $\vert \hspace{0.1cm} \mathbb{I}^{\mathcal{G}_{\mathbb{Z}_p}^{\times}}]$ are distinct column vectors of size $p-1$. Hence, $d_{min}\geq 3$ and $H=[H_1^{sub}|H_2^{sub}]$ of length $N=4n+1$ is at least a single error-correctable code. We now give an example of Type-I stabilizer codes of length $N=4n+1$. \begin{example} \label{exp:DSS4np1b} For $n=3$ and $p=13$, $\mathcal{Q^R}=\{1,3,4,9,10,12\}\left(\bmod \hspace{0.1cm}13\right)$ and $\mathcal{Q^{NR}}=\{2,5,6,7,8,11\}$ $\left(\bmod \hspace{0.1cm}13\right)$. Thus \begin{align} \mathbb{{Q}}^r(x) = x+x^3+x^4+x^9+x^{10}+x^{12} \notag \end{align} and \begin{align} \mathbb{{Q}}^{nr}(x) = x^2+x^5+x^6+x^7+x^{8}+x^{11}. \end{align} The rank $Rank(H)=Rank(H_1^{sub})=Rank(H_2^{sub})=13-1=12$. This is a $[[13,1,d_{min}]]$ quantum stabilizer code. The stabilizer and the set of logical operators $\bar{X}_1$ and $\bar{Z}_1$ are shown in TABLE \ref{tab:exp4np1b}. Let $E=g_2g_4\bar{X}_1$. Then $E=IXIYZIIIIIIZY\in\mathcal{N}(\mathcal{S})\backslash\mathcal{S}$ has $wt(E)=5$. Note that $d^{\dag}= 6$ and the minimum distance of this code is $d_{min}=5<d^{\dag}$. Hence, this is a non-degenerate $[[13, 1, 5]]$ stabilizer code that is capable to correct arbitrary two errors. $\Box$ \end{example} \begin{table} \center \caption{Stabilizer of $[[13,1,5]]$ quantum stabilizer code.} \label{tab:exp4np1b} \renewcommand#1}\tabular{#2}{0.7} \renewcommand\tabcolsep{4pt} \begin{tabular}{c|ccccccccccccc} \toprule $g_1$ & $X$&$Z$&$Z$&$I$&$Z$&$I$&$I$&$I$&$Z$&$I$&$Z$&$Z$&$X$\\ $g_2$ & $I$&$Y$&$I$&$Z$&$Z$&$Z$&$I$&$I$&$Z$&$Z$&$Z$&$I$&$Y$\\ $g_3$ & $Z$&$Z$&$X$&$I$&$I$&$Z$&$Z$&$I$&$Z$&$Z$&$I$&$I$&$X$\\ $g_4$ & $I$&$I$&$I$&$X$&$Z$&$I$&$Z$&$Z$&$Z$&$Z$&$I$&$Z$&$X$\\ $g_5$ & $I$&$Z$&$Z$&$I$&$Y$&$Z$&$I$&$Z$&$I$&$Z$&$I$&$Z$&$Y$\\ $g_6$ & $Z$&$Z$&$I$&$Z$&$Z$&$Y$&$Z$&$I$&$I$&$I$&$I$&$Z$&$Y$\\ $g_7$ & $Z$&$I$&$I$&$I$&$I$&$Z$&$Y$&$Z$&$Z$&$I$&$Z$&$Z$&$Y$\\ $g_8$ & $Z$&$I$&$Z$&$I$&$Z$&$I$&$Z$&$Y$&$I$&$Z$&$Z$&$I$&$Y$\\ $g_9$ & $Z$&$I$&$Z$&$Z$&$Z$&$Z$&$I$&$Z$&$X$&$I$&$I$&$I$&$X$\\ $g_{10}$ & $I$&$I$&$Z$&$Z$&$I$&$Z$&$Z$&$I$&$I$&$X$&$Z$&$Z$&$X$\\ $g_{11}$ & $I$&$Z$&$Z$&$Z$&$I$&$I$&$Z$&$Z$&$Z$&$I$&$Y$&$I$&$Y$\\ $g_{12}$ & $Z$&$Z$&$I$&$Z$&$I$&$I$&$I$&$Z$&$I$&$Z$&$Z$&$X$&$X$\\ \midrule $\bar{X}_1$ & $I$&$Z$&$I$&$I$&$Z$&$Z$&$Z$&$Z$&$I$&$I$&$Z$&$I$&$X$\\ $\bar{Z}_1$ & $Z$&$Z$&$Z$&$Z$&$Z$&$Z$&$Z$&$Z$&$Z$&$Z$&$Z$&$Z$&$Z$\\ \bottomrule \end{tabular} \end{table} \section{Type-II Quasi-cyclic Quantum stabilizer codes} Latin squares are wildly used in the design of Steiner triple systems (STS), which leads to an efficient way to design conventional quasi-cyclic LDPC codes, \emph{e.g.}, \cite{vasic2004} \cite{LiZhang2010}. The general definition of a Latin square is the following. \begin{definition} \label{def:latin} Let $L$ be a set of elements $\{l_1,l_2,\ldots,l_q\}$. An $q\times q$ square matrix \begin{align} \label{equ:latin} S=\left[\begin{matrix}s_{(1,1)} & s_{(1,2)}&\cdots&s_{(1,q)}\\ s_{(2,1)} & s_{(2,2)}&\cdots&s_{(2,q)}\\ \vdots&\vdots&\ddots&\ddots \\ s_{(q,1)} & s_{(q,2)}&\cdots&s_{(q,q)}\\ \end{matrix}\right], \end{align} is a Latin square of order $q$ if each row and column of $S$ contains each element of $L$ exactly once. A Latin square is called commutative if cell $(i,j)$ and $(j,i)$ for $1\leq i, j\leq q$ contain the same element of $L$, that is $S = S^T$. $\blacksquare$ \end{definition} In \cite{aly2007}, a class of quantum LDPC codes of CSS structure has been proposed based on the notion of \emph{Latin Squares}. We will introduce a type of quantum LDPC codes of quasi-cyclic structure for general stabilizer codes by adopting the two step \emph{position-and-lift} operation. The first step of the operation is to design a \emph{proto-matrix} by positioning elements of $\mathcal{Q^R}$ (resp. $\mathcal{Q^{NR}}$) into the form given in (\ref{equ:latin}), where each entry of the proto-matrix can be treated as the power of the CPM $P$ given in (\ref{equ:cpm}). By substituting each element at position $(i,j)$ of the proto-matrix with the CPM $P$, we lift the proto-matrix into a square matrix of size $pk\times pk$. The dimension of the associated Type-II quasi-cyclic stabilizer (QCS) codes can be determined thereafter. In the rest of this section, we first design Type-II QCS codes of length $N=kp$, where $p=4n-1$ and $k=\frac{p-1}{2}$. Then we look at Type-II QCS codes of length $N=kp$ and $p=4n+1$. We name them QCS-A codes and QCS-B codes, respectively. \subsection{QCS-A codes from QR set of size p=4n-1} Since $\mathcal{Q^R}$ (resp. $\mathcal{Q^{NR}}$) is a set of elements of size $k$, we first design a $k\times k$ proto-matrix such that each row and column contains each element of $\mathcal{Q^R}$ (resp. $\mathcal{Q^{NR}}$) exactly once. Hence, both proto-matrices are Latin squares of order $k$. Let $\beta=\alpha^2$, where $\alpha$ is a primitive element of the field $\mathbb{F}_p$. Since $\alpha^2\in\mathcal{Q^R}$ and $k=\frac{p-1}{2}$, $\beta$ is the $k-$th root of unity and $\mathcal{Q^R}$ is closed under multiplication by $\beta$. Thus, $\beta$ is the \emph{generator element} of the $\mathcal{Q^R}$ and we can express $\mathcal{Q^R}$ as \begin{align} \mathcal{Q^R} = \{\beta, \beta^{2}, \ldots,\beta^{k}\}. \end{align} Moreover, we denote the proto-matrix representation of $\mathcal{Q^R}$ as \begin{align} \centering \label{equ:30} {h_P}\left( \mathcal{Q^R} \right) = \left[{\mathcal{Q^R}(1)}\hspace{0.1cm}{\mathcal{Q^R}(2)} \hspace{0.1cm}\cdots \hspace{0.1cm}{\mathcal{Q^R}(k)} \right]=\left[{\beta}\hspace{0.1cm} {\beta^2}\hspace{0.1cm}{\ldots}\hspace{0.1cm}{\beta^k}\right], \end{align} where $\mathcal{Q^R}\left(j\right)$, $1\leq j\leq k$, represents the $j$-th element of $\mathcal{Q^R}$. Since $\beta^k=1\left(\bmod\hspace{0.1cm} p\right)$, $\beta^{k+i}\equiv\beta^{i\left(\bmod k\right)}$ for $1\leq i\leq k$. Denote the $i$-th cyclic left shift of ${h_P}\left( \mathcal{Q^R} \right)$ by \begin{align} \centering \label{equ:31} \begin{array}{l} circ\left(h_P(\mathcal{Q^R})\right)^i\equiv {h_P}\left( {{\beta ^i}\mathcal{Q^R}} \right) = \left[ {{\beta ^i}\mathcal{Q^R}( 1 )}\hspace{0.1cm}{{\beta ^i}\mathcal{Q^R}( 2 )} \hspace{0.1cm}\cdots \hspace{0.1cm}{{\beta ^i}\mathcal{Q^R}( k)}\right].\\ \end{array} \end{align} Similarly, for set $\mathcal{Q^{NR}}=-\{\beta, \beta^{2}, \ldots,\beta^{k}\}$, we have $\beta^i\mathcal{Q^{NR}}\in\mathcal{Q^{NR}}$, then \begin{align} circ\left( h_P(\mathcal{Q^{NR}})\right)^i\equiv {h_P}\left( {{\beta ^i}\mathcal{Q^{NR}} } \right) = \left[ {{\beta ^i}\mathcal{Q^{NR}}(1)}\hspace{0.1cm} {{\beta ^i}\mathcal{Q^{NR}}(2)}\hspace{0.1cm} \cdots\hspace{0.1cm} {{\beta ^i}\mathcal{Q^{NR}} (k)}\right]. \end{align} We now construct the proto-matrices ${H_{1}}_{proto}$ and ${H_{2}}_{proto}$ by positioning different shift of $h_P(\mathcal{Q^R})$ and $h_P(\mathcal{Q^{NR}})$ into the following structure \begin{equation} \centering \label{equ:32} \renewcommand#1}\tabular{#2}{0.7} \renewcommand\tabcolsep{4pt} {H_{1proto}} = \left[ \begin{array}{l} {h_P}\left( \mathcal{Q^R}\right)\\ circ\left({h_P}\left( {\mathcal{Q^R}}\right) \right)^1\\ \begin{array}{*{20}{c}} {}& \vdots &{} \end{array}\\ circ\left({h_P}\left( {\mathcal{Q^R}} \right)\right)^{k-1} \end{array} \right],{H_{2proto}} = \left[ \begin{array}{l} {h_P}\left( {\mathcal{Q^{NR}}} \right)\\ circ\left({h_P}\left( { {\mathcal{Q^{NR}}} } \right)\right)^1\\ \begin{array}{*{20}{c}} {}& \vdots &{} \end{array}\\ circ\left({h_P}\left( { {\mathcal{Q^{NR}}} } \right)\right)^{k-1} \end{array} \right]. \end{equation} Both ${H_{1}}_{proto}$ and ${H_{2}}_{proto}$ are square matrices of $k$ different permutations of $\mathcal{Q^R}$ and $\mathcal{Q^{NR}}$, respectively, where the $i$-th row is the $i$-th permutation. Since the first column of $H_{1proto}$ is $[\beta\hspace{0.2cm} \beta^{1+1}\hspace{0.2cm} \ldots \hspace{0.2cm}\beta^{1+k-1}]^T$, which is equivalent to (\ref{equ:30}), $H_{1proto} = H_{1proto}^T$. Similarly, we have $H_{2proto} = H_{2proto}^T$. Thus, by \emph{Definition \ref{def:latin}}, $H_{1proto}$ and $H_{2proto}$ are commutative Latin squares of order $k$ with every element of $\mathcal{Q^R}$ and $\mathcal{Q^{NR}}$ appearing exactly once in every row and every column. Since $circ\left({h_P}\left( \mathcal{Q^R}\right)\right)^i=-circ\left({h_P}\left( \mathcal{Q^{NR}}\right)\right)^i$ for $0\leq i\leq k-1$, ${H_{2}}_{proto} = -{H_{1}}_{proto}$ and $H_{1proto}+H_{2proto} = p\mathbb{I}^{p\times p}$. Next, we lift each entry of $H_{1proto}$ and $H_{2proto}$ by inserting CPM $P$ of size $p$. For each cyclic shift $0\leq i\leq k-1$ of $h_P(\mathcal{Q^R})$ (resp. $h_P(\mathcal{Q^{NR}})$), we have \begin{align} h_{\mathcal{Q^R}_i} = \left[P^{\beta^{1+i}} \hspace{0.2cm} P^{\beta^{2+i}}\hspace{0.2cm}\ldots \hspace{0.2cm}P^{\beta^{k+i}}\right] \end{align} and \begin{align} h_{\mathcal{Q^{NR}}_i} = \left[P^{-\beta^{1+i}} \hspace{0.2cm} P^{-\beta^{2+i}}\hspace{0.2cm}\ldots \hspace{0.2cm}P^{-\beta^{k+i}}\right]. \end{align} Finally, let \begin{align} \renewcommand#1}\tabular{#2}{0.7} \renewcommand\tabcolsep{4pt} H_1=\left[\begin{array}{l}h_{\mathcal{Q^R}_0}\\h_{\mathcal{Q^R}_1}\\\vdots\\ h_{\mathcal{Q^R}_{k-1}}\end{array}\right] \hspace{0.5cm}\text{and} \hspace{0.5cm} H_2=\left[\begin{array}{l}h_{\mathcal{Q^{NR}}_0}\\h_{\mathcal{Q^{NR}}_1}\\\vdots\\ h_{\mathcal{Q^{NR}}_{k-1}}\end{array}\right]. \end{align} We obtain a pair of matrices $H_1$ and $H_2$ of size $pk\times pk$. Note that each one of $h_{\mathcal{Q^R}_i}$ (resp. $h_{\mathcal{Q^{NR}}_i}$) is a $p\times kp$ sub-matrix of $H_1$ (resp. $H_2$). So we call each $h_{\mathcal{Q^R}_i}$ (resp. $h_{\mathcal{Q^{NR}}_i}$) a \emph{circulant array}. Define $\boxplus$ the operation of \emph{adjunction}; \emph{e.g.,} $(3\boxplus 5) \equiv (P^{3} + P^{5})$. Equivalently, it can also be represented as $(x^{3} + x^{5})$ in the polynomial form. Let $\mathbf{\boldsymbol\emptyset}_{proto}^{1 \times k}$ be an all-zero proto-matrix of size $1\times k$. We adjunct each element of $H_{2proto}$ with element $0$. Thus, the final proto-matrix $H_{proto}$ is of the form \begin{align} \label{equ:protoQCDSS} \renewcommand#1}\tabular{#2}{0.8} \renewcommand\tabcolsep{6pt} \begin{array}{l} {H_{proto}} = \left[ {{H_{1proto}}|H_{2proto}^{'}} \right] = \\ \left[ {\begin{array}{c|c}{\underbrace {\begin{array}{*{20}{l}} {{ {{h_P}\left( {\mathcal{Q^R}} \right)}}}\\ {circ{{\left( {{h_P}\left( {\mathcal{Q^R}} \right)} \right)}^1}}\\ {\begin{array}{*{20}{c}} {}& \vdots &{} \end{array}}\\ {circ{{\left( {{h_P}\left( {\mathcal{Q^R}} \right)} \right)}^{k - 1}}} \end{array}}_{H_{1proto}}} & \underbrace{\begin{array}{*{20}{l}} {{{ {{h_P}\left( {\mathcal{Q^{NR}}} \right)}}}}\\ {circ{{\left( {{h_P}\left( {\mathcal{Q^{NR}}} \right)} \right)}^1}}\\ {\begin{array}{*{20}{c}} {} & \vdots & {} \end{array}}\\ {circ{{\left( {{h_P}\left( {\mathcal{Q^{NR}}} \right)} \right)}^{k - 1}}} \end{array}\begin{array}{*{20}{c}} {\boxplus\left( {\boldsymbol\emptyset _{proto}^{1 \times k}} \right)}\\ {\boxplus\left( {\boldsymbol\emptyset _{proto}^{1 \times k}} \right)}\\ \vdots \\ {\boxplus\left( {\boldsymbol\emptyset _{proto}^{1 \times k}} \right)} \end{array}}_{H_{2proto}^{'} = {H_{2proto}} \boxplus \boldsymbol\emptyset _{proto}^{k \times k}}\end{array}} \right]. \end{array} \end{align} \begin{proposition} \label{prop:2} For a positive integer $n$ and a prime $p=4n-1$, let $h_P(\mathcal{Q^R})$ and $h_P(\mathcal{Q^{NR}})$ be the proto-matrices of $\mathcal{Q^R}$ and $\mathcal{Q^{NR}}$, respectively. Let $\boldsymbol\emptyset_{proto}^{k \times k}$ be an all-zero proto-matrix of size $k\times k$. The parity-check matrix $H$ generated from the proto-matrix $H_{proto} = \left[ {{H_{1proto}}|{H_{2proto}}} \boxplus \boldsymbol\emptyset_{proto}^{k \times k}\right]$ always satisfies the SIP constraint, that is, ${H_{1}}{H_{2}}^T + {H_{2}}{H_{1}}^T=2\left(\mathbb{I}_{proto}^{k \times k} \bigotimes {\mathbb{I}^{\mathcal{G}_{\mathbb{Z}_p}^{\times}}}\right) \equiv \mathbf{0}^{pk\times pk}\left(\bmod\hspace{0.1cm}2\right)$. $\blacksquare$ \end{proposition} \begin{IEEEproof} Let $H_1$ and $H_2$ be in the form of \begin{align} \label{equ:42} \setlength{\arraycolsep}{1.5pt} \renewcommand{#1}\tabular{#2}}{0.6} {H_1}(x) = \left( {\begin{array}{*{20}{c}} {{x^\beta }}& \cdots &{{x^{{\beta ^{k - 1}}}}}&{{x^{{\beta ^k}}}}\\ {{x^{{\beta ^2}}}}& \cdots &{{x^{{\beta ^k}}}}&{{x^{{\beta ^1}}}}\\ \vdots & {\mathinner{\mkern2mu\raise1pt\hbox{.}\mkern2mu \raise4pt\hbox{.}\mkern2mu\raise7pt\hbox{.}\mkern1mu}} & {\mathinner{\mkern2mu\raise1pt\hbox{.}\mkern2mu \raise4pt\hbox{.}\mkern2mu\raise7pt\hbox{.}\mkern1mu}} & \vdots \\ {{x^{{\beta ^k}}}}&{ \cdots \;}&{{x^{{\beta ^{k - 2}}}}}&{{x^{{\beta ^{k - 1}}}}} \end{array}} \right) \hspace{0.2cm} \text{and}\hspace{0.2cm} {H_2}(x) = \left( {\begin{array}{*{20}{c}} {1 + {x^{ - \beta }}}& \cdots &{1 + {x^{ - {\beta ^{k - 1}}}}}&{1 + {x^{ - {\beta ^k}}}}\\ {1 + {x^{ - {\beta ^2}}}}& \cdots &{1 + {x^{ - {\beta ^k}}}}&{1 + {x^{ - {\beta ^1}}}}\\ \vdots & {\mathinner{\mkern2mu\raise1pt\hbox{.}\mkern2mu \raise4pt\hbox{.}\mkern2mu\raise7pt\hbox{.}\mkern1mu}} & {\mathinner{\mkern2mu\raise1pt\hbox{.}\mkern2mu \raise4pt\hbox{.}\mkern2mu\raise7pt\hbox{.}\mkern1mu}} & \vdots \\ {1 + {x^{ - {\beta ^k}}}}&{ \cdots \;}&{1 + {x^{ - {\beta ^{k - 2}}}}}&{1 + {x^{ - {\beta ^{k - 1}}}}} \end{array}} \right). \end{align} Then the first circulant array of $H_1(x)H_{2}(x^{-1})$ is \begin{align} \label{equ:QCSAequ1} \renewcommand\arraycolsep{2pt} \left[ {\begin{array}{*{20}{c}} {\sum\limits_{j = 1}^k {\left( {{x^{{\beta ^j}}} + {x^{{\beta ^{2j}}}}} \right)} }&{\sum\limits_{j = 1}^k {{x^{{\beta ^j}}}\left( {1 + {x^{{\beta ^{(j + 1)(\bmod k)}}}}} \right)} }& \cdots &{\sum\limits_{j = 1}^k {{x^{{\beta ^j}}}\left( {1 + {x^{{\beta ^{(j + 1)(\bmod k)}}}}} \right)} } \end{array}} \right], \end{align} and the other $k-1$ circulant arrays are cyclic shift of (\ref{equ:QCSAequ1}) to the right. Similarly, the first circulant array of $H_2(x)H_{1}(x^{-1})$ is \begin{align} \label{equ:QCSAequ2} \renewcommand\arraycolsep{2pt} \left[ {\begin{array}{*{20}{c}} {\sum\limits_{j = 1}^k {\left( {{x^{ - {\beta ^j}}} + {x^{ - {\beta ^{2j}}}}} \right)} }&{\sum\limits_{j = 1}^k {{x^{ - {\beta ^j}}}\left( {1 + {x^{ - {\beta ^{(j + 1)(\bmod k)}}}}} \right)} }& \cdots &{\sum\limits_{j = 1}^k {{x^{ - {\beta ^j}}}\left( {1 + {x^{ - {\beta ^{(j + 1)(\bmod k)}}}}} \right)} } \end{array}} \right], \end{align} and the other $k-1$ circulant arrays are cyclic shift of (\ref{equ:QCSAequ2}) to the right. The result of $H_1(x)H_2(x^{-1})+H_2(x)H_1(x^{-1})$ is \begin{equation} \centering \label{equ:45} \renewcommand\arraycolsep{2pt} \begin{array}{l} \sum\limits_{j = 1}^k {\left( {{x^{ {\beta ^j}}} + {x^{{\beta ^{2j}}}}}\right)+\left({{x^{ - {\beta ^j}}} + {x^{ - {\beta ^{2j}}}}} \right)}\hspace{0.2cm} \text{on the diagonal,}\\ \sum\limits_{j = 1}^k {{x^{{\beta ^j}}}\left( {1 + {x^{{\beta ^{(j + 1)(\bmod k)}}}}} \right) + {x^{ - {\beta ^j}}}\left( {1 + {x^{ - {\beta ^{(j + 1)(\bmod k)}}}}} \right)} \hspace{0.2cm} \text{elsewhere.} \end{array} \end{equation} As a consequence of \emph{Lemma \ref{lem:QRSproperty}}, if $2\in\mathcal{Q^R}$, then $2\beta^j\in\mathcal{Q^R}$ for $1\leq j\leq k$. On the other hand, if $2\in\mathcal{Q^{NR}}$, $2\beta^j\in\mathcal{Q^{NR}}$ for $1\leq j\leq k$. In both cases, the diagonal term shown in (\ref{equ:45}) generates entire $\mathcal{G}_{\mathbb{Z}_p}^{\times}$ twice. Further, as $\beta\in\mathcal{Q^R}$, $-\beta\in\mathcal{Q^{NR}}$, and both $\mathcal{Q^R}$ and $\mathcal{Q^{NR}}$ are cyclic, the off-diagonal term given in (\ref{equ:45}) also generates entire $\mathcal{G}_{\mathbb{Z}_p}^{\times}$ twice. Thus, \begin{align} {H_{1}}{H_{2}}^T + {H_{2}}{H_{1}}^T=2\left(\mathbb{I}_{proto}^{k \times k} \bigotimes {\mathbb{I}^{\mathcal{G}_{\mathbb{Z}_p}^{\times}}}\right) \equiv \mathbf{0}^{pk\times pk}\left(\bmod\hspace{0.1cm}2\right), \end{align} and $H_1$ and $H_2$ are commuting pairs. \end{IEEEproof} \begin{example}\label{exp:QCDSS} For $n=2$ and $p=7$, $\mathcal{Q^R} = \{\beta,\beta^2,\beta^3\}=\{2, 4, 1\}\left(\bmod 7\right)$. By \emph{Proposition \ref{prop:2}}, we obtain the following proto-matrix of $H$ \begin{equation*} \centering \label{equ:34} \begin{array}{*{20}{l}} \begin{array}{l} {H_{proto}} = \left[ {{H_1}_{proto}|{H_2}_{proto} \boxplus \boldsymbol\emptyset_{proto}^{k \times k}} \right]\\ \renewcommand#1}\tabular{#2}{0.9} \renewcommand\arraycolsep{2pt} = \left[ {\begin{array}{c|c} {\begin{array}{*{20}{c}} {\left\{ {2,4,1} \right\}}\\ {2\cdot\left\{ {2,4,1} \right\}}\\ {4\cdot\left\{ {2,4,1} \right\}} \end{array}}&{\begin{array}{*{20}{c}} {\left\{ {5,3,6} \right\}}\\ {2\cdot\left\{ {5,3,6} \right\}}\\ {4\cdot\left\{ {5,3,6} \right\}} \end{array} \begin{array}{*{20}{c}} {\boxplus\left( {0,0,0} \right)}\\ {\boxplus\left( {0,0,0} \right)}\\ {\boxplus\left( {0,0,0} \right)} \end{array}} \end{array}} \right]\\ = \renewcommand#1}\tabular{#2}{0.9} \renewcommand\arraycolsep{4pt} \left[ {\begin{array}{c|c} {\begin{array}{*{20}{c}} 2&4&1\\ 4&1&2\\ 1&2&4 \end{array}}&{\begin{array}{*{20}{c}} {0 \boxplus 5}&{0 \boxplus 3}&{0 \boxplus 6}\\ {0 \boxplus 3}&{0 \boxplus 6}&{0 \boxplus 5}\\ {0 \boxplus 6}&{0 \boxplus 5}&{0 \boxplus 3} \end{array}} \end{array}} \right]. \end{array} \end{array} \end{equation*} The parity-check matrix $H$ is then obtained by lifting each element of $H_{proto}$ with CPM $P$ of size $7$, that is \begin{equation} \centering \label{equ:QCexample} H = \renewcommand#1}\tabular{#2}{1.0} \renewcommand\arraycolsep{3pt} \left[ {\begin{array}{c|c} {\begin{array}{*{20}{c}} {{P^{2}}}&{{P^{4}}}&{{P^{1}}}\\ {{P^{4}}}&{{P^{1}}}&{{P^{2}}}\\ {{P^{1}}}&{{P^{2}}}&{{P^{4}}} \end{array}}&{\begin{array}{*{20}{c}} {{P^{0}} + {P^{5}}}&{{P^{0}} + {P^{3}}}&{{P^{0}} + {P^{6}}}\\ {{P^{0}} + {P^{3}}}&{{P^{0}} + {P^{6}}}&{{P^{0}} + {P^{5}}}\\ {{P^{0}} + {P^{6}}}&{{P^{0}} + {P^{5}}}&{{P^{0}} + {P^{3}}} \end{array}} \end{array}} \right]. \end{equation} $\Box$ \end{example} \begin{proposition} \label{prop:3} For a positive integer $n$ and a prime $p=4n-1$, the parity-check matrix $H$ yields a $[[N,K,d_{min}]]=[[kp,kp-Rank(H),d_{min}]]$ QCS-A code, where $Rank(H)=k(p-1)+1$ when $n$ is odd and $Rank(H)=k(p-2)+1$ when $n$ is even. $\blacksquare$ \end{proposition} \begin{IEEEproof} Let $\{d_1,d_2,\ldots,d_k\}$ be the $k$ elements of $\mathcal{Q^R}$, and $\sigma_1,\sigma_2,\ldots,\sigma_k$ be $k$ permutations of $\{1,2,\ldots, k\}$ such that $d_{\sigma_1(j)},d_{\sigma_2(j)},\ldots,d_{\sigma_k(j)}$ are distinct for every $1\leq j\leq k$. The parity-check matrix $H_1$ of Equation (\ref{equ:protoQCDSS}) of size $kp\times kp$ over $\mathbb{F}_2$ is then expressed as \begin{equation} H_1 = \left[\begin{matrix} I^{(d_{\sigma_1(1)})} & \cdots & I^{(d_{\sigma_1(k)})} \\ \vdots & \ddots & \vdots \\ I^{(d_{\sigma_k(1)})} & \cdots & I^{(d_{\sigma_k(k)})} \end{matrix}\right] = \left[\begin{matrix} P^{d_{\sigma_1(1)}}_{11} & \cdots & P^{d_{\sigma_1(k)}}_{1k} \\ \vdots & \ddots & \vdots \\ P^{d_{\sigma_k(1)}}_{k1} & \cdots & P^{d_{\sigma_k(k)}}_{kk} \end{matrix}\right], \end{equation} where each $P^{d}_{ij}$ denotes the $d$-th power of $P$. Let $\alpha$ be a primitive $p$-th root of unity and $\mathbb{F}_2(\alpha)$ be the minimal finite field containing both $\mathbb{F}_2$ and $\alpha$. Denote by $V$ the $p\times p$ Vandermonde matrix generated by $\alpha$ over $\mathbb{F}_2$($\alpha$): \begin{equation*} V_p = \left[ \begin{matrix} 1 & 1 & \cdots & 1 \\ 1 & \alpha & \cdots & \alpha^{p-1} \\ \vdots & \vdots & \cdots & \vdots \\ 1 & \alpha^{p-1} & \cdots & \alpha^{(p-1)(p-1)} \end{matrix} \right]. \end{equation*} Since $\alpha$ is a primitive $p$-th root of unity, $\alpha^i$ is a root of $x^p - 1$ and not equal to $1$ for all $1 \leq i \leq p-1$. Moreover, since $x^p - 1 = (x-1)(x^{p-1} + \cdots + 1)$, $\sum_{j=0}^{p-1}\alpha^{ij} = 0$ for all $1 \leq i \leq p-1$. Furthermore, since 2 and $p$ are co-prime, summation of $1$ by $p$ times is still equal to 1 over $\mathbb{F}_2$. It is then easy to check that the inverse of $V_p$ is: \begin{align*} V_p^{-1} = \left[ \begin{matrix} 1 & 1 & \cdots & 1 \\ 1 & \alpha^{-1} & \cdots & \alpha^{-(p-1)} \\ \vdots & \vdots & \cdots & \vdots \\ 1 & \alpha^{-(p-1)} & \cdots & \alpha^{-(p-1)(p-1)} \end{matrix} \right]. \end{align*} For $0 \leq i \leq p-1$, denote by $\mathcal{D}(\alpha^i)$ the $p\times p$ matrix with diagonal entries equal to $\{1, \alpha^i, \cdots, \alpha^{i(p-1)}\}$, that is, \begin{align*} \mathcal{D}(\alpha^i) = \left[\begin{matrix} 1 & 0 & \cdots & 0 \\ 0 & \alpha^i & \ddots & \vdots \\ \vdots & \ddots & \ddots & 0 \\ 0 & \cdots & 0 & \alpha^{i(p-1)} \end{matrix}\right]. \end{align*} Thus, \begin{align*} I^{(1)} = P^1 = V_p\cdot \mathcal{D}(\alpha)\cdot V_p^{-1}, \end{align*} and hence for any $0 \leq d \leq p-1$, \[ I^{(d)} = P^d = V_p\cdot \mathcal{D}(\alpha^d) \cdot V_p^{-1}. \] The matrix $H_1$ can then be decomposed into \begin{align} H_1 = \left[\begin{matrix} V_p & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \ddots & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & V_p \end{matrix}\right] \cdot \left[\begin{matrix} \mathcal{D}(\alpha^{d_{\sigma_1(1)}}) & \cdots & \mathcal{D}(\alpha^{d_{\sigma_1(k)}}) \\ \vdots & \ddots & \vdots \\ \mathcal{D}(\alpha^{d_{\sigma_k(1)}}) & \cdots & \mathcal{D}(\alpha^{d_{\sigma_k(k)}}) \end{matrix}\right] \cdot \left[\begin{matrix} V_p^{-1} & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \ddots & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & V_p^{-1} \end{matrix}\right]. \end{align} {\color{black} Write \begin{align*} \tilde{H_1} = \left[ \begin{matrix} \mathcal{D}(\alpha^{d_{\sigma_1(1)}}) & \cdots & \mathcal{D}(\alpha^{d_{\sigma_1(k)}}) \\ \vdots & \ddots & \vdots \\ \mathcal{D}(\alpha^{d_{\sigma_k(1)}}) & \cdots & \mathcal{D}(\alpha^{d_{\sigma_k(k)}}) \end{matrix} \right]. \end{align*} Since both $\left[\begin{smallmatrix} V_p & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \ddots & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & V_p \end{smallmatrix}\right]$ and $\left[\begin{smallmatrix} V_p^{-1} & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \ddots & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & V_p^{-1} \end{smallmatrix}\right]$ have full rank $kp$, \[Rank(H_1) = Rank(\tilde{H_1}).\] Note that $\tilde{H_1}$ can be regarded as a block matrix with $k \times k$ blocks each of which is a $p \times p$ diagonal matrix. We can then rearrange the columns and rows in $\tilde{H_1}$ to form a block diagonal matrix $\tilde{\tilde{H_1}}$ with each block of size $k\times k$, that is \[ \tilde{\tilde{H_1}} = \left[\begin{matrix} C_0 & \mathbf{0} & \cdots & \mathbf{0} \\ \mathbf{0} & C_1 & \ddots & \mathbf{0} \\ \vdots & \ddots & \ddots & \mathbf{0}\\ \mathbf{0} & \cdots & \mathbf{0} & C_{p-1} \end{matrix}\right], \] where $C_j = \left[\begin{smallmatrix} \alpha^{jd_{\sigma_1(1)}} & \cdots & \alpha^{jd_{\sigma_1(k)}} \\ \vdots & \vdots & \vdots \\ \alpha^{jd_{\sigma_{k}(1)}} & \cdots & \alpha^{jd_{\sigma_{k}(k)}} \end{smallmatrix}\right]$ for all $0 \leq j \leq p-1$. Obviously, \[Rank(\tilde{H_1}) = Rank(\tilde{\tilde{H_1}}) = Rank(C_0) + \cdots + Rank(C_{p-1}).\] Since $C_0 = \left[ \begin{smallmatrix} 1 & \cdots & 1 \\ \vdots & \ddots & \vdots \\ 1 & \cdots & 1 \end{smallmatrix} \right]$, $Rank(C_0) = 1$. Furthermore, since each row of $H_{1proto}$ is a cyclic shift of the first row, we denote \begin{eqnarray*} \sigma_2(1, \cdots, k) &=& (\sigma_1(k),\sigma_1(1),\cdots,\sigma_1(k-1)), \\ &\vdots \\ \sigma_k(1, \cdots, k) &=& (\sigma_1(2),\cdots,\sigma_1(k),\sigma_1(1)). \end{eqnarray*} Thus, $C_j$ is a circulant matrix over $\mathbb{F}_2$$(\alpha)$. Let $U$ be the $k \times k$ cyclic permutation matrix in the same form as $P$ except for the different size. Then, \begin{equation*} C_j = \alpha^{jd_{\sigma_1(1)}}U^0 + \alpha^{jd_{\sigma_1(2)}}U^1 + \cdots + \alpha^{jd_{\sigma_1(k)}}U^{k-1}. \end{equation*} Let $\beta$ be a primitive $k^{th}$ root of unity, $\mathcal{D}(\beta^i)$ be the $k\times k$ diagonal matrix with diagonal entries equal to $\{1, \beta^i, \cdots, \beta^{i(k-1)}\}$, and $V_k$ be the $k\times k$ Vandermonde matrix (over $\mathbb{F}_2$$(\alpha)(\beta)$) generated by $\beta$. Since $U = V_k\cdot \mathcal{D}(\beta) \cdot V_k^{-1}$ and $U^i = V_k\cdot \mathcal{D}(\beta^i) \cdot V_k^{-1}$, we have \[ C_j = V_k\cdot \left(\sum_{i = 0}^{k-1} \alpha^{jd_{\sigma_1(i+1)}}\mathcal{D}(\beta^i)\right) \cdot V_k^{-1}. \] Thus, the rank of $C_j$ is equal to the number of nonzero diagonal entries in $\sum_{i = 0}^{k-1} \alpha^{jd_{\sigma_1(i+1)}}\mathcal{D}(\beta^i)$. Equivalently, it is equal to $k - z$, where $z$ is the number of roots of the polynomial $f_j(x) = \sum_{i = 0}^{k-1} \alpha^{jd_{\sigma_1(i+1)}}x^i$ that belong to $\{1, \beta, \cdots, \beta^{k-1}\}$. {\color{black} Since $p$ and $k$ are co-prime and $\alpha^p = \beta^k = 1$, it can be deduced that $f_j(\beta^i) \neq 0$ for all $1 \leq j \leq p-1$ and $1 \leq i \leq k-1$. } Next, note that $f_j(1) = \sum_{i = 0}^{k-1} \alpha^{jd_{\sigma_1(i+1)}} = \sum_{i = 1}^k \alpha^{jd_i}$. As a consequence of \emph{Lemma \ref{lemma:three}} and \emph{Corollary \ref{coro:T1Nodd}}: (i) when $n$ is odd, $\sum_{i = 1}^k \alpha^{jd_i} \neq 0$ for all $1 \leq j \leq p-1$; (ii) when $n$ is even, there are exactly $\frac{p-1}{2} = k$ elements in $\{\alpha, \cdots, \alpha^{p-1}\}$ which are roots of $\sum_{i = 1}^k x^{d_i}$. In all, \begin{eqnarray*} Rank(H_1) &=& Rank(C_0) + \cdots + Rank(C_{p-1}) \\ &=& \left\{\begin{matrix} 1+k(p-1), & \mathrm{when}~n~\mathrm{is~odd} \\ 1+k(p-1)-k, & \mathrm{when}~n~\mathrm{is~even} \end{matrix}\right.. \end{eqnarray*}} Similarly, the rank of $H_2$ can be proved to be $1$ deficient from the rank of $H_1$. Since each $P_{ij}^{d}$ of $H_2$ has weight equal to $2$, \emph{i.e.,} $(I^{(d)}\boxplus I^{(0)})$, the diagonal matrix $\mathcal{D}$ will have the form \begin{equation*} \mathcal{D}(1 + \alpha^i) = \left[\begin{matrix} 0 & 0 & \cdots & 0 \\ 0 & 1+\alpha^i & \ddots & \vdots \\ \vdots & \ddots & \ddots & 0 \\ 0 & \cdots & 0 & 1+\alpha^{i(p-1)} \end{matrix}\right]. \end{equation*} Then $\tilde{H_2}$ will be written as \begin{equation*} \tilde{H_2} = \left[ \begin{matrix} \mathcal{D}(1+\alpha^{d_{\sigma_1(1)}}) & \cdots & \mathcal{D}(1+\alpha^{d_{\sigma_1(k)}}) \\ \vdots & \ddots & \vdots \\ \mathcal{D}(1+\alpha^{d_{\sigma_k(1)}}) & \cdots & \mathcal{D}(1+\alpha^{d_{\sigma_k(k)}}) \end{matrix} \right]. \end{equation*} Note that the first entry of $\mathcal{D}(1+\alpha^i)$ is always $0$. By rearranging the columns and rows of $\tilde{H_2}$, we turn $\tilde{H_2}$ into a block diagonal matrix $\tilde{\tilde{H_2}}$ of same format as $\tilde{\tilde{H_1}}$ with $Rank(C_{0})=0$. Hence, $Rank(H_2) = Rank(H_1)-1$. Furthermore, we know that the row rank of a matrix equal to its column rank. We also know that there exists a sub-matrix $H^{sub}$ with non-zero determinant of size $Rank(H_1)\times Rank(H_1)$. Therefore, the rank of the parity-check matrix $H$ is given by $Rank(H)=max\left\{Rank(H_1), Rank(H_2)\right\} = Rank(H_1)$. \end{IEEEproof} \begin{remark} \label{remark:1} If $n$ is odd and $k$ is divisible by $3$, then $Rank(H_1)=Rank(H_2) +1 = k(p-3) + 1$. $\blacksquare$ \end{remark} We now give the following method to construct QCS-A codes with the maximum number of independent stabilizer generators. \textbf{\emph{Construction of QCS-A Codes:}} For $n\in\mathbb{Z}^{+}$ and a prime $p=4n-1$, a parity-check matrix $H=[H_1|H_2]$ can be lifted from a proto-matrix $H_{proto}=[H_{1proto}|H_{2proto}]$ that is constructed from $\mathcal{Q^R}$ and $\mathcal{Q^{NR}}$. We obtain the QCS-A code $H^{sub}=[H_1^{sub}|H_2^{sub}]$ based on the following procedures: \begin{enumerate} \item For an odd $n$, if $3$ is a divisor of $k$ (\emph{i.e.,} non-prime), we first remove one arbitrary circulant array from $k$ arrays of $H$. We then choose an additional $k-2$ arbitrary arrays from the rest $k-1$ circulant arrays of $H$. Finally, we remove an arbitrary row from each of the chosen circulant arrays. \item For an odd $n$, if $k$ is a prime, or $k$ is a non-prime that is not divisible by $3$, we choose arbitrary $k-1$ circulant arrays out of $k$ arrays of $H$. Then we remove an arbitrary row from each of the chosen circulant arrays. \item For an even $n$, we first choose arbitrary $k-1$ circulant arrays out of $k$ arrays of $H$, and we remove an arbitrary row from each of the chosen circulant arrays. Then we remove an additional row from each one of the $k$ circulant arrays. \end{enumerate} The resulting parity-check matrix $H^{sub} = [H_1^{sub}|H_{2}^{sub}]$ is a $[[pk, pk-Rank(H),d_{min}]]$ QCS-A code. $\Box$ Note that the all-zero proto-matrix $\boldsymbol{\emptyset}^{k\times k}_{proto}$ presented in \emph{Proposition \ref{prop:2}} can also be adjunct to $H_{1proto}$. The properties shown in \emph{Propositions \ref{prop:2}} and \emph{\ref{prop:3}} are similar. \begin{example}\label{exp:5} Continue from \emph{Example} \ref{exp:QCDSS}. Since $n$ is even and $k$ is a prime, by using the third construction method for QCS-A codes, we remove arbitrary $k-1=2$ rows from arbitrary $k-1=2$ circulant arrays plus additional one row from each circulant array. The parity-check matrix $H$ of this example is depicted in Fig. \ref{fig:ExampleCode}, where the rows $\{2, 3, 8, 11, 21\}$ are removed from the lifted parity-check matrix. The resulting number of linearly independent stabilizer generators is $16$, and thus we can encode $K=5$ logical qubits into $N=21$ physical qubits. The minimum distance of this code is $d_{min}=4$ and it is a $[[21,5,4]]$ QCS-A code. $\Box$ \end{example} \begin{figure*} \centering \includegraphics[width=5.5in]{./ExampleCode7distance4QCScode.eps} \caption{\hspace{0.1cm}$[[21, 5, 4]]$ QCS-A code in \emph{Example \ref{exp:QCDSS}} and \emph{\ref{exp:5}. }} \label{fig:ExampleCode} \end{figure*} \subsection{QCS-B Codes from QR set of size p = 4n+1} We now give another type of QCS codes, Type-II QCS-B codes, designed from quadratic residue set of size $p=4n+1$. In this case, no adjunct of element $0$ is required. Let $h_P(\mathcal{Q^R}) = \left[\mathcal{Q^R}(1) \mathcal{Q^R}(2) \ldots,\mathcal{Q^R}(k)\right]$ $=\left[\beta,\beta^2,\ldots,\beta^k\right]$, the same format given in Equation (\ref{equ:30}). From \emph{Lemma \ref{lem:QRSproperty}}, since $\alpha^{2i-1}\cdot \alpha^{2i}\in\mathcal{Q^{NR}}$ for $1\leq i\leq \frac{p-1}{2}$, where $\alpha^{2i}\in\mathcal{Q^R}$ and $\alpha^{2i-1}\in\mathcal{Q^{NR}}$, we position $h_P(\mathcal{Q^{NR}})$ in the following format \begin{align} \label{equ:QCDSS2} h_P(\mathcal{Q^{NR}}) = min(\mathcal{Q^{NR}})h_P(\mathcal{Q^{R}})\hspace{0.1cm} \left(\bmod \hspace{0.1cm}p\right). \end{align} Unlike the method used for QCS-A codes, we design $H_{1proto}$ by reversing the direction of cyclic shifts of $h_P(\mathcal{Q^{R}})$. We denote the $i$-th cyclic right shift of $h_P(\mathcal{Q^{R}})$ as \begin{align} \centering \renewcommand#1}\tabular{#2}{1.0} \renewcommand\arraycolsep{3pt} \label{equ:QCSB} \begin{array}{l} circ\left(h_P(\mathcal{Q^R})\right)^{-i}\equiv {h_P}\left( {{\beta ^{-i}}\mathcal{Q^R}} \right) = \left[ {{\beta ^{-i}}\mathcal{Q^R}( 1 )}\hspace{0.1cm}{{\beta ^{-i}}\mathcal{Q^R}( 2 )}\hspace{0.1cm} \cdots\hspace{0.1cm} {{\beta ^{-i}}\mathcal{Q^R}( k )}\right].\\ \end{array} \end{align} By juxtaposing different shifts of ${h_P}\left( {{\beta ^{-i}}\mathcal{Q^R}} \right)$, we obtain \begin{align} \renewcommand#1}\tabular{#2}{0.8} \renewcommand\arraycolsep{3pt} \label{equ:QCDSS2b} {H_{1proto}} = \left[ \begin{array}{l} {h_P}({\mathcal{Q^{R}}})\\ circ{({h_P}({\mathcal{Q^{R}}}))^{ - 1}}\\ \vdots \\ circ{({h_P}({\mathcal{Q^{R}}}))^{ - k + 1}} \end{array} \right]. \end{align} Furthermore, based on (\ref{equ:QCDSS2}), we construct $H_{2proto}$ as \begin{align} \renewcommand#1}\tabular{#2}{0.9} \renewcommand\arraycolsep{2.5pt} \label{equ:QCDSS2c} {H_{2proto}} = \left[ {\begin{array}{*{20}{l}} {{h_P}({\mathcal{Q^{NR}}})}\\ {{\beta }{h_P}({\mathcal{Q^{NR}}})}\\ {\beta ^2}{h_P}({\mathcal{Q^{NR}}})\\ \vdots \\ {{\beta ^{k - 1}}{h_P}({\mathcal{Q^{NR}}})} \end{array}} \right] \equiv \left[ {\begin{array}{*{20}{l}} {min ({\mathcal{Q^{NR}}}){h_P}({\mathcal{Q^R}})}\\ {min ({\mathcal{Q^{NR}}})circ{{({h_P}({\mathcal{Q^R}}))}^1}}\\ min ({\mathcal{Q^{NR}}})circ{({h_P}({\mathcal{Q^R}}))^2}\\ \vdots \\ {min ({\mathcal{Q^{NR}}})circ{{({h_P}({\mathcal{Q^R}}))}^{k - 1}}} \end{array}} \right]. \end{align} The constructed proto-matrices $H_{1proto}$ and $H_{2proto}$ are square matrices of $k$ different permutations of $\mathcal{Q^R}$ and $\mathcal{Q^{NR}}$, respectively. They are also Latin squares of order $k$ since every element of $\mathcal{Q^R}$ (resp. $\mathcal{Q^{NR}}$) appears exactly once in every row and every column. However, only $H_{2proto}$ is a commutative Latin square, whereas $H_{1proto}\neq H_{1proto}^T$ is not. \begin{proposition} \label{prop:QCDSS2} For a positive integer $n$ and $p = 4n+1$, let $h_P(\mathcal{Q^R})=\left[\mathcal{Q^R}(1),\mathcal{Q^R}(2),\ldots,\mathcal{Q^R}(k)\right]$ and $h_P(\mathcal{Q^{NR}})=min(\mathcal{Q^{NR}})h_P(\mathcal{Q^{R}})(\hspace{-0.13cm}\bmod \hspace{-0.07cm}p)$. The parity-check matrix $H$ lifted from $H_{proto}=[H_{1proto}|H_{2proto}]$ as specified in (\ref{equ:QCDSS2b}) and (\ref{equ:QCDSS2c}) satisfies the SIP constraint which yields a $[[N,K,d_{min}]]=[[pk,pk-Rank(H),d_{min}]]$ QCS-B code with $Rank(H)=k(p-1)+1$ when $n$ is odd and $Rank(H)=k(p-2)+1$ when $n$ is even. \end{proposition} \begin{IEEEproof} Let $\gamma=min(\mathcal{Q^{NR}})$, we represent $H_1$ and $H_2$ in polynomial form of circulant arrays \begin{align} \setlength{\arraycolsep}{1.5pt} \renewcommand{#1}\tabular{#2}}{0.6} {H_1(x)} = \left( {\begin{array}{*{20}{c}} {{x^\beta }}&{{x^{{\beta ^2}}}}& \cdots &{{x^{{\beta ^k}}}}\\ {{x^{{\beta ^k}}}}&{{x^\beta }}& \cdots &{{x^{{\beta ^{k - 1}}}}}\\ \vdots & \ddots & \ddots & \vdots \\ {{x^{{\beta ^2}}}}&{{x^{{\beta ^3}}}}& \cdots &{{x^{{\beta }}}} \end{array}} \right) \hspace{0.2cm}\text{and}\hspace{0.2cm} {H_2(x)} = \left( {\begin{array}{*{20}{c}} {{x^{\gamma \beta }}}&\cdots&{{x^{\gamma \beta^{k-1} }}} &{{x^{\gamma {\beta ^k}}}}\\ {{x^{\gamma {\beta ^2}}}}&\cdots& {{x^{\gamma \beta^k }}} &{{x^{\gamma {\beta}}}}\\ \vdots & \iddots & \iddots & \vdots \\ {{x^{\gamma {\beta ^k}}}}& \cdots &{{x^{\gamma {\beta ^{k-2}}}}}&{{x^{\gamma {\beta ^{k - 1}}}}} \end{array}} \right). \end{align} Then the first circulant array of $H_1(x)H_2(x^{-1})$ is \begin{align} \label{equ:QSC2proofa} \left[ {\begin{array}{*{20}{c}} {\sum\limits_{j = 1}^k {{x^{{\beta ^j}\left( {1 - \gamma {\beta ^0}} \right)}}} }&{\sum\limits_{j = 1}^k {{x^{{\beta ^j}\left( {1 - \gamma {\beta ^1}} \right)}}} }& \cdots &{\sum\limits_{j = 1}^k {{x^{{\beta ^j}\left( {1 - \gamma {\beta ^{k - 1}}} \right)}}} } \end{array}} \right], \end{align} and the other $k-1$ circulant arrays are cyclic shift of Equation (\ref{equ:QSC2proofa}) to the left. Similarly, the first circulant array of $H_2(x)H_1(x^{-1})$ is \begin{align} \label{equ:QSC2proofb} \left[ {\begin{array}{*{20}{c}} {\sum\limits_{j = 1}^k {{x^{{\beta ^j}\left( {\gamma {\beta ^0} - 1} \right)}}} }&{\sum\limits_{j = 1}^k {{x^{{\beta ^j}\left( {\gamma {\beta ^1} - 1} \right)}}} }& \cdots &{\sum\limits_{j = 1}^k {{x^{{\beta ^j}\left( {\gamma {\beta ^{k - 1}} - 1} \right)}}} } \end{array}} \right], \end{align} and the other $k-1$ circulant arrays are cyclic shift of Equation (\ref{equ:QSC2proofb}) to the left. Note that $\gamma-1\equiv -(1-\gamma) (\bmod \hspace{0.1cm}p)$. We obtain the first circulant array of ${H_1}\left( x \right){H_2}\left( {{x^{ - 1}}} \right) + {H_2}\left( x \right){H_1}\left( {{x^{ - 1}}} \right)$ containing only the term \begin{align} \label{equ:QSC2proofc} {{x^{\left( {1 - \gamma {\beta ^i}} \right)}}\sum\limits_{j = 1}^k {\left( {{x^{{\beta ^j}}} + {x^{ - {\beta ^j}}}} \right)} } \end{align} for $0 \le i \le k - 1$. Since for a prime $p=4n+1$, both $\{\beta,-\beta\}\in\mathcal{Q^R}$. This implies that $\sum\limits_{j = 1}^k {\left( {{x^{{\beta ^j}}} + {x^{ - {\beta ^j}}}} \right)}\equiv 0$. Hence, $H_1(x)$ and $H_2(x)$ are commuting pairs. Moreover, using the similar way in the proof of \emph{Proposition \ref{prop:3}}, the rank of $H$ can be shown to be either $Rank(H_1)=Rank(H_2)=k(p-1)+1$ for $n$ is odd or $Rank(H_1)=Rank(H_2)=k(p-2)+1$ for $n$ is even. Thus, $Rank(H)=Rank(H_1)=Rank(H_2)$. \end{IEEEproof} The methods $2)$ and $3)$ of the \emph{Construction of QCS-A Codes} can be applied here to generate a QCS-B code. We now see an example. \begin{example} \label{exp:QCSII} For $n=3$ and $p=13$, we have $\mathcal{Q^R}=\{4, 3, 12, 9, 10, 1\}$ and $\mathcal{Q^{NR}}=\{2, 5, 6, 7, 8, 11\}$ with $k=|\mathcal{Q^R}|=|\mathcal{Q^{NR}}|=\frac{p-1}{2}=6$. Let $\beta=4$ and $\gamma=min\left(\mathcal{Q^{NR}}\right)=2$. Then \begin{align*} \begin{array}{l} {H_{proto}} = \left[ {{H_{1proto}}|{H_{2proto}}} \right] = \\ \setlength{\arraycolsep}{1.5pt} \renewcommand{#1}\tabular{#2}}{0.6} \left[ {\begin{array}{c|c} {\begin{matrix} 4&3&{12}&9&{10}&1\\ 1&4&3&{12}&9&{10}\\ {10}&1&4&3&{12}&9\\ 9&{10}&1&4&3&{12}\\ {12}&9&{10}&1&4&3\\ 3&{12}&9&{10}&1&4 \end{matrix}}&{2\left( {\begin{matrix} 4&3&{12}&9&{10}&1\\ 3&{12}&9&{10}&1&4\\ {12}&9&{10}&1&4&3\\ 9&{10}&1&4&3&{12}\\ {10}&1&4&3&{12}&9\\ 1&4&3&{12}&9&{10} \end{matrix}} \right)} \end{array}} \right] =\left[ {\begin{array}{c|c} {\begin{matrix} 4&3&{12}&9&{10}&1\\ 1&4&3&{12}&9&{10}\\ {10}&1&4&3&{12}&9\\ 9&{10}&1&4&3&{12}\\ {12}&9&{10}&1&4&3\\ 3&{12}&9&{10}&1&4 \end{matrix}}&{ {\begin{matrix} 8&6&{11}&5&{7}&2\\ 6&{11}&5&{7}&2&8\\ {11}&5&{7}&2&8&6\\ 5&{7}&2&8&6&{11}\\ {7}&2&8&6&{11}&5\\ 2&8&6&{11}&5&{7} \end{matrix}}} \end{array}} \right] \end{array}. \end{align*} By lifting each element of $H_{proto}$ with CPM $P$ of size $13$, we obtain \begin{align*} \setlength{\arraycolsep}{2.0pt} \renewcommand{#1}\tabular{#2}}{0.7} H = \left[ {\begin{array}{c|c} {\begin{matrix} {{P^4}}&{{P^3}}&{{P^{12}}}&{{P^9}}&{{P^{10}}}&{{P^1}}\\ {{P^1}}&{{P^4}}&{{P^3}}&{{P^{12}}}&{{P^9}}&{{P^{10}}}\\ {{P^{10}}}&{{P^1}}&{{P^4}}&{{P^3}}&{{P^{12}}}&{{P^9}}\\ {{P^9}}&{{P^{10}}}&{{P^1}}&{{P^4}}&{{P^3}}&{{P^{12}}}\\ {{P^{12}}}&{{P^9}}&{{P^{10}}}&{{P^1}}&{{P^4}}&{{P^3}}\\ {{P^3}}&{{P^{12}}}&{{P^9}}&{{P^{10}}}&{{P^1}}&{{P^4}} \end{matrix}}&{\begin{matrix} {{P^8}}&{{P^6}}&{{P^{11}}}&{{P^5}}&{{P^7}}&{{P^2}}\\ {{P^6}}&{{P^{11}}}&{{P^5}}&{{P^7}}&{{P^2}}&{{P^8}}\\ {{P^{11}}}&{{P^5}}&{{P^7}}&{{P^2}}&{{P^8}}&{{P^6}}\\ {{P^5}}&{{P^7}}&{{P^2}}&{{P^8}}&{{P^6}}&{{P^{11}}}\\ {{P^7}}&{{P^2}}&{{P^8}}&{{P^6}}&{{P^{11}}}&{{P^5}}\\ {{P^2}}&{{P^8}}&{{P^6}}&{{P^{11}}}&{{P^5}}&{{P^7}} \end{matrix}} \end{array}} \right]. \end{align*} It can be checked that H satisfies the SIP constraint. Furthermore, since $Rank(H)=6(13-1)+1=73$, we remove $5$ rows separately from $5$ different circulant arrays. Thus, we obtain a $[[73, 5, d_{min}]]$ QCS-B code. $\Box$ \end{example} \section{Constructed Codes and Simulation Results} We constructed Type-I stabilizer codes of length $N=4n+1$ and $N=4n-1$ for $n\leq 25$ and the results are listed in TABLEs \ref{tab:TypeIa} and \ref{tab:TypeIb}. The codes in TABLE \ref{tab:TypeIa} are Type-I $[[N,K,d_{min}]]=[[4n+1,1,d^{\dag}\geq d_{min}\geq 3]]$ stabilizer codes. The corresponding $d^{\dag}$ of the codes, which denotes the minimum weight of an operator $E\in\mathcal{M}$, is also shown in the table. From these two tables, it can be seen that $d_{min}<d^{\dag}$ for all $n$, which means they are all non-degenerate stabilizer codes. Further, we find that for the code lengths $N=4n+1$, $n=1, 3$ and $7$, our constructed Type-I stabilizer codes in TABLE \ref{tab:TypeIa} achieve the highest minimum distance as given in \cite{Grassl}. For $n=9$, the constructed $[[37,1,12]]$ Type-I stabilizer code satisfies the distance bound $11\leq d_{min}\leq 13$ given in \cite{Grassl}. Moreover, our constructed Type-I stabilizer codes, $[[53,1,15]]$, $[[61,1,17]]$ and $[[101,1,21]]$ meet the lower bound of the achievable minimum distance given in \cite{Grassl}. As shown in TABLE \ref{tab:TypeIa}, for $n=1$, our Type-I stabilizer code is equivalent to the \emph{perfect} $[[5,1,3]]$ code \cite{laf1996}, and it has $d^{\dag}=4>d_{min}$ shown in brackets, where $d^{\dag} = 4n$. Also, for $n=3$ and $7$, our $[[13,1,5]]$ and $[[29,1,11]]$ Type-I stabilizer codes are equivalent to the codes proposed in \cite{CalderRainShorSloane1997}. Furthermore, the codes in TABLE \ref{tab:TypeIb} are Type-I $[[N,K,d_{min}]]=[[4n-1,2n-1,2]]$ codes, where the code rate $\frac{K}{N}$ is approximately half and $d_{min}=2$ for any even $n$ that gives a prime $p=4n-1$. The minimum distance $d^{\dag}$ of stabilizer $\mathcal{S}$ is also listed in the table. In TABLE \ref{tab:QCS}, we show the constructed some Type-II QCS codes of length $N=kp$ and $p=4n\pm 1$, where $n$ is both even and odd. We give the exact minimum distance for the constructed codes of length $N=10$ and $21$. The distance range for the constructed QCS codes of length $N=21$ represents different $[[21, K, d_{min}]]$ QCS codes constructed with same $K$ and different $d_{min}$. Note that the proposed Type-II QCS-A codes of length $N=kp$ exist in the form of $H_{proto}=[H_{1proto}|H'_{2proto}=H_{2proto}\boxplus \emptyset^{k\times k}_{proto}]$. We also know that the proposed method enables $\emptyset^{k\times k}_{proto}$ adjunct to either $H_{1proto}$ or $H_{2proto}$. This implies that there are four different arrangements for $H_{proto}$, \emph{i.e.,} $H_{proto}=\left[H'_{2proto}|H_{1proto}\right]$, $H_{proto}=\left[H'_{1proto}|H_{2proto}\right]$, $H_{proto}=\left[H_{1proto}|H'_{2proto}\right]$ and $H_{proto}=\left[H_{2proto}|H'_{1proto}\right]$. Interestingly, if we swap the position of $H_{1proto}$ and $H'_{2proto}$, we might obtain two different codes. More importantly, by removing different rows, different codes with different minimum distance might also be obtained. TABLE \ref{tab:QCS-A21} illustrates various $[[21,5,d_{min}]]$ and $[[21,6,d_{min}]]$ QCS-A codes constructed using different arrangement of proto-matrix $H_{proto}$, and by removing different rows of the lifted parity-check matrix $H$. Let $H_{proto}=[H_{1proto}|H'_{2proto}]$, from the table, for $[[21, 5, d_{min}]]$ QCS-A code, $d_{min}=4$ if rows $\{7, 11, 12, 14, 21\}$ are removed from the lifted parity-check matrix $H$. However, if $H_{proto}=[H'_{2proto}|H_{1proto}]$, we obtain a $[[21, 5, 5]]$ QCS-A code if the same rows $\{7, 11, 12, 14, 21\}$ are removed. Moreover, if $H_{proto}=\left[H'_{1proto}|H_{2proto}\right]$ and rows $\{5, 8, 9, 13, 21\}$ are removed, we obtain a $[[21, 5, 3]]$ QCS-A code. Furthermore, for $[[21,6,d_{min}]]$ QCS-A codes, we have $d_{min}=4$ (resp. $d_{min}=3$) if $H_{proto}=[H_{1proto}|H'_{2proto}]$ (resp. $H_{proto}=[H'_{2proto}|H_{1proto}]$) and the rows $\{3, 7, 11, 12, 14, 21\}$ are removed. Similarly, we can also construct $[[21, 6, 4]]$ and $[[21,6, 2]]$ QCS-A codes when rows $\{4, 7, 11, 12, 14, 21\}$ are removed. If $\emptyset^{k\times k}$ is adjunct to either $H_{1proto}$ or $H_{2proto}$ and the rows $\{7, 11, 12, 14, 15, 21\}$ are removed in both cases, we obtain a $[[21, 6, 4]]$ or $[[21, 6, 1]]$ QCS-A code, respectively. Now we compare our constructed codes with the benchmarks of asymptotic code efficiency for quantum codes. Recall that the quantum Hamming bound is \cite{Gottesman1996} \begin{align} \label{equ:qhb} \sum_{j=0}^{t} 3^j{N \choose j}\leq 2^{m}, \end{align} and the code efficiency is asymptotically upper bounded by \begin{align} \label{equ:QHBA} \frac{K}{N}\leq 1 - \delta^Q \log_2(3) - h_2(\delta^Q), \end{align} where $m = N-K$ is the number of stabilizer generators, $t = \lfloor\frac{d_{min}-1}{2}\rfloor$ is the number of correctable errors, and $\delta^Q=\frac{t}{N}$. In (\ref{equ:QHBA}), $h_2(*)$ is the binary entropy function $h_2(x)=-x\log_2(x)-(1-x)\log_2(1-x)$. The quantum Gilbert-Varshamov (GV) bound is \cite{CalderRainShorSloane1997} \begin{align} \label{equ:QGVB} \sum_{j=0}^{2t} 3^j{N \choose j}\leq 2^{m}, \end{align} and the code efficiency is asymptotically lower bounded by \begin{align} \label{equ:QGVBA} \frac{K}{N}\geq 1 - 2\delta^Q \log_2(3) - h_2(2\delta^Q). \end{align} For an $[[N,K,d_{min}]]$ CSS code, we have the Gilbert-Varshamov bound \cite{Calderbank1996} \begin{align} \frac{K}{N}\geq 1 - 2h_2(2\delta^Q). \end{align} And any (degenerate and non-degenerate) quantum code must satisfy the quantum Singleton bound \cite{KnillLaf1997} \begin{align} \label{equ:QSB} N - K\geq 4t. \end{align} Hence, the asymptotic code efficiency is given by \begin{align} \label{equ:QSBA} \frac{K}{N}\leq 1- 4\delta^Q. \end{align} The above known quantum bounds in the literature are depicted in Fig. \ref{fig:quantumBounds} with code rate $\frac{K}{N}$ in terms of its normalized distance $\frac{d_{min}}{N}$, where $\frac{d_{min}}{N}\approx 2\delta^Q$ for sufficiently large $N$. We also depicted our constructed codes in Fig. \ref{fig:quantumBounds} for comparison. From the figure, the equality of the quantum Hamming bound (\ref{equ:qhb}) and the quantum Singleton bound (\ref{equ:QSB}) holds for $[[5,1,3]]$ Type-I stabilizer code when $n=1$. In this case, the number of correctable error $t$ is equal to $n$. For other Type-I stabilizer codes of $N=4n+1$ with $N>5$, the code efficiency is upper bounded by the quantum Hamming bound for $t<n$ or $d_{min}<2n+1$. Furthermore, for small value of $n$, the constructed $[[21,5,4]]$, $[[21,5,5]]$, $[[21, 6, 4]]$ and $[[55,4,12]]$ Type-II QCS-A codes and $[[10,1,3]]$ Type-II QCS-B code satisfy the quantum GV bound for general stabilizer codes, and upper bounded by quantum Hamming bound. On the other hand, for large value of $n$, weaker lower bound can be satisfied for the constructed QCS codes, \emph{e.g.,} the $[[78, 5, 13]]$ QCS-B code and $[[171, 26, 19]]$ QCS-A code satisfy the quantum GV bound for CSS codes. \begin{table}[ht] \renewcommand{#1}\tabular{#2}}{1.5} \caption{Type-I stabilizer codes of length $N=4n+ 1$ for $n\leq 25$. $d^{\dag}$ is the minimum weight of operator $E\in\mathcal{S}$. Underlined numbers indicate that $d_{min}$ meets the lower bound of the achievable minimum distance given in \cite{Grassl}. Number with brackets is the Perfect code in \cite{laf1996}.} \centering \begin{tabular}{c c c} \hline\hline \vspace{0.05cm} $n$ & ${[[N,K,d_{min}]]}$ & $d^{\dag}\leq 2n$\\ \hline $1$ & [[5,1,3]] & (4) \\ \hline $3$ & [[13,1,5]] & 6 \\ \hline $7$ & [[29,1,11]] & 12 \\ \hline $9$ & [[37,1, 12]]& 12 \\ \hline $13$& [[53,1,\underline{15}]]& 16 \\ \hline $15$& [[61,1,\underline{17}]]& 18 \\ \hline $25$& [[101,1,\underline{21}]]& 22 \\ \hline\hline \end{tabular} \label{tab:TypeIa} \end{table} \begin{table}[ht] \renewcommand{#1}\tabular{#2}}{1.5} \caption{Type-I stabilizer codes of length $N = 4n - 1$ for $n\leq 25$. $d^{\dag}$ is the minimum weight of operator $E\in\mathcal{S}$.} \centering \begin{tabular}{c c c} \hline\hline $n$ & $[[N,K,d_{min}]]$ & $d^{\dag}$ \\ \hline $2$ & $[[7,3,2]]$ & $4$ \\ \hline $6$ & $[[23,11,2]]$& $8$ \\ \hline $8$ & $[[31,15,2]]$& $8$ \\ \hline $12$ & $[[47,23,2]]$& $12$ \\ \hline $18$ & $[[71,35,2]]$& $16$ \\ \hline $20$ & $[[79,39,2]]$& $16$ \\ \hline\hline \end{tabular} \label{tab:TypeIb} \end{table} \begin{table}[ht] \renewcommand{#1}\tabular{#2}}{1.5} \renewcommand{\tabcolsep}{2.0pt} \caption{Type-II QCS codes of length $N=kp$ and $p=4n\pm1$.} \centering \begin{tabular}{c c c c c} \hline\hline \vspace{0.05cm} $n$ & Type& $p=4n\pm1$ & $k=\frac{p-1}{2}$ & $[[N=kp,K,d_{min}]]$ \vspace{0.05cm} \\ \hline $1$ & QCS-B &$5$ & $2$ & $[[10, 1, 3]]$ \vspace{0.05cm}\\ \hline $2$ & QCS-A &$7$ & $3$ & $[[21, 5, 3-5]]$ \vspace{0.05cm}\\ \hline $2$ & QCS-A &$7$ & $3$ & $[[21, 6, 1-4]]$ \vspace{0.05cm}\\ \hline $3$ & QCS-A &$11$ & $5$ & $[[55, 4, \leq{12}]]$ \vspace{0.05cm} \\ \hline $3$ & QCS-B &$13$ & $6$ & $[[78, 5, \leq{13}]]$ \vspace{0.05cm}\\ \hline $4$ & QCS-B &$17$ & $8$ & $[[136, 15, \leq{12}]]$ \vspace{0.05cm}\\ \hline $5$ & QCS-A &$19$ & $9$ & $[[171, 26, \leq{19}]]$ \vspace{0.05cm} \\ \hline $6$ & QCS-A &$23$ & $11$& $[[253, 21, \leq{23} ]]$ \vspace{0.05cm} \\ \hline $7$ & QCS-B &$29$ & $14$& $[[406, 13, \leq{34}]]$ \vspace{0.05cm} \\ \hline\hline \end{tabular} \label{tab:QCS} \end{table} \begin{table}[ht] \renewcommand{#1}\tabular{#2}}{1.5} \renewcommand{\tabcolsep}{2.0pt} \caption{$[[21,K,d_{min}]]$ Type-II QCS-A codes of different minimum distance $d_{min}$.} \centering \begin{tabular}{c c c} \hline\hline $[[N,K,d_{min}]]$ & $H_{proto}$ & Removed Rows \\ \hline $[[21, 5, 5]]$ & $\left[H_{2proto}\boxplus\emptyset^{k\times k}|H_{1proto}\right]$ & \{7, 11, 12, 14, 21\}\\ \hline $[[21, 5, 4]]$ & $\left[H_{1proto}|H_{2proto}\boxplus\emptyset^{k\times k}\right]$ & \{7, 11, 12, 14, 21\}\\ \hline $[[21, 5, 3]]$ & $\left[H_{1proto}\boxplus\emptyset^{k\times k}|H_{2proto}\right]$ & \{5, 8, 9, 13, 21\}\\ \hline $[[21, 6, 4]]$ & $\left[H_{1proto}\boxplus\emptyset^{k\times k}|H_{2proto}\right]$ & \{7, 11, 12, 14, 15, 21\} \\ \hline $[[21, 6, 1]]$ & $\left[H_{2proto}\boxplus\emptyset^{k\times k}|H_{1proto}\right]$ & \{7, 11, 12, 14, 15, 21\} \\ \hline $[[21, 6, 3]]$ & $\left[H_{2proto}\boxplus\emptyset^{k\times k}|H_{1proto}\right]$ & \{3, 7, 11, 12, 14, 21\} \\ \hline $[[21, 6, 4]]$ & $\left[H_{1proto}|H_{2proto}\boxplus\emptyset^{k\times k}\right]$ & \{3, 7, 11, 12, 14, 21\}\\ \hline $[[21, 6, 2]]$ & $\left[H_{2proto}\boxplus\emptyset^{k\times k}|H_{1proto}\right]$ & \{4, 7, 11, 12, 14, 21\} \\ \hline $[[21, 6, 4]]$ & $\left[H_{1proto}|H_{2proto}\boxplus\emptyset^{k\times k}\right]$ & \{4, 7, 11, 12, 14, 21\}\\ \hline\hline \end{tabular} \label{tab:QCS-A21} \end{table} \begin{figure*}[ht] \centering \includegraphics[width=6.8in]{./QuanBounds2.eps} \caption{Known asymptotic quantum coding bounds and some designed Type-I and Type-II stabilizer codes.} \label{fig:quantumBounds} \end{figure*} \section{Conclusion and Discussions} In this work, two types of general quantum stabilizer codes were proposed based on quadratic residue sets of prime modulus. Different construction methods are proposed based on the property of quadratic residue sets and the constructed codes satisfy the commutative constraint. The minimum distance for Type-I stabilizer codes of length $N=4n+1$ is closely related to the size of quadratic residue sets while the dimension of the codes is a constant. The code rate for Type-I stabilizer codes of length $N=4n-1$ is near half. By exploiting the property between the elements of quadratic residue sets, we showed that each quadratic residue set is capable of designing proto-matrix of Latin Square format, and permitted a substantial number of new quasi-cyclic stabilizer codes constructed after lifting a pre-obtained proto-matrix. We demonstrated that the constructed new codes meet the distance bounds as shown in the literature.
{'timestamp': '2014-08-01T02:04:17', 'yymm': '1407', 'arxiv_id': '1407.8249', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8249'}
arxiv
\section{Introduction} Aggregation of preferences is a central problem in the field of social choice, and has received a considerable amount of attention from the artificial intelligence research community \cite<see e.g.,\xspace>{Coni10a}. While the most-studied scenario is that of selecting a single candidate out of many, it is often the case that one needs to select a fixed-size {\em set of winners (committee)}: this includes domains such as parliamentary elections, the hiring of faculty members, or (automated) agents deciding on a set of plans~\cite{ELS11a,LMM07a,DOS14a}. The study of algorithmic complexity of voting rules that output committees is an active research direction \cite<see e.g.,\xspace>{LMM07a,PSZ08a,MPRZ08a,CKM10a,bou-lu:c:chamberlin-courant,BSU13a,SFS13a,cor-gal-spa:c:sp-width,sko-yu-fal:c:mwsc}. Much of the prior work on properties of multi-winner rules focuses on the setting where voters' preferences are total orders of the candidates. In contrast, in this paper we focus on approval-based rules, where each voter lists the subset of candidates that she approves of. One of the advantages of such rules is the simplicity of ballots: approval ballots reduce the cognitive burden on voters (rather than providing a full ranking of the candidates, a voter only needs to decide which candidates to approve) and are also easier to communicate to the election authority. The most straightforward way to aggregate approvals is to have every approval for a candidate contribute one point to that candidate's score and select the candidates with the highest score. This rule is called \emph{Approval Voting (\av)}. \av has many desirable properties in the single winner case~\cite{BMS06a,Endr13a}, including its ``simplicity, propensity to elect Condorcet winners (when they exist), its robustness to manipulation and its monotonicity'' \cite[p.~viii]{Bram10a}. However, for the case of multiple winners, the merits of $\av$ are ``less clear'' \cite[p.~viii]{Bram10a}. In particular, for the multi-winner case, \av does not address concerns such as proportional representation: if the goal is to select $k$ winners, $51\%$ of the agents approve the same $k$ candidates, and the remaining agents approve a disjoint set of $k$ candidates, then the agents in minority do not get any of their approved candidates selected. As a consequence, over the years, several multi-winner rules based on approval ballots have been proposed \cite<see e.g.,\xspace>{Kilg10a}. Under \emph{Proportional Approval Voting (\pav)}, each agent's contribution to the committee's total score depends on how many candidates from the agent's approval set have been elected. A sequential variant of this rule is known as {\em Reweighted Approval Voting (\rav)}. Another way to modulate the approvals is through computing a satisfaction score for each agent based on the ratio of the number of their approved candidates appearing in the committee and their total number of approved candidates; this idea leads to \emph{Satisfaction Approval Voting (\sav)}. One could also use a distance-based approach: \emph{Minimax Approval Voting (\mav)} selects a set of $k$ candidates that minimizes the maximum Hamming distance from the submitted ballots. All the rules informally described above have a more egalitarian objective than \av. For example, Steven Brams, the main proponent of \av in single-winner elections, has argued that \sav is more suitable for more equitable representation in multi-winner elections~\cite{BrKi14a}. Based on their relative merits, approval-based multi-winner rules have been examined in great detail in both economics and computer science literature in recent years~\cite{BrFi07c,LMM07a,MPRZ08a,CKM10a}. The Handbook of Approval Voting discusses various approval-based multi-winner rules including \pav, \rav, \sav and \mav~\cite{Kilg10a}. However, there has been limited axiomatic analysis of these rules from the perspective of representation. In this paper, we introduce and investigate the notion of {\em justified representation} (\ensuremath{\mathit{JR}}\xspace) in approval-based voting. Briefly, a committee is said to provide justified representation for a given set of ballots if every large enough group of voters with shared preferences is allocated at least one representative. A rule is said to satisfy justified representation if it always outputs a committee that provides justified representation. This concept is related to the \emph{Droop proportionality criterion} \cite{Dro81} and Dummett's \emph{solid coalition property}~\cite{Dumm84a,TiRi00a,EFSS14a}, but is specific to approval-based elections. A somewhat similar notion of {\em representativeness} was recenty proposed by \citeA{Dud14a}; however, justified representation does not imply representativeness and, conversely, representativeness does not imply justified representation. We show that every set of ballots admits a committee that provides justified representation; moreover, such a committee can be computed efficiently, and checking whether a given committee provides \ensuremath{\mathit{JR}}\xspace can be done in polynomial time as well. This shows that justified representation is a reasonable requirement. However, it turns out that very few of the existing multi-winner approval-based rules satisfy it. Specifically, we demonstrate that \av, \sav, \mav and the standard variant of \rav do not satisfy \ensuremath{\mathit{JR}}\xspace. On the positive side, \ensuremath{\mathit{JR}}\xspace is satisfied by \pav and some of its variants, as well as an extreme variant of \rav. Also, \mav satisfies \ensuremath{\mathit{JR}}\xspace for a restricted type of voters' preferences. We then consider a strengthening of the \ensuremath{\mathit{JR}}\xspace axiom, which we call {\em extended justified representation (\ensuremath{\mathit{EJR}}\xspace)}. This axiom captures the intuition that a very large group of voters with similar preferences may deserve not just one, but several representatives. \ensuremath{\mathit{EJR}}\xspace turns out to be a more demanding property than \ensuremath{\mathit{JR}}\xspace: of all voting rules considered in this paper, only \pav satisfies \ensuremath{\mathit{EJR}}\xspace. Moreover, it is computationally hard to check whether a given committee provides \ensuremath{\mathit{EJR}}\xspace. We also consider another strengthening of \ensuremath{\mathit{JR}}\xspace, which we call {\em strong justified representation (\ensuremath{\mathit{SJR}}\xspace)}; however, it turns out that for some inputs \ensuremath{\mathit{SJR}}\xspace is impossible to achieve. We conclude the paper by showing how \ensuremath{\mathit{JR}}\xspace can be used to formulate other attractive approval-based multi-winner rules, and by identifying several directions for future work. \section{Preliminaries} We consider a social choice setting with a set of agents (voters) $N=\{1,\ldots, n\}$ and a set of candidates $C=\{c_1,\ldots, c_m\}$. Each agent $i\in N$ submits an approval ballot $A_i\subseteq C$, which represents the subset of candidates that she approves of. We refer to the list ${\cal{A}} = (A_1,\ldots, A_n)$ of approval ballots as the {\em ballot profile}. We will consider {\em approval-based multi-winner voting rules} that take as input $(N, C, {\cal{A}}, k)$, where $k$ is a positive integer that satisfies $k\le |C|$, and return a subset $W \subseteq C$ of size $k$, which we call the {\em winning set}, or {\em committee}~\cite{MaKi12a}. We omit $N$ and $C$ from the notation when they are clear from the context. Several such rules are defined below. Whenever the description of the rule does not uniquely specify a winning set, we assume that ties are broken according to a fixed priority order over size-$k$ subsets; however, most of our results do not depend on the tie-breaking rule. \smallskip \noindent{\bf Approval Voting (AV)\ } Under \av, the winners are the $k$ candidates that receive the largest number of approvals. Formally, the {\em approval score} of a candidate $c\in C$ is defined as $|\{i\mid c\in A_i\}|$, and \av outputs a set $W$ of size $k$ that maximizes $\sum_{c\in W}|\{i\mid c\in A_i\}|$. \av has been adopted by several academic and professional societies such as the Institute of Electrical and Electronics Engineers (IEEE) and the International Joint Conference on Artificial Intelligence. \smallskip \noindent{\bf Satisfaction Approval Voting (SAV)\ } An agent's {\em satisfaction score} is the fraction of her approved candidates that are elected. \sav maximizes the sum of agents' satisfaction scores. Formally, \sav finds a set $W \subseteq C$ of size $k$ that maximizes $\sum_{i\in N}\frac{|W\cap A_i|}{|A_i|}$. The rule was proposed with the aim of ``representing more diverse interests'' than~$\av$~\cite{BrKi14a}. \smallskip \noindent{\bf Proportional Approval Voting (PAV)\ } Under \pav, an agent is assumed to derive a utility of $1+\frac12+\frac13+ \dots +\frac1{j}$ from a committee that contains exactly $j$ of her approved candidates, and the goal is to maximize the sum of the agents' utilities. Formally, the \pav-score of a set $W \subseteq C$ is defined as $\sum_{i\in N}r(|W\cap A_i|)$, where $r(p)=\sum_{j=1}^p\frac{1}{j}$, and $\pav$ outputs a set $W \subseteq C$ of size $k$ with the highest \pav-score. \pav was proposed by mathematician Forest Simmons in 2001, and captures the idea of diminishing returns---an individual agent's preferences should count less the more she is satisfied. It has recently been shown that computing $\pav$ is NP-hard~\cite{AGG+14a}. We can generalize the definition of \pav by using an arbitrary non-increasing score vector in place of $(1, \frac12, \frac13, \dots)$: for every vector ${\mathbf{w}}=(w_1, w_2, \dots)$, where $w_1, w_2, \dots$ are non-negative reals\footnote{ It is convenient to think of ${\mathbf{w}}$ as an infinite vector; however, for an election with $m$ candidates only the first $m$ entries of ${\mathbf{w}}$ matter. To analyze the complexity of ${\mathbf{w}}$-\pav rules, one would have to place additional requirements on ${\mathbf{w}}$; however, we do not consider algorithmic properties of such rules in this paper.}, $w_1=1$ and $w_1\ge w_2\ge\dots$, we define a voting rule ${\mathbf{w}}$-\pav that, given a ballot profile $(A_1, \dots, A_n)$ and a target number of winners $k$, returns a set $W$ of size $k$ with the highest ${\mathbf{w}}$-\pav score, defined by $\sum_{i\in N}r_{\mathbf{w}}(|W\cap A_i|)$, where $r_{\mathbf{w}}(p)=\sum_{j=1}^p w_j$. \smallskip \noindent{\bf Reweighted Approval Voting (RAV)\ } \rav converts \av into a multi-round rule, by selecting a candidate in each round and then reweighing the approvals for the subsequent rounds. Specifically, it starts by setting $W=\emptyset$. Then in round $j$, $j=1, \dots, k$, it computes the {\em approval weight} of each candidate $c$ as $$ \sum_{i: c\in A_i}\frac{1}{1+|W\cap A_i|}, $$ selects a candidate with the highest approval weight, and adds him to $W$. $\rav$ was invented by the Danish polymath Thorvald Thiele in the early 1900's. $\rav$ has also been referred to as ``\emph{sequential proportional AV}''~\cite{BrKi14a}, and was used briefly in Sweden during the early 1900's. Just as for \pav, we can extend the definition of \rav to score vectors other than $(1, \frac12, \frac13, \dots)$: every vector ${\mathbf{w}}=(w_1, w_2, \dots)$ with $w_1=1$ and $w_1\ge w_2\ge\dots$ defines a sequential voting rule ${\mathbf{w}}$-\rav, which proceeds as \rav, except that it computes the approval weight of a candidate $c$ in round $j$ as $\sum_{i: c\in A_i}w_{|W\cap A_i|+1}$, where $W$ is the winning set after the first $j-1$ rounds. \smallskip \noindent{\bf Minimax Approval Voting (MAV)\ } \mav returns a committee $W$ that minimizes the maximum \emph{Hamming distance} between $W$ and the agents' ballots. Formally, let $d(Q, T)=|Q\setminus T|+|T\setminus Q|$ and define the \mav-score of a set $W\subseteq C$ as $\max \left(d(W,A_1),\ldots, d(W,A_n)\right)$. \mav outputs a size-$k$ set with the lowest \mav-score. Minimax approval voting was proposed by \citeA{BKS07a}. Computing the outcome of \mav is known to be NP-hard~\cite{LMM07a}. \section{Justified Representation}\label{sec:jr} We will now define the main concept of this paper. \begin{definition}[Justified representation (\ensuremath{\mathit{JR}}\xspace)] Given a ballot profile $(A_1, \dots, A_n)$ over a candidate set $C$ and a target committee size $k$, $k\le |C|$, we say that a set of candidates $W$ of size $|W|=k$ {\em provides justified representation for $({\cal{A}}, k)$} if there does not exist a set of voters $N^*\subseteq N$ with $|N^*|\ge \frac{n}{k}$ such that $\bigcap_{i\in N^*}A_i\neq \emptyset$ and $A_i\cap W=\emptyset$ for all $i\in N^*$. We say that an approval-based voting rule {\em satisfies justified representation (\ensuremath{\mathit{JR}}\xspace)} if for every profile ${\cal{A}} = (A_1, \dots, A_n)$ and every target committee size $k$ it outputs a winning set that provides justified representation for $({\cal{A}}, k)$. \end{definition} The intuition behind this definition is that if $k$ candidates are to be selected, then a set of $\frac{n}{k}$ voters that are completely unrepresented can demand that at least one of their unanimously approved candidates should be selected. \subsection{Existence and Computational Properties} We start our analysis of justified representation by observing that, for every ballot profile ${\cal{A}}$ and every value of $k$, there is a committee that provides justified representation for $({\cal{A}}, k)$, and, moreover, such a committee can be computed efficiently given the voters' ballots. \begin{theorem}\label{th:grav} There exists a polynomial-time algorithm that, given a ballot profile ${\cal{A}}=(A_1, \dots, A_n)$ over a candidate set $C$, and a target committee size $k$, $k\le |C|$, outputs a set of candidates $W$ such that $|W|=k$ and $W$ provides justified representation for $({\cal{A}}, k)$. \end{theorem} \begin{proof} Consider the following greedy algorithm, which we will refer to as \emph{Greedy Approval Voting} (\grav). We start by setting $C'=C$, ${\cal{A}}'={\cal{A}}$, and $W=\emptyset$. As long as $|W|<k$ and ${\cal{A}}'$ is non-empty, we pick a candidate $c\in C'$ that has the highest approval score with respect to ${\cal{A}}'$, and set $W:=W\cup\{c\}$, $C':=C'\setminus\{c\}$. Also, we remove from ${\cal{A}}'$ all ballots $A_i$ such that $c\in A_i$. If at some point we have $|W|<k$ and ${\cal{A}}'$ is empty, we add an arbitrary set of $k-|W|$ candidates from $C'$ to $W$ and return $W$; if this does not happen, we terminate after having picked $k$ candidates. Suppose for the sake of contradiction that for some $k>0$ and some ballot profile ${\cal{A}}=(A_1, \dots, A_n)$, \grav outputs a committee that does not provide justified representation for $({\cal{A}}, k)$. Then there exists a set $N^*\subseteq N$ with $|N^*|\ge \frac{n}{k}$ such that $\bigcap_{i\in N^*} A_i\neq\emptyset$ and, when \grav terminates, every ballot $A_i$ such that $i\in N^*$ is still in ${\cal{A}}'$. Consider some candidate $c\in \bigcap_{i\in N^*} A_i$. At every point in the execution of \grav, $c$'s approval score is at least $|N^*|\ge \frac{n}{k}$. As $c$ was not elected, at every stage the algorithm selected a candidate whose approval score was at least as high as that of $c$. Since at the end of each stage the algorithm removed from ${\cal{A}}'$ all ballots containing the candidate added to $W$ at that stage, altogether the algorithm has removed at least $k\cdot \frac{n}{k}$ ballots from ${\cal{A}}'$. This contradicts the assumption that ${\cal{A}}'$ contains at least $\frac{n}{k}$ ballots when the algorithm terminates. \end{proof} Theorem~\ref{th:grav} shows that it is easy to find a committee that provides justified representation for a given ballot profile. It is also not too hard to check whether a given committee $W$ provides \ensuremath{\mathit{JR}}\xspace. Indeed, while it may seem that we need to consider every subset of voters of size $\frac{n}{k}$, in fact it is sufficient to consider the candidates one by one, and, for each candidate $c$, compute $s(c)=|\{i\in N\mid c\in A_i, A_i\cap W=\emptyset\}|$; the set $W$ fails to provide justified representation for $({\cal{A}}, k)$ if and only if there exists a candidate $c$ with $s\ge \frac{n}{k}$. Thus, we obtain the following result. \begin{theorem}\label{th:poly-jr} There exists a polynomial-time algorithm that, given a ballot profile ${\cal{A}}$ over a candidate set $C$, and a committee $W$, $|W|=k$, decides whether $W$ provides justified representation for $({\cal{A}}, k)$. \end{theorem} \subsection{JR and Unanimity} Another desirable property of approval-based voting rules is {\em unanimity}: we say that an approval-based rule is {\em unanimous} if, given a ballot profile $(A_1, \dots, A_n)$ with $\bigcap_{i\in N}A_i\neq\emptyset$ and a target committee size $k$, it outputs a winning set $W$, $|W|=k$, such that $W\cap \bigcap_{i\in N}A_i\neq\emptyset$. While unanimity may appear to be similar to \ensuremath{\mathit{JR}}\xspace, the two properties are essentially unrelated. Specifically, for $k=1$ unanimity implies \ensuremath{\mathit{JR}}\xspace (to see this, note that the only way to violate \ensuremath{\mathit{JR}}\xspace for $k=1$ is to select a candidate that is not approved by any of the voters when there exists a candidate that is approved by all voters), but for $k>1$ this is not the case. \begin{example} {\em Fix a $k>1$. Let $C=\{a_1, b_1,\dots, a_k, b_k\}$, $n=k$, $N=\{1, \dots, k\}$, $A_i=\{a_i, b_i\}$ for $1 \le i \le k$. On this profile, every voting rule that provides \ensuremath{\mathit{JR}}\xspace outputs a set $W$ with $W\cap A_i\neq\emptyset$ for $i=1,\dots,k$. However, a unanimous rule may behave arbitrarily. } \end{example} The following example shows that $\ensuremath{\mathit{JR}}\xspace$ does not imply unanimity either; note that it works even for $k=1$. \begin{example}\label{example:jr-unan} {\em Fix a $k>0$ and define $C=\{a, b_1,\dots,b_k\}$, $n=k+1$, $N=\{1, \dots, k, k+1\}$, $A_i=\{a, b_i\}$ for $1 \le i \le k$, $A_{k+1}=\{a\}$. Consider a voting rule that outputs $\{b_1,\dots,b_k\}$ on this profile, and coincides with \grav on every other profile. Clearly, this rule is not unanimous, but it is impossible to find a group of $\left\lceil\frac{n}{k}\right\rceil=2$ unrepresented voters for $(A_1, \dots, A_k, A_{k+1})$. } \end{example} \subsection{JR under Approval-based Rules} We have argued that justified representation is a reasonable condition: there always exists a committee that provides it, and, moreover, such a committee can be computed efficiently. It is therefore natural to ask whether prominent voting rules satisfy \ensuremath{\mathit{JR}}\xspace. In this section, we will answer this question for \av, \sav, \mav, \pav, and \rav, as well as identify conditions on ${\mathbf{w}}$ that are sufficient/necessary for ${\mathbf{w}}$-\pav and ${\mathbf{w}}$-\rav to satisfy \ensuremath{\mathit{JR}}\xspace. In what follows, for each rule we will try to identify the range of values of $k$ for which this rule satisfies \ensuremath{\mathit{JR}}\xspace. Trivially, all considered rules satisfy \ensuremath{\mathit{JR}}\xspace for $k=1$. It turns out that \av fails \ensuremath{\mathit{JR}}\xspace for $k> 2$, and for $k=2$ the answer depends on the tie-breaking rule. \begin{theorem}\label{thm:av-not-jr} For $k=2$, \av satisfies \ensuremath{\mathit{JR}}\xspace if ties are broken in favor of sets that provide \ensuremath{\mathit{JR}}\xspace. For $k\ge 3$, \av fails \ensuremath{\mathit{JR}}\xspace. \end{theorem} \begin{proof} Suppose first that $k=2$. Fix a ballot profile ${\cal{A}}$. If every candidate is approved by less than $\frac{n}{2}$ voters in ${\cal{A}}$, \ensuremath{\mathit{JR}}\xspace is trivially satisfied. If some candidate is approved by more than $\frac{n}{2}$ voters in ${\cal{A}}$, then \av selects some such candidate, in which case no group of $\lceil\frac{n}{2}\rceil$ voters is unrepresented, so \ensuremath{\mathit{JR}}\xspace is satisfied in this case as well. It remains to consider the case where $n=2n'$, some candidates are approved by $n'$ voters, and no candidate is approved by more than $n'$ voters. Then \av necessarily picks at least one candidate approved by $n'$ voters; denote this candidate by $c$. In this situation \ensuremath{\mathit{JR}}\xspace can only be violated if the $n'$ voters who do not approve $c$ all approve the same candidate (say, $c'$), and this candidate is not elected. But the approval score of $c'$ is $n'$, and, by our assumption, the approval score of every candidate is at most $n'$, so this is a contradiction with our tie-breaking rule. This argument also illustrates why the assumption on the tie-breaking rule is necessary: it can be the case that $n'$ voters approve $c$ and $c''$, and the remaining $n'$ voters approve $c'$, in which case the approval score of $\{c, c''\}$ is the same as that of $\{c,c'\}$. For $k\ge 3$, we let $C=\{c_0, c_1,\dots,c_k\}$, $n=k$, and consider the profile where the first voter approves $c_0$, whereas each of the remaining voters approves all of $c_1,\dots, c_k$. \ensuremath{\mathit{JR}}\xspace requires $c_0$ to be selected, but \av selects $\{c_1,\dots,c_k\}$. \end{proof} In contrast, \sav and \mav fail \ensuremath{\mathit{JR}}\xspace even for $k=2$. \begin{theorem}\label{thm:sav-not-jr} \sav and \mav do not satisfy \ensuremath{\mathit{JR}}\xspace for $k\ge 2$. \end{theorem} \begin{proof} We first consider \sav. Fix $k\ge 2$, let $X=\{x_1,\dots,x_k, x_{k+1}\}$, $Y=\{y_1,\dots,y_k\}$, $C=X\cup Y$, and consider the profile $(A_1, \dots, A_k)$, where $A_1=X$, $A_2=\{y_1,y_2\}$, $A_i=\{y_i\}$ for $i=3,\dots, k$. \ensuremath{\mathit{JR}}\xspace requires each voter to be represented, but \sav will choose $Y$: the \sav-score of $Y$ is $k-1$, whereas the \sav-score of every committee $W$ with $W\cap X\neq\emptyset$ is at most $k-2+\frac12+\frac{1}{k+1}<k-1$. Therefore, the first voter will remain unrepresented. For \mav, we use the following construction. Fix $k\ge 2$, let $X=\{x_1,\dots,x_k\}$, $Y=\{y_1,\dots,y_k\}$, $C=X\cup Y\cup\{z\}$, and consider the profile $(A_1, \dots, A_{2k})$, where $A_i=\{x_i, y_i\}$ for $i=1,\dots, k$, $A_i=\{z\}$ for $i=k+1,\dots,2k$. Every committee of size $k$ that provides \ensuremath{\mathit{JR}}\xspace for this profile contains~$z$. However, \mav fails to select $z$. Indeed, the \mav-score of $X$ is $k+1$: we have $d(X,A_i)=k$ for $i\le k$ and $d(X,A_i)=k+1$ for $i>k$. Now, consider some committee $W$ with $|W|=k$, $z\in W$. We have $A_i\cap W=\emptyset$ for some $i\le k$, so $d(W, A_i)=k+2$. Thus, \mav prefers $X$ to any committee that includes $z$. \end{proof} The constructions used in the proof of Theorem~\ref{thm:sav-not-jr} show that \mav and \sav may behave very differently: \sav appears to favor voters who approve very few candidates, whereas \mav appears to favor voters who approve many candidates. Interestingly, we can show that \mav satisfies \ensuremath{\mathit{JR}}\xspace if we assume that each agent approves exactly $k$ candidates and ties are broken in favor of sets that provide justified representation. \begin{theorem}\label{th:mav-resr-jr} If the target committee size is $k$, $|A_i|=k$ for all $i\in N$, and ties are broken in favor of sets that provide \ensuremath{\mathit{JR}}\xspace, then \mav satisfies \ensuremath{\mathit{JR}}\xspace . \end{theorem} \begin{proof} Consider a profile ${\cal{A}}=(A_1, \dots, A_n)$ with $|A_i|=k$ for all $i\in N$. Observe that if there exists a set of candidates $W$ with $|W|=k$ such that $W\cap A_i\neq\emptyset$ for all $i\in N$, then \mav will necessarily select some such set. Indeed, for any such set $W$ we have $d(W, A_i)\le 2k-1$ for each $i\in N$, whereas if $W'\cap A_i=\emptyset$ for some set $W'$ with $|W'|=k$ and some $i\in N$, then $d(W',A_i)=2k$. Further, by definition, every set $W$ such that $|W|=k$ and $W\cap A_i\neq\emptyset$ for all $i\in N$ provides justified representation for $({\cal{A}}, k)$. On the other hand, if there is no $k$-element set of candidates that intersects each $A_i$, $i\in N$, then the \mav-score of every set of size $k$ is $2k$, and therefore \mav can pick an arbitrary size-$k$ subset. Since we assumed that the tie-breaking rule favors sets that provide \ensuremath{\mathit{JR}}\xspace, our claim follows. \end{proof} While Theorem~\ref{th:mav-resr-jr} provides an example of a setting where a well-known voting rule satisfies \ensuremath{\mathit{JR}}\xspace, this result is not entirely satisfactory: first, we had to place a strong restriction on voters' preferences, and, second, we used a tie-breaking rule that was tailored to \ensuremath{\mathit{JR}}\xspace. In contrast, we will now show that another common voting rule, namely, \pav satisfies \ensuremath{\mathit{JR}}\xspace for all ballot profiles and irrespective of the tie-breaking rule. \begin{theorem}\label{thm:pav-jr} \pav satisfies \ensuremath{\mathit{JR}}\xspace. \end{theorem} \begin{proof} Fix a ballot profile ${\cal{A}} = (A_1, \dots, A_n)$ and a $k> 0$ and let $s=\lceil \frac{n}{k}\rceil$. Let $W$ be the output of \pav on $({\cal{A}},k)$. Suppose for the sake of contradiction that there exists a set $N^*\subset N$, $|N^*|\ge s$, such that $\bigcap_{i\in N^*}A_i\neq\emptyset$, but $W\cap \bigcup_{i\in N^*}A_i=\emptyset$. Let $c$ be some candidate approved by all voters in $N^*$. For each candidate $w\in W$, define its {\em marginal contribution} as the difference between the \pav-score of $W$ and that of $W\setminus\{w\}$. Let $m(W)$ denote the sum of marginal contributions of all candidates in $W$. Observe that if $c$ were to be added to the winning set, this would increase the \pav-score by at least~$s$. Therefore, it suffices to argue that the marginal contribution of some candidate in $W$ is less than $s$: this would mean that swapping this candidate with $c$ increases the \pav-score, a contradiction. To this end, we will prove that $m(W)\le s(k-1)$; as $|W|=k$, our claim would then follow by the pigeonhole principle. Consider the set $N\setminus N^*$; we have $n\le sk$, so $|N\setminus N^*| \le n-s \le s(k-1)$. Pick a voter $i\in N\setminus N^*$, and let $j=|A_i\cap W|$. If $j>0$, this voter contributes exactly $\frac{1}{j}$ to the marginal contribution of each candidate in $A_i\cap W$, and hence her contribution to $m(W)$ is exactly $1$. If $j=0$, this voter does not contribute to $m(W)$ at all. Therefore, we have $m(W)\leq |N\setminus N^*|\le s(k-1)$, which is what we wanted to prove. \end{proof} The reader may observe that the proof of Theorem~\ref{thm:pav-jr} applies to all voting rules of the form ${\mathbf{w}}$-\pav where the weight vector satisfies $w_j\le \frac{1}{j}$ for all $j\ge 1$. In Section~\ref{sec:ejr} we will see that this condition on ${\mathbf{w}}$ is also necessary for ${\mathbf{w}}$-\pav to satisfy \ensuremath{\mathit{JR}}\xspace. (see Lemma~\ref{lem:wpav-not-ejr1} in the proof of Theorem~\ref{thm:wpav-not-ejr}). Next, we consider \rav. As this voting rule can be viewed as a tractable approximation of \pav (recall that \pav is NP-hard to compute), one could expect that \rav satisfies \ensuremath{\mathit{JR}}\xspace as well. However, this turns out not to be the case, at least if $k$ is sufficiently large. \begin{theorem}\label{thm:rav-not-jr} \rav satisfies \ensuremath{\mathit{JR}}\xspace for $k=2$, but fails it for $k \ge 10$. \end{theorem} \begin{proof} For $k=2$, we can use essentially the same argument as for \av (see the proof of Theorem~\ref{thm:av-not-jr}); however, we do not need to assume anything about the tie-breaking rule. Indeed, just as in that proof, we only have to worry about the case where $n=2n'$, no candidate is approved by more than $n'$ voters, some candidate $c$ is approved by $n'$ voters, another candidate $c'$ is approved by a disjoint set of $n'$ voters, and \rav picks $c$ in the first round. But then the \rav-score of $c'$ in the second round is $n'$, and the only other candidates with this score are approved by the same group of $n'$ voters, so one of them will necessarily be selected, irrespective of the tie-breaking rule. Now, suppose that $k=10$. Consider a profile over a candidate set $C=\{ c_1, \dots , c_{11}\}$ with $1199$ voters who submit the following ballots: \begin{align*} \!\!\!81 \times &\{c_1,c_2\}, &81 \times &\{c_1,c_3\}, &80 \times &\{c_2\}, &80 \times &\{c_3\},\\ \!\!\!81 \times &\{c_4,c_5\}, &81 \times &\{c_4,c_6\}, &80 \times &\{c_5\}, &80 \times &\{c_6\},\\ \!\!\!49 \times &\{c_7,c_8\}, &49 \times &\{c_7,c_9\}, &49 \times &\{c_7,c_{10}\}, & &\\ \!\!\!96 \times &\{c_8\}, &96 \times &\{c_9\}, &96 \times &\{c_{10}\}, & &\\ \!\!\!120 \times &\{c_{11}\}. \end{align*} Candidates $c_1$ and $c_4$ are each approved by $162$ voters, the most of any candidate and these voters' approvals do not overlap, so \rav selects $c_1$ and $c_4$ first. This reduces the \rav scores of $c_2, c_3, c_5$ and $c_6$ from $80+81=161$ to $80 + 40.5 = 120.5$, so $c_7$, whose \rav score is $147$, is selected next. Now, the \rav scores of $c_8, c_9$ and $c_{10}$ become $96 + 24.5 = 120.5$. The selection of any of $c_2, c_3, c_5,c_6,c_8,c_9$ or $c_{10}$ does not affect the \rav score of the others, so all seven of these candidates will be selected before $c_{11}$, who has $120$ approvals. Thus, after the selection of $10$ candidates, there are $120 > \frac{1199}{10} = \frac{n}{k}$ unrepresented voters who jointly approve~$c_{11}$. To extend this construction to $k > 10$, we create $k-10$ additional candidates and $120(k-10)$ additional voters such that for each new candidate, there are $120$ new voters who approve that candidate only. Note that we still have $120 > \frac{n}{k}$. \rav will proceed to select $c_1, \dots, c_{10}$, followeed by $k-10$ additional candidates, and $c_{11}$ or one of the new candidates will remain unselected. \end{proof} While \rav itself fails \ensuremath{\mathit{JR}}\xspace, one could hope that this can be fixed by modifying the weights, i.e., that ${\mathbf{w}}$-\rav satisfies \ensuremath{\mathit{JR}}\xspace for a suitable weight vector ${\mathbf{w}}$. However, Theorem~\ref{thm:rav-not-jr} can be extended to ${\mathbf{w}}$-\rav for {\em every} weight vector ${\mathbf{w}}$ such that $w_2>0$. \begin{theorem}\label{thm:wrav-not-jr} For every vector ${\mathbf{w}}=(w_1,w_2,\dots )$ with $w_2>0$, there exists a value of $k_0>0$ such that ${\mathbf{w}}$-\rav does not satisfy \ensuremath{\mathit{JR}}\xspace for $k>k_0$. \end{theorem} \begin{proof} Pick a positive integer $s\ge 8$ such that $w_2\ge \frac{1}{s}$. Let $C=C_1\cup C_2\cup\{x,y\}$, where \begin{align*} C_1 &= \{c_{i, j}\mid i=1,\dots,2s+3,j=1,\dots,2s+1\},\\ C_2 &=\{c_i\mid i=1, \dots, 2s+3\}. \end{align*} For each $i=1, \dots, 2s+3$ and each $j=1,\dots, 2s+1$ we construct $2s^3-s$ voters who approve $c_{i,j}$ only and $s^2$ voters who approve $c_{i,j}$ and $c_i$ only. Finally, we construct $2s^3-1$ voters who approve $x$ only and $s^2-7s-5$ voters who approve $y$ only (note that the number of voters who approve $y$ is positive by our choice of $s$). Set $k_0=(2s+2)(2s+3)=|C_1\cup C_2|$. Note that the number of voters $n$ is given by \begin{align*} &(2s+3)(2s+1)(2s^3+s^2-s)+(2s^3-1)+(s^2-7s-5) \\ &= (2s+2)(2s+3)(2s^3-1)=(2s^3-1)k_0, \end{align*} and hence $\frac{n}{k_0}=2s^3-1$. Under ${\mathbf{w}}$-\rav initially the score of each candidate in $C_2$ is $s^2(2s+1)=2s^3+s^2$, the score of each candidate in $C_1$ is $2s^3+s^2-s$, the score of $x$ is $2s^3-1$, and the score of $y$ is $s^2-7s-5$, so in the first $2s+3$ rounds the candidates from $C_2$ get elected. After that, the score of every candidate in $C_1$ becomes $2s^3-s+w_2s^2\ge 2s^3-s+s=2s^3$, while the scores of $x$ and $y$ remains unchanged. Therefore, in the next $(2s+3)(2s+1)$ rounds the candidates from $C_1$ get elected. At this point, $k$ candidates are elected, and $x$ is not elected, even though the $2s^3-1=\frac{n}{k_0}$ voters who approve him do not approve of any of the candidates in the winning set. To extend this argument to larger values of $k$, we proceed as in the proof of Theorem~\ref{thm:rav-not-jr}: for $k>k_0$, we add $k-k_0$ new candidates, and for each new candidate we construct $2s^3-1$ new voters who approve that candidate only. Let the resulting number of voters be $n'$; we have $\frac{n'}{k}=2s^3-1$, so ${\mathbf{w}}$-\rav will first select the candidates in $C_2$, followed by the candidates in $C_1$, and then it will choose $k-k_0$ winners among the new candidates and $x$. As a result, either $x$ or one of the new candidates will remain unselected. \end{proof} \begin{remark} {\em Theorem~\ref{thm:wrav-not-jr} partially subsumes Theorem~\ref{thm:rav-not-jr}: it implies that \rav fails \ensuremath{\mathit{JR}}\xspace, but the proof only shows that this is the case for $k\ge 18\cdot 19=342$, while Theorem~\ref{thm:rav-not-jr} states that \rav fails \ensuremath{\mathit{JR}}\xspace for $k\ge 10$ already. We chose to include the proof of Theorem~\ref{thm:rav-not-jr} because we feel that it is useful to know what happens for relatively small values of $k$. We remark that it remains an open problem whether \rav satisfies \ensuremath{\mathit{JR}}\xspace for $k=3,\dots,9$. } \end{remark} As we require $w_1\ge w_2\ge\dots$, the only weight vector not captured by Theorem~\ref{thm:wrav-not-jr} is $(1, 0, \dots, 0)$. In fact, $(1, 0, \dots, 0)$-\rav satisfies \ensuremath{\mathit{JR}}\xspace: indeed, this rule is exactly the greedy rule \grav! We can extend this result somewhat, by allowing the entries of the weight vector to depend on the number of voters $n$: the argument used to show that \grav satisfies \ensuremath{\mathit{JR}}\xspace extends to ${\mathbf{w}}$-\rav where the weight vector ${\mathbf{w}}$ satisfies $w_2\le \frac{1}{n}$. In particular, the rule $(1, \frac{1}{n}, \frac{1}{n^2}, \dots, )$-\rav is somewhat more appealing than \grav: for instance, if $\bigcap_{i\in N}A_i=\{c\}$ and $k>1$, \grav will pick $c$, and then behave arbitrarily, whereas $(1, \frac{1}{n}, \frac{1}{n^2}, \dots, )$-\rav will also pick $c$, but then it will continue to look for candidates approved by as many voters as possible. \section{Extended Justified Representation}\label{sec:ejr} We have identified two families of voting rules that satisfy \ensuremath{\mathit{JR}}\xspace for arbitrary ballot profiles: ${\mathbf{w}}$-\pav with $w_j\le \frac{1}{j}$ (this includes the \pav rule) and ${\mathbf{w}}$-\rav with $w_2\le \frac{1}{n}$ (this includes the \grav rule). The obvious advantage of the greedy rule is that its output can be computed efficiently, whereas computing the output of \pav in NP-hard. However, arguably, \grav puts too much emphasis on representing {\em every} voter, at the expense of ensuring that large sets of voters with shared preferences are allocated an adequate number of representatives. For instance, if $k=3$, there are $98$ voters who approve $a$ and $b$, while $c$ and $d$ are each approved by a single voter, the greedy rule would include both $c$ and $d$ in the winning set, whereas in many settings it would be more reasonable to choose both $a$ and $b$ (and one of $c$ and $d$). This issue is not addressed by the \ensuremath{\mathit{JR}}\xspace axiom, as it does not care if a given voter is represented by one or more candidates. Thus, if we want to capture the intuition that large cohesive groups of voters should be allocated several representatives, we need a stronger condition. Recall that \ensuremath{\mathit{JR}}\xspace says that each group of $\frac{n}{k}$ voters that all approve the same candidate ``deserves'' at least one representative. It seems reasonable to scale this idea and say that, for every $\ell>0$, each group of $\ell\cdot \frac{n}{k}$ voters that all approve the same $\ell$ candidates ``deserves'' at least $\ell$ representatives. This approach can be formalized as follows. \begin{definition}[Extended justified representation (\ensuremath{\mathit{EJR}}\xspace)] Consider a ballot profile ${\cal{A}} = (A_1, \dots, A_n)$ over a candidate set $C$, a target committee size $k$, $k\le |C|$, and a positive integer $\ell$, $\ell\le k$. We say that a set of candidates $W$, $|W|=k$, {\em provides $\ell$-justified representation for $({\cal{A}}, k)$} if there does not exist a set of voters $N^*\subseteq N$ with $|N^*|\ge \ell\cdot \frac{n}{k}$ such that $|\bigcap_{i\in N^*}A_i|\ge \ell$, but $|A_i\cap W|<\ell$ for each $i\in N^*$; we say that $W$ {\em provides extended justified representation (\ensuremath{\mathit{EJR}}\xspace) for $({\cal{A}}, k)$} if it provides $\ell$-\ensuremath{\mathit{JR}}\xspace for $({\cal{A}}, k)$ for all $\ell$, $1\le\ell\le k$. We say that an approval-based voting rule {\em satisfies $\ell$-justified representation ($\ell$-\ensuremath{\mathit{JR}}\xspace)} if for every profile ${\cal{A}} = (A_1, \dots, A_n)$ and every target committee size $k$ it outputs a committee that provides $\ell$-\ensuremath{\mathit{JR}}\xspace for $({\cal{A}}, k)$. Finally, we say that a rule {\em satisfies extended justified representation (\ensuremath{\mathit{EJR}}\xspace)} if it satisfies $\ell$-\ensuremath{\mathit{JR}}\xspace for all $\ell$, $1\le\ell\le k$. \end{definition} Observe that $1$-\ensuremath{\mathit{JR}}\xspace is simply \ensuremath{\mathit{JR}}\xspace. However, \ensuremath{\mathit{EJR}}\xspace is not implied by \ensuremath{\mathit{JR}}\xspace: this is illustrated by the $4$-candidate $100$-voter example earlier in this section. Further, although \ensuremath{\mathit{EJR}}\xspace is stronger than \ensuremath{\mathit{JR}}\xspace, it still does not imply unanimity; this follows from Example~\ref{example:jr-unan} in Section~\ref{sec:jr}. \subsection{EJR under Approval-based Rules} It is natural to ask which of the voting rules that satisfy \ensuremath{\mathit{JR}}\xspace also satisfy \ensuremath{\mathit{EJR}}\xspace. Our $4$-voter $100$-candidate example immediately shows that for \grav the answer is negative. Consequently, no ${\mathbf{w}}$-\rav rule such that the entries of ${\mathbf{w}}$ do not depend on $n$ satisfies \ensuremath{\mathit{EJR}}\xspace: if $w_2=0$, this rule is \grav, and if $w_2>0$, this follows from Theorem~\ref{thm:wrav-not-jr}. The next example shows that \mav fails \ensuremath{\mathit{EJR}}\xspace even if each voter approves exactly $k$ candidates (recall that under this assumption \mav satisfies \ensuremath{\mathit{JR}}\xspace). \begin{example} {\em Let $k=4$, $C=C_1\cup C_2\cup C_3\cup C_4$, where $|C_1|=|C_2|=|C_3|=|C_4|=4$ and the sets $C_1,C_2,C_3,C_4$ are pairwise disjoint. Let ${\cal{A}}=(A_1, \dots, A_8)$, where $A_i=C_i$ for $i=1,2,3$, and $A_i=C_4$ for $i=4,5,6,7,8$. \mav will select exactly one candidate from each of the sets $C_1, C_2, C_3$ and $C_4$, but \ensuremath{\mathit{EJR}}\xspace dictates that at least two candidates from $C_4$ are chosen. } \end{example} It remains to consider \pav. \begin{theorem}\label{thm:pav-ejr} \pav satisfies \ensuremath{\mathit{EJR}}\xspace. \end{theorem} \begin{proof} Suppose that \pav violates \ensuremath{\mathit{EJR}}\xspace for some value of $k$, and consider a ballot profile $A_1, \dots, A_n$, a value of $\ell>0$ and a set of voters $N^*$, $|N^*| = s \ge \ell\cdot \frac{n}{k}$, that witness this. Let $W$, $|W|=k$, be the winning set. We know that at least one of the $\ell$ candidates approved by all voters in $N^*$ is not elected; let $c$ be some such candidate. Each voter in $N^*$ has at most $\ell-1$ representatives in $W$, so the marginal contribution of $c$ (if it were to be added to $W$) would be at least $s\cdot \frac{1}{\ell} \ge \frac{n}{k}$. On the other hand, the argument in the proof of Theorem~\ref{thm:pav-jr} can me modified to show that the sum of marginal contributions of candidates in $W$ is at most $n$. Now, consider some candidate $w\in W$ with the smallest marginal contribution; clearly, his marginal contribution is at most $\frac{n}{k}$. If it is strictly less than $\frac{n}{k}$, we are done, as we can improve the total \pav-score by swapping $w$ and $c$, a contradiction. Therefore suppose it is exactly $\frac{n}{k}$, and therefore the marginal contribution of each candidate in $W$ is exactly $\frac{n}{k}$. Since \pav satisfies \ensuremath{\mathit{JR}}\xspace, we know that $A_i\cap W\neq\emptyset$ for some $i\in N^*$. Pick some candidate $w'\in W\cap A_i$, and set $W'=(W\setminus\{w'\})\cup \{c\}$. Observe that after $w'$ is removed, adding $c$ increases the total \pav-score by at least $(s-1)\cdot \frac{1}{\ell}+\frac{1}{\ell-1}>\frac{n}{k}$. Indeed, $i$ approves at most $\ell-2$ candidates in $W\setminus\{w'\}$ and therefore adding $c$ to $W\setminus\{w'\}$ contributes at least $\frac{1}{\ell-1}$ to her satisfaction. Thus, the \pav-score of $W'$ is higher than that of $W$, a contradiction again. \end{proof} Interestingly, Theorem~\ref{thm:pav-ejr} does not extend to weight vectors other than $(1, \frac12, \frac13, \dots)$: our next theorem shows that \pav is the unique ${\mathbf{w}}$-\pav rule that satisfies \ensuremath{\mathit{EJR}}\xspace. \begin{theorem}\label{thm:wpav-not-ejr} For every weight vector ${\mathbf{w}}$ with $ {\mathbf{w}} \neq (1, \frac12, \frac13, \dots)$, the rule ${\mathbf{w}}$-\pav does not satisfy \ensuremath{\mathit{EJR}}\xspace. \end{theorem} Theorem~\ref{thm:wpav-not-ejr} follows immediately from Lemmas~\ref{lem:wpav-not-ejr1} and~\ref{lem:wpav-not-ejr2}, which are stated and proved below. \begin{lemma}\label{lem:wpav-not-ejr1} Consider a weight vector ${\mathbf{w}}$. If $w_j>\frac{1}{j}$ for some $j>1$, then ${\mathbf{w}}$-\pav fails \ensuremath{\mathit{JR}}\xspace. \end{lemma} \begin{proof} Suppose that $w_j=\frac{1}{j}+{\varepsilon}$ for some $j>1$ and ${\varepsilon}>0$. Pick $k > \lceil\frac{1}{{\varepsilon} j}\rceil+1$ so that $j$ divides $k$; let $t=\frac{k}{j}$. Let $C=C_0\cup C_1\cup\dots\cup C_t$, where $C_0=\{c\}$, $|C_1|=\dots=|C_t|=j$, and the sets $C_0,C_1, \dots, C_t$ are pairwise disjoint. Note that $|C|=tj+1=k+1$. Also, construct $t+1$ pairwise disjoint groups of voters $N_0, N_1, \dots, N_t$ so that $|N_0|=k$, $|N_1|=\dots=|N_t|=j(k-1)$, and for each $i=0, 1,\dots,t$ the voters in $N_i$ approve the candidates in $C_i$ only. Observe that the total number of voters is given by $n=k+tj(k-1)=k^2$. We have $|N_0|=k=\frac{n}{k}$, so every committee that provides justified representation for this profile must elect $c$. However, we claim that ${\mathbf{w}}$-\pav elects all candidates in $C\setminus\{c\}$ instead. Indeed, if we replace an arbitrary candidate in $C\setminus\{c\}$ with $c$, then under ${\mathbf{w}}$-\pav the total score of our committee changes by $$ k - j(k-1)\cdot\left(\frac{1}{j}+{\varepsilon}\right) = 1 - j(k-1){\varepsilon} < 1-j{\varepsilon}\left\lceil\frac{1}{{\varepsilon} j}\right\rceil \le 0, $$ i.e., $C\setminus\{c\}$ has a strictly higher score than any committee that includes $c$. \end{proof} \begin{lemma}\label{lem:wpav-not-ejr2} Consider a weight vector ${\mathbf{w}}$. If $w_j<\frac{1}{j}$ for some $j>1$, then ${\mathbf{w}}$-\pav fails $j$-\ensuremath{\mathit{JR}}\xspace. \end{lemma} \begin{proof} Suppose that $w_j=\frac{1}{j}-{\varepsilon}$ for some $j>1$ and ${\varepsilon}>0$. Pick $k > j+\lceil\frac{1}{{\varepsilon}}\rceil$. Let $C=C_0\cup C_1$, where $|C_0|=j$, $C_1=\{c_1,\dots, c_{k-j+1}\}$ and $C_0\cap C_1 = \emptyset$. Note that $|C|=k+1$. Also, construct $k-j+2$ pairwise disjoint groups of voters $N_0, N_1, \dots, N_{k-j+1}$ so that $|N_0|=j(k-j+1)$, $|N_1|=\dots=|N_{k-j+1}|=k-j$, the voters in $N_0$ approve the candidates in $C_0$ only, and for each $i=1,\dots,k-j+1$ the voters in $N_i$ approve $c_i$ only. Note that the number of voters is given by $n = j(k-j+1)+(k-j+1)(k-j)=k(k-j+1)$. We have $\frac{n}{k}=k-j+1$ and $|N_0|=j\cdot \frac{n}{k}$, so every committee that provides \ensuremath{\mathit{EJR}}\xspace must select all candidates in $C_0$. However, we claim that ${\mathbf{w}}$-\pav elects all candidates from $C_1$ and $j-1$ candidates from $C_0$ instead. Indeed, let $c$ be some candidate in $C_0$, let $c'$ be some candidate in $C_1$, and let $W=C\setminus \{c\}$, $W'=C\setminus\{c'\}$. The difference between the total score of $W$ and that of $W'$ is $$ j(k-j+1)\left(\frac{1}{j}-{\varepsilon}\right)-(k-j) < 1 - j\cdot \frac{1}{{\varepsilon}} \cdot {\varepsilon} < 1-j<0, $$ i.e., ${\mathbf{w}}$-\pav assigns a higher score to $W$. As this argument does not depend of the choice of $c$ in $C_0$ and $c'$ in $C_1$, the proof is complete. \end{proof} \subsection{Computational Issues} In Section~\ref{sec:jr} we have argued that it is easy to find a committee that provides \ensuremath{\mathit{JR}}\xspace for a given ballot profile, and to check whether a specific committee provides \ensuremath{\mathit{JR}}\xspace. In contrast, for \ensuremath{\mathit{EJR}}\xspace these questions appear to be computationally difficult. Specifically, we were unable to design an efficient algorithm for computing a committee that provides \ensuremath{\mathit{EJR}}\xspace; while \pav is guaranteed to find such a committee, computing its output is NP-hard. For the problem of checking whether a given committee provides \ensuremath{\mathit{EJR}}\xspace for a given input, we can establish a formal hardness result. \begin{theorem}\label{th:ejr-hard} Given a ballot profile ${\cal{A}}$, a target committee size $k$, and a committee $W$, $|W|=k$, it is {\em coNP}-complete to check whether $W$ provides \ensuremath{\mathit{EJR}}\xspace for $({\cal{A}}, k)$. \end{theorem} \begin{proof} It is easy to see that this problem is in coNP: to show that $W$ does not provide \ensuremath{\mathit{EJR}}\xspace for $({\cal{A}}, k)$, it suffices to guess an integer $\ell$ and a set of voters $N^*$ of size at least $\ell\cdot \frac{n}{k}$ such that $|\bigcap_{i\in N^*}A_i|\ge \ell$, but $|A_i\cap W|<\ell$ for all $i\in N^*$. To prove coNP-completeness, we reduce the classic {\sc Balanced Biclique} problem \cite<>[Problem GT24]{gj} to the complement of our problem. An instance of {\sc Balanced Biclique} is given by a bipartite graph $(L, R, E)$ with parts $L$ and $R$ and edge set $E$, and an integer $\ell$; it is a ``yes''-instance if we can pick subsets of vertices $L'\subseteq L$ and $R'\subseteq R$ so that $|L'|=|R'|=\ell$ and $(u, v)\in E$ for each $u\in L', v\in R'$; otherwise, it is a ``no''-instance. Fix an instance $\langle (L, R, E), \ell\rangle$ of {\sc Balanced Biclique} with $R=\{v_1, \dots, v_s\}$. We create an instance of our problem as follows. Assume without loss of generality that $s\ge 3$, $\ell\ge 3$. We construct $4$ pairwise disjoint sets of candidates $C_0$, $C_1$, $C'_1$, $C_2$, so that $C_0=L$, $|C_1|=|C'_1|=\ell-1$, $|C_2|=s\ell+\ell-3s$, and set $C=C_0\cup C_1\cup C'_1\cup C_2$. We then construct $3$ sets of voters $N_0$, $N_1$, $N_2$, so that $N_0=\{1, \dots, s\}$, $|N_1|=\ell(s-1)$, $|N_2|=s\ell+\ell-3s$ (note that $|N_2|>0$ as we assume that $\ell\ge 3$). For each $i\in N_0$ we set $A_i=\{u_j\mid (u_j, v_i)\in E\}\cup C_1$, and for each $i\in N_1$ we set $A_i=C_0\cup C'_1$. The candidates in $C_2$ are matched to voters in $N_2$: each voter in $N_2$ approves exactly one candidate in $C_2$, and each candidate in $C_2$ is approved by exactly one voter in $N_2$. Denote the resulting list of ballots by ${\cal{A}}$. Finally, we set $k=2\ell-2$, and let $W=C_1\cup C'_1$. Note that the number of voters $n$ is given by $s+\ell(s-1)+s\ell+\ell-3s=2s(\ell-1)$, so $\frac{n}{k}=s$. Suppose first that we started with a ``yes''-instance of {\sc Balanced Biclique}, and let $(L', R')$ be the respective $\ell$-by-$\ell$ biclique. Let $C^*=L'$, $N^*=N_0\cup N_1$. Then $|N^*|=\ell s$, all voters in $N^*$ approve all candidates in $C^*$, $|C^*|=\ell$, but each voter in $N^*$ is only represented by $\ell-1$ candidates in $W$. Hence, $W$ fails to provide $\ell$-justified representation for $({\cal{A}}, k)$. Conversely, suppose that $W$ fails to provide \ensuremath{\mathit{EJR}}\xspace for $({\cal{A}}, k)$. That is, there exists a value $j>0$, a set $N^*$ of $js$ voters and a set $C^*$ of $j$ candidates so that all voters in $N^*$ approve of all candidates in $C^*$, but for each voter in $N^*$ at most $j$ of her approved candidates are in $W$. Note that, since $s>1$, we have $N^*\cap N_2=\emptyset$. Further, each voter in $N\setminus N_2$ is represented by $\ell-1$ candidates in $W$, so $j\ge \ell$. As $N^*=js\ge \ell s\ge s$, it follows that $|N^*\cap N_0|\ge \ell$, $|N^*\cap N_1|>0$. Since $N^*$ contains voters from both $N_0$ and $N_1$, it follows that $C^*\subseteq C_0$. Thus, there are at least $\ell$ voters in $N^*\cap N_0$ who approve the same $j\ge \ell$ candidates in $C_0$; any set of $\ell$ such voters and $\ell$ such candidates corresponds to an $\ell$-by-$\ell$ biclique in the input graph. \end{proof} However, we can modify the algorithm described in the proof of Theorem~\ref{th:grav} to verify whether a given committee provides $\ell$-\ensuremath{\mathit{JR}}\xspace for a fixed value of $\ell$. \begin{theorem} For fixed $\ell$, a committee satisfying $\ell$-\ensuremath{\mathit{JR}}\xspace can be computed in polynomial time. \end{theorem} \begin{proof} Consider the following greedy algorithm, which we will refer to as $\ell$-\grav. We start by setting $C'=C$, ${\cal{A}}'={\cal{A}}$, and $W=\emptyset$. As long as $|W| \le k - \ell$, we pick a set of candidates $\{c_1, \ldots, c_\ell \} \subset C'$ that is unanimously approved by at least $\ell \frac{n}{k}$ ballots in ${\cal{A}}'$ (if such a set of candidates exists), and set $W:=W\cup\{c_1, \ldots, c_\ell \}$. Also, we remove from ${\cal{A}}'$ all ballots $A_i$ such that $|A_i \cap W| \ge \ell$ (note that this includes ballots $A_i$ with $\{c_1, \ldots c_\ell \} \subseteq A_i$). If at some point we have $|W| \le k - \ell$ and there is no $\{ c_1, \ldots, c_\ell \}$ that can be added to $W$, or $|W| > k-\ell$, we add an arbitrary $k-|W|$ candidates from $C'$ to $W$ and return $W$; if this does not happen, we terminate after having picked $k$ candidates. Suppose for the sake of contradiction that for some profile ${\cal{A}}=(A_1, \dots, A_n)$ and some $k>0$, $\ell$-\grav outputs a committee that does not provide $\ell$-\ensuremath{\mathit{JR}}\xspace for $({\cal{A}}, k)$. Then there exists a set $N^*\subseteq N$ with $|N^*|\ge \ell \frac{n}{k}$ such that $|\bigcap_{i\in N^*} A_i| \ge \ell$ and, when $\ell$-\grav terminates, every ballot $A_i$ such that $i\in N^*$ is still in ${\cal{A}}'$. Consider some subset of candidates $\{c_1, \ldots, c_\ell \} \subseteq \bigcap_{i\in N^*} A_i$. At every point in the execution of $\ell$-\grav this subset is unanimously approved by at least $|N^*|\ge \ell \frac{n}{k}$ ballots in ${\cal{A}}'$. As at least one of $\{ c_1, \ldots, c_\ell \}$ was not elected, at every stage the algorithm selected a set of $\ell$ candidates that was approved by at least $\ell \frac{n}{k}$ ballots (until more than $k-\ell$ candidates were selected). Since at the end of each stage the algorithm removed from ${\cal{A}}'$ all ballots containing the candidates that had been added to $W$ at that stage, it follows that altogether the algorithm has removed at least $\lfloor \frac{k}{\ell} \rfloor \cdot \ell \frac{n}{k} > (\frac{k}{\ell}-1) \cdot \ell \frac{n}{k} = n-\ell\frac{n}{k}$ ballots from ${\cal{A}}'$. This is a contradiction, since we assumed that, when the algorithm terminates, the $\ell \frac{n}{k}$ ballots $(A_i)_{i\in N^*}$ are still in ${\cal{A}}'$. \end{proof} \section{Strong Justified Representation} The definition of \ensuremath{\mathit{JR}}\xspace requires that if there is a group of $\lceil\frac{n}{k}\rceil$ voters that all approve the same candidate, then the elected committee has to contain at least one candidate approved by {\em some} member of this group. This condition may appear to be too weak: it may seem more natural to require that the committee contains at least one candidate approved by {\em all} group members. Formally, we have the following definition. \begin{definition}[Strong justified representation (\ensuremath{\mathit{SJR}}\xspace)] Given a ballot profile ${\cal{A}} = (A_1, \dots, A_n)$ over a candidate set $C$ and a target committee size $k$, $k\le |C|$, we say that a set of candidates $W$, $|W|=k$, {\em provides strong justified representation for $({\cal{A}}, k)$} if there does not exist a set of voters $N^*\subseteq N$ with $|N^*|\ge \frac{n}{k}$ such that $\bigcap_{i\in N^*}A_i\neq \emptyset$, but $W\cap \bigcap_{i\in N^*}A_i=\emptyset$. We say that an approval-based voting rule {\em satisfies strong justified representation (\ensuremath{\mathit{SJR}}\xspace)} if for every profile ${\cal{A}} = (A_1, \dots, A_n)$ and every target committee size $k$ it outputs a winning set that provides strong justified representation for $({\cal{A}}, k)$. \end{definition} However, it turns out that for some ballot profiles no committee provides strong justified representation. \begin{example}\label{ex:not-sjr} {\em Let $C=\{a, b, c, d\}$, $n=4$, $k=2$, and consider the folowing ballot profile. \begin{align*} A_1: \{a,b\}&& A_2: \{a,c\}&& A_3: \{d,b\}&& A_4: \{d,c\} \end{align*} For every candidate, there are exactly two voters who approve him, and no two voters have the same ballot. Therefore, for every committee $W$, $|W|=2$, and every candidate $x\in C\setminus W$ we can find two voters $i, j$ so that $A_i\cap A_j=\{x\}$. } \end{example} Thus, no approval-based voting rule satisfies \ensuremath{\mathit{SJR}}\xspace. However, it may be interesting to identify voting rules that output a committee that provides \ensuremath{\mathit{SJR}}\xspace for the given ballots whenever such a committee exists. Finally, we remark that \ensuremath{\mathit{EJR}}\xspace and \ensuremath{\mathit{SJR}}\xspace are incomparable: a committee may provide \ensuremath{\mathit{EJR}}\xspace without providing \ensuremath{\mathit{SJR}}\xspace and vice versa. One direction is established by Example~\ref{ex:not-sjr}: it is not hard to see that, e.g., $\{a, d\}$ provides \ensuremath{\mathit{EJR}}\xspace in this example. The other direction follows from the example below. \begin{example}\label{ex:sjr-not-ejr} {\em Let $C=\{a, b, c, d\}$, $n=4$, $k=3$, and consider the folowing ballot profile. \begin{align*} A_1: \{a,b\}&& A_2: \{a,b\}&& A_3: \{c\}&& A_4: \{d\} \end{align*} \ensuremath{\mathit{EJR}}\xspace requires that we choose both $a$ and $b$, but $\{a, c, d\}$ provides \ensuremath{\mathit{SJR}}\xspace. } \end{example} \section{Discussion} We have formulated a desirable property of approval-based committee selection rules, which we called justified representation (\ensuremath{\mathit{JR}}\xspace). While this property is fairly easy to satisfy, it turns out that many well-known approval-based rules fail it. A prominent exception is the \pav rule, which also satisfies a stronger version of this property, namely extended justified representation (\ensuremath{\mathit{EJR}}\xspace). Indeed, \ensuremath{\mathit{EJR}}\xspace characterizes \pav within the class of ${\mathbf{w}}$-\pav rules, and we are not aware of any other natural voting rule that satisfies \ensuremath{\mathit{EJR}}\xspace (of course, we can construct voting rules that differ from \pav, yet satisfy \ensuremath{\mathit{EJR}}\xspace, by modifying the output of \pav on profiles on which \ensuremath{\mathit{EJR}}\xspace places no constraints on the output). Perhaps the most pressing open question suggested by our work is whether there is an efficient algorithm for finding a committee that provides \ensuremath{\mathit{EJR}}\xspace for a given profile. Also, it would be interesting to see if \ensuremath{\mathit{EJR}}\xspace, in combination with other natural axioms, can be used to axiomatize \pav. Our analysis can be extended to approval-based variants of rules that provide fully proportional representation, such as Chamberlin--Courant's rule~\cite{ChCo83a} and Monroe's rule \cite{Monr95a}. Specifically, under a natural adaptation of these rules to approval ballots, where the scoring function associated with each voter is identical to her ballot, Chamberlin--Courant's rule is simply $(1, 0, \dots)$-\pav, and hence satisfes \ensuremath{\mathit{JR}}\xspace, but not \ensuremath{\mathit{EJR}}\xspace; also, Monroe's rule can be shown to satisfy \ensuremath{\mathit{JR}}\xspace, but not \ensuremath{\mathit{EJR}}\xspace. We omit the definitions of these rules and the formal statements and proofs of the respective results, as the focus of this paper is the analysis of classic approval-based rules. Justified representation can also be used to formulate new approval-based rules. We mention two rules that seem particularly attractive: \begin{itemize} \item \emph{Utilitarian \ensuremath{\mathit{JR}}\xspace (UJRAV) rule}: the rule that, among all committees that satisfy \ensuremath{\mathit{JR}}\xspace, returns a committee with the highest \av score. \item \emph{Egalitarian \ensuremath{\mathit{JR}}\xspace (EJRAV) rule}: the rule that, among all committees that satisfy \ensuremath{\mathit{JR}}\xspace, returns a committee that maximizes the number of representatives of the agent who has the least number of representatives in the winning committee. \end{itemize} The computational complexity of winner determination for these rules is an interesting problem. Finally, analyzing the compatibility of \ensuremath{\mathit{JR}}\xspace with other important properties, such as, e.g.,\xspace strategyproofness for dichotomous preferences, is another avenue of future research. \section*{Acknowledgements} The authors acknowledge the helpful comments of Steven Brams. This material is based upon work supported by the Australian Government's Department of Broadband, Communications and the Digital Economy, the Australian Research Council, the Asian Office of Aerospace Research and Development through grant AOARD-12405.
{'timestamp': '2014-09-26T02:04:02', 'yymm': '1407', 'arxiv_id': '1407.8269', 'language': 'en', 'url': 'https://arxiv.org/abs/1407.8269'}
arxiv
\section{INTRODUCTION} Reinforcement learning algorithms have been proven to be effective to learn complex skills in simulation environments in \cite{mnih2015dqn}, \cite{DBLP:journals/nature/SilverHMGSDSAPL16} and \cite{DBLP:journals/corr/YahyaLKCL16}. However, practical robotic reinforcement learning for complex motion skills remains a challenging and unsolved problem, due to the high number of samples needed to train most algorithms and the expense of obtaining those samples from real robots. Most existing approaches to robotic reinforcement learning either fail to generalize between different tasks and among variations of single tasks, or only generalize by requiring collecting impractical amounts of real robot experience. With recent advancements in robotic simulation, and the widespread availability of large computational resources, a popular family of methods seeking to address this challenge has emerged, known as ``sim-to-real'' methods. These methods seek to offload most training time from real robots to offline simulations, which are trivially parallelizable and much cheaper to operate. Our method combines this ``sim-to-real'' schema with representation learning and model-predictive control (MPC) to make transfer more robust, and to significantly decrease the number of simulation samples needed to train policies which achieve families of related tasks. \begin{figure} \centering \begin{subfigure} \centering \includegraphics[width=4cm]{figs/reacher_sim.png} \label{fig:reach_sim} \end{subfigure} \begin{subfigure} \centering \includegraphics[width=4cm]{figs/reacher.jpg} \label{fig:reach} \end{subfigure} \caption{The Sawyer robot performing the reaching task in simulation (left) and real world (right)} \label{fig:robots} \end{figure} \begin{figure} \centering \begin{subfigure} \centering \includegraphics[width=4cm]{figs/pusher_sim.png} \label{fig:push_sim} \end{subfigure} \begin{subfigure} \centering \includegraphics[width=4cm]{figs/pusher.jpg} \label{fig:push} \end{subfigure} \caption{The Sawyer robot performing the box pushing task in simulation (left) and real world (right)} \label{fig:robots} \end{figure} The key insight behind our method is that the simulation used in the pre-training step of a simulation-to-real method can also be used online as a tool for foresight. It allows us to predict the behavior of a known policy on an unseen task. When combined with a latent-conditioned policy, where the latent actuates variations of useful policy behavior (e.g. skills), this simulation-as-foresight tool allows our method to use what the robot has already learned to do (e.g. the pre-trained policy) to bootstrap online policies for tasks it has never seen before. That is, given a latent space of useful behaviors, and a simulation which predicts the rewards for those behaviors on a new task, we can reduce the adaptation problem to intelligently choosing a sequence of latent skills which maximize rewards for the new task. \section{BACKGROUND} Most simulation-to-real approaches so far have focused on addressing the ``reality gap'' problem. The reality gap problem is the domain shift performance loss induced by differences in dynamics and perception between the simulation (policy training) and real (policy execution) environments. Training a policy only in a flawed simulation generally yields control behavior which is not adaptable to even small variations in the environment dynamics. Furthermore, simulating the physics behind many practical robotic problems (e.g. sliding friction and contact forces) is an open problem in applied mathematics, meaning it is not possible to solve a completely accurate simulation for many important robotic tasks \cite{10.1007/3-540-59496-5_337}. Rather than attempt to create an explicit alignment between simulation and real \cite{closingrealitygap}, or randomize our simulation training to a sufficient degree to learn a policy which generalizes to nearby dynamics \cite{peng2017simreal}, our method seeks to learn a sufficient policy in simulation, and adapt it quickly to the real world online during real robot execution. Our proposed approach is based on four key components: reinforcement learning with policy gradients (RL) \cite{DBLP:journals/corr/SchulmanAC17}, variational inference \cite{DBLP:journals/corr/KingmaW13}, model-predictive control (MPC), and physics simulation. We use variational inference to learn a low-dimensional latent space of skills which are useful for tasks, and RL to simultaneously learn single policy which is conditioned on these latent skills. The precise long-horizon behavior of the policy for a given latent skill is difficult to predict, so we use MPC and an online simulation to evaluate latent skill plans in the in simulation before executing them on the real robot. \section{RELATED WORK} Learning skill representations to aid in generalization has been proposed in works old and new. Previous works proposed frameworks such as Associative Skill Memories~\cite{pastor2012asm} and probabilistic movement primitives~\cite{rueckert2015movprim} to acquire a set of reusable skills. Our approach is built upon \cite{hausman2018learning}, which learns a embedding space of skills with reinforcement learning and variational inference, and \cite{julian2018scaling} which shows that these learned skills are transferable and composable on real robots. While \cite{julian2018scaling} noted that predicting the behavior of latent skills is an obstacle to using this method, our approach addresses the problem by using model-predictive control to successfully complete unseen tasks with no fine-tuning on the real robot. Exploration is a key problem in robot learning, and our method uses latent skill representations to address this problem. Using learned latent spaces to make exploration more tractable is also studied in \cite{gu2017deep} and \cite{eysenbach2018diversity}. Our method exploits a latent space for task-oriented exploration: it uses model-predictive control and simulation to choose latent skills which are locally-optimal for completing unseen tasks, then executes those latent skills on the real robot. Using reinforcement learning with model-predictive control has been explored previously. Kamthe \textit{et al.}~\cite{DBLP:journals/corr/KamtheD17} proposed using MPC to increase the data efficiency of reinforcement algorithms by training probabilistic transition models for planning. In our work, we take a different approach by exploiting our learned latent space and simulation directly to find policies for novel tasks online, rather than learning and then solving a model. Simulation-to-real transfer learning approaches include randomizing the dynamic parameters of the simulation~\cite{peng2017simreal}, and varying the visual appearance of the environment~\cite{sadeghi2017cadrl}, both of which scale linearly or quadratically the amount of computation needed to learn a transfer policy. Other strategies, such as that of Barrett \textit{et al.}~\cite{AAMASWS10-barrett} reuse models trained in simulation to make sim-to-real transfer more efficient, similar to our method, however this work requires an explicit pre-defined mapping between seen and unseen tasks. Saemundson \textit{et al.}~\cite{DBLP:journals/corr/abs-1803-07551} use meta-learning and learned representations to generalize from pre-trained seen tasks to unseen tasks, however their approach requires that the unseen tasks be very similar to the pre-trained tasks, and is few-shot rather than zero-shot. Our method is zero-shot with respect to real environment samples, and can be used to learn unseen tasks which are significantly out-of-distribution, as well as for composing learned skills in the time domain to achieve unseen tasks which are more complex than the underlying pre-trained task set. Our work is closely related to simultaneous work performed by Co-Reyes \textit{et al.}~\cite{coreyes2018self}. Whereas our method learns an explicit skill representations using pre-chosen skills identified by a known ID, \cite{coreyes2018self} learn an implicit skill representation by clustering trajectories of states and rewards in a latent space. Furthermore, we focus on MPC-based planning in the latent space to achieve robotic tasks learned online with a real robot, while their analysis focuses on the machine learning behind this family of methods and uses simulation experiments. \section{METHOD} \subsection{Skill Embedding Algorithm} \label{sec:skill_embedding_algorithm} In our multi-task RL setting, we pre-define a set of low-level skills with IDs $\mathcal{T} = \{1,\ldots,N\}$, and accompanying, per-skill reward functions $r^t(s, a)$. In parallel with learning the joint low-level skill policy $\pi_\theta$ as in conventional RL, we learn an embedding function $p_\phi$ which parameterizes the low-level skill library using a latent variable $z$. Note that the true skill identity $t$ is hidden from the policy behind the embedding function $p_\phi$. Rather than reveal the skill ID to the policy, once per rollout we feed the skill ID $t$, encoded as s one-hot vector, through the stochastic embedding function $p_\phi$ to produce a latent vector $z$. We feed this same value of $z$ to the policy for the entire rollout, so that all steps in a trajectory are correlated with the same value of $z$. \begin{align} \label{eq:objective} \mathfrak{L}(\theta, \phi, \psi) &=\nonumber\\ \max_\pi \:&\mathbb{E}_{\substack{\pi(a, z|s, t) \\ t\in T}} \left[ \sum_{i=0}^\infty \gamma^i \hat{r}(s_i, a_i, z, t) \bigg| s_{i+1} \right] \nonumber \\[-3em] &\intertext{where} \nonumber\\[-2.5em] \nonumber \hat{r}(s_i, a_i, z, t) &= \alpha_1 \mathbb{E}_{t\in T} \left[\mathbb{H}\left(p_\phi(z|t)\right)\right] + \alpha_2 \log q_\psi(z | s_i^H) \nonumber \\ \nonumber &~~~ + \alpha_3 \mathbb{H}\left(\pi_\theta(a_i | s_i, z)\right) + r^t(s_i, a_i) \nonumber \end{align} To aid in learning the embedding function, we learn an inference function $q_\psi$ which, given a state-only trajectory window $s_i^H$ of length $H$, predicts the latent vector $z$ which was fed to the low-level skill policy when it produced that trajectory. This allows us to define an augmented reward which encourages the policy to produce distinct trajectories for different latent vectors. We learn $q_\psi$ in parallel with the policy and embedding functions, as shown in Eq.~\ref{eq:objective}. We add a policy entropy bonus $\mathbb{H}\left(\pi_\theta(a_i | s_i, z)\right)$, which ensures that the policy does not collapse to a single solution for each skill. For a detailed derivation, refer to~\cite{hausman2018learning}. \subsection{Skill Embedding Criterion} In order for the learned latent space to be useful for completing unseen tasks, we seek to constrain the embedding distribution to satisfy two important properties: \begin{enumerate} \item \textbf{High entropy:} Each task should induce a distribution over latent vectors which is wide as possible, corresponding to many variations of a single skill. \item \textbf{Identifiability:} Given an arbitrary trajectory window, the inference network should be able to predict with high confidence the latent vector fed to the policy to produce that trajectory. \end{enumerate} When applied together, these properties ensure that during training the policy is trained to encode high-reward controllers for many parameterizations of a skill (high-entropy), while simultaneously ensuring that each of these latent parameterizations corresponds to a distinct variation of that skill. This dual constraint is the key for using model predictive control or other composing methods in the latent space as discussed in Sec.~\ref{sec:mpc_adaptation}. \begin{figure}[H] \centering \includegraphics[width=\columnwidth]{figs/embed_algo_mpc.jpg} \caption{Skill Embedding Algorithm and MPC} \label{fig:mpc} \end{figure} We train the policy and embedding networks using Proximal Policy Optimization~\cite{schulman2017ppo}, though our method may be used by any parametric reinforcement learning algorithm. We use the MuJoCo physics engine \cite{todorov2012mujoco} to implement our Sawyer robot simulation environments. We represent the policy, embedding, and inference functions using multivariate Gaussian distributions whose mean and diagonal covariance are parameterized by the output of a multi-layer perceptron. The policy and embedding distributions are jointly optimized by the reinforcement learning algorithm, while we train the inference distribution using supervised learning and a simple cross-entropy loss. \subsection{Using Model Predictive Control for Zero-Shot Adaptation} \label{sec:mpc_adaptation} To achieve unseen tasks on a real robot with no additional training, we freeze the multi-skill policy learned in Sec.~\ref{sec:skill_embedding_algorithm}, and use a new algorithm which we refer to as a ``composer.'' The composer achieves unseen tasks by choosing new sequences of latent skill vectors to feed to the frozen skill policy. Exploring in this smaller space is faster and more sample-efficient, because it encodes high-level properties of tasks and their relations. Each skill latent induces a different pre-learned behavior, and our method reduces the adaptation problem to choosing sequences of these pre-learned behaviors--continuously parameterized by the skill embedding--to achieve new tasks. Note that we use the simulation itself to evaluate the future outcome of the next action. For each step, we set the state of the simulation environment to the observed state of the real environment. This equips our robot with with the ability to predict the behavior of different skill latents. Since our robot is trained in a simulation-to-real framework, we can reuse the simulation from the pre-training step as a tool for foresight when adapting to unseen tasks. This allow us to select a latent skill online which is locally-optimal for a task, even if that task was seen not during training. We show that this scheme allows us to perform zero-shot task execution and composition for families of related tasks. This is in contrast to existing methods, which have mostly focused on direct alignment between simulation and real, or data augmentation to generalize the policy using brute force. Despite much work on simulation-to-real methods, neither of these approaches has demonstrated the ability to provide the adaptation ability needed for general-purpose robots in the real world. We believe our method provides a third path towards simulation-to-real adaptation that warrants exploration, as a higher-level complement to these effective-but-limited existing low-level approaches. We denote the new task $t^{\text{new}}$ corresponding to reward function $r^{\text{new}}$, the real environment in which we attempt this task $\mathcal{R}(s'|s,a)$, and the RL discount factor $\gamma$. We use the simulation environment $\mathcal{S(s'|s,a)}$, frozen skill embedding $p_\phi(z|t)$, and latent-conditioned skill policy $\pi_\theta(a|s,z)$, all trained in Sec.~\ref{sec:skill_embedding_algorithm}, to apply model-predictive control in the latent space as follows (Algorithm~\ref{algo:latent_space_mpc}). We first sample $k$ candidate latents $\mathcal{Z} = \{z_1, \ldots, z_k\}$ according to $p(z) = \mathbb{E}_{t \sim p(t)} p_\phi(z|t)$. We observe the state $s_{\text{real}}$ of real environment $\mathcal{R}$. For each candidate latent $z_i$, we set the initial state of the simulation $\mathcal{S}$ to $s_{\text{real}}$. For a horizon of $T$ time steps, we sample the frozen policy $\pi_\theta$, conditioned on the candidate latent $a_{j \in T} \sim \pi_\theta(a_j|s_j,z_i)$, and execute the actions $a_j$ the simulation environment $\mathcal{S}$, yielding and total discounted reward $R_i^{\text{new}} = \sum_{j=0}^T{\gamma^j r^{\text{new}}(s_j,a_j)}$ for each candidate latent. We then choose the candidate latent acquiring the highest reward $z^* = \argmax_{i} R_i^\text{new}$, and use it to condition and sample the frozen policy $a_{l \in N} \sim \pi_\theta(a_j|s_j,z^*)$ to control the real environment $\mathcal{R}$ for a horizon of $N < T$ time steps. We repeat this MPC process to choose and execute new latents in sequence, until the task has been achieved. \begin{figure} \centering \includegraphics[width=\columnwidth]{figs/mpc.png} \caption{Using model-predictive control with embedding functions and multi-task policy} \label{fig:mpc} \end{figure} \begin{algorithm} \caption{MPC in Skill Latent Space} \begin{algorithmic} \label{algo:latent_space_mpc} \REQUIRE{A latent-conditioned policy $\pi_{\theta}(a |s, z)$, a skill embedding distribution $p_\phi(z|t)$, a skill distribution prior $p(t)$, a simulation environment $\mathcal{S}(s'|s, a)$, a real environment $\mathcal{R}(s'|s, a)$, a new task $t^{\text{new}}$ with associated reward function $r^{\text{new}}(s,a)$, an RL discount factor $\gamma$, an MPC horizon $T$, and a real environment horizon $N$.} \WHILE{$t^{new}$ is not complete} \STATE{Sample $\mathcal{Z} = \{z_1, \ldots, z_k\} \sim p(z) = \mathbb{E}_{t \sim p(t)} p_\phi(z|t)$} \STATE{Observe $s_{\text{real}}$ from $\mathcal{R}$} \FOR{$z_i \in \mathcal{Z}$} \STATE{Set inital state of $\mathcal{S}$ to $s_{\text{real}}$} \FOR{$j \in \{1, \ldots, T\}$} \STATE{Sample $a_j \sim \pi_\theta(a_j|s_j,z_i)$} \STATE{Execute simulation $s_{j+1} = \mathcal{S}(s_j, a_j)$} \ENDFOR \STATE{Calculate $R_i^{\text{new}} = \sum_{j=0}^T{\gamma^j r^{\text{new}}(s_j,a_j)}$} \ENDFOR \STATE{Choose $z^* = \argmax_{z_i} R_i^\text{new}$} \FOR{$l \in \{1,\ldots, N\}$} \STATE{Sample $a_l \sim \pi_\theta(a_l|s_l,z^*)$} \STATE{Execute simulation $s_{l+1} = \mathcal{S}(s_l, a_j)$} \ENDFOR \ENDWHILE \end{algorithmic} \end{algorithm} The choice of MPC horizon $T$ has a significant effect on the performance of our approach. Since our latent variable encodes a skill which only partially completes the task, executing a single skill for too long unnecessarily penalizes a locally-useful skill for not being globally optimal. Hence, we set the MPC horizon $T$ to not more than twice the number of steps that a latent is actuated in the real environment $N$. \section{EXPERIMENTS} We evaluate our approach by completing two sequencing tasks on a Sawyer robot: drawing a sequence of points and pushing a box along a sequential path. For each of the experiments, the robot must complete an overall task by sequencing skills learned during the embedding learning process. Sequencing skills poses a challenge to conventional RL algorithms due to the sparsity of rewards in sequencing tasks~\cite{andrychowicz2017hindsight}. Because the agent only receives a reward for completing several correct complex actions in a row, exploration under these sequencing tasks is very difficult for conventional RL algorithms. By reusing the skills we have consolidated in the embedding space, we show a high-level controller can effectively compose these skills in order to achieve such difficult sequencing tasks. \subsection{Sawyer: Drawing a Sequence of Points} In this experiment, we ask the Sawyer Robot to move its end-effector to a sequence of points in 3D space. We first learn the low level policy that receives an observation with the robot's seven joint angles as well as the Cartesian position of the robot's gripper, and output incremental joint positions (up to 0.04 rads) as actions. We use the Euclidean distance between the gripper position and the current target is used as the cost function. We trained the policy and the embedding network on eight goal positions in simulation, forming a 3D rectoid enclosing the workspace. Then, we use the model-predictive control to choose a sequence latent vector which allows the robot to draw an unseen shape. For both simulation and real robot experiments, we attempted two unseen tasks: drawing a rectangle in 3D space (Figs.~\ref{fig:reacher_sim_results_1} and~\ref{fig:reacher_real_results_1}) and drawing a triangle in 3D space (Figs.~\ref{fig:reacher_sim_results_2} and~\ref{fig:reacher_real_results_2}). \begin{figure}[H] \centering \includegraphics[width=\columnwidth]{figs/reacher_seq_sim_1.pdf} \caption{Gripper position plots for the unseen rectangle-drawing experiment in simulation. In this experiment, the unseen task is drawing a rectangle in 3D space.} \label{fig:reacher_sim_results_1} \end{figure} \begin{figure}[H] \centering \includegraphics[width=\columnwidth]{figs/reacher_seq_sim_2.pdf} \caption{Gripper position plots in unseen triangle-drawing experiment in simulation. In this experiment, the unseen task is to move the gripper to draw a triangle.} \label{fig:reacher_sim_results_2} \end{figure} \begin{figure}[H] \centering \includegraphics[width=\columnwidth]{figs/reacher_seq_1.pdf} \caption{Gripper position plots for the triangle-drawing experiment on the real robot. In this experiment, the unseen task is to draw a triangle.} \label{fig:reacher_real_results_1} \end{figure} \begin{figure}[H] \centering \includegraphics[width=\columnwidth]{figs/reacher_seq_2.pdf} \caption{Gripper position plots in unseen triangle-drawing experiment on the real robot. In this experiment, the unseen task it to move the gripper to draw a triangle.} \label{fig:reacher_real_results_2} \end{figure} \subsection{Sawyer: Pushing the Box through a Sequence of Waypoints} In this experiment, we test our approach with a task that requires contact between the Sawyer Robot and an object. We ask the robot to push a box along a sequence of points in the table plane. We choose the Euclidean distance between the position of the box and the current target position as the reward function. The policy receives a state observation with the relative position vector between the robot's gripper and the box's centroid and outputs incremental gripper movements (up to $\pm$\SI{0.03}{\cm}) as actions. We first pre-train a policy to push the box to four goal locations relative to its starting position in simulation. We trained the low-level multi-task policy with four tasks in simulation: \SI{20}{\cm} up, down, left, and right of the box starting position. We then use the model-predictive control to choose a latent vectors and feed it with the state observation to frozen multi-task policy which controls the robot. For both simulation and real robot experiments, we use the simulation as a model of the environments. In the simulation experiments, we use model-predictive controller to push the box to three points. In the real robot experiments, we ask the Sawyer Robot to complete two unseen tasks: pushing up-then-left and pushing left-then-down. \begin{figure}[H] \centering \includegraphics[width=\columnwidth]{figs/pusher_seq_sim.pdf} \caption{Plot of block positions and gripper positions in simulation experiments. In the first experiment (left), the robot pushes the box to the right, up and then left. In the second experiment (right), the robot pushes the box to the left, then up, and then back to its starting position.} \label{fig:pusher_sim_results} \end{figure} \begin{figure}[H] \centering \includegraphics[width=\columnwidth]{figs/pusher_seq.pdf} \caption{Plot of block positions and gripper positions in real robot experiments. In experiment I (left), the robot pushes the box to the left, and then down. In experiment II (right), the robot push the box to the up, and then left.} \label{fig:pusher_real_results} \end{figure} \section{RESULTS} \subsection{Sawyer Drawing} In the unseen drawing experiments, we sampled $k = 15$ vectors from the skill latent distribution, and for each of them performed an MPC optimization with a horizon of $T=4$ steps. We then execute the latent with highest reward for $N=2$ steps on the target robot. In simulation experiments, the Sawyer Robot successfully draw a rectangle with by sequencing 54 latents (Fig. 2) and drew by sequencing a triangle with 56 latents (Fig. 3). In the real robot experiments, the Sawyer Robot successfully completed the unseen rectangle-drawing task by choosing 62 latents (Fig. 4) in 2 minutes of real time and completed the unseen triangle-drawing task by choosing 53 latents (Fig. 5) in less than 2 minutes. \subsection{Sawyer Pusher Sequencing} In the pusher sequencing experiments, we sample $k = 50$ vectors from the latent distribution. We use an MPC optimization with a simulation horizon of $T=30$ steps, and execute each chosen latent in the environment for $N=10$ steps. In simulation experiments, the robot completed the unseen up-left task less than 30 seconds of equivalent real time and the unseen right-up-left task less than 40 seconds of equivalent real time. In the real robot experiments, the robot successfully completed the unseen left-down task by choosing 3 latents over approximately 1 minute of real time, and the unseen push up-left task by choosing 8 latents in about 1.5 minutes of real time. \subsection{Analysis} These experiment results show that our learned skills are composable to complete the new task. In comparison with performing a search as done in \cite{julian2018scaling}, our approach is faster in wall clock time because we perform the model prediction in simulation instead of on the real robot. Note that our approach can utilize the continuous space of latents, whereas previous search methods only use an artificial discretization of the continuous latent space. In the unseen box-pushing real robot experiment (Fig. 7, \textit{Right}), the Sawyer robot pushes the box towards the bottom-right right of the workspace to fix an error it made earlier in the task. This intelligent reactive behavior was never explicitly trained during the pre-training in simulation process. This shows that by sampling from our latent space, the model-predictive controller successfully selects a skill that is not pre-defined during training process. \section{CONCLUSION} In this work, we combine task representation learning simulation-to-real training, and model-predictive control to efficiently acquire policies for unseen tasks with no additional training. Our experiments show that applying model predictive control to these learned skill representations can be a very efficient method for online learning of tasks. The tasks we demonstrated are more complex than the underlying pre-trained skills used to achieve them, and the behaviors exhibited by our robot while executing unseen tasks were more adaptive than demanded by the simple reward functions us. Our method provides a partial escape from the reality gap problem in simulation-to-real methods, by mixing simulation-based long-range foresight with locally-correct online behavior. For future work, we plan to apply our model-predictive controller as an exploration strategy to learn a composer policy that uses the latent space as action space. We look forward to efficiently learning a policy on real robots with guided exploration in our latent space. \section*{ACKNOWLEDGEMENTS} The authors would like to thank Angel Gonzalez Garcia, Jonathon Shen, and Chang Su for their work on the garage\footnote{https://github.com/rlworkgroup/garage} reinforcement learning for robotics framework, on which the software for this work was based. We also want to thank the authors of multiworld\footnote{https://github.com/vitchyr/multiworld} for providing a well-tuned Sawyer Block Pushing simulation environment. This research was supported in part by National Science Foundation grants IIS-1205249, IIS-1017134, EECS-0926052, the Office of Naval Research, the Okawa Foundation, and the Max-Planck-Society. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the funding organizations.
{'timestamp': '2018-11-15T02:02:22', 'yymm': '1810', 'arxiv_id': '1810.02422', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02422'}
arxiv
\subsubsection*{Acknowledgments} We thank Jiayuan Mao, Karthik Narasimhan, and Jon Gauthier for helpful discussions and suggestions. We also thank Drew A. Hudson for sharing experimental results for comparison. This work is in part supported by ONR MURI N00014-16-1-2007, the Center for Brain, Minds, and Machines (CBMM), IBM Research, and Facebook. \section{Scene Parser Details} \myparagraph{Data.} Our scene parser is trained on 4,000 CLEVR-style images rendered by Blender with object masks and ground-truth attributes including color, material, shape, size, and 3D coordinates. Because the original CLEVR dataset does not include object masks, we generate these 4,000 training images ourselves using the CLEVR dataset generation tool\footnote{\url{https://github.com/facebookresearch/clevr-dataset-gen}}. For the CLEVR-CoGenT experiment, we generate another set of images that satisfy the attribute composition restrictions, using the same software. \myparagraph{Training.} We first train the Mask-RCNN object detector on the rendered images and masks. For the CLEVR dataset, the bounding-box classifier contains 48 classes, each representing one composition of object intrinsic attributes of three shapes, two materials, and eight colors (i.e\onedot} \def\Ie{I.e\onedot ``blue rubber cube"). Then we run the detector on the same training images to obtain object segmentation proposals, and pair each segment to a labeled object. The segment-label pairs are then used for training the feature extraction CNN. Before entering the CNN, the object segment is concatenated with the original image to provide contextual information. \section{Program Executor Details} Our program executor is implemented as a collection of functional modules in Python, each executing a designated logic operation on a abstract scene representation. Given a program sequence, the modules are executed one by one; The output of a module is iteratively passed to the next. The input and output types of the modules include the following: \textit{object}, a dictionary containing the full abstract representation of a single object; \textit{scene}, a list of objects; \textit{entry}, an indicator of any object attribute values (color, material, shape, size); \textit{number}; \textit{boolean}. All program modules are summarized in the following tables. \input{table/supTable/exe_mod_set.tex} \input{table/supTable/exe_mod_bool.tex} \input{table/supTable/exe_mod_query.tex} \input{table/supTable/exe_mod_relate.tex} \input{table/supTable/exe_mod_filter.tex} \newpage \section{Running Examples} \input{figText/supFigText/run_example_1.tex} \newpage \input{figText/supFigText/run_example_2.tex} \newpage \input{figText/supFigText/run_example_3.tex} \newpage \input{figText/supFigText/run_example_4.tex} \newpage \section{Scene Parsing on Real Images} \input{figText/supFigText/real.tex} \section{Discussion} \label{sec:discuss} We have presented a neural-symbolic VQA approach that disentangles reasoning from visual perception and language understanding. Our model uses deep learning for inverse graphics and inverse language modeling---recognizing and characterizing objects in the scene; it then uses a symbolic program executor to reason and answer questions. We see our research suggesting a possible direction to unify two powerful ideas: deep representation learning and symbolic program execution. Our model connects to, but also differs from the recent pure deep learning approaches for visual reasoning. Wiring in symbolic representation as prior knowledge increases performance, reduces the need for annotated data and for memory significantly, and makes reasoning fully interpretable. The machine learning community has often been skeptical of symbolic reasoning, as symbolic approaches can be brittle or have difficulty generalizing to natural situations. Some of these concerns are less applicable to our work, as we leverage learned abstract representations for mapping both visual and language inputs to an underlying symbolic reasoning substrate. However, building structured representations for scenes and sentence meanings---the targets of these mappings---in ways that generalize to truly novel situations remains a challenge for many approaches including ours. Recent progress on unsupervised or weakly supervised representation learning, in both language and vision, offers some promise of generalization. Integrating this work with our neural-symbolic approach to visually grounded language is a promising future direction. \section{Evaluations} \label{sec:eval} \input{table/CLEVR_result_comparison.tex} We demonstrate the following advantages of our disentangled structural scene representation and symbolic execution engine. First, our model can learn from a small number of training data and outperform the current state-of-the-art methods while precisely recovering the latent programs (\sects{sec:clevr_qa}). Second, our model generalizes well to other question styles (\sects{sec:gen_human}), attribute combinations (\sects{sec:gen_attr}), and visual context (\sect{sec:gen_mc}). Code of our model is available at \url{https://github.com/kexinyi/ns-vqa} \subsection{Data-Efficient, Interpretable Reasoning} \label{sec:clevr_qa} \input{figText/res_clevr.tex} \paragraph{Setup.} We evaluate our NS-VQA\xspace on CLEVR~\citep{Johnson2017CLEVR}. The dataset includes synthetic images of 3D primitives with multiple attributes---shape, color, material, size, and 3D coordinates. Each image has a set of questions, each of which associates with a program (a set of symbolic modules) generated by machines based on 90 logic templates. Our structural scene representation for a CLEVR image characterizes the objects in it, each labeled with its shape, size, color, material, and 3D coordinates (see \fig{fig:model}c). We evaluate our model's performance on the validation set under various supervise signal for training, including the numbers of ground-truth programs used for pretraining and question-answer pairs for REINFORCE. Results are compared with other state-of-the-art methods including the IEP baseline~\citep{Johnson2017Inferring}. We not only assess the correctness of the answer obtained by our model, but also how well it recovers the underlying program. An interpretable model should be able to output the correct program in addition to the correct answer. \myparagraph{Results.} Quantitative results on the CLEVR dataset are summarized in \tbl{tab:CLEVR_result_compare}. Our NS-VQA\xspace achieves near-perfect accuracy and outperforms other methods on all five question types. We first pretrain the question parser on 270 annotated programs sampled across the 90 question templates (3 questions per template), a number below the weakly supervised limit suggested by \cite{Johnson2017Inferring} (9K), and then run REINFORCE on all the question-answer pairs. Repeated experiments starting from different sets of programs show a standard deviation of less than 0.1 percent on the results for 270 pretraining programs (and beyond). The variances are larger when we train our model with fewer programs (90 and 180). The reported numbers are the mean of three runs. We further investigate the data-efficiency of our method with respect to both the number of programs used for pretraining and the overall question-answer pairs used in REINFORCE. \fig{fig:acc_vs_num_prog} shows the result when we vary the number of pretraining programs. NS-VQA\xspace outperforms the IEP baseline under various conditions, even with a weaker supervision during REINFORCE (2K and 9K question-answer pairs in REINFORCE). The number of question-answer pairs can be further reduced by pretraining the model on a larger set of annotated programs. For example, our model achieves the same near-perfect accuracy of 99.8\% with 9K question-answer pairs with annotated programs for both pretraining and REINFORCE. \fig{fig:prog_acc} compares how well our NS-VQA\xspace recovers the underlying programs compared to the IEP model. IEP starts to capture the true programs when trained with over 1K programs, and only recovers half of the programs with 9K programs. Qualitative examples in \fig{fig:res_clevr} demonstrate that IEP tends to fake a long wrong program that leads to the correct answer. In contrast, our model achieves 88\% program accuracy with 500 annotations, and performs almost perfectly on both question answering and program recovery with 9K programs. \fig{fig:acc_vs_num_qa} shows the QA accuracy \vs the number of questions and answers used for training, where our NS-VQA\xspace has the highest performance under all conditions. Among the baseline methods we compare with, MAC~\citep{hudson2018compositional} obtains high accuracy with zero program annotations; in comparison, our method needs to be pretrained on 270 program annotations, but requires fewer question-answer pairs to reach similar performance. Our model also requires minimal memory for offline question answering: the structural representation of each image only occupies less than 100 bytes; in comparison, attention-based methods like IEP requires storing either the original image or its feature maps, taking at least 20K bytes per image. \subsection{Generalizing to Unseen Attribute Combinations} \label{sec:gen_attr} \input{figText/res_data_efficiency.tex} Recent neural reasoning models have achieved impressive performance on the original CLEVR QA task~\citep{Johnson2017Inferring, mascharka2018transparency, perez2018film}, but they generalize less well across biased dataset splits. This is revealed on the CLEVR-CoGenT dataset~\citep{Johnson2017CLEVR}, a benchmark designed specifically for testing models' generalization to novel attribute compositions. \myparagraph{Setup.} The CLEVR-CoGenT dataset is derived from CLEVR and separated into two biased splits: split A only contains cubes that are either gray, blue, brown or yellow, and cylinders that are red, green, purple or cyan; split B has the opposite color-shape pairs for cubes and cylinders. Both splits contain spheres of any color. Split A has 70K images and 700K questions for training and both splits have 15K images and 150K questions for evaluation and testing. The desired behavior of a generalizable model is to perform equally well on both splits while only trained on split A. \myparagraph{Results.} \tbl{tab:clevr_cogent} shows the generalization results with a few interesting findings. The vanilla NS-VQA\xspace trained purely on split A and fine-tuned purely on split B (1000 images) does not generalize as well as the state-of-the-art. We observe that this is because of the bias in the attribute recognition network of the scene parser, which learns to classify object shape based on color. NS-VQA\xspace works well after we fine-tune it on data from both splits (4000 A, 1000 B). Here, we only fine-tune the attribute recognition network with annotated images from split B, but no questions or programs; thanks to the disentangled pipeline and symbolic scene representation, our question parser and executor are not overfitting to particular splits. To validate this, we train a separate shape recognition network that takes gray-scale but not color images as input (NS-VQA+Gray\xspace). The augmented model works well on both splits without seeing any data from split B. Further, with an image parser trained on the original condition (i.e\onedot} \def\Ie{I.e\onedot the same as in CLEVR), our question parser and executor also generalize well across splits (NS-VQA+Ori\xspace). \subsection{Generalizing to Questions from Humans} \label{sec:gen_human} Our model also enables efficient generalization toward more realistic question styles over the same logic domain. We evaluate this on the CLEVR-Humans dataset, which includes human-generated questions on CLEVR images (see \cite{Johnson2017Inferring} for details). The questions follow real-life human conversation style without a regular structural expression. \myparagraph{Setup.} We adopt a training paradigm for CLEVR-Humans similar to the original CLEVR dataset: we first pretrain the model with a limited number of programs from CLEVR, and then fine-tune it on CLEVR-Humans with REINFORCE. We initialize the encoder word embedding by the GloVe word vectors~\citep{pennington2014glove} and keep it fixed during pretraining. The REINFORCE stage lasts for at most 1M iterations; early stop is applied. \myparagraph{Results.} The results on CLEVR-Humans are summarized in \tbl{tab:clevr_humans}. Our NS-VQA\xspace outperforms IEP on CLEVR-Humans by a considerable margin under small amount of annotated programs. This shows our structural scene representation and symbolic program executor helps to exploit the strong exploration power of REINFORCE, and also demonstrates the model's generalizability across different question styles. \subsection{Extending to New Scene Context} \label{sec:gen_mc} \input{table/CLEVR_gen.tex} Structural scene representation and symbolic programs can also be extended to other visual and contextual scenarios. Here we show results on reasoning tasks from the Minecraft world. \myparagraph{Setup.} We now consider a new dataset where objects and scenes are taken from Minecraft and therefore have drastically different scene context and visual appearance. We use the dataset generation tool provided by \cite{Wu2017Neural} to render 10,000 Minecraft scenes, building upon the Malmo interface~\citep{Johnson2016Malmo}. Each image consists of 3 to 6 objects, and each object is sampled from a set of 12 entities. We use the same configuration details as suggested by \cite{Wu2017Neural}. Our structural representation has the following fields for each object: category (12-dim), position in the 2D plane (2-dim, $\{x,z\}$), and the direction the object faces \{front, back, left, right\}. Each object is thus encoded as a 18-dim vector. We generate diverse questions and programs associated with each Minecraft image based on the objects' categorical and spatial attributes (position, direction). Each question is composed as a hierarchy of three families of basic questions: first, querying object attributes (class, location, direction); second, counting the number of objects satisfying certain constraints; third, verifying if an object has certain property. Our dataset differs from CLEVR primarily in two ways: Minecraft hosts a larger set of 3D objects with richer image content and visual appearance; our questions and programs involve hierarchical attributes. For example, a ``wolf'' and a ``pig'' are both ``animals'', and an ``animal'' and a ``tree'' are both ``creatures''. We use the first 9,000 images with 88,109 questions for training and the remaining 1,000 images with 9,761 questions for testing. We follow the same recipe as described in \sect{sec:train} for training on Minecraft. \myparagraph{Results.} Quantitative results are summarized in \tbl{tab:mc_results}. The overall behavior is similar to that on the CLEVR dataset, except that reasoning on Minecraft generally requires weaker initial program signals. \fig{fig:res_mc} shows the results on three test images: our NS-VQA\xspace finds the correct answer and recovers the correct program under the new scene context. Also, most of our model's wrong answers on this dataset are due to errors in perceiving heavily occluded objects, while the question parser still preserves its power to parse input questions. \input{figText/res_mc.tex} \section{Introduction} \label{sec:intro} Looking at the images and questions in \fig{fig:teaser}, we instantly recognize objects and their attributes, parse complicated questions, and leverage such knowledge to reason and answer the questions. We can also clearly explain how we reason to obtain the answer. Now imagine that you are standing in front of the scene, eyes closed, only able to build your scene representation through touch. Not surprisingly, reasoning without vision remains effortless. For humans, reasoning is fully interpretable, and not necessarily interwoven with visual perception. The advances in deep representation learning and the development of large-scale datasets~\citep{Malinowski2014VQA,Antol2015Vqa} have inspired a number of pioneering approaches in visual question-answering (VQA), most trained in an end-to-end fashion~\citep{yang2016stacked}. Though innovative, pure neural net--based approaches often perform less well on challenging reasoning tasks. In particular, a recent study~\citep{Johnson2017CLEVR} designed a new VQA dataset, CLEVR, in which each image comes with intricate, compositional questions generated by programs, and showed that state-of-the-art VQA models did not perform well. \input{figText/teaser.tex} Later, \cite{Johnson2017Inferring} demonstrated that machines can learn to reason by wiring in prior knowledge of human language as programs. Specifically, their model integrates a program generator that infers the underlying program from a question, and a learned, attention-based executor that runs the program on the input image. Such a combination achieves very good performance on the CLEVR dataset, and generalizes reasonably well to CLEVR-Humans, a dataset that contains the same images as CLEVR but now paired with human-generated questions. However, their model still suffers from two limitations: first, training the program generator requires many annotated examples; second, the behaviors of the attention-based neural executor are hard to explain. In contrast, we humans can reason on CLEVR and CLEVR-Humans even with a few labeled instances, and we can also clearly explain how we do it. In this paper, we move one step further along the spectrum of learning \vs modeling, proposing a neural-symbolic approach for visual question answering (NS-VQA) that fully disentangles vision and language understanding from reasoning. We use neural networks as powerful tools for parsing---inferring structural, object-based scene representation from images, and generating programs from questions. We then incorporate a symbolic program executor that, complementary to the neural parser, runs the program on the scene representation to obtain an answer. The combination of deep recognition modules and a symbolic program executor offers three unique advantages. First, the use of symbolic representation offers robustness to long, complex program traces. It also reduces the need of training data. On the CLEVR dataset, our method is trained on questions with 270 program annotations plus 4K images, and is able to achieve a near-perfect accuracy of 99.8\%. Second, both our reasoning module and visual scene representation are light-weighted, requiring minimal computational and memory cost. In particular, our compact structural image representation requires much less storage during reasoning, reducing the memory cost by 99\% compared with other state-of-the-art algorithms. Third, the use of symbolic scene representation and program traces forces the model to accurately recover underlying programs from questions. Together with the fully transparent and interpretable nature of symbolic representations, the reasoning process can be analyzed and diagnosed step-by-step. \section{Approach} \label{sec:model} \input{figText/model.tex} Our NS-VQA\xspace model has three components: a scene parser (de-renderer), a question parser (program generator), and a program executor. Given an image-question pair, the scene parser de-renders the image to obtain a structural scene representation (\fig{fig:model}-I), the question parser generates a hierarchical program from the question (\fig{fig:model}-II), and the executor runs the program on the structural representation to obtain an answer (\fig{fig:model}-III). Our scene parser recovers a structural and disentangled representation of the scene in the image (\fig{fig:model}a), based on which we can perform fully interpretable symbolic reasoning. The parser takes a two-step, segment-based approach for de-rendering: it first generates a number of segment proposals (\fig{fig:model}b), and for each segment, classifies the object and its attributes. The final, structural scene representation is disentangled, compact, and rich (\fig{fig:model}c). The question parser maps an input question in natural language (\fig{fig:model}d) to a latent program (\fig{fig:model}e). The program has a hierarchy of functional modules, each fulfilling an independent operation on the scene representation. Using a hierarchical program as our reasoning backbone naturally supplies compositionality and generalization power. The program executor takes the output sequence from the question parser, applies these functional modules on the abstract scene representation of the input image, and generates the final answer (\fig{fig:model}-III). The executable program performs purely symbolic operations on its input throughout the entire execution process, and is fully deterministic, disentangled, and interpretable with respect to the program sequence. \subsection{Model Details} \label{sec:details} \paragraph{Scene parser.} For each image, we use Mask R-CNN~\citep{he2017mask} to generate segment proposals of all objects. Along with the segmentation mask, the network also predicts the categorical labels of discrete intrinsic attributes such as color, material, size, and shape. Proposals with bounding box score less than 0.9 are dropped. The segment for each single object is then paired with the original image, resized to 224 by 224 and sent to a ResNet-34~\citep{He2015Deep} to extract the spacial attributes such as pose and 3D coordinates. Here the inclusion of the original full image enables the use of contextual information. \myparagraph{Question parser.} Our question parser is an attention-based sequence to sequence (seq2seq) model with an encoder-decoder structure similar to that in \cite{luong2015effective} and \cite{Bahdanau2015Neural}. The encoder is a bidirectional LSTM~\citep{hochreiter1997long} that takes as input a question of variable lengths and outputs an encoded vector $e_i$ at time step $i$ as \begin{equation} e_i = [e_i^F, e_i^B], \quad \text{where}\quad e_i^F, h_i^F = \text{LSTM}(\Phi_E(x_{i}), h_{i-1}^F), \quad e_i^B, h_i^B = \text{LSTM}(\Phi_E(x_{i}), h_{i+1}^B). \end{equation} Here $\Phi_E$ is the jointly trained encoder word embedding. $(e_i^F, h_i^F)$, $(e_i^B, h_i^B)$ are the outputs and hidden vectors of the forward and backward networks at time step $i$. The decoder is a similar LSTM that generates a vector $q_t$ from the previous token of the output sequence $y_{t-1}$. $q_t$ is then fed to an attention layer to obtain a context vector $c_t$ as a weighted sum of the encoded states via \begin{equation} q_t = \text{LSTM}(\Phi_D(y_{t-1})), \qquad \alpha_{ti} \propto \exp(q_t^\top W_A e_i), \qquad c_t = \sum\limits_i \alpha_{ti} e_i. \end{equation} $\Phi_D$ is the decoder word embedding. For simplicity we set the dimensions of vectors $q_t, e_i$ to be the same and let the attention weight matrix $W_A$ to be an identity matrix. Finally, the context vector, together with the decoder output, is passed to a fully connected layer with softmax activation to obtain the distribution for the predicted token $y_t\sim \text{softmax}(W_O [q_t, c_t])$. Both the encoder and decoder have two hidden layers with a 256-dim hidden vector. We set the dimensions of both the encoder and decoder word vectors to be 300. \myparagraph{Program executor.} We implement the program executor as a collection of deterministic, generic functional modules in Python, designed to host all logic operations behind the questions in the dataset. Each functional module is in one-to-one correspondence with tokens from the input program sequence, which has the same representation as in \cite{Johnson2017Inferring}. The modules share the same input/output interface, and therefore can be arranged in any length and order. A typical program sequence begins with a \texttt{scene} token, which signals the input of the original scene representation. Each functional module then sequentially executes on the output of the previous one. The last module outputs the final answer to the question. When type mismatch occurs between input and output across adjacent modules, an \texttt{error} flag is raised to the output, in which case the model will randomly sample an answer from all possible outputs of the final module. \fig{fig:res_clevr} shows two examples. \subsection{Training Paradigm} \label{sec:train} \paragraph{Scene parsing.} Our implementation of the object proposal network (Mask R-CNN) is based on ``Detectron''~\citep{Detectron2018}. We use ResNet-50 FPN~\citep{lin2017feature} as the backbone and train the model for 30,000 iterations with eight images per batch. Please refer to \cite{he2017mask} and \cite{Detectron2018} for more details. Our feature extraction network outputs the values of continuous attributes. We train the network on the \textit{proposed} object segments computed from the training data using the mean square error as loss function for 30,000 iterations with learning rate 0.002 and batch size 50. Both networks of our scene parser are trained on 4,000 generated CLEVR images. \myparagraph{Reasoning.} We adopt the following two-step procedure to train the question parser to learn the mapping from a question to a program. First, we select a small number of ground truth question-program pairs from the training set to pretrain the model with direct supervision. Then, we pair it with our deterministic program executor, and use REINFORCE~\citep{Williams1992Simple} to fine-tune the parser on a larger set of question-answer pairs, using only the correctness of the execution result as the reward signal. During supervised pretraining, we train with learning rate $7\times10^{-4}$ for 20,000 iterations. For reinforce, we set the learning rate to be $10^{-5}$ and run at most 2M iterations with early stopping. The reward is maximized over a constant baseline with a decay weight 0.9 to reduce variance. Batch size is fixed to be 64 for both training stages. All our models are implemented in PyTorch. \section{Related Work} \label{sec:related} \paragraph{Structural scene representation.} Our work is closely related to research on learning an interpretable, disentangled representation with a neural network~\citep{kulkarni2015deep,yang2015weakly,Wu2017Neural}. For example, \cite{kulkarni2015deep} proposed convolutional inverse graphics networks that learn to infer the pose and lighting of a face; \cite{yang2015weakly} explored learning disentangled representations of pose and content from chair images. There has also been work on learning disentangled representation without direct supervision~\citep{Higgins2017SCAN,SiddharthN,Vedantam2017Generative}, some with sequential generative models~\citep{eslami2016attend,ba2015multiple}. In a broader view, our model also relates to the field of ``vision as inverse graphics''~\citep{yuille2006vision}. Our NS-VQA\xspace model builds upon the structural scene representation~\citep{Wu2017Neural} and explores how it can be used for visual reasoning. \myparagraph{Program induction from language.} Recent papers have explored using program search and neural networks to recover programs from a domain-specific language~\citep{balog2017deepcoder,neelakantan2016neural,parisotto2016neuro}. For sentences, semantic parsing methods map them to logical forms via a knowledge base or a program~\citep{berant2013semantic,liang2013learning,vinyals2015grammar,guu2017language}. In particular, \cite{andreas2016learning} attempted to use the latent structure in language to help question answering and reasoning, \cite{rothe2017question} studied the use of formal programs in modeling human questions, and \cite{goldman2017weakly} used abstract examples to build weakly-supervised semantic parsers. \myparagraph{Visual question answering.} Visual question answering (VQA)~\citep{Malinowski2014VQA,Antol2015Vqa} is a versatile and challenging test bed for AI systems. Compared with the well-studied text-based question answering, VQA emerges by its requirement on both semantic and visual understanding. There have been numerous papers on VQA, among which some explicitly used structural knowledge to help reasoning~\citep{wang2015explicit}. Current leading approaches are based on neural attentions~\citep{yang2016stacked,lu2016hierarchical}, which draw inspiration from human perception and learn to attend the visual components that serve as informative evidence to the question. Nonetheless, \cite{jabri2016revisiting} recently proposed a remarkably simple yet effective classification baseline. Their system directly extracts visual and text features from \emph{whole} images and questions, concatenates them, and trains multi-class classifiers to select answers. This paper, among others~\citep{goyal2017making}, reveals potential caveats in the proposed VQA systems---models are overfitting dataset biases. \myparagraph{Visual reasoning.} \cite{Johnson2017CLEVR} built a new VQA dataset, named CLEVR, carefully controlling the potential bias and benchmarking how well models reason. Their subsequent model achieved good results on CLEVR by combining a recurrent program generator and an attentive execution engine~\citep{Johnson2017Inferring}. There have been other end-to-end neural models that has achieved nice performance on the dataset, exploiting various attention structures and accounting object relations ~\citep{hudson2018compositional,Santoro2017simple,hu2017learning,perez2018film,zhu2017structured}. More recently, several papers have proposed to directly incorporate the syntactic and logic structures of the reasoning task to the attentive module network's architecture for reasoning. These structures include the underlying functional programs \citep{mascharka2018transparency,Suarez2018DDRprog} and dependency trees \citep{cao2018visual} of the input question. However, training of the models relies heavily on these extra signals. From a broader perspective, \cite{misra2017learning} explored learning to reason by asking questions and \cite{bisk2017learning} studied spatial reasoning in a 3D blocks world. Recently, \cite{aditya2018explicit} incorporated probabilistic soft logic into a neural attention module and obtained some interpretability of the model, and \cite{gan2017vqs} learned to associate image segments with questions. Our model moves along this direction further by modeling the entire scene into an object-based, structural representation, and integrating it with a fully transparent and interpretable symbolic program executor.
{'timestamp': '2019-01-16T02:05:12', 'yymm': '1810', 'arxiv_id': '1810.02338', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02338'}
arxiv
\section{Introduction} \label{sec:intro} Computing global parametrizations of surfaces is a key operation in geometry processing. While in general only disk-like surfaces can be parametrized continuously in a (locally or globally) injective manner, surfaces of arbitrary topology can be dealt with by cutting them to disks. Across the cuts the parametrization will be discontinuous, limiting its practical value, but this is inevitable in general. One can, however, ask the parametric transitions across cuts to be from certain classes rather than arbitrary. For instance, restricting to similarity transformations with a rotation by some multiple of $\nicefrac{\pi}{2}$ yields global parametrizations ideal for T-spline constructions \cite{Campen:2017:SimilarityMaps}. Restricting further to \emph{rigid} transformations with such discrete rotation angles yields global parametrizations which (possibly after quantization \cite{Bommes:2013,CampenBK15}) are well suited for tasks like conforming quadrangulation, spline and subdivision fitting, seamless texturing, or constructing grids for solving PDEs on surfaces. This important latter type of parametrizations was termed \emph{seamless} \cite{myles2012global,Purnomo:2004}. Seamless parametrizations have \emph{singularities}, points around which the total parametric angle is not $2\pi$ but some other multiple of $\nicefrac{\pi}{2}$, i.e.~the parametrization coordinate isolines do not locally form a regular grid. Equivalently, the metric induced by the parametrization has \emph{cones}, points where the metric is not flat, its curvature not zero but some other multiple of $\nicefrac{\pi}{2}$. Intuitively, in a quadrangulation induced by the parametrization, these singularities or cones correspond to extraordinary vertices, with valence different from~4. As implied by the Gauss-Bonnet theorem, the total curvature of these cones is a topological invariant -- i.e.~such cones, which have a significant influence on the quality and structure of the parametrization, cannot generally be avoided. Depending on the use case, they can be considered either an impairment or features of special interest. In either case, having the ability to control (i.e.~prescribe) them -- where they are, how many there are, what curvature they have -- is of obvious benefit. An important task thus is: \vspace{0.2cm} \emph{Compute a global seamless injective parametrization with cones exactly as prescribed (in accordance with Gauss-Bonnet).} \vspace{0.2cm} Probably closest to a general reliable solution to this problem is an approach by Myles et al.~\shortcite{Myles:2014}: a valid global seamless injective parametrization is guaranteed, cone preservation is aimed for but not guaranteed -- in some cases unnecessary additional cones arise. That these are truly unnecessary follows from the fact that the above task is actually feasible: the \emph{existence} of such parametrizations follows from a theorem on existence of quad meshes with prescribed extraordinary vertices \cite{jucovivc1973theorem}. The proof is relatively complex and purely combinatorial, thus does not translate into a practical parametrization construction. In this paper, we provide a \emph{constructive} proof for the existence of seamless surface parametrizations, that is conceptually simpler and translates to a parametrization algorithm. Precisely, we show: \begin{theorem} \label{th:main} Given a closed surface $M$ of genus $g$ and an admissible set $C$ of cones $c_i$, each given by a point $p_i\in M$ with a prescribed curvature value $\hat\Theta_i = (4-k_i) \frac{\pi}{2}$, $k_i\!\in\!\mathbb{N}^{>1}$, there exists a global parametrization of $M$ with cones $C$ that has seamless transitions.\footnote{We assume $k_i > 1$ for brevity, as cones with curvature $3\nicefrac{\pi}{2}$, corresponding to valence~1 vertices in a quadrangulation, are of low relevance in common applications; with some additional special case handling, our method could be extended to $k_i = 1$.}\\ \end{theorem} \vspace{-0.3cm} The terms used in the theorem are defined precisely in Sec.~\ref{sec:construction}. A set of cones $C = \{(p_i,k_i)\}$ is called \emph{admissible} if it satisfies $\sum_{i}(1- \frac{1}{4}k_i) \!=\! 2-2g$ (Gauss-Bonnet) and if $\bm{k} \neq (3,5)$ (which is the single one notorious infeasible case \cite{jucovivc1973theorem}). \begin{figure}[t] \centering \begin{overpic}[width=0.99\linewidth]{teaser2zoom.png} \end{overpic} \vspace{-0.15cm} \caption{Zoom-ins of Figure \ref{fig:teaser}. Left: cut-aligned conformal map. Middle: padded map, with high distortion, but seamless and locally injective. Right: map optimized for low isometric distortion.} \label{fig:teaserzoom} \vspace{-0.35cm} \end{figure} \subsection*{Basic Idea} \label{sec:basicidea} Instead of directly aiming for a seamless cone metric on a surface~$M$, \begin{enumerate} \item we cut $M$ open using a cutgraph $G$, obtaining the cut surface $M'$ consisting of one or more topological disks, \item ask for a cone metric on $M'$ -- \emph{without} any seamlessness requirements, but with prescribed boundary curvature; concretely, we prescribe a \emph{rectilinear} boundary, consisting of geodesically straight segments meeting at right angles, \item modify this metric into a seamless one on $M$, yielding a seamless parametrization with exactly the prescribed cones; exploiting the rectilinear boundary property, this modification is performed by \emph{padding} the straight segments in the parametric domain with rectangles of suitably chosen size. \end{enumerate} The metric in (2) is known to exist; e.g.~a \emph{conformal} metric with prescribed cones and boundary curvature (satisfying Gauss-Bonnet) on a disk always exists -- in the smooth setting (cf.\ Sec.~\ref{sec:conemetrix}); the situation is more complicated in the discrete setting (cf.~Sec.~\ref{sec:62}). Figures~\ref{fig:teaser} and~\ref{fig:teaserzoom} show the outcome of these main steps. We refer to Appendix \ref{sec:illexample} for a comprehensive example illustrating these steps in a concrete, simple case. \subsection*{Key Contributions} Our key technical contributions pertain to step (3) of the above outline: \begin{itemize} \item We propose a technique (\emph{map padding}) to modify the non-seamless metric into a seamless one on $M$. \item We prove that, for certain choices of cutgraph combinatorics, this technique is always applicable and succeeds. \item We describe an implementation of this construction for the discrete, piecewise linear case. \end{itemize} So, in essence, our approach turns on a problem reduction: \vspace{0.2cm} \hrule \vspace{0.13cm} {If one is able to compute a metric with prescribed cones and prescribed boundary curvature for \emph{disk-topology surfaces}, this solves (by means of our technique) the more general problem of computing a global seamless parameterization with prescribed cones for \emph{arbitrary-topology surfaces.} \vspace{0.13cm} \hrule \vspace{0.05cm} \vspace{0.17cm} Our algorithm can thus be used to obtain non-degenerate, locally injective, seamless parametrizations of arbitrary closed discrete surfaces (triangle meshes) with arbitrary cones, assuming the initial metric with prescribed boundary curvature can be obtained. \section{Related Work} \label{sec:related} Seamless surface parametrization and the related subject of quadrangulation and quad layout generation is a well-explored topic. A relatively recent survey \cite{bommes2013quad} has references to many works in this area. We focus here on the most closely related ones. In a wide variety of applications, surface parametrizations are required to be (locally) injective (i.e.~without fold-overs) as well as to exhibit low parametric distortion \cite{floater2005spt}. Due to the challenging nature of this requirement, a common strategy is to proceed in a two-step fashion: first construct an initial injective parametrization (without specific attention to distortion), then optimize it with respect to application specific distortion criteria (while preserving injectivity). Our work likewise follows this strategy. \paragraph{Constructing injective maps} Interestingly, whenever a robust process is desired, injective maps are almost always initialized using one classical result on convex harmonic maps \cite{Tutte,Floater1997} (essentially a discrete version of the Rad\'o-Kneser-Choquet theorem). In its original form, it handles surfaces with disk topology and does not support cones. Some recent results \cite{GORTLER200683,Aigerman:2015,Aigerman:2016:HOT,Bright:2017:HGP} elegantly generalize the idea to other settings, but either not to arbitrary sets of cones, not to arbitrary topology, not using the piecewise linear Euclidean setting, or without similar guarantees on map existence. \paragraph{Injectivity-preserving optimization} A variety of techniques have been presented for distortion optimization, e.g.\ \cite{Schueller:LIM:2013,Hormann:2000:MAE,Rabinovich:2017:SLI,Kovalsky:2016:AQP,Zhu:2018:BCQ,Liu:2018:PP,Shtengel:2017:GOV}. Through line search techniques, barrier functions, and similar techniques they are able to guarantee preservation of injectivity -- if initialized with an injective starting point. State-of-the-art techniques can handle large meshes efficiently and tolerate significant imperfections in the initial solution. \paragraph{Seamless parametrization} A number of methods have been described for the construction of seamless parametrizations with prescribed cones \cite{kalberer2007qsp,Bommes:2009,Bommes:2013,myles2012global,myles2013controlled,esck2016,Bright:2017:HGP,Fu:2015:CLI,Chien:2016:BDP}. Interestingly, but not surprisingly, they do not follow the above two step principle -- as no general method for the first step (valid initialization) is known for the arbitrary-topology arbitrary-cones setting. Instead, they are typically based on optimization subject to non-convex constraints and, despite long development and practical importance, no concise sufficient conditions for success are known. The key issue is that there is no available way to construct an initial solution, and one cannot guarantee that the solver will itself find a way into the feasible region. Only for certain special cases there are known solutions in this regard, e.g.,\ for specific genus or specific cones \cite{Aigerman:2015,Gu:2003}, using more general non-piecewise-linear parametrization \cite{Aigerman:2016:HOT}, or requiring additional input \cite{tong2006dqd}. Particular challenges are caused by the fact that the given surface discretization may not even admit a (elementwise linear) solution, i.e.\ systematic remeshing capabilities are required in any approach that is supposed to be reliable. \paragraph{Quadrangulation} The problem of surface quadrangulation with conforming elements and prescribed extraordinary vertices is closely related -- state-of-the-art methods actually construct quadrangulations via seamless parametrization \cite{bommes2013quad}. \cite{jucovivc1973theorem} investigate the question of existence of such quadrangulations. The result is purely combinatorial and does not yield a surface parametrization. On an abstract level, we adapt some of the general ideas in this work as foundation of our approach to modify non-seamless into seamless parametrizations through map padding. In this context of quadrangulation, our strategy of transitioning from an initial non-seamless parametrization to a seamless one is, in a sense, similar to modifying a non-conforming quadrangulation into a conforming one. This has been tackled by simple subdivision or more involved T-mesh simplification techniques \cite{Myles:2014} -- however, at the expense of not always preserving the prescribed extraordinary vertices. Our modification technique, by contrast, always preserves exactly the prescribed cones. \paragraph{Cone selection} Regarding the (application specific) question of which cones to prescribe, common approaches are based on considering surface curvature (e.g.\ via cross fields \cite{Vaxman:FieldsSTAR}), distortion reduction \cite{Kharevych:2006:DCM,Soliman:2018:OCS,BenChen:2008,egsh2017}, or on manual design and editing of, e.g., quad mesh or quad layout structure \cite{esck2016}. \paragraph{General holonomy prescription.} \cite{Campen:2017:SimilarityMaps} address a related problem, showing that for any admissible \emph{holonomy signature} one can construct (also via conformal maps) a \emph{seamless similarity} map adequate for constructing T-splines. A holonomy signature, in addition to prescribed cone angles, includes turning angles around homology loops. In contrast, we use a stronger notion of seamlessness, not allowing scale jumps across cuts, while not controlling global turning angles around homology loops (cf.~Sec.~\ref{sec:conclusion}) -- however, they are of the form $k\nicefrac{\pi}{2}$ (for \emph{some} $k$) by our construction. \section{Seamless Parametrization Construction} \label{sec:construction} First, we define the seamless parametrizations we aim to construct as set out by Theorem~\ref{th:main}, as well as a weaker notion of a \emph{rotationally seamless} parametrization we need as an intermediate step. Suppose a smooth surface $M$ is cut to a set of topological disks $M^c_i$ by a cutgraph $G$, i.e. a collection of smooth curves (\emph{branches}) $\gamma_j$ embeddeded in $M$ meeting only at their endpoints (\emph{nodes}). We call the resulting cut surface $M^c$; the boundary of $M^c$ consists of curves $\gamma^c_j$ (boundary curves). There is a canonical map $\pi: M^c \rightarrow M$, which is identity in the interior of $M^c$ and maps exactly two boundary curves $\gamma^c_j$ to each branch $\gamma_j$ on $M$. Pairs of boundary curves mapping to the same branch $\gamma_j$ are called \emph{mates}, and boundary points where curves $\gamma^c_j$ meet are called \emph{joints}. The image of any joint under $\pi$ is a node. Pairs of non-joint points $p, q \in \partial M^c$ with $\pi(p) = \pi(q)$ are called \emph{mated points}. For a boundary point $p$ let $t_p \in T_pM^c$ denote a unit vector that is tangent to the boundary $\partial M^c$ at $p$. \begin{definition}[Rotationally Seamless Parametrization] A continuous, locally injective map $F: M^c \rightarrow \mathbb{R}^2$ is called \emph{rotationally seamless} parametrization of $M$, if for any pair $p$, $q$ of mated points, the images $dF_p(t_p)$ and $dF_q(t_q)$ of boundary tangents are related by a similarity transformation $T_{pq}$, i.e. $T_{pq}\!\circ\! dF_p(t_p) = dF_q(t_q)$, with a rotation angle that is a multiple of $\nicefrac{\pi}{2}$ and constant per branch. \end{definition} Such a rotationally seamless parametrization does, in general, have a (pointwise) \emph{scale jump} across the cut (cf.~Fig.~\ref{fig:rotseam} left) -- unless the similarity $T_{pq}$ is actually just a rotation everywhere: \begin{definition}[Seamless Parametrization] A map $F: M^c \rightarrow \mathbb{R}^2$ is called a \emph{seamless} parametrization of $M$, if it is rotationally seamless and for each pair of mated points $p$, $q$ the transition $T_{pq}$ is rigid, i.e. it is a rotation with a rotation angle that is a multiple of $\nicefrac{\pi}{2}$. \end{definition} \begin{figure}[b] \centering \begin{overpic}[width=0.99\columnwidth]{rotseam} \end{overpic} \vspace{-0.3cm} \caption{Visualization of a parametrization on a surface near a cut branch~(red). Left: rotationally seamless. Right: seamless.} \label{fig:rotseam} \vspace{-0.0cm} \end{figure} Notice that seamlessness implies that the images $F(\gamma^c_j)$ and $F(\gamma^c_k)$ of mates $\gamma^c_j$ and $\gamma^c_k$ are congruent. A seamless parametrization induces a metric on the surface $M$ which is flat except at the nodes, where it may be singular; it may have a \emph{cone}. We say that a seamless parametrization has a cone with angle $\alpha$ at a node $p$, if the sum of parametric angles at all joints $q$ in $M^c$ with $\pi(q) = p$ is equal to $\alpha$. This cone has curvature $\Theta = 2\pi - \alpha$. \paragraph{Overall Approach} We first construct a parametrization $F$ that is rotationally seamless, using a specific type of (conformal) maps: maps with rectilinear boundary, i.e. with the image of the boundary of the cut surface consisting of straight segments meeting at right angles. Then this parametrization is modified near the boundary to make the scale jump vanish so as to make it into a seamless parametrization $F^s$. This is done using a process we call \emph{map padding}. Key to our construction is cutting the surface into \emph{two} (in special cases three or four) topological disks, using a particularly structured cutgraph. This is critical for our method of converting rotationally seamless parametrizations into seamless parametrizations. \subsection{Cutting to Disk(s)} \label{sec:cg} We construct the graph $G$ needed to define our parametrizations in two steps, first cutting the surface $M$ into a set of topological disks $M'_i$, forming a surface $M'$. Typically we use two disks, with some exceptions for special genus 2 cases. $M'$ contains all cones in the interior. The final cut surface $M^c$ is obtained by adding and cutting along additional branches passing through all cones, without splitting the disks $M_i'$. This second step is explained in Section~\ref{sec:mtop}. For the first step, we consider a particular type of cutgraphs that only have nodes of degree 4 and 3. Pairs of cyclically sequential branches around nodes form sectors: four at degree 4 nodes, three \begin{wrapfigure}{r}{0.25\linewidth} \vspace{-0.35cm} \hspace{-0.75cm} \begin{overpic}[width=1.3\linewidth]{nodes} \put(70,31){\small flat} \end{overpic} \vspace{-0.8cm} \end{wrapfigure} at degree 3 nodes. At degree 4 nodes, all four sectors are marked as \emph{corners} (cf.~Fig.~\ref{fig:cutcorners}). At degree 3 nodes, two sectors are marked as corners, the third one is referred to as \emph{flat}. We refer to degree 3 nodes as \emph{T-nodes}. We denote the boundary curves of $M'$ by $\gamma'_j$. Any pair of sequential boundary curves of $M'$ corresponds to a corner or a flat joint. As we will require boundary curves to be straight and corners to be right-angled under a certain metric in the following, the number $n_i$ of corners on the boundary of each connected component $M'_i$ needs to match the total prescribed cone curvature in the interior of $M'_i$ as per Gauss-Bonnet, i.e., \begin{equation} \label{eq:gaussdisk} n_i \frac{\pi}{2} +\!\!\!\!\! \sum_{(p_j,\hat\Theta_j)\in\, C_i'} \!\!\!\!\!\!\hat\Theta_j = 2\pi, \end{equation} where $C_i'\subseteq C$ is the subset of cones prescribed within $M'_i$. Note that this is equivalent to $n_i = 4+ \sum_{(p_j,\hat\Theta_j)\in\, C_i'}(k_j-4)$. \begin{definition}[Admissible Cutgraph] \label{def:admcut} A cutgraph with corner marking is \emph{admissible}, if \begin{itemize} \item all branches are embedded smooth curves meeting transversally at nodes of degree 3 or 4, and not passing through cones; \item it partitions the surface into disk-topology components; \item the number of corners of each component satisfies Eq.~\eqref{eq:gaussdisk}; \item if a boundary curve is involved in a flat joint, its mate is not. \end{itemize} \end{definition} \begin{figure}[t] \centering \begin{overpic}[width=0.83\columnwidth]{cutcornersB} \end{overpic} \vspace{-0.3cm} \caption{Degree 4 cutgraph on a surface of genus $g = 3$. This cutgraph has $10$ branches and $5$ degree 4 nodes, thus 20 corners (marked black). The cutgraph consists of loops (red) and connectors (shades of blue) (cf.~Sec.~\ref{sec:holechain})} \label{fig:cutcorners} \vspace{-0.2cm} \end{figure} {\subsection{Cone Metric with Rectilinear Boundary} \label{sec:conemetrix} Corners partition the boundary $\partial M'$ into \emph{segments}. Note that a segment may contain flat joints, thus consist of several boundary curves $\gamma'_j$ (\emph{complex segment}). (All cutgraphs we will be working with contain at most two T-nodes, thus two flat joints, i.e. almost all segments are simple segments.) We now require a cone metric on $M'$ which has a \emph{rectilinear} boundary: under such a metric segments are geodesically straight (i.e. there is zero geodesic boundary curvature along $\partial M'$ in the interior of segments), and sequential segments form right inner angles of~$\nicefrac{\pi}{2}$. \begin{prop} \label{prop:conemetric} On a cut surface $M'$, obtained from a smooth surface $M$ by cutting it along an admissible cutgraph $G$, there is a cone metric with rectilinear boundary and prescribed admissible cones $C = \{(p_i,\hat\Theta_i)\}$. \end{prop} The proposition is proven in Sec.~\ref{sec:troyaproof}. In particular, a \emph{conformal} cone metric with these properties exists; conformality, however, is not essential in the following. Note that the metric angle on $M$ around points on $G$ is $2\pi$ everywhere: points in the interior of branches are surrounded by two sectors with angles $\pi+\pi$, node points are surrounded by three sectors with angles $\pi+2\frac{\pi}{2}$ or four sectors with angles $4\frac{\pi}{2}$. As we preserve these angles in the following, this implies that no spurious cones emerge. \begin{figure}[b] \centering \begin{overpic}[width=0.99\columnwidth]{padrect} \put(8,-1){\small a)} \put(29,-1){\small b)} \put(48,-1){\small c)} \put(69.5,-1){\small d)} \put(89.5,-1){\small e)} \end{overpic} \vspace{-0.1cm} \caption{a) Generic local view of the boundary of map $F(M^c)$, with straight segments and right-angled corners. b) A rectangular strip along a segment is marked. c) The strip is stretched outwards, effectively increasing the length of the two adjacent segments left and right of the central segment. d) This padding operation can be applied in sequence to further segments. } \label{fig:padrect} \end{figure} {\subsection{Metric to Rotationally Seamless Parametrization} \label{sec:mtop} The cone metric with rectilinear boundary is flat away from the cones on $M'$. We now extend the cutgraph $G$ by a set of trees $T_i$, yielding the extended cutgraph $G^T = G \cup T$, where $T$ is the union of trees $T_i$. The tree $T_i$ is rooted on $\partial M'_i$ at a single non-joint point, and its branches connect all cones prescribed within $M_i'$. Let $M^c_i$ be the surface obtained by cutting $M'_i$ along $T_i$. For distinction, the boundary curves of $M^c$ are denoted $\gamma_j'$ if they map to branches of $G$, or $\gamma_j^T$ if they map to branches of $T$. The above constructed cone metric is flat in the interior of $M^c_i$ (as the cones lie on $\partial M^c$), and defines (via integration) a map $F_i: M^c_i \rightarrow \mathbb{R}^2$. It is unique up to a rigid transformation, which we choose such that all segments' images are axis-aligned in $\mathbb{R}^2$ -- which is possible because they (due to rectilinearity) are all straight and meet at right angles. Together, these maps $F_i$ define a global parametrization $F$ of $M$. \begin{prop} \label{prop:rotseam} The map $F$ is a rotationally seamless parametrization of $M$ (but not, in general, seamless). \end{prop} \begin{proof} Due to all segments' images being axis-aligned, the angle between the images of any two mated boundary curves $\gamma'_j$, $\gamma'_k$ is some multiple of $\nicefrac{\pi}{2}$, constant per branch. The images of any two mated boundary curves $\gamma^T_j$, $\gamma^T_k$ are congruent (thus in particular similar) as the metric is flat on $T$ by construction, and the rotation between them is a multiple of $\nicefrac{\pi}{2}$ because the prescribed angles at cones are multiples of $\nicefrac{\pi}{2}$ (cf., e.g., \cite{Springborn:2008}). Hence, $F$ is seamless on $T$ but, in general, only rotationally seamless on~$G$. \end{proof} \label{sec:vis} {\paragraph{Visualization} For purposes of illustration, we would like to visualize the image $F(M^c)$. Due to global overlaps implied by negative curvature cones, this is not an easy task. However, locally, near the cutgraph $G$, $F(M^c)$ always looks like in Fig. \ref{fig:padrect}a -- because the boundary consists exclusively of straight segments meeting at right angled corners (the only exception being the one boundary curve per $M_i$ where the tree $T_i$ is rooted). We use this type of illustration when a local view is sufficient. An alternative is to flatten the surface to the plane without cutting to the cones (using the trees $T$), instead (for visualization purposes) pushing the curvature of the cones evenly onto the boundary $\partial M'$. This leads to a flattening of $M'_i$ as shown in Fig.~\ref{fig:padABC2}a, where straight boundary segments appear as curved arcs (and cones are not visible). This makes it possible to visualize the complete rectilinear boundary without cuts or overlaps \label{sec:vis}} \begin{figure}[bt] \centering \begin{overpic}[width=0.99\columnwidth]{padABC} \put(4,0){\small a)} \put(38.5,0){\small b)} \put(72,0){\small c)} \put(4.5,25){\small 0} \put(14.5,29.6){\small 1} \put(24,30){\small 2} \put(26.5,19.5){\small 3} \put(22,6.9){\small 4} \put(15.7,2.8){\small 5} \put(11,7){\small 6} \put(5.9,15.5){\small 7} \end{overpic} \vspace{-0.15cm} \caption{a) Global visualization (without cuts to cones) of the rectilinear map, where straight segments appear as curved arcs (as explained in~Sec.~\ref{sec:vis}). b) Padding (analogous to Fig.~\ref{fig:padrect}) of segment 1, increasing the lengths of segments 0 and 2. c) Padding of segment 2, increasing the lengths of segments 1 and 3. This can be continued to adjust all segments' lengths. } \label{fig:padABC2} \vspace{-0.25cm} \end{figure} \subsection{Seamless Parametrization by Padding} \label{sec:pad1} The rotationally seamless map $F$ falls short of being seamless on two levels: the images of mated segments may have different lengths, which implies a scale jump; but even if they are of equal length, this only implies that the scale is equal on average rather than pointwise along the corresponding branch. We thus modify $F$ by composing it with two types of local segment-wise maps: \begin{itemize} \item a \emph{stretch} map $g_j$ which effects a change of the lengths of segment images, \item a \emph{shift} map $r_j$ which subsequently equidistributes scale along a segment. \end{itemize} We apply these operations per segment in an iterative manner. \begin{figure}[b] \vspace{-0.15cm} \centering \begin{overpic}[width=0.99\columnwidth]{padR2} \put(16,19){\small $M^c$} \put(27.6,16){\small $G$} \put(10,12.3){\small $S_j$} \put(15.5,13.7){\small $s_j$} \put(14.5,8){\small $\Omega_j$} \put(37,4){\small $F$} \put(53,10.8){\small $R_j$} \put(71.4,4.5){\small $g_j$} \put(88.6,14.5){\small $R_j'$} \put(72.8,16.5){\small $w_j$} \end{overpic} \vspace{-0.15cm} \caption{Illustration of strip definition and stretch map applied to perform padding of a segment $s_j$ by padding width $w_j$, cf.~Sec.~\ref{sec:pad1}. } \label{fig:padR} \end{figure} \paragraph{Stretching} For a boundary segment $s_j$, we consider a thin strip $S_j$ on $M^c$ which runs along the entire segment and maps to a rectangular region $R_j$ via $F$. This is illustrated in Fig.~\ref{fig:padrect}b and Fig.~\ref{fig:padR}. More formally, the strips are defined as follows. The restriction of $F$ to the segment $s_j$ (which maps $s_j$ to a straight segment in the plane) is bijective and so is the restriction $F_j$ to a sufficiently small neighborhood $\Omega_j \subset M^c$ of $s_j$. We choose the rectangle $R_j$ within $F(\Omega_j)$ such that it includes $F(s_j)$ but no cone points and no joints except the ones on $s_j$. The thin strip $S_j$ on $M^c$ is then defined as $S_j = F_j^{-1}(R_j)$, as shown in Fig.~\ref{fig:padR}. Outside of $S_j$ we preserve the map, but within $S_j$ we modify it by a one-dimensional scaling $g_j$ such that $S_j$ is mapped onto a larger rectangle $R_j'\supseteq R_j$ whose width (orthogonal to the segment $s_j$) is increased by a \emph{padding width} $w_j$ such that it extends across the original segment image by that width. This is illustrated in Fig.~\ref{fig:padrect}c and Fig.~\ref{fig:padR}. Effectively, the domain is locally \emph{padded} by an additional rectangular region $R_j' \backslash R_j$ of width $w_j$ along the image of $s_j$, cf.~Fig.~\ref{fig:padABC2}. The situation is slightly different at the one segment $s_j$ per component where $T$ is rooted (cf. Sec.~\ref{sec:mtop}): it is separated into two parts by $T$ (cf.~Fig.~\ref{fig:poly} left). Both parts can, however, be handled separately using the same technique, as detailed in Sec.~\ref{sec:padding}. We define the padded map $F^p$ iteratively, iterating over the (arbitrarily ordered) strips $S_j$, $j = 1, \dots, n$, of each connected component of $M^c$. $F^{p,0}$~coincides with $F$, and $F^{p,m+1}$ differs from $F^{p,m}$ only on $R_{m+1}$, where it is defined as $g_{m+1} \circ F^{p,m}|_{R_{m+1}}$, where $g_{m+1}$ is the above scaling transformation (detailed in Sec.~\ref{sec:padding}). $F^p = F^{p,n}$. \paragraph{Shifting} In the padded map $F^p$ we again consider for each segment a strip $S^p_j$ (now defined based on $F^p$) and modify the map within this strip by a map $r_j$ with the following properties: \begin{itemize} \item its restriction to segment $s_j$ reparametrizes $s_j$ to constant speed, i.e. scaled arc-length, (in the case of a complex segment: \emph{piecewise}, i.e. constant per boundary curve, cf.~Sec.~\ref{sec:padding}), \item it is identity on the rest of the strip's boundary, \item it is continuous and bijective. \end{itemize} We define the shifted map $F^s$ iteratively, again iterating over the strips $S^p_j$ of each connected component of $M^c$. $F^{s,0}$~coincides with $F^p$, and $F^{s,m+1}$ differs from $F^{s,m}$ only on $R^p_{m+1} = F^{s,m}(S^p_{m+1})$, where it is defined as $r_{m+1} \circ F^{s,m}|_{R^p_{m+1}}$, where $r_{m+1}$ is the above shift map (detailed in Sec.~\ref{sec:padding}). $F^s = F^{s,n}$. \begin{prop} \label{prop:rotseam2} $F^{s}$ is a rotationally seamless parametrization of $M$ with the same cones as $F$, and not only the angle but also the scale jump is constant per branch of the cut. \end{prop} A proof is given in Sec.~\ref{sec:padding}. The choice of padding widths determines the lengths of segments under $F^p$ and, as they are preserved by the shift maps, under $F^s$. In the following Sec.~\ref{sec:equalize} we detail how \emph{equalizing} padding widths can be found: \begin{definition}[Equalizing Padding Widths] A set of padding widths leading to all pairs of mates being of equal length under $F^s$ is called \emph{equalizing padding widths}. \end{definition} \begin{prop} \label{prop:seam} If $F^{s}$ is constructed using equalizing padding widths, it is a seamless parametrization of $M$. \end{prop} \proof{The constant scale jump per branch ascertained by Prop. \ref{prop:rotseam2} together with the equal lengths of mated boundary curves' images implies a scale jump of zero per branch, thus rigid transitions.\qed} {\subsection{Length Equalization} \label{sec:equalize} \begin{figure}[b] \centering \begin{overpic}[width=0.44\columnwidth]{padE} \put(-18,45){$w_{\text{prev}(i)}$} \put(35.5,62.5){$\ell_{i}$} \put(62,82){$w_{\text{next}(i)}$} \end{overpic} \vspace{-0.05cm} \caption{The length of segment $i$ is affected by the padding of the two adjacent segments: the original length $\ell_i$ changes to $\ell_i+w_{\text{prev}(i)} + w_{\text{next}(i)}$.} \label{fig:padE2} \end{figure} When a boundary segment is padded, the lengths of the two adjacent segments' images change. To make this precise, let $\ell_i$ be the length of segment $s_i$ before any padding is performed, and $w_i$ be the amount of padding applied to $s_i$. The length $\ell_i'$ of $s_i$ after each segment was padded according to values $\bm{w} = (w_0,w_1,w_2,...)$ is \begin{equation} \ell_i' = w_{\text{prev}(i)} + \ell_i + w_{\text{next}(i)}, \end{equation} where prev$(i)$ and next$(i)$ are the two segments adjacent to $s_i$, preceding and following it in cyclic order along $\partial M'$, cf.~Fig.~\ref{fig:padE2}. Our goal is to find an equalizing assignment of padding width variables $\bm{w}$ such that the lengths $\bm{\ell}' = \{\ell_0',\ell_1',\ell_2',...\}$ after padding are equal for each pair $(s_i,s_j)$ of mated segments, i.e.~ $\ell_i' =\ell_{j}'$. This leads to \emph{length~equalization} equations \begin{equation} \label{eq:equa} w_{\text{prev}(i)} + w_{\text{next}(i)} - w_{\text{prev}(j)} - w_{\text{next}(j)}= \ell_{j} - \ell_i.\vspace{0.1cm} \end{equation} However, only if all cutgraph nodes are of degree 4, are all segments simple, thus mated in pairs. When T-nodes, thus complex segments, are involved, the situation is a little different: a complex segment $s_i$ consists of multiple boundary curves; their mate curves, however, form simple segments due to the last property of Def.~\ref{def:admcut}. Hence, generally, a (simple or complex) segment $s_i$ is mated with a sequence $J_i = (s_j, s_k, ...)$ of one or more simple segments. Length equalization equations then take this more general form: \begin{equation} \label{eq:equaGeneral} \ell'_i = \sum_{j\in J_i} \ell'_j \vspace{-0.2cm} \end{equation} which expands to \begin{equation} \label{eq:equaGeneralw} w_{\text{prev}(i)} \!+\! w_{\text{next}(i)} - \sum_{j\in J_i}\! \left(w_{\text{prev}(j)} \!+\! w_{\text{next}(j)}\right) = \sum_{j\in J_i} \ell_j -\! \ell_i. \end{equation} These equations form a globally interdependent equation system: \begin{equation} \label{eq:equas} A\bm{w} = \bm{b}, \quad w_i \geq 0 \,\forall i. \end{equation} Notice the non-negativity condition; it ensures that the padding operation actually stretches ($w > 0$) rather than squeezes ($w<0$) the strips along segments (which could be done only by a very limited amount). This system needs to be solved to achieve length equalization and thus enable seamlessness. Unfortunately, it is not generally feasible -- it may have no non-negative solution or even no solution at all. Notice that the system matrix structure is entirely determined by the cutgraph's combinatorics, leading to the following definition. \begin{definition}[Equalizable Cutgraph] An admissible cutgraph for which equalization system \eqref{eq:equas} is feasible for arbitrary $\bm{b}$, is called \emph{equalizable}. \end{definition} Our key result, accompanying the proposed map padding technique, is a proof showing that there is an equalizable cutgraph for any genus and any admissible set of cones, as well as an efficient algorithm to construct such cutgraphs (cf.\ Sec.~\ref{sec:cutgraphs} and~Sec.~\ref{sec:eqproof}). \label{sec:background} \section{Equalizable Cutgraphs} \label{sec:cutgraphs} The foundation of our construction of equalizible cutgraphs is a so-called \emph{hole chain}. Variations thereof, depending on the surface's genus and the cone configuration, then yield equalizable cutgraphs. \begin{prop} \label{th:feas1} For any genus $g$ and any admissible prescription of cones $C$, there is an equalizable cutgraph, i.e. we can always obtain equalizing padding widths that enable a seamless parametrization. \end{prop} Cutgraphs covering all cases (arbitrary genus, arbitrary admissible cones) are defined in the following. Their equalizability is shown in Sec. \ref{sec:eqproof}}. Together with Prop.~\ref{prop:conemetric} (rectilinear cone metric), Prop.~\ref{prop:rotseam} (rotationally seamless map), and Prop.~\ref{prop:seam} (seamless modification given equalizing padding widths), this Prop.~\ref{th:feas1} (equalizable cutgraphs) \textbf{concludes the constructive proof of the main theorem~\ref{th:main}.} \subsection{Hole Chain} \label{sec:holechain} Given a closed surface $M$ of genus $g > 0$, we cut it along $g$ non-intersecting non-homotopic non-separating smooth loops $\alpha_i$. This yields a topological sphere $M^\circ$ with $2g$ holes. Note that each loop corresponds to two holes, which are called \emph{partners}. Let the holes be numbered from $0$ to $2g-1$, and denoted $h_i$, in such a way that $h_0$ and $h_{2g-1}$ (called \emph{terminals}) are partners. Let $\pi: M^\circ \rightarrow M$ be the canonical map from $M^\circ$ to $M$, taking $h_i$ and its partner $h_j$ to their corresponding loop $\alpha$: $\pi(h_i) = \pi(h_j) = \alpha$. On each hole $h_i$ pick two distinct points $q_i$ and $q_i'$, such that they are identified across partners on $M$, i.e. for partners $h_i$, $h_j$ we have $\pi(q_i) = \pi(q_j)$ and $\pi(q_i') = \pi(q_j')$. For each $0 \leq i < 2g-1$ we then further cut $M^\circ$ along a smooth non-intersecting path between holes $h_i$ to $h_{i+1}$, starting transversally at point $q_i'$ and ending transversally at point $q_{i+1}$. These paths are called \emph{connectors}. Note that after each such cut the surface remains a topological sphere with holes (each time one less), thus is path-connected; therefore these connectors always exist. Loops and connectors together form a cutgraph we call \emph{hole chain}, as abstractly depicted in Fig.~\ref{fig:holechain} and on a surface in Fig.~\ref{fig:cutcorners}, which yields the surface $M'$, a sphere with one hole, i.e. a disk. Loops and connectors are assumed not to cross any prescribed cone point. \begin{prop} The hole-chain cutgraph for any genus $g > 0$ is admissible. \end{prop} \proof As the connectors' endpoints $q_i$, $q_j$ are identified in pairs on $M$ across partners $h_i$, $h_j$, each resulting cutgraph node (at point $\pi(q_i) = \pi(q_j)$ on $M$) is of degree 4 (cf.~Fig.~\ref{fig:cutcorners}). All branches are smooth curves meeting transversally at their endpoints and not crossing cones by construction. The surface is cut to a single component with disk-topology. As the set of cones $C$ is admissible, we have $\sum_j \Theta_j = 2\pi(2-2g)$; the hole chain cutgraph has $2g-1$ nodes with 4 corners each, i.e. a total of $8g-4$ corners. Thus Eq.~\eqref{eq:gaussdisk} is satisfied. \qed \paragraph{Odd-Couple Condition} We impose one condition (besides terminals being partners) on the way the numbering of holes is chosen: there needs to be at least one odd couple, i.e. two partner holes which have an odd number of holes in between them in the chain, i.e.\ there is an $i$ and an integer $k$ such that $h_i$ and $h_{i+2k}$ are partners. This will be expected in the proof of equalizability. Note that this is impossible if there are just four or less holes, thus instead special case variations of the hole chain are used for genus 1 (two holes) and genus 2 (four holes) cases, as detailed in Sec.~\ref{sec:special}. \begin{definition}[Fourfold Cones] A set of cones $C = \{(c_i,k_i)\}$ with $k_i$ divisible by 4 for each $i$ is called \emph{fourfold}. \end{definition} While the above hole chain cutgraph is not equalizable in general, it permits equalization for \emph{specific} righthand sides $\bm{b}$: \begin{prop} \label{prop:fourfold} For any genus, a fourfold cone prescription implies a righthand side $\bm{b}$ for which problem \eqref{eq:equas} is feasible. \end{prop} A proof is given in Sec.~\ref{sec:eqproof}. For the general, non-fourfold case, variations of this basic cutgraph are used, as detailed in the following. \begin{figure}[bt] \centering \begin{overpic}[width=0.99\columnwidth]{chainB} \end{overpic} \vspace{-0.2cm} \caption{Schematic depiction of a chain of holes for a genus $g=4$ surface: circles depict holes (emerging from cutting the surface along $g$ loops), straight line segments depict the sides of cut paths (connectors) between these holes. Together, this hole chain cutgraph cuts the surface to a topological disk, i.e. a sphere with one hole (bounded by the closed black curve). An exemplary partnership of holes (due to each loop corresponding to two holes) is indicated by dashed arcs; depending on the chosen ordering of holes in the chain, these partner arcs will look different.} \label{fig:holechain} \vspace{-0.2cm} \end{figure} \subsection{General Case (Genus 3+)} \label{sec:gen3} If the cone prescription is not fourfold, i.e. there is at least one $k_i\!\!\mod 4 \neq 0$, we extend the hole chain cutgraph by one extra path (cf.~Fig.~\ref{fig:extracutB}) -- which makes it equalizable. \begin{definition}[Valid Extra Path] A simple path is called a valid extra path for a hole chain cutgraph if \begin{itemize} \item it does not cross any cone, \item only its endpoints intersect the hole chain cutgraph, \item at least one endpoint is on a hole of the hole chain, \item no endpoint is coincident with a node of the hole chain. \end{itemize} \end{definition} Notice that this extra path forms two additional nodes, both of degree 3, i.e. T-nodes, at its endpoints -- at each we mark as corners the two sectors directly adjacent to the extra path. Hence the total number of corners increases from $8g-4$ to $8g$. At the same time, the extended hole chain cutgraph cuts the surface into two components, $M_0'$ and $M_1'$, each with disk-topology, with numbers of corners $n_0, n_1$. We have $n_0+n_1 = 8g$. In order for the extended hole chain to remain admissible, we need to ensure that Eq.~\eqref{eq:gaussdisk} is satisfied, i.e. the number $n_i$ of corners per component $M_i'$ needs to match the total curvature of cones $C_i'$ prescribed within the component. Note that this is satisfied for $M_0'$ if and only if it is satisfied for $M_1'$. Also, if the endpoints lie on two mated segments, we choose them as mated points so as to create a degree 4 node rather than two opposite T-nodes. We furthermore require that the numbers $n_0$, $n_1$ of corners are not divisible by 4. This will be expected in the proof of equalizability. \begin{definition}[Admissible Extra Path] A valid extra path that yields corner numbers $n_0$, $n_1$ not divisible by 4 and satisfying Eq.~\eqref{eq:gaussdisk} is called admissible. \end{definition} \begin{figure}[b] \centering \begin{overpic}[width=0.99\columnwidth]{extracutB} \end{overpic} \vspace{-0.05cm} \caption{Examples of extra cuts (green) that could be added to the hole chain cutgraph. The red path is not a valid extra cut because it splits the surface into two components with $n_0 = 4$ and $n_1 = 8g-n_0 = 28$ corners (cf.~Sec.~\ref{sec:gen3}).} \label{fig:extracutB} \end{figure} \begin{prop} \label{th:extraexists} An admissible extra path exists for any non-fourfold cone prescription and any genus $g \geq 3$. \end{prop} \proof Pick one prescribed cone $c_i$ with $k_i\!\!\mod 4 \neq 0$. Let $\beta$ be a simple path from a point $q$ on hole $h_0$ which is not a corner to $c_i$ such that it does not contain any other cone. Let $\gamma$ be a path that starts at $q$, runs (arbitrarily close) along one side of $\beta$, then around $c_i$, then back along the other side of $\beta$, and ultimately (arbitrarily close) along the cut $G$ until it has passed $k_i-2$ corners. It then connects to a point $q'$ on the segment it reached. If $\gamma$ is chosen sufficiently close to $\beta$ and $G$, it is an example of a valid extra path: the region that contains $c_i$ contains no other cone and it has $k_i$ corners (the $k_i-2$ corners passed along $G$ plus the two corners formed by the extra path itself with $G$ at $q$ and $q'$). Also, $\gamma$ is connected to a hole, namely $h_0$.\qed The equalizability of the hole chain cutgraph extended by an admissible extra path is proven in Sec.~\ref{sec:eqproof}. \subsection{Special Cases (Genus 0, 1, 2)} \label{sec:special} \subsubsection*{Genus 0 Case} In the case of a topological sphere, our method formally is applicable, but does not actually contribute anything: the cutgraph is empty; there are no cuts across which the cone metric could be non-seamless, thus no padding is required. The existence of conformal metrics with prescribed cones on the topological sphere $M$ is well-known \cite{Troyanov:1991}.} \begin{figure}[t] \centering \begin{overpic}[width=0.99\columnwidth]{genus1patt} \end{overpic} \vspace{-0.35cm} \caption{Cutgraph pattern for genus 1 surfaces, shown abstracly (left) and on an example surface (right). The surface is partitioned into a 2-corner region (enclosed by blue and red paths) and a 6-corner region.} \label{fig:gen1} \end{figure} \subsubsection*{Genus 1 Case} \label{sec:gen1} For the case of genus 1 surfaces, we (like in the general case) add one extra path, but deviate slightly from the general hole chain pattern in terms of identification of connector endpoints. The cutgraph pattern is depicted in Fig.~\ref{fig:gen1}. Notice that the surface is split into a component with 2 corners and a component with 6 corners. It is easy to see that for any admissible prescription of cones on a genus 1 surface, one either has no cones at all (in this case the basic hole chain cutgraph is sufficient, cf.~Prop.~\ref{prop:fourfold}) or one has, among the prescribed cones, one or more cones whose curvature sums up to $\pi$ (due to Gauss-Bonnet there are cones of positive and of negative curvature, and the case of a single positive cone of curvature $\nicefrac{\pi}{2}$ is the one non-admissible case, cf.~Sec.~\ref{sec:intro}). The surface bi-partition by this cutgraph pattern is thus compatible with any non-empty cone prescription, i.e. the paths can be chosen in an admissible way on $M$. The equalization equation system corresponding to this pattern is easily checked explicitly for non-negative feasibility (cf.~Sec.~\ref{app:g1}). \begin{figure}[b] \centering \begin{overpic}[width=0.95\columnwidth]{gen2val5} \end{overpic} \vspace{-0.05cm} \caption{One of the cutgraph patterns for genus 2 surfaces. Segments $i$ and $i'$ are mates, i.e. correspond to a common cutgraph branch. The surface is partitioned into a 5-corner region (center) and a 11-corner region (surround).} \label{fig:gen2val5} \end{figure} \subsubsection*{Genus 2 Case} \label{sec:gen2} For the case of genus 2 surfaces, we (like in the genus 1 case) need to deviate from the general case. In contrast to the genus 1 case, where we could assume that a subset of prescribed cones always have curvatures summing to one specific value, five cases need to be distinguished: there is a subset of prescribed cones with curvatures summing to $\pi$, $\nicefrac{\pi}{2}$, $-\nicefrac{\pi}{2}$, $-\pi$, or $-3\nicefrac{\pi}{2}$ (compatible with regions with 2, 3, 5, 6, and 7 corners, respectively). This list is exhaustive because the total sum of cone curvatures is $-4\pi$ on a genus 2 surface, and not all cones have curvatures that are multiples of $2\pi$ (as this case was handled already in Prop.~\ref{prop:fourfold}); thus at least one of these five values has to appear as a subsum. Depending on which curvature sum subset is available in a given set of prescribed cones, the cutgraph pattern needs to be chosen compatibly. For the case that a cone subset with curvature sum $-\nicefrac{\pi}{2}$ is available (as in most practical scenarios), the pattern depicted in Fig.~\ref{fig:gen2val5} can be used; for the remaining patterns refer to Sec.~\ref{app:g2}. Notice that this pattern is a variation of the basic hole chain: two connectors are required to cross. This partitions the surface into a 5-corner region (compatible with a curvature $-\nicefrac{\pi}{2}$ subset) and a 11-corner region (compatible with the remaining cones). The equation systems corresponding to these patterns are easily checked explicitly for non-negative feasibility (cf.~Sec.~\ref{app:g2}). \section{Implementation} \label{sec:implement} We now describe how our algorithm can be implemented for discrete surfaces. Thus, in the following, $M$ represents a closed triangle mesh of arbitrary genus $g$. Cones are prescribed on vertices of $M$; such vertices are called \emph{cone vertices}. \paragraph{General Overview} The overall algorithmic steps are: \begin{enumerate} \item Construct $g$ non-contractible loops and cut $M$ along these loops (Sec.~\ref{sec:61}). \vspace{0.15cm} \item Connect all holes using shortest paths, selecting the connection pattern based on the given genus and cone prescription. If necessary, add one extra path; then cut the mesh (Sec.~\ref{sec:61}). \vspace{0.15cm} \item Set target angles at cone and corner vertices. Compute a corresponding discrete conformal metric (Sec.~\ref{sec:62}). \vspace{0.15cm} \item Number all cut segments and set up the system matrix $A$ and righthand side $\bm{b}$ accordingly (Sec.~\ref{sec:63}). \vspace{0.15cm} \item Compute a solution to the linear system $A\bm{w} = \bm{b}$; add a constant shift to yield a solution $\bm{w} \geq 0$ (Sec.~\ref{sec:63}). \vspace{0.15cm} \item Extend the cutgraph to include all cones; lay out the mesh in the plane according to the metric (Sec.~\ref{sec:64}). \vspace{0.15cm} \item Perform padding according to the computed padding widths~$\bm{w}$ (Sec.~\ref{sec:65}). \vspace{0.15cm} \end{enumerate} In the end, this yields seamless parametrizations with prescribed cones. While the parametric distortion may initially be high, these parametrizations provide the \emph{feasible starting point} required by techniques for injectivity-preserving parametrization distortion optimization (cf.~Sec.~\ref{sec:66}) as well as quadrangulation methods based on quantization of seamless parametrizations. \subsection{Cutgraph} \label{sec:61} On $M$, one option to obtain $g$ non-intersecting non-contractible loops is via handle or tunnel loop algorithms \cite{DeyFW13}, modified to avoid cone vertices. A simpler robust approach is to iteratively cut the mesh $g$ times, each time by an arbitrary non-contractible loop, not containing a cone vertex or a boundary vertex, obtained using the tree-cotree algorithm \cite{Erickson05greedyoptimal}. For the sake of ultimately yielding a cutgraph that is not unnecessarily long and convoluted, it is advisable to pick a short loop each time. For the same reason we construct the connectors as shortest paths, not containing cone, boundary, or other paths' vertices, between the $2g$ holes using Dijkstra's algorithm. A natural ordering of the holes in the chain can be determined using a Hamiltonian path algorithm; this order then needs to be adjusted slightly before the connectors are constructed, to ensure the paired-terminals condition and the odd-couple condition are satisfied (cf.~Sec.~\ref{sec:holechain}). \paragraph{Mesh Refinement} Here and in the following we work with discrete paths/loops, following the edges of the mesh $M$. To be robust regardless of the mesh structure, after each construction of a path we split each mesh edge that is not on a path if its two vertices both are either on the boundary, on a path, or on a cone, thereby ensuring that the mesh, cut by the paths, remains path-connected even in the sense of the discrete edge paths (avoiding boundary, path, and cone vertices) we use here. \paragraph{Extra Cut} The extra cut path (needed for the general genus $g \geq 3$ case) is likewise constructed as a shortest path. However, we need to employ a cone-aware variant of Dijkstra's algorithm in order to ensure cone/corner compatibility, cf.~Eq.~\eqref{eq:gaussdisk}. To this end, to each directed dual edge $e$ of the mesh $M'$ we assign a value $\rho_e$ (with $\rho_e = -\rho_{\bar e}$ for oppositely directed dual edges $e$, $\bar e$) such that the sum of these values clockwise around a single cone vertex $c_i$ is $\hat\Theta_i$, and around non-cone vertices zero. Such an assignment can, for instance, be achieved using a spanning tree of the cones (dashed in Fig.~\ref{fig:periodtree}), rooted at the boundary $\partial M'$: initialize $\rho$ at all leaves of the tree and propagate the values towards the root, summing values where branches meet. \begin{figure}[tb] \centering \begin{overpic}[width=0.99\columnwidth]{periodtree2} \put(12,6.2){\small$\gamma$} \put(2,15.5){\small$\beta$} \put(6,23.5){\small$\frac{\pi}{2}$} \put(13,22.5){\small$-\frac{\pi}{2}$} \put(23,26.9){\small$\frac{\pi}{2}$} \put(28,14){\small$0$} \put(22,8){\small$\frac{\pi}{2}$} \put(29,4){\small$\frac{\pi}{2}$} \put(71,6.2){\small$\gamma$} \put(61,15.5){\small$\beta$} \put(65,23.5){\small$\frac{\pi}{2}$} \put(72,16.5){\small$-\frac{\pi}{2}$} \put(82.3,26.9){\small$\frac{\pi}{2}$} \put(69.2,27.6){\small$\frac{\pi}{2}$} \end{overpic} \vspace{-0.05cm} \caption{Example of holonomy-aware extra path computation. Left: a tree of cones with computed $\rho$-values is shown in black, dashed. Path $\gamma$ from boundary to boundary, crossing two tree branches, has a holonomy value $\sum_\gamma \rho = \nicefrac{\pi}{2}$. This path is closed along the boundary by $\beta$ (with $\sum_\beta\rho = 0$), forming $n=3$ corners. As $\sum_{\gamma+\beta}\rho = \nicefrac{\pi}{2}$ and $n=3$ conforms with Gauss-Bonnet \eqref{eq:gaussdisk}, the path $\gamma$ can be accepted. Right: to illustrate that the tree of cones can be chosen arbitrarily, here the same situation is depicted with a different tree. We have $\sum_{\gamma}\rho = 0$ and $\sum_\beta\rho = \nicefrac{\pi}{2}$, thus again $\sum_{\gamma+\beta}\rho = \nicefrac{\pi}{2}$.} \label{fig:periodtree} \end{figure} Now for an arbitrary simple closed clockwise dual edge path $\gamma$, we have the following important property: $\sum_{e\in\gamma} \rho_e = \sum_{p_i\in\Gamma} \hat\Theta_i$, where $\Gamma$ is the set of all vertices enclosed by $\gamma$ \cite{CraneDS10}. This sum $\sum_{e\in\gamma} \rho_e$ is called, with slight abuse of terminology also for non-closed paths, \emph{holonomy} in the following. Intuitively, the sum $\sum_{e\in\gamma} \rho_e$ along a closed path tells us what total cone curvature is contained in the region enclosed by the path. We then employ Dijkstra's algorithm, starting from a hole segment on $\partial M'$, and keep track of the holonomy values along the way. Whenever Dijkstra's front propagation reaches $\partial M'$ again, we tentatively close the loop by walking back to the starting point clockwise along $\partial M'$, counting passed corners on the way, and checking whether the total holonomy matches the number of corners, cf.\ Sec.~\ref{sec:cg}, Eq.~\eqref{eq:gaussdisk}. If it matches, the path is accepted and added as extra cut. An example is shown in Fig.~\ref{fig:periodtree}. The following needs to be taken into account in this though: Dijkstra's algorithm keeps track of, for each vertex, the shortest path back to the starting point -- regardless of holonomy $\sum \rho$. So while there are shortest paths of different holonomy back to the starting point, Dijkstra's algorithm discards all but the shortest one. We, instead, need to keep track of the shortest path \emph{per vertex per holonomy}. Otherwise paths that could end up having a suitable holonomy in the end, could already be discarded in favor of a shorter path with an unsuitable holonomy. We thus perform Dijkstra's algorithm not on $M'$, but on a branched covering of $M'$, with sheets glued according to $\rho$ \cite{kalberer2007qsp}. In practice this simply means that each triangle stores separate distance information per holonomy class, indexed by the value $\sum \rho$ of incoming fronts. An additional measure needs to be taken because we need $\gamma$ to be simple on $M'$. While the holonomy-aware version of Dijkstra's algorithm yields a path that is simple on the covering, its projection down onto $M'$ may be self-intersecting. Before advancing the front to the next vertex we thus always check whether this vertex is already contained in the predecessor path to prevent such self-intersections. While with this modification one can no longer guarantee that a path is always found, one can always fall back to an explicit path construction following the existence proof in Sec.~\ref{sec:gen3}; we have never encountered a case where this was necessary. \paragraph{Special Cases} The connectors of the special cutgraph patterns employed for genus 1 and genus 2 surfaces are realized using shortest paths as well. These are constructed incrementally between endpoints chosen on the holes, and cross points chosen on other connectors. For those paths that finally split the surface, again the above cone-aware shortest path algorithm is employed to ensure cone/corner compatibility. \subsection{Conformal Map} \label{sec:discconf} \label{sec:62} After cutting $M$ using the cutgraph $G$ to obtain $M'$, for each component of $M'$ (typically one or two, except for some genus 2 cone configurations) we need to obtain a cone metric with rectilinear boundary. This is the one part of the implementation, where -- even though in the continuous case (cf.~Sec.~\ref{sec:conemetrix}) things are rather straightforward -- achieving robustness is actually a challenge. In contrast to the continuous case, questions of existence (or even just precise definition) of \emph{discrete} conformal metrics with prescribed cones and boundary curvature are not entirely settled. For cases without boundary, recent results have brought insight \cite{Luo:2004,Gu:2013,Gu:2014,Springborn:2017}, but the case with boundary requires further work on the theory side. A method for handling the discrete case without boundary was recently described in \cite{Campen:2017:SimilarityMaps}; it combines the elegant method proposed in \cite{Springborn:2008} with on-demand mesh modifications (edge flips, following \cite{Luo:2004}). It can be used for the genus 0 case as is. With a minor extension (as follows) we additionally prescribe geodesic boundary curvature, and find that it works for this case as well. But as mentioned earlier, further work is necessary to determine whether guarantees (regarding general existence, termination, etc.) can be formally established. We remark that our overall seamless parametrization construction does not at all rely on the cone metric being conformal -- this was merely a convenient natural choice for the theoretical considerations -- thus the concrete notion of discrete conformal equivalence employed is irrelevant in our context, which may simplify the situation. The boundary curvature prescription is performed using the holonomy angle constraints offered by this method; however, not for homology loops, but for each boundary vertex's triangle fan, prescribing $\nicefrac{\pi}{2}$ at corners and $\pi$ at all other boundary vertices. Another recently proposed conformal mapping method \cite{Sawhney:2017:BFF} supporting cone and boundary curvature prescription is particularly efficient -- but does not include remeshing capabilities inevitably required for full robustness. One could think about employing a hybrid solution in practice, where the efficient algorithm is tried first while the more general one serves as fallback. Note that, if this is important in a use case, the edge flips which are performed by the conformal metric computation algorithm can ultimately be realized by means of edge splits, as described in \cite{Fisher:2007}. In this way the output mesh is a locally refined version of the input mesh (rather than a mesh with arbitrarily different combinatorial structure) and its embedding is easily preserved. \subsection{Equalization} \label{sec:63} We (arbitrarily) number the segments of $\partial M'$ and set up the system matrix $A$ \eqref{eq:equas} accordingly, with one equation $\eqref{eq:equa}$ for each pair of mates (or equation $\eqref{eq:equaGeneralw}$ where T-nodes are involved, cf.~Sec.~\ref{sec:gen3}). The righthand side $\bm{b}$ is determined by measuring the lengths of the segments under the metric computed in Sec.~\ref{sec:discconf}. Then the linear system $A\bm{w}=\bm{b}$ is solved. As it is underdetermined, we compute the least-norm solution $\bm{w}^*$ via $A^TA\bm{w}=A^T\bm{b}$. The resulting solution $\bm{w}^*$ does not generally satisfy the important non-negativity constraint of problem \eqref{eq:equas}. However: \begin{prop} \label{th:constant} If cutgraph $G$ contains no T-nodes, $\bm{w}^+ = \bm{w}^* + \lambda\bm{1}$, with $\lambda = -\min \bm{w}^*$, satisfies \eqref{eq:equas}, i.e. $A\bm{w}^+=\bm{b}$ and $\bm{w}^+ \geq 0$. \end{prop} \proof{Each equation $\eqref{eq:equa}$, thus each row of $A$, involves two (not necessarily distinct) variables with positive sign and two with negative sign. We thus have $A\bm{1} = \bm{0}$, i.e. globally constant padding (e.g. by width 1) is in the kernel of $A$, it does not affect equalization. Hence, $A\bm{w}^+ = A\bm{w}^* + \lambda A\bm{1} = A\bm{w}^* = b$ for any $\lambda$. With the above choice of $\lambda$, obviously $\bm{w}^+_i \geq 0\,\forall i$.}\qed This means we can add a sufficiently large global value to the initial solution $\bm{w}^*$ in order to obtain a non-negative solution. One class of cutgraphs (cf.~Sec.~\ref{sec:gen3}) contains one extra path that forms two T-nodes. This leads to one or two general equations \eqref{eq:equaGeneralw} with four or six negative variables. Note that the additional negative sign entries correspond to the variables $w_x, w_{x'}$ of the extra path's segments $s_x, s_{x'}$ -- if we removed these variables, each equation would have two positive and two negative variables. Hence, while $A\bm{1} \neq \bm{0}$, we have $A\bm{1'} = \bm{0}$, where $\bm{1'}$ is the vector of ones except for zeroes at positions $x$ and $x'$. Let $\bar A$ be the matrix obtained from $A$ by zeroing the two columns corresponding to $w_x, w_{x'}$. \begin{prop} \label{th:constant} If cutgraph $G$ is a hole chain with extra path, $\bm{w}^+ = \bm{w}^* + \lambda\bm{1'}$, with $\lambda = -\min \bm{w}^*$ and $\bm{w}^*$ the least-norm solution of $\bar A \bm{w} = \bm{b}$, satisfies \eqref{eq:equas}, i.e. $A\bm{w}^+=\bm{b}$ and $\bm{w}^+ \geq 0$. \end{prop} \proof{ $A \bm{w} = \bm{b}$ is feasible with $w_x = w_{x'} = 0$ as proven in Sec.~\ref{sec:eqproof}, thus $\bar A \bm{w} = \bm{b}$ is feasible and $\bm{w}^*$, being a least-norm solution, has $w^*_x = w^*_{x'} = 0$, thus $\bar A \bm{w}^* = A \bm{w}^*$. Hence, $A\bm{w}^+ = A\bm{w}^* + \lambda A\bm{1'} = \bar A\bm{w}^* = \bm{b}$ for any $\lambda$. With the above choice of $\lambda$, obviously $\bm{w}^+_i \geq~0\,\forall i\neq x,x'$, and $w^+_x = w^+_{x'} = 0$.}\qed \subsection{Flattening} \label{sec:64} In order to obtain the map $F$ according to the conformal cone metric, we first need to extend the cutgraph $G$ to $G^T$ (cf.~Sec.~\ref{sec:mtop}). In each component of $M'$ we pick a point $p$ (which is not a corner) on some segment, and compute shortest paths from $p$ to all cones in the component. The union of these paths forms the tree $T$ to extend $G$ to $G^T$. Note that the piecewise-linear form of padding we use in the discrete setting (cf.~Sec.~\ref{sec:65}) does not require $T$ to meet the segment specifically at right angles. The conformal metric computed in Sec.~\ref{sec:discconf} is then flat in all of $M^c$, so its components can be laid out in the plane \cite{Springborn:2008}, isometrically with respect to the metric, to obtain $F$. \begin{figure}[tb] \centering \begin{overpic}[width=0.99\columnwidth]{paddiscrete} \put(10.5,-2){\small a)} \put(36,-2){\small b)} \put(61.5,-2){\small c)} \put(87,-2){\small d)} \end{overpic} \caption{a) Mesh near a segment (top) that is to be padded. b) The strip to be stretched (green) is formed by inserting a straight line into the triangulation (by splitting edges at the intersections), so close to the segment that no vertex is contained. c) The strip is stretched outwards by displacing the vertices that lie on the segment by the desired padding width. d) The vertices on the segment are translated laterally according to $\phi$ (cf.~Sec.~\ref{sec:padding}) to achieve pointwise seamlessness. } \label{fig:paddiscrete} \end{figure} \begin{figure*}[t] \centering \begin{overpic}[width=0.99\linewidth]{80torusB.png} \end{overpic} \vspace{-0.25cm} \caption{A locally injective seamless map generated on an 80-torus.} \label{fig:80torus} \vspace{-0.2cm} \end{figure*} \begin{figure}[b] \vspace{-0.1cm} \centering \begin{overpic}[width=0.99\linewidth]{highgenANDrandom2.png} \end{overpic} \vspace{-0.2cm} \caption{Left: example map generated on a topologically complex surface. Right: Example map generated with geometrically non-meaningful cone prescription (here: 50 randomly distributed cones of curvatures $\pi$ and $-\pi$).} \label{fig:random} \end{figure} \begin{figure*}[t] \centering \begin{overpic}[width=0.91\linewidth]{results3.png} \end{overpic} \caption{Visualization of a variety of locally injective seamless parametrizations obtained using our method} \label{fig:results} \vspace{-0.5cm} \end{figure*} \subsection{Padding} \label{sec:65} The padding operation described in Sec.~\ref{sec:pad1} can easily be performed in a piecewise linear setting as illustrated in Fig.~\ref{fig:paddiscrete}: After inserting a parametrically straight line into the mesh $M$ along a segment (such that no vertex is contained in the resulting strip), the stretching and lateral shifting can be performed by simply relocating those vertices that are on the segment. Note that, as no vertices lie in the strip, the mesh within the rectangular strip is a simple triangle strip and laterally translating the segment vertices does not cause triangle inversions as long as their order is preserved -- which is the case with the reparametrization $\phi$ (cf.~Sec.~\ref{sec:padding}). We note that the resulting seamless parametrization is not of immediate practical use: the scale distortion involved in the conformal map together with the additional padding-induced stretching often leads to high parametric distortion. This map, however, provides the valid (locally injective and seamless) starting point required by robust optimization methods that can convert it to a low-distortion parametrization (to the extend permitted by the cone prescription) as detailed in the following. \subsection{Distortion Optimization} \label{sec:66} For the optimization of the seamless padded map, in our implementation we use the symmetric Dirichlet energy together with quadratic proxies for efficiency as described in \cite{Rabinovich:2017:SLI}. This method preserves local injectivity during optimization by design, and we additionally impose linear seamlessness constraints to preserve seamlessness of the map: $$\vec{e_i} = R^{k_{ij}\frac{\pi}{2}}\vec{e_j}\quad\text{for each pair $(i,j)$ of identified mesh edges},$$ where $\vec{e_i}$ is the edge vector of edge $i$ in the parametric domain, and $R^{k_{ij}\frac{\pi}{2}}$ is a rotation by $k_{ij}\frac{\pi}{2}$, where the constant integer $k_{ij}$ is determined by the edges' relative initial orientation in the domain. In essence, our method provides the feasible starting point required by such nonconvex distortion minimization techniques. \section{Examples} We demonstrate our implementation of the presented algorithm on a number of examples. Figure \ref{fig:results} shows a visualization of the seamless parametrizations constructed on models from the dataset provided by Myles et al.~\shortcite{Myles:2014}. We employed the cone position and angle prescriptions provided with that dataset. Figure \ref{fig:random} demonstrates the algorithm handling topologically complex surfaces as well as randomly prescribed singularities. In all cases locally injective seamless global parametrization were obtained. Note that seamless does not mean that cuts are not visible in these checkerboard visualizations; for this the maps would additionally need to be quantized \cite{CampenBK15} -- a process for which our method provides a suitable initialization. In order to explore the numeric limits of our implementation, we applied it to $N$-tori, for increasing $N$. For an 80-torus, as depicted in Figure \ref{fig:80torus}, the implementation succeeds; for a 100-torus we are still able to obtain an initial seamless map -- however, with a level of distortion that state-of-the-art local injectivity preserving optimization methods prove to have trouble with, due to numerical precision issues. For even larger $N$, the computation of the constrained conformal map starts to occasionally suffer from numerical issues (e.g. step size going down to numerically zero) as well. Investigation of such numerical aspects of map optimization in high distortion cases is an important direction for future research. \section{Conclusion and Future Work} \label{sec:conclusion} This paper provides a general path to obtaining seamless parametrizations with a given set of cones. On a conceptual level the approach is simple (just pad a cut-aligned map), and we hope it provides some new insights into how global parametrizations can be constructed. A conceptual limitation in its current form is its unawareness of holonomy angles on homology loops (in addition to local cone angles), which, for instance, is important for parametrizations following a global guiding field. We expect that by using different forms of cutgraph construction, based on given global holonomy angles, many of the ideas herein will be applicable to such a setting as well; we plan to address this is a separate paper. Related directions of future work include generalization to surfaces with boundaries as well as aligning to tagged feature curves or other prescribed directions on the surface. In the smooth setting, our algorithm is guaranteed to always yield a valid, locally injective seamless parametrization. In practice, numerical optimization routines notoriously bring about challenges due to numerical precision limits, which applies here to the discrete conformal map computation. As in this discrete setting there furthermore are some unclarities concerning definition and existence of general conformal maps, a potential path could be the replacement of this initial map computation with a different technique -- exploiting the fact that conformality is not actually required. \vspace{-0.05cm} \begin{acks} H. Shen and D. Zorin are supported by awards NSF IIS-1320635, NSF DMS-1436591, and a gift from Adobe; J. Zhou by a CSC scholarship. \end{acks} \vspace{-0.05cm} \bibliographystyle{ACM-Reference-Format}
{'timestamp': '2018-10-08T02:04:11', 'yymm': '1810', 'arxiv_id': '1810.02460', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02460'}
arxiv
\section{Introduction} \label{sec:intro} \IEEEPARstart{P}{refix}-free codes are commonly used in lossless data compression to reduce the number of code symbols to describe information symbols, such that the original information symbols can be completely reconstructed from the code symbols. Optimal prefix-free coding that achieves the minimum number of code symbols transforms information symbols of a non-uniform probability distribution into code symbols of a uniform probability distribution. In this work, prefix-free codes perform a reverse operation called \emph{distribution matching (DM)}; namely, it transforms information symbols of a uniform probability distribution to code symbols of a desired probability distribution. In particular, we restrict information symbols to bits $b\in\mathcal{B}:=\{0,1\}$ drawn with equal probabilities $\mathbb{P}(b=0) = \mathbb{P}(b=1)= 0.5$, and construct prefix-free codes with a unipolar $M$-ary amplitude shift keying ($M$-ASK) code alphabet $\mathcal{X}_{M\textrm{-ASK}} = \{1,3,\ldots,2M-1\}$. Defining the \emph{resolution rate} as the expected number of information bits per code symbol\cite{Bocherer13fixed}, the constructed prefix-free codes have the minimum or near-minimum average symbol energy among all possible prefix-free codes of the same cardinality for the same resolution rate. We also propose a \emph{framing} method, with which variable-length prefix-free codewords can always be contained in a fixed-length frame, thereby facilitating application of prefix-free codes to communications. A prominent application of \emph{prefix-free code distribution matching (PCDM)} is \emph{probabilistic constellation shaping (PCS)} for capacity-approaching communications. PCS makes low-energy symbols in the code alphabet appear with a higher probability than high-energy symbols, thereby reducing the average transmit energy for the same \emph{information rate (IR)} \cite{Tunstall67,Varn71,Hu71,Forney84 ,Calderbank90,Forney92,Livingston92 ,Kschischang93,Raphaeli04,Kaimalettu07,Valenti12}. A long-standing challenge of PCS has been the incorporation of forward error correction (FEC) coding and DM. If DM is embedded between FEC encoding and decoding, errors occurred in the channel can be significantly boosted in the DM decoding process, thereby rendering the outer FEC coding unsuccessful. For the case of variable-length DM, even a single error can cause insertion or deletion of information symbols, leading to synchronization errors or catastrophic propagation of errors. In a reversed architecture where FEC coding is embedded between DM encoding and decoding, a symbol distribution formed by DM encoding is not preserved by the subsequent FEC encoding, since (linear) FEC encoding generates almost equiprobable code symbols from information bits of any distribution. There have been approaches to jointly optimizing FEC and DM \cite{Forney92,Raphaeli04,Kaimalettu07,Valenti12}, but they lack rate adaptability and involve the design of customized FEC codes. Recently, however, an architecture called \emph{probabilistic amplitude shaping (PAS)} \cite{Bocherer15} solved the problem. In the PAS architecture, information bits are first encoded by DM to produce \emph{amplitudes} of transmit symbols with a desired probability distribution, then a following systematic FEC encoder generates parity bits that constitute \emph{signs} of the transmit symbols. In this manner, the amplitude distribution remains unchanged by equiprobable parity bits, and the error propagation and synchronization errors do not occur since FEC decoding corrects errors before DM decoding. PAS enables separate design of FEC and DM, hence allows for the use of off-the-shelf FEC codes in conjunction with independently optimized DM. In this paper, the performance of the proposed PCDM in communication systems will be numerically evaluated using the PAS architecture in comparison with the conventional communication schemes whose transmit symbols are uniformly distributed. \section{Prior Works} \label{sec:prior_works} \subsection{Fixed-Length DMs} The $m$-out-of-$n$ coding~\cite{ramabadran1990coding} and the constant composition DM (CCDM)~\cite{Schulte16} are fixed-to-fixed length (F2F) DMs that realize a target code symbol distribution on a block-by-block basis using arithmetic coding. The CCDM was shown to be asymptotically optimal in the sense that the normalized Kullback-Leibler (KL) divergence between the desired and realized symbol distributions vanishes as the block length goes to infinity~\cite{Schulte16}. The computational complexity of CCDM increases linearly with the block length, making it possible to use a very large block length to closely approach the asymptotic performance. However, CCDM requires high-precision multiplications and divisions. In~\cite{Fehenberger18multiset}, the multiset partitioning DM (MPDM) was proposed to enhance the degrading performance of CCDM in small blocks, by letting CCDM create different symbol distributions across multiple blocks that are averaged to the target distribution. For a small block length, typically below 100 symbols, there have been algorithmic approaches to implement an F2F DM, such as the shell mapping~\cite{lang1989leech,laroia1994optimal,Schulte18shell} and the enumerative sphere shaping~\cite{Gultekin17}. The algorithmic approaches substantially reduced the complexity of indexing a point in a sphere, by divide and conquer~\cite{lang1989leech,laroia1994optimal,Schulte18shell} or dynamic programming\cite{Gultekin17}, which is otherwise exponential in the dimension. Nevertheless, their complexity is polynomial in the dimension, e.g., quadratic for the Algorithm 2 of~\cite{laroia1994optimal}, hence a large block length cannot be used. More recently, an F2F DM was realized in~\cite{Yoshida18low} by using a distribution uniformizer that makes all the symbols in a code alphabet appear the same number of times in each block, followed by run-length coding that transforms the uniform distribution into a non-uniform target distribution. \subsection{Variable-Length PCDM} It was recently shown that F2F DMs like $m$-out-of-$n$~\cite{ramabadran1990coding} and CCDM~\cite{Schulte16} cannot fundamentally eliminate the \emph{un}-normalized KL divergence between the desired and realized symbol distributions~\cite{schulte2017divergence}. On the other hand, \emph{variable-length} may achieve zero \emph{un}-normalized KL divergence~\cite{Bocherer13fixed}. Importantly, variable-length PCDM has a linear complexity in the dimension, as in CCDM and the run-length coding~\cite{Yoshida18low}, hence can be realized in large dimensions to achieve zero un-normalized KL divergences. Furthermore, unlike the $m$-out-of-$n$ or CCDM, PCDM does not require high-precision arithmetic. To this end, we limit the scope to variable-length prefix-free codes and study the construction of prefix-free codes for rate-adaptable PCDM throughout the paper. Let $\bm{b}$ and $\bm{x}$, respectively, denote a concatenation of an indefinite number of information symbols drawn from the binary alphabet $\mathcal{B}$ and a concatenation of an indefinite number of code symbols drawn from the ASK alphabet $\mathcal{X}$. Then, a \emph{code} $\mathcal{C}: \bmcal{B} \mapsto \bmcal{X} $ defines a \emph{bijective} function that maps every information word $\bm{b}$ in the \emph{dictionary} $\bmcal{B}$ to a codeword $\bm{x}$ in the \emph{codebook} $\bmcal{X}$. If the codeword $\bm{x} \in \bmcal{X}$ is an ordered concatenation of two words $\bm{x}_{\mathrm{pre}}$ and $\bm{x}'$, then $\bm{x}_{\mathrm{pre}}$ is called a \emph{prefix} of the word $\bm{x}$. A code is a \emph{prefix-free code} if any codeword $\bm{x} \in \bmcal{X}$ is not a prefix of another codeword. A prefix-free code is an \emph{instantaneously decodable code}, whose decoding can be performed as immediately as a codeword is found on successive receipt of the code symbols. In a special case where all code symbols in $\mathcal{X}$ have equal transmit energies, and if the information word distribution is known a priori, \emph{Huffman codes} represent optimal prefix-free codes in the sense that no other codes can produce a shorter expected codeword length, hence a smaller average code symbol energy. In a more general case where the energies of symbols in $\mathcal{X}$ are not necessarily equal, the prefix-free code construction problem has been addressed in the context of PCS~\cite{Abrahams98}, using \emph{Lempel-Even-Cohn (LEC)} coding~\cite{Lempel73} and \emph{Varn} coding~\cite{Varn71}. LEC coding solves the problem when all codewords have an equal length. LEC coding is isomorphic to Huffman coding if we convert the energy of a codeword into the probability of the corresponding information word. A Huffman codebook therefore becomes the LEC dictionary for parsing information bits, mapped to an LEC codebook that consists of equal-length codewords, completing a \emph{variable-to-fixed length (V2F)} code. However, while we want to minimize the energy per \emph{code} symbol for arbitrary resolution rates, LEC coding minimizes the energy per \emph{information} symbol, and its resolution rate is determined by the Huffman codebook that is given \emph{a priori}. Varn coding provides another solution when information words have an equal length, hence constructing \emph{fixed-to-variable length (F2V)} codes. However, Varn coding requires a non-uniform probability mass function (PMF) for the equal-length information words, which must be given \emph{a priori} to realize a particular resolution rate. Another approach to constructing F2V codes is by minimizing the KL divergence between the desired and realized PMFs for a binary code alphabet \cite{Amjad13}, which also assumes \emph{a priori} knowledge of the optimal PMF for the target resolution rate. In general cases where both information words and codewords can have unequal lengths, there are known algorithms to construct optimal prefix-free codes \cite{Hu71,Choi96,Golin96,Golin98,Golin08} using, e.g., dynamic programming \cite{Golin98,Golin08}. However, they require unequal probabilities of the information symbols that must be given \emph{a priori}, and the resulting codes are optimal only in the sense that they minimize the average \emph{codeword} energy, without taking into account the resolution rate. To the best of our knowledge, none of the existing approaches addressed the problem of constructing prefix-free codes to minimize the average code symbol energy for arbitrary target resolution rates. \section{Prefix-Free Codes for Various Resolution Rates} \label{sec:codes} \begin{table}[!t] \caption{Examples of prefix-free codes for 2-ASK code alphabet} \label{tab:examples} \centering \vspace*{-1em} \includegraphics[width=3.35in]{table1} \end{table} \begin{figure}[!t] \centering \includegraphics[width=3.3in]{fig_trees.pdf} \caption{Root-concatenated trees representing the codes in Tab.~\ref{tab:examples}.} \label{fig:trees} \end{figure} Let $\bm{b}_n$ and $\bm{x}_n$ denote the $n$-th information word in $\bmcal{B}$ and the $n$-th codeword in $\bmcal{X}$, respectively, and let $l(\bm{a})$ denote the length of string $\bm{a}$. Since mapping~$\mathcal{C}$ is bijective, we abuse notation to write $|\mathcal{C}|=|\bmcal{B}|=|\bmcal{X}|$. Table~\ref{tab:examples} shows examples of V2F, F2V, and V2V codes with $|\mathcal{C}|=8$, for the 2-ASK code alphabet $\mathcal{X}_{2\textrm{-ASK}} = \{1,3\}$. Let $\bm{l}(\bmcal{B}) := [l(\bm{b}_1), \ldots, l(\bm{b}_{N})]$ with $N = |\mathcal{C}|$ denote an information word length vector, $\bm{l}(\bmcal{X}) := [l(\bm{x}_1), \ldots, l(\bm{x}_{N})]$ a codeword length vector, and $\bm{e}(\bmcal{X}) := [||\bm{x}_1||^2, \ldots, ||\bm{x}_{N}||^2]$ a codeword energy vector. For example, the V2V code in Table~\ref{tab:examples}(c) has $\bm{l}(\bmcal{B}) = [1, 3, 3, 3, 4, 5, 6, 6]$, $\bm{l}(\bmcal{X}) = [7, 7, 6, 5, 4, 3, 2, 1]$, and $\bm{e}(\bmcal{X}) = [7, 15, 14, 13, 12, 11, 10, 9]$. The tree diagrams for the codes in Table~\ref{tab:examples} are depicted in Fig.~\ref{fig:trees}, where double circles, open circles, and closed circles represent the root nodes, branch nodes, and leaf nodes, respectively, which will be defined below. A code is formed by concatenating the roots of two \emph{ordered} trees, which we call \emph{left} and \emph{right trees} depending on their relative position. We use the following terminologies throughout the paper to describe the structure of a right tree (defined in a similar fashion for a left tree): \begin{itemize} \item \emph{Root}: The left-most node of a tree. \item \emph{Child}: A node directly connected to the right of a node. \item \emph{Parent}: The converse of a child. \item \emph{Siblings}: A group of nodes with the same parent. \item \emph{Branch}: A node with at least one child. \item \emph{Leaf}: A node with no children. \item \emph{Degree}: The number of children of a node. \item \emph{Path}: A sequence of nodes and edges connecting a node with another node. \item \emph{Depth}: The depth of a node is the number of edges from the root node to the node, i.e., the path length connecting the root node and the node. \item \emph{Height}: The height of a tree is the longest path length between the root and leaves. \item \emph{Size}: The size of a tree is the number of all leaf nodes of the tree. \end{itemize} The $n$-th leaf of a left tree represents the information word $\bm{b}_n$ and that of a right tree represents the codeword $\bm{x}_n$. The depth of the $n$-th leaf equals $l(\bm{b}_n)$ (in the left tree) or $l(\bm{x}_n)$ (in the right tree), and the probability mass vector of the leaves is given by $\bm{p} = [p_1,\ldots,p_N]^T$, with $p_n = \mathbb{P}_{\bm{B}}(\bm{b}_n) = \mathbb{P}_{\bm{X}}(\bm{x}_n)$. Prefix-free code encoding is a random process that parses a random variable $\bm{B}$ which takes values $\bm{b}\in{\bmcal{B}}$ to produce a codeword $\bm{X} = \mathcal{C}(\bm{B}) \in \bmcal{X}$. Since our information bits are assumed to be independent and equiprobable, the probability of information words is \emph{dyadic}, i.e., $\mathbb{P}_{\bm{B}}(\bm{b}) = 2^{-l(\bm{b})}$ with $\sum_{\bm{b} \in \bmcal{B}} \mathbb{P}_{\bm{B}}(\bm{b}) = 1$. Therefore, the expected symbol energy can be calculated as \begin{align*} \mathsf{E}(\bmcal{B,X}) &:= \frac{\mathbb{E}(||\bm{X}||^2)}{\mathbb{E}(l(\bm{X}))} = \frac{\sum_{\bm{x}\in\bmcal{X}} 2^{-l(\mathcal{C}^{-1}(\bm{x}))} ||\bm{x}||^2}{\sum_{\bm{x}\in\bmcal{X}} 2^{-l(\mathcal{C}^{-1}(\bm{x}))} l(\bm{x})}, \eqnum \label{eqn:E} \end{align*} where $\mathbb{E}(\cdot)$ denotes expectation. The resolution rate of this code can be calculated as \begin{align*} \mathsf{R}(\bmcal{B,X}) &:= \frac{\mathbb{E}(l(\bm{B}))}{\mathbb{E}(l(\bm{X}))} = \frac{\sum_{\bm{b}\in\bmcal{B}} 2^{-l(\bm{b})} l(\bm{b})}{\sum_{\bm{x}\in\bmcal{X}} 2^{-l(\mathcal{C}^{-1}(\bm{x}))} l(\bm{x})}. \eqnum \label{eqn:R} \end{align*} Since it is apparent that $\mathsf{E}(\bmcal{B,X})$ and $\mathsf{R}(\bmcal{B,X})$ are functions of $\bmcal{B}$ and $\bmcal{X}$, we henceforth omit the arguments and denote them by $\mathsf{E}_\mathcal{C}$ and $\mathsf{R}_\mathcal{C}$ for simplicity. The bijection $\mathcal{C}$ is immediately defined from the ordered sets $\bmcal{B}$ and $\bmcal{X}$, hence the optimal prefix-free coding problem for a target resolution rate $\mathsf{R}^*$ can be written as \begin{align*} \begin{array}{ll} \underset{\bmcal{B},\bmcal{X}}{\text{minimize}} & \mathsf{E}_\mathcal{C} \eqnum \label{eqn:optimize_E} \\ \text{subject to} & \mathsf{R}_\mathcal{C} \geq \mathsf{R}^*, \\ [-0.2ex] & \bmcal{B}\text{ and }\bmcal{X} \text{ are left and right trees, respectively.} \end{array} \end{align*} The resolution rate is upper-bounded as $\mathsf{R}_\mathcal{C} \leq \mathbb{H}(X)$, where $X$ denotes an independent and identically distributed (IID) random variable that takes values in $\mathcal{X}$ according to the same distribution as the prefix-free code symbols, and where $\mathbb{H}(X)$ denotes the entropy of $X$. Under an average energy constraint, the entropy is maximized by the Maxwell-Boltzmann (MB) distribution\cite{Kschischang93} $\mathbb{P}_{X}(x) := \exp(-\lambda |x|^2) / \sum_{x\in\mathcal{X}} \exp(-\lambda |x|^2), \lambda \geq 0$. Conversely, the average symbol energy $\mathbb{E}(|X|^2)$ is minimized by the MB distribution to achieve a target entropy $\mathbb{H}(X)$. Therefore, if we denote by $X_{\text{MB}}$ an IID random variable drawn according to the MB distribution that fulfills $\mathbb{H}(X) = \mathsf{R}_\mathcal{C}$, we obtain a lower bound of the average symbol energy to achieve the resolution rate $\mathsf{R}_\mathcal{C}$ as $\mathsf{E}_\mathcal{C} \geq \mathbb{E}(|X_{\text{MB}}|^2)$. The energy efficiency of a prefix-free code that achieves $\mathsf{R}_\mathcal{C}$ can therefore be evaluated by the \emph{energy gap} defined as \begin{align*} \mathsf{E}_{\text{Gap}} := \mathsf{E}_\mathcal{C} / \mathbb{E}(|X_{\text{MB}}|^2). \label{eqn:E_gap} \end{align*} \subsection{V2F Codes} To solve problem \eqref{eqn:optimize_E}, we begin with a \emph{balanced} $M$-ary right tree, i.e., a right tree in which every branch has $M$ children and every leaf is at the same depth (see the right tree of Fig.~\ref{fig:trees}~(a)), which represents a codebook $\bmcal{X}$ with a fixed codeword length $l(\bm{x}) = v$ for all $\bm{x}\in\bmcal{X}$. Then, the codebook can immediately be obtained from the fixed codeword length $v$ by lexicographical ordering as $\bmcal{X}_v = \mathcal{X}_{M\textrm{-ASK}}^{v}$, and $|\mathcal{C}| = M^v$. In this case, \eqref{eqn:E} and \eqref{eqn:R} degenerate, respectively, to \begin{align} \mathsf{E}_\mathcal{C} = \mathbb{E}(||\bm{X}||^2)/v \end{align} and \begin{align} \mathsf{R}_\mathcal{C} = \mathbb{E}(l(\bm{B})) / v = \mathbb{H}(\bm{X})/v, \end{align} where the last equation holds since $\mathbb{P}_{\bm{X}}$ is dyadic. Therefore, for V2F codes, minimizing the average code symbol energy is equivalent to minimizing the average codeword energy. Also, maximizing $\mathsf{R}_\mathcal{C}$ subject to $\mathsf{E}_\mathcal{C} \leq \mathsf{E}^*$ is equivalent to maximizing $\mathbb{H}(\bm{X})$ subject to $\mathbb{E}(||\bm{X}||^2) \leq v\mathsf{E}^*$. \begin{figure}[!t] \centering \subfloat[][]{\!\includegraphics[width=0.47\linewidth]{fig_lambda_E}\label{fig:v2f_ghc_a}}% \quad \subfloat[][]{\!\includegraphics[width=0.47\linewidth]{fig_lambda_R}\label{fig:v2f_ghc_b}} \caption{(a) Average symbol energy of a continuous MB PMF (dashed lines) and its dyadic approximation (solid lines) divided by that of a uniform PMF $\mathsf{E}_{\text{U}}$, and (b) the corresponding entropy rate. The codewords are taken from Tab.~\ref{tab:examples}(a). \label{fig:v2f_ghc} \end{figure} If we waive the dyadic constraint on $\mathbb{P}_{\bm{X}}$, the entropy $\mathbb{H}(\bm{X})$ is maximized by $\bm{X}_{\text{MB}}$ that follows an MB distribution $\mathbb{P}_{\bm{X}_{\text{MB}}}(\bm{x}) := \exp(-\lambda ||\bm{x}||^2) / \sum_{\bm{x}\in\bmcal{\bm{X}}} \exp(-\lambda ||\bm{x}||^2)$. Note that $\bm{X}_{\text{MB}}$ is a random vector, whereas $X_{\text{MB}}$ in \eqref{eqn:E_gap} is a random scalar. Since $||\bm{x}||^2 = \sum_{x\in\bm{x}}|x|^2$, we have that $\mathbb{P}_{\bm{X}_{\text{MB}}}(\bm{x}) = \prod_{x\in{\bm{x}}}\mathbb{P}_{X_{\text{MB}}}(x)$. We also have that $\mathbb{H}(\bm{X}_{\text{MB}}) = v \mathbb{H}(X_{\text{MB}})$. Therefore, if a dictionary $\bmcal{B}$ can make the codewords $\bm{X}$ follow the distribution $\mathbb{P}_{\bm{X}_{\text{MB}}}$, the code achieves both $\mathsf{E}_\mathcal{C} = \mathbb{E}(|X_{\text{MB}}|^2)$ and $\mathsf{R}_\mathcal{C} = \mathbb{H}(X_{\text{MB}})$. Indeed, LEC coding \cite{Lempel73} is optimal in the sense that it yields a special instance of the MB distribution, for which the rate parameter is given by $\lambda = \log(\beta)$ with $\beta$ being a root of the characteristic condition $\sum_{\bm{x}\in\bmcal{X}} \beta^{-||\bm{x}||^2} = 1$. The dashed curves in Fig.~\ref{fig:v2f_ghc}~(a) and (b) show the average symbol energy and the entropy rate of $X_{\text{MB}}$ as a strictly monotonically decreasing function of $\lambda$ (this is true in general, see \cite[Section~5.C]{Bocherer15}), obtained from the codewords of Tab.~\ref{tab:examples}~(a). Due to the monotonicity, the rate parameter $\lambda$ of the MB PMF $\mathbb{P}_{\bm{X}_\text{MB}}$ that leads to the minimum average symbol energy $\mathbb{E}(|X_{\text{MB}}|^2)$ subject to the rate constraint $\mathbb{H}(X_{\text{MB}}) = \mathsf{R}^*$ can simply be obtained by the \emph{bisection} method. Once we obtain $\mathbb{P}_{\bm{X}_\text{MB}}$, its optimal dyadic approximate $\mathbb{P}_{\widetilde{\bm{X}}_\text{MB}}$ can be obtained by \emph{Geometric Huffman coding (GHC)}~\cite{Bocherer11}, i.e., $\mathbb{P}_{\widetilde{\bm{X}}_\text{MB}} = \text{GHC} (\mathbb{P}_{\bm{X}_\text{MB}})$, optimal in the sense that it minimizes the KL divergence $\mathbb{D}( \mathbb{P}_{\widetilde{\bm{X}}_\text{MB}} \| \mathbb{P}_{\bm{X}_\text{MB}}) := \sum_{ \bm{x} \in \bmcal{X} } \mathbb{P}_{\widetilde{\bm{X}}_\text{MB}}(\bm{x}) \log_2 \frac{\mathbb{P}_{\widetilde{\bm{X}}_\text{MB}}(\bm{x}) } {\mathbb{P}_{\bm{X}_\text{MB}}(\bm{x})}$. Notice that, since $\mathcal{X}$ and $v$ completely define the right tree $\bmcal{X}_v$, the PMF $\mathbb{P}_{\bm{X}_\text{MB}}$ can immediately be obtained for an arbitrary target resolution rate $\mathsf{R}^*$, using a series of operations $(\mathcal{X}, v, \mathsf{R}^*) \mapsto \mathbb{P}_{\bm{X}_\text{MB}} \mapsto \mathbb{P}_{\widetilde{\bm{X}}_\text{MB}} \mapsto (\bmcal{B},\bmcal{X}_v)$. The solid lines in Fig.~\ref{fig:v2f_ghc} show the average symbol energy and resolution rate that can be obtained using this method for $\mathcal{X}_{2\text{-ASK}}$ with $v=3$. In this example, there are only five non-zero distinct resolution rates generated by the dyadic PMF $\mathbb{P}_{\widetilde{\bm{X}}_\text{MB}}$. \begin{figure}[!t] \centering \!\! \includegraphics[width=1.00\linewidth]{fig_v2f_gap_2ask}\label{fig:v2f_gap_a} \\[1.25em] \includegraphics[width=1.00\linewidth]{fig_v2f_gap_4ask}\label{fig:v2f_gap_b} \\[1.25em] \includegraphics[width=1.00\linewidth]{fig_v2f_gap_8ask}\label{fig:v2f_gap_c} \\[1.25em] \includegraphics[width=1.00\linewidth]{fig_v2f_gap_16ask}\label{fig:v2f_gap_d} \caption{Energy gap of V2F codes with $|\mathcal{C}| \leq 4096$ for the (a) 2-ASK, (b) 4-ASK, (c) 8-ASK, and (d) 16-ASK alphabets. \label{fig:v2f_gap} \end{figure} {However, as $v$ increases, the created codes have much finer granularity of the resolution rate}, as shown in Fig.~\ref{fig:v2f_gap} for up to the 16-ASK alphabet (producing up to the 1024-QAM in the PAS architecture). Here, we find all V2F codes of the cardinality $|\mathcal{C}| \leq 4096$ for the target resolution rates $\mathsf{R}^* \in \{\Delta,2\Delta,\ldots,\log_2 M\}$ with rate granularity $\Delta = 0.001$. The codes have less finer granularity of the resolution rate in the lower resolution rate regime, which can be supplemented by allowing variable codeword lengths, as will be discussed in Section~\ref{sec:v2v}. Figure~\ref{fig:v2f_gap} shows that the constructed V2F codes achieve energy gaps smaller than 0.1~dB across a wide range of resolution rates with a cardinality $|\mathcal{C}| \leq 4096$, or even $|\mathcal{C}| \leq 64$ for $M \leq 4$. \subsection{F2V Codes} For F2V codes, we consider a balanced binary left tree representing a dictionary $\bmcal{B}$ with a fixed information word length $l(\bm{b}) = u$ for all $\bm{b}\in \bmcal{B}$ such that $|\mathcal{C}| = 2^u$. Then, the dictionary $\bmcal{B}_u$ can be immediately obtained by lexicographical ordering of $\mathcal{B}^u$, and all the information words $\bm{b}\in\bmcal{B}_u$ are parsed to the codewords $\bm{x} \in \bmcal{X}$ with the equal probability $\mathbb{P}_{\bm{B}}(\bm{b}) = 2^{-u}$. Let us define the \emph{sum depth} and \emph{sum energy} of a right tree as $l(\bmcal{X}) := \sum_{\bm{x}\in\bmcal{X}} l(\bm{x})$ and $||\bmcal{X}||^2 := \sum_{\bm{x}\in\bmcal{X}} ||\bm{x}||^2$, respectively. Then, the average symbol energy and the resolution rate of the code are calculated, respectively, as \begin{align*} \mathsf{E}_\mathcal{C} = \frac{\mathbb{E}(||\bm{X}||^2)}{\mathbb{E}(l(\bm{X}))} = \frac{\sum_{\bm{x}\in\bmcal{X}}2^{-u}||\bm{x}||^2}{\sum_{\bm{x}\in\bmcal{X}}2^{-u}l(\bm{x})} = \frac{||\bmcal{X}||^2}{l(\bmcal{X})}, \eqnum \label{eqn:E_f2v} \end{align*} and \begin{align*} \mathsf{R}_\mathcal{C} = \frac{\mathbb{E}(l(\bm{B}))}{\mathbb{E}(l(\bm{X}))} = \frac{u}{\sum_{\bm{x}\in\bmcal{X}}2^{-u}l(\bm{x})} = \frac{2^{u} u}{l(\bmcal{X})}. \eqnum \label{eqn:R_f2v} \end{align*} \begin{figure}[!t] \centering \subfloat[][]{\!\includegraphics[width=0.97\linewidth]{fig_1plus_trees}\label{fig:Lplus_trees_a}}\\[0.5em] \subfloat[][]{\!\includegraphics[width=0.97\linewidth]{fig_2plus_trees}\label{fig:Lplus_trees_b}} \caption{All $L^+$-trees in $\bm{\Psi}(N)$ with the 2-ASK alphabet for (a) $L = 1, N = 1$, and (b) $L=2, N \leq 4$. \label{fig:Lplus_trees} \end{figure} We do not know of any existing method that can solve~\eqref{eqn:optimize_E} with \eqref{eqn:E_f2v} and \eqref{eqn:R_f2v} for an arbitrary desired $\mathsf{R}^*$. In this paper, therefore, instead of directly solving the problem for a particular $\mathsf{R}^*$, we try to identify a set of trees that produces all possible sum depths $l(\bmcal{X})$ under a tree size constraint $|\bmcal{X}|=u$, hence realizing all possible $\mathsf{R}_\mathcal{C}$ according to~\eqref{eqn:R_f2v}. The constructed trees are optimal in the sense that they have the minimum sum energy $||\bmcal{X}||^2$ among all $2^+$-trees with the same sum depth~$l(\bmcal{X})$, where $L^+$-tree is a tree in which every node except leaves has a degree not smaller than $L$. This further implies that the tree achieves the minimum average symbol energy $\mathsf{E}_\mathcal{C}$ for the given $l(\bmcal{X})$ and $\mathsf{R}_\mathcal{C}$ due to \eqref{eqn:E_f2v} and \eqref{eqn:R_f2v}. Indeed, any $1^+$-tree is allowed for a right tree; however, we restrict the type of trees to $2^+$-trees to avoid infinite tree expansion (see Fig.~\ref{fig:Lplus_trees}~(a) for example). In Fig.~\ref{fig:Lplus_trees}, and throughout the paper, $\mathcal{T}(N)$ denotes a right tree that has $N$ leaves, i.e., $|\bmcal{X}|=N$, $\mathcal{T}(N,\nu)$ is a tree $\mathcal{T}(N)$ whose sum depth $l(\bmcal{X})=v$, and $\mathcal{T}(N,\nu,\omega)$ is a tree $\mathcal{T}(N,\nu)$ whose sum energy $||\bmcal{X}||^2=\omega$. Also, let $\bm{\Psi}(N)$ and $\bm{\Psi}(N,\nu)$ be the sets of all trees $\mathcal{T}(N)$ and $\mathcal{T}(N,\nu)$, respectively. Then, by \eqref{eqn:E_f2v} and \eqref{eqn:R_f2v}, all trees in $\bm{\Psi}(N,\nu)$ lead to the same $\mathsf{R}_\mathcal{C}$ but not necessarily the same $\mathsf{E}_\mathcal{C}$. Since a distinct sum depth $\nu$ generates a distinct $\mathsf{R}_\mathcal{C} = 2^u u/\nu$ for the fixed $u$, we have as many optimal trees as the number of distinct sum depths of trees in $\bm{\Psi}(N)$, where an optimal tree with sum depth $\nu$ is defined as $\mathcal{T}^* (N,\nu) = \argmin_{\mathcal{T} (N,\nu) \in \bm{\Psi}(N,\nu)} ||\bmcal{X}||^2$. A brute-force search of $\mathcal{T}^* (N,\nu)$ in $\bm{\Psi}(N)$ requires exponential time in $N$. There are known problems that are isomorphic to the problem of counting the number of all trees in $\bm{\Psi}(N)$, including the parenthesizations counting problem \cite[Ch.~15.2]{Cormen01}. For example, the trees in $\bm{\Psi}(4)$ of Fig.~\ref{fig:Lplus_trees}~(b) have isomorphic representations of $((13)(13))$, $(((13)3)3)$, $((1(13))3)$, $(1((13)3))$, and $(1(1(13)))$ in order, in which the edges connecting two siblings are parenthesized together in a recursive manner from the largest depth of the tree. The number of parenthesizations for $\bm{\Psi}(N)$ is $C_{N-1}$, with $C_{N}$ being the \emph{Catalan number} defined as $C_{N} := \frac{(2N)!}{N!(N+1)!}$ \cite{Stanley15,Dershowitz80}, which grows as $\Omega(\frac{4^N}{N^{3/2}})$ \cite[p.~333]{Cormen01}. In order to reduce the search space, we take a \emph{dynamic programming} approach, as in \cite{Golin98,Golin08}, to find a prefix-free code for a known codeword PMF. \begin{figure}[!t] \centering \includegraphics[width=0.95\linewidth]{fig_tree_construction} \label{fig:v2f_NR_a} \label{fig:v2f_NR_a} \caption{A large tree constructed from smaller sub-trees. \label{fig:tree_construction} \end{figure} We begin from a trivial size-1 tree that has only a root, then construct larger trees by appending smaller trees to the root, as shown in Fig.~\ref{fig:tree_construction}. A tree $\mathcal{T}(N,\nu,\omega)$ formed by appending sub-trees $\mathcal{T}(N_j,\nu_j,\omega_j)$, $j=1,\ldots,J$ satisfies the following relations: \begin{align*} N &= \sum_{j=1}^{J} N_j, \eqnum \label{eqn:update_N} \\ \nu &= \sum_{j=1}^{J} N_j + \sum_{j=1}^{J} \nu_j = N + \sum_{j=1}^{J} \nu_j, \eqnum \label{eqn:update_nu} \\ \omega &= \sum_{j=1}^{J} (2j-1)^2 N_j + \sum_{j=1}^{J} \omega_j, \eqnum \label{eqn:update_omega} \end{align*} where the last two equations hold since the $j$-th edge from the root should be taken into account $N_j$ times to calculate sum depth and sum energy of the tree. For example, due to~\eqref{eqn:update_N}, a tree of $N=4$ with the $4$-ASK alphabet (hence $2 \leq J \leq 4$) can be constructed from $J$-tuples: $(N_1, N_2) = (1,3), (2,2), (3,1)$ for $J=2$, $(N_1, N_2, N_3) = (1,1,2), (1,2,1), (2,1,1)$ for $J=3$, and $(N_1, N_2, N_3, N_4) = (1,1,1,1)$ for $J=4$. Here, we do not need to use all sub-trees of size $<N$ to construct a set of size-$N$ trees, since we have an \emph{optimal sub-substructure} property: \begin{thm}\label{thm_opt_subtree} An optimal tree $\mathcal{T}^* (N)$ contains only optimal sub-trees $\mathcal{T}^* (n < N)$ in it \end{thm} \begin{proof Suppose that an optimal tree $\mathcal{T}^* (N,\nu,\omega^*)$ has a $j$-th sub-tree $\mathcal{T} (N_j,\nu_j,\omega_j)$. If the sub-tree $\mathcal{T} (N_j,\nu_j,\omega_j)$ is not an optimal tree, then there exists a sub-tree $\mathcal{T}^* (N_j,\nu_j,\omega_j^*)$ with $\omega_j^* < \omega_j$. By replacing the sub-tree $\mathcal{T} (N_j,\nu_j,\omega_j)$ with $\mathcal{T}^* (N_j,\nu_j,\omega_j^*)$ from the tree $\mathcal{T}^* (N,\nu,\omega^*)$, we can obtain a new tree $\mathcal{T}' (N,\nu,\omega')$ that has a smaller sum energy than the optimal tree, i.e, with $\omega'<\omega^*$. This is a contradiction, hence an optimal tree consists of only optimal sub-trees. \end{proof} It can be easily seen that the height of $\mathcal{T}(N)$ is minimized when its leaves have maximally uniform depths. The depths can differ from each other at most by one, and the minimum height is given by $\lceil \log_{M}N \rceil$ for the $M$-ASK alphabet. The sum depth of a size-$N$ minimum-height tree is calculated as $\nu_{\text{min}} := (N - M^{\lfloor \log_M N \rfloor}) (\lfloor \log_M N \rfloor + 1) + M^{\lfloor \log_M N \rfloor} \lfloor \log_M N \rfloor$, which is equal to the smallest sum depth of all trees in $\bm{\Psi} (N)$. If $N$ is a positive integer power of $M$, the minimum sum depth can be simplified as $\nu_{\text{min}} = N \log_M N$. On the other hand, if there are only two nodes at every depth of a tree (see, e.g., the last tree of Fig.~\ref{fig:Lplus_trees}~(b)), the tree has height $N-1$ that is the largest of all trees in $\bm{\Psi}(N)$. The sum depth in this case is calculated as $\nu_{\text{max}} = \sum_{v=1}^{N-1} v + (N-1) = \frac{(N+2)(N-1)}{2}$. After some manipulation, it can be seen that the sum depth of a maximum-height tree is also the maximum sum depth of all trees in $\bm{\Psi} (N)$. Therefore, if we store only one optimal tree to $\bm{\Psi}^* (N)$ for each $\nu$, the size of $\bm{\Psi}^* (N)$ is upper-bounded by $\nu_{\text{max}} - \nu_{\text{min}} + 1 = \frac{N^2}{2} + O(N \log_M N)$; i.e., $|\bm{\Psi}^*(N)|$ grows as $O(N^2)$. Since there are at most $N$ choices of the optimal sub-tree sets (ranging from an empty set to $\bm{\Psi}^*(N-1)$) for each of the $M$ edges of the root for enumerating all trees of size $N$ (using the optimal sub-tree property), the number of all choices to build $\bm{\Psi}(N)$ is of the complexity $\Omega(N^M)$. As aforementioned, each of the sub-tree sets is of size at most $\Omega(N^2)$, hence we have the search space of size $\Omega(N^{M+2})$ to identify $\bm{\Psi}^*(N)$. The search time is polynomial in $N$, and exponential in $M$, indicating the intractability of constructing F2V codes for a large alphabet. To further reduce the search space, we can exploit the fact that a larger sub-tree is appended as far left as possible from the root of an optimal tree; i.e., \begin{thm} \label{thm_opt_subtree2} Let $\mathcal{T}_j$ for $j=1,\ldots,J$ constitute the $j$-th sub-tree of an optimal tree $\mathcal{T}^*$ such that the root of $\mathcal{T}_j$ is the $j$-th child of the root of $\mathcal{T}^*$, then the sub-trees satisfy $|\mathcal{T}| > |\mathcal{T}_1| \geq \ldots \geq |\mathcal{T}_J|$. \end{thm} \begin{proof Let $\mathcal{T} (N_i,\nu_i)$ and $\mathcal{T} (N_j,\nu_j)$ denote two of the sub-trees of an optimal tree $\mathcal{T}^* (N,\nu)$ with $i < j$, and assume $N_i < N_j$. Then, by exchanging the two sub-trees $\mathcal{T} (N_i,\nu_i)$ and $\mathcal{T} (N_j,\nu_j)$, we can construct another tree $\mathcal{T}' (N,\nu)$ of the same size $N$ and the same sum depth $\nu$ due to \eqref{eqn:update_N} and \eqref{eqn:update_nu}, which has a smaller sum energy than $\mathcal{T}^* (N,\nu)$ by~\eqref{eqn:update_omega}. This is contradiction, hence an optimal tree must have $N_i \geq N_j$ for any $i > j$. \end{proof} \noindent For example, some trees in $\bm{\Psi}(4)$ can be generated from three sub-trees that have $(N_1,N_2,N_3)=(2,1,1)$, $(1,2,1)$, or $(1,1,2)$, but we can discard the latter two triplets by Theorem~\ref{thm_opt_subtree2}. \begin{figure}[!t] \centering \includegraphics[width=0.97\linewidth]{fig_f2v_gap_2ask}\label{fig:f2v_gap_a} \\[1.2em] \includegraphics[width=0.97\linewidth]{fig_f2v_gap_4ask}\label{fig:f2v_gap_b} \caption{Energy gap of all F2V codes (a) with $|\mathcal{C}| \leq 64$ for the 2-ASK alphabet, and (b) with $|\mathcal{C}| \leq 32$ for the 4-ASK alphabet.}% \label{fig:f2v_gap} \end{figure} We construct one optimal F2V code for each of the resolution rates that can be created with $N \leq 64$ for $\mathcal{X}_{\text{2-ASK}}$ and $\mathcal{X}_{\text{4-ASK}}$. As shown in Fig.~\ref{fig:f2v_gap}, F2V codes offer finer granularity of the resolution rates than V2F codes with the same cardinality, albeit with a slightly larger energy gap. Therefore, a natural consequence is to construct V2V codes to exploit the complementary merits of V2F and F2V codes, as will be illustrated henceforth. \subsection{V2V Codes} \label{sec:v2v} We readily have a set $\bm{\Psi}_{\text{R}}^*(N)$ of optimal right trees, representing optimal F2V codes. From this, without imposing any length constraints on information words and codewords, we can enumerate near-optimal V2V codes of the cardinality $|\mathcal{C}| = N$ in the following manner: \begin{enumerate} \item For each of the desired resolution rates $\mathsf{R}^* = j \Delta_{\mathsf{R}}$, where $j=1,\ldots,J$ for some integer $J$ and the \emph{rate granularity} $\Delta_{\mathsf{R}} = \frac{\log_2 M}{J}$, and for each of the optimal right trees in $\bm{\Psi}_{\text{R}}^*$, identify the MB PMF $\mathbb{P}_{\bm{X}_\text{MB}}$ that fulfills $\mathbb{H}(X_{\text{MB}}) = \mathsf{R}^*$. \item For every $\mathbb{P}_{\bm{X}_\text{MB}}$ obtained in Step~1, construct a set of optimal left trees $\bm{\Psi}_{\text{L}}^* $ that realizes $\mathbb{P}_{\widetilde{\bm{X}}_\text{MB}} = \text{GHC}(\mathbb{P}_{\bm{X}_\text{MB}})$. The trees in $\bm{\Psi}_{\text{L}}^* $ and $\bm{\Psi}_{\text{R}}^* $ have a one-to-one correspondence. \item For each of $\mathsf{R}^* = k \Delta_{\mathsf{R}}$, choose a pair of the left and right trees in $\bm{\Psi}_{\text{L}}^* $ and $\bm{\Psi}_{\text{R}}^*$ that yield the minimum $\mathsf{E}_\mathcal{C}$ with a rate discrepancy $|\mathsf{R}_\mathcal{C}-\mathsf{R}^*| < \delta$ for a small $\delta$. \end{enumerate} \noindent Indeed, an optimal V2V code does not necessarily consist of an optimal right tree, hence an exhaustive search of the left tree should be performed over \emph{all} right trees in $\bm{\Psi}_{\text{R}}$. However, due to the exponential growth of $|\bm{\Psi}_{\text{R}}|$ in $N$, we restrict the search space to optimal right trees in $\bm{\Psi}_{\text{R}}^*$; under this constraint, the constructed V2V codes show surprisingly good performance with a very small $N \leq 32$. Assume that a right tree $\mathcal{T}^*(N)$ has been chosen from $\bm{\Psi}_{\text{R}}^*(N)$, hence $l(\bm{x})$ and $||\bm{x}||^2$ are given. Then, we have from~\eqref{eqn:R} that \begin{align} \mathsf{R}_\mathcal{C} = (-\sum_{n=1}^{N} p_n \log_2 p_n) / (\sum_{n=1}^{N} p_n l(\bm{x}_n) ) \geq \mathsf{R}^* \\\Leftrightarrow \quad {-\sum_{n=1}^{N} p_n \log_2 (p_n / 2^{- \mathsf{R}^* l(\bm{x}_n)}) } \geq 0. \end{align} Let $ q_n := 2^{- \mathsf{R}^* l(\bm{x}_n)}$, $\bm{q} = [q_1,\ldots,q_N]^T$. Then, by definition of $\mathbb{D}(\bm{p} \| \bm{q})$, we have an equivalence relation \begin{gather*} \mathsf{R}_\mathcal{C} \geq \mathsf{R}^* \quad \Leftrightarrow \quad -\mathbb{D}(\bm{p} \| \bm{q}) \geq 0. \eqnum \label{eqn:KL_v2v} \end{gather*} If we waive the dyadic constraint on $\bm{p}$, the optimization problem~\eqref{eqn:optimize_E} translates to \begin{align*} & \underset{\bm{p}}{\text{minimize}} & &\!\!\!\!\!\!\!\!\!\!\!\! \mathsf{E}_\mathcal{C} = \frac { \mathbb{E}(||\bm{X}||^2) } { \mathbb{E}(l(\bm{X})) } = \frac { \sum_{n=1}^{N} p_n ||\bm{x}_n||^2 } { \sum_{n=1}^{N} p_n l(\bm{x}_n) } \eqnum \label{eqn:opt_v2v_minE1} \\ & \text{subject to} & &\!\!\!\!\!\!\!\!\!\! -\mathbb{D}(\bm{p} \| \bm{q}) \geq 0,\eqnum \label{eqn:opt_v2v_st1} \\ & & &\!\!\!\!\!\!\!\!\!\! \sum_{n=1}^{N} p_n = 1. \eqnum \label{eqn:opt_v2v_st2} \end{align*} Let $\mathsf{E}^*$ denote the minimum energy found by solving \eqref{eqn:opt_v2v_minE1}-\eqref{eqn:opt_v2v_st2}. Since the average symbol energy of any code $\mathcal{C}$ fulfills \begin{align*} \mathsf{E}_\mathcal{C} = \frac { \mathbb{E}(||\bm{X}||^2) } { \mathbb{E}(l(\bm{X})) } \geq \mathsf{E}^* \quad \Leftrightarrow \quad \mathbb{E}(||\bm{X}||^2) - \mathsf{E}^* \cdot \mathbb{E}(l(\bm{X})) \geq 0, \eqnum \label{eqn:opt_v2v_nec_suf} \end{align*} where the equality in the right-hand side holds if and only if $\mathsf{E}_\mathcal{C} = \mathsf{E}^*$, the optimal PMF is a solution to a convex optimization problem \begin{align} \bm{p}^* = \underset{\bm{p}}{\text{argmin}} \: \left[\mathbb{E}(||\bm{X}||^2) - \mathsf{E}^* \cdot \mathbb{E}(l(\bm{X})) \right]. \end{align} \begin{algorithm}[t!] \label{alg:v2v} \caption{Finding an optimal codeword PMF $\bm{p}^*$ for $\mathsf{R}^*$} \begin{algorithmic}[1] \renewcommand{\algorithmicrequire}{\textbf{Input:}} \renewcommand{\algorithmicensure}{\textbf{Output:}} \REQUIRE $N,\bm{v,w,q}$ \ENSURE $\bm{p}^*$ \\ \textit{Initialization}: \\ $\ell\leftarrow0$, $\bm{p}^{(0)} \leftarrow \bm{q}/\sum_{n=1}^{N} q_n$, ${\mathsf{E}}_\mathcal{C}^{(0)} \leftarrow \mathbb{E}_{\bm{p}^{(0)}} (||\bm{X}||^2)/ \mathbb{E}_{\bm{p}^{(0)}} (l(\bm{X}))$. \REPEAT \STATE $ \ell \leftarrow \ell + 1$ \STATE $\bm{p}^{(\ell)} \leftarrow \underset{\bm{p}}{\text{argmin}} \: \left[\mathbb{E}(||\bm{X}||^2) - {\mathsf{E}}_\mathcal{C}^{(\ell-1)} \cdot \mathbb{E}(l(\bm{X})) \right]$\\ $\qquad\quad\:$subject to $-\mathbb{D}(\bm{p} \| \bm{q}) \geq 0$, $\sum_{n=1}^{N} p_n = 1$. \STATE ${\mathsf{E}}_\mathcal{C}^{(\ell)} \leftarrow \mathbb{E}_{\bm{p}^{(\ell)}} (||\bm{X}||^2)/ \mathbb{E}_{\bm{p}^{(\ell)}} (l(\bm{X}))$. \UNTIL{$\mathsf{E}_\mathcal{C}^{(\ell-1)} - \mathsf{E}_\mathcal{C}^{(\ell)} < \varepsilon$} \RETURN $\bm{p}^* \leftarrow \bm{p}^{(\ell)}$ \end{algorithmic} \end{algorithm} Also, the constraints in \eqref{eqn:opt_v2v_st1} and \eqref{eqn:opt_v2v_st2} are concave\cite[Th.~2.7.2]{Cover06} and affine, respectively, hence the problem can efficiently be solved by a convex optimization solver such as the CVX \cite{cvx,Grant08}, on condition that $\mathsf{E}^*$ is known. Since we do not know $\mathsf{E}^*$, we can make an initial guess $\mathsf{E}_\mathcal{C}^{(0)} = \mathbb{E}(||\bm{X}||^2) / \mathbb{E}(l(\bm{X}))$ using a PMF $\bm{p} = \bm{q} / \sum_{n=1}^{N} q_n$, then attempt to reduce the error between the estimate ${\mathsf{E}}_\mathcal{C}^{(\ell)}$ at iteration $\ell$ and the true minimum energy $\mathsf{E}^*$ in an iterative manner. The initial PMF maximizes $-\mathbb{D}(\bm{p} \| \bm{q})$ in an attempt to fulfill the rate condition~\eqref{eqn:KL_v2v}, where the maximization of $-\mathbb{D}(\bm{p} \| \bm{q})$ by the initial guess $\bm{p}$ can be proven by using a Lagrangian $\mathbb{L}(\bm{p},\lambda) = -\mathbb{D}(\bm{p} \| \bm{q}) + \lambda(\sum_{n=1}^{N} p_n - 1)$. Since $\bm{p}$ is strictly feasible, the Slater's condition is satisfied for the problem of maximizing the concave function $-\mathbb{D}(\bm{p} \| \bm{q})$, hence strong duality holds\cite[Ch.~5.2.3]{Boyd04}. It follows that the \textrm{Karush-Kuhn-Tucker} (KKT) conditions \cite[Ch.~5.5.3]{Boyd04} are necessary and sufficient to maximize $-\mathbb{D}(\bm{p} \| \bm{q})$. Namely, a PMF $\bm{p}$ maximizes $-\mathbb{D}(\bm{p} \| \bm{q})$ if and only if the gradient of the Lagrangian vanishes at $\bm{p}$; i.e., \begin{align*} &\frac{\partial \mathbb{L}(\bm{p},\lambda)}{\partial p_n} = -\log_2 \frac{p_n}{q_n} - \log_2 e + \lambda = 0 \\ &\Leftrightarrow \quad \log_2 \frac{p_n}{q_n} = \lambda - \log_2 e\\ &\Leftrightarrow \quad p_n = 2^{\lambda - \log_2 e} q_n = r q_n \text{ for some constant }r. \end{align*} Since $\bm{p}$ is a PMF, we have that $r = 1/\sum_{n=1}^{N} q_n$ in the last equation, hence the initial guess $\bm{p}$ maximizes $-\mathbb{D}(\bm{p} \| \bm{q})$. If this $\bm{p}$ does not fulfill the rate condition~\eqref{eqn:KL_v2v}, then no other PMF can satisfy it, hence the corresponding right tree should be discarded. Otherwise, we can solve the convex optimization problem iteratively until the estimation error ${\mathsf{E}}_\mathcal{C}^{(\ell)} - \mathsf{E}^*$ at iteration $\ell$ reaches below a termination threshold $\varepsilon > 0$, as shown in Algorithm~1 \begin{figure}[!t] \centering \includegraphics[width=0.98\linewidth]{fig_v2v_gap_2ask_0p0050}\label{fig:v2v_gap_a} \\[1.2em] \includegraphics[width=0.98\linewidth]{fig_v2v_gap_4ask_0p0050}\label{fig:v2v_gap_b} \caption{Energy gap of V2V codes with $|\mathcal{C}|\leq 32$ for the (a) 2-ASK, and (b) 4-ASK alphabets.}% \label{fig:v2v_gap} \end{figure} \begin{thm}\label{thm_alg_opt} Given a right tree $\mathcal{T}(N)$, Algorithm~1 produces PMF $\bm{p}^*$ that is asymptotically optimal in iteration $\ell$ for a resolution rate $\mathsf{R}_\mathcal{C} \geq \mathsf{R}^*$, such that $\mathsf{E}_\mathcal{C}$ approaches $\mathsf{E}^*$. \end{thm} \begin{proof The proof follows a similar structure to that of Proposition~4.5 in \cite[Sec.~4.3.1]{Bocherer_thesis}. Suppose that Algorithm~1 terminates at the iteration $L$. Then, $\mathsf{{E}}_\mathcal{C}^{(\ell)}$ converges to $\mathsf{E}_\mathcal{C}^{(L)}$ as $\ell$ increases, since the termination condition on Line~5 is not satisfied at every $\ell < L$, hence $\mathsf{{E}}^{(\ell)}_\mathcal{C} \leq \mathsf{{E}}_\mathcal{C}^{(\ell-1)} - \varepsilon$ for $\ell < L$, indicating that $\mathsf{{E}}_\mathcal{C}^{(\ell)}$ is a monotonically decreasing function of $\ell$, while $\mathsf{{E}}_\mathcal{C}^{(\ell)}$ is lower-bounded by $\mathsf{E}^*$. Furthermore, the converged energy $\mathsf{E}_\mathcal{C}^{(L)}$ is indeed the minimum energy $\mathsf{E}^*$ within a small error. To see this, let $\Delta^{(\ell)} := \min_{\bm{p}} [\mathbb{E}(||\bm{X}||^2) - \mathsf{E}^{(\ell-1)}_\mathcal{C} \cdot \mathbb{E}(l(\bm{X}))] $ be the optimal value of the objective function at the iteration $\ell$ such that $\mathbb{E}(||\bm{X}||^2) - \mathsf{E}^{(\ell-1)}_\mathcal{C} \cdot \mathbb{E}(l(\bm{X})) \geq \Delta^{(\ell)}$ for any PMF $\bm{p}$, where the equality holds if and only if $\bm{p} = \bm{p}^{(\ell)}$. Then, $\Delta^{(\ell)} \leq 0$ since $\mathsf{E}_\mathcal{C}^{(\ell-1)} \geq \mathsf{E}^*$ for any PMF $\bm{p}$, where the equality holds if and only if $\mathsf{E}_\mathcal{C}^{(\ell-1)} = \mathsf{E}^*$ by \eqref{eqn:opt_v2v_nec_suf}. Also, since $\mathbb{E}_{\bm{p}^{(\ell)}}(||\bm{X}||^2) - \mathsf{E}_\mathcal{C}^{(\ell-1)} \cdot \mathbb{E}_{\bm{p}^{(\ell)}}(l(\bm{X})) = \Delta^{(\ell)} \Leftrightarrow \mathsf{E}_\mathcal{C}^{(\ell-1)} - \mathsf{E}_\mathcal{C}^{(\ell)} = -\Delta^{(\ell)}/\mathbb{E}_{\bm{p}^{(\ell)}}(l(\bm{X}))$, the termination of Algorithm~1 at the iteration $L$ implies $-\Delta^{(L)} / \mathbb{E}_{\bm{p}^{(L)}}(l(\bm{X})) < \varepsilon \Leftrightarrow \Delta^{(L)} > -\varepsilon \cdot \mathbb{E}_{\bm{p}^{(L)}}(l(\bm{X})) \geq -\varepsilon \cdot \min_{n} l(x_n)$. Since we have $-\varepsilon \cdot \min_{n} l(x_n) \leq \Delta^{(L)} \leq 0$ while $\Delta^{(L)} = 0$ is a necessary and sufficient condition for $\mathsf{E}_\mathcal{C}^{(L-1)} = \mathsf{E}^*$, Algorithm~1 can closely approach the minimum energy $\mathsf{E}^*$ by choosing a small $\varepsilon$. \end{proof} \noindent In our V2V code construction, Algorithm~1 is terminated mostly in 5 iterations with $\varepsilon = 10^{-10}$. Once $\bm{p}^*$ is identified for every optimal right tree and for every desired $\mathsf{R}^* = k \Delta_{\mathsf{R}}$, an optimal dyadic estimate of $\bm{p}^*$ can be obtained by $\bm{p} = \text{GHC}(\bm{p}^*)$, which creates a left tree. Then, among all pairs of such constructed left and right trees, a pair can be chosen for each resolution rate that achieves the minimum $\mathsf{E}_\mathcal{C}$. Figure~\ref{fig:v2v_gap} shows all V2V codes enumerated with the rate granularity $\Delta_{\text{R}} = 0.005$ and the rate tolerance $\delta = 0.0025$ for the 2-ASK and 4-ASK alphabets with $N = 8,16,32$. For the 2-ASK alphabet, only $N = 16$ is required to construct V2V codes that have energy gaps smaller than 0.05~dB across a wide range of the resolution rates. For the 4-ASK alphabet, the energy gap is below 0.2~dB across a wide range of the resolution rates and the realized resolution rates have coarser granularity than those of the 2-ASK alphabet with the same cardinality of the codebook. \begin{figure}[!t] \centering \includegraphics[width=0.99\linewidth]{fig_selected_codes} \caption{Selected prefix-free codes for the 2-, 4-, 8-, and 16-ASK alphabets.} \label{fig:selected_codes} \end{figure} Some codes selected from Figs.~\ref{fig:v2f_gap} and \ref{fig:v2v_gap} are shown in Fig.~\ref{fig:selected_codes}, whose resolution rates range from 0.15 to 3.83 in a step size $\leq 0.16$. This shows that we can approach the theoretic minimum energy per code symbol to within 0.13 dB across a wide range of resolution rates for up to 1024-QAM, using codebooks of a cardinality not larger than 256. \section{Framing for Fixed-Rate Transmission} \label{sec:framing} In a communication system that needs to carry $k$ information bits using a fixed length-$n$ \emph{frame} of code symbols, a fundamental problem of PCDM is that the codeword length varies depending on the information bits. Here, and throughout the paper, the frame refers to a container of code symbols, but not of information bits. Let us define the resolution rate for each of the codewords and for each of the code symbols, as we define the resolution rate for a prefix-free code. By abuse of terminology, if we refer to them as the \emph{codeword resolution rate} and the \emph{symbol resolution rate}, respectively, these resolution rates are realized at the output of the encoder in a random fashion, and their mean value approaches to $\mathsf{R}_\mathcal{C}$ asymptotically in the number of encoding iterations. As a consequence, an \emph{overflow} can occur if incoming bits are frequently mapped to codewords whose resolution rate is smaller than $\mathsf{R}_\mathcal{C}$ such that all the code symbols for the $k$ information bits cannot be accommodated in the length-$n$ frame~\cite{Jelinek68buffer}. On the other hand, if the encoder frequently produces codewords of a resolution rate greater than $\mathsf{R}_\mathcal{C}$, an \emph{underflow} can occur such that part of the frame remains unfilled after completing the encoding. \emph{Framing} in this paper refers to a method that enables a fixed-length frame to always contain a fixed number of information bits, thereby solving the variable length problem of PCDM. In \cite[Sec.~4.8]{Amjad_thesis}, framing is performed by casting overflow symbols into errors; the probability of error decreases as the frame length grows, but zero-error prefix-free decoding is not possible within a finite-length frame. In~\cite{Yoshida18low}, framing of run-length codes is achieved by making zeros and ones appear exactly the same number of times at the input of the run-length encoder, but the method to construct run-length codes for target resolution rates is not shown. \subsection{Algorithm for Framing} To achieve a fixed resolution rate $R_{\text{Frame}} < \log_2 M$ in each fixed-length frame for the $M$-ASK alphabet, we use two different codes: a prefix-free code $\mathcal{C}_1 :\bmcal{B}_1 \mapsto \bmcal{X}_1$ with unequal codeword resolution rates, whose mean value $\mathsf{R}_{\mathcal{C}_1}$ is close to $R_{\text{Frame}}$, and a trivial code $\mathcal{C}_2 : \bmcal{B}_2 \mapsto \bmcal{X}_2$ with an equal codeword resolution rate $\mathsf{R}_{\mathcal{C}_2} = \log_2{M} > \mathsf{R}_{\mathcal{C}_1}$ across all the codewords (i.e., $\mathcal{C}_2$ is a typical F2F mapper for uniform $M$-ASK). The idea is that we begin encoding with $\mathcal{C}_1$ and then \emph{switch} to $\mathcal{C}_2$ at some point of the successive encoding process if an overflow is predicted. If we keep counting the numbers of input bits and output symbols encoded by $\mathcal{C}_1$ in the first part of encoding, we can also calculate the number of symbols required to encode all the remaining input bits if we use $\mathcal{C}_2$ instead of $\mathcal{C}_1$ from that point onward, enabling prediction of an overflow. In what follows, we will show that this prediction can be made in a way that unique decoding is possible, and that the penalty due to this switching is small. Let $k$ and $n$ be, respectively, a fixed number of input bits and a fixed number of output symbols of a PCDM encoder in each frame; i.e., the information bits and the code symbols belong to $\mathcal{B}^k$ and $\mathcal{X}^n$, respectively. Then, framing enables PCDM to achieve a fixed ${R}_{\text{Frame}}$, where \begin{align} \mathsf{R}_{\mathcal{C}_1} < {R}_{\text{Frame}} := \frac{k}{n} < \mathsf{R}_{\mathcal{C}_2}. \label{eqn:Rframe1} \end{align} This shows that, for the chosen $\mathsf{R}_{\mathcal{C}_1}$ and $\mathsf{R}_{\mathcal{C}_2}$, an additional rate adaptability is also offered by framing, at the expense a larger energy gap. Let $\bm{b}^{(\ell)}$ and $\bm{x}^{(\ell)}$ denote the information word and the codeword chosen at the encoding iteration~$\ell$ by $\mathcal{C}_1$, respectively. And assume that the use of $\mathcal{C}_1$ until iteration~$\ell-1$ was assured not to cause an overflow, as long as we switch to $\mathcal{C}_2$ from the next iteration~$\ell$ onwards. Hence we have used $\mathcal{C}_1$ until iteration~$\ell-1$. Then, at the next iteration~$\ell$, in order to foresee if $\mathcal{C}_1$ does not still cause an overflow, we need to ensure that \begin{align} \gamma_{\text{Ava}}^{(\ell)} \geq \gamma_{\text{Req.}}^{(\ell)}, \label{eqn:cond_no_overflow} \end{align} where $\gamma_{\text{Ava}}^{(\ell)} := n - \sum_{i=1}^{\ell} l(\bm{x}^{(i)})$ is the number of available slots in the frame {at the beginning of iteration~$\ell+1$} and $\gamma_{\text{Req.}}^{(\ell)} := \left\lceil (k - \sum_{i=1}^{\ell} l(\bm{b}^{(i)}) )/ {\mathsf{R}_{\mathcal{C}_2}} \right\rceil$ is the number of required symbol slots in case we switch to $\mathcal{C}_2$ at iteration~$\ell+1$, respectively. Codebook $\mathcal{C}_1$ is used for encoding at iteration $\ell$ if condition \eqref{eqn:cond_no_overflow} is fulfilled, otherwise $\mathcal{C}_2$ from iteration $\ell$ onwards. Notice that \eqref{eqn:cond_no_overflow} can be evaluated only after seeing the incoming bits at iteration~$\ell$ to obtain $l(\bm{b}^{(\ell)})$ and $l(\bm{x}^{(\ell)})$. This makes unique decoding impossible, since, assuming that unique decoding was successfully performed until iteration~$\ell-1$ such that $l(\bm{b}^{(i)})$ and $l(\bm{x}^{(i)})$ are known for all $i=1,\ldots,\ell-1$, the decoder cannot identify which codebook was used at iteration~$\ell$ without knowing $l(\bm{b}^{(\ell)})$ and $l(\bm{x}^{(\ell)})$. This suggests that, for unique decoding, the codebook used at iteration~$\ell$ must be identified without relying on $l(\bm{b}^{(\ell)})$ and $l(\bm{x}^{(\ell)})$, which can be realized by a bounding technique. Namely, in a \emph{pessimistic} assumption that the shortest information word is mapped to the longest codeword of $\mathcal{C}_1$ at iteration $\ell$, we can find the lower bound of the available slots and the upper bound of the required slots as \begin{align*} \underline{\gamma}_{\text{Ava}}^{(\ell)} &:= n - \sum_{i=1}^{\ell-1} l(\bm{x}^{(i)}) - l_{\max}(\bmcal{X}), \eqnum \label{eqn:gamma_ava2} \end{align*} and \begin{align*} \overline{\gamma}_{\text{Req}}^{(\ell)} &:= \left\lceil \frac { k - \sum_{i=1}^{\ell-1} l(\bm{b}^{(i)}) - l_{\min}(\bmcal{B}) } {\mathsf{R}_{\mathcal{C}_2}} \right\rceil, \eqnum \label{eqn:gamma_req2} \end{align*} where $l_{\max}(\bmcal{X}) := \max_{\bm{x}\in \bmcal{X}} l(\bm{x})$ and $l_{\min}(\bmcal{B}) := \max_{\bm{b}\in \bmcal{B}} l(\bm{b})$. Now, without knowledge of $l(\bm{b}^{(\ell)})$ and $l(\bm{x}^{(\ell)})$, the condition~\eqref{eqn:cond_no_overflow} can be conservatively examined by \begin{align} \underline{\gamma}_{\text{Ava}}^{(\ell)} \geq \overline{\gamma}_{\text{Req}}^{(\ell)}, \label{eqn:cond_no_overflow2} \end{align} since $\gamma_{\text{Ava}}^{(\ell)} \geq \underline{\gamma}_{\text{Ava}}^{(\ell)}$ and $\overline{\gamma}_{\text{Req}}^{(\ell)} \geq \gamma_{\text{Req}}^{(\ell)}$. \begin{thm}\label{thm_cond_overflow} \label{thm:no_overflow} In the successive PCDM encoding process, an overflow can be avoided by switching the code from $\mathcal{C}_1$ to $\mathcal{C}_2$ at the earliest iteration $\ell$ that does not fulfill \eqref{eqn:cond_no_overflow2}. \end{thm} \begin{proof If \eqref{eqn:cond_no_overflow2} is fulfilled at iteration $\ell = 1$, we can use $\mathcal{C}_1$ at $\ell = 1$ without an overflow, otherwise we can use $\mathcal{C}_2$ to encode all the information bits without an overflow, since $\lceil k / \mathsf{R}_{\mathcal{C}_2} \rceil \leq n$ by \eqref{eqn:Rframe1}. Assume that $\mathcal{C}_1$ was used at iteration $\ell-1$, fulfilling \eqref{eqn:cond_no_overflow2}, hence ensured that an overflow will not occur if we switch to $\mathcal{C}_2$ at iteration $\ell$. If \eqref{eqn:cond_no_overflow2} is fulfilled also at iteration $\ell$, we keep using $\mathcal{C}_1$, since encoding with $\mathcal{C}_2$ from iteration $\ell+1$ suffices to avoid an overflow, otherwise, we switch to $\mathcal{C}_2$ at iteration $\ell$ without an overflow by assumption. This completes proof by mathematical induction. \end{proof} \begin{thm}\label{thm_unique_decoding} The codewords framed by using Theorem~\ref{thm:no_overflow} can be uniquely decoded. \end{thm} \begin{proof At iteration $\ell = 1$, it is trivial to see that a decoder can identify a decoding code using \eqref{eqn:cond_no_overflow2}, which allows for unique decoding and gives knowledge of $l(\bm{b}^{(1)})$ and $l(\bm{x}^{(1)})$. Assume that $l(\bm{b}^{(i)})$ and $l(\bm{x}^{(i)})$ for all $i=1,\ldots,\ell-1$ are known at the beginning of iteration $\ell$. Then, by assessing \eqref{eqn:cond_no_overflow2} at iteration $\ell$, we identify the decoding code, enabling unique decoding at iteration $\ell$. This provides $l(\bm{b}^{(\ell)})$ and $l(\bm{x}^{(\ell)})$ and completes proof by mathematical induction. \end{proof} \begin{algorithm}[!t] \label{alg:framing} \caption{Framing of a prefix-free code} \begin{algorithmic}[1] \renewcommand{\algorithmicrequire}{\textbf{Input:}} \renewcommand{\algorithmicensure}{\textbf{Output:}} \REQUIRE $\mathcal{C}_1,\mathcal{C}_2$, an information bit sequence $\bm{b} \in \mathcal{B}^k$ \ENSURE A code symbol frame $\bm{x} \in \mathcal{X}_{M\text{-ASK}}^n$ \\ \textit{Initialization}: $\ell\leftarrow0$. \REPEAT \STATE $\ell \leftarrow \ell + 1$ \STATE Find $\bm{b}^{(\ell)}\in\bmcal{B}_1$ and produce the corresponding $\bm{x}^{(\ell)}\in\bmcal{X}_1$ as an output. \UNTIL{$\sum_{i=1}^{\ell}l(\bm{b}^{(i)}) <= k$ and $\underline{\gamma}_{\text{Ava}}^{(\ell)} \geq \overline{\gamma}_{\text{Req}}^{(\ell)}$} \IF{$\sum_{i=1}^{\ell}l(\bm{b}^{(i)}) < k$ } \REPEAT \STATE $\ell \leftarrow \ell + 1$ \STATE Find $\bm{b}^{(\ell)}\in\bmcal{B}_2$ and produce the corresponding $\bm{x}^{(\ell)}\in\bmcal{X}_2$ as an output. \UNTIL{$\sum_{i=1}^{\ell}l(\bm{b}^{(i)}) <= k$} \ENDIF \IF{$\sum_{i=1}^{\ell}l(\bm{x}^{(i)}) < n$} \STATE Fill the last $n-\sum_{i=1}^{\ell}l(\bm{x}^{(i)})$ slots in $\bm{x}$ with 1. \ENDIF \RETURN $\bm{x}$ \end{algorithmic} \end{algorithm} In cases where an \emph{underflow} occurs, the encoder can simply fill the unoccupied slots in the frame with dummy symbols of the smallest energy, e.g., $\mathcal{X}_1 = 1$ for the $M$-ASK alphabet. The decoder can discard these dummy symbols after $k$ bits are all decoded. There may also be incidents at the end of encoding that need minor manipulations as follows. At the last encoding iteration, it is possible that there is no information word in the dictionary that matches the input bits. In this case, there must be multiple information words whose prefix matches the input bits, hence an encoder can set a rule for unique encoding; e.g., the first codeword in an lexicographical order can be picked. Unique decoding is straight-forward. A pseudo-code for this framing algorithm is given in Algorithm~2. \subsection{Analysis of Fixed-Length Penalty by Gaussian Approximation} The probability that the codeword resolution rate at a certain time instant equals $r_n := l(\bm{b}_n)) / l(\bm{x}_n)$ is the probability that the current output symbol belongs to the codeword $\bm{x}_n \in {\bmcal{X}_1}$, which can be calculated as $q_n := p_n l(\bm{x}_n) / \sum_{i=1}^{N} p_i l(\bm{x}_i)$, where $N = |\bmcal{X}|$. Without the fixed-length framing constraint, the resolution rate~\eqref{eqn:R} can alternatively be calculated as $\mathsf{R}_{\mathcal{C}_1} = \mathbb{E}_{\bf{q}}(R)$, where $R$ is a random variable taking values on an ordered set $\{r_1, \ldots, r_N \}$, with the PMF $\bm{q} := [q_1,\ldots,q_N]^T$. For example, with the V2V code in Tab.~\ref{tab:examples}~(c), a codeword resolution rate in $\bm{r} := [r_1,\ldots,r_N]^T \approx [$0.14, 0.43, 0.5, 0.6, 1, 1.67, 3, 6$]^T$ is observed at the encoder output with a PMF $\bm{q} \approx [$0.57, 0.143, 0.122, 0.102, 0.041, 0.015, 0.005, 0.003$]^T$, which yields $\mathsf{R}_{\mathcal{C}_1} \approx 0.361$ on average. Suppose now that a fixed-length framing constraint is imposed. We consider the \emph{ensemble} of frames and assume that all symbols encoded by $\mathcal{C}_1$ are IID. Also, though the true symbol resolution rate is a discrete random variable, we approximate this by a continuous Gaussian random variable with mean $\mathsf{R}_{\mathcal{C}_1}$ and variance $\mathsf{S}^2 := \mathbb{E}_{\bm{q}} (R^2) - \mathsf{R}_{\mathcal{C}_1}^2$; i.e., $R \sim \mathcal{N} (\mathsf{R}_{\mathcal{C}_1},\mathsf{S}^2)$. In this case, the number of information bits that are mapped until the $t$-th symbol output follows a Gaussian distribution $\mathcal{N} (t\mathsf{R}_{\mathcal{C}_1},t\mathsf{S}^2)$, if there has been neither an overflow prediction nor an early termination of encoding by $\mathcal{C}_1$ until the $(t-1)$-th symbol. To take into account a fulfilled overflow prediction and an early termination, we notice that \eqref{eqn:gamma_ava2} and \eqref{eqn:gamma_req2} at the $t$-th output symbol can respectively be transformed into $\underline{\gamma}_{\text{Ava}} (t) := n - (t-1) - l_{\max}(\bmcal{X})$ and $\overline{\gamma}_{\text{Req}} (t) := \left\lceil { \big( k-\Theta(t-1) - l_{\min}(\bmcal{B}) \big) } / {\mathsf{R}_{\mathcal{C}_2}} \right\rceil$, where $\Theta(t)$ is a random variable representing the \emph{cumulative symbol resolution rate} at the $t$-th output symbol. \begin{figure}[!t] \centering \hspace*{-2em}\includegraphics[width=2.3in]{fig_ga_illustration}\\[-1em] \caption{Approximated Gaussian distribution of the cumulative symbol resolution} rate at the $t$-th symbol. \label{fig:ga_illustration} \end{figure} However, characterization of $\Theta(t)$ becomes infeasible as the overflow and early termination probabilities increase with $t$, hence we approximate $\Theta(t)$ for all $t = 1,\ldots,n$ by a Gaussian random variable with mean $\mu(t)$ and variance $\sigma^2(t)$ such that $\Theta(t) \sim \mathcal{N} (\mu(t), \sigma^2(t))$ whose evolution over $t$ is mathematically tractable, as shown in Fig.~\ref{fig:ga_illustration}. Then, on condition that $\mathcal{C}_1$ is used at the $t$-th symbol, i.e., on condition that neither an overflow prediction nor an early termination has been made before the $t$-th symbol, the probability of an overflow prediction at the $t$-th symbol is \begin{align*} &\mathbb{P} \left( \overline{\gamma}_{\text{Req}} (t) > \underline{\gamma}_{\text{Ava}} (t) \right) \\ &\approx \mathbb{P} \left( k -\Theta(t-1) - l_{\min}(\bmcal{B}) - \mathsf{R}_{\mathcal{C}_2} \left( n - t+1 - l_{\max}(\bmcal{X}) \right) > 0 \right) \\ &= \mathbb{P} \left( \Theta(t-1) < \xi(t) \right) \eqnum \label{eqn:overflow_threshold} \\ &= F\left( \xi(t) \,|\,\mu(t-1),\sigma^2(t-1)\right) \eqnum \label{eqn:ga_overflow_condition} \end{align*} where, in \eqref{eqn:overflow_threshold}, an overflow threshold is defined as $\xi(t) := \mathsf{R}_{\mathcal{C}_2} \left( t - n - 1 + l_{\max}(\bmcal{X}) \right) + k - l_{\min}(\bmcal{B})$, and $F\left( \,\cdot \,|\,\mu,\sigma^2\right)$ in \eqref{eqn:ga_overflow_condition} denotes Gaussian cumulative distribution function (CDF) with mean $\mu$ and variance $\sigma^2$. Equation~\eqref{eqn:overflow_threshold} gives insight into the behavior of the proposed framing method, since it indicates that an overflow is predicted if the symbol resolution rate accumulated until the $(t-1)$-th symbol is smaller than the threshold $\xi(t)$ that increases linearly with $t$. Here, $\mu(t)$ and $\xi(t)$ are both linear in $t$ with slopes $\mathsf{R}_{\mathcal{C}_1}$ and $\mathsf{R}_{\mathcal{C}_2}$, respectively, and since $\mathsf{R}_{\mathcal{C}_1} < \mathsf{R}_{\mathcal{C}_2}$ by the framing rule, the probability of an overflow prediction in \eqref{eqn:overflow_threshold} gradually increases with $t$. \begin{figure}[!t] \centering \includegraphics[width=3.4in]{fig_ga_evolution} \caption{Evolution of the distribution of the cumulative symbol resolution rate: (a) $k = 108, n = 300, t = 10i$, and (b) $k = 3600, n = 10000, t = 200i$, for positive integers $i$.} \label{fig:ga_evolution} \end{figure} \begin{figure}[!t] \centering \subfloat[][]{\!\!\!\!\!\includegraphics[width=1.12\linewidth]{fig_fixed_length_penalty1}\label{fig:fixed_length_penalty1}}\\[-0.1em] \subfloat[][]{\!\!\!\!\!\includegraphics[width=1.12\linewidth]{fig_fixed_length_penalty2}\label{fig:fixed_length_penalty2}} \caption{Energy gap after framing of (a) V2V codes for the 2- and 4-ASK alphabets, and (b) V2F codes for the 8- and 16-ASK alphabets. The cross and circle markers show the results of GA analysis and MC simulations, respectively. \label{fig:fixed_length_penalty} \end{figure} In order to take into account the history of previous overflow predictions and early terminations, let $\Phi_{\rm{Swi}}(t)$ and $\Phi_{\rm{End}}(t)$ denote the cumulative overflow prediction probability and cumulative early termination probability at symbol~$t$. Then, the \emph{unconditional} probability that an overflow is predicted at symbol~$t$ is \begin{align*} \phi_{\rm{Swi}}(t) := \big(1 - \Phi_{\rm{Swi}}(t-1) - \Phi_{\rm{End}}(t-1)\big) \\ \times F\left(\xi(t) \,|\, \mu(t-1),\sigma^2(t-1)\right). \eqnum \label{eqn:ga_overflow_pr} \end{align*} And the probability of an early termination at symbol~$t$ is \begin{align*} \phi_{\rm{End}}(t) := \big(1 - \Phi_{\rm{Swi}}(t-1) - \Phi_{\rm{End}}(t-1) \big) \\ \times \left( 1- F(S \,|\, \mu(t-1),\sigma^2(t-1)) \right). \eqnum \label{eqn:ga_early_termination_pr} \end{align*} It is straightforward to see that their cumulative probabilities are obtained by $\Phi_{\rm{Swi}}(t) = \sum_{i=1}^{t} \phi_{\rm{Swi}}(t)$ and $\Phi_{\rm{End}}(t) = \sum_{i=1}^{t} \phi_{\rm{End}}(t)$. From the initial conditions $\Phi_{\rm{Swi}}(0) = 0$ and $\Phi_{\rm{End}}(0) = 0$, the cumulative probabilities can be evaluated in an iterative manner from symbol $1$. When evaluating \eqref{eqn:ga_overflow_pr} and \eqref{eqn:ga_early_termination_pr}, we have the initial conditions $\mu(0) = 0$ and $\sigma^2(0) = 0$, and $\mu(t)$ and $\sigma^2(t)$ for $t > 0$ can be obtained using the update rule (see Fig.~\ref{fig:ga_illustration}) $\mu(t) = \int_{\xi(t-1)}^{k} \theta \frac {f\left(\theta \,|\, \mu(t-1),\sigma^2(t-1)\right)}{\alpha} d\theta + \mathsf{R}_{\mathcal{C}_1}$, and $\sigma^2(t) = \int_{\xi(t-1)}^{k} (\theta-\mu(t))^2 \frac{f\left(\theta \,|\, \mu(t-1),\sigma^2(t-1)\right)}{\alpha} d\theta + \mathsf{S}^2$, where $f\left( \,\cdot \,|\,\mu,\sigma^2\right)$ denotes Gaussian probability density function (PDF) with mean $\mu$ and variance $\sigma^2$, and $\alpha$ is a normalization factor defined by $\alpha := \int_{\xi(t-1)}^{k} f\left(\theta \,|\, \mu(t-1),\sigma^2(t-1)\right) d\theta$. $\mu(t)$ and $\sigma^2(t)$ can be efficiently evaluated by numerical integration methods \cite{davis2007methods}. \begin{figure*}[!t] \centering \captionsetup{skip=-5pt} \includegraphics[width=0.81\linewidth]{fig_snr_fer.pdf}\\[-0.1em] \caption{FER of uniform QAM (square markers) and PS-QAM realized by CCDM (triangle markers), and PCDM (circle markers). The numbers in the parentheses show the IRs.} \label{fig:snr_fer} \end{figure*} Figure~\ref{fig:ga_evolution} shows the evolution of $\Theta(t)$, when we use the aforementioned Gaussian approximation (GA) for the V2V code in Tab.~\ref{tab:examples}~(c). It realizes $\mathsf{R}_{\text{Frame}} = 0.36$ in each frame, using the probabilistic symbol resolution rate $R$ with mean $\mathsf{R}_{\mathcal{C}_1} \approx 0.361$ and variance $\mathsf{S}^2 = 0.195$. Each small Gaussian PDF represents a PDF of the cumulative symbol resolution rate at the output symbol $t$, where $t$ increments from 10 in a step size of 10 in~(a), and from 200 in a step size of 200 in~(b). The variance of the Gaussian PDF grows with $t$ at first, which is expected with little effect from the fixed-length constraint, then begins to decrease near the end of the frame as the probabilities of an overflow prediction and an early termination emerge. Comparison of Figs.~\ref{fig:ga_evolution}~(a) and (b) shows that a large frame length reduces the impact of framing on the increase of the energy gap, as will be quantitatively shown below. The average symbol energy under framing can be estimated by GA as \begin{align*} &\mathsf{E}_{\text{Frame}} = \frac{1}{n}\sum_{t=1}^{n} \Big[ \left( 1- \Phi_{\rm{Swi}}(t) - \Phi_{\rm{End}}(t-1) \right) \mathsf{E}_{\mathcal{C}_1} \\ &\qquad\qquad\qquad + \Phi_{\rm{Swi}}(t) \mathsf{E}_{\mathcal{C}_2} + \Phi_{\rm{End}}(t-1) \Big]. \eqnum \label{eqn:E_frame} \end{align*} The energy gap of the prefix-free codes is depicted in Fig.~\ref{fig:fixed_length_penalty}, where the codes are selected to support various $\mathsf{R}_{\text{Frame}}$, ranging from 0.1 to 3.6 in a step size of 0.5. The energy gap is estimated by GA, and also by Monte Carlo (MC) simulations, averaged over 10000 frames created from random equiprobable information bits. GA provides very close results to MC simulations as the frame length increases, in a significantly shorter time. Since a smaller frame length allows a greater flexibility in implementation of the PCDM and parallel processing of multiple frames, Fig.~\ref{fig:fixed_length_penalty} shows there exists a trade-off between the frame length and the energy gap. In the limit of the frame length, prefix-free codes approach the ideal energy efficiency of the MB PMFs to within 0.2~dB, even with framing. \section{Rate-Adaptable PCDM in AWGN Channel} Figure~\ref{fig:snr_fer} shows the performance of rate-adaptable PCS in the AWGN channel, realized by PCDM in the PAS architecture. PCDM is implemented with frame lengths of $30720/\log_2 M$ QAM symbols, and a tail-biting (TB) spatially-coupled low-density parity-check (SC-LDPC) code of length 30720 bits and rate $\mathsf{r}_c = 4/5$ is used for FEC, constructed based on \cite{cho2015construction}. In the simulation, one PCDM frame is made to be exactly one FEC frame, hence the frame error rate (FER) is the same for PCDM decoding and FEC decoding. The TB-SC-LDPC code is 0.9~dB away from the binary phase-shift keying (BPSK) AWGN capacity at the FER of $10^{-3}$, when decoded by the normalized min-sum algorithm with $\leq$ 30 ierations. V2V prefix-codes are used for PCDM, which realize the DM rates $\mathsf{R}_{\text{Frame}} = 0.1, 0.2, \ldots, 0.9$ for the $2$-ASK alphabet and $\mathsf{R}_{\text{Frame}} = 1.2, 1.3, \ldots, 1.9$ for the $4$-ASK alphabet. Each V2V code has only 32 codewords in the codebook. The IR of probabilistically shaped (PS)-$M$-QAM is given by $\mathsf{R}_{\text{PS-}M\text{-QAM}} = 2 \left[ 1+\mathsf{R}_{\text{Frame}}-(1-\mathsf{r}_c)\frac{\log_2 M}{2} \right]$, where $\mathsf{r}_c$ denotes the FEC code rate\cite[eq.~(30)]{Bocherer15}. Note that $\mathsf{R}_{\text{PS-}M\text{-QAM}}$ is quantified in bits/QAM symbol, whereas all the resolution rates in this paper are in bits/ASK symbol. Using the selected V2V codes and $\mathsf{r}_c = 4/5$, the IRs of $\mathsf{R}_{\text{PS-}16\text{-QAM}} = 1.4, 1.6, \ldots, 3.0$ and $\mathsf{R}_{\text{PS-}64\text{-QAM}} = 3.2, 3.4, \ldots, 4.6$ are obtained, as shown by the parentheses in Fig.~\ref{fig:snr_fer}. The FER is estimated as a function of $\mathsf{E_s/N_0}$, with $\mathsf{E_s}$ being energy per channel use and $N_0$ being noise variance per two dimensions. For comparison, also shwon is the performance of the uniform 4-, 8-, 16-, and 32-QAM. The constellations of the uniform 4- and 16-QAM are the square QAM constellations with Gray labeling, and those of the uniform 8- and 32-QAM are `Circular-8QAM' of \cite[Ch.~3.1.1]{Muller16advanced} and $\bm{X}_{32,\text{cro}}$ of \cite[Ch.~3.2.4]{Muhammad10Coding}, respectively. It can be seen that PCDM approaches the performance of CCDM to within 0.2~dB at an FER of $10^{-3}$. Note that, with the chosen frame lengths, CCDM is very close to an ideal DM \cite{Schulte16}. As a result, PCDM achieves shaping gains up to 0.98~dB over the uniform QAM for the same IR. \section{Conclusion} We created a wide range of resolution rates with a very fine granularity using tiny prefix-free codes. In particular, we constructed optimal V2F codes of cardinality $\leq$ 4096 for the 2-, 4-, 8-, and 16-ASK alphabets, optimal in the sense that no other code of the same cardinality can achieve a smaller average symbol energy for the same resolution rate. We also enumerated all of the optimal F2V codes and many near-optimal V2V codes of cardinality $\leq$ 32 with the 2- and 4-ASK alphabets. Selected codes approach the theoretic lowest energy to within 0.13 dB across the resolution rate from 0.1 to 3.9~bits/symbol in a step size less than 0.16~bits/symbol, showing that PCDM is suitable for rate-adaptable PCS. Its implementation cost is a small look-up table for each resolution rate. We also proposed a framing method to implement fixed-rate transmission with variable-rate prefix-free coding, and proved that the proposed framing enables unique prefix-free decoding. We gave insights into the evolution of encoding process under framing. Using GA analysis and MC simulations, we showed that the penalty caused by framing is negligible when the frame length is large. FEC simulations in the AWGN channel demonstrate that the PCDM-based PS-QAM under framing achieves an SNR gain up to 0.98~dB compared to uniform QAM.
{'timestamp': '2019-03-05T02:17:41', 'yymm': '1810', 'arxiv_id': '1810.02411', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02411'}
arxiv
\section{Introduction} \label{sec:intro} Deep reinforcement learning (Deep RL) algorithms often rely on the same stochastic gradient descent methods as other deep learning techniques to optimize value function approximators and policies~\citep{mnih2015human,PPO}. For example, the optimizer used for Proximal Policy Optimization by \citet{PPO} is Adam~\citep{kingma2014adam}, while the optimizer for Advantage Actor Critic in \citet{PPO} is RMSProp~\citep{RMSProp}. However, it is unclear why different optimizers may have different behaviours in Deep RL algorithms and whether the theoretical properties of optimizers in the supervised learning setting generalize to Deep RL algorithms. To initially illustrate some of the possible problems with the adaptive gradient descent optimization in Deep RL, we examine recent literature. First, recent work has discovered that in online stochastic settings (as is often the case in Deep RL), there are cases where Adam does not converge to an optimal solution~\citep{amsgrad}. ~\citet{wilson2017marginal} demonstrate similar findings for adaptive methods such as Adam and RMSProp. It is clear from prior work~\citep{henderson2017deep,islam2017reproducibility} that reinforcement learning methods can be highly stochastic and variant in nature. As such the problem formulation may result exactly in the cases described by~\citet{amsgrad} and \citet{wilson2017marginal}. Furthermore, we note recent work in optimization which suggests that momentum needs to be adjusted to compensate for implicit momentum generated by the system~\citep{mitliagkas2016asynchrony}. That is, in asynchronous optimization itself adds an additional implicit momentum. Once again, a parallel issue can easily be mapped to asynchronous Deep RL methods \citep{a3c} or distributed learning~\citep{heess2017emergence,barth2018distributed}. However, more importantly, it is easy to imagine how this might affect synchronous methods as well. In TD methods especially, there is a staleness to the gradients since the value function is bootstrapping off of its own predictions and updates may be biased toward previous policies and points in a trajectory. To this extent, we focus on two Deep RL algorithms from the family of policy gradient methods~\citep{sutton2000policy} -- synchronous Advantage Actor Critic (A2C) \citep{PPO,a3c} and Proximal Policy Optimization (PPO)~\citep{PPO} -- to examine empirically what effects certain optimizers and learning rates may have on learning on policy gradient methods and what effect momentum may have in learning (suggesting possible sources of implicit momentum). \section{Background} \subsection{Deep RL Algorithms} We focus on two Deep RL algorithms from the class of policy gradient methods: PPO and A2C. Each has a unique set of properties, but are generally very similar. In both cases, a value function approximator is learned via a temporal difference (TD) update loss~\citep{sutton1988learning}: $\mathcal{L}(\theta_V) = \mathbb{E} \left[ \left(Y_t - V_\gamma^\pi (s_t; \theta_V) \right)^2 \right]$, where $Y_t = \sum_{n=0}^{N-1} \gamma ^n r_{t+n} + \gamma^N V_\gamma^\pi(s_{t+n+1})$. In the case of A2C, generally several workers use a policy to synchronously collect a small number of samples in the environment before updating a stochastic parameterized policy ($\pi_\theta(a | s)$). The policy reuses the TD error (the advantage) through a policy gradient update. PPO is similar, except that generally it uses longer Monte Carlo rollouts as in REINFORCE~\citep{williams1992simple}, relying on the value function for its variance reduction baseline properties rather than an estimate of the value in the gradient update. Furthermore, PPO imposes an adaptive trust region on the policy update to prevent the updated policy from straying too far from the prior one. In our case, we use a clipping objective which is proposed by~\citet{PPO} such that the policy is update via the loss $L^{CLIP} (\theta) = \hat{\mathbb{E}} \left[ \min ( r_t(\theta) \hat{A_t}, \text{clip} (r_t (\theta), 1- \epsilon, 1+\epsilon)\hat{A_t} \right],$ where the likelihood ratio is $r_t(\theta) = \frac{\pi_\theta (a_t | s_t)}{\pi_{\theta_{old}}(a_t|s_t)}$, $\hat{A_t}$ is the generalized advantage function~\citep{schulman2015high}, and $\epsilon < 1$ is some small factor to constrain the update. \subsection{Gradient Optimization Methods} We consider several gradient descent-based optimization methods in our analysis: stochastic gradient descent (SGD), SGD with Nesterov momentum (SGDNM)~\citep{nesterov1983method}, Averaged Stochastic Gradient Descent (ASGD)~\citep{polyak1992acceleration}, Adagrad~\citep{duchi2011adaptive}, Adadelta~\citep{zeiler2012adadelta}, RMSProp~\citep{RMSProp}, Adam~\citep{kingma2014adam}, AMSGrad~\citep{amsgrad}, Adamax~\citep{kingma2014adam}, and YellowFin~\citep{zhang2017yellowfin}. In brief, all of these algorithms represent some variation of SGD with differing updates to the learning rate and modifications of the gradient. \citet{ruder2016overview} provides a more detailed overview of these methods, but we briefly describe the variations on SGD here. Momentum can be thought of as accelerating an update in the relevant direction with Nesterov momentum correcting the acceleration upon reaching the next step. ASGD keeps a running average of the parameters $\theta$ and then uses the averaged value for the final result. Overall, the family of adaptive algorithms (Adagrad, Adadelta, RMSProp, Adam, Adamax, AMSGrad, and Adamax) can be thought of as performing a diagonal rescaling of the gradient updates. Adagrad uses a per parameter learning rate instead of a single learning rate, adapting each such that sparse parameters see an increased learning rate by accumulating past gradients. Adadelta is a similar algorithm which attempts to compensate for the monotonically decreasing learning rate resulting from Adagrad's gradient accumulation via a window of gradient accumulation. RMSProp was similarly developed to account for the same issue in Adagrad. Adam also uses per parameter adaptive learning rates, but additionally keeps an exponentially decaying average of prior gradient updates. It uses this in a similar fashion to momentum. As~\citet{heusel2017gans} state, Adam can be described as a ``Heavy Ball with Friction'' such that it ``typically overshoots small local minima that correspond to mode collapse and can find flat minima which generalize well''\footnote{We note that this property is particularly relevant to RL. In online learning and with a shifting loss landscape particularly during exploration-heavy phases, a flat minimum seems unlikely in RL settings.}. Adamax is another variant of Adam which uses the $L_\infty$ norm instead of the $L_2$ norm when scaling gradients. AMSGrad is an update to Adam which claims to improve convergence properties in certain stochastic settings by using the maximum of the past gradients rather than the average. YellowFin attempts to solve the notion of implicit momentum by using an active controller to tune the hyperparameters of momentum SGD. \section{Analysis} We investigate the effects of gradient descent optimization on the family of policy gradient Deep RL algorithms, focusing on the benchmark suite of continuous control tasks (environments) provided by OpenAI Gym~\citep{brockman2016openai}. These tasks yield different dynamics as described by~\citet{henderson2017deep}, while also being small enough to run a large suite of experiments efficiently. We use implementations from~\citet{pytorchrl} for A2C and PPO, modifying the codebase to replace the optimizer. We use the default set of hyperparameters provided by each optimizer except for varying the learning rate as discussed in Section~\ref{sec:lrs} and momentum in Section~\ref{sec:momemtum}. We run 10 random seeds for all experiments and further describe our codebase, setup, and hyperparameters in Appendix~\ref{app:setup}. \subsection{Learning Rates and Performance} \label{sec:lrs} \begin{figure} \centering \includegraphics[width=.49\textwidth]{Ant-v2avg_results} \includegraphics[width=.49\textwidth]{HalfCheetah-v2avg_results} \includegraphics[width=.49\textwidth]{Ant-v2avg_results001} \includegraphics[width=.49\textwidth]{HalfCheetah-v2avg_results001} \caption{A2C (top row) and PPO (bottom row) performance at different learning rates on Ant and HalfCheetah tasks (left and right, respectively). Equivalent to $\alpha$ plots by~\citet{sutton1998reinforcement}.} \label{fig:lrs} \end{figure} First, we investigate the effect of the learning rate on optimizer performance. The results can be seen in Figure~\ref{fig:lrs} (with further information and results in Appendix~\ref{app:lrs}). We observe that SGDNM results in performance that is more stable across a variety of learning rates whereas adaptive methods such as Adam and RMSProp diverge entirely at higher learning rates with a small window of well-performing values in certain domains. However, it is worth noting that, for A2C, adaptive methods do find better optima with a well-tuned learning rate than we were able to find for SGDNM. We further describe several interesting observations from our experimentation on learning rate. As is further seen in Appendix~\ref{app:lrs} and in particular Appendix~\ref{app:lrs_alpha}, there are few settings where AMSGrad significantly improves performance despite the suggestion that it should in theory help in stochastic settings such as RL as suggested in~\citep{amsgrad}. SGD and ASGD generally perform equally across all learning rates. YellowFin is much more stable across learning rates than most algorithms, but this is likely due to the control-based tuning of SGD hyperparameters. It unfortunately does not yield better performance than other well-tuned algorithms. We find that the algorithm distributions across performance can be grouped into 2 categories generally (with the exception of YellowFin and SGDNM). The first set of optimizers, as seen in Figure~\ref{fig:lrs} (RMSProp, AMSGrad, Adam, AdaMax) have a small window of peak performance at lower learning rates and diverge as the learning rates approach $.01$. The second group (Adadelta, ASGD, Adagrad, SGD) has the opposite distribution, showing poor performance at low learning rates while gaining performance in higher learning rates -- with ASGD and SGD consistently outperforming Adadelta and Adagrad. This is likely due to the similarity in base principles used in implementing these two groups as described in~\citep{ruder2016overview}. While SGDNM can predominantly be categorized with the latter group, in reality its performance falls somewhere in between the two. \subsection{Momentum} \label{sec:momemtum} \begin{figure} \centering \includegraphics[width=.49\textwidth]{ppofull} \includegraphics[width=.49\textwidth]{a2cfull} \caption{Normalized performance of PPO and A2C across momentum factors in different environments. Normalization is per environment using a random agent policy (see Appendix~\ref{app:random}) such that the Normalized Return corresponds to $\frac{\text{Average Return} - \text{Random Agent}}{\text{Best Average Return} - \text{Random Agent}}$.} \label{fig:momentums} \end{figure} Next we investigate the effect of momentum on the performance of PPO and A2C. To remove any effects from adaptive aspects of other algorithms we limit the analysis to SGDNM. The goal of these experiments is to probe whether the default momentum hyperparameter of .9 -- that has become the ``industry standard''~\citep{mitliagkas2016asynchrony} -- in fact performs as well as expected. If a lower momentum value is more optimal or yields similar performance as higher momentum values, this may suggest that a sort of implicit momentum is being introduced as described by~\citet{mitliagkas2016asynchrony}, or that the changing loss landscape is negating some of the impact of momentum. We choose the average optimal learning rate of $.003$ for SGDNM as discovered in Section~\ref{sec:lrs} and run a grid of momentum values from $.11$ to $.99$ (with a smaller sub-grid between $.88$ and $.99$ where values tend to diverge). The final results for the various momentum values can be seen on the normalized average performance across 10 training runs with different random seeds provided in Figure~\ref{fig:momentums} (with additional graphs, tables, and information in Appendix~\ref{app:momentum}). Overall, as momentum approached $1$ from $.9$, in nearly all cases the policy diverged -- as updates change the initial momentum very little, they end up relying on the starting conditions for the update. We further find that certain environments are less susceptible to momentum in both A2C and PPO. The varying effectiveness of momentum in different environments may be due to the different dynamics in the systems, as also discussed in~\citep{henderson2017deep}. Furthermore, it could be due to high sensitivity of the loss landscape with respect to small changes in the policy. That is, the loss landscape in certain environments might change significantly from episode to episode even with a minor change in the policy (e.g, environments where the agent might fall over and end the episode early). In such cases, momentum would not bear the same positive impact since the optimum might shift in a different direction. Additionally, we see differences in momentum importance between A2C and PPO. In A2C, the impact of momentum is seen more extensively with values closer to $.9$ yielding large improvements, while in PPO in some environments values remain with 20\% of the optimal momentum returns across all momentum values. The differing behaviours of momentum between PPO and A2C could be attributable to several factors. One effect could be the dissonance caused by constraining the policy while letting the value function update (e.g., the total momentum for the value function is higher than it should be for a constrained policy). Another possible effect could be the nature of long Monte Carlo rollouts by a single worker used by PPO versus small numbers of steps with many workers used in A2C. To probe these effects, we set up another experiment in an attempt to determine if the length of the steps taken in the environment or the number of parallel workers may cause an implicit momentum that should be accounted for. We decreased the number of parallel workers and increased the step size in increments such that the overall number of optimization batch size remained the same and ran a grid of momentum values (see Appendix~\ref{app:steps} for full setup and results). As seen particularly in Appendix~\ref{app:momentum-step-graphs}, there is a slight trend such that lower momentum values see improved performance at higher worker-to-step ratios -- which suggests a source of implicit momentum. However, this trend is noisy and does not generalize to all environments. Overall, while using the default momentum with SGDNM yields close to the optimal results in all cases, the difference in performance improvement at higher momentum values across algorithms and environments provides valuable insights into factors affecting performance in adaptive methods. \section{Conclusion} We show that adaptive gradient descent optimization methods in Deep RL are highly sensitive to the choice of learning rate. In fact, for PPO, the range of well-performing learning rates for adaptive methods is quite small relative to that of simple SGDNM. Furthermore, we show that momentum effect can be dependent on the environment and to some extent as well on the number of steps taken and workers used. This indicates that there may be sources of implicit momentum or other factors that affect adaptive or momentum-based optimization in certain environments. There are also other notions that we did not explore that may have effects in the optimization performance which may be explored in future work (examples discussed in Appendix~\ref{app:otherfactors}). Generally, given current methods, we suggest tuning optimization methods as per the analysis provided here. For example, a small well-tuned learning rate with Adam or RMSProp provides the best performance overall, while relying on SGDNM with momentum equal to $.9$ for PPO yields generally acceptable performance across a wider range of learning rates. More importantly though, our findings demonstrate that the use of default values with adaptive optimizers may not be enough for the unique properties of Deep RL. Both the adaptive methods and non-adaptive methods still require hyperparameter tuning to perform well -- with different optimal settings in each environment. However, tuning may be difficult in more complex environments or online settings, causing issues of fairness, reproducibility, and efficiency~\citep{henderson2017deep}. Furthermore, recent work proposed that algorithms be evaluated on a small neighbourhood of hyperparameters to determine robustness as this may be a crucial factor for real-world usage \citep{cohen2018distributed}. While tuning may be acceptable in simple settings in the interim, further research is likely needed into developing or using adaptive gradient descent optimization methods which account for changing loss landscapes in different environments and the unique dynamics of Deep RL algorithms. Such research may allow for evaluation as suggested by~\citet{cohen2018distributed}, yield more reproducible results by avoiding brittle hyperparameters, improve scalability and robustness, and move toward lifelong learning, online, and complex settings where tuning may not be possible or practical. We hope that the analysis and insights we provide here can be used as a foundation for building such Deep RL-specific optimization methods. \vskip 0.2in
{'timestamp': '2018-10-08T02:06:06', 'yymm': '1810', 'arxiv_id': '1810.02525', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02525'}
arxiv
\section{Introduction} \label{sec:intro} Recent developments in molecular technologies have allowed us to perform complex biological experiments aiming at learning the principles of signaling networks in living organisms. For instance, the knowledge of a biochemical network of physiological processes of living cells offers insights into developing targeted therapies for a wide range of diseases, such as cancer, diabetes and more, by suggesting possible targets in gene pathways. In addition, decoding these mechanisms in organisms with regeneration capabilities, like the zebrafish, can potentially help biologists at least partially answer questions about why humans lack these abilities. However, reverse engineering biochemical networks from observed data has proven to be challenging from both statistical and computational standpoints \citep{oates2012network,daniels2015automated}. Indeed, the high-throughput molecular technology pushes the boundary of a classical statistical inferential paradigm, as the molecular quantification methods such as next generation sequencing, cellular flow cytometry, and fluorescence microscopy (see, e.g. \cite{Perez:2004fk,Wheeler:2008ys}), provide large amounts of high dimensional, longitudinal data from partially observed and poorly understood biochemical systems. The goal of most statistical inference problems in this setting is either one of structure (topology) or parameter estimation \citep{oates2014causal}. Although related, these two inference areas are often considered separately. The first addresses the structure of the underlying biochemical network, i.e. which chemical species directly alters the production rate of another. In this paradigm the object of interest is usually a directed graph or a binary adjacency matrix describing the gene regulation structure of the system. Bayesian networks \citep{pearl1985bayesian, pearl1986fusion}, and, more recently, dynamic Bayesian networks, have been used for learning topology of such models since their graphical structure, which is encoded through distributional assumptions, is in essence the desired output \citep{morrissey2010reverse, morrissey2011inferring}. Bayesian networks and other similar graphical models are appealing because they provide biologists with a simple visual representation of the network. However, the fundamental disadvantage of simple graphical approaches is their reduction of a detailed kinetic view of the system to a set of often unrealistic assumptions on the relationships between graph nodes (representing either chemical or molecular species, like genes). For instance, although it is known that the interactions of species in biological systems typically exhibit a high degree of nonlinearity, it is often assumed that nodes are hierarchically (acyclically) linearly related, with the conditional Gaussian distributions. A practical disadvantage of these methods is that their solutions are of non-polynomial time complexity, and hence algorithms used for model fitting lead to suboptimal solutions, for instance by requiring greedy algorithms. Markov chain Monte Carlo (MCMC) routines have been shown to give moderate improvement in terms of finding optimal network structure, but computational issues still persist. In addition to network structure or topology estimation, the second related inference area is that of network parameters (e.g., reaction rates) estimation. Typically, the methods here focus on fitting detailed kinetic models to the data. Their appeal lies in the fact that they rely on more precise representations of the underlying dynamical system \citep{fearnhead2014inference,golightly2005bayesian,golightly2012,oates2012network}. Their disadvantages are numerous however, particularly of the methods based on exact likelihoods, where the inference is usually not feasible for systems of relevant sizes, i.e. hundreds to thousands of species and reactions. For that reason the corresponding Bayesian frameworks based on the exact likelihoods are usually not applicable to topology estimation \citep{boys2008bayesian,choi2012inference}. Methods based on approximate likelihood, like the linear noise approximation (or LNA, see \citep{komorowski2009bayesian}), fare somewhat better, but they also usually do not allow for efficient posterior sampling due to the complicated form of the likelihood approximation (see, for instance, \citep{Linder:2015aa}). In this paper, we develop a fully Bayesian inference framework for stochastic reaction networks {on both structure and parameters} given time course trajectories from the stochastic dynamical systems under mass action kinetics. The method uses summary statistics to form a synthetic likelihood following the ideas presented by \cite{Wood:2010aa}. The advantage of the proposed methodology is that the synthetic likelihood is based on detailed kinetic models, and its form permits topology and parameter estimation simultaneously, instead of separately. Our approach is Bayesian and allows efficient computation of the posterior network structure through point mass priors on parameters. An outline of the paper beyond the current section is as follows. In Section 2 we describe the types of dynamical systems under consideration. In Section 3 we describe the synthetic likelihood, the relevant priors, and outline an efficient MCMC algorithm to sample posteriors. The model fitting is performed using in silico reaction network data in Section 4 and RNA-seq data from controlled experiments in the zebrafish in Section 5. In Section~5 we also give an example of application of our framework beyond biochemical systems by analyzing historic data from the 1665-1666 plague outbreak in Eyam, England. The technical details of the MCMC algorithm derivations and R code implementation are available in the online Supplementary Material. \section{Stochastic reaction network system} The reaction systems we consider consist of $s$ chemical species, along with a set of $r$ reaction channels where commonly $r > s$. We denote the system state at time $t$ as the vector $X(t)$ of dimension $s$, containing molecular counts of each species. The constant $\kappa_k \ge 0$ gives the reaction rate or speed of the $k^{th}$ reaction, $k=1, \dots, r$. When the $k^{th}$ reaction occurs at time $t$, the system transitions according to the integer valued vector $\nu_k^\prime - \nu_k$, where $\nu^\prime_k$ is a vector of non-negative integers representing the number of species produced by reaction $k$ and $\nu_k$ representing the number consumed, i.e. \begin{equation*}X(t)=X(t-)+\nu_k^\prime-\nu_k. \end{equation*} where $X(t-)$ is the system state at the instantaneous time before $t$. We denote by $n$ the system volume, typically the physical volume of the container (e.g., cell) times Avagadro's number, and by $Y_k$ the unit Poisson processes. Our further analysis is on systems that are well-stirred and thermally equilibrated, with processes obeying the classical mass action rate laws, \citep[see, e.g.,][]{gillespie1992rigorous} corresponding combinatorially to the number of different ways we can choose molecular substrates needed for the reaction $k$ to occur \citep[chapter 10]{ethier2009markov}. Defining $|\nu_k|=\sum_i \nu_{ik}$, the rates are \begin{equation*} \lambda^{(n)}_k(x)=n\kappa_k\frac{\prod_i\nu_{ik}!\binom{x_i}{\nu_{ik}}}{n^{|\nu_{k}|}}. \end{equation*} The nonhomogenous Poisson process with the above propensity function (see also \citep{gillespie1992rigorous}) gives the system time-evolution equation \begin{equation}\label{eq:2} X(t)=X(0)+\sum_kY_k(\int_0^t\lambda_k^{(n)}(X(s))ds)(\nu_{k}^\prime-\nu_k). \end{equation} The model in Equation \eqref{eq:2} is often considered the most accurate representation of true system dynamics, and is in the general class of density dependent Markov jump processes (DDMJP). While the class of DDMJP models are often used to describe a wide variety of physical systems, like gene regulatory networks and stochastic epidemics, unfortunately the corresponding inference is complicated by highly intractable exact likelihoods. Letting $c=n^{-1}x$ we obtain species concentrations {(say, in moles per unit volume or relative density)}. The asymptotic notion of a large volume limit represents the system's behavior as its volume increases to infinity while the species numbers are kept at constant concentrations. This gives the classical deterministic law of mass action ordinary differential equation (ODE), which is referred in the chemical literature \citep{van1992stochastic} as the {\em reaction rate equation} \begin{equation}\label{eq:rre} \dot{c}(t)=\sum_k\kappa_k \prod_i c^{\nu_{ik}}_i(t)(\nu_k^\prime-\nu_k). \end{equation} The solution of the above ODE $c^{\boldsymbol{\beta}}$ is parameterized by a vector $\boldsymbol{\beta}$, a linear combination of the kinetic rates $\kappa_k$ of interest, as well as the initial condition $c(0)$. In what follows we will focus on estimation of $\boldsymbol{\beta}$ under the assumption that it is a linear transformation of the $\kappa_k$'s. It is well known that identifiability of reaction networks is a nontrivial problem and is only guaranteed when certain reaction vectors are linearly independent for each source complex \citep{craciun2008identifiability}. However, the reparameterization from $\boldsymbol{\kappa}$ to $\boldsymbol{\beta}$ can be done so as to ensure that $\boldsymbol{\beta}$ is identifiable, as is the case for the examples we consider below. Results in \cite{Remp12} show that the least squares estimator, $\hat{\boldsymbol{\beta}}$, which minimizes the distance between the data and the solution to \eqref{eq:rre} is consistent and asymptotically normal. These asymptotic properties are also true for solutions to the so-called {\em martingale estimating functions}, which are a generalization of the least squares estimator in this case \citep{bibby1995martingale}. Both methods produce statistics that are easily obtained from time course trajectories of the system. In what follows, we use the asymptotic properties of these statistics {and their estimating equations} to form a synthetic likelihood. The synthetic likelihood serves as a surrogate for, often intractable, exact likelihood and may be used in the same way to perform the usual Bayesian inference. \section{Synthetic likelihood}\label{sec:lfm} Ideally, parametric inference would be based on the likelihood function since, under the typical regularity conditions, maximum likelihood estimates enjoy good asymptotic properties, such as consistency and efficiency. {The likelihood approach also gives one the ability to perform Bayesian inference. Unfortunately, the usage of exact likelihood methods for parameter estimation in stochastic biochemical networks faces some challenges due to the need for computationally demanding routines, like, for instance, the particle filters \citep{Golightly:2011aa}. For that reason many authors have focused on approximate likelihood methods for reaction networks \citep{fearnhead2014inference,golightly2005bayesian,golightly2012,oates2012network}. However, major practical limitation of many such methods, for instance, approximate Bayesian computation (ABC) is their slow convergence and poor mixing in high dimensional problems \citep{csillery2010approximate}. To circumvent these technical complication we propose here an alternative method that is based on the idea of synthetic likelihood \citep{Wood:2010aa}. } To introduce some notation, consider the data $D_j, \hspace{2mm} j=1,\ldots, N$ or the $j^{th}$ system trajectory consisting of $X_{ij}^{(n,\beta)} \in {\mathbb Z}^s_{\ge 0}$, which are the observed counts of $s$ species, measured at a discrete grid of timepoints, $t_{ij}$, ($t_{1j},\dots,t_{m_jj}=T_j<\infty)$ not necessarily equidistant across trajectories, and with possibly different endpoints; i.e., $t_{m_jj}$ not necessarly equal to $t_{m_kk}$. We assume that this observed data arrives from trajectories of the process for which the system volume $n$ is fixed and known and define the concentration values as $C_n(t_{ij})=\boldsymbol{X}_j(t_{ij})/n$. The LSE for the $j^{th}$ observation is then any solution of the optimization problem \begin{equation}\label{eq:LSE} \hat{\boldsymbol{\beta}}_j=\underset{\boldsymbol{\beta}}{\textrm{argmin}} \sum_{t_{ij}} ||C_n(t_{ij})-c^{\boldsymbol{\beta}}(t_{ij})||_2^2 \end{equation} or equivalently any solution to the following estimating equation \begin{equation}\label{eq:EE} \sum_{t_{ij}} \partial c^{\boldsymbol{\beta}}(t_{ij})(C_n(t_{ij})-c^{\boldsymbol{\beta}}(t_{ij}))=0. \end{equation} Asymptotic properties, (as $n \rightarrow \infty $), and the regularity conditions for the consistency and normality of these solutions were discussed in \cite{Remp12}, with all systems under consideration here satisfying these conditions. The expression above is similar in form to the generalized estimating equations (GEEs) \citep{Zeger:1986aa}. GEEs have been used extensively for correlated and longitudinal data where a parametric form of the mean is known but the likelihood function is not readily available. The appeal of GEE estimates is that they exhibit many of the same properties of maximum likelihood estimates \citep{Zeger:1986aa}, even when the correlation structure of the dependent observations is misspecified. \\ \indent The ideas from GEEs were extended to discretely observed diffusion processes in \cite{bibby1995martingale} by considering so-called martingale estimating functions (MEF). Defining the filtration $\mathcal{F}_{ij}=\sigma(X(t_{1j}),\dots,X(t_{ij}))$, scaling the process by $n$, consider all zero-mean $P_{\boldsymbol{\beta}}$-martingale estimating functions of the form \begin{equation}\label{eq:MEF} G_j(\boldsymbol{\beta})=\sum_{t_{ij}} g_{(i-1)j}(\boldsymbol{\beta})(C_n(t_{ij})-F_i(C_n(t_{i-1j}),\boldsymbol{\beta})) \end{equation} where $g_{(i-1)j}$ is $\mathcal{F}_{(i-1)j}$ measurable and $F_i(x,\boldsymbol{\beta})=E_{\boldsymbol{\beta}}(C_n(t_{ij})|x)$. It was also shown in \cite{bibby1995martingale} that the optimal estimating function, in the sense of the smallest asymptotic dispersion and where the data is assumed to arise from discrete observations of a diffusion, is of the form $g_{(i-1)j}=\dot{F}_i(C_n(t_{(i-1)j}),\boldsymbol{\beta})\rho_i(C_n(t_{(i-1)j}),\boldsymbol{\beta})^{-1}$ with $\rho_i(C_n(t_{(i-1)j}),\boldsymbol{\beta})=Var_{\beta}(C_n(t_{ij})|C_n(t_{(i-1)j}))$. The optimal estimating function may be approximated by, $\tilde{g}_{(i-1)j}$, with the substitutions $\tilde{F}_i(x,\boldsymbol{\beta})=c^{\boldsymbol{\beta}}(t_{ij})$ as well as $\tilde{\rho}_i(C_n(t_{(i-1)j}),\boldsymbol{\beta})=\hat{Var}_{\boldsymbol{\beta}}(C_n(t_{ij})|C_n(t_{(i-1)j}))$. Fitting may then be done iteratively by first updating the weights in \eqref{eq:MEF} for the current value of $\boldsymbol{\beta}=\boldsymbol{\beta}^{(k-1)}$ with $\tilde{g}_{(i-1)j}(\boldsymbol{\beta}^{(k-1)})$ and then updating $\boldsymbol{\beta}=\boldsymbol{\beta}^{(k)}$ by solving \eqref{eq:MEF} and repeating this process until convergence, or by replacing $\tilde{\rho}$ with its empirical estimate. \subsection{Form of the Synthetic Likelihood} Given the partially observed trajectory, $\boldsymbol{X}_j$, we denote by $\hat{\boldsymbol{\beta}}_j$ the solution of either \eqref{eq:EE} or \eqref{eq:MEF}. In the mass action setting, the ODE coefficients $\boldsymbol{\beta}$ are linear combinations of the reaction rates and can be written as $\boldsymbol{\beta}=Q\boldsymbol{\kappa}$ where $Q$ is a $d\times r$ matrix (see, e.g., \citep{Linder:2013aa}). {Some specific examples of $\boldsymbol{\beta}$ and $Q$ are given in Section 4 below.} It is straightforward to show that $\hat{\boldsymbol{\beta}}_j$ is asymptotically Gaussian; i.e., $\sqrt{n}(\hat{\beta}-Q\boldsymbol{\kappa}) \rightarrow \mathcal{N}(0,\Sigma)$ as previously mentioned, see Supplementary Material. \begin{comment} \begin{prop} The statistics, $\hat{\boldsymbol{\beta}}_j$, of Equations \eqref{eq:LSE} and \eqref{eq:MEF} computed from the $j^{th}$ trajectory of data arising from the DDMJP in Equation \eqref{eq:2} are asymptotically sufficient for $\boldsymbol{\beta}=Q\boldsymbol{\kappa}$ as $n \rightarrow \infty$. \end{prop} \begin{proof} Let $D_j$ be the $j^{th}$ trajectory arising from the DDMJP in Equation \eqref{eq:2}. Assume that $\boldsymbol{\kappa}$, and hence $\boldsymbol{\beta}=Q\boldsymbol{\kappa}$, is the true parameter and let $\hat{\boldsymbol{\beta}}$ be a solution to $G_j(\hat{\boldsymbol{\beta}})=0$ in Equation \eqref{eq:MEF}, which necessarily satisfies \begin{align*} 0=&\sum_{t_{ij}} \partial c^{\hat{\boldsymbol{\beta}}}(t_{ij})(Var_{\hat{\boldsymbol{\beta}}}(C_n(t_{ij})))^{-1}(C_n(t_{ij})-c^{\hat{\boldsymbol{\beta}}}(t_{ij})) \nonumber \\ =&\sum_{t_{ij}} \partial c^{\hat{\boldsymbol{\beta}}}(t_{ij})(Var_{\hat{\boldsymbol{\beta}}}(C_n(t_{ij})))^{-1}(C_n(t_{ij})-c^{\boldsymbol{\beta}}(t_{ij})+c^{\boldsymbol{\beta}}(t_{ij})-c^{\hat{\boldsymbol{\beta}}}(t_{ij})) \nonumber \\ =&\sum_{t_{ij}} \partial c^{\hat{\boldsymbol{\beta}}}(t_{ij})(Var_{\hat{\boldsymbol{\beta}}}(C_n(t_{ij})))^{-1}(C_n(t_{ij})-c^{\boldsymbol{\beta}}(t_{ij})) \nonumber \\ &+\sum_{t_{ij}} \partial c^{\hat{\boldsymbol{\beta}}}(t_{ij})(Var_{\hat{\boldsymbol{\beta}}}(C_n(t_{ij})))^{-1}(c^{\boldsymbol{\beta}}(t_{ij})-c^{\hat{\boldsymbol{\beta}}}(t_{ij})) \end{align*} implying that \begin{equation}\label{eq:proof} \sum_{t_{ij}} \partial c^{\hat{\boldsymbol{\beta}}}(t_{ij})(Var_{\hat{\boldsymbol{\beta}}}(C_n(t_{ij})))^{-1}(c^{\hat{\boldsymbol{\beta}}}(t_{ij})-c^{\boldsymbol{\beta}}(t_{ij}))=\sum_{t_{ij}} \partial c^{\hat{\boldsymbol{\beta}}}(t_{ij})(Var_{\hat{\boldsymbol{\beta}}}(C_n(t_{ij})))^{-1}(C_n(t_{ij})-c^{\boldsymbol{\beta}}(t_{ij})) \end{equation} Taylor's expansion of the left hand side of Equation \eqref{eq:proof} about $\boldsymbol{\beta}=Q\boldsymbol{\kappa}$ and scaling by $\sqrt{n}$ gives \begin{equation} \sqrt{n}(\hat{\boldsymbol{\beta}}-Q\boldsymbol{\kappa}) \rightarrow (B_{\hat{\boldsymbol{\beta}}})^{-1} \sum_{t_{ij}}\partial c^{\hat{\boldsymbol{\beta}}}(t_{ij})(Var_{\hat{\boldsymbol{\beta}}}(C_n(t_{ij})))^{-1}\sqrt{n}(C_{n}(t_{ij})-c^{\boldsymbol{\beta}}(t_{ij})) \end{equation} where $ B_{\hat{\boldsymbol{\beta}}}=\sum_{i}\partial c^{\hat{\boldsymbol{\beta}}}(t_{i})(Var_{\hat{\boldsymbol{\beta}}}(C_n(t_{ij})))^{-1}[\partial c^{\hat{\boldsymbol{\beta}}}(t_i)]^\top$ and the higher order terms in the expansion vanish since $\hat{\boldsymbol{\beta}}$ is consistent for $\boldsymbol{\beta}$, under the regularity conditions in \cite{Remp12}. Consistency and the asymptotic normality of $\sqrt{n}(C_{n}(t_{ij})-c^{\boldsymbol{\beta}}(t_{ij}))$, imply that $\sqrt{n}(\hat{\boldsymbol{\beta}}-Q\boldsymbol{\kappa}) \Rightarrow \mathcal{N}(0,\Sigma)$, where $\Sigma$ is the limiting covariance, see \cite{Linder:2013aa,Linder:2015aa}. \end{proof} \end{comment} The normality of $\hat{\beta}$ allows to express the synthetic likelihood for the $j^{th}$ trajectory (replicate) as \begin{equation}\label{eq:SL} SL_j(\boldsymbol{\kappa}, \Sigma|\hat{\boldsymbol{\beta}}_j):=f(\hat{\boldsymbol{\beta}}_j|Q \boldsymbol{\kappa}, \Sigma)=(2\pi)^{-d/2}|\Sigma/n|^{-1/2}\exp\bigg\{-\frac{1}{2}(Q\boldsymbol{\kappa}-\hat{\boldsymbol{\beta}}_j)^\top (\Sigma/n)^{-1}(Q\boldsymbol{\kappa}-\hat{\boldsymbol{\beta}}_j) \bigg\} \end{equation} where $\Sigma$ is the corresponding limiting covariance matrix. We have maintained the standard likelihood notational convention by writing it as a function of parameters, given data. This is in sharp contrast to the majority of ABC type methods, where such data summaries are typically chosen in an ad-hoc fashion. Unfortunately, the Pitman-Koopman-Darmois (PKD) theorem essentially guarantees the failure of ABC type methods, since it states that the existence of finite dimensional sufficient statistics is a unique property of the exponential family. {The implications of PKD are thus quite disappointing in the context of ABC methods, where typically the interesting (non-analytic) likelihoods are outside of the exponential family. Consequently, ABC methods based on finite dimensional summary statistics are typically guaranteed to suffer information loss vis a vis exact likelihood inference.} Consider the $j^{th}$ trajectory and the $(dm_j) \times 1$ vector of stacked species concentrations, $\boldsymbol{C}_j=\textrm{vec}(\boldsymbol{X}_j)/n$; i.e., by stacking the concentration vectors at each timepoint. The central limit theorem for DDMJP then gives $\sqrt{n}(\boldsymbol{C}_j-\boldsymbol{c}^\kappa) \Rightarrow \mathcal{N}(0,\Sigma_\kappa)$, so that the trajectory data likelihood, { $L(\boldsymbol{\kappa}|D)=L(\boldsymbol{\kappa}|\textrm{vec}(\boldsymbol{X}_j)/n)$ converges as $n\to \infty$ to the Gaussian likelihood $(2 \pi)^{-dm_j/2}|\Sigma_\kappa/n|^{-1/2} \exp \{-1/2(\boldsymbol{C}_j-\boldsymbol{c}^\kappa)^\top (\Sigma_\kappa/n)^{-1} (\boldsymbol{C}_j-\boldsymbol{c}^\kappa)\}$. }The law of large numbers and consistency of $\hat{\beta}_j$ imply that $\boldsymbol{C}_j \approx \boldsymbol{c}^{\hat{\beta}_j}$, so that \begin{equation*} L(\boldsymbol{\kappa}|\textrm{vec}(\boldsymbol{X}_j)/n) \approx (2 \pi)^{-dm_j/2}|\Sigma_\kappa/n|^{-1/2} \exp \{-1/2(\boldsymbol{c}^{\hat{\beta}_j}-\boldsymbol{c}^\kappa)^\top (\Sigma_\kappa/n)^{-1} (\boldsymbol{c}^{\hat{\beta}_j}-\boldsymbol{c}^\kappa)\}. \end{equation*} {The above approximation is seen to hint at a notion of asymptotic sufficiency (AS) in the sense of \cite{le1956asymptotic}. AS is essentially an asymptotic Neyman-Fisher factorization, and it implies that, at least asymptotically, the chosen statistics contain meaningful information, thus offering some notion of efficiency, even in light of the PKD theorem. However, establishing AS property more formally requires careful analysis of specific inferential problems on case by case basis. For further discussion, see, for instance, \cite{frazier2016}. } It is important to note that in the above arguments, $\Sigma_\kappa$ is the process covariance matrix for the stacked concentration vector in the approximate data likelihood and not the covariance of the summary statistics ($\Sigma$) in the synthetic likelihood. In fact, since $\Sigma$ also depends on $\boldsymbol{\kappa}$, its usage in the likelihood function above would break down the conjugacy and the efficient MCMC via Gibbs sampling would be no longer available. Thus, when we have a single trajectory, as in the Eyam plague example below, we use the asymptotic covariance matrix of the summary statistic, $\hat{\Sigma}_{\hat{\beta}_j}$ for $\hat{\beta}_j$, to form the synthetic likelihood, although we have suppressed the explicit subscript notation for simplicity. When multiple trajectories are available, we additionally have the ability to assess the between trajectory variation of the summary statistics. See below for details. The transition from the original likelihood to the synthetic likelihood shifts our analysis into the setting of a classical linear model. Thus, this approach is vastly different from most of the currently used ones. Specifically, methods based on the reaction rate equation use ODE solutions as the means of corresponding Gaussian likelihoods \citep{girolami2008bayesian}, for instance, those based on the diffusion approximation and the LNA \citep{komorowski2009bayesian,fearnhead2014inference}. These approaches, while being approximations, still face serious computational challenges. The main bottleneck for inference, particularly Bayesian one, in these models is non-conjugacy, since the ODE means are not linear in the parameters. As such, each iteration of MCMC requires solving complex systems of nonautonomous ODEs at each proposal value, like in \cite{girolami2008bayesian}. This can make tuning proposal distributions with good acceptance properties difficult, leading to chains with poor mixing. The ABC methods do not fare much better, since they require summary statistic, distance measure, and tolerance selection that are often ad-hoc. These problems severely limit the applicability and scalability of the current approximate procedures. In contrast, our synthetic likelihood approach circumvents the need to choose distance measures and tolerance levels {by using data summaries that are well understood, and allow for their analysis via standard MCMC. It also only involves solving ODE systems once (to compute initial summary statistics and covariances) thus avoiding the iterative usage of the ODE solver. Finally, the synthetic likelihood form leads itself to the efficient formulation of the MCMC computation steps via a Metropolis-within-Gibb's procedure.} \subsection{Prior Specification} The Bayesian approach to network estimation can be addressed by using specialized priors that allow coefficients to be in the model or out of the model during iterations of MCMC, leading to positive {posterior probabilities of zero value.}Various mixtures of mutually singular distributions, each dominated by $\sigma$-finite measures are a natural choice. Here, we assume a discrete mixture of the point mass at zero, $\delta_0$, and a continuous distribution, $F$, supported on the positive reals and dominated by the Lebesgue measure $\Pi=(1-\omega)\delta_0+\omega F$. Restricting the support of $F$ to positive reals is necessary to convey the fact that kinetic parameters are non-negative. {It was shown in \cite{gottardo2008markov} that when the prior probability of non-zero rate for reaction $k$ is $\omega_k$, the corresponding density for $\kappa_k$ is of the form} \begin{equation}\label{eq:SLprior} \pi(\kappa_k):=\frac{d \Pi}{d(\delta_0+\mu)}=(1-\omega_k)\mathbb{I}_0(\kappa_k)+\omega_k f(\kappa_k) \mathbb{I}_{\mathbb{R}^+}(\kappa_k) \textrm{ a.e }\delta_0+\mu \end{equation} where $\mathbb{R}^+=\{x:x>0\}$. Priors of the form \eqref{eq:SLprior} lead to minimax rates of estimation and posterior contraction on sparse sets, provided the tails of $F$ are exponential or heavier (see, e.g., \cite{johnstone2004needles, castillo2012needles}). Thus, priors of the form \eqref{eq:SLprior} are optimal under certain criteria and are usually considered the theoretical gold standard for variable selection in the Bayesian setting. To that end, we assume that $f(\kappa_k|\lambda_k)=\lambda_k \exp\{- \lambda_k \kappa_k \} \mathbb{I}_{\mathbb{R}^+}(\kappa_k)$, which is the exponential, or one-sided Laplace, distribution. Our choice of the exponential is motivated by several important factors: it naturally restricts the support of $\boldsymbol{\kappa}$ to positive reals, it satisfies the tail requirements mentioned previously, and from the information theoretic perspective it is the maximum entropy prior with mean $\frac{1}{\lambda_k}$ {(see \citep{robert2007bayesian}, Chapter 3)}. It may also be rewritten hierarchically as $f_1(\kappa_k|\tau_k)=\sqrt{\frac{2 }{\pi \tau_k}}\exp\{- \kappa_k^2/2\tau_k \} \mathbb{I}_{\mathbb{R}^+}(\kappa_k)$, with $f_2(\tau_k|\lambda_k)=\frac{\lambda_k^2}{2}\exp \{-\lambda_k^2 \tau_k/2 \}$, via the identity $\int_0^\infty f_1(\kappa_k|\tau_k) f_2(\tau_k|\lambda_k) d\tau_k=f(\kappa_k|\lambda_k)$ \citep{west1987scale,andrews1974scale}. By writing the prior as a scaled mixture of truncated normals, the form of $\boldsymbol{\kappa}$'s full conditionals becomes analytically tractable, as is demonstrated in the Supplementary Material. This gives significant computational advantage to our framework, since priors like \eqref{eq:SLprior} often lead to non-conjugacy, in which case full Metropolis-Hastings (MH) is required for sampling. Although adaptive MH-based MCMC algorithms have been designed to produce chains with desirable acceptance rates \citep{ji2013adaptive}, when the likelihood is complicated or not analytic, as in the present situation, such tuning is not straightforward. Thus when appropriate tuning cannot be done, the resulting chains may exhibit poor mixing and require extremely long run times for sufficient exploration of parameter space. In what follows, we detail the Gibbs sampling procedure, which performs tuning automatically, for posterior sampling under our hierarchical model. Our primary interest is in obtaining the posterior probability that reactions are true, which allows one to infer the reaction network structure. In order to accommodate varying experimental conditions, such as differences in measurement error or experiments with data collected at different timepoints, we place a Wishart prior on the covariance matrix, $\Sigma | \Psi \sim \mathcal{W}(v,\Psi)$. This is in contrast to the common assumption of the inverse-Wishart, see \cite{daniels1999nonconjugate,bouriga2013estimation,alvarez2014bayesian} for {some} examples. Our approach is similar to \cite{chung2015weakly}, in that we assume a Wishart (not inverse-Wishart) prior for $\Sigma$ that leads to desirable modal properties of the posterior. We select the hyperparameter $\Psi$ to be the empirical covariance of $\beta$, and when this estimate is not full rank we add a small regularization term, $10^{-5}$, to its diagonals. \begin{comment}We remark briefly that it is possible to assume the Jeffreys' noninformative prior on the covariance, $\pi^\ast(\Sigma) \propto |\Sigma|^{\frac{-(d+1)}{2}}$. This prior specification will maintain conditional conjugacy and results in the Gibbs sampler similar to the one developed below, with minor modification to the full conditional of $\Sigma$, see Supplementary Material. In this situation the posterior is proper almost surely ($\mu^{Nd}$) when $N \ge d$ and improper when $N < d$, where $\mu^{Nd}$ is Lebesgue measure on $\mathbb{R}^{Nd}$. \end{comment} The hierarchical model under consideration is then \begin{align}\label{eq:Model} SL(\boldsymbol{\kappa},\Sigma|D)=&\prod_j^N SL_j(\boldsymbol{\kappa},\Sigma|\hat{\boldsymbol{\beta}}_j) \nonumber \\ \pi_1(\boldsymbol{\kappa}|\boldsymbol{\lambda})=&\prod_{k}\bigg((1-\omega_k)\mathbb{I}_0(\kappa_k)+\omega_k \lambda_k \exp\{- \lambda_k \kappa_k \} \mathbb{I}_{\mathbb{R}^+}(\kappa_k)\bigg) \nonumber \\ \pi_2(\Sigma|\Psi)=&\frac{|\Psi|^{-v/2}|\Sigma|^{(v-d-1)/2}\exp\{-\frac{1}{2}\mathrm{tr}\Psi^{-1} \Sigma \}}{2^{vd/2}\Gamma_d(\frac{v}{2})} \end{align} where $j=1,...,N$ indexes the $N$ independent trajectories of the process. The model contains a covariance term, $\Sigma$, and this parameter may represent intrinsic stochastic noise, as well as measurement error which will dominate in the large volume limit. This parameter is not of particular interest for network or kinetic rate estimation, and a clear advantage of the Bayesian framework is the ability to marginalize this nuisance parameter {out of} the posterior. Importantly, {we show } that the marginal synthetic posterior distribution, $\pi (\boldsymbol{\kappa}|D)$ is unimodal when $v \ge N+d+1$ and $\lambda_k=\frac{1-\omega_k}{\omega_k}$ (see Supplementary Material). This is a key property of the proposed method that not only guarantees identifiability of the reaction network but also {contributes to the observed rapid mixing of the MCMC procedure}. \begin{comment} \begin{prop} The point mass mixture prior, $\pi_1(\boldsymbol{\kappa})$, in Equation \eqref{eq:SLprior} with \\ $f(\kappa_k)=\lambda_k \exp\{- \lambda_k \kappa_k \} \mathbb{I}_{\mathbb{R}^+}(\kappa_k)$ with $\lambda_k=\frac{1-\omega_k}{\omega_k}$ is a logarithmically concave and hence a unimodal function of $\boldsymbol{\kappa}$. \end{prop} \begin{proof} The exponential density, $f(\kappa_k)=\lambda_k \exp\{-\lambda_k \kappa_k \}$ belongs to the log-concave class of densities; i.e., for any $x, y \in \mathbb{R}^+$ we have $f(\alpha x + (1-\alpha)y) \ge f(x)^{\alpha}f(y)^{1-\alpha}$ for $\alpha \in (0,1)$. Thus, if $x$ and $y$ are both positive we have \begin{align*} \pi_1(\alpha x + (1-\alpha)y)=\omega f(\alpha x + (1-\alpha)y) & \ge \omega f(x)^{\alpha}f(y)^{1-\alpha} \\ & =(\omega f(x))^{\alpha} (\omega f(y))^{1-\alpha} \\ &= \pi_1(x)^{\alpha} \pi_1(y)^{1-\alpha} \end{align*} When both $x$ and $y$ are zero we have $\pi(\alpha x + (1-\alpha)y)=\pi(0)=1-\omega = (1-\omega)^{\alpha}(1-\omega)^{1-\alpha}=\pi(0)^{\alpha}\pi(0)^{1-\alpha}$. When only one is zero, say $y$ then \begin{align*} \pi(\alpha x + (1-\alpha)y)=\omega f(\alpha x + (1-\alpha)y) & \ge \omega f(x)^{\alpha}f(0)^{1-\alpha}\\ & =(\omega f(x))^{\alpha} (\omega f(0))^{1-\alpha} \\ &= \pi(x)^{\alpha} (\omega \frac{1-\omega}{\omega})^{1-\alpha} \\ &= \pi(x)^{\alpha} \pi(0)^{1-\alpha} \end{align*} \end{proof} Thus, by choosing $\lambda_k=\frac{1-\omega_k}{\omega_k}$ the prior $\pi$ is a continuous function (in the classical sense) of $\boldsymbol{\kappa}$, and is proportional to $\prod_k f(\kappa_k|\lambda_k)$ \begin{prop} If $\lambda_k=\frac{1-\omega_k}{\omega_k}$ and $v \ge N+p+1$, the marginal synthetic posterior distribution from the synthetic likelihood model, $\pi(\boldsymbol{\kappa}|D)$, is unimodal. \end{prop} \begin{proof} The synthetic posterior is proportional to \begin{align}\label{eq:posterior} \pi(\boldsymbol{\kappa},\Sigma|D) &\propto SL(\boldsymbol{\kappa},\Sigma|D)\pi_1(\boldsymbol{\kappa}|\boldsymbol{\lambda})\pi_2(\Sigma|\Psi) \nonumber \\ & \propto |\Sigma|^{(v-N-d-1)/2} \exp\big\{-\frac{1}{2}\mathrm{tr}(\Psi^{-1} \Sigma) \big\} \exp\big\{-\frac{n}{2}\sum_j (Q \boldsymbol{\kappa}-\hat{\beta}_j)^\top \Sigma^{-1}(Q \boldsymbol{\kappa}-\hat{\beta}_j)\big\} \nonumber \\ & \times\pi_1(\boldsymbol{\kappa}|\boldsymbol{\lambda}). \end{align} The logarithm of the first term in the product, $(v-N-d-1)/2 log |\Sigma|$, is concave when $v \ge N+d+1$, since $log |\Sigma|$ is concave. Logarithmic concavity of the second term follows from convexity of $tr(\Sigma)$. Consider an individual factor from the third term, $\exp\{-\frac{n}{2}(Q \boldsymbol{\kappa}-\hat{\beta}_j)^\top \Sigma^{-1}(Q \boldsymbol{\kappa}-\hat{\beta}_j) \} $. The function $(Q \boldsymbol{\kappa}-\hat{\beta}_j)^\top \Sigma^{-1}(Q \boldsymbol{\kappa}-\hat{\beta}_j) $ has epigraph $\textrm{epi}\big((Q \boldsymbol{\kappa}-\hat{\beta}_j)^\top \Sigma^{-1}(Q \boldsymbol{\kappa}-\hat{\beta}_j)\big)=\big\{ \bigg(\big((Q \boldsymbol{\kappa}-\hat{\beta}_j), \Sigma \big),t \bigg)| \Sigma \succ 0, (Q \boldsymbol{\kappa}-\hat{\beta}_j)^\top \Sigma^{-1} (Q\boldsymbol{\kappa}-\hat{\beta}_j) \le t \big\}$. This is equivalent to \\ $\big\{ \bigg(\big((Q \boldsymbol{\kappa}-\hat{\beta}_j), \Sigma\big),t\bigg)| \Sigma \succ 0, \left(\begin{array}{cc} \Sigma & (Q \boldsymbol{\kappa}-\hat{\beta}_j) \\ (Q \boldsymbol{\kappa}-\hat{\beta}_j)^\top & t \end{array}\right) \succeq 0 \big\}$ via the Schur complement. Since the last condition is a linear matrix inequality in $((Q \boldsymbol{\kappa}-\hat{\beta}_j),\Sigma,t)$, $\mathrm{epi}((Q \boldsymbol{\kappa}-\hat{\beta}_j)^\top \Sigma^{-1}(Q \boldsymbol{\kappa}-\hat{\beta}_j))$ is convex, which implies that $(Q \boldsymbol{\kappa}-\hat{\beta}_j)^\top \Sigma^{-1}(Q \boldsymbol{\kappa}-\hat{\beta}_j)$ is convex in $((Q \boldsymbol{\kappa}-\hat{\beta}_j),\Sigma)$ \cite[Ch. 3]{boyd2004convex}. Thus, $h_j((Q \boldsymbol{\kappa}-\hat{\beta}_j),\Sigma)=\exp\{-\frac{n}{2}(Q \boldsymbol{\kappa}-\hat{\beta}_j)^\top \Sigma^{-1}(Q \boldsymbol{\kappa}-\hat{\beta}_j) \} $ is logarithmically concave in $((Q \boldsymbol{\kappa}-\hat{\beta}_j),\Sigma)$. That this implies logarithmic concavity in $(\boldsymbol{\kappa},\Sigma)$ follows by considering $h_j^\ast(\boldsymbol{\kappa},\Sigma):=h_j((Q \boldsymbol{\kappa}-\hat{\beta}_j),\Sigma)$, then \begin{align*} &\log h_j^\ast(\alpha \boldsymbol{\kappa}_1 + (1-\alpha)\boldsymbol{\kappa}_2,\alpha \Sigma_1+(1-\alpha) \Sigma_2) = \\ &\log h_j((Q (\alpha \boldsymbol{\kappa}_1+(1-\alpha)\boldsymbol{\kappa}_2)-\hat{\beta}_j),\alpha \Sigma_1 +(1-\alpha)\Sigma_2) = \\ & \log h_j((\alpha(Q\boldsymbol{\kappa}_1-\hat{\beta_j})+(1-\alpha)(Q\boldsymbol{\kappa}_2-\hat{\beta}_j),\alpha \Sigma_1 +(1-\alpha)\Sigma_2) \ge \\ &\alpha \log h_j(((Q\boldsymbol{\kappa}_1-\hat{\beta_j}),\Sigma_1)+(1-\alpha)\log h_j((Q\boldsymbol{\kappa}_2-\hat{\beta}_j),\Sigma_2)= \\ &\alpha \log h^\ast_j(\boldsymbol{\kappa}_1,\Sigma_1)+(1-\alpha)\log h^\ast_j(\boldsymbol{\kappa}_2,\Sigma_2) \end{align*} where the inequality follows from the logarithmic concavity of $h_j$ in $((Q \boldsymbol{\kappa}-\hat{\beta}_j),\Sigma)$. Thus, individual factors in the third term are logarithmically concave in $(\boldsymbol{\kappa},\Sigma)$, and since logarithmic concavity is preserved under multiplication, the third term is also logarithmically concave in $(\boldsymbol{\kappa},\Sigma)$. This combined with logarithmic concavity of $\pi_1$ from Proposition 2 shows that $\pi(\boldsymbol{\kappa},\Sigma|D)$ is logarithmically concave in $(\boldsymbol{\kappa},\Sigma)$. Since logarithmic concavity is preserved via marginalization, see \cite{pbekopa1971logarithmic} and \cite{leindler1972certain}, $\pi(\boldsymbol{\kappa}|D)=\int_{\mathbb{R}^{d(d+1)/2}}\pi(\boldsymbol{\kappa},\Sigma|D) d \Sigma$ is logarithmically concave, and hence unimodal, in $\boldsymbol{\kappa}$. \end{proof} \end{comment} \subsection{ Posterior Computation} Here we describe the algorithm to efficiently sample from the posterior distribution with a Metropolis-within-Gibbs sampler. To simplify notation, define $U:=nNQ^\top \Sigma^{-1} Q$ and $S:=nQ^\top \Sigma^{-1} \sum_{j=1}^N\hat{\boldsymbol{\beta}}_j$. The term $\omega_k$ is the prior probability that reaction channel $k$ is true {(non-zero)}. The posterior computation can then be performed with the following steps. \\ {\bf Algorithm 1.}\\ Step 1. For $k=1,...,r$, compute $\omega_k^\ast=\frac{\omega_k}{(1-\omega_k)/M_k+\omega_k}$ where \begin{equation} M_k=2 \sqrt{\frac{1}{\tau_k^2(u_{kk}+1/\tau_k^2)}}\exp\bigg\{ \frac{(s_k-\sum_{i \ne k}u_{ik}\kappa_i)^2}{2(u_{kk}+1/\tau_k^2)} \bigg\} \bigg (1-\Phi \Big(0,\frac{(s_k-\sum_{i \ne k}u_{ik}\kappa_i)}{(u_{kk}+1/\tau_k^2)},(u_{kk}+1/\tau_k^2)^{-1} \Big) \bigg). \end{equation} With probability $\omega_k^\ast$, sample $\kappa_k$ from the truncated Gaussian and then $\frac{1}{\tau_k^2}$ from inverse Gaussian, \begin{align*} \kappa_k \sim& \mathcal{N}\bigg(\big(s_k-\sum_{i \ne k}u_{ik} \kappa_i\big)/(u_{kk}+1/\tau_k^2),(u_{kk}+1/\tau_k^2)^{-1}\bigg)\mathbb{I}_{\mathbb{R}^+}(\kappa_k) \\ \frac{1}{\tau_k^2} \sim & I\mathcal{G}(\frac{\lambda_k}{\kappa_k},\lambda_k^2) \end{align*} Else, set $\kappa_k=0$ with probability $1-\omega_k^\ast$. \\ Step 2. Given the current sample $(\boldsymbol{\kappa}, \Sigma)$, propose $\Sigma^\ast$ from Wishart, $\Sigma^\ast \sim \mathcal{W}\big(v^\prime, \Sigma \big)$ \\ Step 3. Accept $\Sigma^\ast$ with probability $\min \bigg \{1, \frac{\pi(\boldsymbol{\kappa},\Sigma^\ast|D)\mathcal{W}(\Sigma|v^\prime,\Sigma^\ast)}{\pi(\boldsymbol{\kappa},\Sigma|D)\mathcal{W}(\Sigma^\ast|v^\prime,\Sigma)} \bigg \}$ \\ Step 4. Recompute $U:=nNQ^\top \Sigma^{-1} Q$ and $S:=nQ^\top \Sigma^{-1} \sum_{j=1}^N\hat{\boldsymbol{\beta}}_j$. Return to step 1. \\ \\ In the above notation $u_{ij}=(U)_{ij}$, $s_k$ is the $k^{th}$ element of $S$, $\mathcal{N}(a,b)$ is a Gaussian random variate with mean $a$ and variance $b$, $\mathcal{W}(\Sigma|v,V)$ is the Wishart density evaluated at $\Sigma$ with scale matrix $V$ and degrees of freedom $v$, $I\mathcal{G}(a,b)$ is an inverse Gaussian random variate with mean $a$ and scale $b$, and $\Phi(x,a,b)$ is the Gaussian cumulative distribution function with mean $a$ and variance $b$ evaluated at $x$. We have found that a proposal degrees of freedom, $v^\prime=n$, gives relatively good acceptance rates, between $15-30$\% in our empirical studies. Derivations of the full conditionals may be found in the Supplementary Material. Hence, sampling from the full conditional of $\boldsymbol{\kappa}$ is done by sampling from each $\kappa_k$'s second mixture with probability $\omega_k^\ast$ and from the degenerate component with corresponding probability $1-\omega_k^\ast$. Expressions for the individual parameters' and weights' full conditionals, $\kappa_k|\dots$ and $\omega_k^\ast$, allow for sampling from the target distribution by local parameter-wise updates. Although global moves can lead to optimal acceptance rates, tuning proposals that must be absolutely continuous with respect to measures like $(\delta_0 +\mu)^r$ is not straightforward, and even less so for likelihood-free methods. Additionally, the scheme allows inference about posterior reaction probabilities to be improved via Rao-Blackwellization \citep{gottardo2008markov}. In the remaining sections we illustrate the usage and performance of Algorithm~1 with both simulated and real data examples. \section{Simulation Study} To illustrate network topology estimation using the proposed synthetic likelihood approach, we consider a molecular reaction network partially motivated by the heat shock response. Heat shock transcription factors and protein chaperones are critical to ensure proteins fold into specific three-dimensional structures. Newly formed proteins and proteins within cells that have been challenged with damage risk protein misfoldings that may effect their functional activity \cite{hartl2011molecular}. Accumulation of such toxic species (misfolded proteins) has been implicated in the progression of certain neurodegenerative diseases \cite{neef2011heat,hartl2011molecular}, and has lead to research into development of theraputic targets that restore proteostasis \cite{calamini2012small}. Hence, modeling the cells ability to employ this chaperone machinery to acheive proteostasis may reveal theraputic targets. As a toy {\it in silico}, we consider the following reaction network that has transcriptional and chaperone components, along with redundant reactions, to compare the proposed methodology with existing ones via simulation. \begin{align}\label{eq:sim} \emptyset \rightarrow^{\kappa_1} & P_1 \hspace{10mm } \emptyset \rightarrow^{\kappa_2} P_2 \hspace{10mm} P_1 \rightarrow^{\kappa_3} R_1 \hspace{10mm} P_2 \rightarrow^{\kappa_4} R_1 \nonumber \\ P_1 \rightarrow^{\kappa_5} P_1 + P_2& \hspace{10mm} P_2 \rightarrow^{\kappa_6} P_1+P_2 \hspace{10mm} R_1 \rightarrow^{\kappa_7} P_2 \hspace{10mm}R_1 \rightarrow^{\kappa_8} 2R_1\\ R_1+P_2 \rightarrow^{\kappa_9} \emptyset & \hspace{10mm} R_1 \rightarrow^{\kappa_{10}} \emptyset \hspace{10mm} P_1 \rightarrow^{\kappa_{11}} \emptyset \hspace{10mm} P_2 \rightarrow^{\kappa_{12}} \nonumber \emptyset \end{align} Here $P_1$ and $P_2$ are representing proteins and $R_1$ represents gene RNA expression, with the transitions in/out of $\emptyset$ indicating loss/creation of a molecule. For the system of reactions \eqref{eq:sim} the mass action ODE \eqref{eq:rre} parameterized by $\boldsymbol{\beta}$ specializes to \begin{align}\label{eq:ODE} \frac{dP_1}{dt}=&\beta_1-\beta_2P_1+\beta_3P_2 \nonumber \\ \frac{dP_2}{dt}=&\beta_4+\beta_5R_1+\beta_6P_1-\beta_7P_2-\beta_8R_1P_2 \\ \frac{dR_1}{dt}=&-\beta_9R_1+\beta_{10}P_1+\beta_{11}P_2-\beta_8R_1P_2 .\nonumber \end{align} We note that in this particular case $\boldsymbol{\beta}=Q\boldsymbol{\kappa}$, where \[ Q=\begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 &0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 &0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & -1 & 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ \end{pmatrix} \] In our present setting $s=3$, $d=11$ and $r=12$. For our simulation study we generated trajectories from the pure jump process of the system of reactions \eqref{eq:sim} via Gillespie's algorithm (see, e.g., \citep{van1992stochastic}) with parameters $\boldsymbol{\kappa}=[1,0,1,0,0,1,0,0,0.5,1,1,1]^\top$ and initial molecular copy numbers of 50 for each of the three species. Note that under this set of kinetic parameters $P_1$ enters the system from an external source and acts as a transcription factor for $R_1$ and a chaperone for $P_2$, which we model by reactions 1, 3, and 6 (these are labeled by their respective $\kappa$ subscripts in \eqref{eq:sim}). $P_2$ acts as a suppressor of the transcription of $R_1$ through reaction 9 and all species have a natural degradation rate through reactions 10, 11, and 12 respectively. All others reactions are superfluous. We calculated the required LSE and MEF -based statistics by fitting the mass action ODE in \eqref{eq:ODE} to $N=1,2,3, \textrm{ and } 5$ simulated stochastic trajectories from \eqref{eq:sim}. We set the degrees of freedom hyperparameter to $v=N+d+1$, $\omega_k=0.5$ for equal \textit{a priori} probability that a reaction channel is true or false, and $\lambda_k=\frac{1-\omega_k}{\omega_k}=1$, which in combination with $v=N+d+1$ guarantees a unimodal posterior. For comparison, we perform analysis using the adaptive MCMC routine of \cite{vihola2012robust} with the LNA likelihood approximation and uniform priors on the logarithm of parameter values \cite{finkenstadt2013quantifying}. Additionally, we implemented the particle filtering routine of \cite{Golightly:2011aa}, which computes unbiased likelihood estimates within MCMC using 100 particles generated via Gillespie's algorithm and assigned uniform priors on the logarithm of parameter values. Tables \ref{table:posteriorlinksLSE} and \ref{table:posteriorlinksMEF} contain the posterior median estimates from chains of 50,000 MCMC samples from the MEF-based and LSE-based synthetic likelihood method. For the class of point mass mixture priors, the posterior median has been proven to be a legitimate thresholding rule, see \cite{johnstone2004needles}, so it may be used for both variable selection and estimation simultaneously in our setup. Tables \ref{table:posteriorLNA} and \ref{table:posteriorPF} give posterior means from LNA analysis with 50,000 samples and 10,000 samples from the particle marginal Metropolis-Hastings algorithm respectively. All algorithms are coded in R and run on a personal desktop computer with 2.7 GHz clock speed. \begin{table} \caption{{\label{table:posteriorlinksLSE} Posterior median of $\kappa_k$ from 50,000 MCMC samples for $N=1,2,3,5$ trajectories using LSE.}} \centering \begin{tabular} {c c c c c c c c c c c c c c c} \hline $\kappa$ & $\kappa_1$ & $\kappa_{2}$ & $\kappa_{3}$ & $\kappa_{4}$ & $\kappa_{5}$ & $\kappa_{6}$ & $\kappa_{7}$ & $\kappa_{8}$ & $\kappa_{9}$ & $\kappa_{10}$ & $\kappa_{11}$ & $\kappa_{12}$ & Time \\ \hline Truth&1&0&1&0&0&1&0&0&0.5&1&1&1&Seconds \\ $N=1$ & 0.38 & 0.00 & 0.63 & 1.12 & 0.00 & 8.56 & 0.00 & 0.00 & 1.96 & 0.47 & 0.21 & 0.00&47.33 \\ $N=2$ & 0.78 & 0.00 & 0.70 & 1.03 & 0.00 & 4.34 & 0.00 & 0.00 & 1.24 & 0.60 & 0.89 & 0.00&49.91 \\ $N=3$ &0.60&0.00&0.86&0.68&0.00&6.61&0.00&0.00&1.57&0.83&0.38&0.29&50.20 \\ $N=5$ &0.74&0.00&0.92&0.41&0.00&5.50&0.00&0.00&1.14&0.88&0.58&0.58&52.23 \\ \end{tabular} \end{table} \begin{table}\caption{\label{table:posteriorlinksMEF}Posterior median of $\kappa_k$ from 50,000 MCMC samples for $N=1,2,3,5$ trajectories using MEF.} \centering \begin{tabular} {c c c c c c c c c c c c c c c} \hline $\kappa$ & $\kappa_1$ & $\kappa_{2}$ & $\kappa_{3}$ & $\kappa_{4}$ & $\kappa_{5}$ & $\kappa_{6}$ & $\kappa_{7}$ & $\kappa_{8}$ & $\kappa_{9}$ & $\kappa_{10}$ & $\kappa_{11}$ & $\kappa_{12}$ & Time\\ \hline Truth&1&0&1&0&0&1&0&0&0.5&1&1&1&Seconds \\ $N=1$ & 1.10 & 0.00 & 0.75 & 1.89 & 0.00 & 1.09 & 0.00 & 0.01 & 0.93 & 0.70 & 1.31 & 2.84&46.97 \\ $N=2$ & 1.04 & 0.00 & 0.85 & 0.95 & 0.00 & 1.04 & 0.00 & 0.00 & 0.73 & 0.82 & 1.13 & 2.13&53.17 \\ $N=3$ &1.02&0.00&0.90&0.63&0.00&1.02&0.00&0.00&0.67&0.88&1.08&1.82&52.55 \\ $N=5$ &1.07&0.00&0.93&0.39&0.00&1.04&0.00&0.07&0.60&1.64&1.15&1.49&53.44 \\ \end{tabular} \end{table} \begin{table}\caption{Posterior mean of $\kappa_k$ from 50,000 MCMC samples for $N=1,2,3,5$ trajectories using LNA.} \centering \begin{tabular} {c c c c c c c c c c c c c c c} \hline $\kappa$ & $\kappa_1$ & $\kappa_{2}$ & $\kappa_{3}$ & $\kappa_{4}$ & $\kappa_{5}$ & $\kappa_{6}$ & $\kappa_{7}$ & $\kappa_{8}$ & $\kappa_{9}$ & $\kappa_{10}$ & $\kappa_{11}$ & $\kappa_{12}$ & Time\\ \hline Truth&1&0&1&0&0&1&0&0&0.5&1&1&1&Seconds \\ $N=1$ & 0.95 & 0.00 & 0.79 & 1.52 & 0.00 & 0.40 & 0.00 & 1.11& 0.02 & 1.85 & 1.02 & 0.01 & 998356.82 \\ $N=2$ & 1.06 & 0.00 & 0.84 & 1.33 & 0.00 & 0.12 & 0.00 & 0.00 & 0.25 & 0.82 & 1.22 & 0.01 & 1002223.98\\ $N=3$ &1.01&0.00&0.93&1.30&0.00&0.10&0.00&0.00&0.17&0.96&1.02&0.00&998999.92 \\ $N=5$ &1.05&0.00&0.90&1.19&0.00&0.54&0.00&0.00&0.29&0.91&1.14&0.01&998811.77 \\ \end{tabular} \label{table:posteriorLNA} \end{table} \begin{table}\caption{Posterior mean of $\kappa_k$ from 10,000 MCMC samples for $N=1,2,3,5$ trajectories using particle filtering.} \centering \begin{tabular} {c c c c c c c c c c c c c c c} \hline $\kappa$ & $\kappa_1$ & $\kappa_{2}$ & $\kappa_{3}$ & $\kappa_{4}$ & $\kappa_{5}$ & $\kappa_{6}$ & $\kappa_{7}$ & $\kappa_{8}$ & $\kappa_{9}$ & $\kappa_{10}$ & $\kappa_{11}$ & $\kappa_{12}$ & Time\\ \hline Truth&1&0&1&0&0&1&0&0&0.5&1&1&1&Seconds \\ $N=1$ & 0.62 & 0.01 & 0.83 & 0.71 & 0.01 & 6.05 & 0.01 & 0.15& 3.01 & 0.89 & 0.43 & 1.08 & 1518414.34 \\ $N=2$ & 1.02 & 0.01 & 0.94 & 0.05 & 0.02 & 0.24 & 0.02 & 0.05 & 7.23 & 0.91 & 1.04 & 1.56 & 1546878.77\\ $N=3$ &0.95&0.00&0.99&0.31&0.00&0.29&0.01&0.08&3.54&1.07&0.83&0.93&1546693.39 \\ $N=5$ &0.63&0.00&0.90&0.07&0.01&7.30&0.01&0.05&3.30&0.87&0.40&1.13&1517892.47 \\ \end{tabular} \label{table:posteriorPF} \end{table} The results in Tables \ref{table:posteriorlinksLSE} and \ref{table:posteriorlinksMEF} indicate that both synthetic likelihood methods have performed reasonably well in the example, with the MEF-based synthetic likelihood analysis performing the best. The improvement of the MEF-based synthetic likelihood over the LSE-based one is likely due to a generally better efficiency of MEF over that of LSE. There is also apparently some degree of bias in the LSE estimate of $\kappa_6$, even with increasing $N$. MEF-based likelihood analysis assigned to the true reactions non-zero posterior medians for all sample sizes, while assigning zero posterior medians to nearly all the false reactions for two or more trajectories, with the exception of $\kappa_4$. MEF-based analysis performed better than LSE-based analysis for all reactions and for each number of trajectories. Both LSE and MEF-based analysis gave high posterior probability to the protein $P_1$ being a transcription factor for $R_1$(reaction 3) as well as $P_2$ acting as a suppressor of transcription of $R_1$ (reaction 9), which was indeed the case in the simulation. Since in actual experiments such reactions often indicate drug targets, the fact that our method was able to correctly identify them is of practical relevance. The results for both the LNA and particle filtering, located in Tables \ref{table:posteriorLNA} and \ref{table:posteriorPF}, show that their corresponding run times are already unacceptable in this moderate sized system. Indeed, we found that obtaining just 10,000 samples from the posterior distribution with the particle marginal Metropolis-Hastings implementation required more than two weeks of CPU time. Collecting 50,000 samples from the posterior distribution using the LNA, with adaptive MCMC for optimal acceptance rates of 0.234, took approximately 12 days of CPU time. The bottleneck of computation for the particle filtering is that unbiased likelihood estimates require sampling many trajectories, in our case 100, for each likelihood evaluation. For the LNA based analysis, each likelihood evaluation requires solving a system of non-autonomous ODEs. The particular examples in Tables~\ref{table:posteriorLNA} and \ref{table:posteriorPF} illustrate the generally accepted view that, at least until now, most of the current methods that rely on detailed system modeling do not scale well. Not only did the methods perform poorly in terms of long run times, they also produced estimates that appear biased away from the true values of certain parameters, even as the number of trajectories increases. For the particle filtering routine, estimates for $\kappa_6$ and $\kappa_9$ have a high degree of bias, whereas the LNA-based analysis appears to incorrectly infer $\kappa_4$ as true (non zero) and $\kappa_{12}$ as false (zero), even with all 5 trajectories data provided. The synthetic likelihood methods perform better, in terms of inference and computation, by projecting a high dimensional noisy trajectory into a lower dimensional statistic that captures the important dynamical information with less noise. It appears that for the full Metropolis type methods, the variable selection priors, like the point mass ones used in our synthetic likelihood methods, would likely pose even greater computational challenges than the continuous priors applied in our examples here since the routines for tuning the necessary proposals are not straightforward for the LNA, the particle filter, or any Metropolis type sampling with intractable likelihoods. \begin{figure}[htbp] \centering \includegraphics[width=6in,height=5in]{autocorr.pdf} \caption{{Auto-correlation plots of the output from MEF-based synthetic likelihood (black), LSE-based synthetic likelihood (red), LNA (blue), and particle marginal Metropolis-Hastings (green) for $N=1$.}} \label{fig:autocorr} \end{figure} The plots in Figure \ref{fig:autocorr} indicate that the chains resulting from the LNA and particle filtering have a much higher degree of auto-correlation as compared to the synthetic likelihood methods. Thus, in addition to the increased computational time of each MCMC sample, more samples are required in order for the LNA and particle filter to sufficiently explore parameter space in our current setting. We conclude by these plots that although adaptive MCMC was used, at least for the LNA likelihood approximation, the resulting chains exhibit poor mixing. Although theoretically Metropolis-Hastings type samplers can be tuned to produce optimal acceptance properties, the results here highlight the general difficulty of tuning in the presence of complicated or intractable likelihoods. \section{Data Examples} \subsection{RNA-Seq Data} We now compare the performance of our synthetic method to that of the algebraic statistical model (ASM). The method was introduced in \cite{craciun2009algebraic} to learn biochemical network topology from the empirical patterns of the reaction stoichiometries ($\nu_k ^\prime-\nu_k $). To facilitate the comparison, we re-analyze a dataset introduced in \cite{Linder:2013aa} and consisting of the longitudinal RNA-seq measurements from the retinal tissue in the zebrafish ({\it Danio rerio}). The study was performed to probe the regenerative properties of the zebrafish retina after it sustained cell-specific damage. One interest of the study was in analyzing a particular sub-system, consisting of the following species: heat shock protein transcription factor (Hsp70), signal transducer and activator of transcription 3 (Stat3), and the suppressor of cytokine signaling 3 (Socs3). For more details on the experiment, see \cite{Linder:2013aa}. The network of interest has the form \begin{align}\label{eq:ZebraNet} \emptyset& \xrightarrow{\kappa_1} Stat3 \hspace{5mm}Stat3 \xrightarrow{\kappa_4} 2Stat3 \nonumber \\ \emptyset& \xrightarrow{\kappa_2} Socs3b \hspace{5mm} Stat3\xrightarrow{\kappa_5} Socs3b \nonumber \\ \emptyset& \xrightarrow{\kappa_3} hsp70 \hspace{5mm} Stat3 \xrightarrow{\kappa_6} hsp70 \nonumber \\ S&tat3+Socs3b \xrightarrow{\kappa_7} Socs3b \nonumber \\ S&tat3 \xrightarrow{\kappa_8} \emptyset \nonumber \\ S&ocs3b\xrightarrow{\kappa_9} \emptyset \nonumber \\ h&sp70 \xrightarrow{\kappa_{10}} \emptyset. \end{align} In the above network, we are especially interested in the possible activation of the heat shock response via Stat3. The detailed analysis via ASM based on all 8 trajectories of the experiment was presented in \cite{Linder:2013aa}, where the topology of the conic (i.e., single-source) sub-network in Figure \ref{fig:Stat3Cone} was learned. We may thus compare the proposed synthetic method's results based on LSE with the results based on ASM for the same dataset. As previously mentioned, the proposed method also allows for computation of posterior probabilities via empricial estimates of the posterior weights; i.e., $P(\kappa_k \ne 0|D)$ since the dominating measure is $(\delta_0+\mu)$ and not merely $\mu$. To this end, we compute and report the posterior probabilities by simulating 50,000 MCMC samples from the model in \eqref{eq:Model} under the same hyperparameter assumptions, as in the previous section. \begin{figure}\centering \caption{{Stat3 Conic Network. Note that the only source for 4 different products is Stat3.}} \label{fig:Stat3Cone} \begin{equation*} \xy ;<.7pc, 0pc>: \POS(0,0)*+{Stat3} \ar@<.3 ex> @{->} +(-3,-3)*+{2Stat3} \ar@<.3 ex> @{->} +(3,-3)*+{Socs3b} \ar@<.3 ex> @{->} +(0,3)*+{hsp70} \ar@<.3 ex> @{->} +(0,-3)*+{\emptyset} \endxy \end{equation*} \end{figure} The results in Table \ref{tab:zebraTable} indicate that reactions 4, 5, and 6 are likely true, while reaction 8 may only occur on a much longer time scale. Since both methods produce similar network topologies, we mention some advantages of the proposed model over ASM. While the appeal of the ASM is that it exploits the geometry of the stoichiometric matrix, the proposed method based on synthetic likelihood does so as well, in a sense, through the entries of $Q$ matrix. A practical limitation of the ASM is that it enforces the cone-wise assumption that exactly $s$ reactions are true, which will typically not be the case. Similarly to the synthetic method, ASM also tacitly assumes a large volume setting, $(n \rightarrow \infty)$, however, unlike for the synthetic method, the ASM inference problem is only asymptotically $(N \rightarrow \infty)$ well-posed and only on the set of posterior probabilities $\omega_k^\ast\in \{ 0,1\}$ for $k=1,\ldots,r$. Thus ASM is strictly a topology learning routine, and not capable of kinetic parameter estimation. In contrast, (even though we did not present the results in this section for brevity) the parameter estimation may be easily carried out with the proposed synthetic approach by analyzing the posterior distribution and selecting the point estimates of $\kappa_k$, as was done in the previous section. For illustration, we present the bivariate contour plots of the posterior distribution for the reaction rates from the sub-system of interest in Figure \ref{fig:contour}. Our main observation is that the empirical plots indeed agree with our theoretical results on the unimodality of the posterior distribution. \begin{table}\caption{\label{tab:zebraTable}Synthetic likelihood and ASM reaction probabilities} \centering \begin{tabular}{r r r r} \hline Reaction Source&Reaction Output&Synthetic Likelihood&ASM \\ \hline $Stat3$&$2Stat3$&$0.94$&$1$ \\ $Stat3$&$Socs3b$&$0.97$&$1$ \\ $Stat3$&$hsp70$&$0.99$&$1$ \\ $Stat3$&$\emptyset$&$0.34$&$0$ \\ \hline \end{tabular} \end{table} \begin{figure}[htbp] \centering \includegraphics[width=6in,height=5in]{contour_plots.pdf} \caption{{Bivariate contour plots of posterior distribution from synthetic likelihood. Empirical density estimates increase from light gray to light blue.}} \label{fig:contour} \end{figure} \subsection{The Plague at Eyam} In the seventeeth century, following the Great Plague of London the village of Eyam, Derbyshire, England, experienced an outbreak of plague, caused by the bacterium {\it Yersinia pestis}. In this section we analyze data from this outbreak that occurred at Eyam in 1665-1666. See also \cite{whittles2016epidemiological, dean2018human} for further discussion of the dataset and the relevant historic context. Several features about the plague outbreak at Eyam make its study somewhat unique. The first of these features is that the village rector, a Reverand William Mompesson, reportededly convinced the villagers to self-quarantine. Although recent evidence suggests that a few of the wealthy residents may have fled (it is reported that Mompesson sent his children away before the quarantine), we may effectively treat the plague at Eyam as an outbreak in closed population. The names and burial dates of plague victims were recorded by Mompesson. Further, the parish records combined with the hearth tax record for Eyam in 1664 provide detailed information on the villagers, such as their sex, approximate date of birth, date of burial, and household information. This curated version of the Eyam parish register has lead to a newly revised estimate of a total village population of around 700, from an initially reported 350. As the account goes, a tailor at Eyam received a shipment of cloth from London that was carrying plague infected rat fleas, and the first infected victim is believed to have come in contact with this cloth. As the infected flea's digestive system becomes blocked by the bacterium, the flea vomits into the bite wound, thus transmitting {\it Y. pestis}. This transmission mechanism is now medically confirmed as giving rise to the bubonic form of plague. On September 7th 1665 the first burial due to plague was for a George Viccars. Over the next nine months, a somewhat constrained outbreak occurred in the Eyam villagers, of which 77 deaths have been attributed to plague. Around mid-May 1666 a second wave of the outbreak began to spread, and during the ensuing months from June 1666 through October 1666 had decimated the village, killing some 257 villagers. While the rodent-to-human transmission route via the rat flea is understood to be critical for the initial outbreak dynamics, this particular mode of transmission alone does not fully explain the observed rapidity of the various plague outbreaks throughout Europe. This was also argued, at least qualitatively, based on the empirical differences in the early outbreak dynamics compared to the latter months at Eyam, \cite{raggett1982stochastic}. An apparent lack of recorded rat falls (large scale rat deaths) during these outbreaks provides further evidence that additional transmission mechanisms were also critical for disease spread. Rat falls are generally considered necessary to cause sufficient flea jumpings from rat corpses onto humans. While human-to-human contact has been recognized as a component of the plague transmission process, through plague pneumonia and more recently via ectoparasites, such as lice and the human flea, recent analyses suggest that this transmission route may be far more important than previously recognized \citep{whittles2016epidemiological, dean2018human}. We set out to analyze the Eyam plague data that was reported in \cite{raggett1982stochastic}, which we have augmented to account for the more recent information on the total population reported in \cite{whittles2016epidemiological}. \tikzset{int/.style={draw, line width = .75mm, minimum size=5em}} \begin{figure} \centering \begin{tikzpicture}[node distance=4cm,auto,>=latex'] \node [int] (a) {$S$}; \node [int] (b) [right of=a, node distance=4cm]{$I$}; \node [int] (c) [right of=b, node distance=4cm]{$R$}; \draw[->] (a) -- node[name=u]{$\kappa_3 S$} (b); \draw[->] (b) -- node[name=v] {$\kappa_2 I$} (c); \node [int] (r) [below of=u, node distance=3cm]{$V$}; \path (a) edge[bend left] node[anchor=north, above]{$\kappa_1 \frac{SI}{N}$} (b); \draw[->] (r) -- node[name=j] {$$} (u); \end{tikzpicture} \caption{Susceptible, Infected, Recovered (SIR) compartmental model for the Eyam plague.} \end{figure} Figure 4 illustrates the compartmental SIR model that we consider for analysis of the Eyam data. The $S$, $I$, and $R$ compartments represents the number of susceptibles, infectious, and removed individuals, which we denote at time $t$ by $S(t)$, $I(t)$, and $R(t)$. While we have labeled the compartment $R$ removed as is standard in the typical SIR notation, the Eyam plague was almost universally fatal for infected. There were only three alleged recoveries, of which none were reported in the data sources, so that $R$ effectively represents deaths. We represent the rodent-flea $V$ compartments and its contribution to the infectious pressure on susceptibles as $\kappa_3S$. This is essentially an assumption that the infectious pressure from non-human interaction is proportional to the number of susceptibles. While this may not be a completely accurate description, the outbreak period that we analyze was during early to late summer, leading one to suspect that the infectious pressure from the $V$ compartment may have been approximately constant. According to the SIR model, susceptibles ($S$) make infectious contact and then transition to compartment $I$ at rate $\kappa_1SI$. Finally, infected individuals die and transition to compartment $R$ at rate $\kappa_2I$. The compartment specific prevalence estimates, reported in \cite{raggett1982stochastic}, were updated with the new population total and are displayed in Table \ref{table:Eyam}. We have focused attention on the second phase of the outbreak that occurred in the summer of 1666 to assess the evidence on whether a particular transmission route was more important than another. Since the Eyam data analysis assumes a closed population one may readily recover the $R$ compartment at time $t$ by the formula $N=S(t)+I(t)+R(t)$, with $N=613$. \begin{table} \caption{{\label{table:Eyam} Plague data for Eyam 1666}} \centering \bgroup \setlength{\tabcolsep}{4em} \def1.5{1.5} \begin{tabular} {c c c} Date 1666& $S(t)$ & $I(t)$ \\ \hline May 18&612&1 \\ June 18 & 593 & 7 \\ July 19 & 540& 22 \\ August 19 &460&20 \\ September 19 &436&8 \\ October 20 &422&0 \end{tabular} \egroup \end{table} The corresponding mass action ODE then for the above system has the form \begin{align}\label{EyamODE} \frac{dS}{dt} =& -(\kappa_1I+\kappa_3)S \nonumber \\ \frac{dI}{dt} =&-(\kappa_2-\kappa_1 S)I \end{align} We use the plague data in Table \ref{table:Eyam} to compute the MEF statistic using the approach described above. The MEF statistic is computed by minimizing the weighted sum of squared distances between the observed trajectory and ODE solution of \eqref{EyamODE}, weighted by the asymptotic process covariance at each timepoint. The initial condition is given as the compartment specific prevalence estimates in May 18 1666. For the Eyam data we have the single outbreak trajectory; i.e., no replicates, and we thus use the asymptotic covariance estimate of the MEF statistic for the fixed covariance term to construct the synthetic likelihood. Also, $Q=I_{3 \times 3}$, indicating that the unknown rate parameters are directly related to the summary statistics through the identity matrix. We collected 50,000 MCMC samples via the synthetic likelihood method described above with a burn-in of 5,000. The corresponding posterior medians and 95\% credible intervals for the parameters are $\kappa_1= 5.30\hspace{1mm}(5.22, 5.38)$, $\kappa_2= 4.22\hspace{1mm} (4.14, 4.30)$, and $\kappa_3= 0 \hspace{1mm}(0, 0.003)$. We note that the results from our analysis agree qualitatively with the results in \cite{whittles2016epidemiological, dean2018human} concerning the role of human-to-human transmission of plague. While we have not made explicit assumptions about what the exact form of the human-to-human transmission mechanism (i.e, plague pneumonia, ectoparasites or some other form) the data from the latter months of the outbreak at Eyam nonetheless suggest that in our simple modified SIR model human-to-human contact was important. This was already suggested early on from the historical accounts that the plague at Eyam could be transmitted from the cough of a plague victim, suggesting plague pneumonia transmission. Further, the posterior median for $\kappa_3$ of zero indicates the corresponding link in our modified SIR model, that accounts for infectious pressure from the rodent-flea route, could be negligible, at least during the latter part of the outbreak. There are several limitations of this analysis that should be noted here. The first is that we have restricted our attention to the latter months of the outbreak at Eyam, during which it was apparent that the dynamics had changed from those of the initial outbreak. By doing this we are potentially missing information about the nature of the initial dynamics, which may point to a different transmission route as being important early on. Indeed, results from \cite{whittles2016epidemiological} suggest that approximately 27\% of infections were caused by rodents and 73\% from human-to-human transmission by using the full outbreak data. This leads to another limitation, in that we have relied on the prevalence estimates reported in \cite{raggett1982stochastic}, updated with new population totals. These compartment prevalences were estimated from the historical and death records, so are likely subject to measurement error, which we have not accounted for. Further, we have not used data on household structure and composition, although this is part of planned future work. Finally, while the augmented SIR type model we have used is somewhat similar to the SEIR model used in \cite{whittles2016epidemiological}, it does not consider explicit plague pneumonia vs. ectoparasite driven human-to-human transmission separately, as was done in \cite{dean2018human}. Hence, our analysis only adds to the evidence that some form of human-to-human transmission, which we modeled with a generic SIR framework, was important but does not distinguish between particular forms of this transmission. \section{Conclusions} We have described a method which can be used to perform estimation of biochemical networks as often considered in the context of dynamic gene regulatory networks and stochastic epidemic models. It is well established that this is a notoriously difficult problem, due to the intractability of the likelihood under partially observed trajectories. The underlying theme in most of the popular approaches in this area is to use likelihood approximations to perform approximate inference, such as in \cite{golightly2005bayesian,girolami2008bayesian,komorowski2009bayesian,golightly2012,finkenstadt2013quantifying,fearnhead2014inference}. While our approach adopts this theme, it is fundamentally different than the standard approximate and likelihood-free inferential techniques. The most important of these differences is that the data summary statistics used here (LSE or MEF estimates) have properties that are well understood and are directly related to the unknown kinetic parameters. These properties justify, via the asymptotic normality, a parametric form for the synthetic likelihood, in the spirit of \cite{Wood:2010aa}, that is linear in the parameters of interest. Hence, we have demonstrated that projections of the species' trajectories into sets of dynamically informative statistics allows for highly efficient posterior sampling and a procedure that should scale well in large systems. \section*{ACKNOWLEDGEMENTS} The first author would like to thank the Mathematical Biosciences Institute (MBI) at Ohio State University, for partially supporting this research through an Early Career Award. MBI receives its funding through the National Science Foundation grant DMS 1440386.
{'timestamp': '2018-10-08T02:04:06', 'yymm': '1810', 'arxiv_id': '1810.02457', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02457'}
arxiv
\subsubsection*{\bibname}} \usepackage{amsmath} \usepackage{amssymb} \usepackage{color} \usepackage{cancel} \usepackage{algorithm} \usepackage{algorithmic} \usepackage{graphicx} \usepackage{hyperref} \input{shortdefs} \begin{document} \runningtitle{Correcting the bias in least squares regression} \twocolumn[ \aistatstitle{Correcting the bias in least squares regression\\ with volume-rescaled sampling} \ifisarxiv \aistatsauthor{ Micha{\l } Derezi\'{n}ski \And Manfred K. Warmuth \And Daniel Hsu } \aistatsaddress{\small Foundations of Data Analysis Institute\\ \small University of California, Berkeley\\ \small \texttt{[email protected]} \And \small Dept. of Computer Science\\ \small University of California, Santa Cruz\\ \small\texttt{[email protected]} \And \small Dept. of Computer Science\\ \small Columbia University, New York\\ \small\texttt{[email protected]} } \else \aistatsauthor{ Author 1 \And Author 2 \And Author 3} \aistatsaddress{ Institution 1 \And Institution 2 \And Institution 3 } \fi ] \begin{abstract} Consider linear regression where the examples are generated by an unknown distribution on $\R^d\times\R$. Without any assumptions on the noise, the linear least squares solution for any i.i.d.~sample will typically be biased w.r.t.~the least squares optimum over the entire distribution. However, we show that if an i.i.d.~sample of any size $k$ is augmented by a certain small additional sample, then the solution of the combined sample becomes unbiased. We show this when the additional sample consists of $d$ points drawn jointly according to the input distribution that is rescaled by the squared volume spanned by the points. Furthermore, we propose algorithms to sample from this volume-rescaled distribution when the data distribution is only known through an i.i.d~sample. \end{abstract} \section{INTRODUCTION} \label{s:introduction} Unbiased estimators for linear regression are useful because averaging such estimators gives an unbiased estimator whose prediction variance vanishes as the number of averaged estimators increases. Such estimators might for example be produced in a distributed fashion from multiple small samples. In this paper we develop a unique method for correcting the bias of linear least squares estimators. Our main methodology for producing an unbiased estimator is volume sampling. For a fixed design matrix $\mathbf X \in \R^{n\times d}$, the most basic variant of volume sampling chooses a subset $S\subseteq \{1..n\}$ of dimension many rows (i.e. $|S|=d$) with probability proportional to the squared volume spanned by the rows, i.e. $\det(\mathbf X_S)^2$, where $\mathbf X_S$ is the sub-matrix of rows indexed by $S$. This procedure generalizes to sampling sets of any fixed size $k\geq d$ \cite{avron-boutsidis13}: \begin{equation} \label{eq:vol} P(S)\stackrel{\textit{\tiny{def}}}{=} \frac{\det(\mathbf X_S^\top\mathbf X_S)}{ \Red{n-d \choose k-d} \det(\mathbf X^\top\mathbf X)} . \end{equation} Volume sampling has the property that for any design matrix $\mathbf X$ with $n$ rows and any real response vector $\mathbf y\in\R^n$, the linear least squares solution for the subproblem $(\mathbf X_S,\mathbf y_S)$ is an unbiased estimator for the solution of the full problem $(\mathbf X,\mathbf y)$ \cite{unbiased-estimates-journal}. We propose the following previously unobserved alternate sampling method for size $k> d$ volume sampling: First volume sample a set $S_\circ$ of size $d$ and then pad the sample with a uniform subset $R$ of $k-d$ rows outside of $S_\circ$. Now the probability of the combined size $k$ sample $S=S_\circ \cup R$ is again volume sampling \eqref{eq:vol}: $$ P(S)\!=\!\!\!\! \sum_{\underset{|\hspace{-0.2mm}S_\circ\!|=d}{S_\circ\subseteq S}} \!\underbrace{P\big(R\!=\!S\!\setminus\! S_\circ\,|\,S_\circ\big)} _{\Red{\frac{1} {{n-d \choose k-d}} }} \!\!\! \underbrace {P(S_\circ)} _ {\frac{\det(\mathbf X_{S_\circ}\!)^2}{\det(\mathbf X^\top\mathbf X)}} \!\!\!=\! \frac{\det(\mathbf X_S^\top\mathbf X_S)}{ \Red{n-d \choose k-d} \!\det(\mathbf X^\top\mathbf X)}, $$ where the equality is the Cauchy-Binet formula for determinants. Furthermore, we study a more general statistical learning model where the points come from an unknown probability distribution over $\R^d\times \R$, and the goal is to recover the least squares solution w.r.t.~the distribution. In this paper we generalize volume sampling to this case by rescaling the i.i.d.~sampling distribution by the squared volume of the sampled points. The simplest way to obtain a linear least squares estimator in the statistical learning model is to find the linear least squares solution for a size $k$ i.i.d.~sample. Unfortunately such estimators are generally biased. Note that this is not the kind of bias that we deliberately impose with regularization to reduce the variance of the estimator. Rather, due to the random design, the least squares estimator is typically biased even when it is not regularized at all~\cite{hsu2014random}, and we have limited control over how large that bias may be (see Section~\ref{s:experiment} for a motivating example). However our alternate sampling procedure for volume sampling (discussed in the previous paragraph) implies the following strategy for correcting the bias: We show that if an i.i.d.~sample of any size $k$ is augmented with a size $d$ volume-rescaled sample for this distribution, then the combined sample is a volume-rescaled sample of size $k+d$, and its linear least squares solution is an unbiased estimator of the optimum. In one dimension, this means that if an i.i.d.~sample is augmented with just one example, where this additional example is drawn from a distribution whose marginal distribution on $x$ is proportional to the original (unknown) marginal density times $x^2$, then the resulting least squares estimator becomes unbiased. Curiously enough, for the purpose of correcting the bias it does not matter whether the size $d$ volume-rescaled sample was generated before or after the original size $k$ i.i.d. sample was drawn, since they are independent of each other. In addition to generalizing volume sampling to the continuous domain and showing that only a subsample of size $d$ needs to be rescaled by the squared volume, we study the time and sample complexity of volume-rescaled sampling when the data distribution is only known through an i.i.d.~sample. Specifically: \vspace{-3mm} \begin{enumerate} \item We extend \emph{determinantal rejection sampling} \cite{leveraged-volume-sampling} to arbitrary data distributions with bounded support, and our improved analysis reduces its time and sample complexity by a factor of $d$. \item When the data distribution is Gaussian with unknown covariance, we propose a new algorithm with $O(d)$ sample complexity. \end{enumerate} \paragraph{Related work.} Discrete volume sampling of size $k\leq d$ was introduced to computer science literature by \cite{pca-volume-sampling}, with later algorithms by \cite{efficient-volume-sampling,more-efficient-volume-sampling}. The extension to sets of size $k>d$ is due to \cite{avron-boutsidis13}, with algorithms by \cite{dual-volume-sampling,unbiased-estimates-journal,leveraged-volume-sampling}, and additional applications in experimental design explored by \cite{tractable-experimental-design,proportional-volume-sampling,symmetric-polynomials}. Our alternate volume sampling procedure implies that the algorithms by \cite{efficient-volume-sampling,more-efficient-volume-sampling} can be used to volume sample larger sets at no additional cost. The unbiasedness of least squares estimators under volume sampling was explored by \cite{unbiased-estimates-journal,leveraged-volume-sampling}, drawing on observations of \cite{bental-teboulle}. For arbitrary data distributions, volume-rescaled sampling of size $d$ is a special case of a determinantal point process (DPP) (see, e.g. \cite{dpp-statistics,dpp-first-algorithm}). However for $k>d$ and arbitrary distributions, we are not aware of such sampling appearing in the literature. Related variants of discrete DPPs have been extensively explored in the machine learning community \cite{dpp,k-dpp,k-dpp-efficient,dpp-shopping,celis2016fair,celis2018fair}. \paragraph{Notations and assumptions.} Throughout the paper, $(\mathbf x,y)\in\R^d\times \R$ is a random example drawn from some distribution $D$. We assume that the point $\mathbf x$ and the response $y$ both have finite second moments, i.e. $\mathbb E[\|\mathbf x\|^2]\!<\!\infty$ and $\mathbb E[y^2]\!<\!\infty$. The marginal probability measure of $\mathbf x$ is denoted as $\dx$, while $\dxk$ is the probability measure over $(\R^d)^k$ of $k$ i.i.d.~samples $(\mathbf x_1, \textnormal{\fontsize{6}{6}\selectfont \dots},\mathbf x_k)$ drawn from $\dx$. We define $\boldsymbol\Sigma_{\!\dx}\stackrel{\textit{\tiny{def}}}{=}\mathbb E[\mathbf x\x^\top]\in\R^{d\times d}$ and w.l.o.g. assume that it is invertible. Given a data sample $\mathbf S\!=\! \{(\mathbf x_1,y_1), \textnormal{\fontsize{6}{6}\selectfont \dots},(\mathbf x_k,y_k)\}$, we denote the least squares estimators for $\mathbf S$ and $D$, respectively, as \begin{align*} \mathbf w^*(\mathbf S) &\stackrel{\textit{\tiny{def}}}{=} \argmin_\mathbf w \!\!\sum_{(\mathbf x_i,y_i)\in \mathbf S} (\mathbf x_i^\top\mathbf w-y_i)^2\quad\text{and}\\ \boldsymbol\mathbf w_{\!D}^* &\stackrel{\textit{\tiny{def}}}{=} \argmin_\mathbf w \,\mathbb E_D\big[(\mathbf x^\top\mathbf w-y)^2\big] = \boldsymbol\Sigma_{\!\dx}^{-1}\mathbb E_D[\mathbf x\,y]. \end{align*} \subsection{Statistical Results} Our results are centered around the following size $k$ {\em joint sampling distribution}. \begin{definition}\label{t:cauchy-binet} Given distribution $\dx$ and any $k\geq d$, we define volume-rescaled size $k$ sampling from $\dx$ as the following probability measure: For any event $A\subseteq (\R^d)^k$ measurable w.r.t. $\dxk$, its probability is \vspace{-1mm} \begin{align*} {\mathrm{VS}_{\!\dx}^k}(A) \ &\stackrel{\textit{\tiny{def}}}{=}\ \frac{\mathbb E_{\dxk}\Big[ \,\mathbf 1_A\ \overbrace{\det\!\Big(\sum\nolimits_{i=1}^k\!\mathbf x_i\mathbf x_i^\top\Big)}^ {\textnormal{rescaling factor}}\Big]} {d! {k\choose d}\det\!\big(\boldsymbol\Sigma_{\!\dx}\big)}, \end{align*} \vspace{-3mm} where $\mathbf 1_A$ is the indicator variable of event $A$. \end{definition} This distribution integrates to $1$ over its domain $(\R^d)^k$ as a consequence of a continuous version of the classic Cauchy-Binet formula, which has appeared in the literature in various contexts (Lemma~\ref{l:determinant}). Although we define volume-rescaled sampling for any sample size $k\geq d$, we focus primarily on the special case of $k=d$ in the main results below. This is because we show that any ${\mathrm{VS}_{\!\dx}^k}$ can be decomposed into ${\mathrm{VS}_{\!\dx}^d}$ and $\dx^{k-d}$, the latter being the distribution of a size $k\!-\!d$ i.i.d.~sample from $\dx$. \begin{theorem}\label{l:decomposition} Let $\mathbf S \sim \dx^{k-d}$ and $\mathbf S_\circ\sim{\mathrm{VS}_{\!\dx}^d}$. Let $\widetilde{\S}\in\R^{k\times d}$ denote a random permutation of the points from $\mathbf S$ concatenated with $\mathbf S_\circ$, i.e. $\widetilde{\S}=\sigma(\langle \mathbf S,\mathbf S_\circ \rangle)$, where $\sigma$ is a random permutation. Then $\widetilde{\S}\sim{\mathrm{VS}_{\!\dx}^k}$. \end{theorem} Given the above decomposition, one may wonder what is the purpose of defining volume-rescaled sampling for any size $k>d$. In fact, we will see in the following sections that both in the proofs and in algorithms it is sometimes easier to work with ${\mathrm{VS}_{\!\dx}^k}$ rather than its decomposed version. For example in the theorem below, we show that for any $k$, the least squares estimator computed on a volume-rescaled sample is unbiased. Despite the fact that continuous determinantal point processes have been studied extensively in the past, we were not able to find this result for arbitrary $\dx$ in the literature. \begin{theorem}\label{t:unbiased} Consider the following distribution ${\mathrm{VS}_{\!D}^k}$ on samples $\mathbf S=\{(\mathbf x_1,y_1),\dotsc,(\mathbf x_k,y_k)\}$ of size $k$: \begin{align*} &\textnormal{Sample}& &\mathbf x_{1},\dots,\mathbf x_{k}\ \sim\ {\mathrm{VS}_{\!\dx}^k},\\ &\textnormal{Query}&&y_{i}\ \sim\ D_{{\cal Y}|\mathbf x=\mathbf x_{i}}\quad \forall_{i=1..k}. \end{align*} Then $\mathbb E_{\mathrm{VS}_{\!D}^k}[\mathbf w^*(\mathbf S)] = \boldsymbol\mathbf w_{\!D}^*$. \end{theorem} Combining Theorems~\ref{l:decomposition} and \ref{t:unbiased}, we conclude that an i.i.d.~sample only needs to be augmented by a dimension-size volume-rescaled sample (i.e., $k=d$) so that the least squares estimator becomes unbiased. \begin{corollary}\label{t:augmenting} Let $\mathbf S \!=\! \{(\mathbf x_1,y_1),\textnormal{\fontsize{6}{6}\selectfont \dots},(\mathbf x_k,y_k)\} \!\overset{\textnormal{\fontsize{6}{6}\selectfont i.i.d.}}{\sim}\! D^k$, for any $k\geq 0$. Consider the following procedure: \begin{align*} &\textnormal{Sample}& &\widetilde{\mathbf x}_{1},\dots,\widetilde{\mathbf x}_{d}\ \sim\ {\mathrm{VS}_{\!\dx}^d},\\ &\textnormal{Query}&&\widetilde{y}_{i}\ \sim\ D_{{\cal Y} |\mathbf x=\widetilde{\mathbf x}_{i}}\quad \forall_{i=1..d}. \end{align*} Then for $\mathbf S_{\circ}=\{(\widetilde{\mathbf x}_{1},\widetilde{y}_{1}),\dots,(\widetilde{\mathbf x}_{d},\widetilde{y}_{d})\}$, \begin{align*} \mathbb E\big[\mathbf w^*(\langle \mathbf S, \mathbf S_{\circ}\rangle)\big] &= \mathbb E_{\mathbf S\sim D^k}\!\big[\, \mathbb E_{\mathbf S_{\circ}\sim {\mathrm{VS}_{\!D}^d}}[\,\mathbf w^*(\langle \mathbf S, \mathbf S_{\circ}\rangle)\,]\, \big]\\[1mm] \textnormal{(Theorem~\ref{l:decomposition})}\quad&=\mathbb E_{\widetilde{\S} \sim \vs{k+d}} \big[\,\mathbf w^*\!\big(\,\widetilde{\S}\,\big)\,\big] \\ \textnormal{(Theorem~\ref{t:unbiased})}\quad &= \boldsymbol\mathbf w_{\!D}^*. \end{align*} \end{corollary} \ifisarxiv\vspace{-2mm} \fi To put the above result in context, we note that in the fixed design case it was known that a single volume sampled subset $\mathbf S$ of any size $k\geq d$ produces an unbiased least squares estimator (see, e.g., \cite{unbiased-estimates-journal}). However this required that all $k$ points be sampled jointly from this special distribution. Thus, Corollary~\ref{t:augmenting} says that volume sampling can be used to correct the bias in existing i.i.d.~samples via sample augmentation (requiring labels/responses for only $d$ additional points from ${\mathrm{VS}_{\!\dx}^d}$). This is important in active learning scenarios, where samples from $\dx$ (unlabeled data) are cheaper than draws from $D_{{\cal Y} |\mathbf x}$ (label queries). We also develop methods for generating the small sample from ${\mathrm{VS}_{\!\dx}^d}$ only using additional unlabeled samples from $\dx$ (see Section \ref{s:algs-overview}). Indeed, active learning was a motivation for volume sampling in previous works~\cite{unbiased-estimates-journal,leveraged-volume-sampling}. \subsection{A Simple Gaussian Experiment} \label{s:experiment} The bias in least squares estimators is present even when input is a standard Gaussian. As an example, we let $d=5$ and set: \begin{align*} \mathbf x^\top\! = (x_1,\dots,x_d)\overset{\text{i.i.d.}}{\sim} \mathcal{N}(0,1) ,\quad\ y = \xi(\mathbf x)\! +\! \epsilon, \end{align*} where the response $y$ is a non-linear function $\xi(\mathbf x)$ plus independent white noise $\epsilon$. Note that it is crucial that the response contains some non-linearity, and it is something that one would expect in real datasets. For the purposes of the experiment, we wish to make the least squares solution easy to compute algebraically, so we choose the following response model: \ifisarxiv\vspace{-2mm}\fi \begin{align*} \xi(\mathbf x) = \sum_{i=1}^d x_i + \frac{x_i^3}{3},\quad \epsilon \sim \mathcal{N}(0,1). \end{align*} \ifisarxiv\vspace{-5mm} \fi We stress that there is nothing special about the choice of this response model other than the fact that it contains a non-linearity and it is easy to solve algebraically for $\boldsymbol\mathbf w_{\!D}^*$. We now compare the bias of the least squares estimator produced for this problem by i.i.d.~sampling of $k$ points, with that of an estimator computed from $k-d$ i.i.d.~samples augmented by $d$ volume samples (so that the total number of samples is the same in both cases). We used a special formula (Theorem~\ref{t:gaussian} below) to produce the volume-rescaled samples when $\dx$ is Gaussian. Our strategy is to produce many such estimators $\widehat{\mathbf w}_1,\dots,\widehat{\mathbf w}_T$ independently (e.g. by computing them in parallel on separate machines), and look at estimation error of the average of those estimators, i.e. \ifisarxiv\vspace{-4mm}\fi \begin{align*} \text{estimation error:}\quad \bigg\|\Big(\frac1T\sum_{t=1}^T\widehat{\mathbf w}_t\Big) - \boldsymbol\mathbf w_{\!D}^*\bigg\|^2. \end{align*} \ifisarxiv\vspace{-5mm} \fi \begin{figure} \vspace{-1.5mm} \includegraphics[width=0.5\textwidth]{figs/gaussian} \ifisarxiv\vspace{-6mm}\fi \caption{Experiment with Gaussian inputs.}\label{f:experiment} \end{figure}% Figure~\ref{f:experiment} shows the above experiment for several values of $k$ and a range of values of $T$ (each presented data point is an average over 50 runs). Since the corrected estimator ``i.i.d.~+~volume'' is unbiased, the estimation error of the average estimator exhibits $\frac1T$ convergence to zero (regardless of $k$). This type of convergence appears as a straight line on the log-log plot. In contrast, the i.i.d.~sampled estimator is biased for any sample size (although the bias decreases with $k$), and therefore the averaged estimator does not converge to the optimum. \subsection{Sampling Algorithms} \label{s:algs-overview} To our knowledge, existing literature on algorithms for DPPs and volume sampling (other than the exceptions discussed below) generally assumes full or considerable knowledge of the distribution $\dx$, which often may not be the case in practice, for example when the data is coming in a stream, or is drawn from a larger population. In this work, we are primarily interested in the setting where access to distribution $\dx$ is limited to some approximate statistics plus the ability to draw i.i.d.~samples from it. Two key concerns in this model are the time and sample complexities of volume-rescaled sampling for a given distribution $\dx$. We first consider distributions $\dx$ with bounded support. We use a standard notion of \emph{conditioning number} for multivariate distributions (see, e.g.,~\cite{chen2017condition}): \begin{align*} K_{\!\dx} \stackrel{\textit{\tiny{def}}}{=} \sup_{\widetilde{\mathbf x}\in\text{supp}(\dx)} \widetilde{\mathbf x}^\top\boldsymbol\Sigma_{\!\dx}^{-1}\widetilde{\mathbf x}. \end{align*} When $K_{\!\dx}$ is known to be bounded and we are given the exact knowledge of the covariance matrix $\boldsymbol\Sigma_{\!\dx}$, then it is possible to produce a volume-rescaled sample ${\mathrm{VS}_{\!\dx}^d}$ using a classical algorithm from the DPP literature described in \cite{dpp-first-algorithm} by employing rejection sampling (see also \cite{dpp-statistics}). This approach requires $O(K_{\!\dx}\log(d))$ draws from $\dx$ and runs in time $O(K_{\!\dx} d^2\log(d))$. However, sampled sets produced by that algorithm diverge from the desired distribution unless the given covariance matrix matches the true one exactly. This may be unrealistic when we do not have full access to the distribution $\dx$. Is it possible to sample from ${\mathrm{VS}_{\!\dx}^d}$ without the exact knowledge of $\boldsymbol\Sigma_{\!\dx}$? We answer the question affirmatively. We show that a recently proposed algorithm from \cite{leveraged-volume-sampling} for fixed design volume sampling can be adapted to arbitrary $\dx$ in such a way that it only requires an approximation of the covariance matrix $\boldsymbol\Sigma_{\!\dx}$, while still returning samples exactly from ${\mathrm{VS}_{\!\dx}^d}$. The original algorithm, called \emph{determinantal rejection sampling}, samples from a given finite design matrix (i.e., a discrete distribution $\dx$ which is fully-known), but it was shown in \cite{leveraged-volume-sampling} that the procedure only requires an approximation of the covariance matrix $\widehat{\Sigmab}=(1\pm\epsilon)\boldsymbol\Sigma_{\!\dx}$, where $\epsilon=O(\frac1d)$. We extend this algorithm to handle arbitrary distributions $\dx$, and also improve the analysis by reducing the required approximation quality to $\epsilon = O(\frac1{\sqrt{d}})$. \begin{theorem}\label{t:det} Given any $\widehat{\Sigmab}\in\R^{d\times d}$ s.t. \begin{align*} &(1-\epsilon)\boldsymbol\Sigma_{\!\dx}\preceq\widehat{\Sigmab}\preceq (1+\epsilon)\boldsymbol\Sigma_{\!\dx},\; \\&\text{where}\; \epsilon=\frac1{\sqrt{2d}}\;\text{and}\; K\!\geq\! \frac{K_{\!\dx}}{1-\epsilon}, \end{align*} there is an algorithm which returns $\widetilde{\mathbf x}_1,\dots,\widetilde{\mathbf x}_d\sim {\mathrm{VS}_{\!\dx}^d}$, and with probability at least $1-\delta$ its sample and time complexity is $O(K d(\ln(\frac1\delta))^2)$ and $O(K d^3(\ln(\frac1\delta))^2)$, respectively. \end{theorem} \begin{remark}\label{r:epsilon} Our $\epsilon=\frac{1}{\sqrt{2d}}$ condition improves the result from \cite{leveraged-volume-sampling} (where $\epsilon = \frac1{16d}$ was used). When $\dx$ is given as a finite set of $n$ vectors in $\R^d$, the main cost of volume sampling is an $\widetilde{O}(nd + d^3/\epsilon^2)$ preprocessing step of computing $\widehat{\Sigmab}$, where $\widetilde{O}(\cdot)$ hides $\operatorname{polylog}(n,d,1/\epsilon,1/\delta)$. Setting $\epsilon\!=\!\frac{1}{\sqrt{2d}}$ in Appendix~F of \cite{leveraged-volume-sampling}, we reduce that cost from $\widetilde{O}(nd+d^5)$ to $\widetilde{O}(nd+d^4)$ \end{remark} In Section~\ref{s:algorithm}, we discuss how $\widehat{\Sigmab}$ can be obtained just by sampling from the distribution $\dx$, which requires $m=O(K_{\!\dx} d\ln(d))$ samples with high probability and time $O(md^2)=O(K_{\!\dx} d^3\ln(d))$, nearly the same (up to log terms) as for the algorithm of Theorem~\ref{t:det} (here, the improved $\epsilon$ also plays a key role). The conditioning number $K_{\!\dx}$ can be much larger than the dimension $d$ of the distribution $\dx$, so obtaining an appropriate estimate of $\boldsymbol\Sigma_{\!\dx}$ required for Theorem~\ref{t:det} may still be prohibitively expensive. Thus, it is natural to ask if there are some structural assumptions on distribution $\dx$ which can allow us to sample from ${\mathrm{VS}_{\!\dx}^d}$ without any estimate of the covariance matrix. In the following result, we exploit a connection between volume-rescaled sampling and the Wishart distribution to show that when $\mathbf x$ is a centered multivariate normal, then without any knowledge of $\boldsymbol\Sigma_{\!\dx}$, we can produce a volume-rescaled sample from only $2d+2$ samples of $\dx$ and in $O(d^3)$ running time. \begin{theorem}\label{t:gaussian} Suppose that the point distribution $\dx$ is a Gaussian $\mathcal{N}(\mathbf 0, \boldsymbol\Sigma_{\!\dx})$ and let $\mathbf x_1,\dots,\mathbf x_{2d+2} {\sim}\dx^{2d+2}$. Then $\widetilde{\mathbf x}_1,\dots,\widetilde{\mathbf x}_d \ \sim\ {\mathrm{VS}_{\!\dx}^d}$, where \begin{align*} \widetilde{\mathbf x}_i \stackrel{\textit{\tiny{def}}}{=} \bigg(\sum_{j=d+1}^{2d+2}\mathbf x_j\mathbf x_j^\top\bigg)^{\frac12} \bigg(\sum_{j=1}^d\mathbf x_j\mathbf x_j^\top\bigg)^{-\frac12}\mathbf x_i. \end{align*} \end{theorem} \textbf{Note.} For a positive definite matrix $\mathbf A$, we define $\mathbf A^{\frac12}$ as the unique lower triangular matrix with positive diagonal entries s.t. $\mathbf A^{\frac12}(\mathbf A^{\frac12})^\top=\mathbf A$. Finding other distribution families which allow for volume-rescaled sampling with bounded sample complexity is an interesting future research direction. \section{SAMPLE AUGMENTATION} \label{s:unbiased} Let $\mathbf a_i^\top$ denote the $i$th row of a matrix $\mathbf A$. First, we extend a classic lemma by \cite{expected-generalized-variance}, which was originally used to show the expected value of a metric in multivariate statistics known as ``generalized variance''. \begin{lemma} [based on \cite{expected-generalized-variance}] \label{l:determinant} If the (transposed) rows of the random matrices $\mathbf A,\mathbf B\!\in\!\R^{k\times d}$ are sampled as pairs of vectors $(\mathbf a_1,\mathbf b_1),\dots,(\mathbf a_k,\mathbf b_k)$ i.i.d.~from a distribution over random vectors $(\mathbf a,\mathbf b)\!\in\!\R^{d\times 2}$ such that $\mathbb E[\mathbf a\mathbf b^\top]$ exists, then \begin{align*} \mathbb E \big[\det(\mathbf A^\top\mathbf B)\big] &= d!{k\choose d}\det\!\big(\mathbb E[\mathbf a\mathbf b^\top]\big). \end{align*} \end{lemma} The above result is slightly different than what was presented in \cite{expected-generalized-variance} (the original one had $\mathbf A=\mathbf B$, and the sample mean was subtracted from the vectors before constructing the matrix $\mathbf A^\top\mathbf A$), but the analysis is similar (see proof in Appendix~\ref{a:unbiased}). Note that for $\mathbf a=\mathbf b=\mathbf x$, Lemma~\ref{l:determinant} shows that ${\mathrm{VS}_{\!\dx}^k}$ integrates to $1$, making it a well-defined probability distribution: \begin{align*} \mathbb E_{\dxk}\bigg[\det\!\Big(\sum_{i=1}^k\mathbf x_i\mathbf x_i^\top\Big)\bigg] = d!{k\choose d}\det(\boldsymbol\Sigma_{\!\dx}). \end{align*} The asymmetry of Lemma~\ref{l:determinant} is crucial for showing the unbiasedness property of volume-rescaled sampling. \begin{proofof}{Theorem}{\ref{t:unbiased}} For $k=d$, the least squares estimator is simply the unique solution to a system of linear equations\footnote{Unless $\det(\mathbf X)=0$, in which case we let $\mathbf w^*(\mathbf S)=\mathbf X^+\mathbf y$.}, so Cramer's rule states that the $i$th component of that solution is given by: \[\big(\mathbf w^*(\mathbf S)\big)_i = \frac{\det(\mathbf X\!\overset{i}{\leftarrow}\!\mathbf y)}{\det(\mathbf X)},\] where $\mathbf X\!\overset{i}{\leftarrow}\!\mathbf y$ is matrix $\mathbf X$ with column $i$ replaced by $\mathbf y$. We first prove unbiasedness of $\mathbf w^*(\mathbf S)$ for samples of size $d$: \begin{align*} \mathbb E_{{\mathrm{VS}_{\!D}^d}} \big[\big(\mathbf w^*(\mathbf S)\big)_i\big] &= \frac{ \mathbb E_{D^d}[\det(\mathbf X)^2 \big(\mathbf w^*(\mathbf S)\big)_i]}{d!\det(\boldsymbol\Sigma_{\!\dx})}\\ &=\frac{\mathbb E_{D^d}\big[\det(\mathbf X)\det(\mathbf X\!\overset{i}{\leftarrow}\!\mathbf y)\big]}{d!\det(\boldsymbol\Sigma_{\!\dx})}\\ \text{(Lemma~\ref{l:determinant})}\quad &=\frac{\det\!\big(\,\mathbb E_D[\mathbf x\,(\mathbf x\!\overset{i}{\leftarrow}\!y)^\top]\,\big)} {\det(\boldsymbol\Sigma_{\!\dx})}\\ &= \frac{\det\!\big(\,\boldsymbol\Sigma_{\!\dx} \!\!\overset{i}{\leftarrow}\!\mathbb E_D[\mathbf x\,y]\,\big)} {\det(\boldsymbol\Sigma_{\!\dx})} =\big(\boldsymbol\mathbf w_{\!D}^*\big)_{\!i}, \end{align*} where we applied Lemma~\ref{l:determinant} to the pair of $d\times d$ matrices $\mathbf A=\mathbf X$ and $\mathbf B=\mathbf X \overset{i}{\leftarrow} \mathbf y$. The case of $k>d$ follows by induction based on a formula shown in \cite{unbiased-estimates-journal}: \begin{align*} \mathbb E&_{{\mathrm{VS}_{\!D}^k}} \big[\mathbf w^*(\mathbf S)\big] =\frac{\mathbb E_{\dk}\big[\det(\mathbf X^\top\mathbf X) \,\mathbf w^*(\mathbf S)\big]}{d!{k\choose d}\det(\boldsymbol\Sigma_{\!\dx})}\\ &\!\overset{(1)}{=} \frac{\mathbb E_{\dk} \Big[\frac1{k-d}\sum_{i=1}^k \det(\mathbf X_{-i}^\top\mathbf X_{-i})\,\mathbf w^*\!\big(\mathbf S\backslash \{(\mathbf x_i,y_i)\}\big)\Big]}{d!{k\choose d}\det(\boldsymbol\Sigma_{\!\dx})}\\ &= \frac1{k-d}\frac{\sum_{i=1}^k \mathbb E_{\dk}\big[\det(\mathbf X_{-i}^\top\mathbf X_{-i}) \mathbf w^*\!\big(\mathbf S\backslash\{(\mathbf x_i,y_i)\}\big)\big]}{d!{k\choose d}\det(\boldsymbol\Sigma_{\!\dx})}\\ &\!\overset{(2)}{=}\frac{k}{k-d}\, \frac{d!{k-1\choose d}}{d!{k\choose d}}\mathbb E_{{\mathrm{VS}_{\!D}^{k-1}}}\!\big[\mathbf w^*(\mathbf S)\big]=\mathbb E_{{\mathrm{VS}_{\!D}^{k-1}}}\!\big[\mathbf w^*(\mathbf S)\big], \end{align*} where $\mathbf X_{-i}$ denotes matrix $\mathbf X$ without the $i$th row, $(1)$ follows from the formula shown in \cite{unbiased-estimates-journal} (given in Lemma~\ref{l:pseudoinverse} of Appendix~\ref{a:unbiased}), while $(2)$ follows because the samples $\mathbf x_1,\dots,\mathbf x_k\sim \dxk$ are exchangeable, i.e. $\mathbf x_1,\dots,\cancel{\mathbf x_i},\dots,\mathbf x_k$ is distributed identically to $\mathbf x_1,\dots,\mathbf x_{k-1}$. \end{proofof} Finally, our key observation given in Theorem~\ref{l:decomposition} is that size $k$ volume-rescaled sampling can be decomposed into size $d$ volume-rescaled sampling plus i.i.d.~sampling of $k-d$ points. Note that a version of this already occurs for discrete volume sampling (see Section~\ref{s:introduction}). However it was not previously known even in that case. \begin{proofof}{Theorem}{\ref{l:decomposition}} Let $\text{DVS}_{\dx}^k$ denote the distribution of a matrix $\mathbf X\in\R^{k\times d}$ whose transposed rows are $\{\mathbf x_1,\dots,\mathbf x_k\}=\sigma(\langle \mathbf S ,\mathbf S_\circ\rangle)$. The probability of a measurable event $A$ w.r.t.~$\text{DVS}_{\dx}^k$ is: \begin{align*} \mathbb E_{\text{DVS}_{\dx}^k}\!&\big[\mathbf 1_A\big] = \frac1{{k\choose d}}\sum_{T\subseteq [k]:\,|T|=d} \!\! \frac{\mathbb E_{\dxk}[\mathbf 1_A\det(\mathbf X_T^\top\mathbf X_T)]} { d! \det(\boldsymbol\Sigma_{\!\dx})}\\ &\!\!=\frac1{d!{k\choose d}\! \det(\boldsymbol\Sigma_{\!\dx})}\mathbb E_{\dxk}\!\bigg[\mathbf 1_A \!\!\! \sum_{T\subseteq [k]:\,|T|=d}\!\!\! \det(\mathbf X_T^\top\mathbf X_T)\bigg]\\ &\!\!\!\overset{(*)}{=}\!\frac1{d!{k\choose d}\! \det(\boldsymbol\Sigma_{\!\dx})}\mathbb E_{\dxk}\!\big[\mathbf 1_A \det(\mathbf X^\top\mathbf X)\big] \\ &\!\!= \mathbb E_{{\mathrm{VS}_{\!\dx}^k}}\![\mathbf 1_A], \end{align*} where $[k]=\{1..k\}$, matrix $\mathbf X_T$ consists of the rows of $\mathbf X$ indexed by set $T$, and $(*)$ follows from the Cauchy-Binet formula. \end{proofof} \section{VOLUME-RESCALED GAUSSIAN}\label{s:gaussian} In this section, we obtain a simple formula for producing volume-rescaled samples when $\dx$ is a centered multivariate Gaussian with any (non-singular) covariance matrix. We achieve this by making a connection to the Wishart distribution. Thus, for this section, assume that $\mathbf x\sim\mathcal{N}(\mathbf 0,\boldsymbol\Sigma_{\!\dx})$, and let $\mathbf x_1,\dots,\mathbf x_k\sim \dxk$ be the transposed rows of matrix $\mathbf X$. Then matrix $\mathbf{\Sigma}=\mathbf X^\top\mathbf X\in\R^{d\times d}$ is distributed according to Wishart distribution $W_d(k,\boldsymbol\Sigma_{\!\dx})$ with $k$ degrees of freedom. The density function of this random matrix is proportional to $\det(\mathbf{\Sigma})^{(k-d-1)/2}\exp(-\frac12\mathrm{tr}(\boldsymbol\Sigma_{\!\dx}^{-1}\mathbf{\Sigma}))$. On the other hand, if $\widetilde{\Sigmab} = \widetilde{\mathbf{X}}^\top\widetilde{\mathbf{X}}$ is constructed from vectors $\widetilde{\mathbf x}_1,\dots,\widetilde{\mathbf x}_k\sim{\mathrm{VS}_{\!\dx}^k}$, then its density function is multiplied by an additional $\det(\widetilde{\Sigmab})$, thus increasing the value of $k$ in the exponent of the determinant. This observation leads to the following result: \begin{theorem}\label{t:wishart} If $\dx\sim \mathcal{N}(\mathbf 0,\boldsymbol\Sigma_{\!\dx})$ and $\widetilde{\mathbf x}_1,\dots,\widetilde{\mathbf x}_k\sim{\mathrm{VS}_{\!\dx}^k}$ are rows of a random matrix $\widetilde{\mathbf{X}}\in\R^{k\times d}$, then \begin{align*} \widetilde{\mathbf{X}}^\top\widetilde{\mathbf{X}}\sim W_d(k+2,\boldsymbol\Sigma_{\!\dx}). \end{align*} \end{theorem} \begin{proof} Let $\mathbf{\Sigma}=\mathbf X^\top\mathbf X \sim W_d(k,\boldsymbol\Sigma_{\!\dx})$ and $\widetilde{\Sigmab}\sim W_d(k+2,\boldsymbol\Sigma_{\!\dx})$. For any measurable event $A$ over the random matrix $\widetilde{\mathbf{X}}^\top\widetilde{\mathbf{X}}$, we have \begin{align*} \Pr\big(\widetilde{\mathbf{X}}^\top\widetilde{\mathbf{X}}\!\in\! A\big) &= \frac{\mathbb E[\mathbf 1_{[\mathbf X^\top\mathbf X\in A]}\det(\mathbf X^\top\mathbf X)]}{\mathbb E[\det(\mathbf X^\top\mathbf X)]}\\ &=\frac{\mathbb E[\mathbf 1_{[\mathbf{\Sigma}\in A]}\det(\mathbf{\Sigma})]}{\mathbb E[\det(\mathbf{\Sigma})]} \overset{(*)}{=}\Pr\big(\widetilde{\Sigmab}\!\in\! A\big), \end{align*} where $(*)$ follows because the density function of Wishart distribution $\widetilde{\Sigmab}\sim W_d(k+2,\boldsymbol\Sigma_{\!\dx})$ is proportional to $\det(\widetilde{\Sigmab}) \det(\widetilde{\Sigmab})^{(k-d-1)/2}\exp(-\frac12\mathrm{tr}(\boldsymbol\Sigma_{\!\dx}^{-1}\widetilde{\Sigmab}))$. \end{proof} This gives us an easy way to produce the total covariance matrix $\widetilde{\mathbf{X}}^\top\widetilde{\mathbf{X}}$ of volume-rescaled samples in the Gaussian case. We next show that the individual vectors can also be recovered easily. \begin{proofof}{Theorem}{\ref{t:gaussian}} The proof relies on the following two lemmas. \begin{lemma}\label{l:conditional} For any $\mathbf{\Sigma}\in\R^{d\times d}$, the conditional distribution of $\widetilde{\mathbf{X}}\sim{\mathrm{VS}_{\!\dx}^k}$ given $\widetilde{\mathbf{X}}^\top\widetilde{\mathbf{X}}=\mathbf{\Sigma}$ is the same as the conditional distribution of $\mathbf X\sim \dxk$ given $\mathbf X^\top\mathbf X=\mathbf{\Sigma}$. \end{lemma} While this lemma (proven in Appendix~\ref{a:gaussian}) relies primarily on the definition of conditional probability, the second one uses properties of the matrix variate Beta and Dirichlet distributions. \begin{lemma}\label{l:beta} For $\mathbf{\Sigma}\!\in\!\R^{d\times d}$ and vectors $\mathbf x_1,\dots,\mathbf x_k\!\sim\! \mathcal{N}(\mathbf 0,\boldsymbol\Sigma_{\!\dx})$ forming the transposed rows of a matrix $\mathbf X$, let \vspace{-3mm} \begin{align*} \widetilde{\mathbf x}_i = \mathbf{\Sigma}^{\frac12}(\mathbf X^\top\mathbf X)^{-\frac12}\mathbf x_i. \end{align*} Then $\widetilde{\mathbf x}_1,\dots,\widetilde{\mathbf x}_k$ are jointly distributed as $k$ Gaussians $\mathcal{N}(\mathbf 0,\boldsymbol\Sigma_{\!\dx})$ conditioned on $\widetilde{\mathbf{X}}^\top\widetilde{\mathbf{X}}=\mathbf{\Sigma}$. \end{lemma} Putting Theorem~\ref{t:wishart} together with the two lemmas, we observe that for any $k\geq d$, constructing $\mathbf{\Sigma}\sim W_d(k+2,\boldsymbol\Sigma_{\!\dx})$, and plugging it into Lemma~\ref{l:beta}, we obtain that $\widetilde{\mathbf x}_1,\dots \widetilde{\mathbf x}_k\sim {\mathrm{VS}_{\!\dx}^k}$, completing the proof of Theorem~\ref{t:gaussian}. \end{proofof} We conclude this section with the proof of Lemma~\ref{l:beta}, which demonstrates an interesting application for classical results in matrix variate statistics. \begin{proofof}{Lemma}{\ref{l:beta}} Let $\mathbf{\Sigma}_1\sim W_d(k_1,\boldsymbol\Sigma_{\!\dx})$ and $\mathbf{\Sigma}_2\sim W_d(k_2,\boldsymbol\Sigma_{\!\dx})$ be independent Wishart matrices (where $k_1+k_2\geq d$). Then matrix \[\mathbf U = (\mathbf{\Sigma}_1\!+\!\mathbf{\Sigma}_2)^{-\frac12}\mathbf{\Sigma}_1\big((\mathbf{\Sigma}_1\!+\!\mathbf{\Sigma}_2)^{-\frac12}\big)^\top\] is matrix variate beta distributed, written as $\mathbf U\sim B_d(k_1,k_2)$. The following was shown by \cite{matrix-variate-beta}: \begin{lemma}[\cite{matrix-variate-beta}, Lemma 3.5]\label{l:mvb} If $\mathbf{\Sigma}\sim W_d(k,\boldsymbol\Sigma_{\!\dx})$ is distributed independently of $\mathbf U\sim B_d(k_1,k_2)$, and if $k=k_1+k_2$, then \begin{align*} \mathbf B &= \mathbf{\Sigma}^{\frac12}\mathbf U\big(\mathbf{\Sigma}^{\frac12}\big)^\top \quad \text{and} \quad \mathbf C = \mathbf{\Sigma}^{\frac12}(\mathbf I-\mathbf U)\big(\mathbf{\Sigma}^{\frac12}\big)^\top \end{align*} are independently distributed and $\mathbf B\sim W_d(k_1,\boldsymbol\Sigma_{\!\dx})$, $\mathbf C\sim W_d(k_2,\boldsymbol\Sigma_{\!\dx})$. \end{lemma} Now, suppose that we are given a matrix $\mathbf{\Sigma}\sim W_d(k,\boldsymbol\Sigma_{\!\dx})$. We can decompose it into components of degree one via a splitting procedure described in \cite{matrix-variate-beta}, namely taking $\mathbf U_1\sim B_d(1,k\!-\!1)$ and computing $\mathbf B_1\sim \mathbf{\Sigma}^{\frac12}\mathbf U_1\big(\mathbf{\Sigma}^{\frac12}\big)^\top$, $\mathbf C_1=\mathbf{\Sigma}\!-\!\mathbf{\Sigma}_1$ as in Lemma~\ref{l:mvb}, then recursively repeating the procedure on $\mathbf C_1$ (instead of $\mathbf{\Sigma}$) with $\mathbf U_2\sim B_d(1,k\!-\!2)$, \ldots, until we get $k$ Wishart matrices of degree one summing to $\mathbf{\Sigma}$: \begin{align*} \mathbf B_1 &= \mathbf{\Sigma}^{\frac12}\mathbf U_1\big(\mathbf{\Sigma}^{\frac12}\big)^\top\\ \mathbf B_2 &= \underbrace{\mathbf{\Sigma}^{\frac12}(1\!-\!\mathbf U_1)^{\frac12}}_{\mathbf C_1^{1/2}}\mathbf U_2\underbrace{\big((\mathbf I\!-\!\mathbf U_1)^{\frac12}\big)^\top\big(\mathbf{\Sigma}^{\frac12}\big)^\top}_{(\mathbf C_1^{1/2})^\top}\\[-3mm] \vdots&\\ \mathbf B_k&=\underbrace{\mathbf{\Sigma}^{\frac12}(1\!-\!\mathbf U_{k-1})^{\frac12}\dots}_{\mathbf C_{k-1}^{1/2}}\mathbf U_k\underbrace{\dots \big((1\!-\!\mathbf U_{k-1})^{\frac12}\big)^\top\big(\mathbf{\Sigma}^{\frac12}\big)^\top\!\!}_{(\mathbf C_{k-1}^{1/2})^\top}. \end{align*} The above collection of matrices can be described more simply via the matrix variate Dirichlet distribution. Given independent matrices $\mathbf{\Sigma}_i\sim W_d(k_i,\boldsymbol\Sigma_{\!\dx})$ for $i=1..s$, the matrix variate Dirichlet distribution $D_d(k_1,\dots,k_s)$ corresponds to a sequence of matrices \begin{align*} \mathbf V_i=\mathbf{\Sigma}^{-\frac12}\mathbf{\Sigma}_i\big(\mathbf{\Sigma}^{-\frac12}\big)^\top, \ i=1..s, \quad \mathbf{\Sigma}=\sum_{i=1}^s\mathbf{\Sigma}_i. \end{align*} Now, Theorem 6.3.14 from \cite{matrix-variate-distributions} states that matrices $\mathbf B_i$ defined recursively as above can also be written as \begin{align*} \mathbf B_i = \mathbf{\Sigma}^{\frac12}\mathbf V_i\big(\mathbf{\Sigma}^{\frac12}\big)^\top,\quad (\mathbf V_1,\dots,\mathbf V_k)\sim D_d(1,\dots,1). \end{align*} In particular, we can construct them as \begin{align*} \mathbf B_i = \widetilde{\mathbf x}_i\widetilde{\mathbf x}_i^\top = \mathbf{\Sigma}^{\frac12}(\mathbf X^\top\mathbf X)^{-\frac12}\mathbf x_i \mathbf x_i^\top\big((\mathbf X^\top\mathbf X)^{-\frac12}\big)^\top\big(\mathbf{\Sigma}^{\frac12}\big)^\top\!. \end{align*} Note that since matrix $\mathbf{\Sigma}$ is independent of vectors $\mathbf x_i$, we can condition on it without altering the distribution of the vectors. It remains to observe that the conditional distribution of matrix $\mathbf B_i$ determines the distribution of $\widetilde{\mathbf x}_i$ up to multiplying by $\pm 1$, and since both $\widetilde{\mathbf x}_i$ and $-\widetilde{\mathbf x}_i$ are identically distributed, we recover the correct distribution of $\widetilde{\mathbf x}_1,\dots,\widetilde{\mathbf x}_k$ conditioned on $\widetilde{\mathbf{X}}^\top\widetilde{\mathbf{X}}=\mathbf{\Sigma}$, completing the proof. \end{proofof} \section{GENERAL ALGORITHM} \label{s:algorithm} In this section, we present a general algorithm for volume-rescaled sampling, which uses approximate leverage score sampling to generate a larger pool of points from which the smaller volume-rescaled sample can be drawn. The method relies on a technique called ``determinantal rejection sampling'', introduced recently in \cite{leveraged-volume-sampling} for a variant of volume sampling of finite subsets of points from a fixed set. Also, as in \cite{leveraged-volume-sampling} our algorithm uses the most standard volume sampling distribution (see \eqref{eq:vol} and the associated discussion in the introduction) as a subroutine which samples a subset of points/rows from a fixed set. This is done via an efficient implementation of ``reverse iterative sampling'' \cite{unbiased-estimates-journal} (See Algorithm \ref{alg:standard} for a high-level description of this sampling method). Curiously enough, the efficient implementation of reverse iterative sampling given by \cite{unbiased-estimates-journal} (denoted here as ``VolSamp$(\{\mathbf x_1,\dots,\mathbf x_n\},k)$'' and not repeated here for lack of space) is again based on rejection sampling: It samples a set of $k$ points out of $n$ in time $O(nd^2)$ (independent of $k$). The runtime bound for this implementation only holds with high probability because of its use of rejection sampling. For our algorithm we assume that an estimate $\widehat{\Sigmab} \approx\boldsymbol\Sigma_{\!\dx}$ of the covariance matrix is available, along with an upper-bound on the conditioning number. \begin{algorithm \caption{\bf \small Determinantal rejection sampling\qquad\white{.} \hspace{2.25cm}for arbitrary distributions $\dx$} \label{alg:det} \begin{algorithmic}[1] \STATE \textbf{Input:} $\widehat{\Sigmab}, K, t$ \STATE \textbf{repeat} \STATE \quad $k\rightarrow 0$ \STATE \quad\textbf{while} $k<t$ \STATE \quad\quad Sample $\mathbf x \sim \dx$ \STATE \quad\quad $a\sim \text{Bernoulli}\Big(\min\big\{\,1,\ \frac{\mathbf x^\top\widehat{\Sigmab}^{-1}\mathbf x}{K}\, \big\}\Big)$ \STATE \quad\quad\textbf{if} $a\!=\!\text{true}$,\ \textbf{then} \STATE\quad\quad\quad $k\!\leftarrow\! k\!+\!1$ \STATE \quad\quad\quad$\mathbf x_k\leftarrow \mathbf x$ \STATE \quad\quad\quad$\widetilde{\mathbf x}_k\leftarrow \frac{\sqrt{d}}{\sqrt{\mathbf x_k^\top\widehat{\Sigmab}^{-1}\mathbf x_k}} \,\mathbf x_k$ \vspace{-1mm} \STATE\quad\quad\textbf{end} \STATE \quad\textbf{end} \vspace{1mm} \STATE \quad $\widetilde{\Sigmab} \leftarrow \frac1t\sum_{j=1}^t \widetilde{\mathbf x}_j\widetilde{\mathbf x}_j^\top$ \STATE \quad Sample $\textit{Acc}\sim \text{Bernoulli}\big(\min\{\,1,\ \det(\widetilde{\Sigmab}\widehat{\Sigmab}^{-1})\,\}\big)$ \vspace{-3mm} \STATE \textbf{until} $\textit{Acc}=\text{true}$ \vspace{1mm} \STATE $\{\widetilde{\mathbf x}_{i_1},\dots,\widetilde{\mathbf x}_{i_d}\} \leftarrow$ VolSamp$\big(\{\widetilde{\mathbf x}_1,\dots,\widetilde{\mathbf x}_t\},d\big)$ \RETURN $\mathbf x_{i_1},\dots,\mathbf x_{i_d}$ \end{algorithmic} \end{algorithm} Algorithm~\ref{alg:det} has one additional hyperparameter $t$, which controls the number of inner-loop iterations. Our analysis works for any $t>d^2$, although for simplicity we use $t = 2d^2$ in the main result. \begin{algorithm}[H] \caption{\bf \ \small Reverse iterative sampling \cite{unbiased-estimates-journal}} \label{alg:standard} \begin{algorithmic}[1] \STATE Input $\{\mathbf x_1,\dots,\mathbf x_n\}\subset \R^d$ and $k\geq d$ \STATE \quad$S \leftarrow \{1..n\}$ \vspace{1mm} \STATE \quad{\bf while} $|S|>k$ \STATE \quad\quad For each ${i\in S}$: $q_i\!\leftarrow\! \frac{\det(\sum_{j\in S\backslash i}\mathbf x_j\mathbf x_j^\top )}{(|S|-d)\det(\sum_{j\in S}\mathbf x_j\mathbf x_j^\top)}$ \STATE \quad\quad Sample $i$ from distribution $(q_i)_{i\in S}$ \vspace{1mm} \STATE \quad\quad $S\leftarrow S \backslash \{i\}$ \STATE \quad{\bf end} \RETURN $\{\mathbf x_i\}_{i\in S}$ \end{algorithmic} \end{algorithm} Our analysis of Algorithm~\ref{alg:det} uses the following two lemmas, both of which are extensions of results from~\cite{leveraged-volume-sampling}. \begin{lemma}\label{l:fast-rejection} For $\widehat{\Sigmab}\succ 0$, let $l_{\widehat{\Sigmab}}(\mathbf x)=\mathbf x^\top\widehat{\Sigmab}^{-1}\mathbf x$. Define the following probability measure over $\R^d$: \begin{align*} {\mathrm{Lev}}_{\widehat{\Sigmab},{\cal X}}(A) \stackrel{\textit{\tiny{def}}}{=} \mathbb E_{\dx}\bigg[\,\mathbf 1_A\ \frac{ l_{\widehat{\Sigmab}}(\mathbf x)} {\mathrm{tr}(\boldsymbol\Sigma_{\!\dx}\widehat{\Sigmab}^{-1})}\bigg]. \end{align*} If $\mathbf x_1,\dots,\mathbf x_t \overset{\textnormal{\fontsize{6}{6}\selectfont i.i.d.}}{\sim}{\mathrm{Lev}}_{\widehat{\Sigmab}, {\cal X}}$, and $\widetilde{\mathbf x}_i=\frac{\sqrt{d}}{\sqrt{l_{\widehat{\Sigmab}}(\mathbf x_i)}} \,\mathbf x_i$, then \begin{align*} \det(\widetilde{\Sigmab}\widehat{\Sigmab}^{-1})\leq 1,\quad\text{where}\quad \widetilde{\Sigmab}=\frac1t\sum_{i=1}^t \widetilde{\mathbf x}_i\widetilde{\mathbf x}_i^\top,\\ \text{and}\quad\mathbb E\big[\!\det(\widetilde{\Sigmab}\widehat{\Sigmab}^{-1})\big] \geq \Big(1-\frac{d^2}{t}\Big)\frac{\det(\boldsymbol\Sigma_{\!\dx}\widehat{\Sigmab}^{-1})}{(\frac1d\mathrm{tr}(\boldsymbol\Sigma_{\!\dx}\widehat{\Sigmab}^{-1}))^d}. \end{align*} \end{lemma} \begin{lemma}\label{l:composition} Let $\mathbf x_1,\dots,\mathbf x_k\sim{\mathrm{VS}_{\!\dx}^k}$ be a volume-rescaled sample, and suppose that $\{\mathbf x_{i_1},\dots,\mathbf x_{i_d}\}$ is a subset produced from it by standard volume sampling, i.e. by calling $\textnormal{VolSamp}(\{\mathbf x_1,\dots,\mathbf x_k\},d)$. Then $\mathbf x_{i_1},\dots,\mathbf x_{i_d}\sim{\mathrm{VS}_{\!\dx}^d}$. \end{lemma} We now show that Algorithm~\ref{alg:det} with $t=2d^2$ satisfies the conditions of Theorem~\ref{t:det}. Our key contribution compared to the analysis of \cite{leveraged-volume-sampling} is the use of the Kantorovich inequality, which allows us to significantly relax the $\epsilon$-approximation condition on $\widehat{\Sigmab}$. \begin{proofof}{Theorem}{\ref{t:det}} From the assumptions, we have \[K\geq \frac{K_{\!\dx}}{1-\epsilon}\geq \max_{\widetilde{\mathbf x}\in\text{supp}(\dx)}\widetilde{\mathbf x}^\top\widehat{\Sigmab}^{-1}\widetilde{\mathbf x},\] so the sequence $\widetilde{\mathbf x}_1,\dots,\widetilde{\mathbf x}_{t}$ obtained by the algorithm at the point of exiting the \textbf{while} loop is distributed as in Lemma~\ref{l:fast-rejection}, and let $D_{\cal \widetilde{\!X}}$ be the distribution of one such vector. The lemma ensures that $\det\!\big(\widetilde{\Sigmab}\widehat{\Sigmab}^{-1}\big)\leq 1$ is a valid Bernoulli success probability so after exiting the \textbf{repeat} loop, $\widetilde{\mathbf x}_1,\dots,\widetilde{\mathbf x}_{t}$ is distributed so that the probability of any event $A$ is proportional to \begin{align*} \mathbb E_{D_{\cal \widetilde{\!X}}^t}\!\bigg[\mathbf 1_A\frac{\det(\widetilde{\Sigmab})}{\det(\widehat{\Sigmab})}\bigg] \propto \mathbb E_{D_{\cal \widetilde{\!X}}^t}\!\bigg[\mathbf 1_A \det\!\Big(\sum_{i=1}^t\widetilde{\mathbf x}_i\widetilde{\mathbf x}_i^\top\Big)\bigg] \propto{\mathrm{VS}}_{D_{\cal \widetilde{\!X}}}^t, \end{align*} i.e., volume-rescaled sampling from $D_{\cal \widetilde{\!X}}$. Now Lemma \ref{l:composition} implies that $\widetilde{\mathbf x}_{i_1},\dots,\widetilde{\mathbf x}_{i_d}\sim{\mathrm{VS}}_{D_{\cal \widetilde{\!X}}}^d$. In particular, it means that the distribution of $\mathbf x_{i_1},\dots,\mathbf x_{i_d}$ is the same for any choice of $t\geq d$. We use this observation to compute the probability of an event $A$ w.r.t.~sampling of $\mathbf x_{i_1},\dots,\mathbf x_{i_d}$ (up to constant factors) by setting $t=d$ (in the below, $\widetilde{\Sigmab}$ is treated as a function of $\mathbf x_1,\dots,\mathbf x_d$): \begin{align*} \Pr(A) &\propto\mathbb E_{\dxk} \bigg[\,\mathbf 1_A\,\det\!\big(\widetilde{\Sigmab}\big) \bigg(\prod_{i=1}^dl_{\widehat{\Sigmab}}(\mathbf x_i)\bigg)\bigg]\\ &\overset{(*)}{=} \mathbb E_{\dxk} \bigg[\,\mathbf 1_A\,\frac{\det(\sum_i\mathbf x_i\mathbf x_i^\top)}{(\frac{d}{t})^d \prod_il_{\widehat{\Sigmab}}(\mathbf x_i)}\bigg(\prod_{i=1}^dl_{\widehat{\Sigmab}}(\mathbf x_i)\bigg)\bigg]\\ &\propto \mathbb E_{\dxk} \bigg[\,\mathbf 1_A\,\det\!\bigg(\sum_{i=1}^d\mathbf x_i\mathbf x_i^\top\bigg)\bigg]\\ &\propto{\mathrm{VS}_{\!\dx}^d}(A), \end{align*} where $(*)$ uses the fact that for $t=d$, $\det(\widetilde{\Sigmab})$ is the squared volume of the parallelopiped spanned by $\mathbf x_1,\dots,\mathbf x_d$ and stretched with the appropriate scaling factors. Thus, we established the correctness of Algorithm~\ref{alg:det} for any $t\geq d$, and we move on to complexity analysis. If we think of each iteration of the \textbf{repeat} loop as a single Bernoulli trial, the success probability $\Pr(\textit{Acc}\!=\!\text{true})$ equals $\mathbb E[\det(\widetilde{\Sigmab}\widehat{\Sigmab}^{-1})]$ with the expectation defined as in Lemma~\ref{l:fast-rejection}. Let $\lambda_1,\dots,\lambda_d$ be the eigenvalues of matrix $\widehat{\Sigmab} \boldsymbol\Sigma_{\!\dx}^{-1}$. The approximation guarantee for $\widehat{\Sigmab}$ implies that all of these eigenvalues lie in the range $[1\!-\!\epsilon,1\!+\!\epsilon]$. To lower-bound the success probability, we use the Kantorovich arithmetic-harmonic mean inequality. Letting $A(\cdot)$, $G(\cdot)$ and $H(\cdot)$ denote the arithmetic, geometric and harmonic means respectively: \begin{align*} &\hspace{-5mm}\frac{\det(\boldsymbol\Sigma_{\!\dx}\widehat{\Sigmab}^{-1})}{(\frac{1}{d}\mathrm{tr}(\boldsymbol\Sigma_{\!\dx}\widehat{\Sigmab}^{-1}))^d} =\frac{\prod_{i=1}^d\frac{1}{\lambda_i}}{(\frac{1}{d}\sum_{i=1}^d\frac{1}{\lambda_i})^d}\\ &=\bigg(\frac{H(\lambda_1,\dots,\lambda_d)}{G(\lambda_1,\dots,\lambda_d)}\bigg)^d \;\overset{(1)}{\geq}\;\; \!\bigg(\frac{H(\lambda_1,\dots,\lambda_d)}{A(\lambda_1,\dots,\lambda_d)}\bigg)^d\\ &\overset{(2)}{\geq}\!\big((1\!-\!\epsilon)(1\!+\!\epsilon)\big)^d \;\;\stackrel{\epsilon = 1/\sqrt{2d}} {=} \;\;\Big(1-\frac{1}{2d}\Big)^d \!\geq \frac12, \end{align*} where $(1)$ is the geometric-arithmetic mean inequality and $(2)$ is the Kantorovich inequality (\cite{kant}) with $a\!=\!1\!-\!\epsilon$ and $b\!=\!1\!+\!\epsilon$: $$\text{For } 0\!<\! a\!\le\! \lambda_1 , \!\mydots, \lambda_d \!\le\! b,\ \ \frac{A(\lambda_1,\!\mydots,\lambda_d)}{H(\lambda_1,\!\mydots,\lambda_d)} \!\leq\! \bigg(\frac{A(a,b)} {G(a,b)}\bigg)^{\!2} \!\!. $$ Now setting $t=2d^2$ in Lemma~\ref{l:fast-rejection}, we obtain that \begin{align*} \Pr(\textit{Acc}\!=\!\text{true}) = \mathbb E\big[\!\det(\widetilde{\Sigmab}\widehat{\Sigmab}^{-1})\big] \geq \Big(1-\frac{d^2}{t}\Big)\,\frac12=\frac14. \end{align*} So a simple tail bound on a geometric random variable shows that the number of iterations of \textbf{repeat} loop is $r\leq \ln(\frac1\delta)/\ln(\frac34)$ w.p. at least $1-\delta$. It remains to bound the number of samples needed from $\dx$. Note that we can lower bound this success probability \begin{align*} \Pr(a\!=\!\text{true})&=\mathbb E_{\dx}\bigg[\frac{\mathbf x^\top\widehat{\Sigmab}^{-1}\mathbf x}{K}\bigg] = \frac{\mathrm{tr}(\boldsymbol\Sigma_{\!\dx}\widehat{\Sigmab}^{-1})}{K}\\ &\geq\frac{\mathrm{tr}(\boldsymbol\Sigma_{\!\dx}\sigd^{-1})}{(1+\epsilon) K} =\frac{d}{(1+\epsilon)K}. \end{align*} Similarly as before we conclude that the number of samples needed for a single iteration of \textbf{repeat} loop is $O(2d^2 \frac{K}{d}\ln(\frac1\delta))=O(Kd\ln(\frac1\delta))$ w.p. at least $1-\delta$. Note that the computational cost per sample is $O(d^2)$ and the cost of VolSamp is $O(d^4)$, obtaining the desired complexities. \end{proofof} Finally, we discuss the time and sample complexity of obtaining $\widehat{\Sigmab}$ with desired accuracy under the model where access to $\dx$ is given only through sampling from the distribution. For this we can rely on standard matrix Chernoff bounds given by \cite{matrix-tail-bounds}. The below version is adapted from \cite{chen2017condition}: \begin{lemma}[\cite{matrix-tail-bounds,chen2017condition}]\label{l:matrix-tail} \ If $\mathbf x_1,\mathbf x_2,\dots,\mathbf x_m \overset{\textnormal{\fontsize{6}{6}\selectfont i.i.d.}}{\sim}\dx$ and $m\geq C \frac{K_{\!\dx}}{\epsilon^2}\ln(\frac{d}{\delta})$ for some absolute constant $C$, then \begin{align*} (1-\epsilon)\boldsymbol\Sigma_{\!\dx}\preceq\frac1m\sum_{i=1}^m\mathbf x_i\mathbf x_i^\top\preceq (1+\epsilon)\boldsymbol\Sigma_{\!\dx}\quad\!\!\text{w.p.}\geq 1-\delta. \end{align*} \end{lemma} Setting $\epsilon=\frac1{\sqrt{2d}}$ in Lemma~\ref{l:matrix-tail}, we note that the sample complexity of obtaining $\widehat{\Sigmab}$ that would satisfy the assumptions of Theorem~\ref{t:det} is $m=O(K_{\!\dx} d\ln(\frac{d}{\delta}))$, and computing it takes $O(md^2) = O(K_{\!\dx} d^3\ln(\frac{d}{\delta}))$. \section{CONCLUSIONS} We show that for the least squares estimator, the bias which occurs in random design linear regression can be corrected by augmenting the dataset with dimension many points sampled from a special joint distribution - an extension of discrete volume sampling. We present two methods for performing this augmentation when the underlying data distribution is only known through i.i.d.~samples. In the process we improve the time complexity of a recently proposed algorithm for discrete volume sampling. An important future research direction is providing a random design error analysis for the least squares estimator of the augmented sample. Furthermore, it is natural to ask if there are distribution families other than multivariate normal which offer better complexity guarantees for producing volume-rescaled samples. \bibliographystyle{plain}
{'timestamp': '2018-10-08T02:04:02', 'yymm': '1810', 'arxiv_id': '1810.02453', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02453'}
arxiv
\section{Related work} Although the focus of the football analytics community has been mostly on developing metrics for measuring chance quality, there has also been some work on quantifying other types of actions like passes. Power et al.~\cite{power2017not} objectively measure the expected risk and reward of each pass using spatio-temporal tracking data. Gyarmati and Stanojevic~\cite{gyarmati2016qpass} value each pass by quantifying the value of having the ball in the origin and destination location of the pass using event data. Although their approach is similar in spirit to ours, our proposed approach takes more contextual information into account to value the passes. Furthermore, there has also been some work in the sports analytics community on more general approaches that aim to quantify several different types of actions~\cite{cervone2014pointwise,decroos2018hattrics,decroos2017starss,liu2018deepreinforcementlearning,schulte2015qfunction}. Decroos et al.~\cite{decroos2017starss} compute the value of each on-the-ball action in football (e.g., a pass or a dribble) by computing the difference between the values of the post-action and pre-action game states. Their approach distributes the expected reward of a possession sequence across the constituting actions, whereas our approach computes the expected reward for each pass individually. Cervone et al.~\cite{cervone2014pointwise} propose a method to predict points and to value decisions in basketball. Liu and Schulte as well as Schulte et al.~\cite{liu2018deepreinforcementlearning,schulte2015qfunction} present a deep reinforcement learning approach to address a similar task for ice hockey. \section{Dataset} \label{section:dataset} Our dataset comprises game data for 9,061 games in the English Premier League, Spanish LaLiga, German 1. Bundesliga, Italian Serie A, French Ligue Un, Belgian Pro League and Dutch Eredivisie. The dataset spans the 2014/2015 through 2017/2018 seasons and was provided by SciSports' partner Wyscout.\footnote{\url{https://www.wyscout.com}} For each game, the dataset contains information on the players (i.e., name, date of birth and position) and the teams (i.e., starting lineup and substitutions) as well as play-by-play event data describing the most notable events that happened on the pitch. For each event, the dataset provides the following information: timestamp (i.e., half and time), team and player performing the event, type (e.g., pass or shot) and subtype (e.g., cross or high pass), and start and end location. Table~\ref{table:data-example} shows an excerpt from our dataset showing five consecutive passes. \begin{table}[htp!] \centering \caption{An excerpt from our dataset showing five consecutive passes.} \label{table:data-example} \begin{tabular}{rrrrrrrrrr} \toprule \textbf{half} & \textbf{time (s)} & \textbf{team} & \textbf{player} & \textbf{type} & \textbf{subtype} & \textbf{start\_x} & \textbf{end\_x} & \textbf{start\_y} & \textbf{end\_y} \tabularnewline \midrule 1 & 8.642 & 679 & 217031 & 8 & 85 & 58 & 66 & 34 & 9 \tabularnewline 1 & 10.167 & 679 & 86307 & 8 & 85 & 66 & 85 & 9 & 17 \tabularnewline 1 & 11.987 & 679 & 3443 & 8 & 85 & 85 & 90 & 17 & 25 \tabularnewline 1 & 13.681 & 679 & 4488 & 8 & 80 & 90 & 89 & 25 & 44 \tabularnewline 1 & 14.488 & 679 & 3682 & 8 & 85 & 89 & 81 & 44 & 39 \tabularnewline \bottomrule \end{tabular} \end{table} \section{Conclusion} This paper introduced a novel approach for measuring football players' on-the-ball contributions from passes using play-by-play event data collected during football games. Viewing a football game as a series of possession sequences, our approach values each pass by computing the difference between the values of its constituting possession sequence before and after the pass. To value a possession sequence, our approach combines a k-nearest-neighbor search with dynamic time warping, where the value of the possession sequence reflects its likeliness of yielding a goal. In the future, we aim to improve our approach by accounting for the strength of the opponent and more accurately valuing the possession sequences by taking more contextual information into account. To compute the similarities between the possession sequences, we also plan to investigate spatio-temporal convolution kernels (e.g.,~\cite{knauf2014spatio}) as an alternative for dynamic time warping and to explore more sophisticated techniques for clustering the possession sequences. \section{Introduction} The performances of individual football players in games are hard to quantify due to the low-scoring nature of football. During major tournaments like the FIFA World Cup, the organizers\footnote{\url{https://www.fifa.com/worldcup/statistics/}} and mainstream sports media report basic statistics like distance covered, number of assists, number of saves, number of goal attempts, and number of completed passes~\cite{burnton2018best}. While these statistics provide some insights into the performances of individual football players, they largely fail to account for the circumstances under which the actions were performed. For example, successfully completing a forward pass deep into the half of the opponent is both more difficult and more valuable than performing a backward pass on the own half without any pressure from the opponent whatsoever. In recent years, football analytics researchers and enthusiasts alike have proposed several performance metrics for individual players. Although the majority of these metrics focuses on measuring the quality of shots, there has been an increasing interest in quantifying other types of individual player actions~\cite{decroos2018hattrics,gyarmati2016qpass,power2017not}. This recent focus shift has been fueled by the availability of more extensive data and the observation that shots only constitute a small portion of the on-the-ball actions that football players perform during games~\cite{power2017not}. In the present work, we use a dataset comprising over twelve million on-the-ball actions of which only 2\% are shots. Instead, the majority of the on-the-ball actions are passes (75\%), dribbles (13\%), and set pieces (10\%). In this paper, we introduce a novel approach to measure football players' on-the-ball contributions from passes during games. Our approach measures the expected impact of each pass on the scoreline. We value a pass by computing the difference between the expected reward of the possession sequence constituting the pass both before and after the pass. That is, a pass receives a positive value if the expected reward of the possession sequence after the pass is higher than the expected reward before the pass. Our approach employs a k-nearest-neighbor search with dynamic time warping (DTW) as a distance function to determine the expected reward of a possession sequence. Our empirical evaluation on an extensive real-world dataset shows that our approach is capable of identifying different types of impactful players like the ball-playing defender Ragnar Klavan (Liverpool FC), the advanced playmaker Mesut \"{O}zil (Arsenal), and the deep-lying playmaker Toni Kroos (Real Madrid). \section{Approach} \label{section:approach} Valuing individual actions such as passes is challenging due to the low-scoring nature of football. Since football players get only a few occasions during games to earn reward from their passes (i.e., each time a goal is scored), we resort to computing the passes' expected rewards instead of distributing the actual rewards from goals across the preceding passes. More specifically, we compute the number of goals expected to arise from a given pass if that pass were repeated many times. To this end, we propose a four-step approach to measure football players' expected contributions from their passes during football games. In the remainder of this section, we discuss each step in turn. \subsection{Constructing possession sequences} We split the event stream for each game into a set of possession sequences, which are sequences of events where the same team remains in possession of the ball. The first possession sequence in each half starts with the kick-off. The end of one possession sequence and thus also the start of the following possession sequence is marked by one the following events: a team losing possession (e.g., due to an inaccurate pass), a team scoring a goal, a team committing a foul (e.g., an offside pass), or the ball going out of play. \subsection{Labeling possession sequences} We label each possession sequence by computing its expected reward. When a possession sequence \textit{does not} result in a shot, the sequence receives a value of zero. When a possession sequence \textit{does} result in a shot, the sequence receives the expected-goals value of the shot. This value reflects how often the shot can be expected to yield a goal if the shot were repeated many times. For example, a shot having an expected-goals value of 0.13 is expected to translate into 13 goals if the shot were repeated 100 times. Building on earlier work, we train an expected-goals model to value shots~\cite{decroos2017predicting}. We represent each shot by its location on the pitch (i.e., x and y location), its distance to the center of the goal, and the angle between its location and the goal posts. We label the shots resulting in a goal as positive examples and all other shots as negative examples. We train a binary classification model that assigns a probability of scoring to each shot. \subsection{Valuing passes} \label{subsection:valuing-passes} \begin{figure}[ht] \begin{center} \includegraphics[width=0.8\textwidth]{figures/spvmethod.png} \caption{Visualization of our approach to value passes, where we value the last pass of the possession sequence shown in green. We obtain a pass value of 0.15, which is the difference between the value of the possession subsequence after the pass (0.45) and the value of the possession subsequence before the pass (0.30).} \label{fig:method} \end{center} \vspace{-20pt} \end{figure} We split each possession sequence into a set of possession subsequences. Each subsequence starts with the same event as the original possession sequence and ends after one of the passes in that sequence. For example, a possession sequence consisting of a pass 1, a pass 2, a dribble and a pass 3 collapses into a set of three possession subsequences. The first subsequence consists of pass 1, the second subsequence consists of pass 1 and pass 2, and the third subsequence consists of pass 1, pass 2, the dribble, and pass 3. We value a given pass by computing the difference between the expected reward of the possession subsequence after that pass and the expected reward of the possession subsequence before that pass. Hence, the value of the pass reflects an increase or decrease in expected reward. We assume that a team can only earn reward whenever it is in possession of the ball. If the pass is the first in its possession subsequence, we set the expected reward of the possession subsequence before the pass to zero. If the pass is unsuccessful and thus marks the end of its possession subsequence, we set the expected reward of the possession subsequence after the pass to zero. We compute the expected reward of a possession subsequence by first performing a k-nearest-neighbors search and then averaging the labels of the k most-similar possession subsequences. We use dynamic time warping (DTW) to measure the similarity between two possession subsequences~\cite{bemdt1994using}. We interpolate the possession subsequences and obtain the x and y coordinates at fixed one-second intervals. We first apply DTW to the x coordinates and y coordinates separately and then sum the differences in both dimensions. To speed up the k-nearest-neighbors search, we reduce the number of computations by first clustering the possession subsequences and then performing DTW within each cluster. We divide the pitch into a grid of cells, where each cell is 15 meters long and 17 meters wide. Hence, a default pitch of 105 meters long and 68 meters wide yields a 7-by-4 grid. We represent each cluster as an origin-destination pair and thus obtain 784 clusters (i.e., 28 origins $\times$ 28 destinations). We assign each possession subsequence to exactly one cluster based on its start and end location on the pitch. Figure~\ref{fig:method} shows a visualization of our approach for valuing passes. In this example, we aim to value the last pass in the possession sequence shown in green (top-left figure). First, we compute the value of the possession subsequence before the pass (top-right figure). We compute the average of the labels of the two nearest neighbors, which are 0.0 and 0.6, and obtain a value of 0.3. Second, we compute the value of the possession subsequence after the pass (bottom-left figure). We compute the average of the labels of the two nearest neighbors, which are 0.4 and 0.5, and obtain a value of 0.45. Third, we compute the difference between the value after the pass and the value before the pass to obtain a pass value of 0.15 (bottom-right figure). \subsection{Rating players} We rate a player by first summing the values of his passes for a given period of time (e.g., a game, a sequence of games or a season) and then normalizing the obtained sum per 90 minutes of play. We consider all types of passes, including open-play passes, goal kicks, corner kicks, and free kicks. \section{Experimental evaluation} \label{section:results} In this section, we present an experimental evaluation of our proposed approach. We introduce the datasets, present the methodology, investigate the impact of the parameters, and present results for the 2017/2018 season. \subsection{Datasets} We split the available data presented in Section~\ref{section:dataset} into three datasets: a train set, a validation set, and a test set. We respect the chronological order of the games. Our train set covers the 2014/2015 and 2015/2016 seasons, our validation set covers the 2016/2017 season, and our test set covers the 2017/2018 season. Table~\ref{tbl:datasets} shows the characteristics of our three datasets. \begin{table} \centering \caption{The characteristics of our three datasets.} \label{tbl:datasets} \begin{tabular}{lrrr} \toprule & \textbf{Train set} & \textbf{Validation set} & \textbf{Test set} \tabularnewline \midrule Games & {4,253} & {2,404} & {2,404} \tabularnewline Possession sequences & {1,878,593} & {972,526} & {970,303} \tabularnewline Passes & {3,425,285} & {1,998,533} & {2,023,730} \tabularnewline Shots & {95,381} & {53,617} & {54,311} \tabularnewline Goals & {9,853} & {5,868} & {5,762} \tabularnewline \bottomrule \end{tabular} \end{table} \subsection{Methodology} \label{subsection:methodology} We use the \texttt{XGBoost} algorithm to train the expected-goals model.\footnote{\url{https://xgboost.readthedocs.io/en/latest/}} After optimizing the parameters using a grid search, we set the number of estimators to 500, the learning rate to 0.01, and the maximum tree depth to 5. We use the dynamic time warping implementation provided by the \texttt{dtaidistance} library to compute the distances between the possession subsequences.\footnote{\url{https://github.com/wannesm/dtaidistance}} We do not restrict the warping paths in the distance computations. Inspired by the work from Liu and Schulte on evaluating player performances in ice hockey, we evaluate our approach by predicting the outcomes of future games as we expect our pass values to be predictors of future performances~\cite{liu2018deepreinforcementlearning}. We predict the outcomes for 1,172 games in the English Premier League, Spanish LaLiga, German 1. Bundesliga, Italian Serie A and French Ligue Un. We only consider games involving teams for which player ratings are available for at least one player in each line (i.e., goalkeeper, defender, midfielder or striker). We assume that the number of goals scored by each team in each game is Poisson distributed~\cite{maher1982modelling}. We use the player ratings obtained on the validation set to determine the means of the Poisson random variables representing the expected number of goals scored by the teams in the games in the test set. We compute the Poisson means by summing the ratings for the players in the starting line-up. For players who played at least 900 minutes in the 2016/2017 season, we consider their actual contributions. For the remaining players, we use the average contribution of the team's players in the same line. Since the average reward gained from passes (i.e., 0.07 goals per team per game) only reflects around 5\% of the average reward gained during games (i.e., 1.42 goals per team per game), we transform the distribution over the total player ratings per team per game to follow a similar distribution as the average number of goals scored by each team in each game in the validation set. We compute the probabilities for a home win, a draw, and an away win using the Skellam distribution~\cite{karlis2008bayesian}. \subsection{Impact of the parameters} We now investigate how the clustering step impacts the results and what the optimal number of neighbors in the k-nearest-neighbors search is. \subsubsection{Impact of the clustering step.} For an increasing number of possession sequences, performing the k-nearest-neighbors search quickly becomes prohibitively expensive. For example, obtaining results on our test set would require over 1.8 trillion distance computations (i.e., 1,878,593 possession sequences in the train set $\times$ 970,303 possession sequences in the test set). To reduce the number of distance computations, we exploit the observation that possession sequences starting or ending in entirely different locations on the pitch are unlikely to be similar. For example, a possession sequence starting in a team's penalty area is unlikely to be similar to a possession sequence starting in the opponent's penalty area. More specifically, as explained in Section~\ref{subsection:valuing-passes}, we first cluster the possession sequences according to their start and end locations and then perform the k-nearest-neighbors search within each cluster. To evaluate the impact of the clustering step on our results, we arbitrarily sample 100 games from the train set and 50 games from the validation set. The resulting train and validation subsets consist of 68,907 sequences and 35,291 sequences, respectively. Table~\ref{tbl:clustering} reports the total runtimes, the number of clusters, and the average cluster size for three settings: no clustering, clustering with grid cells of 15 by 17 meters, and clustering with grid cells of 5 by 4 meters. As expected, clustering the possession sequences speeds up our approach considerably. In addition, we also investigate the impact of the clustering step in a more qualitative fashion. We randomly sample three possession sequences and 100 games comprising 32,245 possession sequences from our training set. We perform a three-nearest-neighbors search in both the no-clustering setting and the clustering setting with grid cells of 15 by 17 meters. Figure~\ref{fig:sequences_preclus} shows the three nearest neighbors for each of the three possession sequences in both settings, where the results for the clustering setting are shown on the left and the results for the no-clustering setting are shown on the right. Although the obtained possession sequences are different, the three-nearest-neighbors search obtains highly similar neighbors in both settings. \begin{figure}[H] \vspace{-10pt} \begin{center} \includegraphics[width=0.7\textwidth]{figures/sequences_preclus.png} \caption{Visualization of the three nearest neighbors obtained for three randomly sampled possession sequences in both the clustering setting with grid cells of 15 by 17 meters and the no-clustering setting. The results for the former setting are on the left, whereas the results for the latter setting are on the right.} \label{fig:sequences_preclus} \end{center} \end{figure} \begin{table}[H] \centering \caption{The characteristics of three settings: no clustering, clustering with grid cells of 15 by 17 meters, and clustering with grid cells of 5 by 4 meters.} \label{tbl:clustering} \begin{tabular}{lrrr} \toprule & \textbf{No clustering} & \textbf{Cell: 15$\times$17} & \textbf{Cell: 5$\times$4}\tabularnewline \midrule Total runtime & {270 minutes} & {12 minutes} & {150 minutes} \tabularnewline Number of clusters & 1 & 784 & 127,449 \tabularnewline Average cluster size & {68,907} & {87.89} & {0.54} \tabularnewline \bottomrule \end{tabular} \end{table} \subsubsection{Optimal number of neighbors in the k-nearest-neighbors search.} We investigate the optimal number of neighbors in the k-nearest-neighbors search to value passes. We try the following values for the parameter $k$: 1, 2, 5, 10, 20, 50 and 100. We predict the outcomes of the games in the test set as explained in Section~\ref{subsection:methodology}. Table~\ref{tbl:loglosses} shows the logarithmic losses for each of the values for $k$. We find that 10 is the optimal number of neighbors. In addition, we compare our approach to two baseline approaches. The first baseline approach is the pass accuracy. The second baseline approach is the prior distribution over the possible game outcomes, where we assign a probability of 48.42\% to a home win, 28.16\% to an away win, and 23.42\% to a draw. Our approach outperforms both baseline approaches. \subsection{Results} We now present the players who provided the highest contributions from passes during the 2017/2018 season. We present the overall ranking as well as the top-ranked players under the age of 21. Furthermore, we investigate the relationship between a player's average value per pass and his total number of passes per 90 minutes as well as the distribution of the player ratings per position. \begin{table}[H] \centering \caption{Logarithmic losses for predicting the games in the test set for different numbers of nearest neighbors $k$ in order of increasing logarithmic loss.} \label{tbl:loglosses} \begin{tabular}{lr} \toprule \textbf{Setting} & \textbf{Logarithmic loss} \tabularnewline \midrule $k=10$ & {1.0521} \tabularnewline $k=5$ & {1.0521} \tabularnewline $k=20$ & {1.0528} \tabularnewline $k=2$ & {1.0560} \tabularnewline $k=50$ & {1.0579} \tabularnewline $k=100$ & {1.0594} \tabularnewline $k=1$ & {1.0725} \tabularnewline Pass accuracy & {1.0800} \tabularnewline Prior distribution & {1.0860} \tabularnewline \bottomrule \end{tabular} \end{table} Following the experiments above, we set the number of nearest neighbors $k$ to 10 and perform clustering with grid cells of 15 meters by 17 meters. We compute the expected reward per 90 minutes for the players in the 2017/2018 season (i.e., the test set) and perform the k-nearest-neighbors search to value their passes on all other seasons (i.e., the train and validation set). Table~\ref{tbl:ranking-1718} shows the top-ten-ranked players who played at least 900 minutes during the 2017/2018 season in the English Premier League, Spanish LaLiga, German 1. Bundesliga, Italian Serie A, and French Ligue Un. Ragnar Klavan, who is a ball-playing defender for Liverpool FC, tops our ranking with an expected contribution per 90 minutes of 0.1133. Furthermore, Arsenal's advanced playmaker Mesut \"{O}zil ranks second, whereas Real Madrid's deep-lying playmaker Toni Kroos ranks third. Table~\ref{tbl:ranking-1718-talents} shows the top-five-ranked players under the age of 21 who played at least 900 minutes during the 2017/2018 season in Europe's top-five leagues, the Dutch Eredivisie or the Belgian Pro League. Teun Koopmeiners (AZ Alkmaar) tops our ranking with an expected contribution per 90 minutes of 0.0806. Furthermore, Real Madrid-loanee Martin {\O}degaard (SC Heerenveen) ranks second, whereas Nikola Milenkovi\'{c} (ACF Fiorentina) ranks third. \begin{table}[H] \vspace{-10pt} \centering \caption{The top-ten-ranked players who played at least 900 minutes during the 2017/2018 season in Europe's top-five leagues.} \label{tbl:ranking-1718} \begin{tabular}{rllr} \toprule \textbf{Rank} & \textbf{Player} & \textbf{Team} & \textbf{Contribution P90} \tabularnewline \midrule 1 & Ragnar Klavan & Liverpool FC & 0.1133 \tabularnewline 2 & Mesut \"{O}zil & Arsenal & 0.1034 \tabularnewline 3 & Toni Kroos & Real Madrid & 0.0943 \tabularnewline 4 & Manuel Lanzini & West Ham United & 0.0892 \tabularnewline 5 & Joan Jord\'{a}n & SD Eibar & 0.0830 \tabularnewline 6 & Esteban Granero & Espanyol & 0.0797 \tabularnewline 7 & Nuri Sahin & Borussia Dortmund & 0.0796 \tabularnewline 8 & Mahmoud Dahoud & Borussia Dortmund & 0.0775 \tabularnewline 9 & Granit Xhaka & Arsenal & 0.0774 \tabularnewline 10 & Faouzi Ghoulam & SSC Napoli & 0.0765 \tabularnewline \bottomrule \end{tabular} \vspace{-10pt} \end{table} \begin{table}[H] \vspace{-10pt} \centering \caption{The top-five-ranked players under the age of 21 who played at least 900 minutes during the 2017/2018 season in Europe's top-five leagues, the Dutch Eredivisie or the Belgian Pro League.} \label{tbl:ranking-1718-talents} \begin{tabular}{rllr} \toprule \textbf{Rank} & \textbf{Player} & \textbf{Team} & \textbf{Contribution P90} \tabularnewline \midrule 1 & Teun Koopmeiners & AZ Alkmaar & 0.0806 \tabularnewline 2 & Martin {\O}degaard & SC Heerenveen & 0.0639 \tabularnewline 3 & Nikola Milenkovi\'{c} & ACF Fiorentina & 0.0617 \tabularnewline 4 & Sander Berge & KRC Genk & 0.0601 \tabularnewline 5 & Maximilian W\"{o}ber & Ajax & 0.0599 \tabularnewline \bottomrule \end{tabular} \vspace{-10pt} \end{table} Figure~\ref{fig:top10scatter} shows whether players earn their pass contribution by performing many passes per 90 minutes or by performing high-value passes. The five players with the highest contribution per 90 minutes are highlighted in red. While Lanzini and Joan Jord\'{a}n do not perform many passes per 90 minutes, they obtain a rather high average value per pass. The dotted line drawn through Klavan contains all points with the same contribution per 90 minutes as him. \begin{figure}[htb] \begin{center} \includegraphics[width=0.8\textwidth]{figures/top10scatter.png} \caption{Scatter plot showing the correlation between a player's average value per pass and his total number of passes per 90 minutes. The five players with the highest contribution per 90 minutes are highlighted in red.} \label{fig:top10scatter} \end{center} \end{figure} Figure~\ref{fig:positions_kde} presents a comparison between a player's pass accuracy and pass contribution per 90 minutes. In terms of pass accuracy, forwards rate low as they typically perform passes in more crowded areas of the pitch, while goalkeepers rate high. In terms of pass contribution, goalkeepers rate low, while especially midfielders rate high. \begin{figure}[htb] \centering \subfloat{\includegraphics[width=.4\textwidth]{figures/Goalkeeper_kde.png}}\quad \subfloat{\includegraphics[width=.4\textwidth]{figures/Defender_kde.png}}\\ \subfloat{\includegraphics[width=.4\textwidth]{figures/Midfielder_kde.png}}\quad \subfloat{\includegraphics[width=.4\textwidth]{figures/Forward_kde.png}} \caption{Density plots per position showing the correlation between the pass accuracy and the pass contribution per 90 minutes.} \label{fig:positions_kde} \vspace{-10pt} \end{figure} \subsection{Application: Replacing Manuel Lanzini} We use our pass values to find a suitable replacement for Manuel Lanzini. The Argentine midfielder, who excelled at West Ham United throughout the 2017/2018 season, ruptured his right knee's anterior cruciate ligament while preparing for the 2018 FIFA World Cup. West Ham United are expected to sign a replacement for Lanzini, who will likely miss the entire 2018/2019 season. To address this task, we define a ``Lanzini similarity function'' that accounts for a player's pass contribution per 90 minutes, number of passes per 90 minutes and pass accuracy. We normalize each of the three pass metrics before feeding them into the similarity function. Manuel Lanzini achieves a high pass contribution per 90 minutes despite a low pass accuracy, which suggests that the midfielder prefers high-risk, high-value passes over low-risk, low-value passes. Table~\ref{tbl:lanzini} shows the five most-similar players to Lanzini born after July 1st, 1993, who played at least 900 minutes in the 2017/2018 season. Mahmoud Dahoud (Borussia Dortmund) tops the list ahead of Joan Jord\'{a}n (SD Eibar) and Naby Ke\"{i}ta (RB Leipzig), who moved to Liverpool during the summer of 2018. \begin{table}[H] \vspace{-10pt} \centering \caption{The five most-similar players to Manuel Lanzini born after July 1st, 1993, who played at least 900 minutes in the 2017/2018 season.} \label{tbl:lanzini} \begin{tabular}{rllr} \toprule \textbf{Rank} & \textbf{Player} & \textbf{Team} & \textbf{Similarity score} \tabularnewline \midrule 1 & Mahmoud Dahoud & Borussia Dortmund & 0.9955 \tabularnewline 2 & Joan Jord\'{a}n & SD Eibar & 0.9881 \tabularnewline 3 & Naby Ke\"{i}ta & RB Leipzig & 0.9794 \tabularnewline 4 & Dominik Kohr & Bayer 04 Leverkusen& 0.9717 \tabularnewline 5 & Medr\'{a}n & Deportivo Alav\'{e}s & 0.9591 \tabularnewline \bottomrule \end{tabular} \end{table}
{'timestamp': '2018-10-05T02:12:42', 'yymm': '1810', 'arxiv_id': '1810.02252', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02252'}
arxiv
\section{Introduction} Graph-structured data is ubiquitous across application domains ranging from chemo- and bioinformatics to image and social network analysis. To develop successful machine learning models in these domains, we need techniques that can exploit the rich information inherent in graph structure, as well as the feature information contained within a graph's nodes and edges. In recent years, numerous approaches have been proposed for machine learning graphs---most notably, approaches based on graph kernels \cite{Vis+2010} or, alternatively, using graph neural network algorithms \cite{Ham+2017a}. Kernel approaches typically fix a set of features in advance---e.g., indicator features over subgraph structures or features of local node neighborhoods. For example, one of the most successful kernel approaches, the \new{Weisfeiler-Lehman subtree kernel}~\cite{She+2011}, which is based on the $1$-dimensional Weisfeiler-Leman graph isomorphism heuristic \cite[pp.\,79\,ff.]{Gro2017}, generates node features through an iterative relabeling, or \emph{coloring}, scheme: First, all nodes are assigned a common initial color; the algorithm then iteratively recolors a node by aggregating over the multiset of colors in its neighborhood, and the final feature representation of a graph is the histogram of the resulting node colors. By iteratively aggregating over local node neighborhoods in this way, the WL subtree kernel is able to effectively summarize the neighborhood substructures present in a graph. However, while powerful, the WL subtree kernel---like other kernel methods---is limited because this feature construction scheme is fixed (i.e., it does not adapt to the given data distribution). Moreover, this approach---like the majority of kernel methods---focuses only on the graph structure and cannot interpret continuous node and edge labels, such as real-valued vectors which play an important role in applications such as bio- and chemoinformatics. Graph neural networks (GNNs) have emerged as a machine learning framework addressing the above challenges. Standard GNNs can be viewed as a neural version of the $1$-WL algorithm, where colors are replaced by continuous feature vectors and neural networks are used to aggregate over node neighborhoods \cite{Ham+2017,Kip+2017}. In effect, the GNN framework can be viewed as implementing a continuous form of graph-based ``message passing'', where local neighborhood information is aggregated and passed on to the neighbors~\cite{Gil+2017}. By deploying a trainable neural network to aggregate information in local node neighborhoods, GNNs can be trained in an end-to-end fashion together with the parameters of the classification or regression algorithm, possibly allowing for greater adaptability and better generalization compared to the kernel counterpart of the classical $1$-WL algorithm. Up to now, the evaluation and analysis of GNNs has been largely empirical, showing promising results compared to kernel approaches, see, e.g.,~\cite{Yin+2018}. However, it remains unclear how GNNs are actually encoding graph structure information into their vector representations, and whether there are theoretical advantages of GNNs compared to kernel based approaches. \xhdr{Present Work} We offer a theoretical exploration of the relationship between GNNs and kernels that are based on the $1$-WL algorithm. We show that GNNs cannot be more powerful than the $1$-WL in terms of distinguishing non-isomorphic (sub-)graphs, e.g., the properties of subgraphs around each node. This result holds for a broad class of GNN architectures and all possible choices of parameters for them. On the positive side, we show that given the right parameter initialization GNNs have the same expressiveness as the $1$-WL algorithm, completing the equivalence. Since the power of the $1$-WL has been completely characterized, see, e.g.,~\cite{Arv+2015,kiefer2015graphs}, we can transfer these results to the case of GNNs, showing that both approaches have the same shortcomings. Going further, we leverage these theoretical relationships to propose a generalization of GNNs, called $k$-GNNs, which are neural architectures based on the $k$-dimensional WL algorithm ($k$-WL), which are strictly more powerful than GNNs. The key insight in these higher-dimensional variants is that they perform message passing directly between subgraph structures, rather than individual nodes. This higher-order form of message passing can capture structural information that is not visible at the node-level. Graph kernels based on the $k$-WL have been proposed in the past \cite{Mor+2017}. However, a key advantage of implementing higher-order message passing in GNNs---which we demonstrate here---is that we can design hierarchical variants of $k$-GNNs, which combine graph representations learned at different granularities in an end-to-end trainable framework. Concretely, in the presented hierarchical approach the initial messages in a $k$-GNN are based on the output of lower-dimensional $k'$-GNN (with $k' < k$), which allows the model to effectively capture graph structures of varying granularity. Many real-world graphs inherit a hierarchical structure---e.g., in a social network we must model both the ego-networks around individual nodes, as well as the coarse-grained relationships between entire communities, see, e.g.,~\cite{New2003}---and our experimental results demonstrate that these hierarchical $k$-GNNs are able to consistently outperform traditional GNNs on a variety of graph classification and regression tasks. Across twelve graph regression tasks from the QM9 benchmark, we find that our hierarchical model reduces the mean absolute error by 54.45\% on average. For graph classification, we find that our hierarchical models leads to slight performance gains. \xhdr{Key Contributions} Our key contributions are summarized as follows: \begin{enumerate} \item We show that GNNs are not more powerful than the $1$-WL in terms of distinguishing non-isomorphic (sub-)graphs. Moreover, we show that, assuming a suitable parameter initialization, GNNs have the same power as the $1$-WL. \item We propose $k$-GNNs, which are strictly more powerful than GNNs. Moreover, we propose a hierarchical version of $k$-GNNs, so-called $1$-$k$-GNNs, which are able to work with the fine- and coarse-grained structures of a given graph, and relationships between those. \item Our theoretical findings are backed-up by an experimental study, showing that higher-order graph properties are important for successful graph classification and regression. \end{enumerate} \section{Related Work} Our study builds upon a wealth of work at the intersection of supervised learning on graphs, kernel methods, and graph neural networks. Historically, kernel methods---which implicitly or explicitly map graphs to elements of a Hilbert space---have been the dominant approach for supervised learning on graphs. Important early work in this area includes random-walk based kernels \cite{Gae+2003,Kas+2003}) and kernels based on shortest paths \cite{Borgwardt2005}. More recently, developments in graph kernels have emphasized scalability, focusing on techniques that bypass expensive Gram matrix computations by using explicit feature maps. Prominent examples of this trend include kernels based on graphlet counting~\cite{She+2009}, and, most notably, the Weisfeiler-Lehman subtree kernel~\cite{She+2011} as well as its higher-order variants~\cite{Mor+2017}. Graphlet and Weisfeiler-Leman kernels have been successfully employed within frameworks for smoothed and deep graph kernels~\cite{Yan+2015,Yan+2015a}. Recent works focus on assignment-based approaches~\cite{Kri+2016,Nik+2017,Joh+2015}, spectral approaches~\cite{Kon+2016}, and graph decomposition approaches~\cite{Nik+2018}. Graph kernels were dominant in graph classification for several years, leading to new state-of-the-art results on many classification tasks. However, they are limited by the fact that they cannot effectively adapt their feature representations to a given data distribution, since they generally rely on a fixed set of features. More recently, a number of approaches to graph classification based upon neural networks have been proposed. Most of the neural approaches fit into the graph neural network framework proposed by~\cite{Gil+2017}. Notable instances of this model include \new{Neural Fingerprints}~\cite{Duv+2015}, \emph{Gated Graph Neural Networks}~\cite{Li+2016}, \emph{GraphSAGE}~\cite{Ham+2017}, \emph{SplineCNN}~\cite{Fey+2018}, and the spectral approaches proposed in~\cite{Bru+2014,Def+2015,Kip+2017}---all of which descend from early work in~\cite{Mer+2005} and~\cite{Sca+2009}. Recent extensions and improvements to the GNN framework include approaches to incorporate different local structures around subgraphs \cite{Xu+2018} and novel techniques for pooling node representations in order perform graph classification \cite{Zha+2018,Yin+2018}. GNNs have achieved state-of-the-art performance on several graph classification benchmarks in recent years, see, e.g.,~\cite{Yin+2018}---as well as applications such as protein-protein interaction prediction~\cite{Fou+2017}, recommender systems~\cite{Yin+2018a}, and the analysis of quantum interactions in molecules~\cite{Sch+2017}. A survey of recent advancements in GNN techniques can be found in \cite{Ham+2017a}. Up to this point (and despite their empirical success) there has been very little theoretical work on GNNs---with the notable exceptions of Li et\ al.'s \cite{Li+2018a} work connecting GNNs to a special form Laplacian smoothing and Lei et al.'s\@ \cite{Lei+2017} work showing that the feature maps generated by GNNs lie in the same Hilbert space as some popular graph kernels. Moreover, Scarselli et al.\ \cite{Sca+2009a} investigates the approximation capabilities of GNNs. \section{Preliminaries}\label{prelim} We start by fixing notation, and then outline the Weisfeiler-Leman algorithm and the standard graph neural network framework. \subsection{Notation and Background} A \new{graph} $G$ is a pair $(V,E)$ with a finite set of \new{nodes} $V$ and a set of \new{edges} $E \subseteq \{ \{u,v\} \subseteq V \mid u \neq v \}$. We denote the set of nodes and the set of edges of $G$ by $V(G)$ and $E(G)$, respectively. For ease of notation we denote the edge $\{u,v\}$ in $E(G)$ by $(u,v)$ or $(v,u)$. Moreover, $N(v)$ denotes the \new{neighborhood} of $v$ in $V(G)$, i.e., $N(v) = \{ u \in V(G) \mid (v, u) \in E(G) \}$. We say that two graphs $G$ and $H$ are \new{isomorphic} if there exists an edge preserving bijection $\varphi: V(G) \to V(H)$, i.e., $(u,v)$ is in $E(G)$ if and only if $(\varphi(u),\varphi(v))$ is in $E(H)$. We write $G \simeq H$ and call the equivalence classes induced by $\simeq$ \new{isomorphism types}. Let $S \subseteq V(G)$ then $G[S] = (S,E_S)$ is the \new{subgraph induced} by $S$ with $E_S = \{ (u,v) \in E(G) \mid u,v \in S \}$. A \new{node coloring} is a function $V(G) \to \Sigma$ with arbitrary codomain $\Sigma$. Then a \new{node colored} or \new{labeled graph} $(G,l)$ is a graph $G$ endowed with a node coloring $l \colon V(G) \to \Sigma$. We say that $l(v)$ is a \new{label} or \new{color} of $v\in V(G)$. We say that a node coloring $c$ \new{refines} a node coloring $d$, written $c \sqsubseteq d$, if $c(v) = c(w)$ implies $d(v) = d(w)$ for every $v,w$ in $V(G)$. Two colorings are \new{equivalent} if $c \sqsubseteq d$ and $d \sqsubseteq c$, and we write $c \equiv d$. A \new{color class} $Q\subseteq V(G)$ of a node coloring $c$ is a maximal set of nodes with $c(v)=c(w)$ for every $v,w$ in $Q$. Moreover, let $[1\!:\!n] = \{ 1, \dotsc, n \} \subset \mathbb{N}$ for $n > 1$, let $S$ be a set then the set of \new{$k$-sets} $[S]^k = \{ U \subseteq S \mid |U| = k \}$ for $k \geq 2$, which is the set of all subsets with cardinality $k$, and let $\{\!\!\{ \dots \}\!\!\}$ denote a multiset. \subsection{Weisfeiler-Leman Algorithm} We now describe the \textsc{$1$-WL} algorithm for labeled graphs. Let $(G,l)$ be a labeled graph. In each iteration, $t \geq 0$, the $1$-WL computes a node coloring $c^{(t)}_l \colon V(G) \to \Sigma$, which depends on the coloring from the previous iteration. In iteration $0$, we set $c^{(0)}_l = l$. Now in iteration $t>0$, we set \begin{equation}\label{eq:wlColoring} c_{l}^{(t)}(v) \!=\! \textsc{hash}\Big(\!\big(c_l^{(t-1)}(v),\{\!\!\{ c_l^{(t-1)}(u)\!\mid\!u \in\!N(v) \!\}\!\!\} \big)\! \Big) \end{equation} where $\textsc{hash}$ bijectively maps the above pair to a unique value in $\Sigma$, which has not been used in previous iterations. To test two graph $G$ and $H$ for isomorphism, we run the above algorithm in ``parallel'' on both graphs. Now if the two graphs have a different number of nodes colored $\sigma$ in $\Sigma$, the \textsc{$1$-WL} concludes that the graphs are not isomorphic. Moreover, if the number of colors between two iterations does not change, i.e., the cardinalities of the images of $c_l^{(t-1)}$ and $c_l^{(t)}$ are equal, the algorithm terminates. Termination is guaranteed after at most $\max \{ |V(G)|,|V(H)| \}$ iterations. It is easy to see that the algorithm is not able to distinguish all non-isomorphic graphs, e.g., see~\cite{Cai+1992}. Nonetheless, it is a powerful heuristic, which can successfully test isomorphism for a broad class of graphs~\cite{Bab+1979}. The $k$-dimensional Weisfeiler-Leman algorithm ($k$-WL), for $k \geq 2$, is a generalization of the $1$-WL which colors tuples from $V(G)^k$ instead of nodes. That is, the algorithm computes a coloring $c^{(t)}_{l,k} \colon V(G)^k \to \Sigma$. In order to describe the algorithm, we define the $j$-th neighborhood \begin{equation}\label{gnei} N_j(s) \!=\! \{ ( s_1, \dotsc, s_{j-1}, r, s_{j+1}, \dotsc, s_k) \mid r \in V(G) \} \end{equation} of a $k$-tuple $s = (s_1, \dotsc, s_k )$ in $V(G)^k$. That is, the $j$-th neighborhood $N_j(t)$ of $s$ is obtained by replacing the $j$-th component of $s$ by every node from $V(G)$. In iteration $0$, the algorithm labels each $k$-tuple with its \new{atomic type}, i.e., two $k$-tuples $s$ and $s'$ in $V(G)^k$ get the same color if the map $s_i \mapsto s'_i$ induces a (labeled) isomorphism between the subgraphs induced from the nodes from $s$ and $s'$, respectively. For iteration $t > 0$, we define \begin{equation}\label{wl-prim} C^{(t)}_j(s) = \textsc{hash}_{}\big(\{\!\!\{ c^{(t-1)}_{l,k}(s') \mid s' \in N_j(s)\}\!\!\}\big), \end{equation} and set \begin{equation}\label{labelk} c_{k,l}^{(t)}(s)\!=\! \textsc{hash}_{}\Big( \!\big(c_{k,l}^{(t-1)}(s), \big( C^{(t)}_1(s), \dots, C^{(t)}_k(s) \big) \! \Big)\,. \end{equation} Hence, two tuples $s$ and $s'$ with $c_{k,l}^{(t-1)}(s) = c_{k,l}^{(t-1)}(s')$ get different colors in iteration $t$ if there exists $j$ in $[1\!:\!k]$ such that the number of $j$-neighbors of $s$ and $s'$, respectively, colored with a certain color is different. The algorithm then proceeds analogously to the \textsc{$1$-WL}. By increasing $k$, the algorithm gets more powerful in terms of distinguishing non-isomorphic graphs, i.e., for each $k\geq 2$, there are non-isomorphic graphs which can be distinguished by the ($k+1$)-WL but not by the $k$-WL~\cite{Cai+1992}. We note here that the above variant is not equal to the \emph{folklore} variant of $k$-WL described in~\cite{Cai+1992}, which differs slightly in its update rule. However, it holds that the $k$-WL using~\cref{labelk} is as powerful as the folklore $(k\!-\!1)$-WL \cite{GroheO15}. \xhdr{WL Kernels} After running the WL algorithm, the concatenation of the histogram of colors in each iteration can be used as a feature vector in a kernel computation. Specifically, in the histogram for every color $\sigma$ in $\Sigma$ there is an entry containing the number of nodes or $k$-tuples that are colored with $\sigma$. \subsection{Graph Neural Networks} Let $(G,l)$ be a labeled graph with an initial node coloring $f^{(0)}: V(G)\rightarrow \mathbb{R}^{1\times d}$ that is \emph{consistent} with $l$. This means that each node $v$ is annotated with a feature $f^{(0)}(v)$ in $\ensuremath{\mathbb{R}}^{1\times d}$ such that $f^{(0)}(u) = f^{(0)}(v)$ if and only if $l(u) = l(v)$. Alternatively, $f^{(0)}(v)$ can be an arbitrary real-valued feature vector associated with $v$. Examples include continuous atomic properties in chemoinformatic applications where nodes correspond to atoms, or vector representations of text in social network applications. A GNN model consists of a stack of neural network layers, where each layer aggregates local neighborhood information, i.e., features of neighbors, around each node and then passes this aggregated information on to the next layer. A basic GNN model can be implemented as follows~\cite{Ham+2017a}. In each layer $t > 0$, we compute a new feature \begin{equation}\label{eq:basicgnn} f^{(t)}(v) = \sigma \Big( f^{(t-1)}(v) \cdot W^{(t)}_1 +\, \sum_{\mathclap{w \in N(v)}}\,\, f^{(t-1)}(w) \cdot W_2^{(t)} \Big) \end{equation} in $\ensuremath{\mathbb{R}}^{1 \times e}$ for $v$, where $W_1^{(t)}$ and $W_2^{(t)}$ are parameter matrices from $\ensuremath{\mathbb{R}}^{d \times e}$ , and $\sigma$ denotes a component-wise non-linear function, e.g., a sigmoid or a ReLU.\footnote{For clarity of presentation we omit biases.} Following~\cite{Gil+2017}, one may also replace the sum defined over the neighborhood in the above equation by a permutation-invariant, differentiable function, and one may substitute the outer sum, e.g., by a column-wise vector concatenation or LSTM-style update step. Thus, in full generality a new feature $f^{(t)}(v)$ is computed as \begin{equation}\label{eq:gnngeneral} f^{W_1}_{\text{merge}}\Big(f^{(t-1)}(v) ,f^{W_2}_{\text{aggr}}\big(\{\!\!\{ f^{(t-1)}(w) \mid w \in N(v)\}\!\!\} \big)\!\Big), \end{equation} where $f^{W_1}_{\text{aggr}}$ aggregates over the set of neighborhood features and $f^{W_2}_{\text{merge}}$ merges the node's representations from step $(t-1)$ with the computed neighborhood features. Both $f^{W_1}_{\text{aggr}}$ and $f^{W_2}_{\text{merge}}$ may be arbitrary differentiable, permutation-invariant functions (e.g., neural networks), and, by analogy to Equation \ref{eq:basicgnn}, we denote their parameters as $W_1$ and $W_2$, respectively. In the rest of this paper, we refer to neural architectures implementing~\cref{eq:gnngeneral} as \emph{$1$-dimensional GNN architectures} ($1$-GNNs). A vector representation $f_{\text{GNN}}$ over the whole graph can be computed by summing over the vector representations computed for all nodes, i.e., \begin{equation*} f_{\text{GNN}}(G) = \sum_{v \in V(G)} f^{(T)}(v), \end{equation*} where $T > 0$ denotes the last layer. More refined approaches use differential pooling operators based on sorting~\cite{Zha+2018} and soft assignments~\cite{Yin+2018}. In order to adapt the parameters $W_1$ and $W_2$ of~\cref{eq:basicgnn,eq:gnngeneral}, to a given data distribution, they are optimized in an end-to-end fashion (usually via stochastic gradient descent) together with the parameters of a neural network used for classification or regression. \section{Relationship Between 1-WL and 1-GNNs} In the following we explore the relationship between the $1$-WL and $1$-GNNs. Let $(G,l)$ be a labeled graph, and let $\mathbf{W}^{(t)} = \big(W^{(t')}_1, W^{(t')}_2 \big)_{t'\leq t}$ denote the GNN parameters given by \cref{eq:basicgnn} or~\cref{eq:gnngeneral} up to iteration $t$. We encode the initial labels $l(v)$ by vectors $f^{(0)}(v)\in\mathbb{R}^{1\times d}$, e.g., using a $1$-hot encoding. Our first theoretical result shows that the $1$-GNN architectures do not have more power in terms of distinguishing between non-isomorphic (sub-)graphs than the $1$-WL algorithm. More formally, let $f^{W_1}_{\text{merge}}$ and $f^{W_2}_{\text{aggr}}$ be any two functions chosen in \eqref{eq:gnngeneral}. For every encoding of the labels $l(v)$ as vectors $f^{(0)}(v)$, and for every choice of $\mathbf{W}^{(t)}$, we have that the coloring $c^{(t)}_l$ of $1$-WL always refines the coloring $f^{(t)}$ induced by a $1$-GNN parameterized by $\mathbf{W}^{(t)}$. \begin{theorem}\label{thm:refine} Let $(G, l)$ be a labeled graph. Then for all $t\ge 0$ and for all choices of initial colorings $f^{(0)}$ consistent with $l$, and weights $\mathbf{W}^{(t)}$, \begin{equation*} c^{(t)}_l \sqsubseteq f^{(t)}\,. \end{equation*} \end{theorem} Our second result states that there exist a sequence of parameter matrices $\mathbf{W}^{(t)}$ such that $1$-GNNs have exactly the same power in terms of distinguishing non-isomorphic \mbox{(sub-)}graphs as the $1$-WL algorithm. This even holds for the simple architecture~\eqref{eq:basicgnn}, provided we choose the encoding of the initial labeling $l$ in such a way that different labels are encoded by linearly independent vectors. \begin{theorem}\label{equal} Let $(G, l)$ be a labeled graph. Then for all \mbox{$t\geq 0$} there exists a sequence of weights $\mathbf{W}^{(t)}$, and a $1$-GNN architecture such that \begin{equation*} c^{(t)}_l \equiv f^{(t)}\,. \end{equation*} \end{theorem} Hence, in the light of the above results, $1$-GNNs may viewed as an extension of the $1$-WL which in principle have the same power but are more flexible in their ability to adapt to the learning task at hand and are able to handle continuous node features. \subsection{Shortcomings of Both Approaches} The power of $1$-WL has been completely characterized, see, e.g.,~\cite{Arv+2015}. Hence, by using~\cref{thm:refine,equal}, this characterization is also applicable to $1$-GNNs. On the other hand, $1$-GNNs have the same shortcomings as the $1$-WL. For example, both methods will give the same color to every node in a graph consisting of a triangle and a $4$-cycle, although vertices from the triangle and the vertices from the $4$-cycle are clearly different. Moreover, they are not capable of capturing simple graph theoretic properties, e.g., triangle counts, which are an important measure in social network analysis~\cite{Mil+2002,New2003}. \section{$\boldsymbol{k}$-dimensional Graph Neural Networks} \begin{figure*}[t] \centering \begin{subfigure}[b]{0.65\linewidth} \centering \includegraphics[width=0.7\textwidth]{overview.pdf} \caption{Hierarchical 1-2-3-GNN network architecture}\label{fig:architecture} \end{subfigure} \hspace{-.5cm} \begin{subfigure}[b]{0.28\linewidth} \centering \includegraphics[width=0.7\textwidth]{pool.pdf} \caption{Pooling from $2$- to $3$-GNN.}\label{fig:pooling} \end{subfigure} \caption{Illustration of the proposed hierarchical variant of the $k$-GNN layer. For each subgraph $S$ on $k$ nodes a feature $f$ is learned, which is initialized with the learned features of all $(k-1)$-element subgraphs of $S$. Hence, a hierarchical representation of the input graph is learned.}\label{fig:overview} \end{figure*} In the following, we propose a generalization of $1$-GNNs, so-called $k$-GNNs, which are based on the $k$-WL. Due to scalability and limited GPU memory, we consider a set-based version of the $k$-WL. For a given $k$, we consider all $k$-element subsets $[V(G)]^k$ over $V(G)$. Let $s = \{ s_1, \dotsc, s_k \}$ be a $k$-set in $[V(G)]^k$, then we define the \emph{neighborhood} of $s$ as \begin{equation*}\label{eq:localNeighborhood} N(s) = \{ t\in [V(G)]^k\mid |s\cap t|=k-1\}\,. \end{equation*} The \emph{local neighborhood}\, $N_L(s)$ consists of all $t\in N(s)$ such that $(v,w)\in E(G)$ for the unique $v\in s\setminus t$ and the unique $w\in t\setminus s$. The \emph{global neighborhood} $N_G(s)$ then is defined as $N(s) \setminus N_{\text{L}}(s)$.\footnote{Note that the definition of the local neighborhood is different from the the one defined in~\cite{Mor+2017} which is a superset of our definition. Our computations therefore involve sparser graphs.} The set based $k$-WL works analogously to the $k$-WL, i.e., it computes a coloring $c_{\text{s},k,l}^{(t)} : [V(G)]^k \to \Sigma$ as in \cref{eq:wlColoring} based on the above neighborhood. Initially, $c_{\text{s},k,l}^{(0)}$ colors each element $s$ in $[V(G)]^k$ with the isomorphism type of $G[s]$. Let $(G,l)$ be a labeled graph. In each $k$-GNN layer $t \geq 0$, we compute a feature vector $f^{(t)}_{k}(s)$ for each $k$-set $s$ in $[V(G)]^k$. For $t=0$, we set $f^{(0)}_{k}(s)$ to $f^{\text{iso}}(s)$, a one-hot encoding of the isomorphism type of $G[s]$ labeled by $l$. In each layer $t > 0$, we compute new features by \begin{align*} f^{(t)}_{k}(s) = \sigma & \Big( f^{(t-1)}_{k}(s) \cdot W_1^{(t)} +\, \sum_{\mathclap{u \in N_L (s) \cup N_G (s)}} \, f^{(t-1)}_{k}(u) \cdot W_2^{(t)}\Big)\,. \end{align*} Moreover, one could split the sum into two sums ranging over $N_L (s)$ and $N_G (s)$ respectively, using distinct parameter matrices to enable the model to learn the importance of local and global neighborhoods. To scale $k$-GNNs to larger datasets and to prevent overfitting, we propose \emph{local} $k$-GNNs, where we omit the global neighborhood of $s$, i.e., \begin{equation*} f^{(t)}_{k,\text{L}}(s) = \sigma \Big( f^{(t-1)}_{k,\text{L}}(s) \cdot W^{(t)}_1 + \,\sum_{\mathclap{u \in N_{L}(s)}} \, f^{(t-1)}_{k,\text{L}}(u) \cdot W^{(t)}_2 \Big)\,. \end{equation*} The running time for evaluation of the above depends on $|V|$, $k$ and the sparsity of the graph (each iteration can be bounded by the number of subsets of size $k$ times the maximum degree). Note that we can scale our method to larger datasets by using sampling strategies introduced in, e.g.,~\cite{Mor+2017,Ham+2017}. We can now lift the results of the previous section to the $k$-dimensional case. \begin{proposition}\label{pro:refines} Let $(G, l)$ be a labeled graph and let $k\geq 2$. Then for all $t \ge 0$, for all choices of initial colorings $f_k^{(0)}$ consistent with $l$ and for all weights $\mathbf{W}^{(t)}$, \begin{equation*} c^{(t)}_{\text{s},k,l} \sqsubseteq f^{(t)}_{k}\,. \end{equation*} \end{proposition} Again the second result states that there exists a suitable initialization of the parameter matrices $\mathbf{W}^{(t)}$ such that $k$-GNNs have exactly the same power in terms of distinguishing non-isomorphic (sub-)graphs as the set-based $k$-WL. \begin{proposition}\label{pro:equality} Let $(G, l)$ be a labeled graph and let $k\geq 2$. Then for all $t \geq 0$ there exists a sequence of weights $\mathbf{W}^{(t)}$, and a $k$-GNN architecture such that \begin{equation*} c^{(t)}_{\text{s},k,l} \equiv f^{(t)}_{k}\,. \end{equation*} \end{proposition} \subsection{Hierarchical Variant} One key benefit of the end-to-end trainable $k$-GNN frame\-work---compared to the discrete $k$-WL algorithm---is that we can hierarchically combine representations learned at different granularities. Concretely, rather than simply using one-hot indicator vectors as initial feature inputs in a $k$-GNN, we propose a \emph{hierarchical} variant of $k$-GNN that uses the features learned by a $(k-1)$-dimensional GNN, in addition to the (labeled) isomorphism type, as the initial features, i.e., \begin{equation*} f^{(0)}_{k}(s) = \sigma \Big(\Big[f^{\text{iso}}(s), \sum_{u \subset s} f^{\,(T_{k-1})}_{k-1}(u) \Big] \cdot W_{k-1} \Big), \end{equation*} for some $T_{k-1} > 0$, where $W_{k-1}$ is a matrix of appropriate size, and square brackets denote matrix concatenation. Hence, the features are recursively learned from dimensions $1$ to $k$ in an end-to-end fashion. This hierarchical model also satisfies \cref{pro:refines,pro:equality}, so its representational capacity is theoretically equivalent to a standard $k$-GNN (in terms of its relationship to $k$-WL). Nonetheless, hierarchy is a natural inductive bias for graph modeling, since many real-world graphs incorporate hierarchical structure, so we expect this hierarchical formulation to offer empirical utility. \begin{table*}[t]\ \caption{Classification accuracies in percent on various graph benchmark datasets.} \label{fig:classification_results} \renewcommand{\arraystretch}{0.90} \centering \begin{tabular}{@{}clccccccc@{}} \toprule & \multirow{3}{*}{\vspace*{8pt}\textbf{Method}} & \multicolumn{7}{c}{\textbf{Dataset}} \\ \cmidrule{3-9} & & {\textsc{Pro}} & {\textsc{IMDB-Bin}} & \!{\textsc{IMDB-Mul}} & \!{\textsc{PTC-FM}} & \!{\textsc{NCI1}} & \!{\textsc{Mutag}} & \!{\textsc{PTC-MR}} \\ \cmidrule{2-9} \multirow{6}{*}{\rotatebox{90}{\hspace*{-6pt}Kernel}} & \textsc{Graphlet} & 72.9 & 59.4 & 40.8 & 58.3 & 72.1 & 87.7 & 54.7 \\ & \textsc{Shortest-path} & \textbf{76.4} & 59.2 & 40.5 & 62.1 & 74.5 & 81.7 & 58.9 \\ & \textsc{$1$-WL} & 73.8 & 72.5 & \textbf{51.5} & 62.9 & 83.1 & 78.3 & 61.3 \\ & \textsc{$2$-WL} & 75.2 & 72.6 & 50.6 & \textbf{64.7} & 77.0 & 77.0 & 61.9 \\ & \textsc{$3$-WL} & 74.7 & 73.5 & 49.7 & 61.5 & 83.1 & 83.2 & 62.5 \\ & \textsc{WL-OA} & 75.3 & 73.1 & 50.4 & 62.7 & \textbf{86.1} & 84.5 & \textbf{63.6} \\ \cmidrule{2-9} \multirow{7}{*}{\rotatebox{90}{GNN}} & \textsc{DCNN} & 61.3 & 49.1 & 33.5 & --- & 62.6 & 67.0 & 56.6 \\ & \textsc{PatchySan} & 75.9 & 71.0 & 45.2 & --- & 78.6 & \textbf{92.6} & 60.0 \\ & \textsc{DGCNN} & 75.5 & 70.0 & 47.8 & --- & 74.4 & 85.8 & 58.6 \\ \cmidrule{2-9} & \textsc{$1$-Gnn No Tuning} & 70.7 & 69.4 & 47.3 & 59.0 & 58.6 & 82.7 & 51.2 \\ & \textsc{$1$-Gnn} & 72.2 & 71.2 & 47.7 & 59.3 & 74.3 & 82.2 & 59.0 \\ & \textsc{$1$-$2$-$3$-Gnn No Tuning} & 75.9 & 70.3 & 48.8 & 60.0 & 67.4 & 84.4 & 59.3 \\ & \textsc{$1$-$2$-$3$-Gnn} & 75.5 & \textbf{74.2} & 49.5 & 62.8 & 76.2 & 86.1 & 60.9 \\ \bottomrule \end{tabular} \end{table*} \begin{table*}[t]\ \caption{% Mean absolute errors on the \textsc{Qm9} dataset. The far-right column shows the improvement of the best $k$-GNN model in comparison to the $1$-GNN baseline. }% \label{fig:qm9_results} \renewcommand{\arraystretch}{1.0} \centering \begin{tabular}{lccccccc} \toprule \multirow{3}{*}{\vspace*{8pt}\textbf{Target}} & \multicolumn{7}{c}{\textbf{Method}} \\ \cmidrule{2-8} & \!\!\!\textsc{Dtnn}~\cite{Wu+2018}\!\! & \!\!\textsc{Mpnn}~\cite{Wu+2018}\!\!\! & \textsc{$1$-Gnn} & \!\textsc{$1$-$2$-Gnn} & \textsc{$1$-$3$-Gnn} & \textsc{$1$-$2$-$3$-Gnn}\! & Gain \\ \midrule $\mu$ & $\mathbf{0.244}$ & 0.358 & 0.493 & 0.493 & $\mathbf{0.473}$ & 0.476 & 4.0\% \\ $\alpha$ & 0.95 & 0.89 & 0.78 & $\mathbf{0.27}$ & 0.46 & $\mathbf{0.27}$ & 65.3\% \\ $\varepsilon_{\text{HOMO}}$ & 0.00388 & 0.00541 & $\mathbf{0.00321}$ & 0.00331 & 0.00328 & 0.00337 & -- \\ $\varepsilon_{\text{LUMO}}$ & 0.00512 & 0.00623 & 0.00355 & $\mathbf{0.00350}$ & 0.00354 & 0.00351 & 1.4\% \\ $\Delta\varepsilon$ & 0.0112 & 0.0066 & 0.0049 & 0.0047 & $\mathbf{0.0046}$ & 0.0048 & 6.1\% \\ $\langle R^2 \rangle$ & $\mathbf{17.0}$ & 28.5 & 34.1 & 21.5 & 25.8 & 22.9 & 37.0\% \\ \textsc{ZPVE} & 0.00172 & 0.00216 & 0.00124 & $\mathbf{0.00018}$ & 0.00064 & 0.00019 & 85.5\% \\ $U_0$ & 2.43 & 2.05 & 2.32 & $\mathbf{0.0357}$ & 0.6855 & 0.0427 & 98.5\% \\ $U$ & 2.43 & 2.00 & 2.08 & $\mathbf{0.107}$ & 0.686 & 0.111 & 94.9\% \\ $H$ & 2.43 & 2.02 & 2.23 & 0.070 & 0.794 & $\mathbf{0.0419}$ & 98.1\% \\ $G$ & 2.43 & 2.02 & 1.94 & 0.140 & 0.587 & $\mathbf{0.0469}$ & 97.6\% \\ $C_{\text{v}}$ & 0.27 & 0.42 & 0.27 & 0.0989 & 0.158 & $\mathbf{0.0944}$ & 65.0\% \\ \bottomrule \end{tabular} \end{table*} \section{Experimental Study} In the following, we want to investigate potential benefits of GNNs over graph kernels as well as the benefits of our proposed $k$-GNN architectures over $1$-GNN architectures. More precisely, we address the following questions: \begin{description} \item[Q1] How do the (hierarchical) $k$-GNNs perform in comparison to state-of-the-art graph kernels? \item[Q2] How do the (hierarchical) $k$-GNNs perform in comparison to the $1$-GNN in graph classification and regression tasks? \item[Q3] How much (if any) improvement is provided by optimizing the parameters of the GNN aggregation function, compared to just using random GNN parameters while optimizing the parameters of the downstream classification/regression algorithm? \end{description} \subsection{Datasets } To compare our $k$-GNN architectures to kernel approaches we use well-established benchmark datasets from the graph kernel literature~\cite{KKMMN2016}. The nodes of each graph in these dataset is annotated with (discrete) labels or no labels. To demonstrate that our architectures scale to larger datasets and offer benefits on real-world applications, we conduct experiments on the \textsc{Qm9} dataset~\cite{Ram+2014,Rud+2012,Wu+2018}, which consists of 133\,385 small molecules. The aim here is to perform regression on twelve targets representing energetic, electronic, geometric, and thermodynamic properties, which were computed using density functional theory. We used the dataset provided at \url{http;//moleculenet.ai}, cf. \cref{fig:qm9_details} in the Appendix for details. \subsection{Baselines} We use the following kernel and GNN methods as baselines for our experiments. \xhdr{Kernel Baselines} We use the Graphlet kernel~\cite{She+2009}, the shortest-path kernel~\cite{Borgwardt2005}, the Weisfeiler-Lehman subtree kernel (\textsc{WL})~\cite{She+2011}, the Weisfeiler-Lehman Optimal Assignment kernel (\textsc{WL-OA})~\cite{Kri+2016}, and the global-local $k$-WL~\cite{Mor+2017} with $k$ in $\{2,3\}$ as kernel baselines. For each kernel, we computed the normalized Gram matrix. We used the $C$-SVM implementation of LIBSVM~\cite{Cha+2011} to compute the classification accuracies using 10-fold cross validation. The parameter $C$ was selected from $\{10^{-3}, 10^{-2}, \dotsc, 10^{2},$ $10^{3}\}$ by 10-fold cross validation on the training folds. \xhdr{Neural Baselines} To compare GNNs to kernels we used the basic $1$-GNN layer of~\cref{eq:basicgnn}, DCNN~\cite{Wang2018}, PatchySan~\cite{Nie+2016}, DGCNN~\cite{Zha+2018}. For the \textsc{Qm9} dataset we used a $1$-GNN layer similar to~\cite{Gil+2017}, where we replaced the inner sum of~\cref{eq:basicgnn} with a 2-layer MLP in order incorporate edge features (bond type and distance information). Moreover, we compare against the numbers provided in~\cite{Wu+2018}. \subsection{Model Configuration} We always used three layers for $1$-GNN, and two layers for (local) $2$-GNN and $3$-GNN, all with a hidden-dimension size of $64$. For the hierarchical variant we used architectures that use features computed by $1$-GNN as initial features for the $2$-GNN ($1$-$2$-GNN) and $3$-GNN ($1$-$3$-GNN), respectively. Moreover, using the combination of the former we componentwise concatenated the computed features of the $1$-$2$-GNN and the $1$-$3$-GNN ($1$-$2$-$3$-GNN). For the final classification and regression steps, we used a three layer MLP, with binary cross entropy and mean squared error for the optimization, respectively. For classification we used a dropout layer with $p=0.5$ after the first layer of the MLP. We applied global average pooling to generate a vector representation of the graph from the computed node features for each $k$. The resulting vectors are concatenated column-wise before feeding them into the MLP. Moreover, we used the Adam optimizer with an initial learning rate of $10^{-2}$ and applied an adaptive learning rate decay based on validation results to a minimum of $10^{-5}$. We trained the classification networks for $100$ epochs and the regression networks for $200$ epochs. \subsection{Experimental Protocol} For the smaller datasets, which we use for comparison against the kernel methods, we performed a 10-fold cross validation where we randomly sampled 10\% of each training fold to act as a validation set. For the \textsc{Qm9} dataset, we follow the dataset splits described in~\cite{Wu+2018}. We randomly sampled 10\% of the examples for validation, another 10\% for testing, and used the remaining for training. We used the same initial node features as described in~\cite{Gil+2017}. Moreover, in order to illustrate the benefits of our hierarchical $k$-GNN architecture, we did not use a complete graph, where edges are annotated with pairwise distances, as input. Instead, we only used pairwise Euclidean distances for connected nodes, computed from the provided node coordinates. The code was built upon the work of~\cite{Fey+2018} and is provided at~\url{https://github.com/chrsmrrs/k-gnn}. \subsection{Results and Discussion} In the following we answer questions \textbf {Q1} to \textbf{Q3}. \cref{fig:classification_results} shows the results for comparison with the kernel methods on the graph classification benchmark datasets. Here, the hierarchical $k$-GNN is on par with the kernels despite the small dataset sizes (answering question \textbf{Q1}). We also find that the 1-2-3-GNN significantly outperforms the 1-GNN on all seven datasets (answering \textbf{Q2}), with the 1-GNN being the overall weakest method across all tasks.\footnote{Note that in very recent work, GNNs have shown superior results over kernels when using advanced pooling techniques~\cite{Yin+2018}. Note that our layers can be combined with these pooling layers. However, we opted to use standard global pooling in order to compare a typical GNN implementation with standard off-the-shelf kernels.} We can further see that optimizing the parameters of the aggregation function only leads to slight performance gains on two out of three datasets, and that no optimization even achieves better results on the \textsc{Proteins} benchmark dataset (answering \textbf{Q3}). We contribute this effect to the one-hot encoded node labels, which allow the GNN to gather enough information out of the neighborhood of a node, even when this aggregation is not learned. \cref{fig:qm9_results} shows the results for the \textsc{Qm9} dataset. On eleven out of twelve targets all of our hierarchical variants beat the $1$-GNN baseline, providing further evidence for \textbf{Q2}. For example, on the target $H$ we achieve a large improvement of 98.1\% in MAE compared to the baseline. Moreover, on ten out of twelve datasets, the hierarchical $k$-GNNs beat the baselines from~\cite{Wu+2018}. However, the additional structural information extracted by the $k$-GNN layers does not serve all tasks equally, leading to huge differences in gains across the targets. It should be noted that our $k$-GNN models have more parameters than the $1$-GNN model, since we stack two additional GNN layers for each $k$. However, extending the $1$-GNN model by additional layers to match the number of parameters of the $k$-GNN did not lead to better results in any experiment. \section{Conclusion} We presented a theoretical investigation of GNNs, showing that a wide class of GNN architectures cannot be stronger than the $1$-WL. On the positive side, we showed that, in principle, GNNs possess the same power in terms of distinguishing between non-isomorphic (sub-)graphs, while having the added benefit of adapting to the given data distribution. Based on this insight, we proposed $k$-GNNs which are a generalization of GNNs based on the $k$-WL. This new model is strictly stronger then GNNs in terms of distinguishing non-isomorphic (sub-)graphs and is capable of distinguishing more graph properties. Moreover, we devised a hierarchical variant of $k$-GNNs, which can exploit the hierarchical organization of most real-world graphs. Our experimental study shows that $k$-GNNs consistently outperform $1$-GNNs and beat state-of-the-art neural architectures on large-scale molecule learning tasks. Future work includes designing task-specific $k$-GNNs, e.g., devising $k$-GNNs layers that exploit expert-knowledge in bio- and chemoinformatic settings. \section*{Acknowledgments} This work is supported by the German research council (DFG) within the Research Training Group 2236 \emph{UnRAVeL} and the Collaborative Research Center SFB 876, \emph{Providing Information by Resource-Constrained Analysis}, projects A6 and B2. \fontsize{9.5pt}{10.5pt} \selectfont \bibliographystyle{aaai}
{'timestamp': '2020-02-17T02:15:51', 'yymm': '1810', 'arxiv_id': '1810.02244', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02244'}
arxiv
\section{Introduction} \label{sec:introduction} A wide class of problems in science and engineering can be solved by gradient-based optimization of function expectations. This is especially prevalent in machine learning \citep{schulman2015gradient}, including variational inference \citep{ranganath2014black, rezende2014stochastic} and reinforcement learning \citep{silver2014deterministic}. On the face of it, problems of this nature require solving an intractable integral. Most practical approaches instead use Monte Carlo estimates of expectations and their gradients. These techniques are unbiased but can suffer from high variance when sample size is small---one unlikely sample in the tail of a distribution can heavily skew the final estimate. A simple way to reduce variance is to increase the number of samples; however the computational cost grows quickly. We would like to reap the positive benefits of a larger sample size using as few samples as possible. \textit{With a fixed computational budget, how do we choose samples?} A large body of work has been dedicated to reducing variance in sampling, with the most popular in machine learning being reparameterizations for some continuous distributions \citep{kingma2013auto,jang2016categorical} and control variates to adjust for estimated error \citep{mnih2014neural,weaver2001optimal}. These techniques sample i.i.d.~but perhaps it is possible to choose correlated samples that are more \textit{representative} of their underlying distribution? Several such non-independent sampling approaches have been proposed in statistics. In this work we investigate \textit{antithetics}, where for every sample we draw, we include a negatively correlated sample to minimize the distance between sample and population moments. The key challenges in applying antithetic sampling to modern machine learning are (1) ensuring that antithetic samples are correctly distributed such that they provide unbiased estimators for Monte Carlo simulation, and (2) ensuring that sampling is differentiable to permit gradient-based optimization. We focus on stochastic variational inference and explore using antithetics for learning the parameters for a deep generative model. Critically, our method of antithetic sampling is differentiable and can be composed with reparametrizations of the underlying distributions to provide a fully differentiable sampling process. This yields a simple and low variance way to optimize the parameters of the variational posterior. Concisely, our contributions are as follows: \begin{itemize} \item We review a method to to generate Gaussian variates with known sample moments, then apply it to antithetics, and generalize it to other families using deterministic transformations. \item We show that differentiating through the sampling computation improves variational inference. \item We show that training VAEs with antithetic samples improves learning across objectives, posterior families, and datasets. \end{itemize} \section{Background} \label{sec:background} \subsection{Variational Inference and Learning} Consider a generative model that specifies a joint distribution $p_\theta(x,z)$ over a set of observed variables $x \in \mathbb{R}^m$ and stochastic variables $z \in \mathbb{R}^d$ parameterized by $\theta$. We are interested in the posterior distribution $p_\theta(z|x) = \frac{p_\theta(x|z)p(z)}{p(x)}$, which is intractable since $p(x) = \int_z p(x,z)dz$. Instead, we introduce a \textit{variational posterior}, $q_\phi(z|x)$ that approximates $p_\theta(z|x)$ but is easy to sample from and to evaluate. Our objective is to maximize the likelihood of the data (the ``evidence"), $\log p_\theta(x)$. This is intractable so we optimize the evidence lower bound (ELBO) instead: \begin{align} \log p_\theta(x) & \geq \mathbb{E}_{q_\phi(z|x)}[\log \frac{p_\theta(x,z)}{q_\phi(z|x)}]\label{eqn:elbo} \end{align} The VAE \citep{kingma2013auto,rezende2014stochastic} is an example of one such generative model where $p_\theta(x|z)$ and $q_\phi(z|x)$ are both deep neural networks used to parameterize a simple likelihood (e.g., Bernoulli or Gaussian). \begin{comment} \paragraph{Other Lower Bounds} \cite{burda2015importance} proposed a popular variant of the ELBO that is a tighter bound on $\log p(x)$, denoted as the IWAE: \begin{equation} \mathbb{E}_{z_1, ..., z_k \sim q_\phi(z|x)}[\log \frac{1}{k} \sum_{i=1}^{k} \frac{p_\theta(x,z_i)}{q_\phi(z_i|x)}] \label{eqn:iwae} \end{equation} Many applications have found the IWAE to give better results than the ELBO. \paragraph{Flexible Posteriors} The choice of a Gaussian posterior may not be expressive enough to capture complex distributions (e.g.~multiple modes). \cite{rezende2015variational} improve the flexibility using \textit{normalizing flows} \citep{tabak2010density, tabak2013family}, a technique that applies a series of $T$ invertible transformations $h^{(t)}, t = 1, ..., T$ to samples $z^{(0)}$ from $q_\theta(z|x)$. As a result, the final transformed sample, $z^{(T)}$ comes from a more complex distribution We adjust the objective accordingly: \begin{align} \log p(x) &\geq \mathbb{E}_{z^{(0)} \sim q(z^{(0)}|x)}[\log \frac{p(x,z^{(T)})}{q(z^{(T)}|x)}] \end{align} where $q(z^{(T)}|x) = q(z^{(0)}|x) - \log | \det \frac{\partial h^{(t)}}{\partial z^{(t-1)}} |$. \cite{tomczak2016improving} introduces a second family of flows that are \textit{volume preserving}, meaning that the Jacobian-determinant equals 1. \end{comment} \paragraph{Stochastic Gradient Estimation} Since $\phi$ can impact the ELBO (though not the true marginal likelihood it lower bounds), we jointly optimize over $\theta$ and $\phi$. The gradients of the ELBO objective are: \begin{align} \nabla_\theta \textup{ELBO} &= \mathbb{E}_{q_\phi(z|x)}[\nabla_\theta \log p_\theta(x,z)] \label{eqn:elbo_gradient_theta} \\ \nabla_\phi \textup{ELBO} &= \nabla_\phi \mathbb{E}_{q_\phi(z|x)}[\log \frac{p_\theta(x,z)}{q_\phi(z|x)}] \label{eqn:elbo_gradient_phi} \end{align} Eqn.~\ref{eqn:elbo_gradient_theta} can be directly estimated using Monte Carlo techniques. However, as it stands, Eqn.~\ref{eqn:elbo_gradient_phi} is difficult to approximate as we cannot distribute the gradient inside the expectation. Luckily, if we constrain $q_\phi(z|x)$ to certain families, we can reparameterize. \paragraph{Reparameterization Estimators} Reparameterization refers to isolating sampling from the gradient computation graph \citep{kingma2013auto,rezende2014stochastic}. If we can sample $z \sim q_\phi(z|x)$ by applying a deterministic function $z = g_\phi(\epsilon): \mathbb{R}^{d} \rightarrow \mathbb{R}^{d}$ to sampling from an unparametrized distribution, $\epsilon \sim R$, then we can rewrite Eqn.~\ref{eqn:elbo_gradient_phi} as: \begin{equation} \nabla_\phi \textup{ELBO} = \mathbb{E}_{\epsilon \in R}[\nabla_z \log\frac{p_\theta(x,z(\epsilon))}{q_\phi(z(\epsilon)|x)} \nabla_\phi g_\phi(\epsilon)] \label{eqn:gradient_reparam} \end{equation} which can now be estimated in the usual manner. As an example, if $q_\phi(z|x)$ is a Gaussian, $\mathcal{N}(\mu, \sigma^2)$ and we choose $R$ to be $\mathcal{N}(0, 1)$, then $g(\epsilon) = \epsilon * \sigma + \mu$. \subsection{Antithetic Sampling} Normally, we sample i.i.d.~from $q_\phi(z|x)$ and $R$ to approximate Eqns.~\ref{eqn:elbo_gradient_theta} and \ref{eqn:gradient_reparam}, respectively. However, drawing correlated samples could reduce variance in our estimation. Suppose we are given $k$ samples $z_1, z_2, ..., z_{k} \sim q_\phi(z|x)$. We could choose a second set of samples $z_{k+1}, z_{k+2}, ..., z_{2k} \sim q_\phi(z|x, z_1, ..., z_k)$ such that $z_{i+k}$ is somehow the ``opposite" of $z_{i}$. Then, we can write down a new estimator using both sample sets. For example, Eqn.~\ref{eqn:elbo_gradient_theta} can be approximated by: \begin{equation} \frac{1}{2k}\sum_{i=1}^{k} \nabla_\theta \log p_\theta(x, z_i) + \nabla_\theta \log p_\theta(x, z_{i+k}) \label{eqn:opt_antithetic} \end{equation} Assuming $z_{k+1}, ..., z_{2k}$ is marginally distributed according to $q_\phi(z|x)$, Eqn.~\ref{eqn:opt_antithetic} is unbiased. Moreover, if $q_\phi(z|x)$ is near symmetric, the variance of this new estimator will be cut significantly. But \textit{what does ``opposite" mean?} One idea is to define ``opposite" as choosing $z_{k+i}$ such that the moments of the combined sample set $z_1, ..., z_{2k}$ match the moments of $q_\phi(z|x)$. Intuitively, if $z_i$ is too large, then choosing $z_{k+i}$ to be too small can help rebalance the sample mean, reducing first order errors. Similarly, if our first set of samples is too condensed at the mode, then choosing antithetic samples with higher spread can stabilize the variance closer to its expectation. However, sampling $z_{k+1}, ..., z_{2k}$ with particular sample statistics in mind is a difficult challenge. To solve this, we first narrow our scope to Gaussian distributions, and later extend to other distribution families. \section{Generating Gaussian Variates with Given Sample Mean and Variance} \label{sec:methods} \begin{figure}[tb] \centering \includegraphics[width=0.55\columnwidth]{algo_pic.pdf} \caption{An illustration of Marsaglia's solution to the constrained sampling problem in two dimensions: build a $(k-1)$-dimensional sphere by intersecting a hyperplane and a $k$-dimensional sphere (each representing a contraint). Generating $k$ samples is equivalent to uniformly sampling from the perimeter of the circle.} \label{fig:algo} \end{figure} We present the \textit{constrained sampling problem}: given a Gaussian distribution with \emph{population mean} $\mu$ and \emph{population variance} $\sigma^2$, we wish to generate $k$ samples $x_1, ..., x_k \sim \mathcal{N}(\mu, \sigma^2)$ subject to the conditions: \begin{align} \frac{1}{k}\sum_{i=1}^{k} x_i &= \eta \label{eqn:constraint1}\\ \frac{1}{k}\sum_{i=1}^{k} (x_i - \eta)^2 &= \delta^2 \label{eqn:constraint2} \end{align} where the constants $\eta$ and $\delta^2$ are given and represent the \emph{sample mean} and \emph{sample variance}. In other words, how can we draw samples from the correct marginal distribution conditioned on matching desired \emph{sample} moments? For example, we might wish to match \emph{sample} and \emph{population} moments: $\eta=\mu$ and $\delta=\sigma$. Over forty years, there have been a handful of solutions. We review the algorithm introduced by \citep{marsaglia1980c69}. In our experiments, we reference a second algorithm by \citep{pullin1979generation, cheng1984generation}, which is detailed in the supplement. We chose \citep{marsaglia1980c69} due its simplicity, low computational overhead, and the fact that it makes the fewest random choices of proposed solutions. \paragraph{Intuition} Since $x_1, ..., x_k$ are independent, we can write the joint density function as follows: \begin{equation} p(x_1, ..., x_k) = (2\pi \sigma^2)^{-\frac{k}{2}}e^{-\frac{1}{2\sigma^2}\sum_i(x_i - \mu)^2} \label{eqn:joint_density} \end{equation} We can interpret Eqn.~\ref{eqn:constraint1} as a hyperplane and Eqn.~\ref{eqn:constraint2} as the surface of a sphere in $k$ dimensions. Let $\mathcal{X}$ be the set of all points $(x_1, ..., x_k) \in \mathbb{R}^k$ that satisfy the above constraints. Geometrically, we can view $\mathcal{X}$ as the intersection between the hyperplane and $k$-dimensional sphere, i.e., the surface of a $(k-1)$ dimensional sphere (e.g. a circle if $k=2$). We make the following important observation: the joint density (Eqn.~\ref{eqn:joint_density}) is constant for all points in $\mathcal{X}$. To see this, we can write the following: \begin{equation*} \begin{split} \sum_{i}(x_i - \mu)^2 &= \sum_i(x_i - \eta)^2 \\ & \quad + 2(\eta - \mu)\sum_i(x_i - \eta) + k(\eta - \mu)^2 \\ &= \sum_i(x_i - \eta)^2 + k(\eta - \mu)^2 \\ &= k \delta^2 + k(\eta - \mu)^2 \end{split} \label{eqn:proof1} \end{equation*} where $\sum_i(x_i - \eta) = \sum_i(x_i) - k\eta = 0$ by Eqn.~\ref{eqn:constraint1}. Plugging this into the density function, rewrite Eqn.~\ref{eqn:joint_density} as: \begin{equation} p(x_1, ..., x_k) = (2\pi \sigma^2)^{-\frac{k}{2}}e^{-\frac{1}{2\sigma^2}(k \delta^2 + k(\eta - \mu)^2)} \label{eqn:joint_pdf_2} \end{equation} Critically, Eqn.~\ref{eqn:joint_pdf_2} is independent of $x_1, ..., x_k$. For any $(\eta, \delta, \mu, \sigma)$, the density for every $x \in \mathcal{X}$ is constant. In other words, the conditional distribution of $x_1, ..., x_k$ given that $x_1, ..., x_k \in \mathcal{X}$ is the uniform distribution over $\mathcal{X}$. Surprisingly, it does \textit{not} depend on $\mu$ or $\sigma$. Therefore, to solve the constrained sampling problem, we need only be able to sample uniformly from the surface of a $(k-1)$ dimensional sphere. \paragraph{Marsaglia's Solution} More precisely, we can generate the required samples $\textbf{x} = (x_1, ..., x_k)$ from a point $\textbf{z} = (z_1, ..., z_{k-1})$ uniformly distributed on the unit sphere in $\mathbb{R}^{k-1}$ centered at the origin by solving the linear system: \begin{equation} \textbf{x} = k^{\frac{1}{2}}\delta\textbf{z}B + \eta \textbf{v} \label{eqn:linear_system} \end{equation} where $\textbf{v} = (1, 1, ..., 1)$ is a $k$ dimensional vector of ones and $B$ is a $(k-1)$ by $k$ matrix such that the rows of $B$ form an orthonormal basis with the null space of $\textbf{v}$ i.e. we choose $B$ where $BB^{t} = I$ and $B\textbf{v}^{t} = 0$, which happens to satisfy our constraints: \begin{align} \textbf{x}\textbf{v}^t &= k\eta \label{eqn:newc1}\\ (\textbf{x} - \eta\textbf{v})(\textbf{x} - \eta\textbf{v})^t = k\delta^2\textbf{z}BB^t\textbf{z}^t &= k\delta^2 \label{eqn:newc2} \end{align} As $\textbf{z}$ is uniformly distributed over the unit $(k-1)$ sphere, Eqn.~\ref{eqn:newc1} and \ref{eqn:newc2} guarantee that $\textbf{x}$ is uniformly distributed in $\mathcal{X}$. We can generate $\textbf{z}$ by sampling $(\epsilon_1, ..., \epsilon_{k-1}) \sim \mathcal{N}(0, 1)$ and setting $z_i = \epsilon_i / \sum_i \epsilon_i^2$. As in \citep{marsaglia1980c69}, we set $B$ to \textsc{RowNormalize}$(A)$ where $A$ is defined as \begin{center} \tiny $\begin{bmatrix} 1-k & 1 & 1 & . & . & . & 1 & 1& 1\\ 0 & 2-k & 1 & . & . & . & 1 &1 & 1\\ 0 & 0 & 3-k & . & . & . & 1 & 1 & 1\\ . & & & & & & & & .\\ .& & & & & & & & .\\ . & & & & & & & & .\\ 0 & 0 & 0 & . & . & . &-2 & 1 & 1\\ 0 & 0 & 0 & . & . &. & 0 & -1 & 1 \end{bmatrix}$ \end{center} and \textsc{RowNormalize} divides each row vector in $A$ by the sum of the elements in that row. We summarize the procedure in Alg.~\ref{algo:marsaglia} and the properties of \textsc{MarsagliaSample} in Prop.~\ref{prop:marsaglia}. \begin{algorithm}[h!] \SetAlgoLined \caption{\textsc{MarsagliaSample}} \KwData{i.i.d. samples $\epsilon_1, ..., \epsilon_{k-1} \sim \mathcal{N}(0, 1)$; Desired sample mean $\eta$ and variance $\delta^2$; Number of samples $k \in \mathbb{N}$.} \KwResult{A set of $k$ samples $x_1, x_2, ..., x_k$ marginally distributed as $\mathcal{N}(\mu, \sigma^2)$ with sample mean $\eta$ and sample variance $\delta^2$.} $\gamma = \sqrt{n}\delta$\; $s = \sum_i \epsilon_i^2$\; \For{$i\gets 1$ \KwTo $k$}{ $z_i = \epsilon_i[(k-i)(k-i+1)s]^{-1/2}$\; } $x_1 = (1-k)\gamma z_1 + \eta$\; $x_k = \gamma \sum_{i=1}^{k-1} z_i + \eta$\; \For{$i\gets 2$ \KwTo $k-1$}{ $x_i = (\sum_{i=1}^{i-1} + (i-k)z_i)\gamma + \eta$\; } Return $x_1, ..., x_k$\; \label{algo:marsaglia} \end{algorithm} \begin{prop} For any $k>2$, $\mu \in \mathbb{R}$ and $\sigma^2>0$, if $\eta \sim \mathcal{N}(\mu, \frac{\sigma^2}{k})$ and $\frac{(k-1)\delta^2}{\sigma^2} \sim \chi^2_{k-1}$ and $\boldsymbol{\epsilon} = \epsilon_1, ..., \epsilon_{k-1} \sim \mathcal{N}(0, 1)$ i.i.d., then the generated samples $x_1, ..., x_k = \textsc{MarsagliaSample}(\boldsymbol{\epsilon}, \eta, \delta^2,k)$ are independent normal variates sampled from $\mathcal{N}(\mu, \sigma^2)$ such that $\frac{1}{k}\sum_i x_i = \eta$ and $\frac{1}{k}\sum_i(x_i - \eta)^2 = \delta^2$. \label{prop:marsaglia} \end{prop} \begin{sketch}We provide a full proof in the supplement. For a sketch, let $\mathbf{x} = (x_1, ..., x_k)$ such that $x_i \sim \mathcal{N}(\mu, \sigma^2)$ i.i.d. Compute sample statistics $\eta, \delta^2$ from $\mathbf{x}$ as defined in Eqn.~\ref{eqn:sample_stats}. Consider the joint distribution over samples and sample moments: \begin{equation*} p(\mathbf{x},\eta,\delta^2) = p(\eta,\delta^2)p(\mathbf{x}|\eta,\delta^2) \end{equation*} . We make two observations: first, $\eta,\delta^2$, as defined, are drawn from $p(\eta,\delta^2)$. Second, as hinted above, $p(\mathbf{x}|\eta,\delta^2)$ is the uniform distribution over a $(k-1)$-sphere, which Marsaglia shows us how to sample from. Thus, any samples $\mathbf{x'} \sim p(\mathbf{x}|\eta=\eta,\delta^2=\delta^2)$ will be distributed as $\mathbf{x}$ is (marginally), in other words i.i.d. Gaussian. \end{sketch} As implied in Prop.~\ref{prop:marsaglia}, if we happen to know the population mean $\mu$ and variance $\sigma^2$ (as we do in variational inference), we could generate $k$ i.i.d. Gaussian variates by sampling $\eta \sim \mathcal{N}(\mu, \frac{\sigma^2}{k})$ and $\frac{(k-1)\delta^2}{\sigma^2} \sim \chi^2_{k-1}$, and passing $\eta$, $\delta^2$ to \textsc{MarsagliaSample}. \section{Constrained Antithetic Sampling} We might be inclined to use \textsc{MarsagliaSample} to directly generate samples with some fixed \emph{deterministic} $\eta=\mu$ and $\delta=\sigma$. However, Prop.~\ref{prop:marsaglia} holds only if the desired sample moments $\eta,\delta$ are \emph{random} variables. If we choose them deterministically, we can no longer guarantee the correct marginal distribution for the samples, thus precluding their use for Monte Carlo estimates. Instead, what we can do is compute $\eta$ and $\delta^2$ from i.i.d. samples from $\mathcal{N}(\mu, \sigma^2)$, derive antithetic sample moments, and use \textsc{MarsagliaSample} to generate a second set of samples distributed accordingly. More precisely, given a set of $k$ independent normal variates $(x_1, ..., x_k) \sim \mathcal{N}(\mu, \sigma^2)$, we would like to generate a new set of $k$ normal variates $(x_{k+1}, ..., x_{2k})$ such that the combined sample moments match the population moments, $\frac{1}{2k}\sum_{i=1}^{2k} x_i = \mu$ and $\frac{1}{2k}\sum_{i=1}^{2k} (x_i -\mu)^2 = \sigma^2$. We call the second set of samples $(x_{k+1}, ..., x_{2k})$ \textit{antithetic} to the first set. We compute sample statistics from the first set: \begin{align} \eta &= \frac{1}{k}\sum_{i=1}^{k} x_i & \delta^2 &= \frac{1}{k}\sum_{i=1}^{k} (x_i -\mu)^2 \label{eqn:sample_stats} \end{align} Note that $\eta,\delta$ are random variables, satisfying $\eta \sim \mathcal{N}(\mu, \frac{\sigma^2}{k})$ and $\frac{(k-1)\delta^2}{\sigma^2} \sim \chi^2_{k-1}$. Ideally, we would want the second set to come from an ``opposing" $\eta'$ and $\delta'$. To choose $\eta'$ and $\delta'$, we leverage the \textit{inverse CDF transform}: given the cumulative distribution function (CDF) for a random variable $X$, denoted $F_X$, we can define a uniform variate $Y= F_X(X)$. The \textit{antithetic} uniform variable is then $Y' = 1 - Y$, which upon application of the inverse CDF function, is mapped back to a properly distributed antithetic variate $X' = F^{-1}_X(Y')$. Crucially, $X$ and $X'$ have the same marginal distribution, but are not independent. Let $F_{\eta}$ represent a Gaussian CDF and $F_{\delta}$ represent a Chi-squared CDF. We can derive $\eta'$ and $\delta'$ as: \begin{align} \eta' &= F^{-1}_\eta(1 - F_\eta(\eta)) \\ \frac{(k-1)(\delta')^2}{\sigma^2} &= F^{-1}_\delta\left(1 - F_\delta \left(\frac{(k-1)\delta^2}{\sigma^2}\right)\right) \label{eq:inversechi} \end{align} Crucially, $\eta', \delta'$ chosen this way are random variables with the correct marginal distributions, i.e., $\eta' \sim \mathcal{N}(\mu, \frac{\sigma^2}{k})$ and $\frac{(k-1)(\delta')^2}{\sigma^2} \sim \chi^2_{k-1}$. knowing $\eta', \delta'$, it is straightforward to generate antithetic samples with \textsc{MarsagliaSample}. We summarize the algorithm in Alg.~\ref{alg:antithetic} and its properties in Prop.~\ref{prop:antithetic}. \begin{algorithm}[h!] \SetAlgoLined \caption{\textsc{AntitheticSample}} \KwData{i.i.d. samples $(x_1, ..., x_k) \sim \mathcal{N}(\mu, \sigma^2)$; i.i.d. samples $\boldsymbol{\epsilon} = (\epsilon_1, ..., \epsilon_{k-1}) \sim \mathcal{N}(0, 1)$; Population mean $\mu$ and variance $\sigma^2$; Number of samples $k \in \mathbb{N}$.} \KwResult{A set of $k$ samples $(x_{k+1}, x_{k+2}, ..., x_{2k})$ marginally distributed as $\mathcal{N}(\mu, \sigma^2)$ with sample mean $\eta'$ and sample standard deviation $\delta'$.} $v = k -1$\; $\eta = \frac{1}{k}\sum_{i=1}^k x_i$\; $\delta^2 = \frac{1}{k}\sum_{i=1}^k (x_i - \eta)^2$\; $\eta' = F^{-1}_\eta(1 - F_\eta(\eta))$\; $\lambda = v\delta^2/\sigma^2$\; $\lambda' = F^{-1}_\delta(1 - F_\delta(\lambda))$\; $(\delta')^2 = \lambda'\sigma^2/v$\; $(x_{k+1}, ..., x_{2k}) = \textsc{MarsagliaSample}(\boldsymbol{\epsilon}, \eta', (\delta')^2, k)$\; Return $(x_{k+1}, ..., x_{2k})$\; \label{alg:antithetic} \end{algorithm} \begin{prop} Given $k - 1$ i.i.d samples $\boldsymbol{\epsilon} = (\epsilon_1, ..., \epsilon_{k-1}) \sim \mathcal{N}(0, 1)$, $k$ i.i.d. samples $\boldsymbol{x} = (x_1, ..., x_k) \sim \mathcal{N}(\mu, \sigma^2)$, let $(x_{k+1}, ..., x_{2k}) = \textsc{AntitheticSample}(\boldsymbol{x}, \boldsymbol{\epsilon}, \mu, \sigma^2, k)$ be the generated antithetic samples. Then: \begin{enumerate} \item $x_{k+1}, ..., x_{2k}$ are independent normal variates sampled from $\mathcal{N}(\mu, \sigma^2)$. \item The combined sample mean $\frac{1}{2k}\sum_{i=1}^{2k}x_i$ is equal to the population mean $\mu$. \item The sample variance of $x_{k+1}, ..., x_{2k}$ is anticorrelated with the sample variance of $x_1, ..., x_k$. \end{enumerate} \label{prop:antithetic} \end{prop} \begin{proof} The first property follows immediately from Prop.~\ref{prop:marsaglia}, as by construction $\eta', \delta'$ have the correct marginal distribution. Simple algebra shows that the inverse Gaussian CDF transform simplifies to $\eta' = 2 * \mu - \eta$, giving the desired relationship $\eta/2 + \eta'/2 = \mu $. The third property follows from Eq. \ref{eq:inversechi}. \end{proof} Since both sets of samples share the same (correct) marginal distribution, $x_1, ..., x_{2k}$ can be used to obtain unbiased Monte Carlo estimates. \begin{prop} Given $k - 1$ i.i.d samples $\boldsymbol{\epsilon} = (\epsilon_1, ..., \epsilon_{k-1}) \sim \mathcal{N}(0, 1)$, $k$ i.i.d. samples $\boldsymbol{x} = (x_1, ..., x_k) \sim \mathcal{N}(\mu, \sigma^2)$, let $(x_{k+1}, ..., x_{2k}) = \textsc{AntitheticSample}(\boldsymbol{x}, \boldsymbol{\epsilon}, \mu, \sigma^2, k)$ be the generated antithetic samples. Then $\frac{1}{2k} \sum_{i=1}^{2k} f(x_i)$ is an unbiased estimator of $\mathbb{E}_{x \sim \mathcal{N}(\mu, \sigma^2)}[f(x)]$. \label{unbiased} \end{prop} \begin{proof} Let $q(x_1, \cdots, x_k, x_{k+1}, \cdots, x_{2k})$ denote the joint distribution of the $2k$ samples. Note the two groups of samples $(x_1, ..., x_k)$ and $(x_{k+1}, ..., x_{2k})$ are not independent. However, \begin{align*} \mathbb{E}_{(x_1, \cdots, x_k, x_{k+1}, \cdots, x_{2k}) \sim q} \left[ \frac{1}{2k} \sum_{i=1}^{2k} f(x_i) \right] = \\ \frac{1}{2k} \sum_{i=1}^{2k} \mathbb{E}_{x_i \sim q_i(x_i)} \left[f(x_i) \right] = \mathbb{E}_{x \sim \mathcal{N}(\mu, \sigma^2)}[f(x)] \end{align*} because by assumption and Prop.~\ref{prop:antithetic}, each $x_i$ is marginally distributed as $\mathcal{N}(\mu, \sigma^2)$. \label{prop:test} \end{proof} \subsection{Approximate Antithetic Sampling} If $F_\eta$ and $F_\delta$ were well-defined and invertible, we could use Alg.~\ref{alg:antithetic} as is, with its good guarantees. On one hand, since $\eta$ is normally distributed, the inverse CDF transform simplifies to: \begin{equation} \eta' = 2 * \mu - \eta \label{eqn:inversecdf_mean} \end{equation} However, there is no general closed form expression for $F^{-1}_\delta$. Our options are then to either use a discretized table of probabilities or approximate the inverse CDF. Because we desire differentiability, we choose to use a normal approximation to $F_{\delta}$. \paragraph{Antithetic Hawkins-Wixley} \cite{canal2005normal} surveys a variety of normal approximations, all of which are a linear combination of $\chi^2$ variates to a power root. We choose to use \citep{hawkins1986note} as (P1) it is an even power, (P2) it contains only 1 term involving a random variate, and (P3) is shown to work better for smaller degrees of freedom (smaller sample sizes). We derive a closed form for computing $\delta'$ from $\delta$ by combining the normal approximation with Eqn.~\ref{eqn:inversecdf_mean}. We denote this final transform as the \textit{antithetic Hawkins-Wixley transform}: \begin{equation} \lambda' = v(2(1 - \frac{3}{16v} - \frac{7}{512v^2} + \frac{231}{8192v^3}) - (\frac{\lambda}{v})^{1/4})^4 \label{eqn:anti_approx} \end{equation} where $\lambda \sim \chi^2_{v}$ with $v$ being the degree of freedom. Therefore, if we set $\lambda = (k-1)\delta^2/\sigma^2 \sim \chi^2_{k-1}$ and $v = k - 1$, then we can derive $(\delta')^2 = \lambda'\sigma^2/(k-1)$ where $\lambda'$ is computed as in Eqn.~\ref{eqn:anti_approx}, whose derivation can be found in the supplementary material. P1 is important as odd degree approximations e.g. \citep{wilson1931distribution} can result in a negative value for $\lambda'$ under small $k$. P2 is required to derive a closed form as most linear combinations do not factor. P3 is desirable for variational inference. To update Alg.~\ref{alg:antithetic}, we swap the fourth line with Eqn.~\ref{eqn:inversecdf_mean} and the sixth line with Eqn.~\ref{eqn:anti_approx}. The first property in Prop. \ref{prop:antithetic} and therefore also Prop. \ref{unbiased} do not hold anymore: the approximate \textsc{AntitheticSample} has bias that depends on the approximation error in Eqn.~\ref{eqn:anti_approx}. In practice, we find the approximate \textsc{AntitheticSample} to be effective. From now on, when we refer to \textsc{AntitheticSample}, we refer to the approximate version. See supplement for a written algorithm. We refer to Fig.~\ref{fig:demo} for an illustration of the impact of antithetics: sampling i.i.d. could result in skewed sample distributions that over-emphasize the mode or tails, especially when drawing very few samples. Including antithetic samples helps to ``stabilize" the sample distribution to be closer to the true distribution. \begin{figure}[h!] \centering \begin{subfigure}[b]{\columnwidth} \includegraphics[width=\columnwidth]{demo_legend.pdf} \end{subfigure} \begin{subfigure}[b]{.24\columnwidth} \includegraphics[width=\columnwidth]{demo8sample.pdf} \caption{$k=8$} \label{fig:demo8} \end{subfigure} \begin{subfigure}[b]{.24\columnwidth} \includegraphics[width=\columnwidth]{demo10sample.pdf} \caption{$k=10$} \label{fig:demo10} \end{subfigure} \begin{subfigure}[b]{.24\columnwidth} \includegraphics[width=\columnwidth]{demo20sample.pdf} \caption{$k=20$} \label{fig:demo20} \end{subfigure} \begin{subfigure}[b]{.24\columnwidth} \includegraphics[width=\columnwidth]{demo50sample.pdf} \caption{$k=50$} \label{fig:demo50} \end{subfigure} \caption{The effect of \textsc{AntitheticSample} in 1 dimension. We vary the number of samples $k$, and plot the true distribution (solid black line), a kernel density estimate (KDE) of the empirical distribution (dotted blue line) of $2k$ i.i.d. samples (blue), and a KDE of the empirical distribution (dashed red line) of $k$ i.i.d. samples (red) pooled with $k$ antithetic samples (orange). This snapshot was taken from the first epoch of training an AntiVAE on dynamic MNIST.} \label{fig:demo} \end{figure} \section{Generalization to Other Families} \label{sec:generalization} \cite{marsaglia1980c69}'s algorithm is restricted to distribution families that can be transformed to a unit sphere (primarily Gaussians), as are many similar algorithms \citep{cheng1984generation, pullin1979generation}. However, we can explore ``generalizing" \textsc{AntitheticSample} to a wider class of families by first antithetically sampling in a Gaussian distribution, then transforming its samples to samples from another family using a deterministic function, $g: \mathbb{R}^d \rightarrow \mathbb{R}^d$. Although we are not explicitly matching the moments of the derived distributions, we expect that transformations of more representative samples in an initial distribution may be more representative in the transformed distribution. We now discuss a few candidates for $g(\cdot)$. \subsection{One-Liners} \cite{devroye1996random} presents a large suite of ``one line" transformations between distributions. We focus on three examples starting from a Gaussian to (1) Log Normal, (2) Exponential, and (3) Cauchy. Many additional transformations (e.g.~to Pareto, Gumbel, Weibull, etc.) can be used in a similar fashion. Let $F_x$ refer to the CDF of a random variable $x$. See supplementary material for derivations. \paragraph{Log Normal}$g(z) = e^z$ where $z \sim \mathcal{N}(\mu, \sigma^2)$. \paragraph{Exponential} Let $F_x(x) = 1 - \exp^{\lambda x}$ where $\lambda\in \mathbb{R}^d$ is a learnable parameter. Then $F_x^{-1}(y) = -\frac{1}{\lambda} \log y$. Thus, $g(u, \lambda) = -\frac{1}{\lambda} \log u$ where $u \in U(0, 1)$. \paragraph{Cauchy} Let $F_x(x) = \frac{1}{2} + \frac{1}{\pi}\arctan(\frac{x - x_0}{\gamma})$ where $x_0\in \mathbb{R}^d, \gamma\in \mathbb{R}^d$ are learnable parameters. Then $F_x^{-1}(y) = \gamma(\tan(\pi y) + x_0)$. Given $u \in U(0, 1)$, we define $g(u, x_0, \gamma) = \gamma(\tan(\pi u) + x_0)$. \subsection{Deeper Flows} One liners are an example of a simple flow where we know how to score the transformed sample. If we want more flexible distributions, we can apply normalizing flows (NF). A \textit{normalizing flow} \citep{rezende2015variational} applies $T$ invertible transformations $h^{(t)}, t = 1, ..., T$ to samples $z^{(0)}$ from a simple distribution, leaving $z^{(T)}$ as a sample from a complex distribution. A common normalizing flow is a linear-time transformation: $g(z) = z + u(h(w^{T}z + b))$ where $w\in \mathbb{R}^d, u\in \mathbb{R}^d, b\in \mathbb{R}$ are learnable parameters, and $h$ is a non-linearity. In variational inference, flows enable us to parameterize a wider set of posterior families. We can also achieve flexible posteriors using volume-preserving flows (VPF), of which \cite{tomczak2016improving} introduced the Householder transformation: $g(z) = (I - 2\frac{v \cdot v^T}{\|v\|^2})z$ where $v \in \mathbb{R}^d$ is a trainable parameter. Critically, the Jacobian-determinant is 1. \begin{algorithm}[h] \SetAlgoLined \caption{AntiVAE Inference} \KwData{A observation $x$; number of samples $k \geq 6$; a variational posterior $q(z|x)$ e.g. a $d$-dimensional Gaussian, $\mathcal{N}^d(\mu, \sigma^2)$.} \KwResult{Samples $z^d_1,...,z^d_k\sim q_{\mu, \sigma}(z|x)$ that match moments.} $\mu^d$, $\sigma^d =$\textsc{InferenceNetwork}$(x)$\; $\mu = \normalfont\textsc{Flatten}(\mu^d)$\; $\sigma = \normalfont\textsc{Flatten}(\sigma^d)$\; $\epsilon_1, ..., \epsilon_{kd/2} \sim \mathcal{N}(0, 1)$\; $\boldsymbol{\xi} = \xi_1, ..., \xi_{\frac{kd}{2} - 1} \sim \mathcal{N}(0, 1)$\; \For{$i\gets 1$ \KwTo $kd/2$}{ $y_i = \epsilon_i * \sigma + \mu$\; } $\boldsymbol{y} = (y_1, ..., y_{kd/2})$\; $y_{\frac{kd}{2} + 1}, ..., y_{kd} = $\textsc{AntitheticSample}$(\boldsymbol{y}, \boldsymbol{\xi}, \mu, \sigma)$\; $\boldsymbol{z} = (y_1, ..., y_{kd})$\; $z^d_1, ..., z^d_k = \normalfont\textsc{UnFlatten}(\boldsymbol{z})$\; Return $z^d_1, ..., z^d_k$\; \label{algo:vae_forward} \end{algorithm} \section{Differentiable Antithetic Sampling} Finally, we can use \textsc{AntitheticSample} to approximate the ELBO for variational inference. For a given observation $x \in p_\textup{data}(x)$ from an empirical dataset, we write the antithetic gradient estimators as: \begin{equation} \begin{split} \nabla_\theta \textup{ELBO} &\approx \frac{1}{2k}\sum_{i=1}^{k}[\nabla_\theta \log p_\theta(x, z_i) \\ & + \nabla_\theta \log p_\theta(x, z_{i+k}) ]\label{eqn:grad_anti1} \end{split} \end{equation} \begin{equation} \begin{split} \nabla_\phi \textup{ELBO} &\approx \frac{1}{2k}\sum_{i=1}^{k}[\nabla_{z} \log \frac{p_\theta(x, z_i(\epsilon))}{q_\phi(z_i(\epsilon)|x)}\nabla_\phi g_\phi(\epsilon_i) \\ & + \nabla_{z} \log \frac{p_\theta(x, z_{i+k}(\epsilon))}{q_\phi(z_{i+k}(\epsilon)|x)}\nabla_\phi g_\phi(\epsilon_{i+k})]\label{eqn:grad_anti2} \end{split} \end{equation} where $(\epsilon_1, ..., \epsilon_k) \sim \mathcal{N}(0, 1)$, $\boldsymbol{\xi} = (\xi_1, ..., \xi_{k-1})$, $\boldsymbol{z} = (z_1, ..., z_k) \sim q_\phi(z|x)$, and $(z_{k+1}, ..., z_{2k}) = \textsc{AntitheticSample}(\boldsymbol{z}, \boldsymbol{\xi}, \mu, \sigma^2, k)$. Optionally, $\boldsymbol{z} = \textsc{Transform}(\boldsymbol{z}, \alpha)$ where $\textsc{Transform}$ denotes any sample transformation(s) with parameters $\alpha$. Alternative variational bounds have been considered recently, including an importance-weighted estimator of the ELBO, or IWAE \citep{burda2015importance}. Antithetic sampling can be applied in a similar fashion, as also shown in~\citep{shu2019buffered}. Importantly, \textsc{AntitheticSample} is a special instance of a reparameterization estimator. Aside from samples from a parameter-less distribution (unit Gaussian), \textsc{AntitheticSample} is completely deterministic, meaning that it is differentiable with respect to the population moments $\mu$ and $\sigma^2$ by any modern auto-differentiation library. Allowing backpropagation through \textsc{AntitheticSample} means that any free parameters are aware of the sampling strategy. Thus, including antithetics will change the optimization trajectory, resulting in a different variational posterior than if we had used i.i.d samples alone. In Sec.~\ref{sec:results}, we show experimentally that \textit{most of the benefit} of differentiable antithetic sampling comes from being differentiable. Alg.~\ref{algo:vae_forward} summarizes inference in a VAE using differentiable antithetic sampling (denoted by AntiVAE\footnote{For some experiments, we use Cheng's algorithm instead of Marsaglia's. We refer to this as AntiVAE (Cheng).}). To the best of our knowledge, the application of antithetic sampling to stochastic optimization, especially variational inference is novel. Both the application of \citep{marsaglia1980c69} to drawing antithetics and the extension of \textsc{AntitheticSample} to other distribution families by transformation is novel. This is also the first instance of differentiating through an antithetic sample generator. \begin{figure*}[t!] \centering \begin{subfigure}[b]{\textwidth} \includegraphics[width=\textwidth]{elbo_legend.pdf} \end{subfigure} \begin{subfigure}[b]{0.135\textwidth} \includegraphics[width=\textwidth]{static_mnist_main_result.pdf} \caption{static} \label{fig:elbo_static_mnist} \end{subfigure} \begin{subfigure}[b]{0.135\textwidth} \includegraphics[width=\textwidth]{dynamic_mnist_main_result.pdf} \caption{dynamic} \label{fig:elbo_dynamic_mnist} \end{subfigure} \begin{subfigure}[b]{0.135\textwidth} \includegraphics[width=\textwidth]{fashion_mnist_main_result.pdf} \caption{Fashion} \label{fig:elbo_fashion_mnist} \end{subfigure} \begin{subfigure}[b]{0.135\textwidth} \includegraphics[width=\textwidth]{omniglot_main_result.pdf} \caption{Omniglot} \label{fig:elbo_omniglot} \end{subfigure} \begin{subfigure}[b]{0.135\textwidth} \includegraphics[width=\textwidth]{caltech_main_result.pdf} \caption{Caltech} \label{fig:elbo_caltech} \end{subfigure} \begin{subfigure}[b]{0.135\textwidth} \includegraphics[width=\textwidth]{freyfaces_main_result.pdf} \caption{Frey} \label{fig:elbo_freyfaces} \end{subfigure} \begin{subfigure}[b]{0.135\textwidth} \includegraphics[width=\textwidth]{histopathology_main_result.pdf} \caption{Hist.} \label{fig:elbo_histopathology} \end{subfigure} \caption{A comparison of test log likelihoods over 500 epochs between VAE and AntiVAE. Transforming samples to match moments seems to have different degrees of effectiveness depending on the data domain. However, we find that the test ELBO with AntiVAE is almost always greater or equal to that of the VAE. This behavior is not sensitive to hyperparameters e.g. learning rate or MLP hidden dimension. For each subplot, we start plotting from epoch 20 to 500. We cannot resample observations in Caltech101, leading to overfitting.} \label{fig:learning_trajectory} \end{figure*} \begin{table*}[t!] \small \begin{tabular}{r|ccccccc} Model & stat. MNIST & dyn. MNIST & FashionMNIST & Omniglot & Caltech & Frey & Hist. \\ \toprule VAE & -90.44 & -86.96 & -2819.13 & -110.65 & -127.26 & -1778.78 & -3320.37\\ AntiVAE & -89.74 & -86.94 & -2807.06 & \textbf{-110.13} & \textbf{-124.87} & -1758.66 & -3293.01 \\ AntiVAE (Cheng) & \textbf{-89.70} & \textbf{-86.93} & \textbf{-2806.71} & -110.39 & -125.19 & \textbf{-1758.29} & \textbf{-3292.72}\\ \hline VAE+IWAE & -89.78 & -86.71 & -2797.02 & \textbf{-109.32} & -123.99 & -1772.06 & -3311.23 \\ AntiVAE+IWAE & \textbf{-89.71} & \textbf{-86.62} & \textbf{-2793.01} & -109.48 & \textbf{-123.35} & \textbf{-1771.47} & \textbf{-3305.91}\\ \hline VAE ($\log\mathcal{N}$) & \textbf{-149.47} & -145.13 & -2891.75 & -164.01 & -269.51 & -1910.11 & -3460.18 \\ AntiVAE ($\log\mathcal{N}$) & -149.78 & \textbf{-141.76} & \textbf{-2882.11} & \textbf{-163.55} & \textbf{-266.82} & \textbf{-1895.15} & \textbf{-3454.54} \\ \hline VAE (Exp.) & \textbf{141.95} & -140.91 & -2971.00 & -159.92 & -200.14 & -2176.83 & -3776.48 \\ AntiVAE (Exp.) & 141.98 & \textbf{-140.58} & \textbf{-2970.12} & \textbf{-158.15} & -\textbf{197.47} & \textbf{-2156.93} & \textbf{-3770.33} \\ \hline VAE (Cauchy) & -217.69 & -217.53 & -3570.53 & -187.34 & -419.78 & -2404.24 & -3930.40 \\ AntiVAE (Cauchy) & \textbf{-215.89} & \textbf{-217.12} & \textbf{-3564.80} & \textbf{-186.02} & \textbf{-417.0} & \textbf{-2395.07} & \textbf{-3926.95} \\ \hline VAE+10-NF & -90.07 & -86.93 & -2803.98 & -110.03 & -128.62 & -1780.61 & -3328.68 \\ AntiVAE+10-NF & \textbf{-89.77} & \textbf{-86.57} & \textbf{-2801.90} & \textbf{-109.43} & \textbf{-127.23} & \textbf{-1777.26} & \textbf{-3303.00}\\ \hline VAE+10-VPF & -90.59 & -86.99 & -2802.65 & -110.19 & -128.87& -1789.18 & -3312.30 \\ AntiVAE+10-VPF & \textbf{-90.00} & \textbf{-86.59} & \textbf{-2797.05} & \textbf{-109.04} & \textbf{126.72} & \textbf{-1787.18} & \textbf{-3305.42}\\ \end{tabular} \caption{Test log likelihoods between the VAE and AntiVAE under different objectives and posterior families (a higher number is better). Architecture and hyperparameters are consistent across models. AntiVAE (Cheng) refers to drawing antithetic sampling using an alternative algorithm to Marsaglia (see supplement). Results show the average over 5 independent runs with different random seeds. For measurements of variance, see supplement.} \label{table:results} \end{table*} \begin{figure*}[t!] \begin{subfigure}[b]{0.16\textwidth} \includegraphics[width=\textwidth]{sample_effect.pdf} \caption{FashionMNIST} \end{subfigure} \begin{subfigure}[b]{0.16\textwidth} \includegraphics[width=\textwidth]{z_effect.pdf} \caption{FashionMNIST} \end{subfigure} \begin{subfigure}[b]{0.24\textwidth} \includegraphics[width=\textwidth]{backprop_effect.pdf} \caption{FashionMNIST} \label{fig:discussion:c} \end{subfigure} \begin{subfigure}[b]{0.24\textwidth} \includegraphics[width=\textwidth]{backprop2_effect.pdf} \caption{Histopathology} \label{fig:discussion:d} \end{subfigure} \begin{subfigure}[b]{0.16\textwidth} \includegraphics[width=\textwidth]{backprop_analysis.pdf} \caption{Histopathology} \label{fig:discussion:e} \end{subfigure} \caption{(a) With more samples, the difference in $\log p(x)$ between AntiVAE and VAE approaches 0. (b) The benefit of antithetics varies directly with dimensionality. (c) Backpropagating through \textsc{AntitheticSample} is responsible for most of the improvement over i.i.d. sampling. However, even without it, antithetics outperforms VAE. (d) Similar observation in Histopathology. (e) Differentiable antithetics encourages sample diversity.} \label{fig:discussion} \end{figure*} \section{Experiments} \label{sec:experiments} We compare performance of the VAE and AntiVAE on seven image datasets: static MNIST \citep{larochelle2011neural}, dynamic MNIST \citep{lecun1998gradient}, FashionMNIST \citep{xiao2017fashion}, OMNIGLOT \citep{lake2015human}, Caltech 101 Silhouettes \citep{marlin2010inductive}, Frey Faces\footnote{https://cs.nyu.edu/~roweis/data.html}, and Histopathology patches \citep{tomczak2016improving}. See supplement for details. In both VAE and AntiVAE, $q_\phi(z|x)$ and $p_\theta(x|z)$ are two-layer MLPs with 300 hidden units, Xavier initialization \citep{glorot2010understanding}, and ReLU. By default, we set $d=40$ and $k=8$ (i.e. 4 antithetic samples) and optimize either the ELBO or IWAE. For grayscale images, $p_\theta(x|z)$ parameterize a discretized logistic distribution as in \citep{kingma2016improved, tomczak2017vae}. The log variance from $p_\theta(x|z)$ is clamped between -4.5 and 0.0 \citep{tomczak2017vae}. We use Adam \citep{kingma2014adam} with a fixed learning rate of $3\cdot 10^{-4}$ and a mini-batch of 128. We train for 500 epochs. Test marginal log likelihoods are estimated via importance sampling using 100 i.i.d.~samples. See supplement for additional experiments where we vary architectures, measure runtimes, report variance over many runs, and more. \section{Results} \label{sec:results} Fig.~\ref{fig:learning_trajectory} and Table~\ref{table:results} show test log likelihoods (over 5 runs). We summarize findings below: \paragraph{VAE vs AntiVAE} AntiVAE consistently achieves higher log likelihoods, usually by a margin of 2 to 5 log units. With FashionMNIST/Histopathology, the margin grows to as much as 30 log units. In the 3 cases that AntiVAE performs worse than VAE, the log-likelihoods are almost equal ($\leq$ 1 log unit). In Fig.~\ref{fig:elbo_dynamic_mnist}, we see a case where, even when the final performance is equivalent, AntiVAE learns faster. We find similar behavior using a tighter IWAE bound or other posterior families defined by one liners and flows. With the latter, we see improvements of up to 25 log units. A better sampling strategy is effective regardless of the choice of objective and distributional family. \paragraph{As $k$ increases, the effect of antithetic sampling diminishes.} Fig.~\ref{fig:discussion}a illustrates that as the number of samples $k \rightarrow \infty$, posterior samples will match the true moments of $q_\phi(z|x)$ regardless of the sampling strategy. But as $k\rightarrow 0$, the effectiveness grows quickly. We expect best performance at small (but not too small) $k$ where the normal approximation (Eqn.~\ref{eqn:anti_approx}) is decent and the value of antithetics is high. \paragraph{As $d$ increases, the effect of antithetic sampling grows.} Fig.~\ref{fig:discussion}b illustrates that the importance of sampling strategy increases as the dimensionality grows due to an exponential explosion in the volume of the sample space. With higher dimensionality, we find antithetic sampling to be more effective. \paragraph{Backpropagating through antithetic sampling greatly improves performance.} From Fig.~\ref{fig:discussion:c}, \ref{fig:discussion:d}, we see that most of the improvement from antithetics relies on differentiating through \textsc{AntitheticSample}. This is sensible as the model can adjust parameters if it is aware of the sampling strategy, leading to better optima. Even if we do not backpropagate through sampling (draw antithetic samples from $\mathcal{N}(0, 1)$ followed by standard reparameterization), we will still find modest improvement over i.i.d.~sampling. We believe differentiability encourages initial samples to be more diverse. To test this, we measure the variance of the first $k/2$ samples (1) without antithetics, (2) with non-differentiable antithetics, and (3) with differentiable antithetics. Fig.~\ref{fig:discussion}e shows that samples in (3) have consistently higher variance than (1) or (2). \paragraph{AntiVAE runtimes are comparable.} We measure an average 0.004 sec. increase in wallclock time per step when adding in antithetics. \section{Conclusion} \label{sec:conclusion} We present a differentiable antithetic sampler for variance reduction. We show its benefits for a family of VAEs. We hope to apply it to reinforcement learning using pathwise derivatives~\citep{levy2018deterministic}. \subsubsection*{Acknowledgements} This research was supported by NSF (\#1651565, \#1522054, \#1733686), ONR, AFOSR (FA9550-19-1-0024), FLI, and SocioNeticus (part of the DARPA SocialSim program). MW is supported by NSF GRFP.
{'timestamp': '2019-08-15T02:14:33', 'yymm': '1810', 'arxiv_id': '1810.02555', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02555'}
arxiv
\section{Introduction} Decision-making is a critical step for early-phase drug development, aiming to advance promising drugs for further development and stop inferior drugs. Traditionally, decisions are usually based on a significant $p$-value, e.g., the rejection of the null hypothesis in a Simon two-stage design \citep{simon1989optimal} would warrant further development of the drug. However, a rejection of the null hypothesis may not necessarily support a desired treatment effect \citep{ratain2007testing}. Furthermore, in the context of a multilevel target product profile (TPP), which defines the minimal and targeted levels of treatment effect, more complex decisions are needed. Such a TPP framework has been used routinely throughout clinical development since it addresses the challenges when a drug effect cannot be represented well by a single threshold \citep{frewer2016decision,pulkstenis2017bayesian}. \cite{lalonde2007model} first formulated a Go/Pause/Stop decision framework by defining a lower reference value (LRV) and a target value (TV), where LRV represents a ``dignity" line for developing a drug and TV represents a desired clinical improvement of commercial viability. \cite{frewer2016decision} illustrated how the Go/Pause/Stop decisions in the paper of \cite{lalonde2007model} were calculated for a Phase II study and how the operating characteristics were assessed to ensure robustness. \cite{pulkstenis2017bayesian} extended the Lalonde framework by allowing to incorporate historical data prior to calculating probabilities of Go/Pause/Stop. However, these approaches were developed based on the assumption that the treatment effect was homogeneous among patients, limiting their applicability in many diseases where heterogeneous treatment effect might exist. Depending on patients' clinical characteristics, the expression of specific biomarkers or their combinations, it has become well known that there exists heterogeneity in treatment effects across patient subpopulations when given the same treatment in many diseases. Thus, it is essential to take into account potentially heterogeneous treatment effects in clinical trial designs or data analyses when making a decision. For instance, breast cancer patients with an enriched HER2 pathway were found to respond well to the medication trastuzumab \citep{hudis2007trastuzumab}, while other subtypes of breast cancers do not. Another example is that treatments with EGFR antibodies are not recommended for KRAS mutated colorectal cancer patients as they are usually resistant to anti-EGFR treatment \citep{misale2012emergence}. Therefore, it is very important at the proof-of-concept stage of drug development to identify the biomarkers that have interaction effects with the treatment and are predictive of the subgroups that are more likely to respond to the treatment. For situations where the predictive biomarkers are hypothesized but not proved, i.e., it is not clear whether the new therapy works for all-comers or a subpopulation, adaptive enrichment designs have been developed to evaluate the treatment effect and thereby modify the eligibility criteria at interim analyses in an attempt to identify the right population for the new therapy. Patients exhibiting the desired treatment effects are referred to as the ``enriched population." \cite{wang2007approaches} and \cite{karuri2012two} compared the active versus placebo by evaluating the treatment effectiveness of biomarker positive- and negative- subgroups at an interim analysis, allowing for terminating the enrollment of the biomarker negative subgroup. Simon et al. developed a class of adaptive enrichment designs to adaptively update the eligibility criteria, they then extended this work by developing a frequentist/Bayesian model for decision making using a formal hypothesis test at the end of the trial to preserve type I error \citep{simon2013adaptive,simon2017using}. See, for example, Wang and Huang for a review of adaptive enrichment designs \citep{wang2013adaptive}. Most of these enrichment designs use a set of biomarkers to pre-define subgroups and then test if there are differential therapeutic effects on these pre-defined subgroups. However, pre-defining subgroups can be problematic if the pre-defined biomarkers are not predictive or the cutoff values for the predictive biomarkers are incorrect. Therefore, an enrichment design that allows the discovery and estimation of subgroups during the clinical trial is highly desirable. Subgroup identification involves two major tasks: identify predictive biomarkers and determine the optimal cutoff values for predictive biomarkers. \cite{foster2011subgroup} developed a random forest-based algorithm to find subgroups by searching biomarker regions where the treatment effect is larger than the average effect on the whole population. \cite{lipkovich2011subgroup} developed SIDES (subgroup identification based on differential effect search), which makes use of the classification and regression tree (CART) \citep{breiman1984classification} to recursively split a patient set such that one of the halves from each split has maximal treatment effect relative to the other half. \cite{loh2015regression} and \cite{loh2016identification} proposed a regression tree approach, GUIDE, to first decide which biomarkers to split on through the use of $\chi^2$ tests, and then identify the optimal cutoff values for the selected biomarkers. \cite{xu2014subgroup} developed SUBA, a Bayesian subgroup-based adaptive design, to allocate the patients to their superior treatments using a random partition model that splits the biomarker space by the observed biomarker's median value, which generally is not the optimal cutoff for a predictive biomarker. \cite{guo2017subgroup} extended SUBA ({\it i.e.}, SCUBA) by allowing the biomarker space to be split using hyperplanes that construct linear boundaries, providing a more flexible partition model. All of these methods either target the subgroup identification using the retrospective clinical trial data, or focus on subgroup identification for patient allocations during the trial. They have not been directly utilized in clinical trial enrichment designs to modify the study entry criteria during interim analyses in the context of a multilevel TPP. Applying the Lalonde framework \citep{lalonde2007model} in the context of a multilevel TPP to construct enrichment decision rules in a heterogenous population is challenging and complicated, since one needs to deal with heterogeneity in treatment effect across patient subpopulations. To our best knowledge, there is no such precedent thus far. In this paper, we propose an adaptive subgroup-identification enrichment design (ASIED), utilizing patients' biomarker profiles and outcomes as they become available to create a design with learning, adapting and enriching capacity. ASIED searches for subgroups among a set of biomarkers using interim accumulated data obtained from all-comers rather than predefining subgroups and allows the entry criteria to be modified to enroll subjects with specific clinical characteristic or biomarker signature who are more likely to respond to the treatment, enabling better learning of the treatment effect on the enriched population. The biomarker-defined subgroups are not fixed upfront -- we assume a prior on the partition to classify the patients into subgroups and then learn the cutoff values using observed response data. Building upon \cite{xu2014subgroup} and \cite{guo2017subgroup}, ASIED uses a flexible Bayesian model as the core search algorithm that can handle biomarkers of varying forms (continuous, binary, categorical, or ordinal) and different types of response outcomes (binary, categorical, continuous). The method can be easily extended to model other types of outcomes, such as counting and survival outcomes. More importantly, we construct a decision-making framework to make informed decisions, such as continuing with all-comers or enriching to a subpopulation. The possible decisions include: a ``Go" decision for all-comers, a ``Go" decision for the identified subgroup with enhanced treatment effect, a ``Stop" decision for all-comers due to futility, or conduct one more interim analysis when the interim result is inconclusive. The key novelty of ASIED is to combine the tasks of ``subgroup identification" and ``enrichment" to create an adaptive enrichment design engine that enables more efficient learning about the investigational drug's efficacy in the identified subpopulation through a set of decision-making rules in the context of a multilevel TPP. The posterior inference for subgroups with enhanced treatment effects under the proposed Bayesian model will lead to the modification of study enrollment criteria. Therefore, more patients with the characteristics in the identified subgroup can be enrolled to the study as the trial continues after the interim analysis. In summary, ASIED represents the first effort in the literature to conduct subgroup discovery, evaluation, and adaptive modification of study enrollment criteria simultaneously using a flexible Bayesian searching algorithm and a probabilistic decision-making framework. This paper proceeds as follows. We first introduce the motivating trial in Section \ref{sec:motivate}. The proposed ASIED design with a decision-making framework is described in Section \ref{sec:design}. We elaborate the proposed Bayesian random partition model for subgroup identification in Section \ref{sec:model} with simulation studies. Section \ref{sec:oc} presents simulation studies that examine the operating characteristic of the ASIED in the motivating AD symptom improvement POC study. We conclude with a discussion in Section \ref{sec:con}. \section{Motivating Trial} \label{sec:motivate} We consider a placebo-controlled, double-blind proof-of-concept (POC) study for an investigational drug on patients with Alzheimer's disease (AD) for symptom improvement. The primary efficacy endpoint is the change from baseline to final observation on the total score of 13-item Alzheimer's disease Assessment Scale -- Cognitive Subscale (ADAS-cog) in a 12-week study. Previous research has suggested a number of biomarkers that might predict treatment effect on AD. These biomarkers are apolipoprotein E (APOE)-$\epsilon$4 genotype and allele status, plasma amyloid precursor protein $\beta$ (A$\beta$), and cerebrospinal fluid (CSF) $\beta$-site amyloid precursor protein (APP)-cleaving enzyme 1 (BACE1). It is plausible that the investigational drug only has a clinically meaningful effect on a subpopulation that is qualified by one of the biomarkers or a combination of several biomarkers listed above. The objective of this clinical trial is to test whether the investigational drug has efficacy of AD symptom improvement on all-comers or on a biomarker-defined subpopulation, and if latter, to learn more about the efficacy of the drug on the subpopulation in the same study by adaptive enrichment. At the beginning, patients diagnosed with probable AD and meeting entry criteria will be enrolled and equally assigned to the placebo or the investigational drug. Baseline biomarkers data will be collected. At the pre-specified interim analysis, accumulating ADAS-cog total scores are utilized to assess whether the treatment has effect on all-comers and search for potential subgroups with enhanced treatment effects compared to all-comers. When such a subgroup is ascertained by pre-specified decision rules, study entry criteria will be modified so that only the patients with the characteristics in the identified subpopulation will be enrolled in the rest of the study. The enrichment in the middle course of the study will allow more information to be obtained for the subpopulation to inform next step of clinical development. Previous research reported that the pooled treatment effect of Cholinesterase Inhibitors (approved AD symptom improvement therapies) vs. placebo on mild-to-moderate AD patients was 2.37 \citep{birks2006cholinesterase}. In this paper, the motivating AD trial is used as the background for simulation studies. To set up simulation scenarios and Go/No-Go decision rules in the proposed adaptive enrichment design, we assume that LRV=2.37 is the minimum target and a 30\% gain over the pooled effect (TV=3.08) is the desired target when developing a new molecular for the AD symptom treatment. \section{Adaptive Subgroup-Identification Enrichment Design (ASIED) } \label{sec:design} Assume we have a maximum sample size of $N$ patients and $T$ candidate treatments indexed by $t = 1, \ldots, T$. In the motivating AD trial, $T=2$, where $t=1$ represents the placebo and $t=2$ represents the investigational drug. All patients are equally randomized to placebo and investigational drug. The design can be easily extended to multiple treatments. In this section, we propose an adaptive enrichment design that applies a set of decision rules to determine whether the study population should be enriched after subgroup identification. In the motivating AD trial, we have a lower reference value (LRV) and a target value (TV) to characterize the desired efficacy, in which LRV represents a clinically meaningful minimum treatment effect that is a ``dignity" line for developing a drug and TV represents a desired targeted effect increment of the new drug ($\mathrm{TV}>\mathrm{LRV})$. Let $\delta_{\Delta}$ represent the estimated treatment effect for a given subgroup $\Delta$ under a probability model. Note here we do not make any specific assumptions about the subgroup identification model, except for the existence of such a model. Then the probability of the estimated treatment effect being larger than LRV for a given subgroup $\Delta$ can be denoted by $Pr(\delta_{\Delta}\geq \mathrm{LRV})$. Similarly for the probability of the estimated treatment effect being larger than TV for a given subgroup: $Pr(\delta_{\Delta}\geq \mathrm{TV})$. We define three decision outcomes for a subgroup $\Delta$: ``Go" if $Pr(\delta_{\Delta}\geq \mathrm{LRV})\geq \xi_1$; ``Stop" if $Pr(\delta_{\Delta}\geq \mathrm{LRV})< \xi_1$ and $Pr(\delta_{\Delta}\geq \mathrm{TV})< \xi_2$; ``Gray zone" otherwise. The tuning parameters $\xi_1$ and $\xi_2$ are chosen by simulations to obtain a design with desirable operating characteristics. In Section \ref{sec:oc}, we will illustrate how one may calibrate these parameters. The ASIED will be conducted as follows. \begin{itemize} \item Start the trial by enrolling all-comers denoted by $\Omega$. All subjects are equally randomized to the placebo and the investigational drug. \item \underline{Interim analyses.} At the time when the data from the first $n_1$ subjects become available, an interim analysis will be conducted. Specifically, we search for subgroups with enhanced treatment effect, and apply the following rules to make decisions. \begin{enumerate} \item If the treatment effect is a ``Go" for all-comers, that is, $Pr(\delta_{\Omega}\geq \mathrm{LRV})\geq \xi_1$, we continue the trial with the all-comer population until $N$ subjects are enrolled. \item If the treatment effect is a ``Stop" for all-comers, but a ``Go" for a subgroup $\Delta$, that is, $Pr(\delta_{\Omega}\geq \mathrm{LRV})< \xi_1$, $Pr(\delta_{\Omega}\geq \mathrm{TV})< \xi_2$, and $Pr(\delta_{\Delta}\geq \mathrm{LRV})\geq \xi_1$, we enrich the study population to this subgroup by restricting the entry into the clinical trial to only patients with $\bm{x}\in \Delta$ for the remaining sample size (e.g., $N-n_1$). Here $\bm{x}\in \Delta$ indicates that the patient with biomarker profile $\bm{x}$ belongs to the subgroup $\Delta$. \item If the treatment effect is a ``Stop" for all-comers and all possible subgroups, that is, $Pr(\delta_{\Omega}\geq \mathrm{LRV})< \xi_1$, $Pr(\delta_{\Omega}\geq \mathrm{TV})< \xi_2$, $Pr(\delta_{\Delta}\geq \mathrm{LRV})< \xi_1$, and $Pr(\delta_{\Delta}\geq \mathrm{TV})< \xi_2$ for any subgroup $\Delta$, then we stop the trial early due to futility. \item If the treatment effect for all-comers is in ``Gray zone", that is, $Pr(\delta_{\Omega}\geq \mathrm{LRV})< \xi_1$ and $Pr(\delta_{\Omega}\geq \mathrm{TV})\geq \xi_2$, we continue the trial with the all-comer population with $n_2$ ($n_1+n_2<N$) more patients and conduct a second interim analysis with potential outcomes of Step 1, 2, or 3 at the second interim. \item If the treatment effect for all-comers is ``Stop", but there is one subgroup $\Delta$ in ``Gray zone", we enrich study population to this subgroup by restricting the entry into the clinical trial to only patients with $\bm{x}\in \Delta$ until $n_2$ more patients are enrolled. Then we conduct a second interim analysis with the following potential outcomes. \begin{itemize} \item If the treatment effect is a ``Stop" for the enriched subpopulation $\Delta$, we stop the trial due to futility. \item Otherwise, we continue the trial with the enriched subpopulation $\Delta$ until all N subjects are enrolled to the study. \end{itemize} \end{enumerate} \item \underline{Final recommendation of the drug.} When the trial is completed, there are three possible final recommendations of the drug denoted by $a\in\{0, 1, 2\}$, with $a=2$ denoting a recommendation of ``Go" for all-comers; $a=1$ denoting a recommendation of ``Go" for a subgroup; otherwise $a=0$ (including the scenarios where the investigational drug fails to demonstrate effect for all-comers nor for any sub-population, the treatment effect is in the "Gray Zone" for all-comers, or it is ``Stop" for all-comers but in the "Gray Zone" for a subgroup). \end{itemize} Figure \ref{fig:trial} summarizes the decision-making framework for the ASIED. \begin{figure}[h] \centering \includegraphics[scale=0.45]{./figs/decision.pdf} \caption{A flowchart of the ASIED decision-making framework. The boxes in blue color represent the final recommendation of Go/Stop. } \label{fig:trial} \end{figure} \section{A Bayesian Subgroup Identification Model} \label{sec:model} Recall that in Section \ref{sec:design} we assume there exists a subgroup identification model, which can identify the subgroup with enhanced treatment effect based on patients' biomarker profiles and responses at each interim analysis. In our implementation we introduce a flexible Bayesian model as the core search algorithm that can handle biomarkers of varying forms and different types of response outcomes, building upon the methods proposed in \cite{xu2014subgroup} and \cite{guo2017subgroup}. The proposed model will be easy to implement and accurately identify the subgroup with enhanced treatment effect when the sample size $N$ is small. However, any alternative subgroup identification model that learns about enhanced treatment effects by including treatment by covariate interactions, could be used. For example, when the sample size is large, machine learning-based methods such as random forest \citep{foster2011subgroup} or more flexible Bayesian methods such as Bayesian additive regression trees (BART) \citep{chipman2010bart} could be incorporated into the decision-making framework of the proposed ASIED. Assume we have a maximum sample size of $N$ patients that are indexed by $i = 1, \ldots, N$, and suppose there are $T$ candidate treatments indexed by $t = 1, \ldots, T$. Let $z_i = t$ denote that patient $i$ is assigned to treatment $t$. Assume that we have $K$ biomarkers that are potential predictive biomarkers identified from the investigational drug's mechanism of action or disease clinical presentation. We assume that a biomarker $k$ can be binary, ordinal, categorical, or continuous, where $k=1, \dots, K$. Denote $\bm{x}_i = (x_{i1}, \dots , x_{iK})'$ and $y_i$ to be the biomarker profile and the response outcome of the $i^{th}$ patient, respectively. Let $\Omega$ denote the biomarker space. We say that a partition is a family of subsets $\Pi = \lbrace S_1, \cdots, S_m, \cdots, S_M\rbrace$, where the $S_m$'s are mutually disjoint and their union is $\Omega$. Here the number $M$ of subsets is random. The partition on the biomarker space induces a partition of the patients. If $\bm{x}_i \in S_m$, we say patient $i$ with biomarker profile $\bm{x}_i$ belongs to subgroup $m$. We will construct a prior probability measure for $\Pi$ in the next section. Below we consider the sampling model of $y_i$ of different types conditional on $\bm{x}_i$ and $\Pi$, using binary outcomes and continuous outcomes as examples. It can be easily extended to other types of outcomes, such as categorical or survival outcomes. Let $\Theta$ denote the parameters in the sampling model. Denote $\bm{Y}_n = (y_1, \ldots ,y_n)$, $\bm{X}_n = \{\bm{x}_i\}^n_{i=1}$, and $\bm{Z}_n = (z_1, \ldots , z_n)$. \noindent{\underline{Binary outcomes}}. Let $y_i \in \{0, 1\}$ and $\theta_{t, m}$ be the response rate of patients in subgroup $m$ under treatment $t$. In this case, $\Theta = \{\theta_{t, m}\}_{t=1,m=1}^{T, \ \ M}$. We assume $$ p(y_i = 1 \mid z_i =t, \Pi, \bm{x}_i \in S_m) = \theta_{t, m}.$$ The likelihood function is simply the product of $n$ Bernoulli probability mass functions. We assign the prior $\theta_{t,m} \mid \Pi \stackrel{iid}{\sim} Beta(a_t, b_t)$, where $Beta(a_t, b_t)$ denotes a beta distribution with mean $a_t/(a_t+b_t)$. \noindent{\underline{Continuous outcomes}}. Let $y_i \in R$ and $\theta_{t, m}$ be the mean response of patients in subgroup $m$ under treatment $t$. We assume $$ y_i \mid z_i =t, \Pi, \bm{x}_i \in S_m \sim N(\theta_{t, m}, \sigma^2). $$ The likelihood can be written as follows: \begin{equation} p(\bm{Y}_n \mid \bm{X}_n, \bm{Z}_n, \Theta, \Pi) = \prod_{t=1}^{T}\prod_{m=1}^{M}\prod_{\{i: z_i=t, \bm{x}_i\in S_m\}}(2\pi\,\sigma^2)^{-1/2} \exp\{-\frac{1}{2\sigma^2}(y_{i} - \theta_{t, m})^2\}. \end{equation} We assign the conjugate prior $p(\theta_{t, m}, \sigma^2) = p(\theta_{t, m} | \sigma^2)p(\sigma^2)$ with $\theta_{t, m} | \sigma^2 \sim N(\theta_0, \frac{\sigma^2}{\kappa_0})$ and $\sigma^2 \sim IG(\frac{\nu_0}{2}, \frac{SS_0^2}{2})$, where $SS^2_0 = \nu_0 \sigma^2_0$. The joint model can be written as follows, \begin{eqnarray} p(\bm{Y}_n, \Theta, \Pi \mid \bm{X}_n, \bm{Z}_n) \propto p(\bm{Y}_n \mid \bm{X}_n, \bm{Z}_n, \Theta, \Pi)\, p(\Theta \mid \bm{X}_n, \bm{Z}_n, \Pi)\, p(\Pi \mid \bm{c})p(\bm{c}), \label{eq:model} \end{eqnarray} where $\bm{c}$ denotes the parameters in the prior model that describes the random partition $\Pi$. We have introduced the sampling model and the priors for $\Theta$. In the next section, we will discuss the prior of $\Pi$ and $\bm{c}$. \subsection{Prior of Partition} We propose a tree-type random partition on the biomarker space $\Omega$ to define random biomarker subgroups. We build partitions via a tree of recursive splits: each node of the tree represents a subset of $\Omega$. The final leaves of the tree are the partitioning sets $\{S_m\}_{m=1}^M$. At each node the tree is either pruned or the corresponding subset is further split into two siblings. In the latter case, the two siblings are defined by a plane orthogonal to a randomly selected axes of $\Omega$, say the axis of the $k$-th biomarker. In other words, through a sequence of splits, each of which selects a biomarker $k$ first and then splits the space of $x_k$ into two subspaces, we generate a partition set of $\Omega$ as the collection of the resulting subsets. For the motivating AD trial, we limit the partition to at most four biomarker subgroups due to the small sample size, and hence there are no more than two rounds of random splits in the random partition. This constraint is imposed to avoid resulting in subgroups with too few patients. Figure \ref{fig:partition}) illustrates the procedure of random partition using a simple example with two rounds of splits and two continuous biomarkers on $[-1, 1]^2$. In each round, for each of the current subsets, we split along a biomarker $k$ with probability $\nu_k$ or choose not to split with probability $\nu_0$, $\sum_{k=0}^K\nu_k=1$. If an ancestor subset $S$ is split into two subsets by the $k^{th}$ biomarker, then the resulting subsets are $\{i: x_{ik}\leq c_k(S)\}$ and $\{i: x_{ik}> c_k(S)\}$, where $c_k(S)$ is the threshold by which the subset is being split. We will discuss the prior of $c_k(S)$ later. For example, in Figure \ref{fig:partition}, biomarker 1 is chosen in the first round and the patients are split into $U_1=\{i: x_{i1}\leq 0.5\}$ and $L_1=\{i: x_{i1}> 0.5\}$. Here the subindex $_1$ denotes that biomarker 1 is chosen to split; $U$ and $L$ denote that the measurements are smaller and larger than the threshold, respectively. In round 2, we split the subgroup $U_1$ into two biomarker subgroups $UU_{11}$ and $UL_{11}$ by choosing biomarker 1 with threshold 0 and split the subgroup $L_1$ into two biomarker subgroups $LU_{12}$ and $LL_{12}$ by choosing biomarker 2 with threshold -0.2. Note that the ordering of letters U and L are matched with the ordering of the biomarker index. Therefore, at the end, we have the partition $\Pi = \{UU_{11},UL_{11},LU_{12}, LL_{12}\}$, which corresponds to four biomarker subgroups. \begin{figure}[h] \centering \includegraphics[scale=0.5]{./figs/partition.pdf} \caption{An illustration of $\Pi$. The example shows that with two rounds of split, the initial space of two biomarkers is partitioned into four subsets $ \{UU_{11},UL_{11},LU_{12}, LL_{12}\}$.} \label{fig:partition} \end{figure} For a given subset $S$, if biomarker $k$ is selected with probability $\nu_k$ from a set of available biomarkers to split at threshold $c_k(S)$, the prior of $c_k(S)$ depends on the type (continuous, binary, categorical, or ordinal) of biomarker $k$. By ``available", we mean that the split rules would not lead to empty subgroup. For example, if a binary biomarker was used in one round of split, then it would no longer be available for splitting at nodes below it. We describe the split rules for determining a partition of the biomarker space for various types of biomarkers, including continuous, binary, categorical, and ordinal biomarkers as follows. \begin{itemize} \item If biomarker $k$ is binary, the split will be deterministic and we denote $U_k=\{i: x_{ik} = 0\}$ and $L_k=\{i: x_{ik} = 1\}$. Therefore $p(c_k) = 1$. \item If biomarker $k$ is continuous, denote $U_k=\{i: x_{ik} \leq c_k\}$ and $L_k=\{i: x_{ik} > c_k\}$. We assume $p(c_k)=\mathrm{Uniform}( \min \{ x_{ik} \}_{i=1}^N, \max \{ x_{ik} \}_{i=1}^N)$. \item If biomarker $k$ is ordinal, let $V_k$ denote the number of labels that biomarker $k$ has. Let $c_k$ denote the endpoint of the left partition, e.g., if $V_k = 5$ and $c_k = 3$, the left partition is $\lbrace 1, 2, 3\rbrace$ and the right partition is $\lbrace 4, 5\rbrace$. In this way we denote $U_k=\{i: x_{ik} \leq c_k\}$ and $L_k=\{i: x_{ik} > c_k\}$. Moreover, if $c_k = V_k$, it is equivalent to not splitting, which has been considered with probability $\nu_0$. Therefore, $p(c_k) = \frac{1}{V_k - 1}$. \item If biomarker $k$ is categorical, let $V_k$ denote the number of categories corresponding to biomarker $k$. Let $c_{k}$ denote the elements in one subset $U_k$. The remaining elements are stored in the other subset $L_k$. The $c_k$ are elements of the powerset of $\lbrace 1, 2, \cdots, V_k\rbrace$ without the empty-set or the full set. There are hence $2^{V_k} - 2$ options for $c_k$. Note that the choice of $c_k$ is symmetric: we may flip $c_k$ and its complement, leading to the same partition. Thus, $p(c_k) = \frac{2}{2^{V_k} - 2}$. \end{itemize} In the Supplement A, we describe the detailed split rules using two rounds of splits as an example by taking into account various types of biomarkers. \subsection{Posterior Inference} Markov chain Monte Carlo (MCMC) method is used to obtain the posterior samples of the parameters based on the joint model \eqref{eq:model}. Each iteration of the MCMC simulations consists of the following transition probabilities. Sampling $\theta_{t,m}$ is straightforward due to the use of conjugate priors. For example in the binary outcome case, we can easily compute that $p(\theta_{t,m}\mid \bm{Y}_n, \Pi, \bm{Z}_n) \sim \mathrm{beta}(n_{tm1}+a, n_{tm0}+b)$, where $n_{tmy}=\sum_i I(\bm{x}_i\in S_m, z_i=t, y_i=y)$, $y=0, 1$. In the joint model \eqref{eq:model}, $p(\Pi\mid \bm{c})=1$ since $\bm{c}$ decides the partition $\Pi$ deterministically. Sampling the biomarkers $k$'s that split the patient subsets might change the number of subgroups $M$, leading to the change of the dimension of $\bm{c}$, since we allow to choose not to split. Hence we make use of a two-step Metropolis-Hasting sampler to first update the thresholds $c_k$'s conditional on the selected biomarkers, then update both biomarkers $k$'s and their thresholds $c_k$'s together to ensure fast convergence. We defer the detailed MCMC derivations for all types of outcomes in the Supplement B. \subsection{Subgroup Identification} \label{sec:subgroupidenfication} Since a random distribution is proposed as a prior on the partition, summarizing a distribution over the random partition and then identifying the subgroups with enhanced treatment effects become challenging. Reporting subgroups with enhanced treatment effects hinges on the discovery of regions in the biomarker space in which one treatment outperforms the others. Assume $n$ patients have been treated and their responses have been obtained at the interim analysis. Denote $\mathcal{D}_n=\{\bm{Y}_n, \bm{X}_n, \bm{Z}_n \}$. We define an equally spaced grid of $D_k$ values $\{x_{k1}, \dots, x_{kD_k} \}$ for biomarker $k$ in the biomarker space, then take the Cartesian product of the grids across all $K$ biomarkers to obtain a $K$-dimensional grid $\tilde{\bm{x}}_d$ of size $\prod_kD_k$ points. For example, if biomarker $k$ is continuous on [-1, 1], we can choose $D_k=20$ equally spaced points on [-1, 1]; if biomarker $k$ is binary, then $D_k=2$. Each grid point $d$ represents a possible biomarker profile. For patient $i$ with biomarker profile $\tilde{\bm{x}}_d$, we can compute the posterior predictive distribution of $y_i$ by $$p(y_i\mid z_i=t, \bm{x}_i=\tilde{\bm{x}}_d, \mathcal{D}_n)=\int p(y_i\mid \Theta, z_i=t, \bm{x}_i=\tilde{\bm{x}}_d)p(\Theta\mid \mathcal{D}_n)d\Theta.$$ In the MCMC samples, the $b^{th}$ iteration after burn-in generates a posterior sample $\{ \Theta^{(b)}, \Pi^{(b)}, \bm{c}^{(b)}\}$, which defines a partition set $\Pi^{(b)}=\{ S^{(b)}_1, \dots, S^{(b)}_{M^{(b)}} \}$ and their corresponding response parameters. We can easily calculate the posterior mean response of the patient with biomarker profile $\tilde{\bm{x}}_d$ at iteration $b$ as $\theta^{(b)}_{t, m}$ if $z_i=t$ and $\tilde{\bm{x}}_d\in S^{(b)}_m$, here $B$ is the number of saved MCMC iterations after burn-in. In the motivating AD trial, we assume that $t=1$ represents placebo and $t=2$ represents the investigational drug. The posterior estimated treatment effect for a given subgroup $\Delta$ at iteration $b$ can be represented by $$\delta^{(b)}_{\Delta} = \frac{1}{n_{\Delta}}\sum_{d: \tilde{\bm{x}}_d\in \Delta} (\hat{\theta}^{(b)}_{2, d} - \hat{\theta}^{(b)}_{1, d}),$$ where $n_{\Delta}$ denotes the number of grid points that fall in the subgroup $\Delta$. Denote the posterior probability of treatment effect being larger than LRV for a given subgroup $\Delta$ by $Pr(\delta_{\Delta}\geq \mathrm{LRV})$. We can easily compute $$Pr(\delta_{\Delta}\geq \mathrm{LRV}) = \frac{1}{B}\sum_bI\big[\delta^{(b)}_{\Delta}>\mathrm{LRV}\big], $$ which can be then used for the Go/Stop/Gray zone decision-making described in Section \ref{sec:design}. If the goal is to identify the subgroup of patients whose posterior probability of treatment effect being larger than LRV is bigger than a threshold $\xi$, we can represent such a subgroup as $\{\Delta: Pr(\delta_{\Delta}\geq \mathrm{LRV}) >\xi\}$. \subsection{Simulation Studies on Subgroup Identification} We conducted simulation studies to evaluate the proposed Bayesian random partition (BayRP) model on subgroup identification. We designed simulation scenarios based on the motivating AD trial as described in Section \ref{sec:motivate} and assumed that $K=4$ baseline biomarkers were available for each patient and $p(\nu_k) = 1/5$, $k=0, 1, \dots, 4$, indicating a uniform prior on the biomarker selection. The priors on the parameters in $\bm{c}$ were introduced in supplement A. We considered four scenarios and simulated 100 trials for each scenario. In the motivating AD trial, the first interim analysis will be conducted when 100 subjects have finished Week 12 visit of the study. Therefore, the sample size $n=100$ was set for each scenario to test if BayRP can accurately identify subgroups with enhanced treatment effects. With equal randomization to the placebo or the investigational drug, this would give us approximately 50 per group for the interim analysis. In the first three scenarios, we assumed all the biomarkers were continuous and generated $x_{ik}$ from $\mathrm{Uniform}(-1, 1)$, $i = 1, \dots, n$ and $k=1, \dots, 4$. In \underline{scenario 1}, we assumed only the first biomarker was related to the response and $y_i=0.75 + 0.25I(z_i=2) + 3 I(x_{i1}>-0.4)I(z_i=2) + \epsilon_i$. In \underline{scenario 2}, the first two biomarkers were related to the response and the outcomes $y_i$'s were generated from $y_i=0.75 + 0.25I(z_i=2) + 3 I(x_{i1}< 0.3, x_{i2}>-0.4)I(z_i=2) + \epsilon_i$. In \underline{scenario 3}, we assumed $y_i=0.75 + 0.25I(z_i=2) + 1.5 I(x_{i1}> 0.4)I(z_i=2) + \epsilon_i$. In \underline{scenario 4}, we considered three continuous biomarkers generated from $\mathrm{Uniform}(-1, 1)$ and one binary biomarker generated from $\mathrm{Bernoulli}(0.5)$. The response $y_i$'s were generated from $y_i=0.75 + 0.25I(z_i=2) + 3.5 I(x_{i1}=1, x_{i2}>-0.4)I(z_i=2) + \epsilon_i$. Here $\epsilon_i\sim N(0, 1)$. Define the true effective subgroup as $S^o = \big\{i: [E(y_i\mid z_i=2, \bm{x}_i)-E(y_i\mid z_i=1, \bm{x}_i)] > \mathrm{LRV}\big\}$. In the motivating AD trial, LRV=2.37 was used. The left column of Figure \ref{fig:subgroup} shows the simulated true effective subgroups in blue color for scenarios 1, 2, and 4. Note that we have four biomarkers, but only biomarkers 1 and/or 2 are predictive to responses. Therefore, we plot the true simulated effective subgroup versus biomarkers 1 and 2. Scenario 3 is not shown since there is no effective subgroup. \begin{figure}[h!] \centering \begin{tabular}{cccc} Truth & BayRP& LR &GUIDE\\ \includegraphics[width=.23\textwidth]{./figs/truth1.pdf} & \includegraphics[width=.23\textwidth]{./figs/sim1-1.png}&\includegraphics[width=.23\textwidth]{./figs/lnr2-1.png} & \includegraphics[width=.23\textwidth]{./figs/GUIDE1-1.png} \\ Scenario 1 & Scenario 1& Scenario 1& Scenario 1\\ \includegraphics[width=.23\textwidth]{./figs/truth2.pdf} & \includegraphics[width=.23\textwidth]{./figs/sim2-1.png}&\includegraphics[width=.23\textwidth]{./figs/lnr3-1.png} & \includegraphics[width=.23\textwidth]{./figs/GUIDE2-1.png} \\ Scenario 2 & Scenario 2& Scenario 2& Scenario 2\\ \includegraphics[width=.23\textwidth]{./figs/truth4.pdf} & \includegraphics[width=.23\textwidth]{./figs/simu4_subgroup.pdf}&\includegraphics[width=.23\textwidth]{./figs/lnr4-1.png}&\includegraphics[width=.23\textwidth]{./figs/GUIDE4-1.png} \\ Scenario 4 & Scenario 4& Scenario 4& Scenario 4\\ \end{tabular} \caption{From left to right: true effective subgroups in blue for scenarios 1, 2, and 4; the posterior estimated subgroups represented by grid points in blue under the BayRP, LR, and GUIDE, respectively. } \label{fig:subgroup} \end{figure} We first report the effective subgroup estimated by the proposed Bayesian random partition (BayRP) model. For each simulated trial $h$, $h=1, \dots, 100$, we denote $\delta_d^{h, (b)}=\hat{\theta}^{h, (b)}_{2,d}-\hat{\theta}^{h, (b)}_{1,d}$ to be the posterior estimated treatment effect of grid $d$ with biomarker $\tilde{\bm{x}}_d$ at iteration $b$ in trial $h$. The collection over all the MCMC iterations can be used to report the effective subgroup. Denote $\hat{\delta}_d^{h}$ to be the probability that the treatment effect of the grid $d$ with biomarker $\tilde{\bm{x}}_d$ is larger than LRV in trial $h$. Given a desired confidence $\xi$, we determine that the grid $d$ with biomarker $\tilde{\bm{x}}_d$ belongs to the effective subgroup in trial $h$ if \begin{eqnarray} \hat{\delta}_d^{h}=\frac{1}{B}\sum_bI(\delta_d^{h, (b)}\geq \mathrm{LRV})>\xi. \label{eq:sub} \end{eqnarray} Here we set $\xi=0.9$. Then we define the estimated effective subgroup $\hat{\Delta}_{\mathrm{BayRP}}$ under BayRP as the set of subjects whose posterior probability of the treatment effect being larger than LRV are bigger than 0.9, which can be computed as \begin{eqnarray} \hat{\Delta}_{\mathrm{BayRP}} = \Big\{d: \frac{1}{100}\sum_{h=1}^{100}I(\hat{\delta}_d^{h}> \xi)>0.9\Big\}. \label{eq:ASIED} \end{eqnarray} That means, the estimated effective subgroup under repeated simulations by BayRP is a set of subjects who belong to the effective subgroup in at least 90\% of the simulated trials. BayRP correctly identifies biomarkers 1 and 2 as important predictive biomarkers in all scenarios. The second column of Figure \ref{fig:subgroup} shows the estimated effective subgroup $\hat{\Delta}_{\mathrm{BayRP}}$ versus biomarkers 1 and 2, represented by the grid points in blue for scenarios 1, 2, and 4. As shown in Figure \ref{fig:subgroup}, the effective subgroups identified by the BayRP successfully recover the simulation truth. Scenario 3 is a NULL case, there is no effective subgroup. The BayRP identified $\hat{\Delta}_{\mathrm{BayRP}}=\emptyset$, which matches the simulation truth. For comparison, we implemented two alternative methods on subgroup identification for each simulated trial: a Bayesian linear regression (LR) method and GUIDE \citep{loh2015regression}. Under the LR method, the outcomes were modeled as a Bayesian linear regression considering all main effects and interaction effects between treatments and biomarkers: $$y_i\mid z_i, \bm{x}_i = \beta_0 + \beta_1z_i + \bm{\alpha} \bm{x}_i + \bm{\gamma} z_i \bm{x}_i + \epsilon_i,$$ where $\epsilon_i\stackrel{iid}{\sim} N(0, \sigma^2)$. We assumed non-informative conjugate priors, $1/\sigma^2\sim \mathrm{Gamma}(0.1, 0.1)$ and $(\beta_0, \beta_1, \bm{\alpha}, \bm{\gamma})\sim MN(0, 20{\bm I})$, where $\mathrm{Gamma}(a, b)$ denotes a gamma distribution with mean $a/b$, $MN(\bm{\mu}, \Sigma)$ denotes a multivariate normal distribution with mean $\bm{\mu}$ and covariance $\Sigma$, and ${\bm I}$ denotes the identity matrix. The posterior samples were obtained by a Gibbs sampling procedure. Since LR did not provide a formal way to report the effective subgroup under repeated simulations, we estimated the effective subgroup under LR following \eqref{eq:ASIED} under BayRP for a fair comparison. Specifically, we calculated the treatment effect $q_d^{h, (b)}$ for each grid $d$ with biomarker $\bm{x}_d$ at MCMC iteration $b$ in trial $h$ using the predicted values of LR under two treatments, that is $q_d^{h, (b)}=E^{h, (b)}(y_d\mid z_d=2, \bm{x}_d) - E^{h, (b)}(y_d\mid z_d=1, \bm{x}_d)$. We determined that the grid $d$ with biomarker $\tilde{\bm{x}}_d$ belonged to the effective subgroup in trial $h$ if $\frac{1}{B}\sum_bI(q_d^{h, (b)}\geq \mathrm{LRV})>\xi.$ Similar to \eqref{eq:ASIED}, we then defined the estimated effective subgroup $\hat{\Delta}_{\mathrm{LR}}$ under LR as a collection of subjects who belong to the effective subgroup in at least 90\% of the simulated trials. Under the GUIDE method, we downloaded GUIDE software (\url{http://www.stat.wisc.edu/~loh/guide.html}, version 27.3) and applied the ``Gi" algorithm with the default parameter setting to construct 0-SE least-square regression tree. All biomarkers as well as the treatment assignments were used to construct the tree. We ran GUIDE to the simulated datasets and defined the effective subgroup as the set of subjects among all grid points whose predictive treatment effects are larger than LRV. Then $\hat{\Delta}_{\mathrm{GUIDE}}$ under GUIDE can be estimated in the same way as $\hat{\Delta}_{\mathrm{LR}}$. For the null scenario 3, both LR method and GUIDE successfully recover the simulated truth, $\hat{\Delta}_{\mathrm{LR}}=\hat{\Delta}_{\mathrm{GUIDE}}=\emptyset$. The third and fourth columns of Figure \ref{fig:subgroup} plot the estimated effective subgroup by the LR method and GUIDE in scenarios 1, 2, and 4, respectively. We can clearly see that LR cannot recover the simulated truths in these three scenarios when an effective subgroup exists. In contrast, the effective subgroups estimated by GUIDE have a large overlap with the simulated truths in scenarios 1 and 2, comparable to BayRP. However, in scenario 4 where there is one binary predictive biomarker (i.e., biomarker 1) and one continuous predictive biomarker (i.e., biomarker 2), GUIDE cannot identify any effective subgroup. In addition, we report the true positive rate (TPR) and true negative rate (TNR) of the effective subgroup finding under BayRP, LR, and GUIDE. We define two quantities: 1) TPR = $\sum_{\{d: \bm{x}_d\in S^o\}} \sum_{h=1}^{100} I (\bm{x}_d\in \hat{\Delta})/(|S^o|\times 100)$, where $|S^o|$ is the number of grid points in the simulated true effective subgroup; 2) TNR = $\sum_{\{d: \bm{x}_d\notin S^o\}} \sum_{h=1}^{100} I (\bm{x}_d\notin \hat{\Delta})/(|\Omega \setminus S^o|\times 100)$. As shown in Table \ref{table:sub}, all three methods achieve high TNR, but the BayRP achieves much higher TPR compared to both the LR method and GUIDE, especially for scenario 4 where TPR is 0.87 for BayRP and 0 for either LR or GUIDE. Scenario 3 is not included since there is no effective subgroup. \begin{table}[h] \centering \begin{tabular}{c|ccc|ccc} \hline &&TPR&&&TNR\\ \hline Scenario&BayRP &LR&GUIDE&BayRP&LR&GUIDE\\ \hline 1&0.97&0.54&0.95&1.00&1.00&0.99 \\ 2&0.96&0.38&0.89&0.92&0.98&0.89 \\ 4&0.87&0.00&0.00&1.00&1.00& 0.98 \\ \hline \end{tabular} \caption{The true positive rate (TPR) and true negative rate (TNR) of the subgroup finding under BayRP, LR, and GUIDE.} \label{table:sub} \end{table} In summary, the proposed BayRP can accurately identify the predictive biomarkers and the subgroup with enhanced treatment effect, building a solid foundation for the ASIED trial design. Note that the subgroup identification model is independent of the adaptive enrichment decision framework proposed in Section \ref{sec:design}, and any subgroup identification model such as random forest, SUBA, or BART could be implemented to the decision-making framework of the proposed ASIED. This makes ASIED a flexible adaptive enrichment design that combines the tasks of ``subgroup identification" and ``enrichment." We choose BayRP since it is a robust Bayesian tree model but yields satisfactory performance when the sample size is small, unlike other complex models requiring large sample sizes for accurate estimation, such as SCUBA. \section{ASIED Operating Characteristics} \label{sec:oc} In this section, we evaluate the performance of the proposed ASIED design on trial operating characteristics via simulation studies. In each trial, the maximum sample size was $N=180$ and subjects were equally randomized to the placebo or the investigational drug. We set LRV=2.37 and TV=3.08, following the rationale provided in the motivating AD trial. The first interim analysis would be conducted after $n_1=100$ patients were enrolled. If a second interim analysis is needed, $n_2=40$. We assumed that $K=4$ biomarkers were available for each patient and $p(\nu_k)=1/5$, $k=0, \dots, 4$, indicating a uniform prior on the biomarker selection in the proposed BayRP on subgroup identification. The decision-making framework depends on the parameters $\xi_1$ and $\xi_2$, which defines decisions ``Go", ``Stop", and ``Gray zone." A practical implementation of the proposed design should consider what would be acceptable decision risks to determine the tuning parameters $\xi_1$ and $\xi_2$. To this purpose, we define three acceptable risks at the first interim analysis: false stop risk (FSR), false go risk (FGR), and false enrich risk (FER). FSR is an acceptable risk that a ``Stop" decision is made at the first interim analysis when the truth is that there exists an effective subgroup or the all-comer is effective. FGR is an acceptable risk that a ``Go" or ``Gray zone" decision is made when the truth is that there is no effect in all-comers or in any subgroup. FER is an acceptable risk that an effective subgroup is enriched at the first interim analysis when the truth is that all-comers are effective. These risks could differ for different drugs and with the attitude to risk for different companies. In our case design, we set FSR=0.05, FGR=0.1, and FER=0.15. Note these values can be changed, as long as they can be justified. To evaluate the performance of ASIED in operating characteristics, we assumed that all the biomarkers were continuous and generated from $\mathrm{Uniform}(-1, 1)$. The responses $y_i$'s were generated from $y_i=0.75 + \beta_0I(z_i=2) + \beta_1 I(x_{i1}>-0.4)I(z_i=2) + \epsilon_i$, where $\epsilon_i\sim N(0, 0.5^2)$. Here different values of $\beta_0$ and $\beta_1$ were selected to generate different scenarios. For example, when $\beta_0=0.25$ and $\beta_1=2.55$, there exists an effective subgroup $\Delta=\{i: x_{i1}>-0.4\}$ whose treatment effect is larger than LRV but smaller than TV. We considered five scenarios, as shown in Table \ref{table:truth}. \begin{table}[h] \centering \begin{tabular}{cccc} \hline Scenario & $\beta_0$&$\beta_1$&Truth\\ \hline 1&$0.25$ & 2 &no effective subgroup\\ 2&$0.25$ & 2.55 &effective subgroup($>$LRV, $<$TV)\\ 3&$0.25$ & 2.83 &effective subgroup ($=$TV)\\ 4&$2.6$ & 0 &effective all-comers ($>$LRV, $<$TV)\\ 5& 3.08 & 0 &effective all-comers ($=$TV)\\ \hline \end{tabular} \caption{The simulation truths by different values of $\beta_0$ and $\beta_1$.} \label{table:truth} \end{table} \noindent{\bf Determining $\xi_1$ and $\xi_2$. } We first implemented ASIED design to the five scenarios at the first interim analysis to determine $\xi_1$ and $\xi_2$ by controlling FSR, FGR, and FER. Table S1 in Supplement C presents the sensitivity analysis of the decisions for different combination values of $\xi_1$ and $\xi_2$. With the guidance of the three pre-determined risks, we set $\xi_1=0.8$ and $\xi_2=0.1$. More details are discussed in Supplement C. \noindent{\bf Sensitivity analysis to sample size at the first interim analysis. } To investigate the impact of sample size at the first interim on the decision-making, we plot the estimated probabilities of different decisions versus different sample sizes at the first interim analysis for all five scenarios in Figure \ref{fig:sen_ss}. As shown in Figure \ref{fig:sen_ss}, the sample size $n_1=100$ at the first interim analysis yields satisfactory decision outcomes. For instance, when there exists an effective subgroup (scenario 2), the probability of continuing the trial with an enriched subpopulation increases as the sample size increases. \begin{figure}[htbp] \centering \begin{tabular}{ccc} \includegraphics[width=.33\textwidth,page=1]{./figs/sensitivity_ss} & \includegraphics[width=.33\textwidth,page=2]{./figs/sensitivity_ss} & \includegraphics[width=.33\textwidth,page=3]{./figs/sensitivity_ss} \\ (a) Scenario 1 & (b) Scenario 2& (b) Scenario 3\\ \end{tabular} \begin{tabular}{cc} \includegraphics[width=.33\textwidth,page=4]{./figs/sensitivity_ss} & \includegraphics[width=.33\textwidth,page=5]{./figs/sensitivity_ss} \\ (c) Scenario 4 & (d) Scenario 5\\ \end{tabular} \caption{Sensitivity analysis of the estimated probabilities of different decision outcomes at the first interim versus sample sizes. Pr(All) denotes the probability of continuing the trial with original population until the end of the trial. Pr(Sub) denotes the probability of continuing the trial with an enriched subpopulation until the end of the trial. Pr(EarS) denotes the probability of stopping the trial due to futility. Pr(2All) denotes the probability of continuing the trial with original population and plan a second interim analysis. Pr(2Sub) denotes the probability of continuing the trial with an enriched subpopulation and plan a second interim analysis. All probabilities are with respect to 100 repeated simulations.} \label{fig:sen_ss} \end{figure} \noindent{\bf Operating characteristics. } Now we are ready to evaluate the performance of ASIED trial design in terms of operating characteristics. As described in Section \ref{sec:design}, ASIED has three possible final recommendations, with $a = 2$ denoting a recommendation of investigational drug for all-comers; $a = 1$ denoting a recommendation of investigational drug for a subgroup; and $a = 0$ denoting no recommendation for investigational drug. If the trial is stopped early due to futility, ASIED records the terminal decision $a = 0$. We implemented the ASIED to the five scenarios shown in Table \ref{table:truth}. Table \ref{table:op} reports the probabilities of the five interim decisions and three final Go/Stop recommendations for each scenario under 100 repeated simulations. As shown in Table \ref{table:op}, ASIED achieves desirable operating characteristics. For example, when $\beta_0=0.25, \beta_1=2.55$, we recommend the investigational drug for an effective subgroup with probability 0.96 and recommend stop for the drug with probability 0.04; when $\beta_0=0.25$ and $\beta_1$ increases to 2.83, we recommend the investigational drug for an effective subgroup with probability 0.94 and for all-comers with probability 0.06. \begin{table}[h] \centering {\small \begin{tabular}{ccccccc} \hline &&&&Interim Analysis &\\ Scenario&Truth&Pr(All)&Pr(Sub)&Pr(EarS)&Pr(2All)&Pr(2Sub)\\ \hline 1 & no effective subgroup & 0 &0.01&{\bf 0.99}&0&0\\ 2 & effective subgroup ($>$LRV, $<$TV) &0&{\bf 0.96}&0.04&0&0\\ 3 & effective subgroup ($=$TV)&0.1&{\bf 0.9}&0&0&0\\ 4 & effective all-comers ($>$LRV, $<$TV)&{\bf 0.95}&0&0.05&0&0\\ 5 & effective all-comers ($=$TV)&{\bf 1}&0&0&0&0\\ \hline \end{tabular} \begin{tabular}{ccccc} \hline &&&Final Recommendation of Go/Stop\\ Scenario&Truth&Pr($a$=2)&Pr($a$=1)&Pr($a$=0)\\ \hline 1 & no effective subgroup& 0&0&{\bf 1}\\ 2 & effective subgroup ($>$LRV, $<$TV) &0&{\bf 0.96}&0.04\\ 3 & effective subgroup ($=$TV)&0.06&{\bf 0.94}&0\\ 4 & effective all-comers ($>$LRV, $<$TV)&{\bf 0.95}&0&0.05\\ 5 & effective all-comers ($=$TV)&{\bf 1}&0&0\\ \hline \end{tabular} } \caption{The operating characteristics of ASIED. } \label{table:op} \end{table} \section{Conclusion} \label{sec:con} We develop a Bayesian random partition (BayRP) model to search for subgroups with enhanced treatment effect and a novel enrichment design, ASIED, with a robust decision-making framework that either allows the study to continue with all-comers or adapt to a subpopulation with enhanced treatment effect based on the interim accumulated data. BayRP is fully Bayesian, providing principled and coherent inference on the effective subgroup identification. As shown in the simulation studies, BayRP is flexible and capable of recovering the effective subgroups with various types of biomarkers. The rule for effective subgroup report is also flexible, as we can tune the confidence level $\xi$ in \eqref{eq:sub} depending on the goal of the study. More importantly, to the best of our knowledge, ASIED represents the first attempt in the literature to create a set of comprehensive rules to guide enrichment decisions at interim in the framework where a multilevel target profile (LRV and TV) is incorporated. The merit of using inferred treatment effect and probability statement to make enrichment decisions at interim or decisions about the drug's next step development at final is that not only the estimated treatment effect but also the associated variability are taken into consideration in the decision making. Simulation studies with sensitivity analyses show that ASIED achieves desirable operating characteristics. The decision-making criteria proposed in this paper can be tailored based on users' risk tolerance. For example, users can calibrate the hyperparameters $\xi_1$ and $\xi_2$ by their own preferences on risks such as false go risk, false stop risk, etc. This is critical to precision medicine. There are several potential extensions. First, functionality of BayRP can be extended to include an algorithm that can reduce the dimension of the covariate space. This will make the subgroup identification more powerful and efficient when a large number of potential predictive biomarkers are available. Second, we can expand BayRP to cover various types of outcomes. For example, for survival outcomes we only need to change the sampling model $p(y\mid z_i, \Theta, \Pi)$. Lastly, we can extend the ASIED to accommodate missing responses and delayed responses in the case of having an outcome that takes a relatively long time to be observed. \section*{Acknowledgement} This work is funded by the MedImmune L.L.C. and Johns Hopkins University collaboration project. We thank Prof. Constantine Frangakis for his useful discussion on the enrichment design. \bibliographystyle{biom}
{'timestamp': '2019-02-26T02:24:22', 'yymm': '1810', 'arxiv_id': '1810.02285', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02285'}
arxiv
\section{Examples}\label{s:examples} The folder \mypath{./exmaples} contains scripts to illiustrate the workflow that is required to handle simulated and real experimenal data with the \textit{SiMRX} toolbox. It make use of the provided setups presented in section \ref{ss:examplesetups}. \begin{enumerate} \item \texttt{ExampleA.m} loads the \emph{'default2D'} setup and a eligible config file (see section \ref{subs:sytheticdataset}) and simulates the corresponding system matrix. \item \texttt{ExampleB.m} loads the \emph{'default3D'} setup and a eligible config file (see section \ref{subs:sytheticdataset}) and stores the simulated system in the raw data format (see section \ref{sss:rawExIm}). Finally the raw data is imported and combined to a proper system matrix. \item \texttt{ExampleC.m} loads the \emph{'realistic3D'} setup and a eligible config file (see section \ref{subs:loadext}). Then measured data are loaded, defective sensors are removed and the measured data is compared to a simulated measurement. With this example, data from real experiment can be processed. \end{enumerate} \section{Features}\label{sec:features} The \textit{SiMRX} toolbox is separated in the following submodules (each in its own subfolder): \begin{mymarginbox} \begin{tabular}{@{}L{\textwidth}@{}}% \mypath{./configuration}\\ \mypath{./simulation}\\ \mypath{./phantom}\\ \mypath{./visualization} \end{tabular} \end{mymarginbox} We give a short overview of each module in the following sections. For all provided functions, in detail information of syntax and features are available in each file header. This documentation is also available using the MATLAB help function (F1). \subsection{Configuration}\label{ss:config} \begin{figure}[t] \begin{mymarginbox} \begin{lstfloat}[H] \lstinputlisting[style=matstyle]{code/setup.m} \caption[2D setup]{Create a new 2D setup} \label{code:2Dsetup} \end{lstfloat} \end{mymarginbox} \end{figure} \begin{figure}[t] \begin{mymarginbox} \begin{lstfloat}[H] \lstinputlisting[style=matstyle]{code/config.m} \caption[2D config]{Create a new 2D config} \label{code:2Dconfig} \end{lstfloat} \end{mymarginbox} \end{figure} This module provides a set of functions to create \texttt{setup} and \texttt{config} files. \paragraph{Conventions for 2D configurations:}\label{para:config} \textit{SiMRX} supports 2D and 3D systems. However, at its core, the toolbox is designed for 3D simulations. Therefore 2D setups are implemented as 3D setups with the following variances: \begin{itemize} \item all entities are on the same z-layer (z=0 recommended) \item the region of interest in z direction is set accordingly (\texttt{setup.roi.z = [0,0]} recommended) \item the voxel resolution \texttt{config.res} in z direction is set to 1, e.g. \texttt{config.res = [x,y,1]}; \item coils \emph{must be} represented as dipole magnets to be in line with section \ref{ss:coilDiscretization}. This means that \texttt{coils.Segments} will be ignored, regardless of availability. \end{itemize} Also consider the provided 2D and 3D setups as part of \textit{SiMRX} (see section \ref{subs:sytheticdataset}). \subsubsection{Setup file}\label{sss:setup} In MATLAB a \texttt{setup} file is represented as struct. It holds the following fields \begin{mymarginbox} \begin{tabular}{@{}L{0.15\textwidth}@{}L{0.15\textwidth}@{}L{0.15\textwidth}@{}L{0.15\textwidth}@{}}% \texttt{dim},&\texttt{roi},&\texttt{coils},& and \texttt{sensors}. \end{tabular} \end{mymarginbox} Determined by the dimension of the system, \texttt{setup.dim} is either 2 or 3. The region of interest \texttt{setup.roi} is a struct with fields \texttt{x}, \texttt{y} and \texttt{z}, that holds boundary information in an array with unit meter $\left[\si{m}\right]$. For instance \texttt{setup.roi.x = [0,0.1]} translates to a region of interest of $10\si{cm}$ length in x direction. Yet again \texttt{setup.coils} and \texttt{setup.sensors} are arrays of structs with fields: \begin{mymarginbox}% \begin{tabular}{@{}L{0.30\textwidth}@{}L{0.30\textwidth}@{}}% \texttt{coils(i).Position},&\texttt{sensors(i).Position},\\ \texttt{coils(i).Normal},&\texttt{sensors(i).Normal},\\ \texttt{coils(i).Segments}, \end{tabular} \end{mymarginbox} where $i$ is the $i$-th coil/sensor. As mentioned before, spatial information (in this case the fields \texttt{Position} and \texttt{Normal}) are given as a three element vector with base unit meter $\left[\si{m}\right]$. The function \texttt{createEntityArray.m} is used to create new coil and sensor entries. In the current version the function takes two outer points, a normal and the number of intermediate points. Then \texttt{createEntityArray.m} returns a list of equidistant points, that represent the entity position, as well as the respective normal. In the 3D case the coil wire is modeled by a list of points, which represent the coil shape. The function \texttt{createCoilLoop.m} creates a coil template, which has to be copied in every coil position. The function \texttt{parseCoils.m} receives a coil struct (with fields \texttt{Position} and \texttt{Normal}) and adds the \texttt{Segments} field in respect to the given coil template. Internally this uses the function \texttt{relocateStructure.m} that reorientates a given list of points. In case a predefined voxel grid is given, the corresponding region of interest can be determined using \texttt{getROI.m}. During the creation of a new \texttt{setup} the usage of \texttt{visualizeSetup.m} is recommended. The script in Listing \ref{code:2Dsetup} can be used to create the \texttt{setup} file for the 2D system shown in Figure \ref{im:vis}. Please also examine the examples given in section \ref{ss:examplesetups}, that make use of the described functionalities. \subsubsection{Config file}\label{sss:config} \texttt{config} files are, similar to \texttt{setup} files, structs in MATLAB. They hold the fields \begin{mymarginbox} \begin{tabular}{@{}L{0.15\textwidth}@{}L{0.30\textwidth}@{}L{0.30\textwidth}@{}L{0.25\textwidth}@{}}% \texttt{res},&\texttt{currentPattern},&\texttt{activeCoils},&and \texttt{activeSensors}. \end{tabular} \end{mymarginbox} The simulated voxel resolution of the region of interest is given by a three element array and stored in \texttt{res}. A setup may contain a lot of coils/sensors that are not used in a specific configuration. To optimize the simulation speed \texttt{activeCoils} and \texttt{activeSensors} are lists of coil and sensor ids, that define the subset of active setup parts. The coil current sequence is stored in a matrix with one column for each active coil. Each row represents one pattern, where the entries refer to the applied current at the respective coil. The function \texttt{createCurrentPattern.m} provides standard patterns and multiple other presets. The script in Listing \ref{code:2Dconfig} can be used to create a \texttt{config} file for the 2D system shown in Figure \ref{im:vis}. Again please examine the examples given in Section \ref{ss:examplesetups}, that make use of the described functionalities. \subsubsection{Setup and Config Validation}\label{sss:scvalid} This toolbox also contain functions to check the created \texttt{setup} and \texttt{config}. The functions \texttt{isConfigValid.m} and \texttt{isSetupValid.m} validate if all required fields are set and further include checks for data inconsistencies. Additionally the function \texttt{checkCompatibility.m} checks if a given \texttt{config} is applicable for a given \texttt{setup}. \subsubsection{Save and Load} The \texttt{setup} and \texttt{config} datasets can be stored using \texttt{saveSetup.m} and \texttt{saveConfig.m}. These are stored using a custom \texttt{.mrxsetup} and \texttt{.mrxcfg} extension, that is based on the MATLAB internal \texttt{.mat} file format. Corresponding load functions (\texttt{loadSetup.m} and \texttt{loadConfig.m}) are available. To store the created \texttt{setup} and \texttt{config} datasets, we recommend using the folder structure proposed in section \ref{ss:setupfolderstructure}. \subsection{Simulation} \label{ssec:simulation} \begin{figure}[t] \begin{mymarginbox} \includegraphics[width=\textwidth]{images/systemmatrix} \end{mymarginbox} \caption{Schematics of the system matrix creation workflow. Variables are marked with a rounded corner box, functions are marked with a gray box. The variable usage is color coded: green (dashed) as input and red (solid) as output argument.} \label{im:systemmatrix} \end{figure} The simulation module is the core element of the toolbox. All necessary files can be found in the folder \mypath{./simulation}. The main script is provided by the file \texttt{createSystemMatrix.m}. It processes a given MRX setup and configuration into a linear operator, namely a matrix \texttt{A}. A valid \texttt{setup} file is required, that provides information about dimension, region of interest, coil position/orientation and sensor position/orientation. Furthermore voxel/pixel resolution, lists of active coils and sensors as well as coil current patterns are provided by a \texttt{config} file. See section \ref{sss:scvalid} for tools to validate the setup and config pair. Then \texttt{createSystemMatrix.m} internally calls the functions \texttt{createSystemMatrixRaw.m} and subsequently \texttt{applyCurrentPattern.m}. The internal processes, variables and function arguments are illustrated in Figure \ref{im:systemmatrix}. At first, \texttt{createSystemMatrixRaw.m} calls \texttt{createVoxelGrid.m}, which creates a valid \texttt{voxelGrid}. This voxel grid combines the desired resolution (\texttt{config.res}) within the demanded region of interest (\texttt{setup.roi}). Then \texttt{createExcitationFields.m} is called to calculate the magnetic fields, that are induced by an active coil with a uniform current. Internally the field calculation, hence the choice of the used mathematical model (see section \ref{ss:coilDiscretization}), depends on the existence of \texttt{coils.Segments}. The magnetic fields are derived on the provided \texttt{voxelgrid} and then stored for each coil individually. Finally \texttt{createRelaxationFields.m} translates the fields present on the voxel grid into the magnetic response, which is acquired by the sensors (\texttt{setup.sensors}), for each coil separately in a temporary system matrix \texttt{ARaw}. The set of operators \texttt{ARaw} is finally returned by \texttt{createSystemMatrixRaw.m}. To this point only uniform coil activation currents are used. Due to the linearity of the forward operator, we can apply any coil current sequence by using \texttt{applyCurrentPattern.m}. This derives a linear combination of the temporary system matrices \texttt{ARaw} and creates a linear operator \texttt{A}. \subsubsection{Raw export/import}\label{sss:rawExIm} In general the simulation of the setup is the most time demanding step. It is possible to dump the dataset \texttt{ARaw} into file, which allows for flexible experimentation with varying coil currents. However this is not very suitable in case the set of active coils or sensors changes, since \texttt{ARaw} contains a fixed set of coils. The function \texttt{exportRawSetup.m} allows for in batch export of single coil and sensor data. This allows for flexible import of any coil/sensor combination without reevaluating the system, using the function \texttt{importRawSetup.m}. Internally the simulation steps done in \texttt{exportRawSetup.m} are equivalent to those steps done by \texttt{createSystemMatrixRaw.m}. A working example (\texttt{ExampleB.m}) is presented in section \ref{s:examples}. \subsection{Phantom}\label{ss:phantom} \begin{figure}[t]% \begin{mymarginbox} \includegraphics[width=\textwidth]{images/phantoms} \end{mymarginbox} \caption{Selection of available 3D phantoms with a resolution of $[50,50,15]$. One phantom per row, each column represents a layer. Layers $1, 2, 14$ and $15$ are cut from illustration, due to clarity. Phantom names from top to bottom: \texttt{'F\_2'},\texttt{'shepplogan3d'},\texttt{'tumor'} and \texttt{'fwhmdots\_0.25'}.} \label{im:phantom} \end{figure} The function \texttt{createPhantom.m} provides multiple phantom options, including phantoms suited for reconstruction or resolution tests. \texttt{createPhantom.m} uses the function \texttt{phantom3.m}, which is a 3D reimplementation of the MATLAB given phantom function and able to generate 3D phantoms that are composed of multiple ellipses. For all available phantoms, please check the help section of \texttt{createPhantom.m} and \texttt{phantom3.m}. See Figure \ref{im:phantom} for a selection of the available phantoms. \subsection{Visualization}\label{ss:vis} \begin{figure}[p] \begin{mymarginbox} \includegraphics[width=\textwidth]{images/vis} \end{mymarginbox} \caption{Visualization of the setups \emph{'default2D'} (left column), \emph{'default3D'} (center column) and \emph{'realistic3D'} (right column). From top to bottom: visualization using \texttt{visualizeSetup.m}, \texttt{visualizeCoilFields.m} and \texttt{visualizeVolume.m}. Setups \emph{'default2D'} and \emph{'default3D'} are shown with phantom \texttt{'F\_2'}, setup \emph{'realistic3D'} is shown with phantom \texttt{'P\_1'}. Activation coils are colored magenta, sensors are colored red and (normalized) magnetic field lines are colored blue.} \label{im:vis} \end{figure} \textit{SiMRX} provides tools to visualize the region of interest (\texttt{drawROI.m}), coils (\texttt{drawCoils.m}), sensors (\texttt{drawSensors.m}), magnetic fields (\texttt{drawFields.m}) and 3D phantoms as cuttable volume (\texttt{drawVolume.m}). The toolbox also contains visualization functions that combine these base functions to useful tools: The function \texttt{visualizeSetup.m} draws coils, sensors and the region of interest by passing a \texttt{setup} dataset. We recommend the usage during the creation of a new MRX setup, since it uses only the \texttt{setup} file and does not require the simulation of a given setup. The function \texttt{compareSetups.m} is able to visually compare two setups side by side. The function \texttt{visualizeCoilFields.m} provides a tool to visualize the magnetic fields induced by the activation coils. It uses the magnetic fields as an input argument, that are created by \texttt{createExcitationFields.m} during the simulation process. A scroll functionality is available to seamlessly scroll through each coil activation and current pattern respectively. A toggle between single 'coil mode' and 'current pattern mode' as well as a toggle between plotting normalized and unnormailzed fields is available. Finally \texttt{visualizeVolume.m} provides a visualization of the phantom within the corresponding setup. In the 3D case, a scroll functionality is available to cut through the volume to provide a clear view of the inner layers. Figure \ref{im:vis} shows \texttt{visualizeSetup.m} and \texttt{visualizeCoilFields.m} in a 2D and 3D example. The code of the 2D example is shown in Listing \ref{code:2Dsetup}. \section{Introduction} Many new and experimental treatment methods in medical applications use magnetic nanoparticles as a contrast agent. These particles allow for multiple different approaches (\cite{hiergeist1999ApplicationMagnetiteFerrofluids, alexiou2011CancerTherapyDrug}), however for the named methods the exact knowledge about the particle distribution is crucial. Here, Magnetorelaxometry (MRX) can be used to determine the amount of particles in a region of interest as shown in \cite{baumgarten2008MagneticNanoparticleImaging, liebl2014QuantitativeImagingMagnetic}. Based on this approach an imaging technique called Magnetorelaxometry Imaging (MRXI) has been proposed. The \textit{SiMRX} toolbox provides a set of tools to model and simulate such an MRX system. It is based on the mathematical model developed in \cite{focke2018InverseProblemMagnetorelaxometry}. \subsection{Model} This following section (including notation) is part of \cite{focke2018InverseProblemMagnetorelaxometry}, which, for interested readers, provides an in depth look in the analysis of the following operator. The magnetic field in $w\in\Omega$ induced by a coil $\alpha = (\varphi_\alpha, I_\alpha)$ is given by \begin{equation} \mathbf{B}_\alpha^\textbf{coil}\colon\Omega \rightarrow\mathbb{R}^3, \quad w \mapsto\vartheta\int\limits_0^{L_\alpha}\varphi_\alpha^\prime(s)\times\left(\frac{w-\varphi_\alpha(s)}{\left\vert w-\varphi_\alpha(s)\right\vert^3}\right)ds,\label{eq:biotsavart} \end{equation} where ${L_\alpha}$ is the length of the coil. The magnetization of the magnetic nanoparticles (MNP) after the reorientation process in $w$ is described by \begin{equation} \mathbf{m}_\alpha\colon \Omega\rightarrow\mathbb{R}^3, \quad w \mapsto\frac{1}3 \mathbf{B}_\alpha^\textbf{coil}(w)c(w),\label{eq:dipolemagnetization} \end{equation} where $c$ is the desired particle distribution. The particle induced magnetic response from particles in $w$ measured by a sensor $\sigma = (\sigma_x, \sigma_n)$ is modeled by \begin{align} \mathbf{B}^\textbf{meas}_\alpha\colon\Omega\times\Sigma&\rightarrow\mathbb{R}\nonumber\\ \left(w,\sigma\right)&\mapsto\sigma_n\cdot\left(\left(\frac{3\left(\sigma_x-w\right)\otimes\left(\sigma_x-w\right)}{\left\vert\sigma_x-w\right\vert^5}-\frac{\mathbb{I}}{\left\vert\sigma_x-w\right\vert^3}\right)\mathbf{B}_\alpha^\textbf{coil}(w)\right).\label{eq:measmagnetization} \end{align} In the end we receive the following forward operator for a coil $\alpha$: \begin{equation} \mathbf{K}_\alpha\colon\mathcal{L}^2(\Omega) \rightarrow\mathcal{L}^2(\Sigma), \quad c \mapsto\left[\sigma\mapsto\int\limits_\Omega\mathbf{B}^\textbf{meas}_\alpha(w, \sigma)\ c(w) d^3w\right].\label{eq:fredholmformulation} \end{equation} \subsection{Discretization}\label{ss:coilDiscretization} First we consider the 3D case: Here the conductor coil $\varphi_\alpha$ is approximated by a set list of segments, with starting points $a_k$ and ending points $b_k$ for the $k$-th segment respectively. Then the magnetic field in $w\in\Omega$ is \cite{hanson2002CompactExpressionsBiot}: \begin{align} \mathbf{B}_{\alpha,k}^\textbf{coil}\colon\Omega&\rightarrow\mathbb{R}^3\label{eq:discreteActivation}\nonumber\\ w&\mapsto\vartheta\frac{\vert a_k-w\vert+\vert b_k-w\vert}{\vert a_k-w\vert\vert b_k-w\vert}\frac{(a_k-w)\times(b_k-w)}{\vert a_k-w\vert\vert b_k-w\vert+(a_k-w)\cdot(b_k-w)}. \end{align} The MNP response (see equation \eqref{eq:measmagnetization}) still holds in the discrete case. In the 2D case a coil simplification leads to the usage of variants of \eqref{eq:measmagnetization} for both coil and dipole response (see \cite[section 4.2]{focke2018InverseProblemMagnetorelaxometry}). \section{Remarks} This simulation toolbox does not guarantee its correctness and closeness to reality. \textit{SiMRX} is not qualified for commercial usage. \section{Setups}\label{s:setups} \begin{figure}[t] \begin{mymarginbox} \begin{lstfloat}[H] \begin{verbatim} setups/ // setups base folder ┣━━ default2D/ // a specific setup ┃ ┣━━ README.m // additional information and script ┃ ┣━━ default.mrxsetup // mrxsetup file of this setup ┃ ┣━━ configs/ // contains all configs for this setup ┃ ┃ ┣━━ <resolution>/ // unique folder for each resolution ┃ ┃ ┣━━ 10.10.1/ // example resolution [10,10,1] ┃ ┃ : ┣━━ <config name>/ // unique folder for each config ┃ ┃ : ┣━━ singleSequential/ // example config 'singleSequential' ┃ ┃ : ┣━━ default.mrxcfg // mrxcfg file of this config ┃ ┃ ┗━━ results/ // results for this setup/config/res ┃ ┣━━ raw/ // raw data (via exportRawSetup.m) ┃ ┗━━ scripts/ // scripts to create this config/setup ┃ ┣━━ createSetup.m // create *.mrxsetup file ┃ ┣━━ createConfigs.m // create *.mrxcfg in folder 'configs' ┃ : ┃ ┣━━ <my setup>/ // my new setup ┃ : : \end{verbatim} \caption[Setup folder structure]{Proposed setup folder structure, shown for included setup \emph{'default2D'}} \label{code:folderStructure} \end{lstfloat} \end{mymarginbox} \end{figure}% \begin{table}[t] \begin{mymarginbox} \begin{subtable}{\textwidth} \begin{tabular}[t]{c||c|c|c|c|c|c|c|c|c}% &\texttt{x[m]}&\texttt{y[m]}&\texttt{z[m]}&\texttt{n$_x$}&\texttt{n$_y$}&\texttt{n$_z$}&\texttt{SensorID}&\texttt{ChannelID}&\texttt{GroupID}\\ \hline Sensor 1&&&&&&&1&&\\ \vdots&&&&&&&\vdots&&\\ Sensor $N_s$&&&&&&&$N_s$&&\\ \end{tabular} \caption{File: \texttt{sensors.dat}: sensor data structure} \label{tab:dataSensors} \end{subtable}\vspace{.5cm} \begin{subtable}{0.5\textwidth} \begin{tabular}[t]{c||c|c|c}% &\texttt{x[m]}&\texttt{y[m]}&\texttt{z[m]}\\ \hline Coil 1&&&\\ \vdots&&&\\ Coil $N_c$&&& \end{tabular} \caption{File: \texttt{coilGrid.dat}:\newline coil position data structure} \label{tab:dataCoilGrid} \end{subtable}% \begin{subtable}{0.5\textwidth} \begin{tabular}[t]{c||c|c|c}% &\texttt{x[m]}&\texttt{y[m]}&\texttt{z[m]}\\ \hline Segment 1&&&\\ \vdots&&&\\ Segment $N_l$&&& \end{tabular} \caption{File: \texttt{coilTemplate.dat}:\newline template coil data structure} \label{tab:dataCoilTemplate} \end{subtable}\vspace{.5cm} \begin{subtable}{0.5\textwidth} \begin{tabular}[t]{c||c|c|c}% &\texttt{x[m]}&\texttt{y[m]}&\texttt{z[m]}\\ \hline Voxel 1&&&\\ \vdots&&&\\ Voxel $N_v$&&& \end{tabular} \caption{File: \texttt{voxelGrid.dat}:\newline voxel grid data structure} \label{tab:dataVoxelGrid} \end{subtable}% \begin{subtable}{0.5\linewidth} \begin{tabular}[t]{c||c}% &\texttt{current[A]}\\ \hline Coil 1&\\ \vdots&\\ Coil $N_c$& \end{tabular} \caption{File: \texttt{dataset.01.currents.dat}:\newline coil currents data structure} \label{tab:dataCurrents} \end{subtable}\vspace{.5cm} \begin{subtable}{\linewidth} \begin{tabular}[t]{l||c|c|c|c|c}% &\texttt{$\Delta B$[fT]}&\texttt{SensorID}&\texttt{ChannelID}&\texttt{GroupID}&\texttt{CoilNo}\\ \hline Sensor 1&&&&&1\\ \vdots&&&&&\vdots\\ Sensor $N_s$&&&&&1\\ Sensor 1&&&&&$N_c$\\ \vdots&&&&&\vdots\\ Sensor $N_s$&&&&&$N_c$ \end{tabular} \caption{File: \texttt{dataset.01.relax.dat}: sensor data table structure} \label{tab:dataRelax} \end{subtable} \end{mymarginbox} \caption{Overview of the data structures, that are used for text based datasets. \textbf{Note}: physical units are given in the brackets. The total number of sensors, coils, segments and voxel is given by $N_s$,$N_c$,$N_l$ and $N_v$ respectively.} \label{tab:dataStructure} \end{table}% This toolbox contains three setups, namely \emph{'default2D'}, \emph{'default3D'} and \emph{'realistic3D'}. These can be used to test the functionalities of the \textit{SiMRX} toolbox. We will first outline the used folder structure in section \ref{ss:setupfolderstructure} and then give a short introduction to the included setups in section \ref{ss:examplesetups}. \textbf{Please note:} Due to internal use of the provided setups for short example codes, we firmly request to not edit the setups within the \textit{SiMRX} toolbox folder. Please create a new \emph{'setups'} folder with copies of the provided setups outside the toolbox and make changes in there. This keeps the \textit{SiMRX} directories clean and preserves its integrity for our internal example scripts. \subsection{Folder structure}\label{ss:setupfolderstructure} The following folder structure is proposed for \texttt{setup} and its respective \texttt{config} datasets (see Listing \ref{code:folderStructure} as a reference and visual representation of the folder structure). For each unique setup a base folder \mypath{./setups/<my setup>}is created and all related \texttt{configs}, scripts and datasets are included in this folder. At this folders base level a \texttt{.mrxsetup} file is saved that fully describes the setup. The folder \mypath{./setups/<setup>/configs} contains subfolders for resolution, which again contain folder for all available configs. In \mypath{./setups/<setup>/configs/<resolution>/<config name>/} the \texttt{.mrxconfig} file is found as well as a result folder, dedicated for reconstruction results of this setup/config/resolution combination. The folder \mypath{./setups/<setup>/raw/} is reserved for raw data exports, that has been created by the function \texttt{exportRawSetup.m} (see section \ref{sss:rawExIm} for the raw export/import system). Finally the folder \mypath{./setups/<setup>/scripts/} contains scripts for this specific setup. This includes scripts for the creation of \texttt{.mrxsetup} and compatible \texttt{.mrxconfig} datasets. \subsection{Example setups}\label{ss:examplesetups} The respective folder \mypath{./setups/<setup>/scripts/} contain scripts for the creation of the following datasets. Furthermore the file \texttt{README.m} in \mypath{./setups/<setup>} can be executed to run all creation scripts for that setup at once. \subsubsection{Fully synthetic dataset: \emph{'default2D'} and \emph{'default3D'}}\label{subs:sytheticdataset} In \textit{SiMRX} a 2D (\emph{'default2D'}) and a 3D (\emph{'default3D'}) example is available. These can be created using the respective MATLAB scripts \texttt{createSetup.m} and \texttt{createConfigs.m} (the 2D scrips are shown in listing \ref{code:2Dsetup} and \ref{code:2Dconfig} as seen in section \ref{sss:setup} and \ref{sss:config}). A visualization of both datasets is available in figure \ref{ss:vis}. \subsubsection{A 3D dataset from formatted text files: \emph{'realistic3D'}}\label{subs:loadext} With \textit{SiMRX} it is possible to load datasets from text files, save in the \texttt{.mrxsetup} and \texttt{.mrxcfg} data structure, as well as pre-processing for simulation and reconstructions tasks. In the subfolder \mypath{./setups/realistic3D/scripts} the script \texttt{createRawDataset.m} is used to create the following files in folder \mypath{./setups/realistic3D/rawData}: \begin{mymarginbox} \begin{tabular}{@{}L{\textwidth}@{}}% \texttt{sensors.dat}\\ \texttt{coilGrid.dat}\\ \texttt{coilTemplate.dat}\\ \texttt{voxelGrid.dat}\\ \texttt{dataset.01.currents.dat}\\ \texttt{dataset.01.relax.dat} \end{tabular} \end{mymarginbox} The file structure of the created data is as follows. \paragraph{Sensor Information (Table \ref{tab:dataSensors}, File \texttt{sensors.dat}):} The table (see Table \ref{tab:dataSensors}) that is used in file \texttt{sensors.dat}) stores all necessary sensor information. Each row defines a sensor unit with properties defined by the columns as follows. Columns $1-3$ define the \texttt{x}, \texttt{y} and \texttt{z} position as a translation vector. Columns $4-6$ define the orientation of the sensors measure direction. Columns $7-9$ are used to identify the given coil: column $7$ holds an unique sensorID, column $8$ holds information about the used data channel and column $9$ is used to defined sensor groups. \paragraph{Coil Information (Table \ref{tab:dataCoilGrid}, File \texttt{coilGrid.dat} and Table \ref{tab:dataCoilTemplate}, File \texttt{coilTemplate.dat}):} The file \texttt{coilGrid.dat} contains positioning information for every activation coil in the system (see Table \ref{tab:dataCoilGrid}). Each row defines a coil position with columns $1-3$ defining the translation vector for direction \texttt{x}, \texttt{y} and \texttt{z}. As described in Sections \ref{ss:coilDiscretization} and \ref{sss:setup}, the coil is a composition of multiple conductor segments. The coils single segments are stored as a list of points in file \texttt{coilTemplate.dat} (see Table \ref{tab:dataCoilTemplate}). \paragraph{Voxel Grid Information (Table \ref{tab:dataVoxelGrid}, File: \texttt{voxelGrid.dat}):} The file \texttt{voxelGrid.dat} contains a list of used voxels in the current setup (see Table \ref{tab:dataVoxelGrid}). Again columns $1-3$ define the positions of the voxel midpoints in \texttt{x}, \texttt{y} and \texttt{z}. \paragraph{Current Information (Table \ref{tab:dataCurrents}, File: \texttt{dataset.01.currents.dat}):} The table \ref{tab:dataCurrents} is used as data scheme for file \texttt{dataset.01.currents.dat} and contains a list of currents in Ampere $\left[\si{A}\right]$ that are applied to the coils. Currently, for external data, only subsequent coil patterns are supported. This means that the number of givencurrents has to fit the number of coils as of \texttt{coilGrid.dat}. \paragraph{Measurements Information (Table \ref{tab:dataRelax}, File: \texttt{dataset.01.relax.dat}):} The data structure defined in Table \ref{tab:dataRelax}) is used in file \texttt{dataset.01.relax.dat}. The first column contains the change in the magnetic response $\Delta B \left[\si{fT}\right]$ after an coil activation (compare with equation \eqref{eq:measmagnetization}). Column $2-5$ provide information about the sensorID, channelID, groupID and the coil/current pattern that was used for that measurement. The raw dataset then found in \mypath{./setups/realistic3D/rawData} can be loaded and parsed with the scripts provided in \mypath{./setups/realistic3D/scripts}, namely \texttt{createSetup.m} and finally \texttt{createConfigs.m}. As expected, this creates a \texttt{.mrxsetup} and \texttt{.mrxcfg} file. A visualization of this dataset is available in figure \ref{ss:vis}. With \texttt{loadDataset.m} the data can be loaded and cleaned up in regards of faulty or unused sensors. Finally, with \texttt{simulateMeasurement.m} a simulated measurement is created based on the given dataset. Here the magnetic susceptibility $\chi$ and amount of the particles (in $\left[\si{mg}\right]$) are required to define the phantom properly. As for the other examples, a script \texttt{README.m} is available, that can be used to execute the individual scripts in the recommended order. \section{Structure} The \textit{SiMRX} toolbox is a modular toolkit that provides tools for MRX experiment setup configuration and simulation as well as visualization of data. \textit{SiMRX} is capable of simulating synthetic or real setups and datasets. The processes required for simulation are handled in a sequence of modular functions, i.e. the creation of voxel grids, the calculation of magnetic fields and ultimately the data acquisition at the sensors. See section \ref{ssec:simulation} for a detailed description of the simulation step and relate to Figure \ref{im:systemmatrix} for an illustration of the simulation process. For the simulation of an MRX experiment we introduce a distinction between a \texttt{setup} and \texttt{config} file. The \texttt{setup} file includes information about the number of dimensions, coil position and shape (and, if necessary, orientation), sensor position and orientation, as well as intervals that define the region of interest. The \texttt{config} file includes information about the resolution of the phantom within the region of interest, coil current patterns, as well as information what subset of coils and sensors are actively used. Both files datasets are forwarded to the simulation script, that return a matrix representation of the given setup and configuration. Detailed information on the creation of \texttt{setup} and \texttt{config} file can be found in section \ref{ss:config}. Furthermore \textit{SiMRX} provides useful tools that visualize MRX setups and internal states (section \ref{ss:vis}), and includes a tool for the creation of phantoms (section \ref{ss:phantom}). \textbf{Please note:} The \textit{SiMRX} toolbox used a unified coordinate system, where spatial information is stored in a three dimensional vector $(x,y,z)$. Any position is given in relation to a zeropoint $(0,0,0)$ and, if not specified further, is provided in $\left[\si{m}\right]$. If \textit{SiMRX} is used to implement a 2D setup, please read the paragraph about \textit{Conventions for 2D configurations} in the introduction of section \ref{para:config}.
{'timestamp': '2019-10-30T01:18:12', 'yymm': '1810', 'arxiv_id': '1810.02286', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02286'}
arxiv